How do I setup a Gem to have a binary command eg. "project newProject" that uses Thor's set of generator commands to create files etc.?
A good answer would describe how to layout the skeleton of a gem that that when run from the command line "project newProject" creates 1 file named "newProject.txt" in the directory it's run from.
I've...
I've been trying to write a small library using Thor to help assist me in quick creating new projects and sites. I wrote this small method:
def ssh(cmd)
Net::SSH.start( server_ip, user, :port => port) do |session|
session.exec cmd
end
end
to just assist me in running quick commands on remote servers when needed.
The proble...
I want to automate things like:
Creating a new Rails app with pre-selected database, git initialize it, create heroku project, commit all files etc
Upload all files in folder to another computer through ssh, but do not overwrite files
Upgrade Ubuntu, install all basic packages through apt-get
These kind of tasks.
From what I have un...
Is there a way to run a file that is a Thorfile (named rails.rb) without having to install it?
Cause initially I change the code every minute, so I don't want to be able to run that file directly without having to update it all the time.
...
I have a thor-based Ruby script, but I want to deploy it as a gem in people's bin directories that people can hit without having to do thor mytool.
So instead they'd just use mytool
Is this possible?
I know it's possible with vanilla optparse but I'd rather use Thor if possible.
Update: This is the code I'm using based on the example...
Has anyone used both:
Boson: http://tagaholic.me/2009/10/14/boson-command-your-ruby-universe.html
and
Thor: http://github.com/wycats/thor
Thor are very popular and have more followers and contributers than Boson, but Boson looks far more powerful than Thor and the architecture is very well thought out.
In Boson you:
can add method...
Is there a Thor equivalent (ruby tool) or similar scripting framework for Javascript that could be used to build scripts?
...