nextgen 0.2.0 → 0.4.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: 9891f4e3028745d3dfa0d7e225a87e67b499995effab4c41f416bedfbceee804
4
- data.tar.gz: 6a5c2f9f7bf0065263163f67e38720b98bd3dcdb54fe998c43af8e001e4b5e96
3
+ metadata.gz: 07b5db72fd0b2565334a0de9be709d803aac4099527a0f4b559335d8df3061a0
4
+ data.tar.gz: 94cf539ccfe794dc70ba2b46102eef081cb1602b923dc58ed4a2dc3ad8cb121a
5
5
  SHA512:
6
- metadata.gz: c31b1c4ec93cd8c6a99c7ad1e320eace9ac437c023a46b175ed7f5f5b3b234d0af0295f59a2f6d7f3f60a60105be84b25329004b0c5cfb1b8aa912c6ab63661f
7
- data.tar.gz: f11c4657543959b4e7b0da0b567f7852945fa453a53e70f72c42f6cecc7cc8fe9ac451b36897bed4bcaa200567b0fd15989fff700fa9e5af1e5742b4c6cf034e
6
+ metadata.gz: dd455a469651f794c75d88263892587016b930941e1baf7e758cddbb85b51ed3f1efdc78c02065a2dcdbcd55686701decb74cda75efba3702abb178f338c4422
7
+ data.tar.gz: b347b1918083bc71615fe301e504da5c3c9b4e60283f55b5ff812720ec40fe1cd04f3123fdebbdf2469a0799638d39ea3c37028ca514f0b3d93f2d07748dbb07
data/README.md CHANGED
@@ -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
 
@@ -70,6 +70,10 @@ factory_bot_rails:
70
70
  description: "Install and configure factory_bot_rails gem"
71
71
  requires: active_record
72
72
 
73
+ github_pr_template:
74
+ prompt: "GitHub PR template"
75
+ description: "Add GitHub pull request template"
76
+
73
77
  git_safe:
74
78
 
75
79
  good_migrations:
@@ -131,7 +135,7 @@ tomo:
131
135
 
132
136
  vcr:
133
137
  prompt: "VCR"
134
- description: "Install and configure the vcr gem"
138
+ description: "Install and configure vcr and webmock gems"
135
139
  requires: test_framework
136
140
 
137
141
  rubocop:
@@ -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
- copy_file "test/support/#{file}"
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
- copy_file spec_file_path
66
+ copy_action.call spec_file_path
65
67
  else
66
- copy_file "test/support/#{file}", spec_file_path
68
+ copy_action.call "test/support/#{file}", spec_file_path.sub(/\.tt$/, "")
67
69
  end
68
70
  end
69
71
  end
@@ -135,7 +135,7 @@ module Nextgen
135
135
  "MySQL" => "mysql"
136
136
  }
