here's a function


      def rubygems_version
         Gem::RubyGemsVersion if defined? Gem::RubyGemsVersion
       end

1.8.6
irb(main):005:0* rubygems_version
=> "1.3.0"

1.9

irb(main):001:0>       def rubygems_version
irb(main):002:1>         Gem::RubyGemsVersion if defined?
Gem::RubyGemsVersion
irb(main):003:1>       end
=> nil

hmm.


I guess it's because of the way that 1.9 'auto integrates' gems?

  irb19
>> defined? Gem::RubyGemsVersion
=> nil
>> require 'rubygems'
=> false
>> defined? Gem::RubyGemsVersion
=> nil
>> Gem::RubyGemsVersion
=> "1.3.0"
>> defined? Gem::RubyGemsVersion
=> "constant"

After this point the rubygems_version method works in 1.9


-=R
-- 
Posted via http://www.ruby-forum.com/.