Skip to content

Instantly share code, notes, and snippets.

@yterajima yterajima/template.rb Secret
Last active Jun 16, 2019

Embed
What would you like to do?
template.rb
gem 'slim-rails', '~> 3.2'
gem_group :development, :test do
gem 'rspec-rails', '~> 3.8'
gem 'rubocop-rails', '~> 2.0'
end
gem_group :development do
gem 'capistrano'
gem 'capistrano-rails'
gem 'html2slim'
end
gem_group :test do
gem 'webdrivers'
end
gsub_file 'Gemfile', /^gem\s+['']coffee-rails[''].*$/, ''
gsub_file 'Gemfile', /^\s+gem\s+['']chromedriver-helper[''].*$/, ''
initializer 'generators.rb', <<-CODE
Rails.application.config.generators do |g|
g.assets false
g.helper false
g.jbuilder false
g.template_engine = :slim
g.test_framework :rspec, controller_specs: false, view_specs: false, routing_specs: false, request_specs: false
end
CODE
initializer 'sass.rb', <<-CODE
Rails.application.config.sass.preferred_syntax = :sass
CODE
file '.rubocop.yml', <<-CODE
require: rubocop-rails
Rails/UnknownEnv:
Environments:
- production
- development
- test
- staging
Style/AsciiComments:
Enabled: false
Style/ClassAndModuleChildren:
Enabled: false
Style/Documentation:
Enabled: false
Metrics/LineLength:
Max: 120
Metrics/MethodLength:
Max: 20
CODE
after_bundle do
generate 'rspec:install'
run 'bundle exec erb2slim app/views app/views -d'
run 'bundle exec rubocop --auto-gen-config'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.