suspenders 1.54.1 → 1.55.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +1 -1
  3. data/NEWS.md +6 -0
  4. data/Rakefile +6 -5
  5. data/lib/suspenders/adapters/heroku.rb +16 -16
  6. data/lib/suspenders/app_builder.rb +40 -40
  7. data/lib/suspenders/generators/advisories_generator.rb +1 -1
  8. data/lib/suspenders/generators/analytics_generator.rb +1 -1
  9. data/lib/suspenders/generators/app_generator.rb +25 -25
  10. data/lib/suspenders/generators/base.rb +2 -2
  11. data/lib/suspenders/generators/db_optimizations_generator.rb +2 -2
  12. data/lib/suspenders/generators/factories_generator.rb +1 -1
  13. data/lib/suspenders/generators/jobs_generator.rb +3 -3
  14. data/lib/suspenders/generators/js_driver_generator.rb +1 -1
  15. data/lib/suspenders/generators/lint_generator.rb +5 -0
  16. data/lib/suspenders/generators/preloader_generator.rb +4 -4
  17. data/lib/suspenders/generators/production/compression_generator.rb +1 -1
  18. data/lib/suspenders/generators/production/email_generator.rb +6 -6
  19. data/lib/suspenders/generators/production/manifest_generator.rb +8 -8
  20. data/lib/suspenders/generators/production/single_redirect.rb +1 -1
  21. data/lib/suspenders/generators/production/timeout_generator.rb +2 -2
  22. data/lib/suspenders/generators/profiler_generator.rb +4 -4
  23. data/lib/suspenders/generators/runner_generator.rb +4 -4
  24. data/lib/suspenders/generators/staging/pull_requests_generator.rb +2 -2
  25. data/lib/suspenders/generators/stylelint_generator.rb +2 -1
  26. data/lib/suspenders/generators/stylesheet_base_generator.rb +1 -1
  27. data/lib/suspenders/generators/testing_generator.rb +2 -2
  28. data/lib/suspenders/version.rb +5 -5
  29. data/spec/adapters/heroku_spec.rb +16 -16
  30. data/spec/expand_json_spec.rb +9 -9
  31. data/spec/fakes/bin/heroku +1 -1
  32. data/spec/fakes/bin/hub +1 -1
  33. data/spec/features/cli_help_spec.rb +4 -4
  34. data/spec/features/heroku_spec.rb +3 -3
  35. data/spec/features/lint_spec.rb +26 -0
  36. data/spec/features/new_project_spec.rb +33 -33
  37. data/spec/features/production/compression_spec.rb +2 -2
  38. data/spec/features/production/email_spec.rb +10 -10
  39. data/spec/features/production/manifest_spec.rb +16 -16
  40. data/spec/features/production/single_redirect_spec.rb +2 -2
  41. data/spec/features/profiler_spec.rb +2 -2
  42. data/spec/features/stylelint_spec.rb +7 -7
  43. data/spec/spec_helper.rb +3 -3
  44. data/spec/support/fake_github.rb +3 -3
  45. data/spec/support/fake_heroku.rb +8 -8
  46. data/spec/support/project_files.rb +1 -1
  47. data/spec/support/suspenders.rb +3 -4
  48. data/suspenders.gemspec +20 -20
  49. data/templates/capybara_silence_puma.rb +1 -1
  50. data/templates/errors.rb +3 -3
  51. data/templates/hound.yml +1 -2
  52. data/templates/partials/ci_simplecov.rb +0 -2
  53. data/templates/partials/db_optimizations_configuration.rb +5 -7
  54. data/templates/partials/email_smtp.rb +2 -3
  55. data/templates/partials/pull_requests_config.rb +0 -1
  56. data/templates/partials/runner_setup.rb +1 -2
  57. data/templates/spec_helper.rb +1 -1
  58. data/templates/spring.rb +1 -1
  59. metadata +18 -2
@@ -1,13 +1,13 @@
1
1
  class FakeGithub
