welaika-suspenders 2.33 → 2.34

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -1
  3. data/.travis.yml +4 -2
  4. data/CHANGELOG_WELAIKA.md +15 -0
  5. data/NEWS.md +8 -0
  6. data/README.md +12 -16
  7. data/docs/heroku_deploy.md +22 -0
  8. data/lib/suspenders.rb +2 -0
  9. data/lib/suspenders/actions.rb +2 -2
  10. data/lib/suspenders/app_builder.rb +19 -11
  11. data/lib/suspenders/generators/app_generator.rb +9 -8
  12. data/lib/suspenders/generators/factories_generator.rb +1 -1
  13. data/lib/suspenders/generators/inline_svg_generator.rb +14 -0
  14. data/lib/suspenders/generators/jobs_generator.rb +53 -0
  15. data/lib/suspenders/generators/production/email_generator.rb +1 -1
  16. data/lib/suspenders/generators/production/error_reporting_generator.rb +6 -6
  17. data/lib/suspenders/generators/production/manifest_generator.rb +2 -1
  18. data/lib/suspenders/generators/production/timeout_generator.rb +1 -0
  19. data/lib/suspenders/generators/staging/pull_requests_generator.rb +3 -3
  20. data/lib/suspenders/generators/stylelint_generator.rb +11 -8
  21. data/lib/suspenders/version.rb +2 -2
  22. data/spec/expand_json_spec.rb +89 -0
  23. data/spec/features/inline_svg_spec.rb +10 -0
  24. data/spec/features/new_project_spec.rb +7 -28
  25. data/spec/features/production/email_spec.rb +1 -1
  26. data/spec/features/production/manifest_spec.rb +2 -0
  27. data/suspenders.gemspec +5 -0
  28. data/templates/Dockerfile.gitlab.erb +1 -1
  29. data/templates/Gemfile.erb +3 -2
  30. data/templates/Procfile +0 -1
  31. data/templates/README.md.erb +12 -6
  32. data/templates/bin_auto_migrate +5 -0
  33. data/templates/bin_deploy +0 -2
  34. data/templates/bin_setup_review_app.erb +0 -1
  35. data/templates/config_sidekiq.yml +14 -0
  36. data/templates/dotfiles/.env +0 -1
  37. data/templates/email.rb +2 -2
  38. data/templates/factory_bot_rspec.rb +1 -1
  39. data/templates/gitlab-ci.yml.erb +50 -50
  40. data/templates/inline_svg.rb +3 -0
  41. data/templates/rack_mini_profiler.rb +2 -2
  42. data/templates/rubocop.yml +11 -1
  43. data/templates/smtp.rb +7 -7
  44. data/templates/spec_support_sidekiq.rb +4 -0
  45. metadata +32 -6
  46. data/templates/browserslist +0 -1
data/templates/email.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- if ENV["EMAIL_RECIPIENTS"].present?
3
+ if ENV['EMAIL_RECIPIENTS'].present?
4
4
  Mail.register_interceptor(
5
- RecipientInterceptor.new(ENV["EMAIL_RECIPIENTS"], subject_prefix: '[STAGING]')
5
+ RecipientInterceptor.new(ENV['EMAIL_RECIPIENTS'], subject_prefix: '[STAGING]')
6
6
  )
7
7
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
- #
2
+
3
3
  FactoryBot.use_parent_strategy = true
4
4
 
5
5
  RSpec.configure do |config|
@@ -27,8 +27,8 @@ variables:
27
27
 
28
28
  stages:
29
29
  - setup
30
- - quality
31
30
  - test
31
+ - quality
32
32
 
33
33
  prepare:
34
34
  <<: *job-creation-policy
@@ -39,6 +39,55 @@ prepare:
39
39
  script:
40
40
  - bundle install --retry 3 --deployment --jobs $(nproc)
41
41
 
