Skip to content

Commit

Permalink
added 'destroy' to hobo bin
Browse files Browse the repository at this point in the history
  • Loading branch information
ddnexus committed Oct 18, 2010
1 parent f40a455 commit 6a4ccf2
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions hobo_support/lib/hobo_support/command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,17 @@ def run(gem, version=nil)
puts "#{gem.to_s.capitalize} Command Line Interface #{version}"

banner = %(
Usage:
hobo new <app_name> [rails_options] Creates a new Hobo Application
hobo g <generator> [ARGS] [options] Fires the hobo:<generator>
hobo --help|-h This help screen
Usage:
hobo new <app_name> [rails_options] Creates a new Hobo Application
hobo generate|g <generator> [ARGS] [options] Fires the hobo:<generator>
hobo destroy <generator> [ARGS] [options] Tries to undo generated code
hobo --help|-h This help screen
Dev Notes:
Set the HOBODEV ENV variable to your local hobo git-repository path
in order to use your local dev version instead of the installed gem.
Dev Notes:
Set the HOBODEV ENV variable to your local hobo git-repository path
in order to use your local dev version instead of the installed gem.
)
)

# for hobo developers only
setup_wizard = true
Expand Down Expand Up @@ -86,15 +87,16 @@ def run(gem, version=nil)
system "rails new #{app_name} #{ARGV * ' '} -m #{template_path}"
File.delete template_path

when /^g|generate$/
when /^(g|generate|destroy)$/
cmd = $1
if ARGV.empty?
puts "\nThe generator name is missing!\n"
puts banner
else
if ARGV.first =~ /^hobo:(\w+)$/
puts "NOTICE: You can omit the 'hobo' namespace: e.g. `hobo g #{$1} #{ARGV[1..-1] * ' '}`"
puts "NOTICE: You can omit the 'hobo' namespace: e.g. `hobo #{cmd} #{$1} #{ARGV[1..-1] * ' '}`"
end
exec "rails g hobo:#{ARGV * ' '}"
system "rails #{cmd} hobo:#{ARGV * ' '}"
end

else
Expand Down

0 comments on commit 6a4ccf2

Please sign in to comment.