nextgen 0.20.0 → 0.22.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '08e56651b3e6d88022098471a5b3e04b20ca703ac5e973425fb68f806b271e4a'
4
- data.tar.gz: fed2715b9bdb7625434ef6983a15118e1fe29cd3f64a0f182928c1805920f7ed
3
+ metadata.gz: ab42df3afedd51d12bad9ba602f2cc8d6f1ab94af01305c6c7beac8ed6430f42
4
+ data.tar.gz: 3c1956f80e9780ce64813080ee27e377821f28fdecc8ab54d1a92610ef7ad9a7
5
5
  SHA512:
6
- metadata.gz: 5481874c31115de5229ba346ede332453731c46604b01e974ee1d34471ff1dfcc290dbcdbf2170f03e64b44333d1c83ced987204c6c43abf58637c416e18628c
7
- data.tar.gz: 679b4f278c8493da2ed8b34df79c761073f010262bf66eff305a974051f1a1ff52dd89542dc6a852bbacbe7e4a4a46fda95355d68e7cc0e8e6bfb55c53c31682
6
+ metadata.gz: 20a0a482b9c6abc27a2394573a70ebdf40f68222718afdf3a0605769af67c3718168da5a288520334219c4ebeb2ea9231e478ff4d55e9f157e8a9e771af71f64
7
+ data.tar.gz: 5a9d0e288814f314093cacf5919e683c531083baa16f511ef35d9ba6d18e1daf0134201dae8b98587a75adb3e923653cdf21e35e01aeff9851d0bab2aa4e5199
data/README.md CHANGED
@@ -87,6 +87,7 @@ Nextgen can install and configure your choice of these recommended gems:
87
87
  - [factory_bot_rails](https://github.com/thoughtbot/factory_bot_rails)
88
88
  - [good_migrations](https://github.com/testdouble/good-migrations)
89
89
  - [letter_opener](https://github.com/ryanb/letter_opener)
90
+ - [mocha](https://github.com/freerange/mocha)
90
91
  - [overcommit](https://github.com/sds/overcommit)
91
92
  - [pgcli-rails](https://github.com/mattbrictson/pgcli-rails)
92
93
  - [rack-canonical-host](https://github.com/tylerhunt/rack-canonical-host)
@@ -90,6 +90,11 @@ letter_opener:
90
90
  description: "Install letter_opener gem to use with Action Mailer in dev"
91
91
  requires: action_mailer
92
92
 
93
+ mocha:
94
+ prompt: "mocha"
95
+ description: "Install mocha gem for fluent stubs/mocks in minitest"
96
+ requires: minitest
97
+
93
98
  open_browser_on_start:
94
99
  prompt: "Open browser on startup"
95
100
  description: "Configure puma to launch browser on startup in development"
@@ -7,22 +7,3 @@ if minitest?
7
7
  elsif rspec?
8
8
  empty_directory_with_keep_file "spec/mailers"
9
9
  end
10
-
11
- say_git "Ensure absolute URLs can be used in all environments"
12
- insert_into_file "config/environments/development.rb", <<-RUBY, after: "raise_delivery_errors = false\n"
13
- config.action_mailer.default_url_options = {host: "localhost:3000"}
14
- config.action_mailer.asset_host = "http://localhost:3000"
15
- RUBY
16
-
17
- insert_into_file "config/environments/test.rb", <<-RUBY, after: "config.action_mailer.delivery_method = :test\n"
18
- config.action_mailer.default_url_options = {host: "localhost:3000"}
19
- config.action_mailer.asset_host = "http://localhost:3000"
20
- RUBY
21
-
22
- insert_into_file "config/environments/production.rb", <<-RUBY, after: /config\.action_mailer\.raise_deliv.*\n/
23
- config.action_mailer.default_url_options = {
24
- host: ENV.fetch("RAILS_HOSTNAME", "app.example.com"),
25
- protocol: "https"
26
- }
27
- config.action_mailer.asset_host = "https://\#{ENV.fetch("RAILS_HOSTNAME", "app.example.com")}"
28
- RUBY
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ install_gem "mocha", group: :test
4
+ copy_test_support_file "mocha.rb"
@@ -8,3 +8,7 @@ document_deploy_var "RAILS_HOSTNAME", "Redirect all requests to the specified ca
8
8
  insert_into_file "config.ru",
9
9
  %(use Rack::CanonicalHost, ENV.fetch("RAILS_HOSTNAME", nil) if ENV["RAILS_HOSTNAME"].present?\n),
10
10
  before: /^run Rails.application/
11
+
12
+ gsub_file "config/environments/production.rb",
13
+ /\bhost: "example\.com"/,
14
+ 'host: ENV.fetch("RAILS_HOSTNAME", "example.com")'
@@ -11,7 +11,7 @@ plugins << "performance"
11
11
  plugins << "rails"
12
12
  install_gem("rubocop-rails", version: ">= 2.22.0", group: :development, require: false)
13
13
  install_gems(*plugins.map { "rubocop-#{_1}" }, "rubocop", group: :development, require: false)
14
- binstub "rubocop"
14
+ binstub "rubocop" unless File.exist?("bin/rubocop")
15
15
 
16
16
  say_git "Replace .rubocop.yml"
17
17
  template ".rubocop.yml", context: binding, force: true
@@ -33,4 +33,5 @@ inject_into_file "README.md", <<~MARKDOWN, after: /rake fix\n```\n/
33
33
  MARKDOWN
34
34
 
35
35
  say_git "Auto-correct any existing issues"
36
+ uncomment_lines "config/environments/development.rb", /apply_rubocop_autocorrect_after_generate!/
36
37
  run "bin/rubocop -A --fail-level F", capture: true
@@ -61,7 +61,7 @@ if File.exist?("test/application_system_test_case.rb")
61
61
  end
62
62
 
63
63
  say_git "Install modern-normalize and base stylesheets"
64
- add_yarn_package "modern-normalize@^2.0.0"
64
+ add_yarn_package "modern-normalize@^3.0.0"
65
65
  copy_file "app/frontend/stylesheets/index.css"
66
66
  copy_file "app/frontend/stylesheets/base.css"
67
67
  copy_file "app/frontend/stylesheets/reset.css"
@@ -130,6 +130,10 @@ module Nextgen
130
130
  %w[bootstrap bulma postcss sass].include?(css) || %w[webpack esbuild rollup].include?(javascript)
131
131
  end
132
132
 
133
+ def minitest?
134
+ @test_framework == "minitest"
135
+ end
136
+
133
137
  def rspec?
134
138
  @test_framework == "rspec"
135
139
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nextgen
4
- VERSION = "0.20.0"
4
+ VERSION = "0.22.0"
5
5
  end
@@ -6,6 +6,6 @@ These environment variables affect how the app functions when deployed in produc
6
6
 
7
7
  - `RAILS_DISABLE_SSL` - Disable HSTS and secure cookies
8
8
  - `RAILS_ENV` **REQUIRED** - "production"
9
- - `RAILS_MAX_THREADS` - Number of threads per Puma process (default: 5)
9
+ - `RAILS_MAX_THREADS` - Number of threads per Puma process (default: 3)
10
10
  - `SECRET_KEY_BASE` **REQUIRED** - Unique, secret key used to encrypt and sign cookies and other sensitive data
11
11
  - `WEB_CONCURRENCY` - Number of Puma processes (default: number of CPUs)
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "mocha/minitest"
4
+
5
+ # Reference: https://rubydoc.info/gems/mocha/Mocha/Configuration
6
+ Mocha.configure do |config|
7
+ config.strict_keyword_argument_matching = true
8
+ config.stubbing_method_on_nil = :prevent
9
+ config.stubbing_non_existent_method = :prevent
10
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nextgen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.20.0
4
+ version: 0.22.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Brictson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-08-16 00:00:00.000000000 Z
11
+ date: 2024-09-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -120,6 +120,7 @@ files:
120
120
  - lib/nextgen/generators/home_controller.rb
121
121
  - lib/nextgen/generators/initial_git_commit.rb
122
122
  - lib/nextgen/generators/letter_opener.rb
123
+ - lib/nextgen/generators/mocha.rb
123
124
  - lib/nextgen/generators/node.rb
124
125
  - lib/nextgen/generators/open_browser_on_start.rb
125
126
  - lib/nextgen/generators/overcommit.rb
@@ -194,6 +195,7 @@ files:
194
195
  - template/test/support/capybara.rb.tt
195
196
  - template/test/support/factory_bot.rb
196
197
  - template/test/support/mailer.rb
198
+ - template/test/support/mocha.rb
197
199
  - template/test/support/shoulda.rb
198
200
  - template/test/support/vcr.rb.tt
199
201
  - template/test/support/webmock.rb
@@ -222,7 +224,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
222
224
  - !ruby/object:Gem::Version
223
225
  version: '0'
224
226
  requirements: []
225
- rubygems_version: 3.5.11
227
+ rubygems_version: 3.5.16
226
228
  signing_key:
227
229
  specification_version: 4
228
230
  summary: Generate your next Rails app interactively!