42
+ test:factory_lint:
43
+ <<: *job-creation-policy
44
+ stage: test
45
+ services: *rails-services
46
+ cache:
47
+ <<: *cache-settings
48
+ script:
49
+ # Verify node and yarn versions
50
+ - node --version
51
+ - yarn --version
52
+
53
+ # Setup environment
54
+ - cp -f config/database.gitlab.yml config/database.yml
55
+ - bundle check --path vendor/bundle
56
+ - bin/yarn
57
+ - bundle exec rails db:setup RAILS_ENV=test
58
+
59
+ # Run factory_bot lint
60
+ - bundle exec rake factory_bot:lint RAILS_ENV=test
61
+
62
+ test:rspec:
63
+ <<: *job-creation-policy
64
+ stage: test
65
+ services: *rails-services
66
+ cache:
67
+ <<: *cache-settings
68
+ script:
69
+ # Verify node and yarn versions
70
+ - node --version
71
+ - yarn --version
72
+
73
+ # Setup environment
74
+ - cp -f config/database.gitlab.yml config/database.yml
75
+ - bundle check --path vendor/bundle
76
+ - bin/yarn
77
+ - bundle exec rails db:setup RAILS_ENV=test
78
+
79
+ # Run tests
80
+ - bundle exec rspec spec/
81
+ coverage: '/\(\d+.\d+\%\) covered/'
82
+ artifacts:
83
+ name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
84
+ when: always
85
+ expire_in: 5 days
86
+ paths:
87
+ - coverage/
88
+ - tmp/screenshots/
89
+ - tmp/capybara/
90
+
42
91
  quality:rubocop:
43
92
  <<: *job-creation-policy
44
93
  stage: quality
@@ -92,52 +141,3 @@ quality:rubycritic:
92
141
  script:
93
142
  - bundle check --path vendor/bundle
94
143
  - bundle exec rubycritic app/ config/ lib/ --no-browser --minimum-score 94 --format console
95
-
96
- test:factory_lint:
97
- <<: *job-creation-policy
98
- stage: test
99
- services: *rails-services
100
- cache:
101
- <<: *cache-settings
102
- script:
103
- # Verify node and yarn versions
104
- - node --version
105
- - yarn --version
106
-
107
- # Setup environment
108
- - cp -f config/database.gitlab.yml config/database.yml
109
- - bundle check --path vendor/bundle
110
- - bin/yarn
111
- - bundle exec rails db:setup RAILS_ENV=test
112
-
113
- # Run factory_bot lint
114
- - bundle exec rake factory_bot:lint RAILS_ENV=test
115
-
116
- test:rspec:
117
- <<: *job-creation-policy
118
- stage: test
119
- services: *rails-services
120
- cache:
121
- <<: *cache-settings
122
- script:
123
- # Verify node and yarn versions
124
- - node --version
125
- - yarn --version
126
-
127
- # Setup environment
128
- - cp -f config/database.gitlab.yml config/database.yml
129
- - bundle check --path vendor/bundle
130
- - bin/yarn
131
- - bundle exec rails db:setup RAILS_ENV=test
132
-
133
- # Run tests
134
- - bundle exec rspec spec/
135
- coverage: '/\(\d+.\d+\%\) covered/'
136
- artifacts:
137
- name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG"
138
- when: always
139
- expire_in: 5 days
140
- paths:
141
- - coverage/
142
- - tmp/screenshots/
143
- - tmp/capybara/
@@ -0,0 +1,3 @@
1
+ InlineSvg.configure do |config|
2
+ config.raise_on_file_not_found = true
3
+ end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- if ENV["RACK_MINI_PROFILER"].to_i > 0
4
- require "rack-mini-profiler"
3
+ if ENV['RACK_MINI_PROFILER'].to_i.positive?
4
+ require 'rack-mini-profiler'
5
5
 
6
6
  Rack::MiniProfilerRails.initialize!(Rails.application)
7
7
  end
@@ -1,14 +1,15 @@
1
+ ---
1
2
  require:
2
3
  - rubocop-rspec
3
4
  - rubocop-performance
4
5
  - rubocop-rails
6
+
5
7
  inherit_from: .rubocop_todo.yml
6
8
 
