railman 0.6.20 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -1
  3. data/lib/railman/cli.rb +7 -0
  4. data/lib/railman/version.rb +1 -1
  5. data/templates/rails_app/.ruby-version +1 -1
  6. data/templates/rails_app/Gemfile +18 -10
  7. data/templates/rails_app/README.md +1 -12
  8. data/templates/rails_app/app/assets/config/manifest.js +3 -0
  9. data/templates/rails_app/app/assets/javascripts/cable.js +13 -0
  10. data/templates/rails_app/app/{jobs → assets/javascripts/channels}/.keep +0 -0
  11. data/templates/rails_app/app/channels/application_cable/channel.rb +4 -0
  12. data/templates/rails_app/app/channels/application_cable/connection.rb +4 -0
  13. data/templates/rails_app/app/javascript/packs/application.js +17 -0
  14. data/templates/rails_app/app/javascript/packs/hello.vue +11 -0
  15. data/templates/rails_app/app/jobs/application_job.rb +2 -0
  16. data/templates/rails_app/app/models/application_record.rb +3 -0
  17. data/templates/rails_app/app/views/layouts/application.html.erb.tt +7 -4
  18. data/templates/rails_app/app/views/layouts/mailer.html.erb +5 -1
  19. data/templates/rails_app/bin/rails +6 -1
  20. data/templates/rails_app/bin/rake +5 -0
  21. data/templates/rails_app/bin/setup +21 -12
  22. data/templates/rails_app/bin/spring +17 -0
  23. data/templates/rails_app/bin/update +28 -0
  24. data/templates/rails_app/bin/webpack +19 -0
  25. data/templates/rails_app/bin/webpack-dev-server +27 -0
  26. data/templates/rails_app/bin/webpack-watcher +10 -0
  27. data/templates/rails_app/bin/yarn +10 -0
  28. data/templates/rails_app/config/application.rb.tt +1 -12
  29. data/templates/rails_app/config/cable.yml.tt +10 -0
  30. data/templates/rails_app/config/database.yml.tt +11 -22
  31. data/templates/rails_app/config/environment.rb +1 -1
  32. data/templates/rails_app/config/environments/development.rb +26 -13
  33. data/templates/rails_app/config/environments/production.rb.tt +40 -21
  34. data/templates/rails_app/config/environments/test.rb +6 -6
  35. data/templates/rails_app/config/initializers/application_controller_renderer.rb +6 -0
  36. data/templates/rails_app/config/initializers/assets.rb +6 -3
  37. data/templates/rails_app/config/initializers/cookies_serializer.rb +2 -0
  38. data/templates/rails_app/config/initializers/new_framework_defaults.rb +25 -0
  39. data/templates/rails_app/config/initializers/wrap_parameters.rb +2 -2
  40. data/templates/rails_app/config/puma.rb +76 -0
  41. data/templates/rails_app/config/secrets.yml +18 -6
  42. data/templates/rails_app/config/server/nginx.conf.tt +1 -1
  43. data/templates/rails_app/config/spring.rb +6 -0
  44. data/templates/rails_app/config/webpack/development.js +30 -0
  45. data/templates/rails_app/config/webpack/production.js +23 -0
  46. data/templates/rails_app/config/webpack/shared.js +80 -0
  47. data/templates/rails_app/db/seeds.rb +3 -3
  48. data/templates/rails_app/package.json.tt +28 -0
  49. data/templates/rails_app/{app/models/.keep → public/apple-touch-icon-precomposed.png} +0 -0
  50. data/templates/rails_app/{vendor/assets/javascripts/.keep → public/apple-touch-icon.png} +0 -0
  51. data/templates/rails_app/public/robots.txt +0 -4
  52. data/templates/rails_app/test/application_system_test_case.rb +5 -0
  53. data/templates/rails_app/{vendor/assets/stylesheets → test/system}/.keep +0 -0
  54. data/templates/rails_app/vendor/.keep +0 -0
  55. metadata +32 -10
  56. data/templates/rails_app/bin/unicorn +0 -16
  57. data/templates/rails_app/bin/unicorn_rails +0 -16
  58. data/templates/rails_app/config/unicorn.rb.tt +0 -50
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 81b146fe0aebc04081fa6ba60ce66367cc6b081c
4
- data.tar.gz: 82d2d9942202dc7c0d7d5a35f8f2f9d7982364bf
3
+ metadata.gz: 831f6c86324fa45701b49f8f59732166235d869f
4
+ data.tar.gz: b559cb8e524d8cbd40ae144dbb48087ed5ff2b3a
5
5
  SHA512:
6
- metadata.gz: 2896ce282db3525998fdbe1a37bc286934c6691eac4e6f21b200e1c2e08fe8ddc9f3a2e24fea4f76dec032c695e35547582138ededc1fcc3b9f6dc2f3113b1d6
7
- data.tar.gz: 1b16c8a133f7501d234d1369ba7b5f41f40c5bdc22c6a496e8f62272db9ff75b81f725d0f388ee3e16aeed46e2e86a4c53cddf693147d46720102c33d7043daa
6
+ metadata.gz: 57f9a7428a8d4f74e40d47b5857f39c2d515e5fd838d37b2bac5e596bd0029d1e98a9805a5d20b10d89821ec54476eabaaed718f31a379bd7a27782d7c2ff460
7
+ data.tar.gz: 2dcd5ce5f29c26575bacda37c5f9c47138c9cb9bca1d6cbbea7399be9b36507f199a8ff084bbc976f87f9c8f478766903f58f7a6413e654be7a81899fb51a014
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.3.0
1
+ 2.3.3
data/lib/railman/cli.rb CHANGED
@@ -91,6 +91,13 @@ module Railman
91
91
  template "rails_app/.env.example.test.tt", "#{@config.app_name}/.env.example.test"
92
92
  else
93
93
  directory "rails_app", @config.app_name, exclude_pattern: /home_controller|index\.html\.erb/
94
+ # delete files that shouldn't exist in the new version
95
+ remove_file "#{@config.app_name}/config/unicorn.rb"
96
+ remove_file "#{@config.app_name}/bin/unicorn"
97
+ remove_file "#{@config.app_name}/bin/unicorn_rails"
98
+ remove_file "#{@config.app_name}/app/jobs/.keep"
99
+ remove_file "#{@config.app_name}/app/models/.keep"
100
+ remove_dir "#{@config.app_name}/vendor/assets"
94
101
  end
95
102
  save_config(@config)
96
103
  Dir.chdir @config.app_name do
@@ -1,3 +1,3 @@
1
1
  module Railman
2
- VERSION = '0.6.20'
2
+ VERSION = '1.0.0'
3
3
  end
@@ -1 +1 @@
1
- 2.1.5
1
+ 2.3.3
@@ -1,36 +1,45 @@
1
1
  source 'https://rubygems.org'
2
2
  source 'https://rails-assets.org'
3
3
 
4
+ git_source(:github) do |repo_name|
5
+ repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
6
+ "https://github.com/#{repo_name}.git"
7
+ end
8
+
4
9
  gem 'dotenv-rails', '2.1.1', require: 'dotenv/rails-now' # load ENV from .env
5
10
 
6
- gem 'rails', '4.2.7.1'
11
+ gem 'rails', '~> 5.1.0.beta1'
7
12
  gem 'pg', '0.18.2'
8
13
 
9
14
  gem 'semantic-rails-ui' # semantic-ui + simple_form + rails helpers
10
15
 
16
+ gem 'webpacker', github: 'rails/webpacker'
17
+
11
18
  gem 'hiredis', '0.6.1'
12
19
  gem 'redis', '3.3.1', require: %w(redis redis/connection/hiredis)
13
- gem 'redis-namespace', '1.5.2'
14
20
  gem 'redis-rails', '5.0.1'
15
21
 
16
22
  gem 'sidekiq', '4.1.1' # backgroud jobs
17
23
  gem 'sidekiq-scheduler', '2.0.6' # scheduled background jobs
18
24
  gem 'redis-namespace', '1.5.2' # share same redis instance for multiple applications
19
- gem 'sinatra', '1.4.6', :require => false # for sidekiq-web
25
+ gem 'sinatra', '2.0.0.beta2', :require => false # for sidekiq-web
20
26
 
21
- gem 'unicorn', '4.8.3' # use unicorn as production server
22
- gem 'unicorn-rails', '1.1.0' # use unicorn as local server
27
+ gem 'puma', '~> 3.7'
23
28
 
24
29
  gem 'railman-deployment', '~> 0.2' # capistrano deployment
25
30
 
26
- gem 'exception_notification', '4.1.2' # exception notification per email
31
+ gem 'exception_notification', '4.2.1' # exception notification per email
27
32
 
28
33
  gem 'lograge', '~> 0.4.1' # one-line-per-request log messages
29
34
 
30
35
  group :development do
31
- gem 'annotate', '~> 2.7.1' # add comments to models with db column information
32
36
  gem 'better_errors' # better error pages in development
33
37
  gem 'binding_of_caller' # repl on the error page
38
+ gem 'listen', '>= 3.0.5', '< 3.2'
39
+ # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
40
+ gem 'spring'
41
+ gem 'spring-watcher-listen', '~> 2.0.0'
42
+ gem 'annotate', '~> 2.7.1' # add comments to models with db column information
34
43
  gem 'letter_opener', '1.4.1' # for email tests in development
35
44
  # gem 'rack-mini-profiler'
36
45
  # gem 'flamegraph' # mini-profiler flamegraph extension (?pp=flamegraph)
@@ -41,12 +50,11 @@ group :test do
41
50
  gem 'minitest-screenshot-reporter', '0.0.2' # generate screenshots on capybara errors
42
51
  gem 'simplecov', require: false # generate coverage reports
43
52
  gem 'simplecov-rcov', '0.2.3', require: false # generate coverage reports for jenkins
44
- gem 'capybara', '2.6.0' # dsl for browser tests
53
+ gem 'capybara', '2.12.1' # dsl for browser tests
45
54
  gem 'capybara_minitest_spec', '1.0.5' # capybara rspec-style matchers (must_have...)
46
- gem 'selenium-webdriver', '2.49.0' # use real browser for webtests
55
+ gem 'selenium-webdriver', '3.2.2' # use real browser for webtests
47
56
  gem 'poltergeist', '1.8.1' # headless tests with phantom.js
48
57
  gem 'database_cleaner', '1.5.2' # cleanup test database after every integration test
49
- gem 'nokogiri', '1.6.8' # todo problems installing 1.6.8.1 on mac
50
58
  end
51
59
 
52
60
  # put additional application-specific gems to Gemfile.local
@@ -1,4 +1,4 @@
1
- ## README
1
+ # README
2
2
 
3
3
  This README would normally document whatever steps are necessary to get the
4
4
  application up and running.
@@ -22,14 +22,3 @@ Things you may want to cover:
22
22
  * Deployment instructions
23
23
 
24
24
  * ...
25
-
26
-
27
- Please feel free to use a different markup language if you do not plan to run
28
- <tt>rake doc:app</tt>.
29
-
30
-
31
- ## How-Tos
32
-
33
- ### Add executable to bin
34
-
35
- bundle binstubs some-gem-name
@@ -0,0 +1,3 @@
1
+ //= link_tree ../images
2
+ //= link_directory ../javascripts .js
3
+ //= link_directory ../stylesheets .css
@@ -0,0 +1,13 @@
1
+ // Action Cable provides the framework to deal with WebSockets in Rails.
2
+ // You can generate new channels where WebSocket features live using the `rails generate channel` command.
3
+ //
4
+ //= require action_cable
5
+ //= require_self
6
+ //= require_tree ./channels
7
+
8
+ (function() {
9
+ this.App || (this.App = {});
10
+
11
+ App.cable = ActionCable.createConsumer();
12
+
13
+ }).call(this);
@@ -0,0 +1,4 @@
1
+ module ApplicationCable
2
+ class Channel < ActionCable::Channel::Base
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module ApplicationCable
2
+ class Connection < ActionCable::Connection::Base
3
+ end
4
+ end
@@ -0,0 +1,17 @@
1
+ // This file is automatically compiled by Webpack, along with any other files
2
+ // present in this directory. You're encouraged to place your actual application logic in
3
+ // a relevant structure within app/javascript and only use these pack files to reference
4
+ // that code so it'll be compiled.
5
+ //
6
+ // To reference this file, add <%= javascript_pack_tag 'application' %> to the appropriate
7
+ // layout file, like app/views/layouts/application.html.erb
8
+
9
+ import Vue from 'vue'
10
+ import Hello from './hello.vue'
11
+
12
+ new Vue({
13
+ el: '#app',
14
+ template: '<Hello/>',
15
+ components: { Hello }
16
+ });
17
+
@@ -0,0 +1,11 @@
1
+ <template>
2
+ <div class="hello">
3
+ Hello Igor, hier is your Vue.js!
4
+ </div>
5
+ </template>
6
+
7
+ <style>
8
+ .hello {
9
+ border: 2px solid lightgray;
10
+ }
11
+ </style>
@@ -0,0 +1,2 @@
1
+ class ApplicationJob < ActiveJob::Base
2
+ end
@@ -0,0 +1,3 @@
1
+ class ApplicationRecord < ActiveRecord::Base
2
+ self.abstract_class = true
3
+ end
@@ -7,8 +7,10 @@
7
7
  <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
8
8
 
9
9
  <title><%= @config.class_name %></title>
10
- <%%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
11
- <%%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
10
+ <%%= csrf_meta_tags %>
11
+
12
+ <%%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': true %>
13
+ <%%= javascript_include_tag 'application', 'data-turbolinks-track': true %>
12
14
 
13
15
  <style data-turbolinks-track="true"><%%= yield :stylesheets %></style>
14
16
 
@@ -18,14 +20,15 @@
18
20
  <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
19
21
  <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
20
22
  <![endif]-->
21
-
22
- <%%= csrf_meta_tags %>
23
23
  </head>
24
24
  <body>
25
25
  <div id="content">
26
26
  <%%= ui_flash_messages %>
27
27
  <%%= content_for?(:content) ? yield(:content) : yield %>
28
+
29
+ <div id='app'></div>
28
30
  </div>
31
+ <%= javascript_pack_tag 'application' %>
29
32
  <script>
30
33
  window.current_language = "<%%= I18n.locale %>";
31
34
  window.date_format = "<%%= I18n.t('date.formats.datepicker') %>";
@@ -1,8 +1,12 @@
1
1
  <!DOCTYPE html>
2
2
  <html>
3
3
  <head>
4
- <meta content='text/html; charset=UTF-8' http-equiv='Content-Type' />
4
+ <meta content='text/html; charset=UTF-8' http-equiv='Content-Type'/>
5
+ <style>
6
+ /* Email styles need to be inline */
7
+ </style>
5
8
  </head>
9
+
6
10
  <body>
7
11
  <%= yield %>
8
12
  </body>
@@ -1,4 +1,9 @@
1
1
  #!/usr/bin/env ruby
2
- APP_PATH = File.expand_path('../../config/application', __FILE__)
2
+ begin
3
+ load File.expand_path('../spring', __FILE__)
4
+ rescue LoadError => e
5
+ raise unless e.message.include?('spring')
6
+ end
7
+ APP_PATH = File.expand_path('../config/application', __dir__)
3
8
  require_relative '../config/boot'
4
9
  require 'rails/commands'
@@ -1,4 +1,9 @@
1
1
  #!/usr/bin/env ruby
2
+ begin
3
+ load File.expand_path('../spring', __FILE__)
4
+ rescue LoadError => e
5
+ raise unless e.message.include?('spring')
6
+ end
2
7
  require_relative '../config/boot'
3
8
  require 'rake'
4
9
  Rake.application.run
@@ -1,29 +1,38 @@
1
1
  #!/usr/bin/env ruby
2
2
  require 'pathname'
3
+ require 'fileutils'
4
+ include FileUtils
3
5
 
4
6
  # path to your application root.
5
- APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
7
+ APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
6
8
 
7
- Dir.chdir APP_ROOT do
9
+ def system!(*args)
10
+ system(*args) || abort("\n== Command #{args} failed ==")
11
+ end
12
+
13
+ chdir APP_ROOT do
8
14
  # This script is a starting point to setup your application.
9
- # Add necessary setup steps to this file:
15
+ # Add necessary setup steps to this file.
16
+
17
+ puts '== Installing dependencies =='
18
+ system! 'gem install bundler --conservative'
19
+ system('bundle check') || system!('bundle install')
20
+
21
+ # Install JavaScript dependencies if using Yarn
22
+ # system('bin/yarn')
10
23
 
11
- puts "== Installing dependencies =="
12
- system "gem install bundler --conservative"
13
- system "bundle check || bundle install"
14
24
 
15
25
  # puts "\n== Copying sample files =="
16
- # unless File.exist?("config/database.yml")
17
- # system "cp config/database.yml.sample config/database.yml"
26
+ # unless File.exist?('config/database.yml')
27
+ # cp 'config/database.yml.sample', 'config/database.yml'
18
28
  # end
19
29
 
20
30
  puts "\n== Preparing database =="
21
- system "bin/rake db:setup"
31
+ system! 'bin/rails db:setup'
22
32
 
23
33
  puts "\n== Removing old logs and tempfiles =="
24
- system "rm -f log/*"
25
- system "rm -rf tmp/cache"
34
+ system! 'bin/rails log:clear tmp:clear'
26
35
 
27
36
  puts "\n== Restarting application server =="
28
- system "touch tmp/restart.txt"
37
+ system! 'bin/rails restart'
29
38
  end
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # This file loads spring without using Bundler, in order to be fast.
4
+ # It gets overwritten when you run the `spring binstub` command.
5
+
6
+ unless defined?(Spring)
7
+ require 'rubygems'
8
+ require 'bundler'
9
+
10
+ lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read)
11
+ spring = lockfile.specs.detect { |spec| spec.name == "spring" }
12
+ if spring
13
+ Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path
14
+ gem 'spring', spring.version
15
+ require 'spring/binstub'
16
+ end
17
+ end
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env ruby
2
+ require 'pathname'
3
+ require 'fileutils'
4
+ include FileUtils
5
+
6
+ # path to your application root.
7
+ APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
8
+
9
+ def system!(*args)
10
+ system(*args) || abort("\n== Command #{args} failed ==")
11
+ end
12
+
13
+ chdir APP_ROOT do
14
+ # This script is a way to update your development environment automatically.
15
+ # Add necessary update steps to this file.
16
+
17
+ puts '== Installing dependencies =='
18
+ system! 'gem install bundler --conservative'
19
+ system('bundle check') || system!('bundle install')
20
+ puts "\n== Updating database =="
21
+ system! 'bin/rails db:migrate'
22
+
23
+ puts "\n== Removing old logs and tempfiles =="
24
+ system! 'bin/rails log:clear tmp:clear'
25
+
26
+ puts "\n== Restarting application server =="
27
+ system! 'bin/rails restart'
28
+ end
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env ruby
2
+ require 'shellwords'
3
+
4
+ ENV['RAILS_ENV'] ||= 'development'
5
+ RAILS_ENV = ENV['RAILS_ENV']
6
+
7
+ ENV['NODE_ENV'] ||= RAILS_ENV
8
+ NODE_ENV = ENV['NODE_ENV']
9
+
10
+ APP_PATH = File.expand_path('../', __dir__)
11
+ ESCAPED_APP_PATH = APP_PATH.shellescape
12
+
13
+ SET_NODE_PATH = "NODE_PATH=#{ESCAPED_APP_PATH}/node_modules"
14
+ WEBPACK_BIN = "./node_modules/webpack/bin/webpack.js"
15
+ WEBPACK_CONFIG = "#{ESCAPED_APP_PATH}/config/webpack/#{NODE_ENV}.js"
16
+
17
+ Dir.chdir(APP_PATH) do
18
+ exec "#{SET_NODE_PATH} #{WEBPACK_BIN} --config #{WEBPACK_CONFIG} #{ARGV.join(" ")}"
19
+ end
@@ -0,0 +1,27 @@
1
+ #!/usr/bin/env ruby
2
+ require 'shellwords'
3
+
4
+ ENV['RAILS_ENV'] ||= 'development'
5
+ RAILS_ENV = ENV['RAILS_ENV']
6
+
7
+ ENV['NODE_ENV'] ||= RAILS_ENV
8
+ NODE_ENV = ENV['NODE_ENV']
9
+
10
+ APP_PATH = File.expand_path('../', __dir__)
11
+ ESCAPED_APP_PATH = APP_PATH.shellescape
12
+
13
+ SET_NODE_PATH = "NODE_PATH=#{ESCAPED_APP_PATH}/node_modules"
14
+ WEBPACKER_BIN = "./node_modules/.bin/webpack-dev-server"
15
+ WEBPACK_CONFIG = "#{ESCAPED_APP_PATH}/config/webpack/#{NODE_ENV}.js"
16
+
17
+ # Warn the user if the configuration is not set
18
+ RAILS_ENV_CONFIG = File.join("config", "environments", "#{RAILS_ENV}.rb")
19
+
20
+ # Look into the environment file for a non-commented variable declaration
21
+ unless File.foreach(File.join(APP_PATH, RAILS_ENV_CONFIG)).detect { |line| line.match(/^\s*[^#]*config\.x\.webpacker\[\:dev_server_host\].*=/) }
22
+ puts "Warning: if you want to use webpack-dev-server, you need to tell Webpacker to serve asset packs from it. Please set config.x.webpacker[:dev_server_host] in #{RAILS_ENV_CONFIG}.\n\n"
23
+ end
24
+
25
+ Dir.chdir(APP_PATH) do
26
+ exec "#{SET_NODE_PATH} #{WEBPACKER_BIN} --config #{WEBPACK_CONFIG} --content-base #{ESCAPED_APP_PATH}/public/packs #{ARGV.join(" ")}"
27
+ end
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ ENV['RAILS_ENV'] ||= 'development'
4
+ ENV['NODE_ENV'] ||= ENV['RAILS_ENV']
5
+
6
+ BIN_PATH = File.expand_path('.', __dir__)
7
+
8
+ Dir.chdir(BIN_PATH) do
9
+ exec "./webpack --watch --progress --color #{ARGV.join(" ")}"
10
+ end
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env ruby
2
+ VENDOR_PATH = File.expand_path('..', __dir__)
3
+ Dir.chdir(VENDOR_PATH) do
4
+ begin
5
+ exec "yarnpkg #{ARGV.join(" ")}"
6
+ rescue Errno::ENOENT
7
+ puts "Yarn executable was not detected in the system."
8
+ puts "Download Yarn at https://yarnpkg.com/en/docs/install"
9
+ end
10
+ end
@@ -1,4 +1,4 @@
1
- require File.expand_path('../boot', __FILE__)
1
+ require_relative 'boot'
2
2
 
3
3
  require 'rails/all'
4
4
 
@@ -11,16 +11,5 @@ module <%= @config.class_name %>
11
11
  # Settings in config/environments/* take precedence over those specified here.
12
12
  # Application configuration should go into files in config/initializers
13
13
  # -- all .rb files in that directory are automatically loaded.
14
-
15
- # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
16
- # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
17
- # config.time_zone = 'Central Time (US & Canada)'
18
-
19
- # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
20
- # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
21
- # config.i18n.default_locale = :de
22
-
23
- # Do not swallow errors in after_commit/after_rollback callbacks.
24
- config.active_record.raise_in_transactional_callbacks = true
25
14
  end
26
15
  end
@@ -0,0 +1,10 @@
1
+ development:
2
+ adapter: async
3
+
4
+ test:
5
+ adapter: async
6
+
7
+ production:
8
+ adapter: redis
9
+ url: redis://<%= ENV.fetch('REDIS_SERVER') %>
10
+ channel_prefix: <%= @config.app_name %>_production
@@ -1,32 +1,21 @@
1
- development:
1
+ default: &default
2
2
  adapter: postgresql
3
3
  encoding: unicode
4
- port: 5432
5
4
  host: localhost
6
- database: <%= @config.app_name %>_development
7
- username: <%%= ENV['DB_USER'] %>
8
- password: <%%= ENV['DB_PASSWORD'] %>
9
- pool: 5
5
+ port: 5432
6
+ username: <%= ENV['DB_USER'] %>
7
+ password: <%= ENV['DB_PASSWORD'] %>
8
+ pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
10
9
  timeout: 5000
11
10
 
11
+ development:
12
+ <<: *default
13
+ database: <%= @config.app_name %>_development
14
+
12
15
  test:
13
- adapter: postgresql
14
- encoding: unicode
15
- port: 5432
16
- host: localhost
16
+ <<: *default
17
17
  database: <%= @config.app_name %>_test
18
- username: <%%= ENV['DB_USER'] %>
19
- password: <%%= ENV['DB_PASSWORD'] %>
20
- pool: 5
21
- timeout: 5000
22
18
 
23
19
  production:
24
- adapter: postgresql
25
- encoding: unicode
26
- port: 5432
27
- host: localhost
20
+ <<: *default
28
21
  database: <%= @config.app_name %>_production
29
- username: <%%= ENV['DB_USER'] %>
30
- password: <%%= ENV['DB_PASSWORD'] %>
31
- pool: 15
32
- timeout: 5000
@@ -1,5 +1,5 @@
1
1
  # Load the Rails application.
2
- require File.expand_path('../application', __FILE__)
2
+ require_relative 'application'
3
3
 
4
4
  # Initialize the Rails application.
5
5
  Rails.application.initialize!
@@ -1,4 +1,7 @@
1
1
  Rails.application.configure do
2
+ # Make javascript_pack_tag load assets from webpack-dev-server.
3
+ config.x.webpacker[:dev_server_host] = "http://localhost:8080"
4
+
2
5
  # Settings specified here will take precedence over those in config/application.rb.
3
6
 
4
7
  # In the development environment your application's code is reloaded on
@@ -9,13 +12,28 @@ Rails.application.configure do
9
12
  # Do not eager load code on boot.
10
13
  config.eager_load = false
11
14
 
12
- # Show full error reports and disable caching.
13
- config.consider_all_requests_local = true
14
- config.action_controller.perform_caching = false
15
+ # Show full error reports.
16
+ config.consider_all_requests_local = true
17
+
18
+ # Enable/disable caching. By default caching is disabled.
19
+ if Rails.root.join('tmp/caching-dev.txt').exist?
20
+ config.action_controller.perform_caching = true
21
+
22
+ config.cache_store = :memory_store
23
+ config.public_file_server.headers = {
24
+ 'Cache-Control' => "public, max-age=#{2.days.seconds.to_i}"
25
+ }
26
+ else
27
+ config.action_controller.perform_caching = false
28
+
29
+ config.cache_store = :null_store
30
+ end
15
31
 
16
32
  # Don't care if the mailer can't send.
17
33
  config.action_mailer.raise_delivery_errors = false
18
34
 
35
+ config.action_mailer.perform_caching = false
36
+
19
37
  # Print deprecation notices to the Rails logger.
20
38
  config.active_support.deprecation = :log
21
39
 
@@ -27,18 +45,9 @@ Rails.application.configure do
27
45
  # number of complex assets.
28
46
  config.assets.debug = true
29
47
 
30
- # Asset digests allow you to set far-future HTTP expiration dates on all assets,
31
- # yet still be able to expire them through the digest params.
32
- config.assets.digest = true
33
-
34
- # Less asset logs in development
48
+ # Suppress logger output for asset requests.
35
49
  config.assets.quiet = true
36
50
 
37
- # Adds additional error checking when serving assets at runtime.
38
- # Checks for improperly declared sprockets dependencies.
39
- # Raises helpful error messages.
40
- config.assets.raise_runtime_errors = true
41
-
42
51
  # Raises error for missing translations
43
52
  # config.action_view.raise_on_missing_translations = true
44
53
 
@@ -48,4 +57,8 @@ Rails.application.configure do
48
57
  # config.active_job.queue_adapter = :sidekiq
49
58
 
50
59
  config.action_mailer.default_url_options = { host: 'http://localhost:3000' }
60
+
61
+ # Use an evented file watcher to asynchronously detect changes in source code,
62
+ # routes, locales, etc. This feature depends on the listen gem.
63
+ config.file_watcher = ActiveSupport::EventedFileUpdateChecker
51
64
  end