railties 8.1.1 → 8.1.2

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: ad06383ebe43275c8480b20d685bb24fdc80aa69a356d1993ab326cc2e02af20
4
- data.tar.gz: f99ebe1113417a9c4fb9e29799ded20ffb610aabccacb115d0736ebc0978dfa0
3
+ metadata.gz: ca3632394597a25e87e2bc8fe4df39a8c6866a3b27ddeafc405e71517eac81d4
4
+ data.tar.gz: '02469d5ca0b08fa86f9cdc182c33188694db329c49cdb4728fe8b7f3516d75ed'
5
5
  SHA512:
6
- metadata.gz: 0473b71e3c66b2eb9674b8b94ff40b6a353665d9a9d2f1f7fe972b8dcc944061ce4410571456f89e9aed3f55b2b5dc5b8f9a79a90cf3966f714932b5a49f3440
7
- data.tar.gz: 80338fca595869f2068f85dabea6b910f958b1f7083c4675ab9a31df04a958c4e73c12f7de91f8749d30f11a3fffc335c33f8ce9d9318aac86e6f3a9b9ff647f
6
+ metadata.gz: f7f7f4ed53efe93f3adda429e8b43ef0e9436d821046dad05d6af7df49508e10a6341d84091a80d55081a73737245780ea850c24dae6ff3d5f52589d4abb9122
7
+ data.tar.gz: 0e657ed1142b0f74c2cf15eff6be224a67949ec65b14251536351bbe444eda45c9468aa6bdf68b10e930ec994933ad1c363f9d04d117f9a51542af539d1acea1
data/CHANGELOG.md CHANGED
@@ -1,3 +1,26 @@
1
+ ## Rails 8.1.2 (January 08, 2026) ##
2
+
3
+ * Skip all system test files on app generation.
4
+
5
+ *Eileen M. Uchitelle*
6
+
7
+ * Fix `db:system:change` to correctly update Dockerfile base packages.
8
+
9
+ *Josiah Smith*
10
+
11
+ * Fix devcontainer volume mount when app name differs from folder name.
12
+
13
+ *Rafael Mendonça França*
14
+
15
+ * Fixed the `rails notes` command to properly extract notes in CSS files.
16
+
17
+ *David White*
18
+
19
+ * Fixed the default Dockerfile to properly include the `vendor/` directory during `bundle install`.
20
+
21
+ *Zhong Sheng*
22
+
23
+
1
24
  ## Rails 8.1.1 (October 28, 2025) ##
2
25
 
3
26
  * Do not assume and force SSL in production by default when using Kamal, to allow for out of the box Kamal deployments.
@@ -105,6 +105,13 @@ module Minitest
105
105
  options[:fail_fast] = true
106
106
  end
107
107
 
108
+ if Minitest::VERSION > "6" then
109
+ opts.on "-n", "--name PATTERN", "Include /regexp/ or string for run." do |a|
110
+ warn "Please switch from -n/--name to -i/--include"
111
+ options[:include] = a
112
+ end
113
+ end
114
+
108
115
  opts.on("-c", "--[no-]color", "Enable color in the output") do |value|
109
116
  options[:color] = value
110
117
  end
@@ -22,6 +22,7 @@ module Rails
22
22
  def devcontainer_options
23
23
  @devcontainer_options ||= {
24
24
  app_name: Rails.application.railtie_name.chomp("_application"),
25
+ app_folder: File.basename(Rails.root),
25
26
  database: !!defined?(ActiveRecord) && database,
26
27
  active_storage: !!defined?(ActiveStorage),
27
28
  redis: !!((defined?(ActionCable) && !defined?(SolidCable)) || (defined?(ActiveJob) && !defined?(SolidQueue))),
@@ -9,7 +9,7 @@ module Rails
9
9
  module VERSION
10
10
  MAJOR = 8
11
11
  MINOR = 1
12
- TINY = 1
12
+ TINY = 2
13
13
  PRE = nil
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
@@ -767,6 +767,19 @@ module Rails
767
767
  defined?(JRUBY_VERSION)
768
768
  end
769
769
 
770
+ def version_manager_ruby_version
771
+ return ENV["RBENV_VERSION"] if ENV["RBENV_VERSION"]
772
+ return ENV["rvm_ruby_string"] if ENV["rvm_ruby_string"]
773
+
774
+ version = if RUBY_ENGINE == "ruby"
775
+ Gem.ruby_version.to_s.sub(/\.([a-zA-Z])/, '-\1')
776
+ else
777
+ RUBY_ENGINE_VERSION
778
+ end
779
+
780
+ "#{RUBY_ENGINE}-#{version}"
781
+ end
782
+
770
783
  def empty_directory_with_keep_file(destination, config = {})
771
784
  empty_directory(destination, config)
772
785
  keep_file(destination)
@@ -255,9 +255,10 @@ module Rails
255
255
  end
256
256
 
257
257
  def system_test
258
- empty_directory_with_keep_file "test/system"
259
-
260
- template "test/application_system_test_case.rb"
258
+ if devcontainer? && depends_on_system_test?
259
+ empty_directory_with_keep_file "test/system"
260
+ template "test/application_system_test_case.rb"
261
+ end
261
262
  end
262
263
 
263
264
  def tmp
@@ -283,6 +284,7 @@ module Rails
283
284
  dev: options[:dev],
284
285
  node: using_node?,
285
286
  app_name: app_name,
287
+ app_folder: File.basename(app_path),
286
288
  skip_solid: options[:skip_solid],
287
289
  pretend: options[:pretend]
288
290
  }
@@ -474,7 +476,7 @@ module Rails
474
476
  end
475
477
 
476
478
  def create_system_test_files
477
- build(:system_test) if depends_on_system_test?
479
+ build(:system_test)
478
480
  end
479
481
 
480
482
  def create_storage_files
@@ -61,7 +61,8 @@ RUN curl -fsSL https://bun.sh/install | bash -s -- "bun-v${BUN_VERSION}"
61
61
 
62
62
  <% end -%>
63
63
  # Install application gems
64
- COPY Gemfile Gemfile.lock vendor ./
64
+ COPY vendor/* ./vendor/
65
+ COPY Gemfile Gemfile.lock ./
65
66
 
66
67
  RUN bundle install && \
67
68
  rm -rf ~/.bundle/ "${BUNDLE_PATH}"/ruby/*/cache "${BUNDLE_PATH}"/ruby/*/bundler/gems/*/.git<% if depend_on_bootsnap? -%> && \
@@ -19,17 +19,17 @@ CI.run do
19
19
  step "Security: Brakeman code analysis", "bin/brakeman --quiet --no-pager --exit-on-warn --exit-on-error"
20
20
  <% end -%>
21
21
  <% unless options[:skip_test] -%>
22
- <% if options[:api] || options[:skip_system_test] -%>
23
22
  step "Tests: Rails", "bin/rails test"
24
- <% else %>
25
- step "Tests: Rails", "bin/rails test"
26
- step "Tests: System", "bin/rails test:system"
27
- <% end -%>
28
23
  <% unless options.skip_active_record? -%>
29
24
  step "Tests: Seeds", "env RAILS_ENV=test bin/rails db:seed:replant"
30
25
  <% end -%>
31
26
  <% end -%>
32
27
 
28
+ <% unless options[:skip_test] -%>
29
+ # Optional: Run system tests
30
+ # step "Tests: System", "bin/rails test:system"
31
+ <% end -%>
32
+
33
33
  # Optional: set a green GitHub commit status to unblock PR merge.
34
34
  # Requires the `gh` CLI and `gh extension install basecamp/gh-signoff`.
35
35
  # if success?
@@ -20,7 +20,6 @@ test:
20
20
  <<: *default
21
21
  database: storage/test.sqlite3
22
22
 
23
-
24
23
  <%- if options.skip_kamal? -%>
25
24
  # SQLite3 write its data on the local filesystem, as such it requires
26
25
  # persistent disks. If you are deploying to a managed service, you should
@@ -90,7 +90,6 @@ volumes:
90
90
  # hitting 404 on in-flight requests. Combines all files from new and old
91
91
  # version inside the asset_path.
92
92
  asset_path: /rails/public/assets
93
-
94
93
  <% end -%>
95
94
 
96
95
  # Configure the image builder.
@@ -12,7 +12,7 @@ jobs:
12
12
 
13
13
  steps:
14
14
  - name: Checkout code
15
- uses: actions/checkout@v5
15
+ uses: actions/checkout@v6
16
16
 
17
17
  - name: Set up Ruby
18
18
  uses: ruby/setup-ruby@v1
@@ -36,7 +36,7 @@ jobs:
36
36
 
37
37
  steps:
38
38
  - name: Checkout code
39
- uses: actions/checkout@v5
39
+ uses: actions/checkout@v6
40
40
 
41
41
  - name: Set up Ruby
42
42
  uses: ruby/setup-ruby@v1
@@ -54,7 +54,7 @@ jobs:
54
54
  RUBOCOP_CACHE_ROOT: tmp/rubocop
55
55
  steps:
56
56
  - name: Checkout code
57
- uses: actions/checkout@v5
57
+ uses: actions/checkout@v6
58
58
 
59
59
  - name: Set up Ruby
60
60
  uses: ruby/setup-ruby@v1
@@ -121,7 +121,7 @@ jobs:
121
121
 
122
122
  <%- end -%>
123
123
  - name: Checkout code
124
- uses: actions/checkout@v5
124
+ uses: actions/checkout@v6
125
125
 
126
126
  - name: Set up Ruby
127
127
  uses: ruby/setup-ruby@v1
@@ -194,7 +194,7 @@ jobs:
194
194
 
195
195
  <%- end -%>
196
196
  - name: Checkout code
197
- uses: actions/checkout@v5
197
+ uses: actions/checkout@v6
198
198
 
199
199
  - name: Set up Ruby
200
200
  uses: ruby/setup-ruby@v1
@@ -1 +1 @@
1
- <%= ENV["RBENV_VERSION"] || ENV["rvm_ruby_string"] || "#{RUBY_ENGINE}-#{RUBY_ENGINE_VERSION}" %>
1
+ <%= version_manager_ruby_version %>
@@ -11,7 +11,7 @@ module Rails
11
11
  class ChangeGenerator < Base # :nodoc:
12
12
  include AppName
13
13
 
14
- BASE_PACKAGES = %w( curl libvips )
14
+ BASE_PACKAGES = %w( curl libjemalloc2 libvips )
15
15
  BUILD_PACKAGES = %w( build-essential git )
16
16
 
17
17
  class_option :to, required: true,
@@ -8,6 +8,9 @@ module Rails
8
8
  class_option :app_name, type: :string, default: "rails_app",
9
9
  desc: "Name of the app"
10
10
 
11
+ class_option :app_folder, type: :string, default: nil,
12
+ desc: "The folder name where the app is generated"
13
+
11
14
  class_option :database, enum: Database::DATABASES, type: :string, default: "sqlite3",
12
15
  desc: "Include configuration for selected database"
13
16
 
@@ -67,6 +70,10 @@ module Rails
67
70
  options[:app_name]
68
71
  end
69
72
 
73
+ def app_folder
74
+ options[:app_folder] || app_name
75
+ end
76
+
70
77
  def dependencies
71
78
  return @dependencies if @dependencies
72
79
 
@@ -7,7 +7,7 @@ services:
7
7
  dockerfile: .devcontainer/Dockerfile
8
8
 
9
9
  volumes:
10
- - ../../<%= options[:app_name] %>:/workspaces/<%= options[:app_name] %>:cached
10
+ - ../../<%= app_folder %>:/workspaces/<%= app_folder %>:cached
11
11
 
12
12
  # Overrides default command so things don't shut down after the process ends.
13
13
  command: sleep infinity
@@ -14,7 +14,7 @@ jobs:
14
14
  RUBOCOP_CACHE_ROOT: tmp/rubocop
15
15
  steps:
16
16
  - name: Checkout code
17
- uses: actions/checkout@v5
17
+ uses: actions/checkout@v6
18
18
 
19
19
  - name: Set up Ruby
20
20
  uses: ruby/setup-ruby@v1
@@ -77,7 +77,7 @@ jobs:
77
77
  <%- end -%>
78
78
  steps:
79
79
  - name: Checkout code
80
- uses: actions/checkout@v5
80
+ uses: actions/checkout@v6
81
81
 
82
82
  - name: Set up Ruby
83
83
  uses: ruby/setup-ruby@v1
@@ -26,6 +26,10 @@ module TestUnit # :nodoc:
26
26
  # Generate system tests if this isn't an API only app and the system
27
27
  # tests option is true
28
28
  if !options.api? && options[:system_tests] == "true"
29
+ if !File.exist?(File.join("test/application_system_test_case.rb"))
30
+ template "application_system_test_case.rb", File.join("test", "application_system_test_case.rb")
31
+ end
32
+
29
33
  template "system_test.rb", File.join("test/system", class_path, "#{file_name.pluralize}_test.rb")
30
34
  end
31
35
  end
@@ -0,0 +1,5 @@
1
+ require "test_helper"
2
+
3
+ class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
4
+ driven_by :selenium, using: :headless_chrome, screen_size: [ 1400, 1400 ]
5
+ end
@@ -107,10 +107,14 @@ module Rails
107
107
  PatternExtractor.new(/#\s*(#{tag}):?\s*(.*)$/)
108
108
  end
109
109
 
110
- register_extensions("css", "js") do |tag|
110
+ register_extensions("js") do |tag|
111
111
  PatternExtractor.new(/\/\/\s*(#{tag}):?\s*(.*)$/)
112
112
  end
113
113
 
114
+ register_extensions("css") do |tag|
115
+ PatternExtractor.new(/\/\*\s*(#{tag}):?\s*(.*?)(?:\*\/)?$/)
116
+ end
117
+
114
118
  register_extensions("erb") do |tag|
115
119
  PatternExtractor.new(/<%\s*#\s*(#{tag}):?\s*(.*?)\s*%>/)
116
120
  end
@@ -205,7 +209,7 @@ module Rails
205
209
  results.keys.sort.each do |file|
206
210
  puts "#{file}:"
207
211
  results[file].each do |note|
208
- puts " * #{note.to_s(options)}"
212
+ puts " * #{note.to_s(options).strip}"
209
213
  end
210
214
  puts
211
215
  end
@@ -4,10 +4,31 @@ require "rails/test_unit/runner"
4
4
 
5
5
  module Rails
6
6
  module LineFiltering # :nodoc:
7
- def run(reporter, options = {})
8
- options = options.merge(filter: Rails::TestUnit::Runner.compose_filter(self, options[:filter]))
7
+ def self.extended(obj)
8
+ require "minitest"
9
9
 
10
- super
10
+ case Minitest::VERSION
11
+ when /^5/ then
12
+ obj.extend MT5
13
+ when /^6/ then
14
+ obj.extend MT6
15
+ end
16
+ end
17
+
18
+ module MT5
19
+ def run(reporter, options = {})
20
+ options = options.merge(filter: Rails::TestUnit::Runner.compose_filter(self, options[:filter]))
21
+
22
+ super
23
+ end
24
+ end
25
+
26
+ module MT6
27
+ def run_suite(reporter, options = {})
28
+ options = options.merge(include: Rails::TestUnit::Runner.compose_filter(self, options[:include]))
29
+
30
+ super
31
+ end
11
32
  end
12
33
  end
13
34
  end
@@ -4,9 +4,10 @@ require "minitest"
4
4
 
5
5
  module Rails
6
6
  class TestUnitReporter < Minitest::StatisticsReporter
7
+ @app_root = ENV["RAILS_TEST_PWD"]
7
8
  singleton_class.attr_accessor :app_root
8
9
 
9
- @executable = "bin/rails test"
10
+ @executable = ENV.fetch("RAILS_TEST_EXECUTABLE", "bin/rails test")
10
11
  singleton_class.attr_accessor :executable
11
12
 
12
13
  def prerecord(test_class, test_name)
@@ -61,7 +62,7 @@ module Rails
61
62
 
62
63
  def relative_path_for(file)
63
64
  if app_root
64
- file.sub(/^#{app_root}\/?/, "")
65
+ File.expand_path(file).sub(/^#{app_root}\/?/, "")
65
66
  else
66
67
  file
67
68
  end
@@ -92,10 +93,14 @@ module Rails
92
93
 
93
94
  def app_root
94
95
  @app_root ||= self.class.app_root ||
95
- if defined?(ENGINE_ROOT)
96
+ if ENV["RAILS_TEST_PWD"]
97
+ ENV["RAILS_TEST_PWD"]
98
+ elsif defined?(ENGINE_ROOT)
96
99
  ENGINE_ROOT
97
100
  elsif Rails.respond_to?(:root)
98
101
  Rails.root
102
+ else
103
+ Dir.pwd
99
104
  end
100
105
  end
101
106
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: railties
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.1.1
4
+ version: 8.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
@@ -15,28 +15,28 @@ dependencies:
15
15
  requirements:
16
16
  - - '='
17
17
  - !ruby/object:Gem::Version
18
- version: 8.1.1
18
+ version: 8.1.2
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.1.1
25
+ version: 8.1.2
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: actionpack
28
28
  requirement: !ruby/object:Gem::Requirement
29
29
  requirements:
30
30
  - - '='
31
31
  - !ruby/object:Gem::Version
32
- version: 8.1.1
32
+ version: 8.1.2
33
33
  type: :runtime
34
34
  prerelease: false
35
35
  version_requirements: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - '='
38
38
  - !ruby/object:Gem::Version
39
- version: 8.1.1
39
+ version: 8.1.2
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: rackup
42
42
  requirement: !ruby/object:Gem::Requirement
@@ -133,14 +133,14 @@ dependencies:
133
133
  requirements:
134
134
  - - '='
135
135
  - !ruby/object:Gem::Version
136
- version: 8.1.1
136
+ version: 8.1.2
137
137
  type: :development
138
138
  prerelease: false
139
139
  version_requirements: !ruby/object:Gem::Requirement
140
140
  requirements:
141
141
  - - '='
142
142
  - !ruby/object:Gem::Version
143
- version: 8.1.1
143
+ version: 8.1.2
144
144
  description: 'Rails internals: application bootup, plugins, generators, and rake tasks.'
145
145
  email: david@loudthinking.com
146
146
  executables:
@@ -451,6 +451,7 @@ files:
451
451
  - lib/rails/generators/test_unit/model/templates/unit_test.rb.tt
452
452
  - lib/rails/generators/test_unit/scaffold/scaffold_generator.rb
453
453
  - lib/rails/generators/test_unit/scaffold/templates/api_functional_test.rb.tt
454
+ - lib/rails/generators/test_unit/scaffold/templates/application_system_test_case.rb.tt
454
455
  - lib/rails/generators/test_unit/scaffold/templates/functional_test.rb.tt
455
456
  - lib/rails/generators/test_unit/scaffold/templates/system_test.rb.tt
456
457
  - lib/rails/generators/test_unit/system/system_generator.rb
@@ -508,10 +509,10 @@ licenses:
508
509
  - MIT
509
510
  metadata:
510
511
  bug_tracker_uri: https://github.com/rails/rails/issues
511
- changelog_uri: https://github.com/rails/rails/blob/v8.1.1/railties/CHANGELOG.md
512
- documentation_uri: https://api.rubyonrails.org/v8.1.1/
512
+ changelog_uri: https://github.com/rails/rails/blob/v8.1.2/railties/CHANGELOG.md
513
+ documentation_uri: https://api.rubyonrails.org/v8.1.2/
513
514
  mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
514
- source_code_uri: https://github.com/rails/rails/tree/v8.1.1/railties
515
+ source_code_uri: https://github.com/rails/rails/tree/v8.1.2/railties
515
516
  rubygems_mfa_required: 'true'
516
517
  rdoc_options:
517
518
  - "--exclude"
@@ -529,7 +530,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
529
530
  - !ruby/object:Gem::Version
530
531
  version: '0'
531
532
  requirements: []
532
- rubygems_version: 3.6.9
533
+ rubygems_version: 4.0.3
533
534
  specification_version: 4
534
535
  summary: Tools for creating, working with, and running Rails applications.
535
536
  test_files: []