rails-rfc6570 3.4.0 → 3.5.1
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 +4 -4
- data/CHANGELOG.md +15 -4
- data/README.md +3 -3
- data/lib/rails/rfc6570/formatter.rb +9 -12
- data/lib/rails/rfc6570/patches.rb +1 -1
- data/lib/rails/rfc6570/version.rb +2 -2
- data/lib/rails/rfc6570.rb +3 -3
- data/spec/rails/rfc6570_spec.rb +64 -1
- data/vendor/bundle/ruby/3.4.0/bundler/gems/rubocop-config-3bcd2110ca87/README.md +23 -0
- data/vendor/bundle/ruby/3.4.0/bundler/gems/{rubocop-config-67802c9d1826 → rubocop-config-3bcd2110ca87}/rubocop-config.gemspec +11 -11
- data/vendor/bundle/ruby/3.4.0/gems/{actionpack-8.0.1 → actionpack-8.0.3}/CHANGELOG.md +80 -0
- data/vendor/bundle/ruby/3.4.0/gems/{actionpack-8.0.1 → actionpack-8.0.3}/README.rdoc +1 -1
- data/vendor/bundle/ruby/3.4.0/gems/actionview-8.0.3/CHANGELOG.md +129 -0
- data/vendor/bundle/ruby/3.4.0/gems/{actionview-8.0.1 → actionview-8.0.3}/README.rdoc +1 -1
- data/vendor/bundle/ruby/3.4.0/gems/{activesupport-8.0.1 → activesupport-8.0.3}/CHANGELOG.md +152 -0
- data/vendor/bundle/ruby/3.4.0/gems/{activesupport-8.0.1 → activesupport-8.0.3}/README.rdoc +1 -1
- data/vendor/bundle/ruby/3.4.0/gems/{benchmark-0.4.0 → benchmark-0.4.1}/README.md +1 -1
- data/vendor/bundle/ruby/3.4.0/gems/{connection_pool-2.5.0 → connection_pool-2.5.4}/README.md +21 -0
- data/vendor/bundle/ruby/3.4.0/gems/diff-lcs-1.6.2/CHANGELOG.md +518 -0
- data/vendor/bundle/ruby/3.4.0/gems/diff-lcs-1.6.2/README.md +92 -0
- data/vendor/bundle/ruby/3.4.0/gems/{drb-2.2.1 → drb-2.2.3}/drb.gemspec +2 -1
- data/vendor/bundle/ruby/3.4.0/gems/{loofah-2.24.0 → loofah-2.24.1}/CHANGELOG.md +7 -0
- data/vendor/bundle/ruby/3.4.0/gems/{minitest-5.25.4 → minitest-5.25.5}/README.rdoc +16 -9
- data/vendor/bundle/ruby/3.4.0/gems/{public_suffix-6.0.1 → public_suffix-6.0.2}/CHANGELOG.md +7 -0
- data/vendor/bundle/ruby/3.4.0/gems/{public_suffix-6.0.1 → public_suffix-6.0.2}/LICENSE.txt +1 -1
- data/vendor/bundle/ruby/3.4.0/gems/{public_suffix-6.0.1 → public_suffix-6.0.2}/README.md +1 -1
- data/vendor/bundle/ruby/3.4.0/gems/{rack-3.1.9 → rack-3.2.1}/CHANGELOG.md +232 -2
- data/vendor/bundle/ruby/3.4.0/gems/{rack-3.1.9 → rack-3.2.1}/README.md +68 -20
- data/vendor/bundle/ruby/3.4.0/gems/{rails-dom-testing-2.2.0 → rails-dom-testing-2.3.0}/README.md +3 -0
- data/vendor/bundle/ruby/3.4.0/gems/{rake-13.2.1 → rake-13.3.0}/README.rdoc +5 -5
- data/vendor/bundle/ruby/3.4.0/gems/{rake-13.2.1 → rake-13.3.0}/rake.gemspec +2 -2
- data/vendor/bundle/ruby/3.4.0/gems/{uri-1.0.2 → uri-1.0.3}/README.md +1 -1
- data/vendor/bundle/ruby/3.4.0/specifications/{actionpack-8.0.1.gemspec → actionpack-8.0.3.gemspec} +9 -9
- data/vendor/bundle/ruby/3.4.0/specifications/{actionview-8.0.1.gemspec → actionview-8.0.3.gemspec} +9 -9
- data/vendor/bundle/ruby/3.4.0/specifications/{activesupport-8.0.1.gemspec → activesupport-8.0.3.gemspec} +6 -6
- data/vendor/bundle/ruby/3.4.0/specifications/addressable-2.8.7.gemspec +1 -1
- data/vendor/bundle/ruby/3.4.0/specifications/{base64-0.2.0.gemspec → base64-0.3.0.gemspec} +6 -6
- data/vendor/bundle/ruby/3.4.0/specifications/{benchmark-0.4.0.gemspec → benchmark-0.4.1.gemspec} +4 -4
- data/vendor/bundle/ruby/3.4.0/specifications/{bigdecimal-3.1.9.gemspec → bigdecimal-3.2.3.gemspec} +5 -5
- data/vendor/bundle/ruby/3.4.0/specifications/builder-3.3.0.gemspec +1 -1
- data/vendor/bundle/ruby/3.4.0/specifications/concurrent-ruby-1.3.5.gemspec +1 -1
- data/vendor/bundle/ruby/3.4.0/specifications/{connection_pool-2.5.0.gemspec → connection_pool-2.5.4.gemspec} +5 -5
- data/vendor/bundle/ruby/3.4.0/specifications/crass-1.0.6.gemspec +1 -1
- data/vendor/bundle/ruby/3.4.0/specifications/diff-lcs-1.6.2.gemspec +35 -0
- data/vendor/bundle/ruby/3.4.0/specifications/{drb-2.2.1.gemspec → drb-2.2.3.gemspec} +6 -6
- data/vendor/bundle/ruby/3.4.0/specifications/erubi-1.13.1.gemspec +1 -1
- data/vendor/bundle/ruby/3.4.0/specifications/i18n-1.14.7.gemspec +1 -1
- data/vendor/bundle/ruby/3.4.0/specifications/{logger-1.6.5.gemspec → logger-1.7.0.gemspec} +4 -4
- data/vendor/bundle/ruby/3.4.0/specifications/{loofah-2.24.0.gemspec → loofah-2.24.1.gemspec} +5 -5
- data/vendor/bundle/ruby/3.4.0/specifications/{minitest-5.25.4.gemspec → minitest-5.25.5.gemspec} +7 -7
- data/vendor/bundle/ruby/3.4.0/specifications/{nokogiri-1.18.2-x86_64-linux-gnu.gemspec → nokogiri-1.18.10-x86_64-linux-gnu.gemspec} +4 -4
- data/vendor/bundle/ruby/3.4.0/specifications/{public_suffix-6.0.1.gemspec → public_suffix-6.0.2.gemspec} +6 -6
- data/vendor/bundle/ruby/3.4.0/specifications/racc-1.8.1.gemspec +1 -1
- data/vendor/bundle/ruby/3.4.0/specifications/{rack-3.1.9.gemspec → rack-3.2.1.gemspec} +7 -7
- data/vendor/bundle/ruby/3.4.0/specifications/{rack-session-2.1.0.gemspec → rack-session-2.1.1.gemspec} +4 -4
- data/vendor/bundle/ruby/3.4.0/specifications/rack-test-2.2.0.gemspec +1 -1
- data/vendor/bundle/ruby/3.4.0/specifications/{rails-dom-testing-2.2.0.gemspec → rails-dom-testing-2.3.0.gemspec} +5 -5
- data/vendor/bundle/ruby/3.4.0/specifications/rails-html-sanitizer-1.6.2.gemspec +1 -1
- data/vendor/bundle/ruby/3.4.0/specifications/{rake-13.2.1.gemspec → rake-13.3.0.gemspec} +6 -6
- data/vendor/bundle/ruby/3.4.0/specifications/rake-release-1.3.0.gemspec +1 -1
- data/vendor/bundle/ruby/3.4.0/specifications/{rspec-3.13.0.gemspec → rspec-3.13.1.gemspec} +9 -9
- data/vendor/bundle/ruby/3.4.0/specifications/rspec-core-3.13.5.gemspec +31 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rspec-expectations-3.13.5.gemspec +29 -0
- data/vendor/bundle/ruby/3.4.0/specifications/rspec-mocks-3.13.5.gemspec +29 -0
- data/vendor/bundle/ruby/3.4.0/specifications/{rspec-support-3.13.2.gemspec → rspec-support-3.13.6.gemspec} +9 -9
- data/vendor/bundle/ruby/3.4.0/specifications/securerandom-0.4.1.gemspec +1 -1
- data/vendor/bundle/ruby/3.4.0/specifications/tzinfo-2.0.6.gemspec +1 -1
- data/vendor/bundle/ruby/3.4.0/specifications/{uri-1.0.2.gemspec → uri-1.0.3.gemspec} +4 -4
- data/vendor/bundle/ruby/3.4.0/specifications/useragent-0.16.11.gemspec +1 -1
- metadata +81 -82
- data/vendor/bundle/ruby/3.4.0/bundler/gems/rubocop-config-67802c9d1826/README.md +0 -23
- data/vendor/bundle/ruby/3.4.0/gems/actionview-8.0.1/CHANGELOG.md +0 -67
- data/vendor/bundle/ruby/3.4.0/gems/diff-lcs-1.5.1/README.rdoc +0 -84
- data/vendor/bundle/ruby/3.4.0/gems/drb-2.2.1/LICENSE.txt +0 -22
- data/vendor/bundle/ruby/3.4.0/gems/logger-1.6.5/logger.gemspec +0 -28
- data/vendor/bundle/ruby/3.4.0/specifications/diff-lcs-1.5.1.gemspec +0 -37
- data/vendor/bundle/ruby/3.4.0/specifications/rspec-core-3.13.2.gemspec +0 -39
- data/vendor/bundle/ruby/3.4.0/specifications/rspec-expectations-3.13.3.gemspec +0 -33
- data/vendor/bundle/ruby/3.4.0/specifications/rspec-mocks-3.13.2.gemspec +0 -33
- /data/vendor/bundle/ruby/3.4.0/bundler/gems/{rubocop-config-67802c9d1826 → rubocop-config-3bcd2110ca87}/LICENSE +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{actionpack-8.0.1 → actionpack-8.0.3}/MIT-LICENSE +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{actionview-8.0.1 → actionview-8.0.3}/MIT-LICENSE +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{activesupport-8.0.1 → activesupport-8.0.3}/MIT-LICENSE +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{base64-0.2.0 → base64-0.3.0}/README.md +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{benchmark-0.4.0 → benchmark-0.4.1}/benchmark.gemspec +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{bigdecimal-3.1.9 → bigdecimal-3.2.3}/LICENSE +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{bigdecimal-3.1.9 → bigdecimal-3.2.3}/bigdecimal.gemspec +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{connection_pool-2.5.0 → connection_pool-2.5.4}/LICENSE +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{connection_pool-2.5.0 → connection_pool-2.5.4}/connection_pool.gemspec +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{base64-0.2.0 → drb-2.2.3}/LICENSE.txt +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{logger-1.6.5 → logger-1.7.0}/README.md +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{loofah-2.24.0 → loofah-2.24.1}/MIT-LICENSE.txt +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{loofah-2.24.0 → loofah-2.24.1}/README.md +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{nokogiri-1.18.2-x86_64-linux-gnu → nokogiri-1.18.10-x86_64-linux-gnu}/LICENSE-DEPENDENCIES.md +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{nokogiri-1.18.2-x86_64-linux-gnu → nokogiri-1.18.10-x86_64-linux-gnu}/LICENSE.md +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{nokogiri-1.18.2-x86_64-linux-gnu → nokogiri-1.18.10-x86_64-linux-gnu}/README.md +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rack-3.1.9 → rack-3.2.1}/MIT-LICENSE +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rails-dom-testing-2.2.0 → rails-dom-testing-2.3.0}/MIT-LICENSE +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rake-13.2.1 → rake-13.3.0}/MIT-LICENSE +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rspec-3.13.0 → rspec-3.13.1}/LICENSE.md +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rspec-3.13.0 → rspec-3.13.1}/README.md +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rspec-core-3.13.2 → rspec-core-3.13.5}/LICENSE.md +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rspec-core-3.13.2 → rspec-core-3.13.5}/README.md +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rspec-expectations-3.13.3 → rspec-expectations-3.13.5}/LICENSE.md +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rspec-expectations-3.13.3 → rspec-expectations-3.13.5}/README.md +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rspec-mocks-3.13.2 → rspec-mocks-3.13.5}/LICENSE.md +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rspec-mocks-3.13.2 → rspec-mocks-3.13.5}/README.md +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rspec-support-3.13.2 → rspec-support-3.13.6}/LICENSE.md +0 -0
- /data/vendor/bundle/ruby/3.4.0/gems/{rspec-support-3.13.2 → rspec-support-3.13.6}/README.md +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3b9e7af3153e5a26e9f9a61c0c31968d2f830abacb236e1827bcac8e506f484
|
4
|
+
data.tar.gz: 1e8c62d9e35f2e68e7b79d6fbef0932be6b762d87095e6f43b686441d50fc052
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85e72c2a7b91d1e076a8bf03c6edb115fa77a2e1e84893c896b80af5ac81c4baf6ac8d843c23a9cb017b659888d19e93ca0efb5d36835827102f5e68a43fc3b5
|
7
|
+
data.tar.gz: dc660af0bf6f1c901998fa1cc62ecf5e2d4ab41265beaa063f1354577bf555502bc436a0464e123e6f6532fd087f53459f91f04b732ac36e2372969324bbc64c
|
data/CHANGELOG.md
CHANGED
@@ -11,14 +11,25 @@ This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a Ch
|
|
11
11
|
|
12
12
|
### Changes
|
13
13
|
|
14
|
-
|
15
|
-
|
14
|
+
### Fixes
|
15
|
+
|
16
|
+
### Breaks
|
17
|
+
|
18
|
+
## 3.5.1 - (2025-09-28)
|
19
|
+
|
20
|
+
---
|
16
21
|
|
17
22
|
### Fixes
|
18
23
|
|
19
|
-
- Fix up `
|
24
|
+
- Fix up `rfc6570` path helpers to accept hash argument required when calling template from Rails Engine in the main app.
|
20
25
|
|
21
|
-
|
26
|
+
## 3.5.0 - (2025-09-26)
|
27
|
+
|
28
|
+
---
|
29
|
+
|
30
|
+
### New
|
31
|
+
|
32
|
+
- Support `*_path_rfc6570` to include Rails Engines mount point.
|
22
33
|
|
23
34
|
## 3.4.0 - (2025-01-31)
|
24
35
|
|
data/README.md
CHANGED
@@ -5,14 +5,14 @@
|
|
5
5
|
|
6
6
|
Pragmatic access to your Rails routes as RFC6570 URI templates.
|
7
7
|
|
8
|
-
Tested with Rails 6.1, 7.0, 7.1, 7.2 and Ruby 2.7, 3.0, 3.1, 3.2, 3.3, and 3.4.
|
8
|
+
Tested with Rails 6.1, 7.0, 7.1, 7.2, 8.0 and Ruby 2.7, 3.0, 3.1, 3.2, 3.3, and 3.4.
|
9
9
|
|
10
10
|
## Installation
|
11
11
|
|
12
12
|
Add this line to your application's Gemfile:
|
13
13
|
|
14
14
|
```ruby
|
15
|
-
gem 'rails-rfc6570', '~> 3.
|
15
|
+
gem 'rails-rfc6570', '~> 3.5'
|
16
16
|
```
|
17
17
|
|
18
18
|
## Usage
|
@@ -92,7 +92,7 @@ end
|
|
92
92
|
|
93
93
|
This gem does not support every construct possible with route matchers especially nested groups cannot be expressed in URI templates. They are expanded into separate groups. It also makes some assumptions when converting splat matchers like swallowing a multiple slashes. An error is raised when routes with OR-clauses are tried to be converted.
|
94
94
|
|
95
|
-
You can also combine **Rails::RFC6570** with [rack-link_headers](https://github.com/jgraichen/rack-link_headers) and provide hypermedia linking everywhere!
|
95
|
+
You can also combine **Rails::RFC6570** with [`rack-link_headers`](https://github.com/jgraichen/rack-link_headers) and provide hypermedia linking everywhere!
|
96
96
|
|
97
97
|
```ruby
|
98
98
|
class UserController < ApplicationController
|
@@ -21,23 +21,20 @@ module Rails
|
|
21
21
|
|
22
22
|
if controller.present? && action.present?
|
23
23
|
params = ::Rails::RFC6570.params_for(controller, action)
|
24
|
-
parts <<
|
24
|
+
parts << "{?#{params.join(',')}}" if params&.any?
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
options = ctx.url_options.merge(kwargs)
|
32
|
-
options[:path] = parts.join
|
28
|
+
options = ctx.url_options.merge(kwargs)
|
29
|
+
options[:path] = parts.join
|
30
|
+
options[:only_path] = kwargs.fetch(:path_only, false)
|
33
31
|
|
34
|
-
|
35
|
-
|
36
|
-
end
|
37
|
-
|
38
|
-
::Addressable::Template.new \
|
39
|
-
ActionDispatch::Http::URL.url_for(options)
|
32
|
+
if (osn = options.delete(:original_script_name))
|
33
|
+
options[:script_name] = osn + options[:script_name]
|
40
34
|
end
|
35
|
+
|
36
|
+
::Addressable::Template.new \
|
37
|
+
ActionDispatch::Http::URL.url_for(options)
|
41
38
|
end
|
42
39
|
|
43
40
|
def symbol(node, prefix: nil, suffix: nil)
|
data/lib/rails/rfc6570.rb
CHANGED
@@ -52,15 +52,15 @@ module Rails
|
|
52
52
|
end
|
53
53
|
|
54
54
|
mod.module_eval do
|
55
|
-
define_method(rfc6570_name) do
|
55
|
+
define_method(rfc6570_name) do |opts = {}|
|
56
56
|
route.to_rfc6570(**opts, ctx: self)
|
57
57
|
end
|
58
58
|
|
59
|
-
define_method(rfc6570_url_name) do
|
59
|
+
define_method(rfc6570_url_name) do |opts = {}|
|
60
60
|
route.to_rfc6570(**opts, ctx: self, path_only: false)
|
61
61
|
end
|
62
62
|
|
63
|
-
define_method(rfc6570_path_name) do
|
63
|
+
define_method(rfc6570_path_name) do |opts = {}|
|
64
64
|
route.to_rfc6570(**opts, ctx: self, path_only: true)
|
65
65
|
end
|
66
66
|
end
|
data/spec/rails/rfc6570_spec.rb
CHANGED
@@ -6,6 +6,28 @@ ActiveSupport::Inflector.inflections(:en) do |inflect|
|
|
6
6
|
inflect.acronym 'API'
|
7
7
|
end
|
8
8
|
|
9
|
+
module DummyEngine
|
10
|
+
class Engine < ::Rails::Engine
|
11
|
+
isolate_namespace DummyEngine
|
12
|
+
|
13
|
+
routes.draw do
|
14
|
+
get '/action' => 'engine#action', as: :action
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
class EngineController < ActionController::API
|
19
|
+
rfc6570_params action: %i[param3]
|
20
|
+
def action
|
21
|
+
render json: {
|
22
|
+
ref: action_path,
|
23
|
+
template: action_rfc6570,
|
24
|
+
template_url: action_url_rfc6570,
|
25
|
+
template_path: action_path_rfc6570,
|
26
|
+
}
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
9
31
|
Dummy::Application.routes.draw do
|
10
32
|
get '/' => 'api#index', as: :root
|
11
33
|
|
@@ -20,6 +42,8 @@ Dummy::Application.routes.draw do
|
|
20
42
|
get '/path/*capture/:title' => 'api#index', as: :test4
|
21
43
|
get '/path(/*capture)/:title' => 'api#index', as: :test5
|
22
44
|
get '/path(/*capture)(/:title)' => 'api#index', as: :test6
|
45
|
+
|
46
|
+
mount DummyEngine::Engine => '/dummy_engine'
|
23
47
|
end
|
24
48
|
|
25
49
|
class APIController < ApplicationController
|
@@ -37,6 +61,9 @@ class APIController < ApplicationController
|
|
37
61
|
partial: test6_rfc6570.partial_expand(title: 'TITLE'),
|
38
62
|
ignore: test6_rfc6570(ignore: %w[title]),
|
39
63
|
expand: test6_rfc6570.expand(capture: %w[a b], title: 'TITLE'),
|
64
|
+
engine_template: dummy_engine.action_rfc6570,
|
65
|
+
engine_template_url: dummy_engine.action_url_rfc6570,
|
66
|
+
engine_template_path: dummy_engine.action_path_rfc6570,
|
40
67
|
}
|
41
68
|
end
|
42
69
|
|
@@ -58,7 +85,7 @@ describe Rails::RFC6570, type: :request do
|
|
58
85
|
|
59
86
|
it 'returns list of all parsed and named routes' do
|
60
87
|
expect(json.keys).to match_array \
|
61
|
-
%w[root action test1 test2 test3 test4 test5 test6]
|
88
|
+
%w[root action test1 test2 test3 test4 test5 test6 dummy_engine]
|
62
89
|
end
|
63
90
|
|
64
91
|
it 'includes known parameters' do
|
@@ -88,6 +115,10 @@ describe Rails::RFC6570, type: :request do
|
|
88
115
|
it 'parses splash operator (III)' do
|
89
116
|
expect(json['test6']).to eq "#{host}/path{/capture*}{/title}"
|
90
117
|
end
|
118
|
+
|
119
|
+
it 'includes the engine mount point root only' do
|
120
|
+
expect(json['dummy_engine']).to eq "#{host}/dummy_engine"
|
121
|
+
end
|
91
122
|
end
|
92
123
|
|
93
124
|
context 'action' do
|
@@ -121,6 +152,18 @@ describe Rails::RFC6570, type: :request do
|
|
121
152
|
expect(json['expand']).to eq "#{host}/path/a/b/TITLE"
|
122
153
|
end
|
123
154
|
|
155
|
+
it 'allows to return and render a rails engines templates' do
|
156
|
+
expect(json['engine_template']).to eq "#{host}/dummy_engine/action{?param3}"
|
157
|
+
end
|
158
|
+
|
159
|
+
it 'allows to return and render a rails engines url templates' do
|
160
|
+
expect(json['engine_template_url']).to eq "#{host}/dummy_engine/action{?param3}"
|
161
|
+
end
|
162
|
+
|
163
|
+
it 'allows to return and render a rails engines path templates' do
|
164
|
+
expect(json['engine_template_path']).to eq '/dummy_engine/action{?param3}'
|
165
|
+
end
|
166
|
+
|
124
167
|
context 'with origin_script_name' do
|
125
168
|
let(:headers) { {'__OSN' => '/fuubar'} }
|
126
169
|
|
@@ -134,4 +177,24 @@ describe Rails::RFC6570, type: :request do
|
|
134
177
|
end
|
135
178
|
end
|
136
179
|
end
|
180
|
+
|
181
|
+
context 'mounted Rails engine' do
|
182
|
+
before { get '/dummy_engine/action', headers: headers }
|
183
|
+
|
184
|
+
it 'includes URL helpers' do
|
185
|
+
expect(response).to have_http_status :ok
|
186
|
+
end
|
187
|
+
|
188
|
+
it 'allows to return and render templates' do
|
189
|
+
expect(json['template']).to eq "#{host}/dummy_engine/action{?param3}"
|
190
|
+
end
|
191
|
+
|
192
|
+
it 'allows to return and render url templates' do
|
193
|
+
expect(json['template_url']).to eq "#{host}/dummy_engine/action{?param3}"
|
194
|
+
end
|
195
|
+
|
196
|
+
it 'allows to return and render path templates' do
|
197
|
+
expect(json['template_path']).to eq '/dummy_engine/action{?param3}'
|
198
|
+
end
|
199
|
+
end
|
137
200
|
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# Shared RuboCop Configuration
|
2
|
+
|
3
|
+
Shared RuboCop configuration and defaults for my libraries and projects.
|
4
|
+
|
5
|
+
## Usage
|
6
|
+
|
7
|
+
```ruby
|
8
|
+
# Gemfile
|
9
|
+
|
10
|
+
gem 'rubocop-config', github: 'jgraichen/rubocop-config', tag: 'v13', require: false
|
11
|
+
```
|
12
|
+
|
13
|
+
```yaml
|
14
|
+
# .rubocop.yml
|
15
|
+
|
16
|
+
inherit_gem:
|
17
|
+
rubocop-config: default.yml
|
18
|
+
|
19
|
+
AllCops:
|
20
|
+
TargetRubyVersion: 3.1
|
21
|
+
SuggestExtensions: False
|
22
|
+
NewCops: enable
|
23
|
+
```
|
@@ -1,31 +1,31 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: rubocop-config
|
2
|
+
# stub: rubocop-config 14.0.0 ruby lib
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "rubocop-config".freeze
|
6
|
-
s.version = "
|
6
|
+
s.version = "14.0.0".freeze
|
7
7
|
|
8
8
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
9
9
|
s.metadata = { "allowed_push_host" => ".", "rubygems_mfa_required" => "true" } if s.respond_to? :metadata=
|
10
10
|
s.require_paths = ["lib".freeze]
|
11
11
|
s.authors = ["Jan Graichen".freeze]
|
12
|
-
s.date = "
|
12
|
+
s.date = "1980-01-02"
|
13
13
|
s.email = ["jgraichen@altimos.de".freeze]
|
14
14
|
s.files = ["LICENSE".freeze, "README.md".freeze, "default.yml".freeze]
|
15
15
|
s.homepage = "https://github.com/jgraichen/rubocop-config".freeze
|
16
16
|
s.licenses = ["MIT".freeze]
|
17
17
|
s.required_ruby_version = Gem::Requirement.new(">= 2.7.0".freeze)
|
18
|
-
s.rubygems_version = "3.6.
|
18
|
+
s.rubygems_version = "3.6.9".freeze
|
19
19
|
s.summary = "Shared rubocop config".freeze
|
20
20
|
|
21
|
-
s.installed_by_version = "3.6.
|
21
|
+
s.installed_by_version = "3.6.9".freeze
|
22
22
|
|
23
23
|
s.specification_version = 4
|
24
24
|
|
25
|
-
s.add_runtime_dependency(%q<rubocop>.freeze, ["~> 1.
|
26
|
-
s.add_runtime_dependency(%q<rubocop-capybara>.freeze, ["~> 2.
|
27
|
-
s.add_runtime_dependency(%q<rubocop-factory_bot>.freeze, ["~> 2.
|
28
|
-
s.add_runtime_dependency(%q<rubocop-performance>.freeze, ["~> 1.
|
29
|
-
s.add_runtime_dependency(%q<rubocop-rspec>.freeze, ["~> 3.
|
30
|
-
s.add_runtime_dependency(%q<rubocop-rspec_rails>.freeze, ["~> 2.
|
25
|
+
s.add_runtime_dependency(%q<rubocop>.freeze, ["~> 1.75.2".freeze])
|
26
|
+
s.add_runtime_dependency(%q<rubocop-capybara>.freeze, ["~> 2.22.1".freeze])
|
27
|
+
s.add_runtime_dependency(%q<rubocop-factory_bot>.freeze, ["~> 2.27.1".freeze])
|
28
|
+
s.add_runtime_dependency(%q<rubocop-performance>.freeze, ["~> 1.25.0".freeze])
|
29
|
+
s.add_runtime_dependency(%q<rubocop-rspec>.freeze, ["~> 3.5.0".freeze])
|
30
|
+
s.add_runtime_dependency(%q<rubocop-rspec_rails>.freeze, ["~> 2.31.0".freeze])
|
31
31
|
end
|
@@ -1,3 +1,83 @@
|
|
1
|
+
## Rails 8.0.3 (September 22, 2025) ##
|
2
|
+
|
3
|
+
* URL helpers for engines mounted at the application root handle `SCRIPT_NAME` correctly.
|
4
|
+
|
5
|
+
Fixed an issue where `SCRIPT_NAME` is not applied to paths generated for routes in an engine
|
6
|
+
mounted at "/".
|
7
|
+
|
8
|
+
*Mike Dalessio*
|
9
|
+
|
10
|
+
* Fix `Rails.application.reload_routes!` from clearing almost all routes.
|
11
|
+
|
12
|
+
When calling `Rails.application.reload_routes!` inside a middleware of
|
13
|
+
a Rake task, it was possible under certain conditions that all routes would be cleared.
|
14
|
+
If ran inside a middleware, this would result in getting a 404 on most page you visit.
|
15
|
+
This issue was only happening in development.
|
16
|
+
|
17
|
+
*Edouard Chin*
|
18
|
+
|
19
|
+
* Address `rack 3.2` deprecations warnings.
|
20
|
+
|
21
|
+
```
|
22
|
+
warning: Status code :unprocessable_entity is deprecated and will be removed in a future version of Rack.
|
23
|
+
Please use :unprocessable_content instead.
|
24
|
+
```
|
25
|
+
|
26
|
+
Rails API will transparently convert one into the other for the foreseeable future.
|
27
|
+
|
28
|
+
*Earlopain*, *Jean Boussier*
|
29
|
+
|
30
|
+
* Support hash-source in Content Security Policy.
|
31
|
+
|
32
|
+
*madogiwa*
|
33
|
+
|
34
|
+
* Always return empty body for HEAD requests in `PublicExceptions` and
|
35
|
+
`DebugExceptions`.
|
36
|
+
|
37
|
+
This is required by `Rack::Lint` (per RFC9110).
|
38
|
+
|
39
|
+
*Hartley McGuire*
|
40
|
+
|
41
|
+
|
42
|
+
## Rails 8.0.2.1 (August 13, 2025) ##
|
43
|
+
|
44
|
+
* No changes.
|
45
|
+
|
46
|
+
## Rails 8.0.2 (March 12, 2025) ##
|
47
|
+
|
48
|
+
* Improve `with_routing` test helper to not rebuild the middleware stack.
|
49
|
+
|
50
|
+
Otherwise some middleware configuration could be lost.
|
51
|
+
|
52
|
+
*Édouard Chin*
|
53
|
+
|
54
|
+
* Add resource name to the `ArgumentError` that's raised when invalid `:only` or `:except` options are given to `#resource` or `#resources`
|
55
|
+
|
56
|
+
This makes it easier to locate the source of the problem, especially for routes drawn by gems.
|
57
|
+
|
58
|
+
Before:
|
59
|
+
```
|
60
|
+
:only and :except must include only [:index, :create, :new, :show, :update, :destroy, :edit], but also included [:foo, :bar]
|
61
|
+
```
|
62
|
+
|
63
|
+
After:
|
64
|
+
```
|
65
|
+
Route `resources :products` - :only and :except must include only [:index, :create, :new, :show, :update, :destroy, :edit], but also included [:foo, :bar]
|
66
|
+
```
|
67
|
+
|
68
|
+
*Jeremy Green*
|
69
|
+
|
70
|
+
* Fix `url_for` to handle `:path_params` gracefully when it's not a `Hash`.
|
71
|
+
|
72
|
+
Prevents various security scanners from causing exceptions.
|
73
|
+
|
74
|
+
*Martin Emde*
|
75
|
+
|
76
|
+
* Fix `ActionDispatch::Executor` to unwrap exceptions like other error reporting middlewares.
|
77
|
+
|
78
|
+
*Jean Boussier*
|
79
|
+
|
80
|
+
|
1
81
|
## Rails 8.0.1 (December 13, 2024) ##
|
2
82
|
|
3
83
|
* Add `ActionDispatch::Request::Session#store` method to conform Rack spec.
|
@@ -52,6 +52,6 @@ Bug reports for the Ruby on \Rails project can be filed here:
|
|
52
52
|
|
53
53
|
* https://github.com/rails/rails/issues
|
54
54
|
|
55
|
-
Feature requests should be discussed on the
|
55
|
+
Feature requests should be discussed on the rubyonrails-core forum here:
|
56
56
|
|
57
57
|
* https://discuss.rubyonrails.org/c/rubyonrails-core
|
@@ -0,0 +1,129 @@
|
|
1
|
+
## Rails 8.0.3 (September 22, 2025) ##
|
2
|
+
|
3
|
+
* Fix label with `for` option not getting prefixed by form `namespace` value
|
4
|
+
|
5
|
+
*Abeid Ahmed*, *Hartley McGuire*
|
6
|
+
|
7
|
+
* Fix `javascript_include_tag` `type` option to accept either strings and symbols.
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
javascript_include_tag "application", type: :module
|
11
|
+
javascript_include_tag "application", type: "module"
|
12
|
+
```
|
13
|
+
|
14
|
+
Previously, only the string value was recognized.
|
15
|
+
|
16
|
+
*Jean Boussier*
|
17
|
+
|
18
|
+
* Fix `excerpt` helper with non-whitespace separator.
|
19
|
+
|
20
|
+
*Jonathan Hefner*
|
21
|
+
|
22
|
+
|
23
|
+
## Rails 8.0.2.1 (August 13, 2025) ##
|
24
|
+
|
25
|
+
* No changes.
|
26
|
+
|
27
|
+
|
28
|
+
## Rails 8.0.2 (March 12, 2025) ##
|
29
|
+
|
30
|
+
* Respect `html_options[:form]` when `collection_checkboxes` generates the
|
31
|
+
hidden `<input>`.
|
32
|
+
|
33
|
+
*Riccardo Odone*
|
34
|
+
|
35
|
+
* Layouts have access to local variables passed to `render`.
|
36
|
+
|
37
|
+
This fixes #31680 which was a regression in Rails 5.1.
|
38
|
+
|
39
|
+
*Mike Dalessio*
|
40
|
+
|
41
|
+
* Argument errors related to strict locals in templates now raise an
|
42
|
+
`ActionView::StrictLocalsError`, and all other argument errors are reraised as-is.
|
43
|
+
|
44
|
+
Previously, any `ArgumentError` raised during template rendering was swallowed during strict
|
45
|
+
local error handling, so that an `ArgumentError` unrelated to strict locals (e.g., a helper
|
46
|
+
method invoked with incorrect arguments) would be replaced by a similar `ArgumentError` with an
|
47
|
+
unrelated backtrace, making it difficult to debug templates.
|
48
|
+
|
49
|
+
Now, any `ArgumentError` unrelated to strict locals is reraised, preserving the original
|
50
|
+
backtrace for developers.
|
51
|
+
|
52
|
+
Also note that `ActionView::StrictLocalsError` is a subclass of `ArgumentError`, so any existing
|
53
|
+
code that rescues `ArgumentError` will continue to work.
|
54
|
+
|
55
|
+
Fixes #52227.
|
56
|
+
|
57
|
+
*Mike Dalessio*
|
58
|
+
|
59
|
+
* Fix stack overflow error in dependency tracker when dealing with circular dependencies
|
60
|
+
|
61
|
+
*Jean Boussier*
|
62
|
+
|
63
|
+
## Rails 8.0.1 (December 13, 2024) ##
|
64
|
+
|
65
|
+
* Fix a crash in ERB template error highlighting when the error occurs on a
|
66
|
+
line in the compiled template that is past the end of the source template.
|
67
|
+
|
68
|
+
*Martin Emde*
|
69
|
+
|
70
|
+
* Improve reliability of ERB template error highlighting.
|
71
|
+
Fix infinite loops and crashes in highlighting and
|
72
|
+
improve tolerance for alternate ERB handlers.
|
73
|
+
|
74
|
+
*Martin Emde*
|
75
|
+
|
76
|
+
|
77
|
+
## Rails 8.0.0.1 (December 10, 2024) ##
|
78
|
+
|
79
|
+
* No changes.
|
80
|
+
|
81
|
+
|
82
|
+
## Rails 8.0.0 (November 07, 2024) ##
|
83
|
+
|
84
|
+
* No changes.
|
85
|
+
|
86
|
+
|
87
|
+
## Rails 8.0.0.rc2 (October 30, 2024) ##
|
88
|
+
|
89
|
+
* No changes.
|
90
|
+
|
91
|
+
|
92
|
+
## Rails 8.0.0.rc1 (October 19, 2024) ##
|
93
|
+
|
94
|
+
* Remove deprecated support to passing a content to void tag elements on the `tag` builder.
|
95
|
+
|
96
|
+
*Rafael Mendonça França*
|
97
|
+
|
98
|
+
* Remove deprecated support to passing `nil` to the `model:` argument of `form_with`.
|
99
|
+
|
100
|
+
*Rafael Mendonça França*
|
101
|
+
|
102
|
+
|
103
|
+
## Rails 8.0.0.beta1 (September 26, 2024) ##
|
104
|
+
|
105
|
+
* Enable DependencyTracker to evaluate renders with trailing interpolation.
|
106
|
+
|
107
|
+
```erb
|
108
|
+
<%= render "maintenance_tasks/runs/info/#{run.status}" %>
|
109
|
+
```
|
110
|
+
|
111
|
+
Previously, the DependencyTracker would ignore this render, but now it will
|
112
|
+
mark all partials in the "maintenance_tasks/runs/info" folder as
|
113
|
+
dependencies.
|
114
|
+
|
115
|
+
*Hartley McGuire*
|
116
|
+
|
117
|
+
* Rename `text_area` methods into `textarea`
|
118
|
+
|
119
|
+
Old names are still available as aliases.
|
120
|
+
|
121
|
+
*Sean Doyle*
|
122
|
+
|
123
|
+
* Rename `check_box*` methods into `checkbox*`.
|
124
|
+
|
125
|
+
Old names are still available as aliases.
|
126
|
+
|
127
|
+
*Jean Boussier*
|
128
|
+
|
129
|
+
Please check [7-2-stable](https://github.com/rails/rails/blob/7-2-stable/actionview/CHANGELOG.md) for previous changes.
|
@@ -35,6 +35,6 @@ Bug reports for the Ruby on \Rails project can be filed here:
|
|
35
35
|
|
36
36
|
* https://github.com/rails/rails/issues
|
37
37
|
|
38
|
-
Feature requests should be discussed on the
|
38
|
+
Feature requests should be discussed on the rubyonrails-core forum here:
|
39
39
|
|
40
40
|
* https://discuss.rubyonrails.org/c/rubyonrails-core
|