[Rubygems-developers] [ rubygems-Bugs-27698 ] Inconsistent handling of Strings versus Symbols in gemrc

noreply at rubyforge.org noreply at rubyforge.org
Sat Feb 6 20:55:08 EST 2010


Bugs item #27698, was opened at 2010-01-18 08:31
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=575&aid=27698&group_id=126

Category: `gem` commands (other)
Group: v1.3.x
>Status: Closed
>Resolution: Accepted
Priority: 3
Submitted By: J Smith (darkpanda)
>Assigned to: Eric Hodel (drbrain)
Summary: Inconsistent handling of Strings versus Symbols in gemrc

Initial Comment:
It seems that the gem command can't make up its mind whether it should be using Symbols or Strings in the gemrc configuration file.

As an example, given the following gemrc:

---
sources:
- http://gems.rubyforge.org/
- http://gems.github.com/
:gem: --no-ri --no-rdoc

Look at how the following commands execute:

[user at testbox ~]% sudo gem install activerecord
Password:
Successfully installed activerecord-2.3.5
1 gem installed
Installing ri documentation for activerecord-2.3.5...
Installing RDoc documentation for activerecord-2.3.5...
[user at testbox ~]% gem sources
*** CURRENT SOURCES ***

http://gems.rubyforge.org/

The install command is ignoring the arguments that were set using :gem and proceeded to install ri and rdoc documentation and the sources command ignored the github repository.

Now, take that same gemrc but switch up the 'sources' String for a Symbol and the :gem Symbol for a String:

---
:sources:
- http://gems.rubyforge.org/
- http://gems.github.com/
gem: --no-ri --no-rdoc

And issue the same commands to gem:

[user at testbox ~]% sudo gem install activerecord
Successfully installed activerecord-2.3.5
1 gem installed
[user at testbox ~]% gem sources                  
*** CURRENT SOURCES ***

http://gems.rubyforge.org/
http://gems.github.com/

Now the arguments set on 'gem' in the configuration file work and the so does the github repository added via :sources.

This is very wtf -- is the gemrc configuration file supposed to be using Strings as keys, Symbols as keys, both or neither? 

Here's my environment output:

RubyGems Environment:
  - RUBYGEMS VERSION: 1.3.5
  - RUBY VERSION: 1.8.6 (2009-03-31 patchlevel 368) [i686-darwin10.0.0]
  - INSTALLATION DIRECTORY: /opt/local/lib/ruby/gems/1.8
  - RUBY EXECUTABLE: /opt/local/bin/ruby
  - EXECUTABLE DIRECTORY: /opt/local/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-darwin-10
  - GEM PATHS:
     - /opt/local/lib/ruby/gems/1.8
     - /Users/test/.gem/ruby/1.8
  - GEM CONFIGURATION:
     - "gem" => "--no-ri --no-rdoc"
     - :sources => ["http://gems.rubyforge.org/", "http://gems.github.com/"]
  - REMOTE SOURCES:
     - http://gems.rubyforge.org/
     - http://gems.github.com/


----------------------------------------------------------------------

>Comment By: Eric Hodel (drbrain)
Date: 2010-02-06 17:55

Message:
Strings for command defaults, symbols for RubyGems options.

I've updated Gem::ConfigFile with more details

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=575&aid=27698&group_id=126


More information about the Rubygems-developers mailing list