General

Profile

taw (Tomasz Wegrzanowski)

Issues

open closed Total
Assigned issues 0 0 0
Reported issues 2 5 7

Activity

02/04/2018

02:38 PM Ruby Bug #14437: Integer == doesn't work with coerce since 2.4 (and != since 1.9). Should it?
nobu (Nobuyoshi Nakada) wrote:
> `==` and `!=` have never called `coerce`.
> ...
You're right about coerce not being involved here, my theory was wrong.
Looking at the code fix_equal(x,y) when y was of non-core class used to call nu...
taw (Tomasz Wegrzanowski)

02/03/2018

10:42 PM Ruby Bug #14380: Expected transform_keys! to work just as transform_keys, but it doesn't
marcandre (Marc-Andre Lafortune) wrote:
> I raised this issue previously https://bugs.ruby-lang.org/issues/13583#note-8
> ...
I'd say that ActiveSupport is testing group for possible new ruby features,
and when getting them into ruby ...
taw (Tomasz Wegrzanowski)
10:28 PM Ruby Bug #14437 (Closed): Integer == doesn't work with coerce since 2.4 (and != since 1.9). Should it?
Here's extracted test sample:
~~~ruby
class Item
def initialize(value)
@value = value
end
def coerce(other)
[Item.new(other), self]
end
def ==(other)
Item.new("#{inspect} == #{other.inspect}")
end...
taw (Tomasz Wegrzanowski)

01/21/2018

10:24 PM Ruby Bug #14380: Expected transform_keys! to work just as transform_keys, but it doesn't
Oops, I meant to suggest this, accidentally said "values" instead of "keys" :
class Hash
def transform_keys!(&block)
replace transform_keys(&block)
end
end
taw (Tomasz Wegrzanowski)

01/20/2018

07:03 PM Ruby Bug #14380 (Closed): Expected transform_keys! to work just as transform_keys, but it doesn't
This seriously violates the Principle of Least Surprise to me:
{1 => :a, -1 => :b}.transform_keys{|k| -k} #=> {-1=>:a, 1=>:b}
{1 => :a, -1 => :b}.transform_keys!{|k| -k} # => {1=>:a}
# This fails:
ht=(1..10).map{|...
taw (Tomasz Wegrzanowski)

08/10/2015

12:34 PM Ruby Feature #11428 (Open): system/exec/etc. should to_s their argument to restore Pathname functionality as it was in 1.8
The safest way to interact with Unix shell with ruby is using `Pathname` and multi-argument system/exec/etc. commands.
In 1.8 days (and early 1.9) it was possible to do nice things like:
path = Pathname("/dev/null"); system "ls...
taw (Tomasz Wegrzanowski)

08/02/2010

05:43 AM Ruby Feature #3608: Enhancing Pathname#each_child to be lazy
> A problem of the lazy behaviour that is it opens a file descriptor when
> ...
This won't normally be a problem as directory
handler isn't opened on `to_enum`, only once
iteration actually begins.
Unless you put these enumerators ...
taw (Tomasz Wegrzanowski)

07/25/2010

12:25 PM Ruby Bug #3589: Converting Bignums to Float for equality checks is wrong
=begin
> > Integer 10 means exactly 10, not everything that would end up as 10 if rounded. 10 == 10.2 #=> false
> but 10 == 10.0. 100000000000000000000000 should == 100000000000000000000000.0
> You know, if you think it should not, ...
taw (Tomasz Wegrzanowski)

07/24/2010

01:14 PM Ruby Bug #3609 (Closed): Float Infinity comparisons in 1.9
=begin
The way <=> works on pretty much everything in Ruby
is that if a <=> b return 0, 1, or -1, it completely
determines the entire set of comparisons
a==b, a>=b, a>b, a<=b, a<b,
b<=>a, b==a, b>=a, b>a, b<=a, b<a.
(and if it...
taw (Tomasz Wegrzanowski)
10:27 AM Ruby Feature #3608 (Assigned): Enhancing Pathname#each_child to be lazy
=begin
Right now it lists entire directory, then yields
every element, that is x.each_child(&b) means x.children.each(&b).

This is too slow for directories mounted over networked file systems etc.,
and there is currently no wa...
taw (Tomasz Wegrzanowski)

Also available in: Atom