2
- RECORDER = File.expand_path(File.join('..', '..', 'tmp', 'hub_commands'), File.dirname(__FILE__))
2
+ RECORDER = File.expand_path(File.join("..", "..", "tmp", "hub_commands"), File.dirname(__FILE__))
3
3
 
4
4
  def initialize(args)
5
5
  @args = args
6
6
  end
7
7
 
8
8
  def run!
9
- File.open(RECORDER, 'a') do |file|
10
- file.write @args.join(' ')
9
+ File.open(RECORDER, "a") do |file|
10
+ file.write @args.join(" ")
11
11
  end
12
12
  end
13
13
 
@@ -1,5 +1,5 @@
1
1
  class FakeHeroku
2
- RECORDER = File.expand_path(File.join('..', '..', 'tmp', 'heroku_commands'), File.dirname(__FILE__))
2
+ RECORDER = File.expand_path(File.join("..", "..", "tmp", "heroku_commands"), File.dirname(__FILE__))
3
3
 
4
4
  def initialize(args)
5
5
  @args = args
@@ -9,8 +9,8 @@ class FakeHeroku
9
9
  if @args.first == "help"
10
10
  puts "pipelines # manage collections of apps in pipelines"
11
11
  end
12
- File.open(RECORDER, 'a') do |file|
13
- file.puts @args.join(' ')
12
+ File.open(RECORDER, "a") do |file|
13
+ file.puts @args.join(" ")
14
14
  end
15
15
  end
16
16
 
@@ -19,7 +19,7 @@ class FakeHeroku
19
19
  end
20
20
 
21
21
  def self.has_gem_included?(project_path, gem_name)
22
- gemfile = File.open(File.join(project_path, 'Gemfile'), 'a')
22
+ gemfile = File.open(File.join(project_path, "Gemfile"), "a")
23
23
 
24
24
  File.foreach(gemfile).any? do |line|
