Skip to content

Instantly share code, notes, and snippets.

@radavis
Last active March 22, 2024 16:42
Show Gist options
  • Save radavis/979ce4a34e84580be243 to your computer and use it in GitHub Desktop.
Save radavis/979ce4a34e84580be243 to your computer and use it in GitHub Desktop.
Using .railsrc and a Rails Template
# ~/.railsrc
--database=postgresql
--skip-bundle
--skip-spring
--skip-test-unit
--skip-turbolinks
--template=/path/to/rails_template.rb
# ~/rails_template.rb
gem_group :development, :test do
gem "capybara"
gem "factory_girl_rails"
gem "rspec-rails", "~> 3.0"
gem "pry-rails"
gem "shoulda-matchers"
end
gem_group :test do
gem "launchy", require: false
gem "valid_attribute"
end
gem_group :production, :staging do
gem "rails_12factor"
end
scss = <<-SCSS
@import "*";
SCSS
run "echo '#{scss}' >> app/assets/stylesheets/application.scss"
run "rm app/assets/stylesheets/application.css"
run "rm README.rdoc"
run "echo '# #{@app_name.titleize}' >> README.md"
run("bundle install")
generate("rspec:install")
rake("db:create")
run "echo 'require \"capybara/rails\"' >> spec/rails_helper.rb"
git :init
git add: "."
git commit: "-a -m initial"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment