Ryan Davis wrote:

On Aug 19, 2009, at 16:48 , Daniel Berger wrote:

On Wed, Aug 19, 2009 at 4:36 PM, Ryan Davis<ryand-r...@zenspider.com> wrote:
I just added this to Version:

 def assert_spermy expect, version
   assert_equal expect, Gem::Version.new(version).spermy_recommendation
 end

 def test_spermy_recommendation
   assert_spermy "~> 1.0", "1"
   assert_spermy "~> 1.0", "1.0"
   assert_spermy "~> 1.2", "1.2"
   assert_spermy "~> 1.2", "1.2.0"
   assert_spermy "~> 1.2", "1.2.3"
   assert_spermy "~> 1.2", "1.2.3.a.4"
 end

The idea being that tools like hoe and rubygems can use it to help recommend better dependency specifiers. Right now in hoe if you don't have a version specifier on a dependency it tells you that you should at least add "> 0"
and this would offer a vast improvement. Eventually I'd like to push
rubygems into if not deprecating then at least warning against using ">="
specifiers (when used alone).

See also:
http://blog.zenspider.com/2008/10/rubygems-howto-preventing-cata.html

I also added part of that blog post to the doco on version and pointed to it
from the top level rdoc.

Good idea, but I can't say I like the name much. I'd like to see it
changed to something like "assert_version_range".

I think you missed the point. assert_spermy is there to illustrate the API change to Version. I refactored the tests to be readable.

I understand what you're doing. I just don't like the name "assert_spermy". Can we please change it?

Regards,

Dan
_______________________________________________
Rubygems-developers mailing list
http://rubyforge.org/projects/rubygems
Rubygems-developers@rubyforge.org
http://rubyforge.org/mailman/listinfo/rubygems-developers

Reply via email to