25
25
  line.match(/#{Regexp.quote(gem_name)}/)
@@ -30,10 +30,10 @@ class FakeHeroku
30
30
  app_name = "#{SuspendersTestHelpers::APP_NAME.dasherize}-#{environment}"
31
31
 
32
32
  command = if flags
33
- "create #{app_name} #{flags} --remote #{environment}\n"
34
- else
35
- "create #{app_name} --remote #{environment}\n"
36
- end
33
+ "create #{app_name} #{flags} --remote #{environment}\n"
34
+ else
35
+ "create #{app_name} --remote #{environment}\n"
36
+ end
37
37
 
38
38
  File.foreach(RECORDER).any? { |line| line == command }
39
39
  end
@@ -19,7 +19,7 @@ module ProjectFiles
19
19
 
20
20
  FileUtils.cp(
21
21
  File.join(root_path, "templates", from_in_templates),
22
- destination,
22
+ destination
23
23
  )
24
24
  end
25
25
  end
@@ -88,7 +88,7 @@ module SuspendersTestHelpers
88
88
  end
89
89
 
90
90
  def add_fakes_to_path
91
- ENV["PATH"] = "#{support_bin}:#{ENV['PATH']}"
91
+ ENV["PATH"] = "#{support_bin}:#{ENV["PATH"]}"
92
92
  end
93
93
 
94
94
  def project_path
@@ -106,7 +106,7 @@ module SuspendersTestHelpers
106
106
  end
107
107
 
108
108
  def suspenders_bin
109
- File.join(root_path, 'bin', 'suspenders')
109
+ File.join(root_path, "bin", "suspenders")
110
110
  end
111
111
 
112
112
  def system_rails_bin
@@ -122,7 +122,7 @@ module SuspendersTestHelpers
122
122
  end
123
123
 
124
124
  def root_path
125
- File.expand_path('../../../', __FILE__)
125
+ File.expand_path("../../../", __FILE__)
126
126
  end
127
127
 
128
128
  def rails_template_path
@@ -144,7 +144,6 @@ module SuspendersTestHelpers
144
144
  ENV[name] = new_value.to_s
145
145
 
146
146
  yield
147
-
148
147
  ensure
149
148
  ENV.delete(name)
150
149
 
@@ -1,35 +1,35 @@
1
- # -*- encoding: utf-8 -*-
2
- $:.push File.expand_path('../lib', __FILE__)
3
- require 'suspenders/version'
4
- require 'date'
1
+ $:.push File.expand_path("../lib", __FILE__)
2
+ require "suspenders/version"
3
+ require "date"
5
4
 
6
5
  Gem::Specification.new do |s|
7
6
  s.required_ruby_version = ">= #{Suspenders::RUBY_VERSION}"
8
7
  s.required_rubygems_version = ">= 2.7.4"
9
- s.authors = ['thoughtbot']
10
- s.date = Date.today.strftime('%Y-%m-%d')
8
+ s.authors = ["thoughtbot"]
9
+ s.date = Date.today.strftime("%Y-%m-%d")
11
10
 
12
- s.description = <<-HERE
13
- Suspenders is a base Rails project that you can upgrade. It is used by
14
- thoughtbot to get a jump start on a working app. Use Suspenders if you're in a
15
- rush to build something amazing; don't use it if you like missing deadlines.
11
+ s.description = <<~HERE
12
+ Suspenders is a base Rails project that you can upgrade. It is used by
13
+ thoughtbot to get a jump start on a working app. Use Suspenders if you're in a
14
+ rush to build something amazing; don't use it if you like missing deadlines.
16
15
  HERE
17
16
 
18
- s.email = 'support@thoughtbot.com'
19
- s.executables = ['suspenders']
17
+ s.email = "support@thoughtbot.com"
18
+ s.executables = ["suspenders"]
20
19
  s.extra_rdoc_files = %w[README.md LICENSE]
21
20
  s.files = `git ls-files`.split("\n")
22
- s.homepage = 'http://github.com/thoughtbot/suspenders'
23
- s.license = 'MIT'
24
- s.name = 'suspenders'
25
- s.rdoc_options = ['--charset=UTF-8']
26
- s.require_paths = ['lib']
21
+ s.homepage = "http://github.com/thoughtbot/suspenders"
22
+ s.license = "MIT"
23
+ s.name = "suspenders"
24
+ s.rdoc_options = ["--charset=UTF-8"]
25
+ s.require_paths = ["lib"]
27
26
  s.summary = "Generate a Rails app using thoughtbot's best practices."
28
27
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
29
28
  s.version = Suspenders::VERSION
30
29
 
31
- s.add_dependency 'bitters', '>= 2.0.4'
32
- s.add_dependency 'rails', Suspenders::RAILS_VERSION
30
+ s.add_dependency "bitters", ">= 2.0.4"
31
+ s.add_dependency "rails", Suspenders::RAILS_VERSION
33
32
 
34
- s.add_development_dependency 'rspec', '~> 3.2'
33
+ s.add_development_dependency "rspec", "~> 3.2"
34
+ s.add_development_dependency "standard"
35
35
  end
@@ -1 +1 @@
1
- Capybara.server = :puma, { Silent: true }
1
+ Capybara.server = :puma, {Silent: true}
@@ -15,7 +15,7 @@ HTTP_ERRORS = [
15
15
  Net::HTTPBadResponse,
16
16
  Net::HTTPHeaderSyntaxError,
17
17
  Net::ProtocolError,
18
- Timeout::Error,
18
+ Timeout::Error
19
19
  ]
20
20
 
21
21
  SMTP_SERVER_ERRORS = [
@@ -23,12 +23,12 @@ SMTP_SERVER_ERRORS = [
23
23
  Net::SMTPAuthenticationError,
24
24
  Net::SMTPServerBusy,
25
25
  Net::SMTPUnknownError,
26
- Timeout::Error,
26
+ Timeout::Error
27
27
  ]
28
28
 
29
29
  SMTP_CLIENT_ERRORS = [
30
30
  Net::SMTPFatalError,
31
- Net::SMTPSyntaxError,
31
+ Net::SMTPSyntaxError
32
32
  ]
33
33
 
34
34
  SMTP_ERRORS = SMTP_SERVER_ERRORS + SMTP_CLIENT_ERRORS
@@ -7,8 +7,7 @@ javascript:
7
7
  enabled: true
8
8
  # ignore_file: .javascript_ignore
9
9
  ruby:
10
- # config_file: .ruby-style.yml
11
- enabled: true
10
+ enabled: false
12
11
  scss:
13
12
  enabled: false
14
13
  stylelint:
@@ -6,11 +6,9 @@ if ENV.fetch("COVERAGE", false)
6
6
  SimpleCov.coverage_dir(dir)
7
7
  end
8
8
 
9
-
10
9
  SimpleCov.start "rails"
11
10
 
12
11
  if defined?(Spring) && ENV["DISABLE_SPRING"].to_i == 1
13
12
  Rails.application.eager_load!
14
13
  end
15
14
  end
16
-
@@ -1,7 +1,5 @@
1
-
2
-
3
- config.after_initialize do
4
- Bullet.enable = true
5
- Bullet.bullet_logger = true
6
- Bullet.rails_logger = true
7
- end
1
+ config.after_initialize do
2
+ Bullet.enable = true
3
+ Bullet.bullet_logger = true
4
+ Bullet.rails_logger = true
5
+ end
@@ -1,3 +1,2 @@
1
-
2
- config.action_mailer.delivery_method = :smtp
3
- config.action_mailer.smtp_settings = SMTP_SETTINGS
1
+ config.action_mailer.delivery_method = :smtp
2
+ config.action_mailer.smtp_settings = SMTP_SETTINGS
@@ -2,4 +2,3 @@ if ENV.fetch("HEROKU_APP_NAME", "").include?("staging-pr-")
2
2
  ENV["APPLICATION_HOST"] = ENV["HEROKU_APP_NAME"] + ".herokuapp.com"
3
3
  ENV["ASSET_HOST"] = ENV["HEROKU_APP_NAME"] + ".herokuapp.com"
4
4
  end
5
-
@@ -1,3 +1,2 @@
1
1
  puts "\n== Copying sample env =="
2
- system! 'cp -i .sample.env .env'
3
-
2
+ system! "cp -i .sample.env .env"
@@ -18,7 +18,7 @@ end
18
18
 
19
19
  WebMock.disable_net_connect!(
20
20
  allow_localhost: true,
21
- allow: "chromedriver.storage.googleapis.com",
21
+ allow: "chromedriver.storage.googleapis.com"
22
22
  )
23
23
 
24
24
  # Only allow Timecop with block syntax
@@ -2,5 +2,5 @@ Spring.watch(
2
2
  ".ruby-version",
3
3
  ".rbenv-vars",
4
4
  "tmp/restart.txt",
5
- "tmp/caching-dev.txt",
5
+ "tmp/caching-dev.txt"
6
6
  )
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: suspenders
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.54.1
4
+ version: 1.55.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - thoughtbot
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-30 00:00:00.000000000 Z
11
+ date: 2020-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bitters
@@ -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
@@ -128,6 +142,7 @@ files:
128
142
  - spec/features/heroku_spec.rb
129
143
  - spec/features/inline_svg_spec.rb
130
144
  - spec/features/json_spec.rb
145
+ - spec/features/lint_spec.rb
131
146
  - spec/features/new_project_spec.rb
132
147
  - spec/features/preloader_spec.rb
133
148
  - spec/features/production/compression_spec.rb
@@ -266,6 +281,7 @@ test_files:
266
281
  - spec/features/heroku_spec.rb
267
282
  - spec/features/inline_svg_spec.rb
268
283
  - spec/features/json_spec.rb
284
+ - spec/features/lint_spec.rb
269
285
  - spec/features/new_project_spec.rb
270
286
  - spec/features/preloader_spec.rb
271
287
  - spec/features/production/compression_spec.rb