[Rubygems-developers] Change in Gem::Requirement.create("~> 1.0.0").satisfied_by? semantics?

Eric Hodel drbrain at segment7.net
Mon Nov 26 18:06:50 EST 2007


On Nov 26, 2007, at 10:54 , Todd Fisher wrote:
>   After upgrading from rubygems 0.9.4 to 0.9.5 I noticed a change in
> how the satisfied_by? method compares versions.
>
> Here's a simple example to demonstrate the change in behavior.
>
>
> 0.9.5:
>
> irb(main):001:0>  gem_list =  ["1.0.67943", "1.1.75596"]
> => ["1.0.67943", "1.1.75596"]
> irb(main):002:0> req = Gem::Requirement.create("~> 1.0.0")
> => #<Gem::Requirement:0xb7b34720 @requirements=[["~>", #<Gem::Version
> "1.0.0">]], @version=nil>
> irb(main):003:0> gem_list.select{|v| req.satisfied_by? 
> (Gem::Version.new(v))}
> => ["1.0.67943", "1.1.75596"]
>
>
> 0.9.4:
>
> irb(main):002:0> gem_list =  ["1.0.67943", "1.1.75596"]
> => ["1.0.67943", "1.1.75596"]
> irb(main):003:0>  req = Gem::Requirement.create("~> 1.0.0")
> => #<Gem::Version::Requirement:0x7fe34430 @version=nil,
> @requirements=[["~>", #<Gem::Version:0x7fe34304 @version="1.0.0">]]>
> irb(main):004:0> gem_list.select{|v| req.satisfied_by? 
> (Gem::Version.new(v))}
> => ["1.0.67943"]
> irb(main):005:0>
>
>
> Is this an intended change?

No.  Please file a bug.

--
Poor workers blame their tools. Good workers build better tools. The
best workers get their tools to do the work for them. -- Syndicate Wars




More information about the Rubygems-developers mailing list