[Rubygems-developers] Executable Ruby Scripts under a gem dir...

Chad Fowler chad at chadfowler.com
Thu Mar 18 10:02:40 EST 2004


On Thu, 18 Mar 2004, Richard Kilmer wrote:

# 
# On Mar 18, 2004, at 9:08 AM, Richard Kilmer wrote:
# 
# >
# > On Mar 18, 2004, at 7:52 AM, Chad Fowler wrote:
# >
# >>> Precisely.  We could use ':' instead of '/' perhaps, to make it look
# >>> less literal and more logical.  For example:
# >>>
# >>>   gem --run rubygems:gem_server
# >>
# >> I almost suggested the same thing.  Opinions anyone else?
# >
# > So, this would suggest that the gem (rubygems) would have an 
# > executable ruby script (gem_server) installed in it.  Where should we 
# > look for these executable scripts?
# >
# > gem-version/lib/... (lib files for library)
# > gem-version/bin/... (executable script files)
# >                 gem_server.rb -OR- gem_server
# >
# > Should we have a metadata key that specifies the executable dir? (like 
# > bin above) or just use bin every time?
# >
# 
# Responding to myself, we could have a default executable in a gem, so:
# 
# gem --run blah
# 
# Would execute a default executable script (if specified)
# 
# potential yaml could be:
# 
#    s.require_path = 'lib'
#    s.autorequire = 'jabber4r/jabber4r'
# 
# which we have now...and add:
# 
#    s.bin_path = 'bin'
#    s.execute = 'myapp' # (which looks for gem-version/bin/myapp -OR- 
# gem-version/bin/myapp.rb)
# 
# thus, myapp would be the default and the gem:myapp2 would override that 
# default executable.
# 
# thoughts?
# 
# -rich

I like it.  Then 

gem --run blah:foo

will run gemdir/blah-0.0.1/bin/foo(.rb)

Chad



More information about the Rubygems-developers mailing list