suspenders 1.52.0 → 1.55.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/.standard.yml +2 -0
- data/.travis.yml +6 -3
- data/CONTRIBUTING.md +15 -15
- data/GOALS.md +65 -0
- data/Gemfile +1 -1
- data/NEWS.md +52 -0
- data/README.md +6 -5
- data/Rakefile +6 -5
- data/docs/heroku_deploy.md +19 -0
- data/lib/suspenders.rb +7 -0
- data/lib/suspenders/actions.rb +2 -2
- data/lib/suspenders/adapters/heroku.rb +27 -14
- data/lib/suspenders/app_builder.rb +42 -111
- data/lib/suspenders/generators/advisories_generator.rb +15 -0
- data/lib/suspenders/generators/analytics_generator.rb +1 -1
- data/lib/suspenders/generators/app_generator.rb +36 -58
- data/lib/suspenders/generators/base.rb +40 -1
- data/lib/suspenders/generators/ci_generator.rb +19 -9
- data/lib/suspenders/generators/db_optimizations_generator.rb +5 -17
- data/lib/suspenders/generators/factories_generator.rb +2 -2
- data/lib/suspenders/generators/forms_generator.rb +1 -1
- data/lib/suspenders/generators/inline_svg_generator.rb +14 -0
- data/lib/suspenders/generators/jobs_generator.rb +4 -4
- data/lib/suspenders/generators/js_driver_generator.rb +7 -4
- data/lib/suspenders/generators/json_generator.rb +1 -1
- data/lib/suspenders/generators/lint_generator.rb +5 -0
- data/lib/suspenders/generators/preloader_generator.rb +122 -0
- data/lib/suspenders/generators/production/compression_generator.rb +14 -0
- data/lib/suspenders/generators/production/deployment_generator.rb +1 -12
- data/lib/suspenders/generators/production/email_generator.rb +9 -12
- data/lib/suspenders/generators/production/manifest_generator.rb +8 -7
- data/lib/suspenders/generators/production/single_redirect.rb +15 -0
- data/lib/suspenders/generators/production/timeout_generator.rb +3 -2
- data/lib/suspenders/generators/profiler_generator.rb +35 -0
- data/lib/suspenders/generators/runner_generator.rb +48 -0
- data/lib/suspenders/generators/staging/pull_requests_generator.rb +4 -12
- data/lib/suspenders/generators/static_generator.rb +5 -1
- data/lib/suspenders/generators/stylelint_generator.rb +2 -1
- data/lib/suspenders/generators/stylesheet_base_generator.rb +7 -8
- data/lib/suspenders/generators/testing_generator.rb +3 -14
- data/lib/suspenders/version.rb +6 -6
- data/spec/adapters/heroku_spec.rb +36 -10
- data/spec/expand_json_spec.rb +89 -0
- data/spec/fakes/bin/heroku +1 -1
- data/spec/fakes/bin/hub +1 -1
- data/spec/features/advisories_spec.rb +24 -0
- data/spec/features/api_spec.rb +1 -1
- data/spec/features/ci_spec.rb +31 -0
- data/spec/features/cli_help_spec.rb +4 -4
- data/spec/features/db_optimizations_spec.rb +19 -0
- data/spec/features/heroku_spec.rb +9 -16
- data/spec/features/inline_svg_spec.rb +10 -0
- data/spec/features/lint_spec.rb +26 -0
- data/spec/features/new_project_spec.rb +40 -60
- data/spec/features/preloader_spec.rb +25 -0
- data/spec/features/production/compression_spec.rb +23 -0
- data/spec/features/production/email_spec.rb +10 -10
- data/spec/features/production/manifest_spec.rb +16 -14
- data/spec/features/production/single_redirect_spec.rb +25 -0
- data/spec/features/profiler_spec.rb +20 -0
- data/spec/features/runner_spec.rb +30 -0
- data/spec/features/staging/pull_requests_spec.rb +1 -1
- data/spec/features/static_spec.rb +17 -0
- data/spec/features/stylelint_spec.rb +7 -7
- data/spec/spec_helper.rb +3 -3
- data/spec/support/contain_json_matcher.rb +16 -10
- data/spec/support/fake_github.rb +3 -3
- data/spec/support/fake_heroku.rb +8 -8
- data/spec/support/project_files.rb +12 -0
- data/spec/support/rails_template.rb +1 -0
- data/spec/support/suspenders.rb +21 -19
- data/suspenders.gemspec +20 -20
- data/templates/Gemfile.erb +2 -10
- data/templates/_javascript.html.erb +1 -1
- data/templates/application.scss +0 -1
- data/templates/bin_auto_migrate +5 -0
- data/templates/bin_deploy +0 -2
- data/templates/bin_setup +2 -2
- data/templates/bin_setup_review_app.erb +0 -1
- data/templates/capybara_silence_puma.rb +1 -0
- data/templates/chromedriver.rb +14 -4
- data/templates/descriptions/advisories.md +5 -0
- data/templates/descriptions/analytics.md +4 -0
- data/templates/descriptions/ci.md +4 -0
- data/templates/descriptions/compression.md +4 -0
- data/templates/descriptions/db_optimizations.md +2 -0
- data/templates/descriptions/deployment.md +5 -0
- data/templates/descriptions/email.md +9 -0
- data/templates/descriptions/factories.md +12 -0
- data/templates/descriptions/force_tls.md +1 -0
- data/templates/descriptions/forms.md +1 -0
- data/templates/descriptions/inline_svg.md +2 -0
- data/templates/descriptions/jobs.md +3 -0
- data/templates/descriptions/js_driver.md +4 -0
- data/templates/descriptions/json.md +1 -0
- data/templates/descriptions/lint.md +3 -0
- data/templates/descriptions/manifest.md +2 -0
- data/templates/descriptions/preloader.md +3 -0
- data/templates/descriptions/profiler.md +7 -0
- data/templates/descriptions/pull_requests.md +4 -0
- data/templates/descriptions/runner.md +10 -0
- data/templates/descriptions/single_redirect.md +1 -0
- data/templates/descriptions/static.md +5 -0
- data/templates/descriptions/stylelint.md +3 -0
- data/templates/descriptions/stylesheet_base.md +4 -0
- data/templates/descriptions/testing.md +9 -0
- data/templates/descriptions/timeout.md +4 -0
- data/templates/descriptions/views.md +8 -0
- data/templates/errors.rb +3 -3
- data/templates/hound.yml +1 -2
- data/templates/inline_svg.rb +3 -0
- data/templates/partials/ci_simplecov.rb +14 -0
- data/templates/partials/db_optimizations_configuration.rb +7 -0
- data/templates/partials/deployment_readme.md +8 -0
- data/templates/partials/email_smtp.rb +2 -0
- data/templates/partials/profiler_readme.md +8 -0
- data/templates/partials/pull_requests_config.rb +4 -0
- data/templates/partials/runner_readme.md +31 -0
- data/templates/partials/runner_setup.rb +2 -0
- data/templates/rack_mini_profiler.rb +2 -0
- data/templates/rails_helper.rb +4 -1
- data/templates/{dotfiles/.env → sample_env} +0 -2
- data/templates/spec_helper.rb +4 -7
- data/templates/spring.rb +6 -0
- data/templates/suspenders_gitignore +1 -1
- metadata +103 -17
- data/templates/browserslist +0 -3
- data/templates/dotfiles/.ctags +0 -2
- data/templates/puma.rb +0 -28
data/templates/rails_helper.rb
CHANGED
@@ -1,7 +1,10 @@
|
|
1
1
|
ENV["RACK_ENV"] = "test"
|
2
2
|
|
3
3
|
require File.expand_path("../../config/environment", __FILE__)
|
4
|
-
|
4
|
+
|
5
|
+
if Rails.env.production?
|
6
|
+
abort("The Rails environment is running in production mode!")
|
7
|
+
end
|
5
8
|
|
6
9
|
require "rspec/rails"
|
7
10
|
|
data/templates/spec_helper.rb
CHANGED
@@ -1,9 +1,3 @@
|
|
1
|
-
if ENV.fetch("COVERAGE", false)
|
2
|
-
require "simplecov"
|
3
|
-
|
4
|
-
SimpleCov.start "rails"
|
5
|
-
end
|
6
|
-
|
7
1
|
require "webmock/rspec"
|
8
2
|
require "timecop"
|
9
3
|
|
@@ -22,7 +16,10 @@ RSpec.configure do |config|
|
|
22
16
|
config.order = :random
|
23
17
|
end
|
24
18
|
|
25
|
-
WebMock.disable_net_connect!(
|
19
|
+
WebMock.disable_net_connect!(
|
20
|
+
allow_localhost: true,
|
21
|
+
allow: "chromedriver.storage.googleapis.com"
|
22
|
+
)
|
26
23
|
|
27
24
|
# Only allow Timecop with block syntax
|
28
25
|
Timecop.safe_mode = true
|
data/templates/spring.rb
ADDED
metadata
CHANGED
@@ -1,43 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: suspenders
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.55.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- thoughtbot
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-09-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bitters
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 2.0.4
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 2.0.4
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rails
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 6.0.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 6.0.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '3.2'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: standard
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
55
69
|
description: |
|
56
70
|
Suspenders is a base Rails project that you can upgrade. It is used by
|
57
71
|
thoughtbot to get a jump start on a working app. Use Suspenders if you're in a
|
@@ -66,8 +80,10 @@ extra_rdoc_files:
|
|
66
80
|
files:
|
67
81
|
- ".gitignore"
|
68
82
|
- ".ruby-version"
|
83
|
+
- ".standard.yml"
|
69
84
|
- ".travis.yml"
|
70
85
|
- CONTRIBUTING.md
|
86
|
+
- GOALS.md
|
71
87
|
- Gemfile
|
72
88
|
- LICENSE
|
73
89
|
- NEWS.md
|
@@ -79,10 +95,12 @@ files:
|
|
79
95
|
- bin/rspec
|
80
96
|
- bin/setup
|
81
97
|
- bin/suspenders
|
98
|
+
- docs/heroku_deploy.md
|
82
99
|
- lib/suspenders.rb
|
83
100
|
- lib/suspenders/actions.rb
|
84
101
|
- lib/suspenders/adapters/heroku.rb
|
85
102
|
- lib/suspenders/app_builder.rb
|
103
|
+
- lib/suspenders/generators/advisories_generator.rb
|
86
104
|
- lib/suspenders/generators/analytics_generator.rb
|
87
105
|
- lib/suspenders/generators/app_generator.rb
|
88
106
|
- lib/suspenders/generators/base.rb
|
@@ -90,15 +108,21 @@ files:
|
|
90
108
|
- lib/suspenders/generators/db_optimizations_generator.rb
|
91
109
|
- lib/suspenders/generators/factories_generator.rb
|
92
110
|
- lib/suspenders/generators/forms_generator.rb
|
111
|
+
- lib/suspenders/generators/inline_svg_generator.rb
|
93
112
|
- lib/suspenders/generators/jobs_generator.rb
|
94
113
|
- lib/suspenders/generators/js_driver_generator.rb
|
95
114
|
- lib/suspenders/generators/json_generator.rb
|
96
115
|
- lib/suspenders/generators/lint_generator.rb
|
116
|
+
- lib/suspenders/generators/preloader_generator.rb
|
117
|
+
- lib/suspenders/generators/production/compression_generator.rb
|
97
118
|
- lib/suspenders/generators/production/deployment_generator.rb
|
98
119
|
- lib/suspenders/generators/production/email_generator.rb
|
99
120
|
- lib/suspenders/generators/production/force_tls_generator.rb
|
100
121
|
- lib/suspenders/generators/production/manifest_generator.rb
|
122
|
+
- lib/suspenders/generators/production/single_redirect.rb
|
101
123
|
- lib/suspenders/generators/production/timeout_generator.rb
|
124
|
+
- lib/suspenders/generators/profiler_generator.rb
|
125
|
+
- lib/suspenders/generators/runner_generator.rb
|
102
126
|
- lib/suspenders/generators/staging/pull_requests_generator.rb
|
103
127
|
- lib/suspenders/generators/static_generator.rb
|
104
128
|
- lib/suspenders/generators/stylelint_generator.rb
|
@@ -107,18 +131,30 @@ files:
|
|
107
131
|
- lib/suspenders/generators/views_generator.rb
|
108
132
|
- lib/suspenders/version.rb
|
109
133
|
- spec/adapters/heroku_spec.rb
|
134
|
+
- spec/expand_json_spec.rb
|
110
135
|
- spec/fakes/bin/heroku
|
111
136
|
- spec/fakes/bin/hub
|
137
|
+
- spec/features/advisories_spec.rb
|
112
138
|
- spec/features/api_spec.rb
|
139
|
+
- spec/features/ci_spec.rb
|
113
140
|
- spec/features/cli_help_spec.rb
|
141
|
+
- spec/features/db_optimizations_spec.rb
|
114
142
|
- spec/features/github_spec.rb
|
115
143
|
- spec/features/heroku_spec.rb
|
144
|
+
- spec/features/inline_svg_spec.rb
|
116
145
|
- spec/features/json_spec.rb
|
146
|
+
- spec/features/lint_spec.rb
|
117
147
|
- spec/features/new_project_spec.rb
|
148
|
+
- spec/features/preloader_spec.rb
|
149
|
+
- spec/features/production/compression_spec.rb
|
118
150
|
- spec/features/production/deployment_spec.rb
|
119
151
|
- spec/features/production/email_spec.rb
|
120
152
|
- spec/features/production/manifest_spec.rb
|
153
|
+
- spec/features/production/single_redirect_spec.rb
|
154
|
+
- spec/features/profiler_spec.rb
|
155
|
+
- spec/features/runner_spec.rb
|
121
156
|
- spec/features/staging/pull_requests_spec.rb
|
157
|
+
- spec/features/static_spec.rb
|
122
158
|
- spec/features/stylelint_spec.rb
|
123
159
|
- spec/spec_helper.rb
|
124
160
|
- spec/support/be_executable_matcher.rb
|
@@ -129,6 +165,7 @@ files:
|
|
129
165
|
- spec/support/generators.rb
|
130
166
|
- spec/support/match_contents_matcher.rb
|
131
167
|
- spec/support/project_files.rb
|
168
|
+
- spec/support/rails_template.rb
|
132
169
|
- spec/support/suspenders.rb
|
133
170
|
- suspenders.gemspec
|
134
171
|
- templates/Gemfile.erb
|
@@ -141,17 +178,43 @@ files:
|
|
141
178
|
- templates/action_mailer.rb
|
142
179
|
- templates/active_job.rb
|
143
180
|
- templates/application.scss
|
181
|
+
- templates/bin_auto_migrate
|
144
182
|
- templates/bin_deploy
|
145
183
|
- templates/bin_setup
|
146
184
|
- templates/bin_setup_review_app.erb
|
147
|
-
- templates/browserslist
|
148
185
|
- templates/bundler_audit.rake
|
186
|
+
- templates/capybara_silence_puma.rb
|
149
187
|
- templates/chromedriver.rb
|
150
188
|
- templates/circle.yml.erb
|
151
189
|
- templates/config_locales_en.yml.erb
|
190
|
+
- templates/descriptions/advisories.md
|
191
|
+
- templates/descriptions/analytics.md
|
192
|
+
- templates/descriptions/ci.md
|
193
|
+
- templates/descriptions/compression.md
|
194
|
+
- templates/descriptions/db_optimizations.md
|
195
|
+
- templates/descriptions/deployment.md
|
196
|
+
- templates/descriptions/email.md
|
197
|
+
- templates/descriptions/factories.md
|
198
|
+
- templates/descriptions/force_tls.md
|
199
|
+
- templates/descriptions/forms.md
|
200
|
+
- templates/descriptions/inline_svg.md
|
201
|
+
- templates/descriptions/jobs.md
|
202
|
+
- templates/descriptions/js_driver.md
|
203
|
+
- templates/descriptions/json.md
|
204
|
+
- templates/descriptions/lint.md
|
205
|
+
- templates/descriptions/manifest.md
|
206
|
+
- templates/descriptions/preloader.md
|
207
|
+
- templates/descriptions/profiler.md
|
208
|
+
- templates/descriptions/pull_requests.md
|
209
|
+
- templates/descriptions/runner.md
|
210
|
+
- templates/descriptions/single_redirect.md
|
211
|
+
- templates/descriptions/static.md
|
212
|
+
- templates/descriptions/stylelint.md
|
213
|
+
- templates/descriptions/stylesheet_base.md
|
214
|
+
- templates/descriptions/testing.md
|
215
|
+
- templates/descriptions/timeout.md
|
216
|
+
- templates/descriptions/views.md
|
152
217
|
- templates/dev.rake
|
153
|
-
- templates/dotfiles/.ctags
|
154
|
-
- templates/dotfiles/.env
|
155
218
|
- templates/email.rb
|
156
219
|
- templates/errors.rb
|
157
220
|
- templates/factories.rb
|
@@ -159,15 +222,25 @@ files:
|
|
159
222
|
- templates/flashes_helper.rb
|
160
223
|
- templates/hound.yml
|
161
224
|
- templates/i18n.rb
|
225
|
+
- templates/inline_svg.rb
|
162
226
|
- templates/json_encoding.rb
|
227
|
+
- templates/partials/ci_simplecov.rb
|
228
|
+
- templates/partials/db_optimizations_configuration.rb
|
229
|
+
- templates/partials/deployment_readme.md
|
230
|
+
- templates/partials/email_smtp.rb
|
231
|
+
- templates/partials/profiler_readme.md
|
232
|
+
- templates/partials/pull_requests_config.rb
|
233
|
+
- templates/partials/runner_readme.md
|
234
|
+
- templates/partials/runner_setup.rb
|
163
235
|
- templates/postgresql_database.yml.erb
|
164
|
-
- templates/puma.rb
|
165
236
|
- templates/rack_mini_profiler.rb
|
166
237
|
- templates/rails_helper.rb
|
238
|
+
- templates/sample_env
|
167
239
|
- templates/secrets.yml
|
168
240
|
- templates/shoulda_matchers_config_rspec.rb
|
169
241
|
- templates/smtp.rb
|
170
242
|
- templates/spec_helper.rb
|
243
|
+
- templates/spring.rb
|
171
244
|
- templates/stylelintrc.json
|
172
245
|
- templates/suspenders_gitignore
|
173
246
|
- templates/suspenders_layout.html.erb.erb
|
@@ -175,7 +248,7 @@ homepage: http://github.com/thoughtbot/suspenders
|
|
175
248
|
licenses:
|
176
249
|
- MIT
|
177
250
|
metadata: {}
|
178
|
-
post_install_message:
|
251
|
+
post_install_message:
|
179
252
|
rdoc_options:
|
180
253
|
- "--charset=UTF-8"
|
181
254
|
require_paths:
|
@@ -184,31 +257,43 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
184
257
|
requirements:
|
185
258
|
- - ">="
|
186
259
|
- !ruby/object:Gem::Version
|
187
|
-
version: 2.6.
|
260
|
+
version: 2.6.6
|
188
261
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
189
262
|
requirements:
|
190
263
|
- - ">="
|
191
264
|
- !ruby/object:Gem::Version
|
192
265
|
version: 2.7.4
|
193
266
|
requirements: []
|
194
|
-
rubygems_version: 3.
|
195
|
-
signing_key:
|
267
|
+
rubygems_version: 3.1.2
|
268
|
+
signing_key:
|
196
269
|
specification_version: 4
|
197
270
|
summary: Generate a Rails app using thoughtbot's best practices.
|
198
271
|
test_files:
|
199
272
|
- spec/adapters/heroku_spec.rb
|
273
|
+
- spec/expand_json_spec.rb
|
200
274
|
- spec/fakes/bin/heroku
|
201
275
|
- spec/fakes/bin/hub
|
276
|
+
- spec/features/advisories_spec.rb
|
202
277
|
- spec/features/api_spec.rb
|
278
|
+
- spec/features/ci_spec.rb
|
203
279
|
- spec/features/cli_help_spec.rb
|
280
|
+
- spec/features/db_optimizations_spec.rb
|
204
281
|
- spec/features/github_spec.rb
|
205
282
|
- spec/features/heroku_spec.rb
|
283
|
+
- spec/features/inline_svg_spec.rb
|
206
284
|
- spec/features/json_spec.rb
|
285
|
+
- spec/features/lint_spec.rb
|
207
286
|
- spec/features/new_project_spec.rb
|
287
|
+
- spec/features/preloader_spec.rb
|
288
|
+
- spec/features/production/compression_spec.rb
|
208
289
|
- spec/features/production/deployment_spec.rb
|
209
290
|
- spec/features/production/email_spec.rb
|
210
291
|
- spec/features/production/manifest_spec.rb
|
292
|
+
- spec/features/production/single_redirect_spec.rb
|
293
|
+
- spec/features/profiler_spec.rb
|
294
|
+
- spec/features/runner_spec.rb
|
211
295
|
- spec/features/staging/pull_requests_spec.rb
|
296
|
+
- spec/features/static_spec.rb
|
212
297
|
- spec/features/stylelint_spec.rb
|
213
298
|
- spec/spec_helper.rb
|
214
299
|
- spec/support/be_executable_matcher.rb
|
@@ -219,4 +304,5 @@ test_files:
|
|
219
304
|
- spec/support/generators.rb
|
220
305
|
- spec/support/match_contents_matcher.rb
|
221
306
|
- spec/support/project_files.rb
|
307
|
+
- spec/support/rails_template.rb
|
222
308
|
- spec/support/suspenders.rb
|
data/templates/browserslist
DELETED
data/templates/dotfiles/.ctags
DELETED
data/templates/puma.rb
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
# https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server
|
2
|
-
|
3
|
-
# The environment variable WEB_CONCURRENCY may be set to a default value based
|
4
|
-
# on dyno size. To manually configure this value use heroku config:set
|
5
|
-
# WEB_CONCURRENCY.
|
6
|
-
#
|
7
|
-
# Increasing the number of workers will increase the amount of resting memory
|
8
|
-
# your dynos use. Increasing the number of threads will increase the amount of
|
9
|
-
# potential bloat added to your dynos when they are responding to heavy
|
10
|
-
# requests.
|
11
|
-
#
|
12
|
-
# Starting with a low number of workers and threads provides adequate
|
13
|
-
# performance for most applications, even under load, while maintaining a low
|
14
|
-
# risk of overusing memory.
|
15
|
-
workers Integer(ENV.fetch("WEB_CONCURRENCY", 2))
|
16
|
-
threads_count = Integer(ENV.fetch("MAX_THREADS", 2))
|
17
|
-
threads(threads_count, threads_count)
|
18
|
-
|
19
|
-
preload_app!
|
20
|
-
|
21
|
-
rackup DefaultRackup
|
22
|
-
environment ENV.fetch("RACK_ENV", "development")
|
23
|
-
|
24
|
-
on_worker_boot do
|
25
|
-
# Worker specific setup for Rails 4.1+
|
26
|
-
# See: https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#on-worker-boot
|
27
|
-
ActiveRecord::Base.establish_connection
|
28
|
-
end
|