railties 8.0.0.1 → 8.0.1

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: 7fca089938bf115d240c9b62e4accfcba3bdc04e73448a93187748b1a20661bc
4
- data.tar.gz: cedc794ab75fabf3f2e6a74f44cf19b0c36243afe38a4e21d9a063b173e37cec
3
+ metadata.gz: adc7a54226a0d457897877951d6e57773a0410509532712c3f23e4a327eba22b
4
+ data.tar.gz: 9a4fdb1a2b8d77039f670694c6639162577cf832cd92653fb4f95a14c9d16980
5
5
  SHA512:
6
- metadata.gz: 97156cb0b8c0459441fe390bf5bb5731c7746b49a532bdf0474d92ba38fd982e16c257ca02b529ce6548dad90e70d2f49d3e683e24fb2a6268fd2896305529bd
7
- data.tar.gz: a08eec8d223b51e6f9962e3a8e984759a8a4a2c58b775bca52511f35ebb32090c23421532fcdfc42a00738bb7c7544a4b7bb082cc40ab6a9ea694a04135f1f12
6
+ metadata.gz: c9135f6974186b7c1e6fb473416bf5c5c63affa34fecc4e2bd9714d9690e68a68061a1229d34fab7379eae97b110985543e2dff22cc111160276bdda16dc1b3e
7
+ data.tar.gz: '0354482884c4a3f5d8959603d602b2a1064409e825fab90cdad52b81f2db32bcdacc4f2697ffd679bf37d77adc6b6f47f7da456d48390a19b6ec5ce049448bf6'
data/CHANGELOG.md CHANGED
@@ -1,3 +1,18 @@
1
+ ## Rails 8.0.1 (December 13, 2024) ##
2
+
3
+ * Skip generation system tests related code for CI when `--skip-system-test` is given.
4
+
5
+ *fatkodima*
6
+
7
+ * Don't add bin/thrust if thruster is not in Gemfile.
8
+
9
+ *Étienne Barrié*
10
+
11
+ * Don't install a package for system test when applications don't use it.
12
+
13
+ *y-yagi*
14
+
15
+
1
16
  ## Rails 8.0.0.1 (December 10, 2024) ##
2
17
 
3
18
  * No changes.
@@ -25,7 +25,7 @@ module Minitest
25
25
  end
26
26
  end
27
27
 
28
- class ProfileReporter < StatisticsReporter
28
+ class ProfileReporter < Reporter
29
29
  def initialize(io = $stdout, options = {})
30
30
  super
31
31
  @results = []
@@ -345,7 +345,7 @@ module Rails
345
345
  action_dispatch.strict_freshness = true
346
346
  end
347
347
 
348
- Regexp.timeout ||= 1
348
+ Regexp.timeout ||= 1 if Regexp.respond_to?(:timeout=)
349
349
  else
350
350
  raise "Unknown version #{target_version.to_s.inspect}"
351
351
  end
@@ -12,6 +12,9 @@ module Rails
12
12
 
13
13
  desc "update", "Update configs and some other initially generated files (or use just update:configs or update:bin)"
14
14
  def perform
15
+ require_application!
16
+ Rails.application.deprecators.silenced = true
17
+
15
18
  configs
16
19
  bin
17
20
  public_directory
@@ -21,26 +24,22 @@ module Rails
21
24
 
22
25
  desc "configs", "Update config files in the application config/ directory", hide: true
23
26
  def configs
24
- require_application!
25
27
  app_generator.create_boot_file
26
28
  app_generator.update_config_files
27
29
  end
28
30
 
29
31
  desc "bin", "Add or update executables in the application bin/ directory", hide: true
30
32
  def bin
31
- require_application!
32
33
  app_generator.update_bin_files
33
34
  end
34
35
 
35
36
  desc "public_directory", "Add or update files in the application public/ directory", hide: true
36
37
  def public_directory
37
- require_application!
38
38
  app_generator.create_public_files
39
39
  end
40
40
 
41
41
  desc "active_storage", "Run the active_storage:update command", hide: true
42
42
  def active_storage
43
- require_application!
44
43
  app_generator.update_active_storage
45
44
  end
46
45
 
@@ -71,6 +70,7 @@ module Rails
71
70
  skip_action_cable: !defined?(ActionCable::Engine),
72
71
  skip_brakeman: skip_gem?("brakeman"),
73
72
  skip_rubocop: skip_gem?("rubocop"),
73
+ skip_thruster: skip_gem?("thruster"),
74
74
  skip_test: !defined?(Rails::TestUnitRailtie),
75
75
  skip_system_test: Rails.application.config.generators.system_tests.nil?,
76
76
  skip_asset_pipeline: asset_pipeline.nil?,
@@ -59,22 +59,11 @@ module Rails
59
59
  end
60
60
  end
61
61
 
62
- class ReloadCommand < IRB::Command::Base
63
- category "Rails console"
64
- description "Reloads the Rails application."
65
-
66
- def execute(*)
67
- puts "Reloading..."
68
- Rails.application.reloader.reload!
69
- end
70
- end
71
-
72
62
  IRB::HelperMethod.register(:helper, ControllerHelper)
73
63
  IRB::HelperMethod.register(:controller, ControllerInstance)
74
64
  IRB::HelperMethod.register(:new_session, NewSession)
75
65
  IRB::HelperMethod.register(:app, AppInstance)
76
66
  IRB::HelperMethod.register(:reload!, ReloadHelper)
77
- IRB::Command.register(:reload!, ReloadCommand)
78
67
 
79
68
  class IRBConsole
80
69
  def initialize(app)
@@ -9,8 +9,8 @@ module Rails
9
9
  module VERSION
10
10
  MAJOR = 8
11
11
  MINOR = 0
12
- TINY = 0
13
- PRE = "1"
12
+ TINY = 1
13
+ PRE = nil
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
16
16
  end
@@ -609,6 +609,14 @@ module Rails
609
609
  packages.compact.sort
610
610
  end
611
611
 
612
+ def ci_packages
613
+ if depends_on_system_test?
614
+ dockerfile_build_packages << "google-chrome-stable"
615
+ else
616
+ dockerfile_build_packages
617
+ end
618
+ end
619
+
612
620
  def css_gemfile_entry
613
621
  return if options[:api]
614
622
  return unless options[:css]
@@ -47,6 +47,12 @@
47
47
  /.github
48
48
  <% end -%>
49
49
 
50
+ <% unless options.skip_kamal? -%>
51
+ # Ignore Kamal files.
52
+ /config/deploy*.yml
53
+ /.kamal
54
+
55
+ <% end -%>
50
56
  # Ignore development files
51
57
  /.devcontainer
52
58
 
@@ -24,7 +24,7 @@ jobs:
24
24
  run: bin/brakeman --no-pager
25
25
 
26
26
  <% end -%>
27
- <%- if options[:javascript] == "importmap" && !options[:api] -%>
27
+ <%- if options[:javascript] == "importmap" && !options[:api] && !options[:skip_javascript] -%>
28
28
  scan_js:
29
29
  runs-on: ubuntu-latest
30
30
 
@@ -100,7 +100,7 @@ jobs:
100
100
  <%- end -%>
101
101
  steps:
102
102
  - name: Install packages
103
- run: sudo apt-get update && sudo apt-get install --no-install-recommends -y google-chrome-stable <%= dockerfile_base_packages.join(" ") %>
103
+ run: sudo apt-get update && sudo apt-get install --no-install-recommends -y <%= ci_packages.join(" ") %>
104
104
 
105
105
  - name: Checkout code
106
106
  uses: actions/checkout@v4
@@ -126,12 +126,12 @@ jobs:
126
126
  DATABASE_URL: postgres://postgres:postgres@localhost:5432
127
127
  <%- end -%>
128
128
  # REDIS_URL: redis://localhost:6379/0
129
- <%- if options[:api] -%>
129
+ <%- if options[:api] || options[:skip_system_test] -%>
130
130
  run: bin/rails db:test:prepare test
131
131
  <%- else -%>
132
132
  run: bin/rails db:test:prepare test test:system
133
133
  <%- end -%>
134
- <%- unless options[:api] -%>
134
+ <%- unless options[:api] || options[:skip_system_test] -%>
135
135
 
136
136
  - name: Keep screenshots from failed system tests
137
137
  uses: actions/upload-artifact@v4
@@ -21,16 +21,14 @@ module Authentication
21
21
  resume_session || request_authentication
22
22
  end
23
23
 
24
-
25
24
  def resume_session
26
25
  Current.session ||= find_session_by_cookie
27
26
  end
28
27
 
29
28
  def find_session_by_cookie
30
- Session.find_by(id: cookies.signed[:session_id])
29
+ Session.find_by(id: cookies.signed[:session_id]) if cookies.signed[:session_id]
31
30
  end
32
31
 
33
-
34
32
  def request_authentication
35
33
  session[:return_to_after_authenticating] = request.url
36
34
  redirect_to new_session_path
@@ -40,7 +38,6 @@ module Authentication
40
38
  session.delete(:return_to_after_authenticating) || root_url
41
39
  end
42
40
 
43
-
44
41
  def start_new_session_for(user)
45
42
  user.sessions.create!(user_agent: request.user_agent, ip_address: request.remote_ip).tap do |session|
46
43
  Current.session = session
@@ -64,7 +64,7 @@ jobs:
64
64
  <%- end -%>
65
65
  steps:
66
66
  - name: Install packages
67
- run: sudo apt-get update && sudo apt-get install --no-install-recommends -y google-chrome-stable <%= dockerfile_base_packages.join(" ") %>
67
+ run: sudo apt-get update && sudo apt-get install --no-install-recommends -y <%= ci_packages.join(" ") %>
68
68
 
69
69
  - name: Checkout code
70
70
  uses: actions/checkout@v4
@@ -13,29 +13,32 @@ if defined?(Prism)
13
13
  # Parse a test file to extract the line ranges of all tests in both
14
14
  # method-style (def test_foo) and declarative-style (test "foo" do)
15
15
  module TestParser
16
+ @begins_to_ends = {}
16
17
  # Helper to translate a method object into the path and line range where
17
18
  # the method was defined.
18
19
  def self.definition_for(method)
19
20
  filepath, start_line = method.source_location
20
- queue = [Prism.parse_file(filepath).value]
21
+ @begins_to_ends[filepath] ||= ranges(filepath)
22
+ return unless end_line = @begins_to_ends[filepath][start_line]
23
+ [filepath, start_line..end_line]
24
+ end
21
25
 
22
- while (node = queue.shift)
23
- case node.type
24
- when :def_node
25
- if node.location.start_line == start_line
26
- return [filepath, start_line..node.location.end_line]
26
+ private
27
+ def self.ranges(filepath)
28
+ queue = [Prism.parse_file(filepath).value]
29
+ begins_to_ends = {}
30
+ while (node = queue.shift)
31
+ case node.type
32
+ when :def_node
33
+ begins_to_ends[node.location.start_line] = node.location.end_line
34
+ when :call_node
35
+ begins_to_ends[node.location.start_line] = node.location.end_line
27
36
  end
28
- when :call_node
29
- if node.location.start_line == start_line
30
- return [filepath, start_line..node.location.end_line]
31
- end
32
- end
33
37
 
34
- queue.concat(node.compact_child_nodes)
38
+ queue.concat(node.compact_child_nodes)
39
+ end
40
+ begins_to_ends
35
41
  end
36
-
37
- nil
38
- end
39
42
  end
40
43
  end
41
44
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: railties
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.0.0.1
4
+ version: 8.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-12-10 00:00:00.000000000 Z
11
+ date: 2024-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 8.0.0.1
19
+ version: 8.0.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: 8.0.0.1
26
+ version: 8.0.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: actionpack
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 8.0.0.1
33
+ version: 8.0.1
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 8.0.0.1
40
+ version: 8.0.1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rackup
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -120,14 +120,14 @@ dependencies:
120
120
  requirements:
121
121
  - - '='
122
122
  - !ruby/object:Gem::Version
123
- version: 8.0.0.1
123
+ version: 8.0.1
124
124
  type: :development
125
125
  prerelease: false
126
126
  version_requirements: !ruby/object:Gem::Requirement
127
127
  requirements:
128
128
  - - '='
129
129
  - !ruby/object:Gem::Version
130
- version: 8.0.0.1
130
+ version: 8.0.1
131
131
  description: 'Rails internals: application bootup, plugins, generators, and rake tasks.'
132
132
  email: david@loudthinking.com
133
133
  executables:
@@ -491,10 +491,10 @@ licenses:
491
491
  - MIT
492
492
  metadata:
493
493
  bug_tracker_uri: https://github.com/rails/rails/issues
494
- changelog_uri: https://github.com/rails/rails/blob/v8.0.0.1/railties/CHANGELOG.md
495
- documentation_uri: https://api.rubyonrails.org/v8.0.0.1/
494
+ changelog_uri: https://github.com/rails/rails/blob/v8.0.1/railties/CHANGELOG.md
495
+ documentation_uri: https://api.rubyonrails.org/v8.0.1/
496
496
  mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
497
- source_code_uri: https://github.com/rails/rails/tree/v8.0.0.1/railties
497
+ source_code_uri: https://github.com/rails/rails/tree/v8.0.1/railties
498
498
  rubygems_mfa_required: 'true'
499
499
  post_install_message:
500
500
  rdoc_options: