Created
January 17, 2012 20:20
-
-
Save elfassy/1628663 to your computer and use it in GitHub Desktop.
Revisions
-
elfassy created this gist
Jan 17, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ #!/usr/bin/env ruby require "rubygems" # ruby1.9 doesn't "require" it though require "thor" class CloneRails < Thor include Thor::Actions desc "new NAME, TEMPLATE", "Create a new rails app based on a template app" method_options :template => "template" def new(name) puts "Copying the template..." FileUtils.cp_r(options[:template],name) FileUtils.cd(name) puts "Generating your new application..." run "rails g rename_to #{name}" FileUtils.rm_r('vendor/plugins/Rename') # commit to git run "git init" run "git add ." run "git commit -a -m 'create initial application'" puts <<-eos ============================================================================ Your new Rails application is ready to go. Don't forget to scroll up for important messages from installed generators. eos end end CloneRails.start