suspenders 1.53.0 → 1.54.0
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/.travis.yml +4 -3
- data/CONTRIBUTING.md +15 -15
- data/GOALS.md +65 -0
- data/NEWS.md +29 -0
- data/README.md +2 -4
- data/docs/heroku_deploy.md +2 -5
- data/lib/suspenders.rb +6 -0
- data/lib/suspenders/actions.rb +2 -2
- data/lib/suspenders/adapters/heroku.rb +14 -1
- data/lib/suspenders/app_builder.rb +3 -71
- data/lib/suspenders/generators/advisories_generator.rb +19 -0
- data/lib/suspenders/generators/app_generator.rb +7 -33
- data/lib/suspenders/generators/base.rb +39 -0
- data/lib/suspenders/generators/ci_generator.rb +19 -9
- data/lib/suspenders/generators/db_optimizations_generator.rb +3 -15
- data/lib/suspenders/generators/js_driver_generator.rb +1 -2
- 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 +5 -8
- data/lib/suspenders/generators/production/manifest_generator.rb +1 -0
- data/lib/suspenders/generators/production/single_redirect.rb +15 -0
- data/lib/suspenders/generators/production/timeout_generator.rb +1 -0
- 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 +2 -10
- data/lib/suspenders/generators/static_generator.rb +4 -0
- data/lib/suspenders/generators/stylesheet_base_generator.rb +5 -6
- data/lib/suspenders/generators/testing_generator.rb +0 -11
- data/lib/suspenders/version.rb +1 -1
- data/spec/adapters/heroku_spec.rb +28 -2
- data/spec/expand_json_spec.rb +89 -0
- data/spec/features/advisories_spec.rb +24 -0
- data/spec/features/ci_spec.rb +31 -0
- data/spec/features/db_optimizations_spec.rb +19 -0
- data/spec/features/heroku_spec.rb +6 -13
- data/spec/features/new_project_spec.rb +5 -27
- data/spec/features/preloader_spec.rb +25 -0
- data/spec/features/production/compression_spec.rb +23 -0
- data/spec/features/production/manifest_spec.rb +2 -0
- 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/static_spec.rb +17 -0
- data/spec/support/contain_json_matcher.rb +16 -10
- data/spec/support/project_files.rb +12 -0
- data/spec/support/rails_template.rb +1 -0
- data/spec/support/suspenders.rb +16 -13
- data/suspenders.gemspec +1 -2
- data/templates/Gemfile.erb +1 -6
- 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/chromedriver.rb +10 -0
- 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/partials/ci_simplecov.rb +16 -0
- data/templates/partials/db_optimizations_configuration.rb +7 -0
- data/templates/partials/deployment_readme.md +8 -0
- data/templates/partials/email_smtp.rb +3 -0
- data/templates/partials/profiler_readme.md +8 -0
- data/templates/partials/pull_requests_config.rb +5 -0
- data/templates/partials/runner_readme.md +31 -0
- data/templates/partials/runner_setup.rb +3 -0
- data/templates/rack_mini_profiler.rb +2 -0
- data/templates/rails_helper.rb +4 -1
- data/templates/{dotfiles/.env → sample_env} +0 -1
- data/templates/spec_helper.rb +4 -7
- data/templates/spring.rb +6 -0
- data/templates/suspenders_gitignore +1 -1
- metadata +75 -25
- data/templates/dotfiles/.ctags +0 -2
- data/templates/puma.rb +0 -28
@@ -0,0 +1 @@
|
|
1
|
+
Canonicalize the URL by configuring the `Rack::CanonicalHost` middleware.
|
@@ -0,0 +1,9 @@
|
|
1
|
+
Set up the project for an in-depth test-driven development workflow.
|
2
|
+
|
3
|
+
- Maintain the test DB schema.
|
4
|
+
- Clear mail deliveries between tests.
|
5
|
+
- Import i18n helpers for use in tests.
|
6
|
+
- Prepare for system tests in `spec/system`.
|
7
|
+
- Integrate Formulaic for easier form testing.
|
8
|
+
- RSpec infers the file type based on the directory name.
|
9
|
+
- Install and configure RSpec and shoulda-matchers, with Spring integration.
|
@@ -0,0 +1,8 @@
|
|
1
|
+
View templates for flash, JavaScript, and CSS.
|
2
|
+
|
3
|
+
- Disable CSS animations in tests.
|
4
|
+
- Run JavaScript when the page has loaded.
|
5
|
+
- Use the `title` gem for controlling the page title via i18n.
|
6
|
+
- Insert one-off JavaScript into a `:javascript` content block.
|
7
|
+
- Creates the directory for storing generic, application-level partials.
|
8
|
+
- Render user-facing partials (alert, error, notice, success) on all pages.
|
@@ -0,0 +1,16 @@
|
|
1
|
+
if ENV.fetch("COVERAGE", false)
|
2
|
+
require "simplecov"
|
3
|
+
|
4
|
+
if ENV["CIRCLE_ARTIFACTS"]
|
5
|
+
dir = File.join(ENV["CIRCLE_ARTIFACTS"], "coverage")
|
6
|
+
SimpleCov.coverage_dir(dir)
|
7
|
+
end
|
8
|
+
|
9
|
+
|
10
|
+
SimpleCov.start "rails"
|
11
|
+
|
12
|
+
if defined?(Spring) && ENV["DISABLE_SPRING"].to_i == 1
|
13
|
+
Rails.application.eager_load!
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
@@ -0,0 +1,31 @@
|
|
1
|
+
## Configuration
|
2
|
+
|
3
|
+
Environment variables during local development are handled by the node-foreman
|
4
|
+
project runner. To provide environment variables, create a `.env` file at the
|
5
|
+
root of the project. In that file provide the environment variables listed in
|
6
|
+
`.sample.env`. The `bin/setup` script does this for you, but be careful about
|
7
|
+
overwriting your existing `.env` file.
|
8
|
+
|
9
|
+
`app.json` also contains a list of environment variables that are required for
|
10
|
+
the application. The `.sample.env` file provides either non-secret vars that
|
11
|
+
can be copied directly into your own `.env` file or instructions on where to
|
12
|
+
obtain secret values.
|
13
|
+
|
14
|
+
During development add any new environment variables needed by the application
|
15
|
+
to both `.sample.env` and `app.json`, providing either **public** default
|
16
|
+
values or brief instructions on where secret values may be found.
|
17
|
+
|
18
|
+
Do not commit the `.env` file to the git repo.
|
19
|
+
|
20
|
+
## Running the Application
|
21
|
+
|
22
|
+
Use the `heroku local` runner to run the app locally as it would run on Heroku.
|
23
|
+
This uses the node-forman runner, which reads from the `Procfile` file.
|
24
|
+
|
25
|
+
```sh
|
26
|
+
heroku local
|
27
|
+
```
|
28
|
+
|
29
|
+
Once the server is started the application is reachable at
|
30
|
+
`http://localhost:3000`.
|
31
|
+
|
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,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: suspenders
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.54.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- thoughtbot
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-06-24 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
|
@@ -52,20 +52,6 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '3.2'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: rack-timeout
|
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'
|
69
55
|
description: |
|
70
56
|
Suspenders is a base Rails project that you can upgrade. It is used by
|
71
57
|
thoughtbot to get a jump start on a working app. Use Suspenders if you're in a
|
@@ -82,6 +68,7 @@ files:
|
|
82
68
|
- ".ruby-version"
|
83
69
|
- ".travis.yml"
|
84
70
|
- CONTRIBUTING.md
|
71
|
+
- GOALS.md
|
85
72
|
- Gemfile
|
86
73
|
- LICENSE
|
87
74
|
- NEWS.md
|
@@ -98,6 +85,7 @@ files:
|
|
98
85
|
- lib/suspenders/actions.rb
|
99
86
|
- lib/suspenders/adapters/heroku.rb
|
100
87
|
- lib/suspenders/app_builder.rb
|
88
|
+
- lib/suspenders/generators/advisories_generator.rb
|
101
89
|
- lib/suspenders/generators/analytics_generator.rb
|
102
90
|
- lib/suspenders/generators/app_generator.rb
|
103
91
|
- lib/suspenders/generators/base.rb
|
@@ -110,11 +98,16 @@ files:
|
|
110
98
|
- lib/suspenders/generators/js_driver_generator.rb
|
111
99
|
- lib/suspenders/generators/json_generator.rb
|
112
100
|
- lib/suspenders/generators/lint_generator.rb
|
101
|
+
- lib/suspenders/generators/preloader_generator.rb
|
102
|
+
- lib/suspenders/generators/production/compression_generator.rb
|
113
103
|
- lib/suspenders/generators/production/deployment_generator.rb
|
114
104
|
- lib/suspenders/generators/production/email_generator.rb
|
115
105
|
- lib/suspenders/generators/production/force_tls_generator.rb
|
116
106
|
- lib/suspenders/generators/production/manifest_generator.rb
|
107
|
+
- lib/suspenders/generators/production/single_redirect.rb
|
117
108
|
- lib/suspenders/generators/production/timeout_generator.rb
|
109
|
+
- lib/suspenders/generators/profiler_generator.rb
|
110
|
+
- lib/suspenders/generators/runner_generator.rb
|
118
111
|
- lib/suspenders/generators/staging/pull_requests_generator.rb
|
119
112
|
- lib/suspenders/generators/static_generator.rb
|
120
113
|
- lib/suspenders/generators/stylelint_generator.rb
|
@@ -123,19 +116,29 @@ files:
|
|
123
116
|
- lib/suspenders/generators/views_generator.rb
|
124
117
|
- lib/suspenders/version.rb
|
125
118
|
- spec/adapters/heroku_spec.rb
|
119
|
+
- spec/expand_json_spec.rb
|
126
120
|
- spec/fakes/bin/heroku
|
127
121
|
- spec/fakes/bin/hub
|
122
|
+
- spec/features/advisories_spec.rb
|
128
123
|
- spec/features/api_spec.rb
|
124
|
+
- spec/features/ci_spec.rb
|
129
125
|
- spec/features/cli_help_spec.rb
|
126
|
+
- spec/features/db_optimizations_spec.rb
|
130
127
|
- spec/features/github_spec.rb
|
131
128
|
- spec/features/heroku_spec.rb
|
132
129
|
- spec/features/inline_svg_spec.rb
|
133
130
|
- spec/features/json_spec.rb
|
134
131
|
- spec/features/new_project_spec.rb
|
132
|
+
- spec/features/preloader_spec.rb
|
133
|
+
- spec/features/production/compression_spec.rb
|
135
134
|
- spec/features/production/deployment_spec.rb
|
136
135
|
- spec/features/production/email_spec.rb
|
137
136
|
- spec/features/production/manifest_spec.rb
|
137
|
+
- spec/features/production/single_redirect_spec.rb
|
138
|
+
- spec/features/profiler_spec.rb
|
139
|
+
- spec/features/runner_spec.rb
|
138
140
|
- spec/features/staging/pull_requests_spec.rb
|
141
|
+
- spec/features/static_spec.rb
|
139
142
|
- spec/features/stylelint_spec.rb
|
140
143
|
- spec/spec_helper.rb
|
141
144
|
- spec/support/be_executable_matcher.rb
|
@@ -146,6 +149,7 @@ files:
|
|
146
149
|
- spec/support/generators.rb
|
147
150
|
- spec/support/match_contents_matcher.rb
|
148
151
|
- spec/support/project_files.rb
|
152
|
+
- spec/support/rails_template.rb
|
149
153
|
- spec/support/suspenders.rb
|
150
154
|
- suspenders.gemspec
|
151
155
|
- templates/Gemfile.erb
|
@@ -158,6 +162,7 @@ files:
|
|
158
162
|
- templates/action_mailer.rb
|
159
163
|
- templates/active_job.rb
|
160
164
|
- templates/application.scss
|
165
|
+
- templates/bin_auto_migrate
|
161
166
|
- templates/bin_deploy
|
162
167
|
- templates/bin_setup
|
163
168
|
- templates/bin_setup_review_app.erb
|
@@ -166,9 +171,34 @@ files:
|
|
166
171
|
- templates/chromedriver.rb
|
167
172
|
- templates/circle.yml.erb
|
168
173
|
- templates/config_locales_en.yml.erb
|
174
|
+
- templates/descriptions/advisories.md
|
175
|
+
- templates/descriptions/analytics.md
|
176
|
+
- templates/descriptions/ci.md
|
177
|
+
- templates/descriptions/compression.md
|
178
|
+
- templates/descriptions/db_optimizations.md
|
179
|
+
- templates/descriptions/deployment.md
|
180
|
+
- templates/descriptions/email.md
|
181
|
+
- templates/descriptions/factories.md
|
182
|
+
- templates/descriptions/force_tls.md
|
183
|
+
- templates/descriptions/forms.md
|
184
|
+
- templates/descriptions/inline_svg.md
|
185
|
+
- templates/descriptions/jobs.md
|
186
|
+
- templates/descriptions/js_driver.md
|
187
|
+
- templates/descriptions/json.md
|
188
|
+
- templates/descriptions/lint.md
|
189
|
+
- templates/descriptions/manifest.md
|
190
|
+
- templates/descriptions/preloader.md
|
191
|
+
- templates/descriptions/profiler.md
|
192
|
+
- templates/descriptions/pull_requests.md
|
193
|
+
- templates/descriptions/runner.md
|
194
|
+
- templates/descriptions/single_redirect.md
|
195
|
+
- templates/descriptions/static.md
|
196
|
+
- templates/descriptions/stylelint.md
|
197
|
+
- templates/descriptions/stylesheet_base.md
|
198
|
+
- templates/descriptions/testing.md
|
199
|
+
- templates/descriptions/timeout.md
|
200
|
+
- templates/descriptions/views.md
|
169
201
|
- templates/dev.rake
|
170
|
-
- templates/dotfiles/.ctags
|
171
|
-
- templates/dotfiles/.env
|
172
202
|
- templates/email.rb
|
173
203
|
- templates/errors.rb
|
174
204
|
- templates/factories.rb
|
@@ -178,14 +208,23 @@ files:
|
|
178
208
|
- templates/i18n.rb
|
179
209
|
- templates/inline_svg.rb
|
180
210
|
- templates/json_encoding.rb
|
211
|
+
- templates/partials/ci_simplecov.rb
|
212
|
+
- templates/partials/db_optimizations_configuration.rb
|
213
|
+
- templates/partials/deployment_readme.md
|
214
|
+
- templates/partials/email_smtp.rb
|
215
|
+
- templates/partials/profiler_readme.md
|
216
|
+
- templates/partials/pull_requests_config.rb
|
217
|
+
- templates/partials/runner_readme.md
|
218
|
+
- templates/partials/runner_setup.rb
|
181
219
|
- templates/postgresql_database.yml.erb
|
182
|
-
- templates/puma.rb
|
183
220
|
- templates/rack_mini_profiler.rb
|
184
221
|
- templates/rails_helper.rb
|
222
|
+
- templates/sample_env
|
185
223
|
- templates/secrets.yml
|
186
224
|
- templates/shoulda_matchers_config_rspec.rb
|
187
225
|
- templates/smtp.rb
|
188
226
|
- templates/spec_helper.rb
|
227
|
+
- templates/spring.rb
|
189
228
|
- templates/stylelintrc.json
|
190
229
|
- templates/suspenders_gitignore
|
191
230
|
- templates/suspenders_layout.html.erb.erb
|
@@ -202,32 +241,42 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
202
241
|
requirements:
|
203
242
|
- - ">="
|
204
243
|
- !ruby/object:Gem::Version
|
205
|
-
version: 2.6.
|
244
|
+
version: 2.6.6
|
206
245
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
207
246
|
requirements:
|
208
247
|
- - ">="
|
209
248
|
- !ruby/object:Gem::Version
|
210
249
|
version: 2.7.4
|
211
250
|
requirements: []
|
212
|
-
rubygems_version: 3.
|
251
|
+
rubygems_version: 3.1.2
|
213
252
|
signing_key:
|
214
253
|
specification_version: 4
|
215
254
|
summary: Generate a Rails app using thoughtbot's best practices.
|
216
255
|
test_files:
|
217
256
|
- spec/adapters/heroku_spec.rb
|
257
|
+
- spec/expand_json_spec.rb
|
218
258
|
- spec/fakes/bin/heroku
|
219
259
|
- spec/fakes/bin/hub
|
260
|
+
- spec/features/advisories_spec.rb
|
220
261
|
- spec/features/api_spec.rb
|
262
|
+
- spec/features/ci_spec.rb
|
221
263
|
- spec/features/cli_help_spec.rb
|
264
|
+
- spec/features/db_optimizations_spec.rb
|
222
265
|
- spec/features/github_spec.rb
|
223
266
|
- spec/features/heroku_spec.rb
|
224
267
|
- spec/features/inline_svg_spec.rb
|
225
268
|
- spec/features/json_spec.rb
|
226
269
|
- spec/features/new_project_spec.rb
|
270
|
+
- spec/features/preloader_spec.rb
|
271
|
+
- spec/features/production/compression_spec.rb
|
227
272
|
- spec/features/production/deployment_spec.rb
|
228
273
|
- spec/features/production/email_spec.rb
|
229
274
|
- spec/features/production/manifest_spec.rb
|
275
|
+
- spec/features/production/single_redirect_spec.rb
|
276
|
+
- spec/features/profiler_spec.rb
|
277
|
+
- spec/features/runner_spec.rb
|
230
278
|
- spec/features/staging/pull_requests_spec.rb
|
279
|
+
- spec/features/static_spec.rb
|
231
280
|
- spec/features/stylelint_spec.rb
|
232
281
|
- spec/spec_helper.rb
|
233
282
|
- spec/support/be_executable_matcher.rb
|
@@ -238,4 +287,5 @@ test_files:
|
|
238
287
|
- spec/support/generators.rb
|
239
288
|
- spec/support/match_contents_matcher.rb
|
240
289
|
- spec/support/project_files.rb
|
290
|
+
- spec/support/rails_template.rb
|
241
291
|
- spec/support/suspenders.rb
|