Skip to content

Instantly share code, notes, and snippets.

@koshigoe
Created April 12, 2015 01:27
Show Gist options
  • Select an option

  • Save koshigoe/50bebf8d382b79ce6713 to your computer and use it in GitHub Desktop.

Select an option

Save koshigoe/50bebf8d382b79ce6713 to your computer and use it in GitHub Desktop.
Rails Application Template for Heroku app
# $ rails new <application name> -T -d postgresql --skip-spring -m heroku_rails_template.rb
if yes? 'Deploy to herok?'
gem 'rails_12factor', group: :production
end
gem 'dotenv'
if yes? 'Use slim?'
gem 'slim-rails'
run 'gem list -i html2slim > /dev/null || gem install html2slim --no-ri --no-rdoc'
run 'for i in app/views/**/*.erb; do erb2slim $i ${i%erb}slim && rm $i; done'
end
if yes? 'Use twitter bootstrap?'
gem 'bootstrap-sass'
inject_into_file 'app/assets/stylesheets/application.css', after: " */\n" do <<-'RUBY'.strip_heredoc
@import "bootstrap-sprockets";
@import "bootstrap";
RUBY
end
# gsub_file 'app/assets/stylesheets/application.css', " *= require_tree .\n", ''
# gsub_file 'app/assets/stylesheets/application.css', " *= require_self\n", ''
run 'mv app/assets/stylesheets/application.css app/assets/stylesheets/application.scss'
inject_into_file 'app/assets/javascripts/application.js', after: "//= require jquery\n" do <<-'RUBY'.strip_heredoc
//= require bootstrap-sprockets
RUBY
end
gem 'bootstrap-generators'
after_bundle do
generate 'bootstrap:install', '--force'
end
end
gem_group :development, :test do
gem 'rspec-rails'
gem 'factory_girl_rails'
gem 'pry-byebug'
gem 'pry-rails'
gem 'pry-stack_explorer'
gem 'tapp'
gem 'awesome_print'
end
gem_group :development do
gem 'quiet_assets'
gem 'annotate'
end
after_bundle do
generate 'rspec:install'
uncomment_lines 'spec/rails_helper.rb', /Dir\[Rails\.root\.join/
git :init
git add: "."
git commit: "-m 'First commit!'"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment