hanami 2.0.0.beta1.1 → 2.0.0.beta3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +82 -0
- data/hanami.gemspec +1 -2
- data/lib/hanami/app.rb +76 -16
- data/lib/hanami/assets/{application_configuration.rb → app_configuration.rb} +1 -1
- data/lib/hanami/configuration/null_configuration.rb +2 -2
- data/lib/hanami/configuration.rb +36 -36
- data/lib/hanami/extensions/action/slice_configured_action.rb +44 -1
- data/lib/hanami/extensions/view/slice_configured_view.rb +47 -7
- data/lib/hanami/providers/rack.rb +2 -0
- data/lib/hanami/providers/settings.rb +81 -6
- data/lib/hanami/routes.rb +48 -21
- data/lib/hanami/settings/env_store.rb +32 -0
- data/lib/hanami/settings.rb +8 -12
- data/lib/hanami/setup.rb +1 -6
- data/lib/hanami/slice/routing/middleware/stack.rb +26 -5
- data/lib/hanami/slice.rb +38 -45
- data/lib/hanami/slice_configurable.rb +14 -1
- data/lib/hanami/slice_registrar.rb +65 -5
- data/lib/hanami/version.rb +1 -1
- data/lib/hanami.rb +53 -2
- data/spec/{new_integration → integration}/action/cookies_spec.rb +0 -0
- data/spec/{new_integration → integration}/action/csrf_protection_spec.rb +0 -0
- data/spec/{new_integration → integration}/action/routes_spec.rb +3 -5
- data/spec/{new_integration → integration}/action/sessions_spec.rb +0 -0
- data/spec/integration/action/slice_configuration_spec.rb +287 -0
- data/spec/{new_integration → integration}/action/view_integration_spec.rb +0 -0
- data/spec/{new_integration → integration}/action/view_rendering/automatic_rendering_spec.rb +0 -0
- data/spec/{new_integration → integration}/action/view_rendering/paired_view_inference_spec.rb +0 -0
- data/spec/{new_integration → integration}/action/view_rendering_spec.rb +0 -0
- data/spec/{new_integration → integration}/code_loading/loading_from_app_spec.rb +0 -0
- data/spec/integration/code_loading/loading_from_lib_spec.rb +208 -0
- data/spec/{new_integration → integration}/code_loading/loading_from_slice_spec.rb +0 -0
- data/spec/{new_integration → integration}/container/application_routes_helper_spec.rb +1 -3
- data/spec/{new_integration → integration}/container/auto_injection_spec.rb +0 -0
- data/spec/{new_integration → integration}/container/auto_registration_spec.rb +0 -0
- data/spec/{new_integration → integration}/container/autoloader_spec.rb +0 -0
- data/spec/{new_integration → integration}/container/imports_spec.rb +0 -0
- data/spec/{new_integration → integration}/container/prepare_container_spec.rb +0 -0
- data/spec/{new_integration → integration}/container/shutdown_spec.rb +0 -0
- data/spec/{new_integration → integration}/container/standard_bootable_components_spec.rb +0 -0
- data/spec/integration/dotenv_loading_spec.rb +137 -0
- data/spec/{new_integration → integration}/rack_app/middleware_spec.rb +9 -15
- data/spec/{new_integration → integration}/rack_app/non_booted_rack_app_spec.rb +3 -5
- data/spec/{new_integration → integration}/rack_app/rack_app_spec.rb +28 -48
- data/spec/integration/settings/access_to_constants_spec.rb +169 -0
- data/spec/integration/settings/loading_from_env_spec.rb +187 -0
- data/spec/integration/settings/settings_component_loading_spec.rb +113 -0
- data/spec/integration/settings/using_types_spec.rb +87 -0
- data/spec/integration/setup_spec.rb +165 -0
- data/spec/{new_integration → integration}/slices/external_slice_spec.rb +2 -4
- data/spec/{new_integration → integration}/slices/slice_configuration_spec.rb +0 -0
- data/spec/integration/slices/slice_loading_spec.rb +171 -0
- data/spec/{new_integration → integration}/slices/slice_routing_spec.rb +5 -13
- data/spec/{new_integration → integration}/slices/slice_settings_spec.rb +0 -0
- data/spec/{new_integration → integration}/slices_spec.rb +0 -0
- data/spec/{new_integration → integration}/view/context/assets_spec.rb +0 -0
- data/spec/{new_integration → integration}/view/context/inflector_spec.rb +0 -0
- data/spec/{new_integration → integration}/view/context/request_spec.rb +0 -0
- data/spec/{new_integration → integration}/view/context/routes_spec.rb +1 -3
- data/spec/{new_integration → integration}/view/context/settings_spec.rb +5 -1
- data/spec/{new_integration → integration}/view/inflector_spec.rb +0 -0
- data/spec/{new_integration → integration}/view/part_namespace_spec.rb +0 -0
- data/spec/{new_integration → integration}/view/path_spec.rb +0 -0
- data/spec/integration/view/slice_configuration_spec.rb +289 -0
- data/spec/{new_integration → integration}/view/template_spec.rb +0 -0
- data/spec/{new_integration → integration}/view/views_spec.rb +0 -0
- data/spec/support/app_integration.rb +4 -5
- data/spec/unit/hanami/configuration/actions_spec.rb +4 -15
- data/spec/unit/hanami/configuration/router_spec.rb +45 -0
- data/spec/unit/hanami/configuration/slices_spec.rb +34 -0
- data/spec/unit/hanami/configuration/views_spec.rb +4 -15
- data/spec/unit/hanami/settings/env_store_spec.rb +52 -0
- data/spec/unit/hanami/slice_configurable_spec.rb +2 -2
- data/spec/unit/hanami/version_spec.rb +1 -1
- metadata +105 -250
- data/lib/hanami/server.rb +0 -29
- data/lib/hanami/settings/dotenv_store.rb +0 -58
- data/spec/integration/application_middleware_stack_spec.rb +0 -84
- data/spec/integration/assets/cdn_spec.rb +0 -48
- data/spec/integration/assets/fingerprint_spec.rb +0 -42
- data/spec/integration/assets/helpers_spec.rb +0 -50
- data/spec/integration/assets/serve_spec.rb +0 -70
- data/spec/integration/assets/subresource_integrity_spec.rb +0 -54
- data/spec/integration/body_parsers_spec.rb +0 -50
- data/spec/integration/cli/assets/precompile_spec.rb +0 -147
- data/spec/integration/cli/assets_spec.rb +0 -14
- data/spec/integration/cli/console_spec.rb +0 -105
- data/spec/integration/cli/db/apply_spec.rb +0 -74
- data/spec/integration/cli/db/console_spec.rb +0 -40
- data/spec/integration/cli/db/create_spec.rb +0 -50
- data/spec/integration/cli/db/drop_spec.rb +0 -54
- data/spec/integration/cli/db/migrate_spec.rb +0 -108
- data/spec/integration/cli/db/prepare_spec.rb +0 -36
- data/spec/integration/cli/db/rollback_spec.rb +0 -96
- data/spec/integration/cli/db/version_spec.rb +0 -38
- data/spec/integration/cli/db_spec.rb +0 -21
- data/spec/integration/cli/destroy/action_spec.rb +0 -143
- data/spec/integration/cli/destroy/app_spec.rb +0 -118
- data/spec/integration/cli/destroy/mailer_spec.rb +0 -74
- data/spec/integration/cli/destroy/migration_spec.rb +0 -70
- data/spec/integration/cli/destroy/model_spec.rb +0 -113
- data/spec/integration/cli/destroy_spec.rb +0 -18
- data/spec/integration/cli/generate/action_spec.rb +0 -469
- data/spec/integration/cli/generate/app_spec.rb +0 -215
- data/spec/integration/cli/generate/mailer_spec.rb +0 -189
- data/spec/integration/cli/generate/migration_spec.rb +0 -72
- data/spec/integration/cli/generate/model_spec.rb +0 -290
- data/spec/integration/cli/generate/secret_spec.rb +0 -56
- data/spec/integration/cli/generate_spec.rb +0 -19
- data/spec/integration/cli/new/database_spec.rb +0 -235
- data/spec/integration/cli/new/hanami_head_spec.rb +0 -27
- data/spec/integration/cli/new/template_spec.rb +0 -118
- data/spec/integration/cli/new/test_spec.rb +0 -274
- data/spec/integration/cli/new_spec.rb +0 -970
- data/spec/integration/cli/plugins_spec.rb +0 -39
- data/spec/integration/cli/routes_spec.rb +0 -49
- data/spec/integration/cli/server_spec.rb +0 -626
- data/spec/integration/cli/version_spec.rb +0 -85
- data/spec/integration/early_hints_spec.rb +0 -35
- data/spec/integration/handle_exceptions_spec.rb +0 -244
- data/spec/integration/head_spec.rb +0 -89
- data/spec/integration/http_headers_spec.rb +0 -29
- data/spec/integration/mailer_spec.rb +0 -32
- data/spec/integration/middleware_spec.rb +0 -81
- data/spec/integration/mount_applications_spec.rb +0 -88
- data/spec/integration/project_initializers_spec.rb +0 -40
- data/spec/integration/rackup_spec.rb +0 -35
- data/spec/integration/rake/with_minitest_spec.rb +0 -67
- data/spec/integration/rake/with_rspec_spec.rb +0 -69
- data/spec/integration/routing_helpers_spec.rb +0 -61
- data/spec/integration/security/content_security_policy_spec.rb +0 -46
- data/spec/integration/security/csrf_protection_spec.rb +0 -42
- data/spec/integration/security/force_ssl_spec.rb +0 -29
- data/spec/integration/security/x_content_type_options_spec.rb +0 -46
- data/spec/integration/security/x_frame_options_spec.rb +0 -46
- data/spec/integration/security/x_xss_protection_spec.rb +0 -46
- data/spec/integration/send_file_spec.rb +0 -51
- data/spec/integration/sessions_spec.rb +0 -247
- data/spec/integration/static_middleware_spec.rb +0 -21
- data/spec/integration/streaming_spec.rb +0 -41
- data/spec/integration/unsafe_send_file_spec.rb +0 -52
- data/spec/new_integration/action/configuration_spec.rb +0 -26
- data/spec/new_integration/settings_spec.rb +0 -115
- data/spec/new_integration/view/configuration_spec.rb +0 -49
- data/spec/support/fixtures/hanami-plugin/Gemfile +0 -8
- data/spec/support/fixtures/hanami-plugin/README.md +0 -35
- data/spec/support/fixtures/hanami-plugin/Rakefile +0 -4
- data/spec/support/fixtures/hanami-plugin/bin/console +0 -15
- data/spec/support/fixtures/hanami-plugin/bin/setup +0 -8
- data/spec/support/fixtures/hanami-plugin/hanami-plugin.gemspec +0 -28
- data/spec/support/fixtures/hanami-plugin/lib/hanami/plugin/cli.rb +0 -19
- data/spec/support/fixtures/hanami-plugin/lib/hanami/plugin/version.rb +0 -7
- data/spec/support/fixtures/hanami-plugin/lib/hanami/plugin.rb +0 -8
- data/spec/unit/hanami/routes_spec.rb +0 -25
- data/spec/unit/hanami/settings/dotenv_store_spec.rb +0 -119
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.beta3
|
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-09-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -58,20 +58,6 @@ dependencies:
|
|
58
58
|
- - "~>"
|
59
59
|
- !ruby/object:Gem::Version
|
60
60
|
version: '0.7'
|
61
|
-
- !ruby/object:Gem::Dependency
|
62
|
-
name: dry-types
|
63
|
-
requirement: !ruby/object:Gem::Requirement
|
64
|
-
requirements:
|
65
|
-
- - "~>"
|
66
|
-
- !ruby/object:Gem::Version
|
67
|
-
version: '1.5'
|
68
|
-
type: :runtime
|
69
|
-
prerelease: false
|
70
|
-
version_requirements: !ruby/object:Gem::Requirement
|
71
|
-
requirements:
|
72
|
-
- - "~>"
|
73
|
-
- !ruby/object:Gem::Version
|
74
|
-
version: '1.5'
|
75
61
|
- !ruby/object:Gem::Dependency
|
76
62
|
name: dry-inflector
|
77
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -121,7 +107,7 @@ dependencies:
|
|
121
107
|
version: '0.6'
|
122
108
|
- - ">="
|
123
109
|
- !ruby/object:Gem::Version
|
124
|
-
version: 0.6.
|
110
|
+
version: 0.6.3
|
125
111
|
type: :runtime
|
126
112
|
prerelease: false
|
127
113
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -131,7 +117,7 @@ dependencies:
|
|
131
117
|
version: '0.6'
|
132
118
|
- - ">="
|
133
119
|
- !ruby/object:Gem::Version
|
134
|
-
version: 0.6.
|
120
|
+
version: 0.6.3
|
135
121
|
- !ruby/object:Gem::Dependency
|
136
122
|
name: hanami-cli
|
137
123
|
requirement: !ruby/object:Gem::Requirement
|
@@ -231,7 +217,7 @@ files:
|
|
231
217
|
- hanami.gemspec
|
232
218
|
- lib/hanami.rb
|
233
219
|
- lib/hanami/app.rb
|
234
|
-
- lib/hanami/assets/
|
220
|
+
- lib/hanami/assets/app_configuration.rb
|
235
221
|
- lib/hanami/assets/configuration.rb
|
236
222
|
- lib/hanami/boot.rb
|
237
223
|
- lib/hanami/configuration.rb
|
@@ -261,9 +247,8 @@ files:
|
|
261
247
|
- lib/hanami/providers/settings.rb
|
262
248
|
- lib/hanami/rake_tasks.rb
|
263
249
|
- lib/hanami/routes.rb
|
264
|
-
- lib/hanami/server.rb
|
265
250
|
- lib/hanami/settings.rb
|
266
|
-
- lib/hanami/settings/
|
251
|
+
- lib/hanami/settings/env_store.rb
|
267
252
|
- lib/hanami/setup.rb
|
268
253
|
- lib/hanami/slice.rb
|
269
254
|
- lib/hanami/slice/router.rb
|
@@ -276,70 +261,52 @@ files:
|
|
276
261
|
- lib/hanami/slice_registrar.rb
|
277
262
|
- lib/hanami/version.rb
|
278
263
|
- lib/hanami/web/rack_logger.rb
|
279
|
-
- spec/integration/
|
280
|
-
- spec/integration/
|
281
|
-
- spec/integration/
|
282
|
-
- spec/integration/
|
283
|
-
- spec/integration/
|
284
|
-
- spec/integration/
|
285
|
-
- spec/integration/
|
286
|
-
- spec/integration/
|
287
|
-
- spec/integration/
|
288
|
-
- spec/integration/
|
289
|
-
- spec/integration/
|
290
|
-
- spec/integration/
|
291
|
-
- spec/integration/
|
292
|
-
- spec/integration/
|
293
|
-
- spec/integration/
|
294
|
-
- spec/integration/
|
295
|
-
- spec/integration/
|
296
|
-
- spec/integration/
|
297
|
-
- spec/integration/
|
298
|
-
- spec/integration/
|
299
|
-
- spec/integration/
|
300
|
-
- spec/integration/
|
301
|
-
- spec/integration/
|
302
|
-
- spec/integration/
|
303
|
-
- spec/integration/
|
304
|
-
- spec/integration/
|
305
|
-
- spec/integration/
|
306
|
-
- spec/integration/
|
307
|
-
- spec/integration/
|
308
|
-
- spec/integration/
|
309
|
-
- spec/integration/
|
310
|
-
- spec/integration/
|
311
|
-
- spec/integration/
|
312
|
-
- spec/integration/
|
313
|
-
- spec/integration/
|
314
|
-
- spec/integration/
|
315
|
-
- spec/integration/
|
316
|
-
- spec/integration/
|
317
|
-
- spec/integration/
|
318
|
-
- spec/integration/
|
319
|
-
- spec/integration/
|
320
|
-
- spec/integration/
|
321
|
-
- spec/integration/
|
322
|
-
- spec/integration/
|
323
|
-
- spec/integration/
|
324
|
-
- spec/integration/
|
325
|
-
- spec/integration/middleware_spec.rb
|
326
|
-
- spec/integration/mount_applications_spec.rb
|
327
|
-
- spec/integration/project_initializers_spec.rb
|
328
|
-
- spec/integration/rackup_spec.rb
|
329
|
-
- spec/integration/rake/with_minitest_spec.rb
|
330
|
-
- spec/integration/rake/with_rspec_spec.rb
|
331
|
-
- spec/integration/routing_helpers_spec.rb
|
332
|
-
- spec/integration/security/content_security_policy_spec.rb
|
333
|
-
- spec/integration/security/csrf_protection_spec.rb
|
334
|
-
- spec/integration/security/force_ssl_spec.rb
|
335
|
-
- spec/integration/security/x_content_type_options_spec.rb
|
336
|
-
- spec/integration/security/x_frame_options_spec.rb
|
337
|
-
- spec/integration/security/x_xss_protection_spec.rb
|
338
|
-
- spec/integration/send_file_spec.rb
|
339
|
-
- spec/integration/sessions_spec.rb
|
340
|
-
- spec/integration/static_middleware_spec.rb
|
341
|
-
- spec/integration/streaming_spec.rb
|
342
|
-
- spec/integration/unsafe_send_file_spec.rb
|
264
|
+
- spec/integration/action/cookies_spec.rb
|
265
|
+
- spec/integration/action/csrf_protection_spec.rb
|
266
|
+
- spec/integration/action/routes_spec.rb
|
267
|
+
- spec/integration/action/sessions_spec.rb
|
268
|
+
- spec/integration/action/slice_configuration_spec.rb
|
269
|
+
- spec/integration/action/view_integration_spec.rb
|
270
|
+
- spec/integration/action/view_rendering/automatic_rendering_spec.rb
|
271
|
+
- spec/integration/action/view_rendering/paired_view_inference_spec.rb
|
272
|
+
- spec/integration/action/view_rendering_spec.rb
|
273
|
+
- spec/integration/code_loading/loading_from_app_spec.rb
|
274
|
+
- spec/integration/code_loading/loading_from_lib_spec.rb
|
275
|
+
- spec/integration/code_loading/loading_from_slice_spec.rb
|
276
|
+
- spec/integration/container/application_routes_helper_spec.rb
|
277
|
+
- spec/integration/container/auto_injection_spec.rb
|
278
|
+
- spec/integration/container/auto_registration_spec.rb
|
279
|
+
- spec/integration/container/autoloader_spec.rb
|
280
|
+
- spec/integration/container/imports_spec.rb
|
281
|
+
- spec/integration/container/prepare_container_spec.rb
|
282
|
+
- spec/integration/container/shutdown_spec.rb
|
283
|
+
- spec/integration/container/standard_bootable_components_spec.rb
|
284
|
+
- spec/integration/dotenv_loading_spec.rb
|
285
|
+
- spec/integration/rack_app/middleware_spec.rb
|
286
|
+
- spec/integration/rack_app/non_booted_rack_app_spec.rb
|
287
|
+
- spec/integration/rack_app/rack_app_spec.rb
|
288
|
+
- spec/integration/settings/access_to_constants_spec.rb
|
289
|
+
- spec/integration/settings/loading_from_env_spec.rb
|
290
|
+
- spec/integration/settings/settings_component_loading_spec.rb
|
291
|
+
- spec/integration/settings/using_types_spec.rb
|
292
|
+
- spec/integration/setup_spec.rb
|
293
|
+
- spec/integration/slices/external_slice_spec.rb
|
294
|
+
- spec/integration/slices/slice_configuration_spec.rb
|
295
|
+
- spec/integration/slices/slice_loading_spec.rb
|
296
|
+
- spec/integration/slices/slice_routing_spec.rb
|
297
|
+
- spec/integration/slices/slice_settings_spec.rb
|
298
|
+
- spec/integration/slices_spec.rb
|
299
|
+
- spec/integration/view/context/assets_spec.rb
|
300
|
+
- spec/integration/view/context/inflector_spec.rb
|
301
|
+
- spec/integration/view/context/request_spec.rb
|
302
|
+
- spec/integration/view/context/routes_spec.rb
|
303
|
+
- spec/integration/view/context/settings_spec.rb
|
304
|
+
- spec/integration/view/inflector_spec.rb
|
305
|
+
- spec/integration/view/part_namespace_spec.rb
|
306
|
+
- spec/integration/view/path_spec.rb
|
307
|
+
- spec/integration/view/slice_configuration_spec.rb
|
308
|
+
- spec/integration/view/template_spec.rb
|
309
|
+
- spec/integration/view/views_spec.rb
|
343
310
|
- spec/isolation/hanami/application/already_configured_spec.rb
|
344
311
|
- spec/isolation/hanami/application/inherit_anonymous_class_spec.rb
|
345
312
|
- spec/isolation/hanami/application/inherit_concrete_class_spec.rb
|
@@ -347,57 +314,9 @@ files:
|
|
347
314
|
- spec/isolation/hanami/application/routes/configured_spec.rb
|
348
315
|
- spec/isolation/hanami/application/routes/not_configured_spec.rb
|
349
316
|
- spec/isolation/hanami/boot/success_spec.rb
|
350
|
-
- spec/new_integration/action/configuration_spec.rb
|
351
|
-
- spec/new_integration/action/cookies_spec.rb
|
352
|
-
- spec/new_integration/action/csrf_protection_spec.rb
|
353
|
-
- spec/new_integration/action/routes_spec.rb
|
354
|
-
- spec/new_integration/action/sessions_spec.rb
|
355
|
-
- spec/new_integration/action/view_integration_spec.rb
|
356
|
-
- spec/new_integration/action/view_rendering/automatic_rendering_spec.rb
|
357
|
-
- spec/new_integration/action/view_rendering/paired_view_inference_spec.rb
|
358
|
-
- spec/new_integration/action/view_rendering_spec.rb
|
359
|
-
- spec/new_integration/code_loading/loading_from_app_spec.rb
|
360
|
-
- spec/new_integration/code_loading/loading_from_slice_spec.rb
|
361
|
-
- spec/new_integration/container/application_routes_helper_spec.rb
|
362
|
-
- spec/new_integration/container/auto_injection_spec.rb
|
363
|
-
- spec/new_integration/container/auto_registration_spec.rb
|
364
|
-
- spec/new_integration/container/autoloader_spec.rb
|
365
|
-
- spec/new_integration/container/imports_spec.rb
|
366
|
-
- spec/new_integration/container/prepare_container_spec.rb
|
367
|
-
- spec/new_integration/container/shutdown_spec.rb
|
368
|
-
- spec/new_integration/container/standard_bootable_components_spec.rb
|
369
|
-
- spec/new_integration/rack_app/middleware_spec.rb
|
370
|
-
- spec/new_integration/rack_app/non_booted_rack_app_spec.rb
|
371
|
-
- spec/new_integration/rack_app/rack_app_spec.rb
|
372
|
-
- spec/new_integration/settings_spec.rb
|
373
|
-
- spec/new_integration/slices/external_slice_spec.rb
|
374
|
-
- spec/new_integration/slices/slice_configuration_spec.rb
|
375
|
-
- spec/new_integration/slices/slice_routing_spec.rb
|
376
|
-
- spec/new_integration/slices/slice_settings_spec.rb
|
377
|
-
- spec/new_integration/slices_spec.rb
|
378
|
-
- spec/new_integration/view/configuration_spec.rb
|
379
|
-
- spec/new_integration/view/context/assets_spec.rb
|
380
|
-
- spec/new_integration/view/context/inflector_spec.rb
|
381
|
-
- spec/new_integration/view/context/request_spec.rb
|
382
|
-
- spec/new_integration/view/context/routes_spec.rb
|
383
|
-
- spec/new_integration/view/context/settings_spec.rb
|
384
|
-
- spec/new_integration/view/inflector_spec.rb
|
385
|
-
- spec/new_integration/view/part_namespace_spec.rb
|
386
|
-
- spec/new_integration/view/path_spec.rb
|
387
|
-
- spec/new_integration/view/template_spec.rb
|
388
|
-
- spec/new_integration/view/views_spec.rb
|
389
317
|
- spec/spec_helper.rb
|
390
318
|
- spec/support/app_integration.rb
|
391
319
|
- spec/support/coverage.rb
|
392
|
-
- spec/support/fixtures/hanami-plugin/Gemfile
|
393
|
-
- spec/support/fixtures/hanami-plugin/README.md
|
394
|
-
- spec/support/fixtures/hanami-plugin/Rakefile
|
395
|
-
- spec/support/fixtures/hanami-plugin/bin/console
|
396
|
-
- spec/support/fixtures/hanami-plugin/bin/setup
|
397
|
-
- spec/support/fixtures/hanami-plugin/hanami-plugin.gemspec
|
398
|
-
- spec/support/fixtures/hanami-plugin/lib/hanami/plugin.rb
|
399
|
-
- spec/support/fixtures/hanami-plugin/lib/hanami/plugin/cli.rb
|
400
|
-
- spec/support/fixtures/hanami-plugin/lib/hanami/plugin/version.rb
|
401
320
|
- spec/support/rspec.rb
|
402
321
|
- spec/support/shared_examples/cli/generate/app.rb
|
403
322
|
- spec/support/shared_examples/cli/generate/migration.rb
|
@@ -412,11 +331,12 @@ files:
|
|
412
331
|
- spec/unit/hanami/configuration/base_url_spec.rb
|
413
332
|
- spec/unit/hanami/configuration/inflector_spec.rb
|
414
333
|
- spec/unit/hanami/configuration/logger_spec.rb
|
334
|
+
- spec/unit/hanami/configuration/router_spec.rb
|
335
|
+
- spec/unit/hanami/configuration/slices_spec.rb
|
415
336
|
- spec/unit/hanami/configuration/views_spec.rb
|
416
337
|
- spec/unit/hanami/configuration_spec.rb
|
417
338
|
- spec/unit/hanami/env_spec.rb
|
418
|
-
- spec/unit/hanami/
|
419
|
-
- spec/unit/hanami/settings/dotenv_store_spec.rb
|
339
|
+
- spec/unit/hanami/settings/env_store_spec.rb
|
420
340
|
- spec/unit/hanami/settings_spec.rb
|
421
341
|
- spec/unit/hanami/slice_configurable_spec.rb
|
422
342
|
- spec/unit/hanami/slice_name_spec.rb
|
@@ -444,75 +364,57 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
444
364
|
- !ruby/object:Gem::Version
|
445
365
|
version: 1.3.1
|
446
366
|
requirements: []
|
447
|
-
rubygems_version: 3.3.
|
367
|
+
rubygems_version: 3.3.3
|
448
368
|
signing_key:
|
449
369
|
specification_version: 4
|
450
370
|
summary: The web, with simplicity
|
451
371
|
test_files:
|
452
|
-
- spec/integration/
|
453
|
-
- spec/integration/
|
454
|
-
- spec/integration/
|
455
|
-
- spec/integration/
|
456
|
-
- spec/integration/
|
457
|
-
- spec/integration/
|
458
|
-
- spec/integration/
|
459
|
-
- spec/integration/
|
460
|
-
- spec/integration/
|
461
|
-
- spec/integration/
|
462
|
-
- spec/integration/
|
463
|
-
- spec/integration/
|
464
|
-
- spec/integration/
|
465
|
-
- spec/integration/
|
466
|
-
- spec/integration/
|
467
|
-
- spec/integration/
|
468
|
-
- spec/integration/
|
469
|
-
- spec/integration/
|
470
|
-
- spec/integration/
|
471
|
-
- spec/integration/
|
472
|
-
- spec/integration/
|
473
|
-
- spec/integration/
|
474
|
-
- spec/integration/
|
475
|
-
- spec/integration/
|
476
|
-
- spec/integration/
|
477
|
-
- spec/integration/
|
478
|
-
- spec/integration/
|
479
|
-
- spec/integration/
|
480
|
-
- spec/integration/
|
481
|
-
- spec/integration/
|
482
|
-
- spec/integration/
|
483
|
-
- spec/integration/
|
484
|
-
- spec/integration/
|
485
|
-
- spec/integration/
|
486
|
-
- spec/integration/
|
487
|
-
- spec/integration/
|
488
|
-
- spec/integration/
|
489
|
-
- spec/integration/
|
490
|
-
- spec/integration/
|
491
|
-
- spec/integration/
|
492
|
-
- spec/integration/
|
493
|
-
- spec/integration/
|
494
|
-
- spec/integration/
|
495
|
-
- spec/integration/
|
496
|
-
- spec/integration/
|
497
|
-
- spec/integration/
|
498
|
-
- spec/integration/middleware_spec.rb
|
499
|
-
- spec/integration/mount_applications_spec.rb
|
500
|
-
- spec/integration/project_initializers_spec.rb
|
501
|
-
- spec/integration/rackup_spec.rb
|
502
|
-
- spec/integration/rake/with_minitest_spec.rb
|
503
|
-
- spec/integration/rake/with_rspec_spec.rb
|
504
|
-
- spec/integration/routing_helpers_spec.rb
|
505
|
-
- spec/integration/security/content_security_policy_spec.rb
|
506
|
-
- spec/integration/security/csrf_protection_spec.rb
|
507
|
-
- spec/integration/security/force_ssl_spec.rb
|
508
|
-
- spec/integration/security/x_content_type_options_spec.rb
|
509
|
-
- spec/integration/security/x_frame_options_spec.rb
|
510
|
-
- spec/integration/security/x_xss_protection_spec.rb
|
511
|
-
- spec/integration/send_file_spec.rb
|
512
|
-
- spec/integration/sessions_spec.rb
|
513
|
-
- spec/integration/static_middleware_spec.rb
|
514
|
-
- spec/integration/streaming_spec.rb
|
515
|
-
- spec/integration/unsafe_send_file_spec.rb
|
372
|
+
- spec/integration/action/cookies_spec.rb
|
373
|
+
- spec/integration/action/csrf_protection_spec.rb
|
374
|
+
- spec/integration/action/routes_spec.rb
|
375
|
+
- spec/integration/action/sessions_spec.rb
|
376
|
+
- spec/integration/action/slice_configuration_spec.rb
|
377
|
+
- spec/integration/action/view_integration_spec.rb
|
378
|
+
- spec/integration/action/view_rendering/automatic_rendering_spec.rb
|
379
|
+
- spec/integration/action/view_rendering/paired_view_inference_spec.rb
|
380
|
+
- spec/integration/action/view_rendering_spec.rb
|
381
|
+
- spec/integration/code_loading/loading_from_app_spec.rb
|
382
|
+
- spec/integration/code_loading/loading_from_lib_spec.rb
|
383
|
+
- spec/integration/code_loading/loading_from_slice_spec.rb
|
384
|
+
- spec/integration/container/application_routes_helper_spec.rb
|
385
|
+
- spec/integration/container/auto_injection_spec.rb
|
386
|
+
- spec/integration/container/auto_registration_spec.rb
|
387
|
+
- spec/integration/container/autoloader_spec.rb
|
388
|
+
- spec/integration/container/imports_spec.rb
|
389
|
+
- spec/integration/container/prepare_container_spec.rb
|
390
|
+
- spec/integration/container/shutdown_spec.rb
|
391
|
+
- spec/integration/container/standard_bootable_components_spec.rb
|
392
|
+
- spec/integration/dotenv_loading_spec.rb
|
393
|
+
- spec/integration/rack_app/middleware_spec.rb
|
394
|
+
- spec/integration/rack_app/non_booted_rack_app_spec.rb
|
395
|
+
- spec/integration/rack_app/rack_app_spec.rb
|
396
|
+
- spec/integration/settings/access_to_constants_spec.rb
|
397
|
+
- spec/integration/settings/loading_from_env_spec.rb
|
398
|
+
- spec/integration/settings/settings_component_loading_spec.rb
|
399
|
+
- spec/integration/settings/using_types_spec.rb
|
400
|
+
- spec/integration/setup_spec.rb
|
401
|
+
- spec/integration/slices/external_slice_spec.rb
|
402
|
+
- spec/integration/slices/slice_configuration_spec.rb
|
403
|
+
- spec/integration/slices/slice_loading_spec.rb
|
404
|
+
- spec/integration/slices/slice_routing_spec.rb
|
405
|
+
- spec/integration/slices/slice_settings_spec.rb
|
406
|
+
- spec/integration/slices_spec.rb
|
407
|
+
- spec/integration/view/context/assets_spec.rb
|
408
|
+
- spec/integration/view/context/inflector_spec.rb
|
409
|
+
- spec/integration/view/context/request_spec.rb
|
410
|
+
- spec/integration/view/context/routes_spec.rb
|
411
|
+
- spec/integration/view/context/settings_spec.rb
|
412
|
+
- spec/integration/view/inflector_spec.rb
|
413
|
+
- spec/integration/view/part_namespace_spec.rb
|
414
|
+
- spec/integration/view/path_spec.rb
|
415
|
+
- spec/integration/view/slice_configuration_spec.rb
|
416
|
+
- spec/integration/view/template_spec.rb
|
417
|
+
- spec/integration/view/views_spec.rb
|
516
418
|
- spec/isolation/hanami/application/already_configured_spec.rb
|
517
419
|
- spec/isolation/hanami/application/inherit_anonymous_class_spec.rb
|
518
420
|
- spec/isolation/hanami/application/inherit_concrete_class_spec.rb
|
@@ -520,57 +422,9 @@ test_files:
|
|
520
422
|
- spec/isolation/hanami/application/routes/configured_spec.rb
|
521
423
|
- spec/isolation/hanami/application/routes/not_configured_spec.rb
|
522
424
|
- spec/isolation/hanami/boot/success_spec.rb
|
523
|
-
- spec/new_integration/action/configuration_spec.rb
|
524
|
-
- spec/new_integration/action/cookies_spec.rb
|
525
|
-
- spec/new_integration/action/csrf_protection_spec.rb
|
526
|
-
- spec/new_integration/action/routes_spec.rb
|
527
|
-
- spec/new_integration/action/sessions_spec.rb
|
528
|
-
- spec/new_integration/action/view_integration_spec.rb
|
529
|
-
- spec/new_integration/action/view_rendering/automatic_rendering_spec.rb
|
530
|
-
- spec/new_integration/action/view_rendering/paired_view_inference_spec.rb
|
531
|
-
- spec/new_integration/action/view_rendering_spec.rb
|
532
|
-
- spec/new_integration/code_loading/loading_from_app_spec.rb
|
533
|
-
- spec/new_integration/code_loading/loading_from_slice_spec.rb
|
534
|
-
- spec/new_integration/container/application_routes_helper_spec.rb
|
535
|
-
- spec/new_integration/container/auto_injection_spec.rb
|
536
|
-
- spec/new_integration/container/auto_registration_spec.rb
|
537
|
-
- spec/new_integration/container/autoloader_spec.rb
|
538
|
-
- spec/new_integration/container/imports_spec.rb
|
539
|
-
- spec/new_integration/container/prepare_container_spec.rb
|
540
|
-
- spec/new_integration/container/shutdown_spec.rb
|
541
|
-
- spec/new_integration/container/standard_bootable_components_spec.rb
|
542
|
-
- spec/new_integration/rack_app/middleware_spec.rb
|
543
|
-
- spec/new_integration/rack_app/non_booted_rack_app_spec.rb
|
544
|
-
- spec/new_integration/rack_app/rack_app_spec.rb
|
545
|
-
- spec/new_integration/settings_spec.rb
|
546
|
-
- spec/new_integration/slices/external_slice_spec.rb
|
547
|
-
- spec/new_integration/slices/slice_configuration_spec.rb
|
548
|
-
- spec/new_integration/slices/slice_routing_spec.rb
|
549
|
-
- spec/new_integration/slices/slice_settings_spec.rb
|
550
|
-
- spec/new_integration/slices_spec.rb
|
551
|
-
- spec/new_integration/view/configuration_spec.rb
|
552
|
-
- spec/new_integration/view/context/assets_spec.rb
|
553
|
-
- spec/new_integration/view/context/inflector_spec.rb
|
554
|
-
- spec/new_integration/view/context/request_spec.rb
|
555
|
-
- spec/new_integration/view/context/routes_spec.rb
|
556
|
-
- spec/new_integration/view/context/settings_spec.rb
|
557
|
-
- spec/new_integration/view/inflector_spec.rb
|
558
|
-
- spec/new_integration/view/part_namespace_spec.rb
|
559
|
-
- spec/new_integration/view/path_spec.rb
|
560
|
-
- spec/new_integration/view/template_spec.rb
|
561
|
-
- spec/new_integration/view/views_spec.rb
|
562
425
|
- spec/spec_helper.rb
|
563
426
|
- spec/support/app_integration.rb
|
564
427
|
- spec/support/coverage.rb
|
565
|
-
- spec/support/fixtures/hanami-plugin/Gemfile
|
566
|
-
- spec/support/fixtures/hanami-plugin/README.md
|
567
|
-
- spec/support/fixtures/hanami-plugin/Rakefile
|
568
|
-
- spec/support/fixtures/hanami-plugin/bin/console
|
569
|
-
- spec/support/fixtures/hanami-plugin/bin/setup
|
570
|
-
- spec/support/fixtures/hanami-plugin/hanami-plugin.gemspec
|
571
|
-
- spec/support/fixtures/hanami-plugin/lib/hanami/plugin/cli.rb
|
572
|
-
- spec/support/fixtures/hanami-plugin/lib/hanami/plugin/version.rb
|
573
|
-
- spec/support/fixtures/hanami-plugin/lib/hanami/plugin.rb
|
574
428
|
- spec/support/rspec.rb
|
575
429
|
- spec/support/shared_examples/cli/generate/app.rb
|
576
430
|
- spec/support/shared_examples/cli/generate/migration.rb
|
@@ -585,11 +439,12 @@ test_files:
|
|
585
439
|
- spec/unit/hanami/configuration/base_url_spec.rb
|
586
440
|
- spec/unit/hanami/configuration/inflector_spec.rb
|
587
441
|
- spec/unit/hanami/configuration/logger_spec.rb
|
442
|
+
- spec/unit/hanami/configuration/router_spec.rb
|
443
|
+
- spec/unit/hanami/configuration/slices_spec.rb
|
588
444
|
- spec/unit/hanami/configuration/views_spec.rb
|
589
445
|
- spec/unit/hanami/configuration_spec.rb
|
590
446
|
- spec/unit/hanami/env_spec.rb
|
591
|
-
- spec/unit/hanami/
|
592
|
-
- spec/unit/hanami/settings/dotenv_store_spec.rb
|
447
|
+
- spec/unit/hanami/settings/env_store_spec.rb
|
593
448
|
- spec/unit/hanami/settings_spec.rb
|
594
449
|
- spec/unit/hanami/slice_configurable_spec.rb
|
595
450
|
- spec/unit/hanami/slice_name_spec.rb
|
data/lib/hanami/server.rb
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "hanami"
|
4
|
-
require "rack"
|
5
|
-
|
6
|
-
module Hanami
|
7
|
-
# Rack compatible server.
|
8
|
-
#
|
9
|
-
# It is run with:
|
10
|
-
#
|
11
|
-
# `bundle exec hanami server`
|
12
|
-
#
|
13
|
-
# It runs the app, by using the server specified in your `Gemfile`
|
14
|
-
# (eg. Puma or Unicorn).
|
15
|
-
#
|
16
|
-
# @since 0.8.0
|
17
|
-
# @api private
|
18
|
-
class Server < ::Rack::Server
|
19
|
-
# Primarily this removes the ::Rack::Chunked middleware
|
20
|
-
# which is the cause of Safari content-length bugs.
|
21
|
-
#
|
22
|
-
# @since 0.8.0
|
23
|
-
def middleware
|
24
|
-
mw = ::Hash.new { |e, m| e[m] = [] }
|
25
|
-
mw["development"].concat([::Rack::ShowExceptions, ::Rack::Lint])
|
26
|
-
mw
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
@@ -1,58 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "dry/core/constants"
|
4
|
-
|
5
|
-
module Hanami
|
6
|
-
class Settings
|
7
|
-
# Default app settings store.
|
8
|
-
#
|
9
|
-
# Uses [dotenv](https://github.com/bkeepers/dotenv) (if available) to load
|
10
|
-
# .env files and then loads settings from ENV. For a given `HANAMI_ENV`
|
11
|
-
# environment, the following `.env` files are looked up in the following order:
|
12
|
-
#
|
13
|
-
# - .env.{environment}.local
|
14
|
-
# - .env.local (except if the environment is `test`)
|
15
|
-
# - .env.{environment}
|
16
|
-
# - .env
|
17
|
-
#
|
18
|
-
# @since 2.0.0
|
19
|
-
# @api private
|
20
|
-
class DotenvStore
|
21
|
-
Undefined = Dry::Core::Constants::Undefined
|
22
|
-
|
23
|
-
attr_reader :store,
|
24
|
-
:hanami_env
|
25
|
-
|
26
|
-
def initialize(store: ENV, hanami_env: Hanami.env)
|
27
|
-
@store = store
|
28
|
-
@hanami_env = hanami_env
|
29
|
-
end
|
30
|
-
|
31
|
-
def fetch(name, default_value = Undefined, &block)
|
32
|
-
name = name.to_s.upcase
|
33
|
-
args = (default_value == Undefined) ? [name] : [name, default_value]
|
34
|
-
|
35
|
-
store.fetch(*args, &block)
|
36
|
-
end
|
37
|
-
|
38
|
-
def with_dotenv_loaded
|
39
|
-
require "dotenv"
|
40
|
-
Dotenv.load(*dotenv_files) if defined?(Dotenv)
|
41
|
-
self
|
42
|
-
rescue LoadError
|
43
|
-
self
|
44
|
-
end
|
45
|
-
|
46
|
-
private
|
47
|
-
|
48
|
-
def dotenv_files
|
49
|
-
[
|
50
|
-
".env.#{hanami_env}.local",
|
51
|
-
(".env.local" unless hanami_env == :test),
|
52
|
-
".env.#{hanami_env}",
|
53
|
-
".env"
|
54
|
-
].compact
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|
@@ -1,84 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
RSpec.describe "App middleware stack", type: :integration do
|
4
|
-
it "mounts Rack middleware" do
|
5
|
-
with_project do
|
6
|
-
generate "action web home#index --url=/"
|
7
|
-
generate_middleware
|
8
|
-
|
9
|
-
# Add apps/web/middleware to the load paths
|
10
|
-
replace "apps/web/app.rb", "load_paths << [", "load_paths << ['middleware',"
|
11
|
-
|
12
|
-
# Require Rack::ETag
|
13
|
-
unshift "apps/web/app.rb", "require 'rack/etag'"
|
14
|
-
|
15
|
-
# Mount middleware
|
16
|
-
replace "apps/web/app.rb", "# middleware.use", "middleware.use 'Web::Middleware::Runtime'\nmiddleware.use 'Web::Middleware::Custom', 'OK'\nmiddleware.use Rack::ETag"
|
17
|
-
|
18
|
-
rewrite "apps/web/controllers/home/index.rb", <<~EOF
|
19
|
-
module Web::Controllers::Home
|
20
|
-
class Index
|
21
|
-
include Web::Action
|
22
|
-
|
23
|
-
def call(params)
|
24
|
-
self.body = "OK"
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
EOF
|
29
|
-
|
30
|
-
server do
|
31
|
-
get "/"
|
32
|
-
|
33
|
-
expect(last_response.status).to eq(200)
|
34
|
-
|
35
|
-
expect(last_response.headers["X-Runtime"]).to eq("1ms")
|
36
|
-
expect(last_response.headers["X-Custom"]).to eq("OK")
|
37
|
-
expect(last_response.headers["ETag"]).to_not be_nil
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
private
|
43
|
-
|
44
|
-
def generate_middleware # rubocop:disable Metrics/MethodLength
|
45
|
-
write "apps/web/middleware/runtime.rb", <<~EOF
|
46
|
-
module Web
|
47
|
-
module Middleware
|
48
|
-
class Runtime
|
49
|
-
def initialize(app)
|
50
|
-
@app = app
|
51
|
-
end
|
52
|
-
|
53
|
-
def call(env)
|
54
|
-
status, headers, body = @app.call(env)
|
55
|
-
headers["X-Runtime"] = "1ms"
|
56
|
-
|
57
|
-
[status, headers, body]
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|
62
|
-
EOF
|
63
|
-
|
64
|
-
write "apps/web/middleware/custom.rb", <<~EOF
|
65
|
-
module Web
|
66
|
-
module Middleware
|
67
|
-
class Custom
|
68
|
-
def initialize(app, value)
|
69
|
-
@app = app
|
70
|
-
@value = value
|
71
|
-
end
|
72
|
-
|
73
|
-
def call(env)
|
74
|
-
status, headers, body = @app.call(env)
|
75
|
-
headers["X-Custom"] = @value
|
76
|
-
|
77
|
-
[status, headers, body]
|
78
|
-
end
|
79
|
-
end
|
80
|
-
end
|
81
|
-
end
|
82
|
-
EOF
|
83
|
-
end
|
84
|
-
end
|