lib/suspenders/app_builder.rb in welaika-suspenders-2.22.0 vs lib/suspenders/app_builder.rb in welaika-suspenders-2.23.0
- old
+ new
@@ -18,10 +18,25 @@
def readme
template 'README.md.erb', 'README.md'
end
+ def gitignore
+ copy_file "suspenders_gitignore", ".gitignore"
+ end
+
+ def gemfile
+ template "Gemfile.erb", "Gemfile"
+ end
+
+ def setup_rack_mini_profiler
+ copy_file(
+ "rack_mini_profiler.rb",
+ "config/initializers/rack_mini_profiler.rb",
+ )
+ end
+
def raise_on_missing_assets_in_test
inject_into_file(
"config/environments/test.rb",
"\n config.assets.raise_runtime_errors = true",
after: "Rails.application.configure do",
@@ -227,15 +242,10 @@
def create_database
bundle_command 'exec rake db:create db:migrate'
end
- def replace_gemfile
- remove_file 'Gemfile'
- template 'Gemfile.erb', 'Gemfile'
- end
-
def set_ruby_to_version_being_used
create_file '.ruby-version', "#{Suspenders::RUBY_VERSION}\n"
end
def create_ruby_gemset_file
@@ -334,18 +344,10 @@
"config.active_job.queue_adapter = :delayed_job"
)
configure_environment "test", "config.active_job.queue_adapter = :inline"
end
- def fix_i18n_deprecation_warning
- config = <<-RUBY
- config.i18n.enforce_available_locales = true
- RUBY
-
- inject_into_class 'config/application.rb', 'Application', config
- end
-
def generate_rspec
generate 'rspec:install'
end
def configure_puma
@@ -360,13 +362,11 @@
remove_file 'app/assets/stylesheets/application.css'
copy_file 'application.sass',
'app/assets/stylesheets/application.sass'
end
- def gitignore_files
- remove_file '.gitignore'
- copy_file 'suspenders_gitignore', '.gitignore'
+ def setup_default_directories
[
'app/forms',
'app/decorators',
'app/queries',
'app/services',
@@ -381,11 +381,10 @@
'spec/fixtures',
'spec/support/matchers',
'spec/support/mixins',
'spec/support/shared_examples'
].each do |dir|
- run "mkdir #{dir}"
- run "touch #{dir}/.keep"
+ empty_directory_with_keep_file dir
end
end
def copy_dotfiles
directory("dotfiles", ".")