decentworks-date-support 0.1.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 +7 -0
- data/.gem_rbs_collection/actionpack/7.2/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/actionpack/7.2/actioncontroller-7.2.rbs +14 -0
- data/.gem_rbs_collection/actionpack/7.2/actioncontroller.rbs +290 -0
- data/.gem_rbs_collection/actionpack/7.2/actiondispatch.rbs +349 -0
- data/.gem_rbs_collection/actionpack/7.2/actionpack-generated.rbs +11497 -0
- data/.gem_rbs_collection/actionpack/7.2/patch.rbs +77 -0
- data/.gem_rbs_collection/actionview/6.0/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/actionview/6.0/actionview-generated.rbs +8976 -0
- data/.gem_rbs_collection/actionview/6.0/actionview.rbs +1940 -0
- data/.gem_rbs_collection/actionview/6.0/patch.rbs +57 -0
- data/.gem_rbs_collection/activesupport/7.0/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/activesupport/7.0/activesupport-7.0.rbs +381 -0
- data/.gem_rbs_collection/activesupport/7.0/activesupport-generated.rbs +11633 -0
- data/.gem_rbs_collection/activesupport/7.0/activesupport.rbs +724 -0
- data/.gem_rbs_collection/activesupport/7.0/manifest.yaml +15 -0
- data/.gem_rbs_collection/activesupport/7.0/patch.rbs +55 -0
- data/.gem_rbs_collection/ast/2.4/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/ast/2.4/ast.rbs +73 -0
- data/.gem_rbs_collection/cgi/0.5/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/cgi/0.5/core.rbs +925 -0
- data/.gem_rbs_collection/cgi/0.5/manifest.yaml +3 -0
- data/.gem_rbs_collection/concurrent-ruby/1.1/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/concurrent-ruby/1.1/array.rbs +4 -0
- data/.gem_rbs_collection/concurrent-ruby/1.1/atomic_reference.rbs +16 -0
- data/.gem_rbs_collection/concurrent-ruby/1.1/executor.rbs +96 -0
- data/.gem_rbs_collection/concurrent-ruby/1.1/hash.rbs +4 -0
- data/.gem_rbs_collection/concurrent-ruby/1.1/map.rbs +68 -0
- data/.gem_rbs_collection/concurrent-ruby/1.1/promises.rbs +249 -0
- data/.gem_rbs_collection/concurrent-ruby/1.1/set.rbs +4 -0
- data/.gem_rbs_collection/concurrent-ruby/1.1/timer_task.rbs +47 -0
- data/.gem_rbs_collection/concurrent-ruby/1.1/utility/processor_counter.rbs +5 -0
- data/.gem_rbs_collection/connection_pool/2.4/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/connection_pool/2.4/connection_pool.rbs +34 -0
- data/.gem_rbs_collection/connection_pool/2.4/manifest.yaml +2 -0
- data/.gem_rbs_collection/diff-lcs/1.5/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/diff-lcs/1.5/diff-lcs.rbs +11 -0
- data/.gem_rbs_collection/faker/3.4.2/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/faker/3.4.2/faker-2.23.rbs +90 -0
- data/.gem_rbs_collection/faker/3.4.2/faker.rbs +18 -0
- data/.gem_rbs_collection/i18n/1.10/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/i18n/1.10/backend.rbs +274 -0
- data/.gem_rbs_collection/i18n/1.10/i18n.rbs +116 -0
- data/.gem_rbs_collection/lint_roller/1.1/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/lint_roller/1.1/lint_roller.rbs +48 -0
- data/.gem_rbs_collection/minitest/5.25/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/abstract_reporter.rbs +52 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/assertion.rbs +17 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/assertions.rbs +590 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/backtrace_filter.rbs +23 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/bench_spec.rbs +102 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/benchmark.rbs +259 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/composite_reporter.rbs +25 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/compress.rbs +13 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/error_on_warning.rbs +3 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/expectation.rbs +2 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/expectations.rbs +21 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/guard.rbs +64 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/mock.rbs +64 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/parallel/executor.rbs +46 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/parallel/test/class_methods.rbs +5 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/parallel/test.rbs +3 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/parallel.rbs +2 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/pride_io.rbs +62 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/pride_lol.rbs +19 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/progress_reporter.rbs +11 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/reportable.rbs +53 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/reporter.rbs +5 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/result.rbs +28 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/runnable.rbs +163 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/skip.rbs +6 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/spec/dsl/instance_methods.rbs +48 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/spec/dsl.rbs +129 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/spec.rbs +11 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/statistics_reporter.rbs +81 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/summary_reporter.rbs +18 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/test/lifecycle_hooks.rbs +92 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/test.rbs +69 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/unexpected_error.rbs +12 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/unexpected_warning.rbs +6 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/unit/test_case.rbs +3 -0
- data/.gem_rbs_collection/minitest/5.25/minitest/unit.rbs +4 -0
- data/.gem_rbs_collection/minitest/5.25/minitest.rbs +115 -0
- data/.gem_rbs_collection/nokogiri/1.11/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/nokogiri/1.11/nokogiri.rbs +2332 -0
- data/.gem_rbs_collection/nokogiri/1.11/patch.rbs +4 -0
- data/.gem_rbs_collection/parallel/1.20/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/parallel/1.20/parallel.rbs +86 -0
- data/.gem_rbs_collection/parser/3.2/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/parser/3.2/manifest.yaml +7 -0
- data/.gem_rbs_collection/parser/3.2/parser.rbs +194 -0
- data/.gem_rbs_collection/parser/3.2/polyfill.rbs +4 -0
- data/.gem_rbs_collection/rack/2.2/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/rack/2.2/manifest.yaml +3 -0
- data/.gem_rbs_collection/rack/2.2/rack.rbs +1480 -0
- data/.gem_rbs_collection/rails-dom-testing/2.0/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/rails-dom-testing/2.0/rails-dom-testing.rbs +51 -0
- data/.gem_rbs_collection/rails-html-sanitizer/1.6/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/rails-html-sanitizer/1.6/rails-html-sanitizer.rbs +53 -0
- data/.gem_rbs_collection/railties/6.0/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/railties/6.0/manifest.yaml +2 -0
- data/.gem_rbs_collection/railties/6.0/patch.rbs +17 -0
- data/.gem_rbs_collection/railties/6.0/railties-generated.rbs +4822 -0
- data/.gem_rbs_collection/railties/6.0/railties.rbs +44 -0
- data/.gem_rbs_collection/rainbow/3.0/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/rainbow/3.0/global.rbs +7 -0
- data/.gem_rbs_collection/rainbow/3.0/presenter.rbs +209 -0
- data/.gem_rbs_collection/rainbow/3.0/rainbow.rbs +5 -0
- data/.gem_rbs_collection/rake/13.0/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/rake/13.0/manifest.yaml +2 -0
- data/.gem_rbs_collection/rake/13.0/rake.rbs +39 -0
- data/.gem_rbs_collection/regexp_parser/2.8/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/regexp_parser/2.8/regexp_parser.rbs +17 -0
- data/.gem_rbs_collection/rubocop/1.57/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/rubocop/1.57/rubocop.rbs +208 -0
- data/.gem_rbs_collection/rubocop-ast/1.46/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/rubocop-ast/1.46/rubocop-ast.rbs +903 -0
- data/.gem_rbs_collection/thor/1.2/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/thor/1.2/thor.rbs +62 -0
- data/.gem_rbs_collection/tzinfo/2.0/.rbs_meta.yaml +9 -0
- data/.gem_rbs_collection/tzinfo/2.0/manifest.yaml +7 -0
- data/.gem_rbs_collection/tzinfo/2.0/tzinfo.rbs +600 -0
- data/.rspec +3 -0
- data/.rubocop.yml +8 -0
- data/.ruby-version +1 -0
- data/CHANGELOG.md +5 -0
- data/CODE_OF_CONDUCT.md +132 -0
- data/LICENSE +21 -0
- data/LICENSE.txt +21 -0
- data/README.md +54 -0
- data/Rakefile +12 -0
- data/Steepfile +43 -0
- data/lib/decentworks/active_support/time_with_zone_support.rb +327 -0
- data/lib/decentworks/date/support/version.rb +9 -0
- data/lib/decentworks/date_support.rb +323 -0
- data/lib/decentworks_date_support.rb +4 -0
- data/rbs_collection.lock.yaml +288 -0
- data/rbs_collection.yaml +41 -0
- data/sig/decentworks/active_support/time_with_zone_support.rbs +109 -0
- data/sig/decentworks/date/support.rbs +8 -0
- data/sig/decentworks/date_support.rbs +107 -0
- metadata +197 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 6e9dfe6b36ab7e84d333bb4562533c8552fac643b805ad2839948d93bc001740
|
|
4
|
+
data.tar.gz: 3ef12c40ef40af471f5ef8bf8ef5a3b73ab44e372c091c41b41674bc0894d978
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: c85f09c4a5579df1c9108f49a2950cea6a7b29ad91f05a38a5963a23e0351b0227fa7c799d44a89ec0300ba73a4ac5ef0279deeab1baab3c69ff64be68b475d7
|
|
7
|
+
data.tar.gz: 883158b0abd8e2c1e7e4184a82d4545795f1a91b5660eddbfaa79c72ea50bcb9ed1cd750cc2bf6c36389246156a6266bd566e2a7842e3d871832800982bba128
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
module ActionController
|
|
2
|
+
module AllowBrowser
|
|
3
|
+
extend ActiveSupport::Concern
|
|
4
|
+
|
|
5
|
+
module ClassMethods
|
|
6
|
+
def allow_browser: (versions: :modern | Hash[untyped, false | _ToS], ?block: ^() [self: Base] -> void, **untyped options) -> void
|
|
7
|
+
end
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
class Base < Metal
|
|
11
|
+
extend AllowBrowser::ClassMethods
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
module ActionController
|
|
2
|
+
interface _API_and_Base
|
|
3
|
+
def flash: () -> untyped
|
|
4
|
+
end
|
|
5
|
+
|
|
6
|
+
class Base < Metal
|
|
7
|
+
include _API_and_Base
|
|
8
|
+
|
|
9
|
+
# https://github.com/rails/rails/blob/v6.0.3.2/actionpack/lib/action_controller/base.rb#L205-L255
|
|
10
|
+
include AbstractController::Rendering
|
|
11
|
+
include AbstractController::Translation
|
|
12
|
+
include AbstractController::AssetPaths
|
|
13
|
+
include Helpers
|
|
14
|
+
extend Helpers::ClassMethods
|
|
15
|
+
extend AbstractController::Helpers::ClassMethods
|
|
16
|
+
include UrlFor
|
|
17
|
+
include Redirecting
|
|
18
|
+
include ActionView::Layouts
|
|
19
|
+
extend ::ActionView::Layouts::ClassMethods
|
|
20
|
+
include Rendering
|
|
21
|
+
extend Rendering::ClassMethods
|
|
22
|
+
include Renderers::All
|
|
23
|
+
include ConditionalGet
|
|
24
|
+
extend ConditionalGet::ClassMethods
|
|
25
|
+
include EtagWithTemplateDigest
|
|
26
|
+
include EtagWithFlash
|
|
27
|
+
include Caching
|
|
28
|
+
include AbstractController::Caching
|
|
29
|
+
extend AbstractController::Caching::ClassMethods
|
|
30
|
+
extend AbstractController::Caching::Fragments::ClassMethods
|
|
31
|
+
include MimeResponds
|
|
32
|
+
include ImplicitRender
|
|
33
|
+
include StrongParameters
|
|
34
|
+
include ParameterEncoding
|
|
35
|
+
extend ParameterEncoding::ClassMethods
|
|
36
|
+
include Cookies
|
|
37
|
+
include Flash
|
|
38
|
+
extend Flash::ClassMethods
|
|
39
|
+
include FormBuilder
|
|
40
|
+
extend FormBuilder::ClassMethods
|
|
41
|
+
include RequestForgeryProtection
|
|
42
|
+
extend RequestForgeryProtection::ClassMethods
|
|
43
|
+
include ContentSecurityPolicy
|
|
44
|
+
extend ContentSecurityPolicy::ClassMethods
|
|
45
|
+
include ForceSSL
|
|
46
|
+
extend ForceSSL::ClassMethods
|
|
47
|
+
include Streaming
|
|
48
|
+
include DataStreaming
|
|
49
|
+
include HttpAuthentication::Basic::ControllerMethods
|
|
50
|
+
extend HttpAuthentication::Basic::ControllerMethods::ClassMethods
|
|
51
|
+
include HttpAuthentication::Digest::ControllerMethods
|
|
52
|
+
include HttpAuthentication::Token::ControllerMethods
|
|
53
|
+
include DefaultHeaders
|
|
54
|
+
extend DefaultHeaders::ClassMethods
|
|
55
|
+
include AbstractController::Callbacks
|
|
56
|
+
extend AbstractController::Callbacks::ClassMethods
|
|
57
|
+
include Rescue
|
|
58
|
+
include ActiveSupport::Rescuable
|
|
59
|
+
extend ActiveSupport::Rescuable::ClassMethods
|
|
60
|
+
include Instrumentation
|
|
61
|
+
extend Instrumentation::ClassMethods
|
|
62
|
+
include ParamsWrapper
|
|
63
|
+
extend ParamsWrapper::ClassMethods
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
class API < Metal
|
|
67
|
+
include _API_and_Base
|
|
68
|
+
|
|
69
|
+
# https://github.com/rails/rails/blob/v6.0.3.2/actionpack/lib/action_controller/api.rb#L112-L145
|
|
70
|
+
include AbstractController::Rendering
|
|
71
|
+
include UrlFor
|
|
72
|
+
include Redirecting
|
|
73
|
+
include ApiRendering
|
|
74
|
+
include Renderers::All
|
|
75
|
+
include ConditionalGet
|
|
76
|
+
extend ConditionalGet::ClassMethods
|
|
77
|
+
include BasicImplicitRender
|
|
78
|
+
include StrongParameters
|
|
79
|
+
include ForceSSL
|
|
80
|
+
extend ForceSSL::ClassMethods
|
|
81
|
+
include DataStreaming
|
|
82
|
+
include DefaultHeaders
|
|
83
|
+
extend DefaultHeaders::ClassMethods
|
|
84
|
+
include AbstractController::Callbacks
|
|
85
|
+
extend AbstractController::Callbacks::ClassMethods
|
|
86
|
+
include Rescue
|
|
87
|
+
include ActiveSupport::Rescuable
|
|
88
|
+
extend ActiveSupport::Rescuable::ClassMethods
|
|
89
|
+
include Instrumentation
|
|
90
|
+
extend Instrumentation::ClassMethods
|
|
91
|
+
include ParamsWrapper
|
|
92
|
+
extend ParamsWrapper::ClassMethods
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
module HttpAuthentication
|
|
96
|
+
module Token
|
|
97
|
+
TOKEN_KEY: ::String
|
|
98
|
+
TOKEN_REGEX: ::Regexp
|
|
99
|
+
AUTHN_PAIR_DELIMITERS: ::Regexp
|
|
100
|
+
|
|
101
|
+
extend ::ActionController::HttpAuthentication::Token
|
|
102
|
+
|
|
103
|
+
module ControllerMethods
|
|
104
|
+
def authenticate_or_request_with_http_token: (?String realm, ?String? message) { (String token, ActiveSupport::HashWithIndifferentAccess[untyped, untyped] options) -> boolish } -> untyped
|
|
105
|
+
|
|
106
|
+
def authenticate_with_http_token: () { (String token, ActiveSupport::HashWithIndifferentAccess[untyped, untyped] options) -> boolish } -> boolish
|
|
107
|
+
|
|
108
|
+
def request_http_token_authentication: (?String realm, ?String? message) -> void
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
def authenticate: (instance controller) { (String token, ActiveSupport::HashWithIndifferentAccess[untyped, untyped] options) -> boolish } -> boolish
|
|
112
|
+
|
|
113
|
+
def token_and_options: (ActionDispatch::Request request) -> [String, ActiveSupport::HashWithIndifferentAccess[untyped, untyped]]?
|
|
114
|
+
|
|
115
|
+
def token_params_from: (String auth) -> Array[String]
|
|
116
|
+
|
|
117
|
+
def raw_params: (String auth) -> Array[String]
|
|
118
|
+
|
|
119
|
+
def params_array_from: (Array[String] raw_params) -> Array[String]
|
|
120
|
+
|
|
121
|
+
def rewrite_param_values: (Array[String] array_params) -> Array[String]
|
|
122
|
+
|
|
123
|
+
def encode_credentials: (String token, ?::Hash[untyped, untyped] options) -> ::String
|
|
124
|
+
|
|
125
|
+
def authentication_request: (instance controller, String realm, ?String? message) -> void
|
|
126
|
+
end
|
|
127
|
+
end
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
module AbstractController::Callbacks::ClassMethods
|
|
131
|
+
interface _BeforeActionCallback
|
|
132
|
+
def before: (ActionController::Base controller) -> void
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
interface _AroundActionCallback
|
|
136
|
+
def around: (ActionController::Base controller) { () -> void } -> void
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
interface _AfterActionCallback
|
|
140
|
+
def after: (ActionController::Base controller) -> void
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
type before_action_callback[T] = Symbol | ^(T controller) [self: T] -> void | _BeforeActionCallback
|
|
144
|
+
type around_action_callback[T] = Symbol | ^(T controller, ^() -> void) [self: T] -> void | _AroundActionCallback
|
|
145
|
+
type after_action_callback[T] = Symbol | ^(T controller) [self: T] -> void | _AfterActionCallback
|
|
146
|
+
|
|
147
|
+
def before_action: (*before_action_callback[instance], ?if: before_action_callback[instance], ?unless: before_action_callback[instance], **untyped) ?{ (instance controller) [self: instance] -> void } -> void
|
|
148
|
+
def around_action: (*around_action_callback[instance], ?if: around_action_callback[instance], ?unless: around_action_callback[instance], **untyped) ?{ (instance controller, ^() -> void) [self: instance] -> void } -> void
|
|
149
|
+
def after_action: (*after_action_callback[instance], ?if: after_action_callback[instance], ?unless: after_action_callback[instance], **untyped) ?{ (instance controller) [self: instance] -> void } -> void
|
|
150
|
+
def skip_before_action: (*before_action_callback[instance], ?if: before_action_callback[instance], ?unless: before_action_callback[instance], **untyped) ?{ (instance controller) [self: instance] -> void } -> void
|
|
151
|
+
def skip_around_action: (*around_action_callback[instance], ?if: around_action_callback[instance], ?unless: around_action_callback[instance], **untyped) ?{ (instance controller, ^() -> void) [self: instance] -> void } -> void
|
|
152
|
+
def skip_after_action: (*after_action_callback[instance], ?if: after_action_callback[instance], ?unless: after_action_callback[instance], **untyped) ?{ (instance controller) [self: instance] -> void } -> void
|
|
153
|
+
def prepend_before_action: (*before_action_callback[instance], ?if: before_action_callback[instance], ?unless: before_action_callback[instance], **untyped) ?{ (instance controller) [self: instance] -> void } -> void
|
|
154
|
+
def prepend_around_action: (*around_action_callback[instance], ?if: around_action_callback[instance], ?unless: around_action_callback[instance], **untyped) ?{ (instance controller, ^() -> void) [self: instance] -> void } -> void
|
|
155
|
+
def prepend_after_action: (*after_action_callback[instance], ?if: after_action_callback[instance], ?unless: after_action_callback[instance], **untyped) ?{ (instance controller) [self: instance] -> void } -> void
|
|
156
|
+
|
|
157
|
+
alias append_before_action before_action
|
|
158
|
+
alias append_around_action around_action
|
|
159
|
+
alias append_after_action after_action
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
module ActionController
|
|
163
|
+
class Parameters
|
|
164
|
+
# Deletes a key-value pair from +Parameters+ and returns the value. If
|
|
165
|
+
# +key+ is not found, returns +nil+ (or, with optional code block, yields
|
|
166
|
+
# +key+ and returns the result). Cf. +#extract!+, which returns the
|
|
167
|
+
# corresponding +ActionController::Parameters+ object.
|
|
168
|
+
def delete: (untyped key) ?{ (untyped key) -> untyped } -> untyped
|
|
169
|
+
|
|
170
|
+
def keys: () -> Array[untyped]
|
|
171
|
+
def key?: (untyped key) -> bool
|
|
172
|
+
def has_key?: (untyped key) -> bool
|
|
173
|
+
def values: () -> Array[untyped]
|
|
174
|
+
def has_value?: (untyped value) -> bool
|
|
175
|
+
def empty?: () -> bool
|
|
176
|
+
def include?: (untyped key) -> bool
|
|
177
|
+
def as_json: () -> String
|
|
178
|
+
def to_s: () -> String
|
|
179
|
+
def each_key: () { (untyped) -> untyped } -> Hash[untyped, untyped]
|
|
180
|
+
| () -> Enumerator[untyped, self]
|
|
181
|
+
def fetch: (untyped key, *untyped args) ?{ () -> untyped } -> untyped
|
|
182
|
+
end
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
module AbstractController
|
|
186
|
+
module Helpers
|
|
187
|
+
module ClassMethods
|
|
188
|
+
# The +helper+ class method can take a series of helper module names, a block, or both.
|
|
189
|
+
#
|
|
190
|
+
# ==== Options
|
|
191
|
+
# * <tt>*args</tt> - Module, Symbol, String
|
|
192
|
+
# * <tt>block</tt> - A block defining helper methods
|
|
193
|
+
#
|
|
194
|
+
# When the argument is a module it will be included directly in the template class.
|
|
195
|
+
# helper FooHelper # => includes FooHelper
|
|
196
|
+
#
|
|
197
|
+
# When the argument is a string or symbol, the method will provide the "_helper" suffix, require the file
|
|
198
|
+
# and include the module in the template class. The second form illustrates how to include custom helpers
|
|
199
|
+
# when working with namespaced controllers, or other cases where the file containing the helper definition is not
|
|
200
|
+
# in one of Rails' standard load paths:
|
|
201
|
+
# helper :foo # => requires 'foo_helper' and includes FooHelper
|
|
202
|
+
# helper 'resources/foo' # => requires 'resources/foo_helper' and includes Resources::FooHelper
|
|
203
|
+
#
|
|
204
|
+
# Additionally, the +helper+ class method can receive and evaluate a block, making the methods defined available
|
|
205
|
+
# to the template.
|
|
206
|
+
#
|
|
207
|
+
# # One line
|
|
208
|
+
# helper { def hello() "Hello, world!" end }
|
|
209
|
+
#
|
|
210
|
+
# # Multi-line
|
|
211
|
+
# helper do
|
|
212
|
+
# def foo(bar)
|
|
213
|
+
# "#{bar} is the very best"
|
|
214
|
+
# end
|
|
215
|
+
# end
|
|
216
|
+
#
|
|
217
|
+
# Finally, all the above styles can be mixed together, and the +helper+ method can be invoked with a mix of
|
|
218
|
+
# +symbols+, +strings+, +modules+ and blocks.
|
|
219
|
+
#
|
|
220
|
+
# helper(:three, BlindHelper) { def mice() 'mice' end }
|
|
221
|
+
#
|
|
222
|
+
def helper: (*untyped args) ?{ () -> untyped } -> untyped
|
|
223
|
+
end
|
|
224
|
+
end
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
module AbstractController
|
|
228
|
+
module Caching
|
|
229
|
+
module Fragments
|
|
230
|
+
module ClassMethods
|
|
231
|
+
# Allows you to specify controller-wide key prefixes for
|
|
232
|
+
# cache fragments. Pass either a constant +value+, or a block
|
|
233
|
+
# which computes a value each time a cache key is generated.
|
|
234
|
+
#
|
|
235
|
+
# For example, you may want to prefix all fragment cache keys
|
|
236
|
+
# with a global version identifier, so you can easily
|
|
237
|
+
# invalidate all caches.
|
|
238
|
+
#
|
|
239
|
+
# class ApplicationController
|
|
240
|
+
# fragment_cache_key "v1"
|
|
241
|
+
# end
|
|
242
|
+
#
|
|
243
|
+
# When it's time to invalidate all fragments, simply change
|
|
244
|
+
# the string constant. Or, progressively roll out the cache
|
|
245
|
+
# invalidation using a computed value:
|
|
246
|
+
#
|
|
247
|
+
# class ApplicationController
|
|
248
|
+
# fragment_cache_key do
|
|
249
|
+
# @account.id.odd? ? "v1" : "v2"
|
|
250
|
+
# end
|
|
251
|
+
# end
|
|
252
|
+
def fragment_cache_key: (?untyped? value) ?{ () -> untyped } -> untyped
|
|
253
|
+
end
|
|
254
|
+
end
|
|
255
|
+
end
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
module AbstractController
|
|
259
|
+
module Rendering
|
|
260
|
+
def render_to_string: (*untyped args) ?{ () -> untyped } -> ::String
|
|
261
|
+
end
|
|
262
|
+
end
|
|
263
|
+
|
|
264
|
+
module ActionController
|
|
265
|
+
module Caching
|
|
266
|
+
extend AbstractController::Caching::ClassMethods
|
|
267
|
+
extend AbstractController::Caching::Fragments::ClassMethods
|
|
268
|
+
end
|
|
269
|
+
end
|
|
270
|
+
|
|
271
|
+
module ActionController
|
|
272
|
+
module ContentSecurityPolicy
|
|
273
|
+
module ClassMethods
|
|
274
|
+
def content_security_policy: (?bool enabled, **untyped options) ?{ (untyped) -> untyped } -> untyped
|
|
275
|
+
end
|
|
276
|
+
end
|
|
277
|
+
end
|
|
278
|
+
|
|
279
|
+
module ActionController
|
|
280
|
+
class TestSession < Rack::Session::Abstract::PersistedSecure::SecureSessionHash
|
|
281
|
+
def fetch: (untyped key) ?{ () -> untyped } -> untyped
|
|
282
|
+
| (untyped key, untyped args) -> untyped
|
|
283
|
+
end
|
|
284
|
+
end
|
|
285
|
+
|
|
286
|
+
module ActionController
|
|
287
|
+
module Rendering
|
|
288
|
+
def render_to_string: (*untyped args) ?{ () -> untyped } -> ::String
|
|
289
|
+
end
|
|
290
|
+
end
|
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
module ActionDispatch
|
|
2
|
+
class Cookies
|
|
3
|
+
class CookieJar
|
|
4
|
+
def fetch: (untyped name, *untyped args) ?{ () -> untyped } -> untyped
|
|
5
|
+
end
|
|
6
|
+
end
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
module ActionDispatch
|
|
10
|
+
module Http
|
|
11
|
+
class Headers
|
|
12
|
+
# Returns the value for the given key mapped to @env.
|
|
13
|
+
#
|
|
14
|
+
# If the key is not found and an optional code block is not provided,
|
|
15
|
+
# raises a <tt>KeyError</tt> exception.
|
|
16
|
+
#
|
|
17
|
+
# If the code block is provided, then it will be run and
|
|
18
|
+
# its result returned.
|
|
19
|
+
def fetch: (untyped key) ?{ () -> untyped } -> untyped
|
|
20
|
+
| (untyped key, untyped default) -> untyped
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
module ActionDispatch
|
|
26
|
+
class Request
|
|
27
|
+
class Session
|
|
28
|
+
# Returns value of the given key from the session, or raises +KeyError+
|
|
29
|
+
# if can't find the given key and no default value is set.
|
|
30
|
+
# Returns default value if specified.
|
|
31
|
+
#
|
|
32
|
+
# session.fetch(:foo)
|
|
33
|
+
# # => KeyError: key not found: "foo"
|
|
34
|
+
#
|
|
35
|
+
# session.fetch(:foo, :bar)
|
|
36
|
+
# # => :bar
|
|
37
|
+
#
|
|
38
|
+
# session.fetch(:foo) do
|
|
39
|
+
# :bar
|
|
40
|
+
# end
|
|
41
|
+
# # => :bar
|
|
42
|
+
def fetch: (untyped key) ?{ () -> untyped } -> untyped
|
|
43
|
+
| (untyped key, untyped default) -> untyped
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
module ActionDispatch
|
|
49
|
+
class RequestId
|
|
50
|
+
X_REQUEST_ID: ::String
|
|
51
|
+
|
|
52
|
+
def initialize: (Rack::_Application app) -> void
|
|
53
|
+
|
|
54
|
+
def call: (Rack::env env) -> Rack::response
|
|
55
|
+
|
|
56
|
+
private
|
|
57
|
+
|
|
58
|
+
def make_request_id: (String? request_id) -> String
|
|
59
|
+
|
|
60
|
+
def internal_request_id: () -> String
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
module ActionDispatch
|
|
65
|
+
module Routing
|
|
66
|
+
module PolymorphicRoutes
|
|
67
|
+
def polymorphic_url: (untyped record_or_hash_or_array, ?::Hash[untyped, untyped] options) -> String
|
|
68
|
+
def polymorphic_path: (untyped record_or_hash_or_array, ?::Hash[untyped, untyped] options) -> String
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
class RouteSet
|
|
72
|
+
def draw: () { () [self: Mapper] -> untyped } -> nil
|
|
73
|
+
|
|
74
|
+
def url_helpers: (?bool supports_path) -> singleton(RouteSet_AnonymousModule)
|
|
75
|
+
|
|
76
|
+
module RouteSet_AnonymousModule
|
|
77
|
+
include ActiveSupport::Concern
|
|
78
|
+
include UrlFor
|
|
79
|
+
# https://github.com/rails/rails/blob/v7.2.2.2/actionpack/lib/action_dispatch/routing/route_set.rb#L518
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
class Mapper
|
|
84
|
+
module HttpHelpers
|
|
85
|
+
# Define a route that only recognizes HTTP GET.
|
|
86
|
+
# For supported arguments, see match[rdoc-ref:Base#match]
|
|
87
|
+
#
|
|
88
|
+
# get 'bacon', to: 'food#bacon'
|
|
89
|
+
def get: (*untyped args) ?{ () -> untyped } -> untyped
|
|
90
|
+
|
|
91
|
+
# Define a route that only recognizes HTTP POST.
|
|
92
|
+
# For supported arguments, see match[rdoc-ref:Base#match]
|
|
93
|
+
#
|
|
94
|
+
# post 'bacon', to: 'food#bacon'
|
|
95
|
+
def post: (*untyped args) ?{ () -> untyped } -> untyped
|
|
96
|
+
|
|
97
|
+
# Define a route that only recognizes HTTP PATCH.
|
|
98
|
+
# For supported arguments, see match[rdoc-ref:Base#match]
|
|
99
|
+
#
|
|
100
|
+
# patch 'bacon', to: 'food#bacon'
|
|
101
|
+
def patch: (*untyped args) ?{ () -> untyped } -> untyped
|
|
102
|
+
|
|
103
|
+
# Define a route that only recognizes HTTP PUT.
|
|
104
|
+
# For supported arguments, see match[rdoc-ref:Base#match]
|
|
105
|
+
#
|
|
106
|
+
# put 'bacon', to: 'food#bacon'
|
|
107
|
+
def put: (*untyped args) ?{ () -> untyped } -> untyped
|
|
108
|
+
|
|
109
|
+
# Define a route that only recognizes HTTP DELETE.
|
|
110
|
+
# For supported arguments, see match[rdoc-ref:Base#match]
|
|
111
|
+
#
|
|
112
|
+
# delete 'broccoli', to: 'food#broccoli'
|
|
113
|
+
def delete: (*untyped args) ?{ () -> untyped } -> untyped
|
|
114
|
+
|
|
115
|
+
private
|
|
116
|
+
|
|
117
|
+
def map_method: (untyped method, untyped args) ?{ () -> untyped } -> untyped
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
module Resources
|
|
121
|
+
# Sometimes, you have a resource that clients always look up without
|
|
122
|
+
# referencing an ID. A common example, /profile always shows the
|
|
123
|
+
# profile of the currently logged in user. In this case, you can use
|
|
124
|
+
# a singular resource to map /profile (rather than /profile/:id) to
|
|
125
|
+
# the show action:
|
|
126
|
+
#
|
|
127
|
+
# resource :profile
|
|
128
|
+
#
|
|
129
|
+
# This creates six different routes in your application, all mapping to
|
|
130
|
+
# the +Profiles+ controller (note that the controller is named after
|
|
131
|
+
# the plural):
|
|
132
|
+
#
|
|
133
|
+
# GET /profile/new
|
|
134
|
+
# GET /profile
|
|
135
|
+
# GET /profile/edit
|
|
136
|
+
# PATCH/PUT /profile
|
|
137
|
+
# DELETE /profile
|
|
138
|
+
# POST /profile
|
|
139
|
+
#
|
|
140
|
+
# === Options
|
|
141
|
+
# Takes same options as resources[rdoc-ref:#resources]
|
|
142
|
+
def resource: (*untyped resources) ?{ () -> untyped } -> untyped
|
|
143
|
+
|
|
144
|
+
# In Rails, a resourceful route provides a mapping between HTTP verbs
|
|
145
|
+
# and URLs and controller actions. By convention, each action also maps
|
|
146
|
+
# to particular CRUD operations in a database. A single entry in the
|
|
147
|
+
# routing file, such as
|
|
148
|
+
#
|
|
149
|
+
# resources :photos
|
|
150
|
+
#
|
|
151
|
+
# creates seven different routes in your application, all mapping to
|
|
152
|
+
# the +Photos+ controller:
|
|
153
|
+
#
|
|
154
|
+
# GET /photos
|
|
155
|
+
# GET /photos/new
|
|
156
|
+
# POST /photos
|
|
157
|
+
# GET /photos/:id
|
|
158
|
+
# GET /photos/:id/edit
|
|
159
|
+
# PATCH/PUT /photos/:id
|
|
160
|
+
# DELETE /photos/:id
|
|
161
|
+
#
|
|
162
|
+
# Resources can also be nested infinitely by using this block syntax:
|
|
163
|
+
#
|
|
164
|
+
# resources :photos do
|
|
165
|
+
# resources :comments
|
|
166
|
+
# end
|
|
167
|
+
#
|
|
168
|
+
# This generates the following comments routes:
|
|
169
|
+
#
|
|
170
|
+
# GET /photos/:photo_id/comments
|
|
171
|
+
# GET /photos/:photo_id/comments/new
|
|
172
|
+
# POST /photos/:photo_id/comments
|
|
173
|
+
# GET /photos/:photo_id/comments/:id
|
|
174
|
+
# GET /photos/:photo_id/comments/:id/edit
|
|
175
|
+
# PATCH/PUT /photos/:photo_id/comments/:id
|
|
176
|
+
# DELETE /photos/:photo_id/comments/:id
|
|
177
|
+
#
|
|
178
|
+
# === Options
|
|
179
|
+
# Takes same options as match[rdoc-ref:Base#match] as well as:
|
|
180
|
+
#
|
|
181
|
+
# [:path_names]
|
|
182
|
+
# Allows you to change the segment component of the +edit+ and +new+ actions.
|
|
183
|
+
# Actions not specified are not changed.
|
|
184
|
+
#
|
|
185
|
+
# resources :posts, path_names: { new: "brand_new" }
|
|
186
|
+
#
|
|
187
|
+
# The above example will now change /posts/new to /posts/brand_new.
|
|
188
|
+
#
|
|
189
|
+
# [:path]
|
|
190
|
+
# Allows you to change the path prefix for the resource.
|
|
191
|
+
#
|
|
192
|
+
# resources :posts, path: 'postings'
|
|
193
|
+
#
|
|
194
|
+
# The resource and all segments will now route to /postings instead of /posts.
|
|
195
|
+
#
|
|
196
|
+
# [:only]
|
|
197
|
+
# Only generate routes for the given actions.
|
|
198
|
+
#
|
|
199
|
+
# resources :cows, only: :show
|
|
200
|
+
# resources :cows, only: [:show, :index]
|
|
201
|
+
#
|
|
202
|
+
# [:except]
|
|
203
|
+
# Generate all routes except for the given actions.
|
|
204
|
+
#
|
|
205
|
+
# resources :cows, except: :show
|
|
206
|
+
# resources :cows, except: [:show, :index]
|
|
207
|
+
#
|
|
208
|
+
# [:shallow]
|
|
209
|
+
# Generates shallow routes for nested resource(s). When placed on a parent resource,
|
|
210
|
+
# generates shallow routes for all nested resources.
|
|
211
|
+
#
|
|
212
|
+
# resources :posts, shallow: true do
|
|
213
|
+
# resources :comments
|
|
214
|
+
# end
|
|
215
|
+
#
|
|
216
|
+
# Is the same as:
|
|
217
|
+
#
|
|
218
|
+
# resources :posts do
|
|
219
|
+
# resources :comments, except: [:show, :edit, :update, :destroy]
|
|
220
|
+
# end
|
|
221
|
+
# resources :comments, only: [:show, :edit, :update, :destroy]
|
|
222
|
+
#
|
|
223
|
+
# This allows URLs for resources that otherwise would be deeply nested such
|
|
224
|
+
# as a comment on a blog post like <tt>/posts/a-long-permalink/comments/1234</tt>
|
|
225
|
+
# to be shortened to just <tt>/comments/1234</tt>.
|
|
226
|
+
#
|
|
227
|
+
# Set <tt>shallow: false</tt> on a child resource to ignore a parent's shallow parameter.
|
|
228
|
+
#
|
|
229
|
+
# [:shallow_path]
|
|
230
|
+
# Prefixes nested shallow routes with the specified path.
|
|
231
|
+
#
|
|
232
|
+
# scope shallow_path: "sekret" do
|
|
233
|
+
# resources :posts do
|
|
234
|
+
# resources :comments, shallow: true
|
|
235
|
+
# end
|
|
236
|
+
# end
|
|
237
|
+
#
|
|
238
|
+
# The +comments+ resource here will have the following routes generated for it:
|
|
239
|
+
#
|
|
240
|
+
# post_comments GET /posts/:post_id/comments(.:format)
|
|
241
|
+
# post_comments POST /posts/:post_id/comments(.:format)
|
|
242
|
+
# new_post_comment GET /posts/:post_id/comments/new(.:format)
|
|
243
|
+
# edit_comment GET /sekret/comments/:id/edit(.:format)
|
|
244
|
+
# comment GET /sekret/comments/:id(.:format)
|
|
245
|
+
# comment PATCH/PUT /sekret/comments/:id(.:format)
|
|
246
|
+
# comment DELETE /sekret/comments/:id(.:format)
|
|
247
|
+
#
|
|
248
|
+
# [:shallow_prefix]
|
|
249
|
+
# Prefixes nested shallow route names with specified prefix.
|
|
250
|
+
#
|
|
251
|
+
# scope shallow_prefix: "sekret" do
|
|
252
|
+
# resources :posts do
|
|
253
|
+
# resources :comments, shallow: true
|
|
254
|
+
# end
|
|
255
|
+
# end
|
|
256
|
+
#
|
|
257
|
+
# The +comments+ resource here will have the following routes generated for it:
|
|
258
|
+
#
|
|
259
|
+
# post_comments GET /posts/:post_id/comments(.:format)
|
|
260
|
+
# post_comments POST /posts/:post_id/comments(.:format)
|
|
261
|
+
# new_post_comment GET /posts/:post_id/comments/new(.:format)
|
|
262
|
+
# edit_sekret_comment GET /comments/:id/edit(.:format)
|
|
263
|
+
# sekret_comment GET /comments/:id(.:format)
|
|
264
|
+
# sekret_comment PATCH/PUT /comments/:id(.:format)
|
|
265
|
+
# sekret_comment DELETE /comments/:id(.:format)
|
|
266
|
+
#
|
|
267
|
+
# [:format]
|
|
268
|
+
# Allows you to specify the default value for optional +format+
|
|
269
|
+
# segment or disable it by supplying +false+.
|
|
270
|
+
#
|
|
271
|
+
# [:param]
|
|
272
|
+
# Allows you to override the default param name of +:id+ in the URL.
|
|
273
|
+
#
|
|
274
|
+
# === Examples
|
|
275
|
+
#
|
|
276
|
+
# # routes call <tt>Admin::PostsController</tt>
|
|
277
|
+
# resources :posts, module: "admin"
|
|
278
|
+
#
|
|
279
|
+
# # resource actions are at /admin/posts.
|
|
280
|
+
# resources :posts, path: "admin/posts"
|
|
281
|
+
def resources: (*untyped resources) ?{ () -> untyped } -> untyped
|
|
282
|
+
end
|
|
283
|
+
end
|
|
284
|
+
end
|
|
285
|
+
end
|
|
286
|
+
|
|
287
|
+
module ActionDispatch
|
|
288
|
+
module Routing
|
|
289
|
+
module Redirection
|
|
290
|
+
# Redirect any path to another path:
|
|
291
|
+
#
|
|
292
|
+
# get "/stories" => redirect("/posts")
|
|
293
|
+
#
|
|
294
|
+
# This will redirect the user, while ignoring certain parts of the request, including query string, etc.
|
|
295
|
+
# <tt>/stories</tt>, <tt>/stories?foo=bar</tt>, etc all redirect to <tt>/posts</tt>.
|
|
296
|
+
#
|
|
297
|
+
# You can also use interpolation in the supplied redirect argument:
|
|
298
|
+
#
|
|
299
|
+
# get 'docs/:article', to: redirect('/wiki/%{article}')
|
|
300
|
+
#
|
|
301
|
+
# Note that if you return a path without a leading slash then the URL is prefixed with the
|
|
302
|
+
# current SCRIPT_NAME environment variable. This is typically '/' but may be different in
|
|
303
|
+
# a mounted engine or where the application is deployed to a subdirectory of a website.
|
|
304
|
+
#
|
|
305
|
+
# Alternatively you can use one of the other syntaxes:
|
|
306
|
+
#
|
|
307
|
+
# The block version of redirect allows for the easy encapsulation of any logic associated with
|
|
308
|
+
# the redirect in question. Either the params and request are supplied as arguments, or just
|
|
309
|
+
# params, depending of how many arguments your block accepts. A string is required as a
|
|
310
|
+
# return value.
|
|
311
|
+
#
|
|
312
|
+
# get 'jokes/:number', to: redirect { |params, request|
|
|
313
|
+
# path = (params[:number].to_i.even? ? "wheres-the-beef" : "i-love-lamp")
|
|
314
|
+
# "http://#{request.host_with_port}/#{path}"
|
|
315
|
+
# }
|
|
316
|
+
#
|
|
317
|
+
# Note that the +do end+ syntax for the redirect block wouldn't work, as Ruby would pass
|
|
318
|
+
# the block to +get+ instead of +redirect+. Use <tt>{ ... }</tt> instead.
|
|
319
|
+
#
|
|
320
|
+
# The options version of redirect allows you to supply only the parts of the URL which need
|
|
321
|
+
# to change, it also supports interpolation of the path similar to the first example.
|
|
322
|
+
#
|
|
323
|
+
# get 'stores/:name', to: redirect(subdomain: 'stores', path: '/%{name}')
|
|
324
|
+
# get 'stores/:name(*all)', to: redirect(subdomain: 'stores', path: '/%{name}%{all}')
|
|
325
|
+
# get '/stories', to: redirect(path: '/posts')
|
|
326
|
+
#
|
|
327
|
+
# This will redirect the user, while changing only the specified parts of the request,
|
|
328
|
+
# for example the +path+ option in the last example.
|
|
329
|
+
# <tt>/stories</tt>, <tt>/stories?foo=bar</tt>, redirect to <tt>/posts</tt> and <tt>/posts?foo=bar</tt> respectively.
|
|
330
|
+
#
|
|
331
|
+
# Finally, an object which responds to call can be supplied to redirect, allowing you to reuse
|
|
332
|
+
# common redirect routes. The call method must accept two arguments, params and request, and return
|
|
333
|
+
# a string.
|
|
334
|
+
#
|
|
335
|
+
# get 'accounts/:name' => redirect(SubdomainRedirector.new('api'))
|
|
336
|
+
#
|
|
337
|
+
def redirect: (*untyped args) ?{ () -> untyped } -> (OptionRedirect | PathRedirect | Redirect)
|
|
338
|
+
end
|
|
339
|
+
end
|
|
340
|
+
end
|
|
341
|
+
|
|
342
|
+
module ActionDispatch
|
|
343
|
+
module Http
|
|
344
|
+
module MimeNegotiation
|
|
345
|
+
class InvalidType < Mime::Type::InvalidMimeType
|
|
346
|
+
end
|
|
347
|
+
end
|
|
348
|
+
end
|
|
349
|
+
end
|