nextgen 0.35.1 → 0.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 24e7c4ab4df49ee604a2adf4687e705a57171d0fdf57ef967e7247e6f3891a8e
4
- data.tar.gz: 794a80b46d5a9751f0ff55acec3d8107406a97d0f2261dba7e80a30d93f49667
3
+ metadata.gz: 0547fc9946683f3753ce175848f7a7a5b0e96e9212e21d8cdd1f69430fecea05
4
+ data.tar.gz: 72fa1da52395f08d06291dc3c43b6cf38f932b3073dc0b17476780dba2b6ceb0
5
5
  SHA512:
6
- metadata.gz: 105a4b52d22ab7a302880ae2c64584ec4e4c5c8f01a70289d1d9267ab73ab83f5a1a989f3a476cb6444e1ee770b1313dfc3607ed168cca0e29640c7949dbc7f6
7
- data.tar.gz: 4ca4ff9fa7aa2dfb303a3ceb15a062f7658f4810dfd22b9387fbe63020c106c01194202e03ff26a35381dbba76256dab9cb1cde696b2ed76adc30d37a3d74adb
6
+ metadata.gz: f455f1ee06e99bab86cab8dee4ccc955279bb7de8ae2261e5724f36ee01afa59813b20509de74a745cbe15253d465f92311c00df0d4f42928cde202a903bddd2
7
+ data.tar.gz: 11ff219399baaebe36d497109b0b150f52681087fdfdcc52761ce12e78f33a05936f71e01500cf159e0ac528fe536342f08285fd16eb14f075a77fd31d1d19a3
data/README.md CHANGED
@@ -3,7 +3,6 @@
3
3
  [![Gem Version](https://img.shields.io/gem/v/nextgen)](https://rubygems.org/gems/nextgen)
4
4
  [![Gem Downloads](https://img.shields.io/gem/dt/nextgen)](https://www.ruby-toolbox.com/projects/nextgen)
5
5
  [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/mattbrictson/nextgen/ci.yml)](https://github.com/mattbrictson/nextgen/actions/workflows/ci.yml)
6
- [![Code Climate maintainability](https://img.shields.io/codeclimate/maintainability/mattbrictson/nextgen)](https://codeclimate.com/github/mattbrictson/nextgen)
7
6
 
8
7
  Nextgen is an **interactive** and flexible alternative to `rails new` that includes opt-in support for modern frontend development with ⚡️**Vite.**
9
8
 
@@ -26,7 +25,7 @@ Nextgen is an **interactive** and flexible alternative to `rails new` that inclu
26
25
 
27
26
  ## Requirements
28
27
 
29
- Nextgen generates apps using **Rails 8.0**.
28
+ Nextgen generates apps using **Rails 8.1**.
30
29
 
31
30
  - **Ruby 3.2+** is required
32
31
  - **Rubygems 3.4.8+** is required (run `gem update --system` to get it)
@@ -54,7 +53,7 @@ Check out the [examples directory](./examples) to see some Rails apps that were
54
53
 
55
54
  ## What's included
56
55
 
57
- **Nextgen starts with the "omakase" default behavior of `rails new`,** so you get the great things included in Rails 8.0 like RuboCop, a GitHub Actions CI workflow, your choice of database platform, CSS framework, etc. You can also interactively disable parts of the default stack that you don't need, like JBuilder or Action Mailbox.
56
+ **Nextgen starts with the "omakase" default behavior of `rails new`,** so you get the great things included in Rails 8.1 like RuboCop, a GitHub Actions CI workflow, your choice of database platform, CSS framework, etc. You can also interactively disable parts of the default stack that you don't need, like JBuilder or Action Mailbox.
58
57
 
59
58
  On top of that foundation, Nextgen offers dozens of useful enhancements to the vanilla Rails experience. You are free to pick and choose which (if any) of these to apply to your new project. Behind the scenes, **each enhancement is applied in a separate git commit,** so that you can later see what was applied and why, and revert the suggestions if necessary.
60
59
 
@@ -76,7 +75,7 @@ Prefer RSpec? Nextgen can set you up with RSpec, plus the gems and configuration
76
75
  Prefer npm? Nextgen allows you to choose Yarn or npm to manage your app's JavaScript dependencies. Your Dockerfile, CI jobs, `bin/setup` script, etc. will be adjusted appropriately.
77
76
 
78
77
  > [!NOTE]
79
- > As of Rails 8.0, `rails new` is still hard-coded to use Yarn in some places. Therefore you may still need Yarn installed on your system in order to generate a new app. Nextgen will remove these Yarn references from your generated project if you select the npm option.
78
+ > As of Rails 8.1, `rails new` is still hard-coded to use Yarn in some places. Therefore you may still need Yarn installed on your system in order to generate a new app. Nextgen will remove these Yarn references from your generated project if you select the npm option.
80
79
 
81
80
  ### Opinionated RuboCop Config
82
81
 
@@ -87,7 +86,6 @@ By default, Rails apps include RuboCop with a config defined by the [rubocop-rai
87
86
  Nextgen can install and configure your choice of these recommended gems:
88
87
 
89
88
  - [annotaterb](https://github.com/drwl/annotaterb)
90
- - [bundler-audit](https://github.com/rubysec/bundler-audit)
91
89
  - [capybara-lockstep](https://github.com/makandra/capybara-lockstep)
92
90
  - [dotenv](https://github.com/bkeepers/dotenv)
93
91
  - [erb_lint](https://github.com/Shopify/erb_lint)
@@ -45,10 +45,6 @@ basic_auth:
45
45
  prompt: "BasicAuth controller concern"
46
46
  description: "Allow app to be secured with ENV-based basic auth credentials"
47
47
 
48
- bundler_audit:
49
- prompt: "Bundler Audit"
50
- description: "Install bundler-audit gem to detect CVEs in Ruby dependencies"
51
-
52
48
  capybara_lockstep:
53
49
  prompt: "capybara-lockstep"
54
50
  description: "Install capybara-lockstep gem for less-flaky browser testing"
@@ -18,6 +18,7 @@ current: &current
18
18
  mariadb-trilogy: MariaDB-Trilogy
19
19
  default_features:
20
20
  brakeman: Brakeman
21
+ bundler-audit: bundler-audit
21
22
  ci: GitHub Actions CI
22
23
  kamal: Kamal
23
24
  rubocop: RuboCop
@@ -29,7 +30,7 @@ current: &current
29
30
  edge:
30
31
  <<: *current
31
32
  args: ["--edge"]
32
- label: "edge (8-0-stable)"
33
+ label: "edge (8-1-stable)"
33
34
 
34
35
  main:
35
36
  <<: *current
@@ -143,9 +143,9 @@ module Nextgen
143
143
 
144
144
  paths.reverse_each do |path|
145
145
  gsub_file("config/application.rb", /autoload_lib\(ignore: %w.*$/) do |match|
146
- next match if match.match?(/%w.*[\(\[ ]#{Regexp.quote(path)}[ \)\]]/)
146
+ next match if match.match?(/%w.*[(\[ ]#{Regexp.quote(path)}[ )\]]/)
147
147
 
148
- match.sub(/%w[\(\[]/, '\0' + path + " ")
148
+ match.sub(/%w[(\[]/, '\0' + path + " ")
149
149
  end
150
150
  end
151
151
  end
@@ -41,7 +41,9 @@ if File.exist?("test/application_system_test_case.rb")
41
41
  end
42
42
 
43
43
  missing_ruby_decl = !File.read("Gemfile").match?(/^ruby /)
44
- if missing_ruby_decl && File.exist?(".ruby-version") && File.read(".ruby-version").match?(/\A\d+\.\d+.\d+.\s*\z/m)
44
+ if missing_ruby_decl &&
45
+ File.exist?(".ruby-version") &&
46
+ File.read(".ruby-version").match?(/\A(ruby-)?\d+\.\d+.\d+.\s*\z/m)
45
47
  say_git "Add ruby declaration to Gemfile"
46
48
  ruby_decl = if bundler_ruby_file_supported?
47
49
  'ruby file: ".ruby-version"'
@@ -58,7 +60,6 @@ if File.exist?("app/views/layouts/application.html.erb")
58
60
  gsub_file "app/views/layouts/application.html.erb", "<html>", '<html lang="en">'
59
61
  gsub_file "app/views/layouts/application.html.erb", %r{^\s*<title>.*</title>}, <<~ERB.gsub(/^/, " ").rstrip
60
62
  <title><%= content_for?(:title) ? strip_tags(yield(:title)) : #{app_const_base.titleize.inspect} %></title>
61
- <meta name="apple-mobile-web-app-title" content="#{app_const_base.titleize}">
62
63
  ERB
63
64
  end
64
65
 
@@ -4,6 +4,7 @@ say_git "Install erb_lint"
4
4
  install_gem "erb_lint", group: :development, require: false
5
5
  binstub "erb_lint"
6
6
  template ".erb_lint.yml.tt"
7
+ gitignore "/.erb_lint_cache"
7
8
 
8
9
  say_git "Add erb_lint to default rake task"
9
10
  copy_file "lib/tasks/erb_lint.rake"
@@ -16,7 +17,7 @@ if File.exist?(".github/workflows/ci.yml")
16
17
  runs-on: ubuntu-latest
17
18
  steps:
18
19
  - name: Checkout code
19
- uses: actions/checkout@v4
20
+ uses: actions/checkout@v5
20
21
 
21
22
  - name: Set up Ruby
22
23
  uses: ruby/setup-ruby@v1
@@ -33,10 +33,10 @@ if File.exist?(".github/workflows/ci.yml")
33
33
 
34
34
  steps:
35
35
  - name: Checkout code
36
- uses: actions/checkout@v4
36
+ uses: actions/checkout@v5
37
37
 
38
38
  - name: Set up Node
39
- uses: actions/setup-node@v4
39
+ uses: actions/setup-node@v5
40
40
  with:
41
41
  #{node_spec}
42
42
  cache: #{js_package_manager}
@@ -25,7 +25,7 @@ erb = <<~YAML
25
25
 
26
26
  <%- end -%>
27
27
  - name: Checkout code
28
- uses: actions/checkout@v4
28
+ uses: actions/checkout@v5
29
29
 
30
30
  - name: Set up Ruby
31
31
  uses: ruby/setup-ruby@v1
@@ -30,10 +30,10 @@ if File.exist?(".github/workflows/ci.yml")
30
30
 
31
31
  steps:
32
32
  - name: Checkout code
33
- uses: actions/checkout@v4
33
+ uses: actions/checkout@v5
34
34
 
35
35
  - name: Set up Node
36
- uses: actions/setup-node@v4
36
+ uses: actions/setup-node@v5
37
37
  with:
38
38
  #{node_spec}
39
39
  cache: #{js_package_manager}
@@ -125,7 +125,7 @@ if File.exist?(".github/workflows/ci.yml")
125
125
  inject_into_file ".github/workflows/ci.yml", <<-YAML, before: /^\s+- name: Run tests/
126
126
 
127
127
  - name: Set up Node
128
- uses: actions/setup-node@v4
128
+ uses: actions/setup-node@v5
129
129
  with:
130
130
  #{node_spec}
131
131
  cache: #{js_package_manager}
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nextgen
4
- VERSION = "0.35.1"
4
+ VERSION = "0.37.0"
5
5
  end
@@ -9,7 +9,7 @@ PreCommit:
9
9
  ErbLint:
10
10
  enabled: true
11
11
  required_executable: bundle
12
- command: ["bundle", "exec", "erb_lint"]
12
+ command: ["bundle", "exec", "erb_lint", "--cache"]
13
13
  include: "**/*.html.erb"
14
14
  <% end -%>
15
15
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  desc "Run erb_lint"
4
4
  task :erb_lint do
5
- sh "bin/erb_lint --lint-all"
5
+ sh "bin/erb_lint --lint-all --cache"
6
6
  end
7
7
 
8
8
  namespace :erb_lint do
@@ -3,6 +3,5 @@
3
3
  return if ViteRuby.config.auto_build
4
4
 
5
5
  # Compile assets once at the start of testing
6
- require "benchmark"
7
- seconds = Benchmark.realtime { ViteRuby.commands.build }
6
+ seconds = ActiveSupport::Benchmark.realtime { ViteRuby.commands.build }
8
7
  puts format("Built Vite assets (%.1fms)", seconds * 1_000)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nextgen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.35.1
4
+ version: 0.37.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Brictson
@@ -15,14 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - "~>"
17
17
  - !ruby/object:Gem::Version
18
- version: 8.0.0
18
+ version: 8.1.0
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - "~>"
24
24
  - !ruby/object:Gem::Version
25
- version: 8.0.0
25
+ version: 8.1.0
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: thor
28
28
  requirement: !ruby/object:Gem::Requirement
@@ -107,7 +107,6 @@ files:
107
107
  - lib/nextgen/generators/annotaterb.rb
108
108
  - lib/nextgen/generators/base.rb
109
109
  - lib/nextgen/generators/basic_auth.rb
110
- - lib/nextgen/generators/bundler_audit.rb
111
110
  - lib/nextgen/generators/capybara_lockstep.rb
112
111
  - lib/nextgen/generators/clean_gemfile.rb
113
112
  - lib/nextgen/generators/dotenv.rb
@@ -225,7 +224,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
225
224
  - !ruby/object:Gem::Version
226
225
  version: '0'
227
226
  requirements: []
228
- rubygems_version: 3.6.9
227
+ rubygems_version: 3.7.2
229
228
  specification_version: 4
230
229
  summary: Generate your next Rails app interactively!
231
230
  test_files: []
@@ -1,26 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- install_gem "bundler-audit", group: :development, require: false
4
- binstub "bundler-audit"
5
-
6
- if File.exist?(".github/workflows/ci.yml")
7
- say_git "Add bundle-audit job to CI workflow"
8
- inject_into_file ".github/workflows/ci.yml", <<-YAML, after: /^jobs:\n/
9
- scan_gems:
10
- runs-on: ubuntu-latest
11
-
12
- steps:
13
- - name: Checkout code
14
- uses: actions/checkout@v4
15
-
16
- - name: Set up Ruby
17
- uses: ruby/setup-ruby@v1
18
- with:
19
- ruby-version: .ruby-version
20
- bundler-cache: true
21
-
22
- - name: Scan for security vulnerabilities in Ruby dependencies
23
- run: bundle exec bundle-audit check --update -v
24
-
25
- YAML
26
- end