nextgen 0.1.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -1
- data/config/generators.yml +5 -4
- data/lib/nextgen/actions.rb +5 -3
- data/lib/nextgen/generators/base.rb +1 -0
- data/lib/nextgen/generators/rspec_system_testing.rb +1 -0
- data/lib/nextgen/generators/rubocop.rb +2 -1
- data/lib/nextgen/generators/vcr.rb +3 -0
- data/lib/nextgen/version.rb +1 -1
- data/template/.rubocop.yml.tt +0 -9
- data/template/spec/support/system.rb +0 -6
- data/template/spec/support/webmock.rb +1 -0
- data/template/test/application_system_test_case.rb +0 -7
- data/template/test/support/capybara.rb.tt +12 -0
- data/template/test/support/vcr.rb.tt +26 -0
- data/template/test/support/webmock.rb +1 -0
- metadata +10 -6
- data/lib/nextgen/generators/initial_migrations.rb +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1591abd0b5db745b385bf46cd2b7f3322e8e70fa498c227d856e390db9ae0841
|
4
|
+
data.tar.gz: 9d1ed374bda103b54f0c79aaf00a7ada704b3ce3e9c87a0037c0ab2e0d702668
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8430143a55d838a9eeab4ab90a1fb115ec5f1fc3f6b7c0e8780e7bf35f9cdf06e2ba728f86df8a28f697b08b09701ab8b1a8b2b9256e6de17b4981226aef70d0
|
7
|
+
data.tar.gz: 8279239e32266c60ed81c39d69116e4cc9693a2faaed087b1fceb026dbb3e882f4efea4386d640c0ccbc4408981f1d0718e686f4b3473b6bc440ba718755277c
|
data/README.md
CHANGED
@@ -22,7 +22,7 @@ Nextgen is an **interactive** and flexible alternative to `rails new` that inclu
|
|
22
22
|
|
|
23
23
|
[Contribution guide](#contribution-guide)
|
24
24
|
|
25
|
-
|
25
|
+
![Screen recording of Nextgen in action](./demo.gif)
|
26
26
|
|
27
27
|
## About
|
28
28
|
|
@@ -97,6 +97,7 @@ Nextgen can install and configure your choice of these recommended gems:
|
|
97
97
|
- [sidekiq](https://github.com/sidekiq/sidekiq)
|
98
98
|
- [thor](https://github.com/rails/thor)
|
99
99
|
- [tomo](https://github.com/mattbrictson/tomo)
|
100
|
+
- [vcr](https://github.com/vcr/vcr)
|
100
101
|
|
101
102
|
### Node packages
|
102
103
|
|
data/config/generators.yml
CHANGED
@@ -3,10 +3,6 @@ initial_git_commit:
|
|
3
3
|
base:
|
4
4
|
description: "Enhance base Rails template with better docs, etc"
|
5
5
|
|
6
|
-
initial_migrations:
|
7
|
-
description: "Install and run initial migrations"
|
8
|
-
requires: active_record
|
9
|
-
|
10
6
|
clean_gemfile:
|
11
7
|
description: "Clean up Gemfile"
|
12
8
|
|
@@ -133,6 +129,11 @@ tomo:
|
|
133
129
|
prompt: "Tomo"
|
134
130
|
description: "Install tomo gem for SSH-based deployment"
|
135
131
|
|
132
|
+
vcr:
|
133
|
+
prompt: "VCR"
|
134
|
+
description: "Install and configure vcr and webmock gems"
|
135
|
+
requires: test_framework
|
136
|
+
|
136
137
|
rubocop:
|
137
138
|
prompt: "RuboCop"
|
138
139
|
description: "Install rubocop gems; apply formatting rules"
|
data/lib/nextgen/actions.rb
CHANGED
@@ -54,16 +54,18 @@ module Nextgen
|
|
54
54
|
end
|
55
55
|
|
56
56
|
def copy_test_support_file(file)
|
57
|
+
copy_action = file.end_with?(".tt") ? method(:template) : method(:copy_file)
|
58
|
+
|
57
59
|
if minitest?
|
58
60
|
create_test_support_directory
|
59
|
-
|
61
|
+
copy_action.call "test/support/#{file}"
|
60
62
|
elsif rspec?
|
61
63
|
empty_directory "spec/support"
|
62
64
|
spec_file_path = "spec/support/#{file}"
|
63
65
|
if Nextgen.template_path.join(spec_file_path).exist?
|
64
|
-
|
66
|
+
copy_action.call spec_file_path
|
65
67
|
else
|
66
|
-
|
68
|
+
copy_action.call "test/support/#{file}", spec_file_path.sub(/\.tt$/, "")
|
67
69
|
end
|
68
70
|
end
|
69
71
|
end
|
@@ -6,7 +6,8 @@ plugins << "factory_bot" if gemfile.match?(/^\s*gem ['"]factory_bot/)
|
|
6
6
|
plugins << "minitest" if minitest?
|
7
7
|
plugins << "performance"
|
8
8
|
plugins << "rails"
|
9
|
-
|
9
|
+
install_gem("rubocop-rails", version: ">= 2.22.0", group: :development, require: false)
|
10
|
+
install_gems(*plugins.map { "rubocop-#{_1}" }, "rubocop", group: :development, require: false)
|
10
11
|
binstub "rubocop"
|
11
12
|
|
12
13
|
say_git "Generate .rubocop.yml"
|
data/lib/nextgen/version.rb
CHANGED
data/template/.rubocop.yml.tt
CHANGED
@@ -190,15 +190,6 @@ Rails/RootPathnameMethods:
|
|
190
190
|
Rails/SkipsModelValidations:
|
191
191
|
Enabled: false
|
192
192
|
|
193
|
-
<% if Gem::Version.new(Rails.version) >= Gem::Version.new("7.1.0.beta1") -%>
|
194
|
-
Rails/UnknownEnv:
|
195
|
-
Environments:
|
196
|
-
- development
|
197
|
-
- test
|
198
|
-
- production
|
199
|
-
- local
|
200
|
-
<% end -%>
|
201
|
-
|
202
193
|
Rails/Validation:
|
203
194
|
Enabled: false
|
204
195
|
|
@@ -0,0 +1 @@
|
|
1
|
+
require "webmock/rspec"
|
@@ -1,5 +1,4 @@
|
|
1
1
|
require "test_helper"
|
2
|
-
require "capybara/rails"
|
3
2
|
|
4
3
|
class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
|
5
4
|
driven_by :selenium,
|
@@ -9,10 +8,4 @@ class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
|
|
9
8
|
options.add_argument("--disable-dev-shm-usage")
|
10
9
|
options.add_argument("--no-sandbox")
|
11
10
|
end
|
12
|
-
|
13
|
-
setup do
|
14
|
-
Capybara.default_max_wait_time = 2
|
15
|
-
Capybara.disable_animation = true
|
16
|
-
Capybara.server = :puma, {Silent: true}
|
17
|
-
end
|
18
11
|
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require "capybara/rails"
|
2
|
+
<% if rspec? -%>
|
3
|
+
require "capybara/rspec"
|
4
|
+
<% end -%>
|
5
|
+
|
6
|
+
Capybara.configure do |config|
|
7
|
+
config.default_max_wait_time = 2
|
8
|
+
config.disable_animation = true
|
9
|
+
config.enable_aria_label = true
|
10
|
+
config.server = :puma, {Silent: true}
|
11
|
+
config.test_id = "data-testid"
|
12
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require "vcr"
|
2
|
+
|
3
|
+
VCR.configure do |config|
|
4
|
+
config.hook_into :webmock
|
5
|
+
config.allow_http_connections_when_no_cassette = false
|
6
|
+
config.ignore_localhost = true
|
7
|
+
config.ignore_host "chromedriver.storage.googleapis.com"
|
8
|
+
config.cassette_library_dir = File.expand_path("../cassettes", __dir__)
|
9
|
+
<% if rspec? -%>
|
10
|
+
config.configure_rspec_metadata!
|
11
|
+
<% end -%>
|
12
|
+
config.default_cassette_options = {
|
13
|
+
# Enable automatic expiration and re-recording of cassettes
|
14
|
+
# re_record_interval: 1.week,
|
15
|
+
record: ENV["CI"] ? :none : :once,
|
16
|
+
record_on_error: false,
|
17
|
+
match_requests_on: %i[method uri body]
|
18
|
+
}
|
19
|
+
|
20
|
+
# Make sure headers containing secrets aren't recorded in cassettes and stored in git
|
21
|
+
%w[Authorization X-Api-Key].each do |sensitive_header|
|
22
|
+
config.filter_sensitive_data("[#{sensitive_header.upcase}]") do |interaction|
|
23
|
+
interaction.request.headers[sensitive_header]&.first
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
require "webmock/minitest"
|
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.
|
4
|
+
version: 0.3.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: 2023-10-
|
11
|
+
date: 2023-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 7.1.
|
19
|
+
version: 7.1.1
|
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: 7.1.
|
26
|
+
version: 7.1.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: thor
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -120,7 +120,6 @@ files:
|
|
120
120
|
- lib/nextgen/generators/good_migrations.rb
|
121
121
|
- lib/nextgen/generators/home_controller.rb
|
122
122
|
- lib/nextgen/generators/initial_git_commit.rb
|
123
|
-
- lib/nextgen/generators/initial_migrations.rb
|
124
123
|
- lib/nextgen/generators/letter_opener.rb
|
125
124
|
- lib/nextgen/generators/node.rb
|
126
125
|
- lib/nextgen/generators/open_browser_on_start.rb
|
@@ -136,6 +135,7 @@ files:
|
|
136
135
|
- lib/nextgen/generators/stylelint.rb
|
137
136
|
- lib/nextgen/generators/thor.rb
|
138
137
|
- lib/nextgen/generators/tomo.rb
|
138
|
+
- lib/nextgen/generators/vcr.rb
|
139
139
|
- lib/nextgen/generators/vite.rb
|
140
140
|
- lib/nextgen/rails.rb
|
141
141
|
- lib/nextgen/rails_options.rb
|
@@ -183,12 +183,16 @@ files:
|
|
183
183
|
- template/spec/support/mailer.rb
|
184
184
|
- template/spec/support/shoulda.rb
|
185
185
|
- template/spec/support/system.rb
|
186
|
+
- template/spec/support/webmock.rb
|
186
187
|
- template/test/application_system_test_case.rb
|
187
188
|
- template/test/helpers/inline_svg_helper_test.rb
|
189
|
+
- template/test/support/capybara.rb.tt
|
188
190
|
- template/test/support/factory_bot.rb
|
189
191
|
- template/test/support/mailer.rb
|
190
192
|
- template/test/support/shoulda.rb
|
193
|
+
- template/test/support/vcr.rb.tt
|
191
194
|
- template/test/support/vite.rb
|
195
|
+
- template/test/support/webmock.rb
|
192
196
|
homepage: https://github.com/mattbrictson/nextgen
|
193
197
|
licenses:
|
194
198
|
- MIT
|
@@ -213,7 +217,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
213
217
|
- !ruby/object:Gem::Version
|
214
218
|
version: '0'
|
215
219
|
requirements: []
|
216
|
-
rubygems_version: 3.4.
|
220
|
+
rubygems_version: 3.4.21
|
217
221
|
signing_key:
|
218
222
|
specification_version: 4
|
219
223
|
summary: Generate your next Rails app interactively!
|
@@ -1,11 +0,0 @@
|
|
1
|
-
migration_tasks = %w[
|
2
|
-
action_mailbox:install:migrations
|
3
|
-
action_text:install:migrations
|
4
|
-
active_storage:install
|
5
|
-
]
|
6
|
-
all_tasks = rails_command("-T", capture: true).scan(/^\S+\s+(\S+)/).flatten
|
7
|
-
tasks_to_run = migration_tasks & all_tasks
|
8
|
-
return unless tasks_to_run.any?
|
9
|
-
|
10
|
-
tasks_to_run.each { |task| rails_command(task) }
|
11
|
-
rails_command "db:migrate"
|