hanami 2.0.0.rc1 → 2.0.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 +4 -4
- data/CHANGELOG.md +17 -0
- data/FEATURES.md +15 -21
- data/README.md +7 -37
- data/hanami.gemspec +5 -5
- data/lib/hanami/app.rb +0 -5
- data/lib/hanami/config/actions.rb +0 -3
- data/lib/hanami/config/logger.rb +52 -29
- data/lib/hanami/config.rb +22 -1
- data/lib/hanami/extensions/action/slice_configured_action.rb +5 -2
- data/lib/hanami/extensions/view/slice_configured_view.rb +4 -1
- data/lib/hanami/providers/rack.rb +3 -2
- data/lib/hanami/rake_tasks.rb +4 -5
- data/lib/hanami/slice.rb +3 -1
- data/lib/hanami/version.rb +1 -1
- data/lib/hanami/web/rack_logger.rb +64 -15
- data/lib/hanami.rb +24 -5
- data/spec/integration/action/format_config_spec.rb +194 -0
- data/spec/integration/action/slice_configuration_spec.rb +39 -42
- data/spec/integration/code_loading/loading_from_lib_spec.rb +34 -0
- data/spec/integration/rack_app/body_parser_spec.rb +2 -5
- data/spec/integration/rack_app/rack_app_spec.rb +74 -3
- data/spec/integration/setup_spec.rb +2 -2
- data/spec/spec_helper.rb +12 -0
- data/spec/unit/hanami/config/actions/default_values_spec.rb +0 -8
- data/spec/unit/hanami/config/actions_spec.rb +7 -10
- data/spec/unit/hanami/config/logger_spec.rb +4 -4
- data/spec/unit/hanami/version_spec.rb +1 -1
- data/spec/unit/hanami/web/rack_logger_spec.rb +4 -1
- metadata +33 -13
@@ -13,22 +13,19 @@ RSpec.describe Hanami::Config, "#actions" do
|
|
13
13
|
it "is a full actions config" do
|
14
14
|
is_expected.to be_an_instance_of(Hanami::Config::Actions)
|
15
15
|
|
16
|
-
is_expected.to respond_to(:
|
17
|
-
is_expected.to respond_to(:default_response_format=)
|
16
|
+
is_expected.to respond_to(:format)
|
18
17
|
end
|
19
18
|
|
20
19
|
it "configures base action settings" do
|
21
|
-
expect { actions.
|
22
|
-
.to change { actions.
|
23
|
-
.to
|
20
|
+
expect { actions.public_directory = "pub" }
|
21
|
+
.to change { actions.public_directory }
|
22
|
+
.to end_with("pub")
|
24
23
|
end
|
25
24
|
|
26
25
|
it "configures base actions settings using custom methods" do
|
27
|
-
actions.formats
|
28
|
-
|
29
|
-
|
30
|
-
.to change { actions.formats }
|
31
|
-
.to("app/json" => :json)
|
26
|
+
expect { actions.formats.add(:json, "app/json") }
|
27
|
+
.to change { actions.formats.mapping }
|
28
|
+
.to include("app/json" => :json)
|
32
29
|
end
|
33
30
|
|
34
31
|
it "can be finalized" do
|
@@ -72,8 +72,8 @@ RSpec.describe Hanami::Config::Logger do
|
|
72
72
|
end
|
73
73
|
|
74
74
|
describe "#formatter" do
|
75
|
-
it "defaults to :
|
76
|
-
expect(subject.formatter).to eq(:
|
75
|
+
it "defaults to :string" do
|
76
|
+
expect(subject.formatter).to eq(:string)
|
77
77
|
end
|
78
78
|
|
79
79
|
context "when :production environment" do
|
@@ -94,8 +94,8 @@ RSpec.describe Hanami::Config::Logger do
|
|
94
94
|
end
|
95
95
|
|
96
96
|
describe "#template" do
|
97
|
-
it "defaults to
|
98
|
-
expect(subject.template).to
|
97
|
+
it "defaults to :details" do
|
98
|
+
expect(subject.template).to be(:details)
|
99
99
|
end
|
100
100
|
end
|
101
101
|
|
@@ -53,7 +53,10 @@ RSpec.describe Hanami::Web::RackLogger do
|
|
53
53
|
stream.rewind
|
54
54
|
actual = stream.read
|
55
55
|
|
56
|
-
expect(actual).to
|
56
|
+
expect(actual).to eql(<<~LOG)
|
57
|
+
[#{app_name}] [INFO] [#{time}] #{verb} #{status} #{elapsed}µs #{ip} #{path} #{content_length}
|
58
|
+
{"user"=>{"password"=>"[FILTERED]"}}
|
59
|
+
LOG
|
57
60
|
end
|
58
61
|
|
59
62
|
context "ip" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hanami
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0
|
4
|
+
version: 2.0.0
|
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-
|
11
|
+
date: 2022-11-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -97,6 +97,9 @@ dependencies:
|
|
97
97
|
- - "~>"
|
98
98
|
- !ruby/object:Gem::Version
|
99
99
|
version: '1.0'
|
100
|
+
- - ">="
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: 1.0.1
|
100
103
|
- - "<"
|
101
104
|
- !ruby/object:Gem::Version
|
102
105
|
version: '2'
|
@@ -107,6 +110,9 @@ dependencies:
|
|
107
110
|
- - "~>"
|
108
111
|
- !ruby/object:Gem::Version
|
109
112
|
version: '1.0'
|
113
|
+
- - ">="
|
114
|
+
- !ruby/object:Gem::Version
|
115
|
+
version: 1.0.1
|
110
116
|
- - "<"
|
111
117
|
- !ruby/object:Gem::Version
|
112
118
|
version: '2'
|
@@ -116,56 +122,68 @@ dependencies:
|
|
116
122
|
requirements:
|
117
123
|
- - "~>"
|
118
124
|
- !ruby/object:Gem::Version
|
119
|
-
version: 1.0
|
125
|
+
version: '1.0'
|
126
|
+
- - "<"
|
127
|
+
- !ruby/object:Gem::Version
|
128
|
+
version: '2'
|
120
129
|
type: :runtime
|
121
130
|
prerelease: false
|
122
131
|
version_requirements: !ruby/object:Gem::Requirement
|
123
132
|
requirements:
|
124
133
|
- - "~>"
|
125
134
|
- !ruby/object:Gem::Version
|
126
|
-
version: 1.0
|
135
|
+
version: '1.0'
|
136
|
+
- - "<"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '2'
|
127
139
|
- !ruby/object:Gem::Dependency
|
128
140
|
name: dry-logger
|
129
141
|
requirement: !ruby/object:Gem::Requirement
|
130
142
|
requirements:
|
131
143
|
- - "~>"
|
132
144
|
- !ruby/object:Gem::Version
|
133
|
-
version: 1.0
|
145
|
+
version: '1.0'
|
146
|
+
- - "<"
|
147
|
+
- !ruby/object:Gem::Version
|
148
|
+
version: '2'
|
134
149
|
type: :runtime
|
135
150
|
prerelease: false
|
136
151
|
version_requirements: !ruby/object:Gem::Requirement
|
137
152
|
requirements:
|
138
153
|
- - "~>"
|
139
154
|
- !ruby/object:Gem::Version
|
140
|
-
version: 1.0
|
155
|
+
version: '1.0'
|
156
|
+
- - "<"
|
157
|
+
- !ruby/object:Gem::Version
|
158
|
+
version: '2'
|
141
159
|
- !ruby/object:Gem::Dependency
|
142
160
|
name: hanami-cli
|
143
161
|
requirement: !ruby/object:Gem::Requirement
|
144
162
|
requirements:
|
145
163
|
- - "~>"
|
146
164
|
- !ruby/object:Gem::Version
|
147
|
-
version: 2.0
|
165
|
+
version: '2.0'
|
148
166
|
type: :runtime
|
149
167
|
prerelease: false
|
150
168
|
version_requirements: !ruby/object:Gem::Requirement
|
151
169
|
requirements:
|
152
170
|
- - "~>"
|
153
171
|
- !ruby/object:Gem::Version
|
154
|
-
version: 2.0
|
172
|
+
version: '2.0'
|
155
173
|
- !ruby/object:Gem::Dependency
|
156
174
|
name: hanami-utils
|
157
175
|
requirement: !ruby/object:Gem::Requirement
|
158
176
|
requirements:
|
159
177
|
- - "~>"
|
160
178
|
- !ruby/object:Gem::Version
|
161
|
-
version: 2.0
|
179
|
+
version: '2.0'
|
162
180
|
type: :runtime
|
163
181
|
prerelease: false
|
164
182
|
version_requirements: !ruby/object:Gem::Requirement
|
165
183
|
requirements:
|
166
184
|
- - "~>"
|
167
185
|
- !ruby/object:Gem::Version
|
168
|
-
version: 2.0
|
186
|
+
version: '2.0'
|
169
187
|
- !ruby/object:Gem::Dependency
|
170
188
|
name: zeitwerk
|
171
189
|
requirement: !ruby/object:Gem::Requirement
|
@@ -281,6 +299,7 @@ files:
|
|
281
299
|
- lib/hanami/web/rack_logger.rb
|
282
300
|
- spec/integration/action/cookies_spec.rb
|
283
301
|
- spec/integration/action/csrf_protection_spec.rb
|
302
|
+
- spec/integration/action/format_config_spec.rb
|
284
303
|
- spec/integration/action/routes_spec.rb
|
285
304
|
- spec/integration/action/sessions_spec.rb
|
286
305
|
- spec/integration/action/slice_configuration_spec.rb
|
@@ -381,17 +400,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
381
400
|
version: '3.0'
|
382
401
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
383
402
|
requirements:
|
384
|
-
- - "
|
403
|
+
- - ">="
|
385
404
|
- !ruby/object:Gem::Version
|
386
|
-
version:
|
405
|
+
version: '0'
|
387
406
|
requirements: []
|
388
|
-
rubygems_version: 3.3.
|
407
|
+
rubygems_version: 3.3.7
|
389
408
|
signing_key:
|
390
409
|
specification_version: 4
|
391
410
|
summary: The web, with simplicity
|
392
411
|
test_files:
|
393
412
|
- spec/integration/action/cookies_spec.rb
|
394
413
|
- spec/integration/action/csrf_protection_spec.rb
|
414
|
+
- spec/integration/action/format_config_spec.rb
|
395
415
|
- spec/integration/action/routes_spec.rb
|
396
416
|
- spec/integration/action/sessions_spec.rb
|
397
417
|
- spec/integration/action/slice_configuration_spec.rb
|