hanami-controller 2.0.0.alpha8 → 2.0.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +123 -3
- data/hanami-controller.gemspec +21 -20
- data/lib/hanami/action/base_params.rb +20 -57
- data/lib/hanami/action/cache/cache_control.rb +14 -10
- data/lib/hanami/action/cache/conditional_get.rb +8 -26
- data/lib/hanami/action/cache/directives.rb +8 -6
- data/lib/hanami/action/cache/expires.rb +10 -11
- data/lib/hanami/action/cache.rb +5 -3
- data/lib/hanami/action/configuration.rb +20 -12
- data/lib/hanami/action/constants.rb +261 -0
- data/lib/hanami/action/cookie_jar.rb +37 -55
- data/lib/hanami/action/cookies.rb +2 -0
- data/lib/hanami/action/csrf_protection.rb +28 -31
- data/lib/hanami/action/flash.rb +4 -0
- data/lib/hanami/action/halt.rb +4 -0
- data/lib/hanami/action/mime.rb +103 -73
- data/lib/hanami/action/params.rb +41 -31
- data/lib/hanami/action/rack/file.rb +5 -9
- data/lib/hanami/action/request.rb +10 -59
- data/lib/hanami/action/response.rb +89 -46
- data/lib/hanami/action/session.rb +5 -3
- data/lib/hanami/action/validatable.rb +18 -19
- data/lib/hanami/action/view_name_inferrer.rb +10 -0
- data/lib/hanami/action.rb +133 -216
- data/lib/hanami/controller/error.rb +2 -0
- data/lib/hanami/controller/version.rb +3 -1
- data/lib/hanami/controller.rb +10 -12
- data/lib/hanami/http/status.rb +3 -1
- metadata +22 -8
- data/lib/hanami/action/glue.rb +0 -40
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hanami-controller
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0.
|
4
|
+
version: 2.0.0.beta1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luca Guidi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 2.0.
|
33
|
+
version: 2.0.beta
|
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: 2.0.
|
40
|
+
version: 2.0.beta
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: dry-configurable
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -84,14 +84,14 @@ dependencies:
|
|
84
84
|
requirements:
|
85
85
|
- - "~>"
|
86
86
|
- !ruby/object:Gem::Version
|
87
|
-
version: '
|
87
|
+
version: '2.0'
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
90
|
version_requirements: !ruby/object:Gem::Requirement
|
91
91
|
requirements:
|
92
92
|
- - "~>"
|
93
93
|
- !ruby/object:Gem::Version
|
94
|
-
version: '
|
94
|
+
version: '2.0'
|
95
95
|
- !ruby/object:Gem::Dependency
|
96
96
|
name: rake
|
97
97
|
requirement: !ruby/object:Gem::Requirement
|
@@ -120,6 +120,20 @@ dependencies:
|
|
120
120
|
- - "~>"
|
121
121
|
- !ruby/object:Gem::Version
|
122
122
|
version: '3.9'
|
123
|
+
- !ruby/object:Gem::Dependency
|
124
|
+
name: rubocop
|
125
|
+
requirement: !ruby/object:Gem::Requirement
|
126
|
+
requirements:
|
127
|
+
- - "~>"
|
128
|
+
- !ruby/object:Gem::Version
|
129
|
+
version: '1.0'
|
130
|
+
type: :development
|
131
|
+
prerelease: false
|
132
|
+
version_requirements: !ruby/object:Gem::Requirement
|
133
|
+
requirements:
|
134
|
+
- - "~>"
|
135
|
+
- !ruby/object:Gem::Version
|
136
|
+
version: '1.0'
|
123
137
|
description: Complete, fast and testable actions for Rack
|
124
138
|
email:
|
125
139
|
- me@lucaguidi.com
|
@@ -139,11 +153,11 @@ files:
|
|
139
153
|
- lib/hanami/action/cache/directives.rb
|
140
154
|
- lib/hanami/action/cache/expires.rb
|
141
155
|
- lib/hanami/action/configuration.rb
|
156
|
+
- lib/hanami/action/constants.rb
|
142
157
|
- lib/hanami/action/cookie_jar.rb
|
143
158
|
- lib/hanami/action/cookies.rb
|
144
159
|
- lib/hanami/action/csrf_protection.rb
|
145
160
|
- lib/hanami/action/flash.rb
|
146
|
-
- lib/hanami/action/glue.rb
|
147
161
|
- lib/hanami/action/halt.rb
|
148
162
|
- lib/hanami/action/mime.rb
|
149
163
|
- lib/hanami/action/params.rb
|
@@ -177,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
177
191
|
- !ruby/object:Gem::Version
|
178
192
|
version: 1.3.1
|
179
193
|
requirements: []
|
180
|
-
rubygems_version: 3.3.
|
194
|
+
rubygems_version: 3.3.3
|
181
195
|
signing_key:
|
182
196
|
specification_version: 4
|
183
197
|
summary: Complete, fast and testable actions for Rack and Hanami
|
data/lib/hanami/action/glue.rb
DELETED
@@ -1,40 +0,0 @@
|
|
1
|
-
module Hanami
|
2
|
-
class Action
|
3
|
-
# Glue code for full stack Hanami applications
|
4
|
-
#
|
5
|
-
# This includes missing rendering logic that it makes sense to include
|
6
|
-
# only for web applications.
|
7
|
-
#
|
8
|
-
# @api private
|
9
|
-
# @since 0.3.0
|
10
|
-
module Glue
|
11
|
-
# Rack environment key that indicates where the action instance is passed
|
12
|
-
#
|
13
|
-
# @api private
|
14
|
-
# @since 0.3.0
|
15
|
-
ENV_KEY = 'hanami.action'.freeze
|
16
|
-
|
17
|
-
protected
|
18
|
-
|
19
|
-
# Put the current instance into the Rack environment
|
20
|
-
#
|
21
|
-
# @api private
|
22
|
-
# @since 0.3.0
|
23
|
-
#
|
24
|
-
# @see Hanami::Action#finish
|
25
|
-
def finish(req, *)
|
26
|
-
req.env[ENV_KEY] = self
|
27
|
-
super
|
28
|
-
end
|
29
|
-
|
30
|
-
# Check if the request's body is a file
|
31
|
-
#
|
32
|
-
# @return [TrueClass,FalseClass] the result of the check
|
33
|
-
#
|
34
|
-
# @since 0.4.3
|
35
|
-
def sending_file?
|
36
|
-
response.body.is_a?(::Rack::File::Iterator)
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|