[Rubygems-developers] Gem#status?
Daniel Berger
djberg96 at gmail.com
Thu Nov 13 00:26:17 EST 2008
Josh Susser wrote:
>
> On Nov 12, 2008, at 4:39 AM, Ryan Davis wrote:
>
>>
>> On Nov 11, 2008, at 10:59 , Phil Hagelberg wrote:
>>
>>> Really? String#<=> is pretty well-understood as far as I can tell.
>>
>>
>> yes... it is very well understood to be very bad for this problem:
>>
>> >> "a2" <=> "a11"
>> => 1
>> >> 2 <=> 11
>> => -1
>
>
> So use a.1 and a.11 instead of a1 and a11
>
> def test_order
> numbers = %w[ 1.0.a 1.0.a.1 1.0.a.2 1.0.a.11 1.0.b.1 1 1.0.1 1.2 ]
> versions = numbers.collect { |n| Gem::Version.new(n) }
> assert_equal numbers, versions.sort.collect { |v| v.parts.join(".") }
> end
I can't say I like where this is going.
In my opinion this is going to lead to unforeseen issues. I don't know what
those issues are exactly, I just have a very bad feeling about it.
I recommend holding off on this for now.
Regards,
Dan
More information about the Rubygems-developers
mailing list