7
9
  AllCops:
8
10
  DisplayCopNames: true
9
11
  Exclude:
10
12
  - 'bin/*'
11
- - 'config/**/*'
12
13
  - 'db/**/*'
13
14
  - 'tmp/**/*'
14
15
  - 'vendor/**/*'
@@ -16,14 +17,23 @@ AllCops:
16
17
  Metrics/BlockLength:
17
18
  Exclude:
18
19
  - 'app/admin/**/*'
20
+ - 'config/environments/*'
19
21
  - 'lib/tasks/*.rake'
20
22
  - 'spec/**/*'
21
23
 
22
24
  Metrics/LineLength:
23
25
  Max: 100
26
+ Exclude:
27
+ - 'config/initializers/backtrace_silencers.rb'
28
+ - 'config/initializers/content_security_policy.rb'
24
29
 
25
30
  Rails:
26
31
  Enabled: true
27
32
 
33
+ RSpec/MultipleExpectations:
34
+ Exclude:
35
+ - 'spec/features/**/*'
36
+ - 'spec/system/**/*'
37
+
28
38
  Style/Documentation:
29
39
  Enabled: false
data/templates/smtp.rb CHANGED
@@ -1,11 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  SMTP_SETTINGS = {
4
- address: ENV.fetch("SMTP_ADDRESS"), # example: "smtp.sendgrid.net"
5
- authentication: :plain,
6
- domain: ENV.fetch("SMTP_DOMAIN"), # example: "heroku.com"
4
+ address: ENV.fetch('SMTP_ADDRESS'), # example: "smtp.sendgrid.net"
5
+ authentication: :login,
6
+ domain: ENV.fetch('SMTP_DOMAIN'), # example: "heroku.com"
7
7
  enable_starttls_auto: true,
8
- password: ENV.fetch("SMTP_PASSWORD"),
9
- port: "587",
10
- user_name: ENV.fetch("SMTP_USERNAME")
11
- }
8
+ password: ENV.fetch('SMTP_PASSWORD'),
9
+ port: '587',
10
+ user_name: ENV.fetch('SMTP_USERNAME')
11
+ }.freeze
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'sidekiq/testing'
4
+ Sidekiq::Testing.inline!
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: welaika-suspenders
3
3
  version: !ruby/object:Gem::Version
4
- version: '2.33'
4
+ version: '2.34'
5
5
  platform: ruby
6
6
  authors:
7
7
  - thoughtbot
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-07-23 00:00:00.000000000 Z
12
+ date: 2019-10-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -25,6 +25,20 @@ dependencies:
25
25
  - - "~>"
26
26
  - !ruby/object:Gem::Version
27
27
  version: 5.2.3
28
+ - !ruby/object:Gem::Dependency
29
+ name: bundler
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: '2'
35
+ type: :runtime
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ version: '2'
28
42
  - !ruby/object:Gem::Dependency
29
43
  name: rspec
30
44
  requirement: !ruby/object:Gem::Requirement
@@ -96,6 +110,7 @@ files:
96
110
  - bin/setup
97
111
  - bin/welaika-suspenders
98
112
  - diff_suspenders.sh
113
+ - docs/heroku_deploy.md
99
114
  - lib/suspenders.rb
100
115
  - lib/suspenders/actions.rb
101
116
  - lib/suspenders/adapters/heroku.rb
@@ -108,6 +123,8 @@ files:
108
123
  - lib/suspenders/generators/factories_generator.rb
109
124
  - lib/suspenders/generators/faker_generator.rb
110
125
  - lib/suspenders/generators/import_dump_generator.rb
126
+ - lib/suspenders/generators/inline_svg_generator.rb
127
+ - lib/suspenders/generators/jobs_generator.rb
111
128
  - lib/suspenders/generators/js_driver_generator.rb
112
129
  - lib/suspenders/generators/json_generator.rb
113
130
  - lib/suspenders/generators/lint_generator.rb
@@ -127,11 +144,13 @@ files:
127
144
  - lib/suspenders/version.rb
128
145
  - lib/welaika-suspenders.rb
129
146
  - spec/adapters/heroku_spec.rb
147
+ - spec/expand_json_spec.rb
130
148
  - spec/fakes/bin/heroku
131
149
  - spec/features/api_spec.rb
132
150
  - spec/features/cli_help_spec.rb
133
151
  - spec/features/heroku_spec.rb
134
152
  - spec/features/import_dump_spec.rb
153
+ - spec/features/inline_svg_spec.rb
135
154
  - spec/features/json_spec.rb
136
155
  - spec/features/new_project_spec.rb
137
156
  - spec/features/production/deployment_spec.rb
@@ -158,14 +177,15 @@ files:
158
177
  - templates/_javascript.html.slim
159
178
  - templates/action_mailer.rb
160
179
  - templates/application.sass
180
+ - templates/bin_auto_migrate
161
181
  - templates/bin_deploy
162
182
  - templates/bin_import_dump.erb
163
183
  - templates/bin_setup
164
184
  - templates/bin_setup_review_app.erb
165
- - templates/browserslist
166
185
  - templates/capybara_silence_puma.rb
167
186
  - templates/chromedriver.rb
168
187
  - templates/config_locales_it.yml.erb
188
+ - templates/config_sidekiq.yml
169
189
  - templates/database.gitlab.yml
170
190
  - templates/dev.rake
171
191
  - templates/dockerignore
@@ -179,6 +199,7 @@ files:
179
199
  - templates/flashes_helper.rb
180
200
  - templates/gitlab-ci.yml.erb
181
201
  - templates/i18n.rb
202
+ - templates/inline_svg.rb
182
203
  - templates/json_encoding.rb
183
204
  - templates/overcommit.yml
184
205
  - templates/postgresql_database.yml.erb
@@ -197,13 +218,16 @@ files:
197
218
  - templates/slim.rb
198
219
  - templates/smtp.rb
199
220
  - templates/spec_helper.rb
221
+ - templates/spec_support_sidekiq.rb
200
222
  - templates/stylelintrc.json
201
223
  - templates/suspenders_gitignore
202
224
  - templates/suspenders_layout.html.slim
203
225
  homepage: http://github.com/welaika/welaika-suspenders
204
226
  licenses:
205
227
  - MIT
206
- metadata: {}
228
+ metadata:
229
+ changelog_uri: https://github.com/welaika/welaika-suspenders/blob/master/CHANGELOG_WELAIKA.md
230
+ source_code_uri: https://github.com/welaika/welaika-suspenders
207
231
  post_install_message:
208
232
  rdoc_options:
209
233
  - "--charset=UTF-8"
@@ -213,24 +237,26 @@ required_ruby_version: !ruby/object:Gem::Requirement
213
237
  requirements:
214
238
  - - ">="
215
239
  - !ruby/object:Gem::Version
216
- version: 2.6.3
240
+ version: 2.6.5
217
241
  required_rubygems_version: !ruby/object:Gem::Requirement
218
242
  requirements:
219
243
  - - ">="
220
244
  - !ruby/object:Gem::Version
221
245
  version: 2.7.4
222
246
  requirements: []
223
- rubygems_version: 3.0.4
247
+ rubygems_version: 3.0.3
224
248
  signing_key:
225
249
  specification_version: 4
226
250
  summary: Generate a Rails app using thoughtbot's best practices.
227
251
  test_files:
228
252
  - spec/adapters/heroku_spec.rb
253
+ - spec/expand_json_spec.rb
229
254
  - spec/fakes/bin/heroku
230
255
  - spec/features/api_spec.rb
231
256
  - spec/features/cli_help_spec.rb
232
257
  - spec/features/heroku_spec.rb
233
258
  - spec/features/import_dump_spec.rb
259
+ - spec/features/inline_svg_spec.rb
234
260
  - spec/features/json_spec.rb
235
261
  - spec/features/new_project_spec.rb
236
262
  - spec/features/production/deployment_spec.rb
@@ -1 +0,0 @@
1
- Last 2 versions