dannypurcell / rubycom

Turn your library into a command-line app by simply including Rubycom.
http://dannypurcell.github.io/rubycom/
MIT License
5 stars 0 forks source link

Gem executable does not evoke Rubycom.run #11

Closed dannypurcell closed 11 years ago

dannypurcell commented 11 years ago

In order to support running the base command from an installed gem Rubycom needs to detect that a loaded gemspec's executable matches $0's basename and call the run method.

Rubycom.rb:23 should be changed to something like the following

if base_file_path == $0 || Gem.loaded_specs.map{|k,s| s.executables.select{|exe| exe == base.to_s }.include?(File.basename($0)) rescue false }.reduce(&:|)

dannypurcell commented 11 years ago

Fixed in f6db708ff900f165fb031699803848d1627d4fbe