137
137
  all_databases = common_databases.merge(
138
- %w[MySQL Oracle SQLServer JDBCMySQL JDBCSQLite3 JDBCPostgreSQL JDBC].to_h do |name|
138
+ %w[MySQL Trilogy Oracle SQLServer JDBCMySQL JDBCSQLite3 JDBCPostgreSQL JDBC].to_h do |name|
139
139
  [name, name.downcase]
140
140
  end,
141
141
  "None (disable Active Record)" => nil
@@ -185,6 +185,7 @@ module Nextgen
185
185
  rails_opts.javascript = prompt.select(
186
186
  "Which JavaScript bundler will you use with the asset pipeline?",
187
187
  "Importmap (default)" => "importmap",
188
+ "Bun" => "bun",
188
189
  "ESBuild" => "esbuild",
189
190
  "Rollup" => "rollup",
190
191
  "Webpack" => "webpack",
@@ -27,6 +27,7 @@ RUBY
27
27
 
28
28
  if File.exist?("test/application_system_test_case.rb")
29
29
  say_git "Configure system tests"
30
+ copy_test_support_file "capybara.rb.tt"
30
31
  copy_file "test/application_system_test_case.rb", force: true
31
32
  end
32
33
 
@@ -0,0 +1 @@
1
+ template ".github/PULL_REQUEST_TEMPLATE.md.tt"
@@ -1,4 +1,5 @@
1
1
  install_gems "capybara", "selenium-webdriver", group: :test
2
+ copy_test_support_file "capybara.rb.tt"
2
3
  copy_test_support_file "system.rb"
3
4
 
4
5
  copy_file "lib/templates/rspec/system/system_spec.rb"
@@ -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
- install_gems "rubocop", *plugins.map { "rubocop-#{_1}" }, group: :development, require: false
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"
@@ -1,2 +1,3 @@
1
1
  install_gems "vcr", "webmock", group: :test
2
- template "test/support/vcr.rb.tt", rspec? ? "spec/support/vcr.rb" : "test/support/vcr.rb"
2
+ copy_test_support_file "vcr.rb.tt"
3
+ copy_test_support_file "webmock.rb"
@@ -3,6 +3,7 @@ module Nextgen
3
3
  DATABASES = %w[
4
4
  postgresql
5
5
  mysql
6
+ trilogy
6
7
  sqlite3
7
8
  oracle
8
9
  sqlserver
@@ -1,3 +1,3 @@
1
1
  module Nextgen
2
- VERSION = "0.2.0".freeze
2
+ VERSION = "0.4.0".freeze
3
3
  end
@@ -0,0 +1,21 @@
1
+ Problem
2
+ =======
3
+
4
+ <!-- describe what motivated this PR -->
5
+
6
+ <!-- link to issue or ticket -->
7
+
8
+ Solution
9
+ ========
10
+
11
+ Steps to verify
12
+ ---------------
13
+
14
+ 1. step
15
+ 1. step
16
+ 1. step
17
+ <% if File.exist?("app/views/layouts/application.html.erb") -%>
18
+
19
+ Screenshots
20
+ -----------
21
+ <% end -%>
@@ -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
 
@@ -1,9 +1,3 @@
1
- require "capybara/rails"
2
- require "capybara/rspec"
3
-
4
- Capybara.default_max_wait_time = 2
5
- Capybara.disable_animation = true
6
-
7
1
  RSpec.configure do |config|
8
2
  config.before(:each, type: :system) do
9
3
  driven_by :selenium,
@@ -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 @@
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.2.0
4
+ version: 0.4.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-13 00:00:00.000000000 Z
11
+ date: 2023-11-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -117,6 +117,7 @@ files:
117
117
  - lib/nextgen/generators/factory_bot_rails.rb
118
118
  - lib/nextgen/generators/git_safe.rb
119
119
  - lib/nextgen/generators/github_actions.rb
120
+ - lib/nextgen/generators/github_pr_template.rb
120
121
  - lib/nextgen/generators/good_migrations.rb
121
122
  - lib/nextgen/generators/home_controller.rb
122
123
  - lib/nextgen/generators/initial_git_commit.rb
@@ -146,6 +147,7 @@ files:
146
147
  - template/.env.sample
147
148
  - template/.erb-lint.yml.tt
148
149
  - template/.eslintrc.cjs
150
+ - template/.github/PULL_REQUEST_TEMPLATE.md.tt
149
151
  - template/.github/workflows/ci.yml.tt
150
152
  - template/.overcommit.yml.tt
151
153
  - template/.prettierrc.cjs
@@ -183,13 +185,16 @@ files:
183
185
  - template/spec/support/mailer.rb
184
186
  - template/spec/support/shoulda.rb
185
187
  - template/spec/support/system.rb
188
+ - template/spec/support/webmock.rb
186
189
  - template/test/application_system_test_case.rb
187
190
  - template/test/helpers/inline_svg_helper_test.rb
191
+ - template/test/support/capybara.rb.tt
188
192
  - template/test/support/factory_bot.rb
189
193
  - template/test/support/mailer.rb
190
194
  - template/test/support/shoulda.rb
191
195
  - template/test/support/vcr.rb.tt
192
196
  - template/test/support/vite.rb
197
+ - template/test/support/webmock.rb
193
198
  homepage: https://github.com/mattbrictson/nextgen
194
199
  licenses:
195
200
  - MIT
@@ -214,7 +219,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
214
219
  - !ruby/object:Gem::Version
215
220
  version: '0'
216
221
  requirements: []
217
- rubygems_version: 3.4.19
222
+ rubygems_version: 3.4.21
218
223
  signing_key:
219
224
  specification_version: 4
220
225
  summary: Generate your next Rails app interactively!