actionpack 7.2.2.1 → 8.0.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of actionpack might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +83 -139
- data/lib/abstract_controller/helpers.rb +0 -2
- data/lib/action_controller/metal/allow_browser.rb +1 -1
- data/lib/action_controller/metal/conditional_get.rb +5 -1
- data/lib/action_controller/metal/http_authentication.rb +4 -1
- data/lib/action_controller/metal/instrumentation.rb +1 -2
- data/lib/action_controller/metal/live.rb +10 -2
- data/lib/action_controller/metal/rate_limiting.rb +13 -4
- data/lib/action_controller/metal/renderers.rb +2 -1
- data/lib/action_controller/metal/streaming.rb +5 -84
- data/lib/action_controller/metal/strong_parameters.rb +274 -73
- data/lib/action_controller/railtie.rb +1 -1
- data/lib/action_controller/test_case.rb +2 -0
- data/lib/action_dispatch/http/cache.rb +27 -10
- data/lib/action_dispatch/http/content_security_policy.rb +13 -25
- data/lib/action_dispatch/http/filter_parameters.rb +4 -9
- data/lib/action_dispatch/http/filter_redirect.rb +2 -9
- data/lib/action_dispatch/http/permissions_policy.rb +2 -0
- data/lib/action_dispatch/http/request.rb +4 -2
- data/lib/action_dispatch/journey/parser.rb +99 -196
- data/lib/action_dispatch/journey/scanner.rb +40 -42
- data/lib/action_dispatch/middleware/cookies.rb +4 -2
- data/lib/action_dispatch/middleware/debug_exceptions.rb +16 -3
- data/lib/action_dispatch/middleware/request_id.rb +2 -1
- data/lib/action_dispatch/middleware/ssl.rb +13 -3
- data/lib/action_dispatch/railtie.rb +2 -0
- data/lib/action_dispatch/routing/inspector.rb +1 -1
- data/lib/action_dispatch/routing/mapper.rb +25 -17
- data/lib/action_dispatch/routing/route_set.rb +18 -6
- data/lib/action_dispatch/system_testing/browser.rb +12 -21
- data/lib/action_dispatch.rb +0 -4
- data/lib/action_pack/gem_version.rb +4 -4
- metadata +13 -35
- data/lib/action_dispatch/journey/parser.y +0 -50
- data/lib/action_dispatch/journey/parser_extras.rb +0 -33
@@ -11,9 +11,11 @@ module ActionDispatch
|
|
11
11
|
#
|
12
12
|
# 1. **TLS redirect**: Permanently redirects `http://` requests to `https://`
|
13
13
|
# with the same URL host, path, etc. Enabled by default. Set
|
14
|
-
# `config.ssl_options` to modify the destination URL
|
15
|
-
#
|
16
|
-
#
|
14
|
+
# `config.ssl_options` to modify the destination URL:
|
15
|
+
#
|
16
|
+
# config.ssl_options = { redirect: { host: "secure.widgets.com", port: 8080 }`
|
17
|
+
#
|
18
|
+
# Or set `redirect: false` to disable redirection.
|
17
19
|
#
|
18
20
|
# Requests can opt-out of redirection with `exclude`:
|
19
21
|
#
|
@@ -21,6 +23,14 @@ module ActionDispatch
|
|
21
23
|
#
|
22
24
|
# Cookies will not be flagged as secure for excluded requests.
|
23
25
|
#
|
26
|
+
# When proxying through a load balancer that terminates SSL, the forwarded
|
27
|
+
# request will appear as though it's HTTP instead of HTTPS to the application.
|
28
|
+
# This makes redirects and cookie security target HTTP instead of HTTPS.
|
29
|
+
# To make the server assume that the proxy already terminated SSL, and
|
30
|
+
# that the request really is HTTPS, set `config.assume_ssl` to `true`:
|
31
|
+
#
|
32
|
+
# config.assume_ssl = true
|
33
|
+
#
|
24
34
|
# 2. **Secure cookies**: Sets the `secure` flag on cookies to tell browsers
|
25
35
|
# they must not be sent along with `http://` requests. Enabled by default.
|
26
36
|
# Set `config.ssl_options` with `secure_cookies: false` to disable this
|
@@ -29,6 +29,7 @@ module ActionDispatch
|
|
29
29
|
config.action_dispatch.request_id_header = ActionDispatch::Constants::X_REQUEST_ID
|
30
30
|
config.action_dispatch.log_rescued_responses = true
|
31
31
|
config.action_dispatch.debug_exception_log_level = :fatal
|
32
|
+
config.action_dispatch.strict_freshness = false
|
32
33
|
|
33
34
|
config.action_dispatch.default_headers = {
|
34
35
|
"X-Frame-Options" => "SAMEORIGIN",
|
@@ -69,6 +70,7 @@ module ActionDispatch
|
|
69
70
|
|
70
71
|
ActionDispatch::Routing::Mapper.route_source_locations = Rails.env.development?
|
71
72
|
|
73
|
+
ActionDispatch::Http::Cache::Request.strict_freshness = app.config.action_dispatch.strict_freshness
|
72
74
|
ActionDispatch.test_app = app
|
73
75
|
end
|
74
76
|
end
|
@@ -101,7 +101,7 @@ module ActionDispatch
|
|
101
101
|
{ controller: /#{filter[:controller].underscore.sub(/_?controller\z/, "")}/ }
|
102
102
|
elsif filter[:grep]
|
103
103
|
grep_pattern = Regexp.new(filter[:grep])
|
104
|
-
path = RFC2396_PARSER.escape(filter[:grep])
|
104
|
+
path = URI::RFC2396_PARSER.escape(filter[:grep])
|
105
105
|
normalized_path = ("/" + path).squeeze("/")
|
106
106
|
|
107
107
|
{
|
@@ -470,7 +470,6 @@ module ActionDispatch
|
|
470
470
|
# When a pattern points to an internal route, the route's `:action` and
|
471
471
|
# `:controller` should be set in options or hash shorthand. Examples:
|
472
472
|
#
|
473
|
-
# match 'photos/:id' => 'photos#show', via: :get
|
474
473
|
# match 'photos/:id', to: 'photos#show', via: :get
|
475
474
|
# match 'photos/:id', controller: 'photos', action: 'show', via: :get
|
476
475
|
#
|
@@ -614,10 +613,6 @@ module ActionDispatch
|
|
614
613
|
#
|
615
614
|
# mount SomeRackApp, at: "some_route"
|
616
615
|
#
|
617
|
-
# Alternatively:
|
618
|
-
#
|
619
|
-
# mount(SomeRackApp => "some_route")
|
620
|
-
#
|
621
616
|
# For options, see `match`, as `mount` uses it internally.
|
622
617
|
#
|
623
618
|
# All mounted applications come with routing helpers to access them. These are
|
@@ -625,7 +620,7 @@ module ActionDispatch
|
|
625
620
|
# `some_rack_app_path` or `some_rack_app_url`. To customize this helper's name,
|
626
621
|
# use the `:as` option:
|
627
622
|
#
|
628
|
-
# mount(SomeRackApp
|
623
|
+
# mount(SomeRackApp, at: "some_route", as: "exciting")
|
629
624
|
#
|
630
625
|
# This will generate the `exciting_path` and `exciting_url` helpers which can be
|
631
626
|
# used to navigate to this mounted app.
|
@@ -773,6 +768,16 @@ module ActionDispatch
|
|
773
768
|
map_method(:options, args, &block)
|
774
769
|
end
|
775
770
|
|
771
|
+
# Define a route that recognizes HTTP CONNECT (and GET) requests. More
|
772
|
+
# specifically this recognizes HTTP/1 protocol upgrade requests and HTTP/2
|
773
|
+
# CONNECT requests with the protocol pseudo header. For supported arguments,
|
774
|
+
# see [match](rdoc-ref:Base#match)
|
775
|
+
#
|
776
|
+
# connect 'live', to: 'live#index'
|
777
|
+
def connect(*args, &block)
|
778
|
+
map_method([:get, :connect], args, &block)
|
779
|
+
end
|
780
|
+
|
776
781
|
private
|
777
782
|
def map_method(method, args, &block)
|
778
783
|
options = args.extract_options!
|
@@ -1673,7 +1678,6 @@ module ActionDispatch
|
|
1673
1678
|
# Matches a URL pattern to one or more routes. For more information, see
|
1674
1679
|
# [match](rdoc-ref:Base#match).
|
1675
1680
|
#
|
1676
|
-
# match 'path' => 'controller#action', via: :patch
|
1677
1681
|
# match 'path', to: 'controller#action', via: :post
|
1678
1682
|
# match 'path', 'otherpath', on: :member, via: :get
|
1679
1683
|
def match(path, *rest, &block)
|
@@ -1935,6 +1939,11 @@ module ActionDispatch
|
|
1935
1939
|
end
|
1936
1940
|
|
1937
1941
|
def map_match(paths, options)
|
1942
|
+
ActionDispatch.deprecator.warn(<<-MSG.squish) if paths.count > 1
|
1943
|
+
Mapping a route with multiple paths is deprecated and
|
1944
|
+
will be removed in Rails 8.1. Please use multiple method calls instead.
|
1945
|
+
MSG
|
1946
|
+
|
1938
1947
|
if (on = options[:on]) && !VALID_ON_OPTIONS.include?(on)
|
1939
1948
|
raise ArgumentError, "Unknown scope #{on.inspect} given to :on"
|
1940
1949
|
end
|
@@ -2025,7 +2034,7 @@ module ActionDispatch
|
|
2025
2034
|
name_for_action(options.delete(:as), action)
|
2026
2035
|
end
|
2027
2036
|
|
2028
|
-
path = Mapping.normalize_path RFC2396_PARSER.escape(path), formatted
|
2037
|
+
path = Mapping.normalize_path URI::RFC2396_PARSER.escape(path), formatted
|
2029
2038
|
ast = Journey::Parser.parse path
|
2030
2039
|
|
2031
2040
|
mapping = Mapping.build(@scope, @set, ast, controller, default_action, to, via, formatted, options_constraints, anchor, options)
|
@@ -2267,9 +2276,9 @@ module ActionDispatch
|
|
2267
2276
|
|
2268
2277
|
attr_reader :parent, :scope_level
|
2269
2278
|
|
2270
|
-
def initialize(hash, parent =
|
2271
|
-
@hash = hash
|
2279
|
+
def initialize(hash, parent = ROOT, scope_level = nil)
|
2272
2280
|
@parent = parent
|
2281
|
+
@hash = parent ? parent.frame.merge(hash) : hash
|
2273
2282
|
@scope_level = scope_level
|
2274
2283
|
end
|
2275
2284
|
|
@@ -2282,7 +2291,7 @@ module ActionDispatch
|
|
2282
2291
|
end
|
2283
2292
|
|
2284
2293
|
def root?
|
2285
|
-
@parent
|
2294
|
+
@parent == ROOT
|
2286
2295
|
end
|
2287
2296
|
|
2288
2297
|
def resources?
|
@@ -2327,23 +2336,22 @@ module ActionDispatch
|
|
2327
2336
|
end
|
2328
2337
|
|
2329
2338
|
def [](key)
|
2330
|
-
|
2331
|
-
scope && scope.frame[key]
|
2339
|
+
frame[key]
|
2332
2340
|
end
|
2333
2341
|
|
2342
|
+
def frame; @hash; end
|
2343
|
+
|
2334
2344
|
include Enumerable
|
2335
2345
|
|
2336
2346
|
def each
|
2337
2347
|
node = self
|
2338
|
-
until node.equal?
|
2348
|
+
until node.equal? ROOT
|
2339
2349
|
yield node
|
2340
2350
|
node = node.parent
|
2341
2351
|
end
|
2342
2352
|
end
|
2343
2353
|
|
2344
|
-
|
2345
|
-
|
2346
|
-
NULL = Scope.new(nil, nil)
|
2354
|
+
ROOT = Scope.new({}, nil)
|
2347
2355
|
end
|
2348
2356
|
|
2349
2357
|
def initialize(set) # :nodoc:
|
@@ -351,7 +351,7 @@ module ActionDispatch
|
|
351
351
|
PATH = ->(options) { ActionDispatch::Http::URL.path_for(options) }
|
352
352
|
UNKNOWN = ->(options) { ActionDispatch::Http::URL.url_for(options) }
|
353
353
|
|
354
|
-
attr_accessor :formatter, :set, :named_routes, :
|
354
|
+
attr_accessor :formatter, :set, :named_routes, :router
|
355
355
|
attr_accessor :disable_clear_and_finalize, :resources_path_names
|
356
356
|
attr_accessor :default_url_options, :draw_paths
|
357
357
|
attr_reader :env_key, :polymorphic_mappings
|
@@ -363,7 +363,7 @@ module ActionDispatch
|
|
363
363
|
end
|
364
364
|
|
365
365
|
def self.new_with_config(config)
|
366
|
-
route_set_config = DEFAULT_CONFIG
|
366
|
+
route_set_config = DEFAULT_CONFIG.dup
|
367
367
|
|
368
368
|
# engines apparently don't have this set
|
369
369
|
if config.respond_to? :relative_url_root
|
@@ -374,14 +374,18 @@ module ActionDispatch
|
|
374
374
|
route_set_config.api_only = config.api_only
|
375
375
|
end
|
376
376
|
|
377
|
+
if config.respond_to? :default_scope
|
378
|
+
route_set_config.default_scope = config.default_scope
|
379
|
+
end
|
380
|
+
|
377
381
|
new route_set_config
|
378
382
|
end
|
379
383
|
|
380
|
-
Config = Struct.new :relative_url_root, :api_only
|
384
|
+
Config = Struct.new :relative_url_root, :api_only, :default_scope
|
381
385
|
|
382
|
-
DEFAULT_CONFIG = Config.new(nil, false)
|
386
|
+
DEFAULT_CONFIG = Config.new(nil, false, nil)
|
383
387
|
|
384
|
-
def initialize(config = DEFAULT_CONFIG)
|
388
|
+
def initialize(config = DEFAULT_CONFIG.dup)
|
385
389
|
self.named_routes = NamedRouteCollection.new
|
386
390
|
self.resources_path_names = self.class.default_resources_path_names
|
387
391
|
self.default_url_options = {}
|
@@ -416,6 +420,14 @@ module ActionDispatch
|
|
416
420
|
@config.api_only
|
417
421
|
end
|
418
422
|
|
423
|
+
def default_scope
|
424
|
+
@config.default_scope
|
425
|
+
end
|
426
|
+
|
427
|
+
def default_scope=(new_default_scope)
|
428
|
+
@config.default_scope = new_default_scope
|
429
|
+
end
|
430
|
+
|
419
431
|
def request_class
|
420
432
|
ActionDispatch::Request
|
421
433
|
end
|
@@ -917,7 +929,7 @@ module ActionDispatch
|
|
917
929
|
params.each do |key, value|
|
918
930
|
if value.is_a?(String)
|
919
931
|
value = value.dup.force_encoding(Encoding::BINARY)
|
920
|
-
params[key] = RFC2396_PARSER.unescape(value)
|
932
|
+
params[key] = URI::RFC2396_PARSER.unescape(value)
|
921
933
|
end
|
922
934
|
end
|
923
935
|
req.path_parameters = params
|
@@ -9,7 +9,6 @@ module ActionDispatch
|
|
9
9
|
|
10
10
|
def initialize(name)
|
11
11
|
@name = name
|
12
|
-
set_default_options
|
13
12
|
end
|
14
13
|
|
15
14
|
def type
|
@@ -27,9 +26,9 @@ module ActionDispatch
|
|
27
26
|
@options ||=
|
28
27
|
case type
|
29
28
|
when :chrome
|
30
|
-
|
29
|
+
default_chrome_options
|
31
30
|
when :firefox
|
32
|
-
|
31
|
+
default_firefox_options
|
33
32
|
end
|
34
33
|
end
|
35
34
|
|
@@ -49,26 +48,18 @@ module ActionDispatch
|
|
49
48
|
end
|
50
49
|
|
51
50
|
private
|
52
|
-
def
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
end
|
51
|
+
def default_chrome_options
|
52
|
+
options = ::Selenium::WebDriver::Chrome::Options.new
|
53
|
+
options.add_argument("--disable-search-engine-choice-screen")
|
54
|
+
options.add_argument("--headless") if name == :headless_chrome
|
55
|
+
options.add_argument("--disable-gpu") if Gem.win_platform?
|
56
|
+
options
|
59
57
|
end
|
60
58
|
|
61
|
-
def
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
end
|
66
|
-
end
|
67
|
-
|
68
|
-
def set_headless_firefox_browser_options
|
69
|
-
configure do |capabilities|
|
70
|
-
capabilities.add_argument("-headless")
|
71
|
-
end
|
59
|
+
def default_firefox_options
|
60
|
+
options = ::Selenium::WebDriver::Firefox::Options.new
|
61
|
+
options.add_argument("-headless") if name == :headless_firefox
|
62
|
+
options
|
72
63
|
end
|
73
64
|
|
74
65
|
def resolve_driver_path(namespace)
|
data/lib/action_dispatch.rb
CHANGED
@@ -30,7 +30,6 @@ require "active_support/core_ext/module/attribute_accessors"
|
|
30
30
|
|
31
31
|
require "action_pack"
|
32
32
|
require "rack"
|
33
|
-
require "uri"
|
34
33
|
require "action_dispatch/deprecator"
|
35
34
|
|
36
35
|
module Rack # :nodoc:
|
@@ -48,9 +47,6 @@ end
|
|
48
47
|
module ActionDispatch
|
49
48
|
extend ActiveSupport::Autoload
|
50
49
|
|
51
|
-
RFC2396_PARSER = defined?(URI::RFC2396_PARSER) ? URI::RFC2396_PARSER : URI::RFC2396_Parser.new
|
52
|
-
private_constant :RFC2396_PARSER
|
53
|
-
|
54
50
|
class MissingController < NameError
|
55
51
|
end
|
56
52
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: actionpack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 8.0.0.beta1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-09-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 8.0.0.beta1
|
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:
|
26
|
+
version: 8.0.0.beta1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: nokogiri
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -38,20 +38,6 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 1.8.5
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: racc
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
48
|
-
type: :runtime
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
55
41
|
- !ruby/object:Gem::Dependency
|
56
42
|
name: rack
|
57
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -59,9 +45,6 @@ dependencies:
|
|
59
45
|
- - ">="
|
60
46
|
- !ruby/object:Gem::Version
|
61
47
|
version: 2.2.4
|
62
|
-
- - "<"
|
63
|
-
- !ruby/object:Gem::Version
|
64
|
-
version: '3.2'
|
65
48
|
type: :runtime
|
66
49
|
prerelease: false
|
67
50
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -69,9 +52,6 @@ dependencies:
|
|
69
52
|
- - ">="
|
70
53
|
- !ruby/object:Gem::Version
|
71
54
|
version: 2.2.4
|
72
|
-
- - "<"
|
73
|
-
- !ruby/object:Gem::Version
|
74
|
-
version: '3.2'
|
75
55
|
- !ruby/object:Gem::Dependency
|
76
56
|
name: rack-session
|
77
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -148,28 +128,28 @@ dependencies:
|
|
148
128
|
requirements:
|
149
129
|
- - '='
|
150
130
|
- !ruby/object:Gem::Version
|
151
|
-
version:
|
131
|
+
version: 8.0.0.beta1
|
152
132
|
type: :runtime
|
153
133
|
prerelease: false
|
154
134
|
version_requirements: !ruby/object:Gem::Requirement
|
155
135
|
requirements:
|
156
136
|
- - '='
|
157
137
|
- !ruby/object:Gem::Version
|
158
|
-
version:
|
138
|
+
version: 8.0.0.beta1
|
159
139
|
- !ruby/object:Gem::Dependency
|
160
140
|
name: activemodel
|
161
141
|
requirement: !ruby/object:Gem::Requirement
|
162
142
|
requirements:
|
163
143
|
- - '='
|
164
144
|
- !ruby/object:Gem::Version
|
165
|
-
version:
|
145
|
+
version: 8.0.0.beta1
|
166
146
|
type: :development
|
167
147
|
prerelease: false
|
168
148
|
version_requirements: !ruby/object:Gem::Requirement
|
169
149
|
requirements:
|
170
150
|
- - '='
|
171
151
|
- !ruby/object:Gem::Version
|
172
|
-
version:
|
152
|
+
version: 8.0.0.beta1
|
173
153
|
description: Web apps on Rails. Simple, battle-tested conventions for building and
|
174
154
|
testing MVC web applications. Works with any Rack-compatible server.
|
175
155
|
email: david@loudthinking.com
|
@@ -268,8 +248,6 @@ files:
|
|
268
248
|
- lib/action_dispatch/journey/nfa/dot.rb
|
269
249
|
- lib/action_dispatch/journey/nodes/node.rb
|
270
250
|
- lib/action_dispatch/journey/parser.rb
|
271
|
-
- lib/action_dispatch/journey/parser.y
|
272
|
-
- lib/action_dispatch/journey/parser_extras.rb
|
273
251
|
- lib/action_dispatch/journey/path/pattern.rb
|
274
252
|
- lib/action_dispatch/journey/route.rb
|
275
253
|
- lib/action_dispatch/journey/router.rb
|
@@ -369,10 +347,10 @@ licenses:
|
|
369
347
|
- MIT
|
370
348
|
metadata:
|
371
349
|
bug_tracker_uri: https://github.com/rails/rails/issues
|
372
|
-
changelog_uri: https://github.com/rails/rails/blob/
|
373
|
-
documentation_uri: https://api.rubyonrails.org/
|
350
|
+
changelog_uri: https://github.com/rails/rails/blob/v8.0.0.beta1/actionpack/CHANGELOG.md
|
351
|
+
documentation_uri: https://api.rubyonrails.org/v8.0.0.beta1/
|
374
352
|
mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
|
375
|
-
source_code_uri: https://github.com/rails/rails/tree/
|
353
|
+
source_code_uri: https://github.com/rails/rails/tree/v8.0.0.beta1/actionpack
|
376
354
|
rubygems_mfa_required: 'true'
|
377
355
|
post_install_message:
|
378
356
|
rdoc_options: []
|
@@ -382,7 +360,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
382
360
|
requirements:
|
383
361
|
- - ">="
|
384
362
|
- !ruby/object:Gem::Version
|
385
|
-
version: 3.
|
363
|
+
version: 3.2.0
|
386
364
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
387
365
|
requirements:
|
388
366
|
- - ">="
|
@@ -390,7 +368,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
390
368
|
version: '0'
|
391
369
|
requirements:
|
392
370
|
- none
|
393
|
-
rubygems_version: 3.5.
|
371
|
+
rubygems_version: 3.5.16
|
394
372
|
signing_key:
|
395
373
|
specification_version: 4
|
396
374
|
summary: Web-flow and rendering framework putting the VC in MVC (part of Rails).
|
@@ -1,50 +0,0 @@
|
|
1
|
-
class ActionDispatch::Journey::Parser
|
2
|
-
options no_result_var
|
3
|
-
token SLASH LITERAL SYMBOL LPAREN RPAREN DOT STAR OR
|
4
|
-
|
5
|
-
rule
|
6
|
-
expressions
|
7
|
-
: expression expressions { Cat.new(val.first, val.last) }
|
8
|
-
| expression { val.first }
|
9
|
-
| or
|
10
|
-
;
|
11
|
-
expression
|
12
|
-
: terminal
|
13
|
-
| group
|
14
|
-
| star
|
15
|
-
;
|
16
|
-
group
|
17
|
-
: LPAREN expressions RPAREN { Group.new(val[1]) }
|
18
|
-
;
|
19
|
-
or
|
20
|
-
: expression OR expression { Or.new([val.first, val.last]) }
|
21
|
-
| expression OR or { Or.new([val.first, val.last]) }
|
22
|
-
;
|
23
|
-
star
|
24
|
-
: STAR { Star.new(Symbol.new(val.last, Symbol::GREEDY_EXP)) }
|
25
|
-
;
|
26
|
-
terminal
|
27
|
-
: symbol
|
28
|
-
| literal
|
29
|
-
| slash
|
30
|
-
| dot
|
31
|
-
;
|
32
|
-
slash
|
33
|
-
: SLASH { Slash.new(val.first) }
|
34
|
-
;
|
35
|
-
symbol
|
36
|
-
: SYMBOL { Symbol.new(val.first) }
|
37
|
-
;
|
38
|
-
literal
|
39
|
-
: LITERAL { Literal.new(val.first) }
|
40
|
-
;
|
41
|
-
dot
|
42
|
-
: DOT { Dot.new(val.first) }
|
43
|
-
;
|
44
|
-
|
45
|
-
end
|
46
|
-
|
47
|
-
---- header
|
48
|
-
# :stopdoc:
|
49
|
-
|
50
|
-
require "action_dispatch/journey/parser_extras"
|
@@ -1,33 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# :markup: markdown
|
4
|
-
|
5
|
-
require "action_dispatch/journey/scanner"
|
6
|
-
require "action_dispatch/journey/nodes/node"
|
7
|
-
|
8
|
-
module ActionDispatch
|
9
|
-
# :stopdoc:
|
10
|
-
module Journey
|
11
|
-
class Parser < Racc::Parser
|
12
|
-
include Journey::Nodes
|
13
|
-
|
14
|
-
def self.parse(string)
|
15
|
-
new.parse string
|
16
|
-
end
|
17
|
-
|
18
|
-
def initialize
|
19
|
-
@scanner = Scanner.new
|
20
|
-
end
|
21
|
-
|
22
|
-
def parse(string)
|
23
|
-
@scanner.scan_setup(string)
|
24
|
-
do_parse
|
25
|
-
end
|
26
|
-
|
27
|
-
def next_token
|
28
|
-
@scanner.next_token
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
# :startdoc:
|
33
|
-
end
|