Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Creating a command-line Gem

Reply
Thread Tools

Creating a command-line Gem

 
 
Eric Marthinsen
Guest
Posts: n/a
 
      06-25-2008
Hi. I'm working on creating a Ruby command-line tool that I want to
distribute as a gem. Are there any examples or references on how to do
this? I'd like to create an application similar to god or rake, where
you can enter something like "god myapp.god" and be able to enter that
command anywhere and be called without calling it like "ruby god
myapp.god" or by having to call the script that is nested deep within
the gem directory. I'm starting from scratch on this and have a very low
level of knowledge, so any help on how to do this or where to find more
information would be much appreciated. Thanks in advance.

-Eric
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Ryan Davis
Guest
Posts: n/a
 
      06-25-2008

On Jun 25, 2008, at 14:31 , Eric Marthinsen wrote:

> Hi. I'm working on creating a Ruby command-line tool that I want to
> distribute as a gem. Are there any examples or references on how to do
> this? I'd like to create an application similar to god or rake, where
> you can enter something like "god myapp.god" and be able to enter that
> command anywhere and be called without calling it like "ruby god
> myapp.god" or by having to call the script that is nested deep within
> the gem directory. I'm starting from scratch on this and have a very
> low
> level of knowledge, so any help on how to do this or where to find
> more
> information would be much appreciated. Thanks in advance.


Either use or study hoe. In hoe you put cmdline tools in a bin
directory and list them in the manifest. hoe automatically takes care
of the gem details for you.

quick start instructions:

sudo gem install hoe
sow thingy
cd thingy
poke around


 
Reply With Quote
 
 
 
 
Eric Marthinsen
Guest
Posts: n/a
 
      06-25-2008
Thanks. I'll check it out.
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
RubyGems 0.9.1 calling a gem with gem '<gem>' Austin 7873 Ruby 5 01-27-2007 10:05 PM
gem.cmd install RMagick-win32-1.9.2-mswin32.gem: Buffer error Clifford Heath Ruby 7 06-09-2006 07:02 PM
[GEM PATCH] allow gem to install bin file to different location Ara.T.Howard Ruby 0 10-26-2005 11:52 PM
ERROR: While executing gem ... (Gem::GemNotFoundException) Could not find rubygems-upodate (> 0) in the repository han Ruby 1 10-24-2005 10:28 PM
[ANN] Getopt-Declare 1.12 (gem/zip) and GGEnv (gem/zip) gga Ruby 0 07-18-2005 03:21 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57