Created
January 13, 2013 04:58
-
-
Save acidlabs-snippets/4522387 to your computer and use it in GitHub Desktop.
Rails application template
This file contains 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
# acid-template.rb | |
git :init | |
gitignore = run("curl https://gist.github.com/raw/3875160/5d2745ee9bcae0bb4addf4bc701d3fa9a48ce187/.gitignore") | |
file ".gitignore", gitignore | |
if yes?("Do you use RVM? (yes|no") | |
if yes?("Do you want to create a .rvmrc file for the project? (yes|no)") | |
# RVM | |
current_ruby = %x{rvm list}.match(/^=>\s+(.*)\s\[/)[1].strip | |
desired_ruby = ask("Which RVM Ruby would you like to use? [#{current_ruby}]") | |
desired_ruby = current_ruby if desired_ruby.blank? | |
gemset_name = ask("What name should the custom gemset have? [#{app_name}]") | |
gemset_name = app_name if gemset_name.blank? | |
# Create the gemset | |
run "rvm #{desired_ruby} gemset create #{gemset_name}" | |
# Let us run shell commands inside our new gemset. Use this in other template partials. | |
@rvm = "rvm use #{desired_ruby}@#{gemset_name}" | |
# Create .rvmrc | |
file '.rvmrc', @rvm | |
puts " #{@rvm}" | |
# Make the .rvmrc trusted | |
run "rvm rvmrc trust #{app_path}" | |
end | |
end | |
gem "pg" | |
gem "less-rails" | |
gem "twitter-bootstrap-rails" | |
gem "simple_form" | |
gem "select2-rails" | |
gem_group :development do | |
gem "better_errors" | |
gem "binding_of_caller" | |
gem "letter_opener" | |
gem "route66" | |
gem "rack-mini-profiler" | |
end | |
gem_group :test do | |
gem "factory_girl_rails" | |
gem "capybara" | |
gem "guard-rspec" | |
end | |
gem_group :development, :test do | |
gem "rspec-rails" | |
end | |
gem_group :assets do | |
gem 'therubyracer', :platforms => :ruby | |
end | |
run "bundle install" | |
generate("bootstrap:install") | |
layout_type = ask("Choose between fixed and fluid bootstrap layout (fixed|fluid)") | |
generate("bootstrap:layout", "application", "#{layout_type}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment