hanami 2.1.1 → 2.2.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +19 -0
  3. data/README.md +7 -7
  4. data/hanami.gemspec +6 -6
  5. data/lib/hanami/app.rb +5 -1
  6. data/lib/hanami/config/db.rb +33 -0
  7. data/lib/hanami/config.rb +36 -9
  8. data/lib/hanami/extensions/db/repo.rb +103 -0
  9. data/lib/hanami/extensions.rb +4 -0
  10. data/lib/hanami/helpers/form_helper/form_builder.rb +2 -4
  11. data/lib/hanami/provider_registrar.rb +26 -0
  12. data/lib/hanami/providers/assets.rb +2 -20
  13. data/lib/hanami/providers/db/adapter.rb +68 -0
  14. data/lib/hanami/providers/db/adapters.rb +44 -0
  15. data/lib/hanami/providers/db/config.rb +66 -0
  16. data/lib/hanami/providers/db/sql_adapter.rb +80 -0
  17. data/lib/hanami/providers/db.rb +203 -0
  18. data/lib/hanami/providers/db_logging.rb +22 -0
  19. data/lib/hanami/providers/rack.rb +1 -1
  20. data/lib/hanami/providers/relations.rb +31 -0
  21. data/lib/hanami/providers/routes.rb +1 -13
  22. data/lib/hanami/rake_tasks.rb +8 -7
  23. data/lib/hanami/slice.rb +84 -4
  24. data/lib/hanami/version.rb +1 -1
  25. data/lib/hanami.rb +3 -0
  26. data/spec/integration/container/provider_environment_spec.rb +52 -0
  27. data/spec/integration/db/auto_registration_spec.rb +39 -0
  28. data/spec/integration/db/db_inflector_spec.rb +57 -0
  29. data/spec/integration/db/db_slices_spec.rb +327 -0
  30. data/spec/integration/db/db_spec.rb +220 -0
  31. data/spec/integration/db/logging_spec.rb +238 -0
  32. data/spec/integration/db/provider_config_spec.rb +88 -0
  33. data/spec/integration/db/provider_spec.rb +35 -0
  34. data/spec/integration/db/repo_spec.rb +215 -0
  35. data/spec/integration/db/slices_importing_from_parent.rb +130 -0
  36. data/spec/integration/slices/slice_configuration_spec.rb +4 -4
  37. data/spec/support/app_integration.rb +3 -0
  38. data/spec/unit/hanami/config/db_spec.rb +38 -0
  39. data/spec/unit/hanami/config/router_spec.rb +1 -1
  40. data/spec/unit/hanami/helpers/form_helper_spec.rb +31 -0
  41. data/spec/unit/hanami/providers/db/config/default_config_spec.rb +107 -0
  42. data/spec/unit/hanami/providers/db/config_spec.rb +206 -0
  43. data/spec/unit/hanami/slice_spec.rb +32 -0
  44. data/spec/unit/hanami/version_spec.rb +1 -1
  45. metadata +61 -19
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.1.1
4
+ version: 2.2.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: 2024-05-12 00:00:00.000000000 Z
11
+ date: 2024-07-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -37,6 +37,9 @@ dependencies:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
39
  version: '1.0'
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ version: 1.2.0
40
43
  - - "<"
41
44
  - !ruby/object:Gem::Version
42
45
  version: '2'
@@ -47,6 +50,9 @@ dependencies:
47
50
  - - "~>"
48
51
  - !ruby/object:Gem::Version
49
52
  version: '1.0'
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: 1.2.0
50
56
  - - "<"
51
57
  - !ruby/object:Gem::Version
52
58
  version: '2'
@@ -77,6 +83,9 @@ dependencies:
77
83
  - - "~>"
78
84
  - !ruby/object:Gem::Version
79
85
  version: '1.0'
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: 1.1.0
80
89
  - - "<"
81
90
  - !ruby/object:Gem::Version
82
91
  version: '2'
@@ -87,6 +96,9 @@ dependencies:
87
96
  - - "~>"
88
97
  - !ruby/object:Gem::Version
89
98
  version: '1.0'
99
+ - - ">="
100
+ - !ruby/object:Gem::Version
101
+ version: 1.1.0
90
102
  - - "<"
91
103
  - !ruby/object:Gem::Version
92
104
  version: '2'
@@ -120,22 +132,16 @@ dependencies:
120
132
  name: dry-system
121
133
  requirement: !ruby/object:Gem::Requirement
122
134
  requirements:
123
- - - "~>"
124
- - !ruby/object:Gem::Version
125
- version: '1.0'
126
- - - "<"
135
+ - - '='
127
136
  - !ruby/object:Gem::Version
128
- version: '2'
137
+ version: 1.1.0.beta1
129
138
  type: :runtime
130
139
  prerelease: false
131
140
  version_requirements: !ruby/object:Gem::Requirement
132
141
  requirements:
133
- - - "~>"
134
- - !ruby/object:Gem::Version
135
- version: '1.0'
136
- - - "<"
142
+ - - '='
137
143
  - !ruby/object:Gem::Version
138
- version: '2'
144
+ version: 1.1.0.beta1
139
145
  - !ruby/object:Gem::Dependency
140
146
  name: dry-logger
141
147
  requirement: !ruby/object:Gem::Requirement
@@ -160,30 +166,30 @@ dependencies:
160
166
  name: hanami-cli
161
167
  requirement: !ruby/object:Gem::Requirement
162
168
  requirements:
163
- - - "~>"
169
+ - - '='
164
170
  - !ruby/object:Gem::Version
165
- version: '2.1'
171
+ version: 2.2.0.beta1
166
172
  type: :runtime
167
173
  prerelease: false
168
174
  version_requirements: !ruby/object:Gem::Requirement
169
175
  requirements:
170
- - - "~>"
176
+ - - '='
171
177
  - !ruby/object:Gem::Version
172
- version: '2.1'
178
+ version: 2.2.0.beta1
173
179
  - !ruby/object:Gem::Dependency
174
180
  name: hanami-utils
175
181
  requirement: !ruby/object:Gem::Requirement
176
182
  requirements:
177
183
  - - "~>"
178
184
  - !ruby/object:Gem::Version
179
- version: '2.1'
185
+ version: 2.2.beta
180
186
  type: :runtime
181
187
  prerelease: false
182
188
  version_requirements: !ruby/object:Gem::Requirement
183
189
  requirements:
184
190
  - - "~>"
185
191
  - !ruby/object:Gem::Version
186
- version: '2.1'
192
+ version: 2.2.beta
187
193
  - !ruby/object:Gem::Dependency
188
194
  name: zeitwerk
189
195
  requirement: !ruby/object:Gem::Requirement
@@ -262,6 +268,7 @@ files:
262
268
  - lib/hanami/config/actions/cookies.rb
263
269
  - lib/hanami/config/actions/sessions.rb
264
270
  - lib/hanami/config/assets.rb
271
+ - lib/hanami/config/db.rb
265
272
  - lib/hanami/config/logger.rb
266
273
  - lib/hanami/config/null_config.rb
267
274
  - lib/hanami/config/router.rb
@@ -272,6 +279,7 @@ files:
272
279
  - lib/hanami/extensions.rb
273
280
  - lib/hanami/extensions/action.rb
274
281
  - lib/hanami/extensions/action/slice_configured_action.rb
282
+ - lib/hanami/extensions/db/repo.rb
275
283
  - lib/hanami/extensions/router/errors.rb
276
284
  - lib/hanami/extensions/view.rb
277
285
  - lib/hanami/extensions/view/context.rb
@@ -291,10 +299,18 @@ files:
291
299
  - lib/hanami/middleware/render_errors.rb
292
300
  - lib/hanami/port.rb
293
301
  - lib/hanami/prepare.rb
302
+ - lib/hanami/provider_registrar.rb
294
303
  - lib/hanami/providers/assets.rb
304
+ - lib/hanami/providers/db.rb
305
+ - lib/hanami/providers/db/adapter.rb
306
+ - lib/hanami/providers/db/adapters.rb
307
+ - lib/hanami/providers/db/config.rb
308
+ - lib/hanami/providers/db/sql_adapter.rb
309
+ - lib/hanami/providers/db_logging.rb
295
310
  - lib/hanami/providers/inflector.rb
296
311
  - lib/hanami/providers/logger.rb
297
312
  - lib/hanami/providers/rack.rb
313
+ - lib/hanami/providers/relations.rb
298
314
  - lib/hanami/providers/routes.rb
299
315
  - lib/hanami/rake_tasks.rb
300
316
  - lib/hanami/routes.rb
@@ -336,10 +352,20 @@ files:
336
352
  - spec/integration/container/autoloader_spec.rb
337
353
  - spec/integration/container/imports_spec.rb
338
354
  - spec/integration/container/prepare_container_spec.rb
355
+ - spec/integration/container/provider_environment_spec.rb
339
356
  - spec/integration/container/provider_lifecycle_spec.rb
340
357
  - spec/integration/container/shutdown_spec.rb
341
358
  - spec/integration/container/standard_providers/rack_provider_spec.rb
342
359
  - spec/integration/container/standard_providers_spec.rb
