-
-
Save dotemacs/723552 to your computer and use it in GitHub Desktop.
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 characters
| #!/usr/bin/env ruby | |
| # quick and dirty way to generate a rails app | |
| my_gem_file =<<END | |
| group :development, :test do | |
| gem "rspec-rails" | |
| gem "capybara" | |
| gem "cucumber-rails" | |
| end | |
| END | |
| if ARGV.length < 1 | |
| puts | |
| puts "app name is required" | |
| puts | |
| puts "eg. #{$0} app-name" | |
| exit 1 | |
| else | |
| app = ARGV[0] | |
| system "rails new #{app}" | |
| Dir.chdir("#{app}") do | |
| # add the gems | |
| File.open("Gemfile", "a") {|f| | |
| f.puts "#{my_gem_file}" | |
| } | |
| # install the gems | |
| puts | |
| puts "Running: bundle install..." | |
| system "bundle install" | |
| puts | |
| puts "Generating specs ..." | |
| system "script/rails generate rspec:install" | |
| puts | |
| puts "Generating cukes ..." | |
| system "script/rails generate cucumber:install" | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment