class DflRailsConfig::Generators::GemsGeneratorsGenerator
Public Instance Methods
devise_install()
click to toggle source
# File lib/generators/dfl_rails_config/gems_generators_generator.rb, line 16 def devise_install run 'rails generate devise:install' #password length old_config = 'config.password_length = 8..72' new_config = 'config.password_length = Rails.env.production? ? 8..72 : 1..8' gsub_file 'config/initializers/devise.rb', old_config, new_config end
kaminari_views()
click to toggle source
# File lib/generators/dfl_rails_config/gems_generators_generator.rb, line 25 def kaminari_views run 'rails g kaminari:views bootstrap3' end
overcommit_install()
click to toggle source
# File lib/generators/dfl_rails_config/gems_generators_generator.rb, line 9 def overcommit_install # run 'overcommit --install' file_name = '.overcommit.yml' remove_file file_name copy_file file_name, file_name end
rspec_always_test_env()
click to toggle source
# File lib/generators/dfl_rails_config/gems_generators_generator.rb, line 43 def rspec_always_test_env gsub_file 'spec/rails_helper.rb', "ENV['RAILS_ENV'] ||= 'test'", "ENV['RAILS_ENV'] = 'test'" end
rspec_gem()
click to toggle source
# File lib/generators/dfl_rails_config/gems_generators_generator.rb, line 33 def rspec_gem file_name = 'gemfiles/rspec.rb' copy_file file_name, file_name Bundler.with_clean_env {run "bundle install --without production"} end
rspec_install()
click to toggle source
# File lib/generators/dfl_rails_config/gems_generators_generator.rb, line 39 def rspec_install run 'rails generate rspec:install' end
simple_form_install()
click to toggle source
# File lib/generators/dfl_rails_config/gems_generators_generator.rb, line 29 def simple_form_install run 'rails generate simple_form:install --bootstrap' end