360
+ - spec/integration/db/auto_registration_spec.rb
361
+ - spec/integration/db/db_inflector_spec.rb
362
+ - spec/integration/db/db_slices_spec.rb
363
+ - spec/integration/db/db_spec.rb
364
+ - spec/integration/db/logging_spec.rb
365
+ - spec/integration/db/provider_config_spec.rb
366
+ - spec/integration/db/provider_spec.rb
367
+ - spec/integration/db/repo_spec.rb
368
+ - spec/integration/db/slices_importing_from_parent.rb
343
369
  - spec/integration/dotenv_loading_spec.rb
344
370
  - spec/integration/logging/exception_logging_spec.rb
345
371
  - spec/integration/logging/notifications_spec.rb
@@ -403,6 +429,7 @@ files:
403
429
  - spec/unit/hanami/config/actions/sessions_spec.rb
404
430
  - spec/unit/hanami/config/actions_spec.rb
405
431
  - spec/unit/hanami/config/base_url_spec.rb
432
+ - spec/unit/hanami/config/db_spec.rb
406
433
  - spec/unit/hanami/config/inflector_spec.rb
407
434
  - spec/unit/hanami/config/logger_spec.rb
408
435
  - spec/unit/hanami/config/render_detailed_errors_spec.rb
@@ -421,6 +448,8 @@ files:
421
448
  - spec/unit/hanami/helpers/assets_helper/video_tag_spec.rb
422
449
  - spec/unit/hanami/helpers/form_helper_spec.rb
423
450
  - spec/unit/hanami/port_spec.rb
451
+ - spec/unit/hanami/providers/db/config/default_config_spec.rb
452
+ - spec/unit/hanami/providers/db/config_spec.rb
424
453
  - spec/unit/hanami/router/errors/not_allowed_error_spec.rb
425
454
  - spec/unit/hanami/router/errors/not_found_error_spec.rb
426
455
  - spec/unit/hanami/settings/env_store_spec.rb
@@ -444,7 +473,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
444
473
  requirements:
445
474
  - - ">="
446
475
  - !ruby/object:Gem::Version
447
- version: '3.0'
476
+ version: '3.1'
448
477
  required_rubygems_version: !ruby/object:Gem::Requirement
449
478
  requirements:
450
479
  - - ">="
@@ -478,10 +507,20 @@ test_files:
478
507
  - spec/integration/container/autoloader_spec.rb
479
508
  - spec/integration/container/imports_spec.rb
480
509
  - spec/integration/container/prepare_container_spec.rb
510
+ - spec/integration/container/provider_environment_spec.rb
481
511
  - spec/integration/container/provider_lifecycle_spec.rb
482
512
  - spec/integration/container/shutdown_spec.rb
483
513
  - spec/integration/container/standard_providers/rack_provider_spec.rb
484
514
  - spec/integration/container/standard_providers_spec.rb
515
+ - spec/integration/db/auto_registration_spec.rb
516
+ - spec/integration/db/db_inflector_spec.rb
517
+ - spec/integration/db/db_slices_spec.rb
518
+ - spec/integration/db/db_spec.rb
519
+ - spec/integration/db/logging_spec.rb
520
+ - spec/integration/db/provider_config_spec.rb
521
+ - spec/integration/db/provider_spec.rb
522
+ - spec/integration/db/repo_spec.rb
523
+ - spec/integration/db/slices_importing_from_parent.rb
485
524
  - spec/integration/dotenv_loading_spec.rb
486
525
  - spec/integration/logging/exception_logging_spec.rb
487
526
  - spec/integration/logging/notifications_spec.rb
@@ -545,6 +584,7 @@ test_files:
545
584
  - spec/unit/hanami/config/actions/sessions_spec.rb
546
585
  - spec/unit/hanami/config/actions_spec.rb
547
586
  - spec/unit/hanami/config/base_url_spec.rb
587
+ - spec/unit/hanami/config/db_spec.rb
548
588
  - spec/unit/hanami/config/inflector_spec.rb
549
589
  - spec/unit/hanami/config/logger_spec.rb
550
590
  - spec/unit/hanami/config/render_detailed_errors_spec.rb
@@ -563,6 +603,8 @@ test_files:
563
603
  - spec/unit/hanami/helpers/assets_helper/video_tag_spec.rb
564
604
  - spec/unit/hanami/helpers/form_helper_spec.rb
565
605
  - spec/unit/hanami/port_spec.rb
606
+ - spec/unit/hanami/providers/db/config/default_config_spec.rb
607
+ - spec/unit/hanami/providers/db/config_spec.rb
566
608
  - spec/unit/hanami/router/errors/not_allowed_error_spec.rb
567
609
  - spec/unit/hanami/router/errors/not_found_error_spec.rb
568
610
  - spec/unit/hanami/settings/env_store_spec.rb