3 Errors in Ruby Gems

Discussion in 'Ruby' started by Lothar Scholz, Nov 24, 2004.

  1. Hello ,

    While tracking a bug report for ArachnoRuby i found three errors in the
    0.8.1 gems code. My program sets the environment "GEM_PATH".

    1) If i use a normal windows path with backslashes in the environment
    variable, then this does not work, because Dir::glob will fail.
    So please convert all '\' to '/' this before feeding glob.

    2) For some reasons Gem::mad:gem_path will have "/lib/ruby/gems/1.8" after
    the directory that is given in GEM_PATH. Also @gem_home is set to this
    wrong directory. Don't think that it is a good default value on
    windows.

    3) Error in Gem::Specification::build_paths

    def self.build_paths
    @paths = []
    ::Gem.path.each do |gempath|
    @specs = Dir.glob("#{gempath}/specifications/*.gemspec").collect { |specfile| eval(File.read(specfile)) }.sort!
    @specs.each do |spec|
    spec.require_paths.each {|path|
    @paths << "#{gempath}/gems/#{spec.full_name}/#{path}"
    foo = "hallo"
    }
    end
    end
    end

    Here you iterate over the gem path members but always reset @specs. So
    in my case it founds the specs for in "c:/ruby/lib/ruby/gems/1.8" but
    when trying to glob "/lib/ruby/gems/1.8" it clears the @specs member.
    Later in def self.search_gempath(file) it will never find the
    specification and so never activate the gem and always return
    "false".

    And by the way, on http://rubygems.rubyforge.org/wiki/wiki.pl?UserGuide
    you talk about a RUBY_GEMS environment variable, instead of GEM_PATH.
    I think this is an also an mistake.


    --
    Best regards, emailto: scholz at scriptolutions dot com
    Lothar Scholz http://www.ruby-ide.com
    CTO Scriptolutions Ruby, PHP, Python IDE 's
    Lothar Scholz, Nov 24, 2004
    #1
    1. Advertising

  2. Lothar Scholz

    Chad Fowler Guest

    Thanks, Lothar. These will be fixed for the next release.

    Chad


    On Wed, 24 Nov 2004 11:16:51 +0900, Lothar Scholz
    <> wrote:
    > Hello ,
    >
    > While tracking a bug report for ArachnoRuby i found three errors in the
    > 0.8.1 gems code. My program sets the environment "GEM_PATH".
    >
    > 1) If i use a normal windows path with backslashes in the environment
    > variable, then this does not work, because Dir::glob will fail.
    > So please convert all '\' to '/' this before feeding glob.
    >
    > 2) For some reasons Gem::mad:gem_path will have "/lib/ruby/gems/1.8" after
    > the directory that is given in GEM_PATH. Also @gem_home is set to this
    > wrong directory. Don't think that it is a good default value on
    > windows.
    >
    > 3) Error in Gem::Specification::build_paths
    >
    > def self.build_paths
    > @paths = []
    > ::Gem.path.each do |gempath|
    > @specs = Dir.glob("#{gempath}/specifications/*.gemspec").collect { |specfile| eval(File.read(specfile)) }.sort!
    > @specs.each do |spec|
    > spec.require_paths.each {|path|
    > @paths << "#{gempath}/gems/#{spec.full_name}/#{path}"
    > foo = "hallo"
    > }
    > end
    > end
    > end
    >
    > Here you iterate over the gem path members but always reset @specs. So
    > in my case it founds the specs for in "c:/ruby/lib/ruby/gems/1.8" but
    > when trying to glob "/lib/ruby/gems/1.8" it clears the @specs member.
    > Later in def self.search_gempath(file) it will never find the
    > specification and so never activate the gem and always return
    > "false".
    >
    > And by the way, on http://rubygems.rubyforge.org/wiki/wiki.pl?UserGuide
    > you talk about a RUBY_GEMS environment variable, instead of GEM_PATH.
    > I think this is an also an mistake.
    >
    > --
    > Best regards, emailto: scholz at scriptolutions dot com
    > Lothar Scholz http://www.ruby-ide.com
    > CTO Scriptolutions Ruby, PHP, Python IDE 's
    >
    >



    --

    Chad Fowler
    http://chadfowler.com
    http://rubycentral.org
    http://rubygarden.org
    http://rubygems.rubyforge.org (over 20,000 gems served!)
    Chad Fowler, Nov 24, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tomás

    Gems -- #include <gems.hpp>

    Tomás, Mar 4, 2006, in forum: C++
    Replies:
    7
    Views:
    411
    Tomás
    Mar 5, 2006
  2. Lloyd Zusman
    Replies:
    3
    Views:
    173
    Lloyd Zusman
    Jun 21, 2005
  3. Dany Cayouette

    'private' gems/gems hierarchy

    Dany Cayouette, Nov 25, 2005, in forum: Ruby
    Replies:
    3
    Views:
    149
    Jim Weirich
    Nov 25, 2005
  4. Thaddeus L Olczyk

    Problem getting gems/listing gems. EINVAL

    Thaddeus L Olczyk, Aug 15, 2006, in forum: Ruby
    Replies:
    0
    Views:
    180
    Thaddeus L Olczyk
    Aug 15, 2006
  5. Patrick Hurley

    Creating binary gems, from source gems

    Patrick Hurley, Mar 4, 2007, in forum: Ruby
    Replies:
    0
    Views:
    128
    Patrick Hurley
    Mar 4, 2007
Loading...

Share This Page