rocky/columnize

File lib/version.rb conflicts with other gems

pmahoney opened this issue · 3 comments

I am requesting you rename lib/version.rb to lib/columnize/version.rb to avoid possible conflicts. (Having gem-name/version.rb seems to be a convention in Ruby.)

For example, the 'version' gem also has a lib/version.rb and an arguably more legitimate claim to that name (though I do think the version gem's name is a bit unfortunate). But with both columnize and version as dependencies, I cannot load version's version.rb via the require 'version' command (since it loads columnize's first).

I'll try to look at this, next weekend.

I've just committed the change you suggested. Please test and close issue if this does it.

Thank you!

I should have included a test case.
With columnize-0.3.5 and version-1.0.0 installed: (ruby 1.9.2; using RVM but I think these are irrelevant)

$ ruby -e 'require "version"; p Version'
-e:1:in `<main>': uninitialized constant Object::Version (NameError)

$ ruby -e 'require "version"; p Columnize'
Columnize   # unintentionally loaded columnize

Now with columnize-0.3.6 and version-1.0.0:

$ ruby -e 'require "version"; p Version'
Version

$ ruby -e 'require "version"; p Columnize'
-e:1:in `<main>': uninitialized constant Object::Columnize (NameError)  # this is the expected behavior