hanami 2.1.0 → 2.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3f9161e98415778e746f9140d2ee9e23b7d8388eca678e7ddeb696c2bb8cdfee
4
- data.tar.gz: 7deffed8c1081258db7182306bf95bf484fa9e08dbd37193ca36659a06d45040
3
+ metadata.gz: 190712bdfa529ad5769aa5effd9335e436b067cd91b6a109a3aa9a4718a73507
4
+ data.tar.gz: 353ccb232425a07133e981d5d8ae6c6906f49cb48d38d7f2b55dc4e28a9c797b
5
5
  SHA512:
6
- metadata.gz: 1acff67204a42604558bce5455d36454cc8c176a741906750a536ae72f3048a006c798db7192918d64f06cc4b1fce7ce5c4f46726d0a27b309c82a1263b3d72b
7
- data.tar.gz: aadb05898198c750f485f5a78f6d35f1e82c6b95ee052f749cfb0241b11f6706c367f7cfc01c31205664ff508853a3415884b7b729097e689d2f9f72c6bdf0fc
6
+ metadata.gz: 4a4e7e1885c9b3eb494863b63f4d376739d6736764b435b83ce75e9a1bb68340681a26bea3883ed20c679e4d88bf99b3d487ae40e2e80f0fb15adb99acfa561d
7
+ data.tar.gz: 8fe1a9d8f9f7372d67ee3f7b9c6e55b0e1aa59acbaee7264028d876dd5cd7b586f147ae08cd268d67c923d5028344bf37868d190cd2d56229932db56828dcce1
data/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  The web, with simplicity.
4
4
 
5
+ ## v2.1.1 - 2024-05-12
6
+
7
+ ### Fixed
8
+
9
+ - [Tim Riley] Ensure Rack logging continues to work when upgrading to dry-logger 1.0.4 (#1384)
10
+
5
11
  ## v2.1.0 - 2024-02-27
6
12
 
7
13
  ### Changed
@@ -14,7 +20,7 @@ The web, with simplicity.
14
20
  ### Changed
15
21
 
16
22
  - [Tim Riley] Return `nil` when setting content via `#content_for` on the app's view context. This
17
- allows it to be used with tempalte output tags (such as ERB's `<%=`) that capture a block for the
23
+ allows it to be used with template output tags (such as ERB's `<%=`) that capture a block for the
18
24
  given content. (#1369)
19
25
 
20
26
  ### Fixed
@@ -52,7 +58,6 @@ The web, with simplicity.
52
58
  - Keep `video_tag` (remove `video` alias)
53
59
  - Keep `audio_tag` (remove `audio` alias)
54
60
 
55
-
56
61
  ## v2.1.0.beta2.1 - 2023-10-04
57
62
 
58
63
  ### Added
@@ -151,7 +156,7 @@ The web, with simplicity.
151
156
  ### Fixed
152
157
 
153
158
  - [Luca Guidi] Ensure to properly mount Rack middleware in routing scope and slice
154
- - [Tim Riley] Simplify and clarify usage of `Hanami::Config#enviroment`
159
+ - [Tim Riley] Simplify and clarify usage of `Hanami::Config#environment`
155
160
  - [Tim Riley] Improve error message for missing action class
156
161
  - [Tim Riley] Expect nested slices to use parent’s namespace
157
162
 
@@ -811,7 +816,7 @@ The web, with simplicity.
811
816
  - [Luca Guidi] Main configuration is available at `config/application.rb` instead of `config/enviroment.rb`
812
817
  - [Luca Guidi] Removed `Hanami.configure` in favor of main application configuration (e.g. `Bookshelf::Application.config`)
813
818
  - [Luca Guidi] Removed DSL syntax for main configuration (from `cookies max_age: 600` to `config.cookies = { max_age: 600 }`)
814
- - [Luca Guidi] Per enviroment settings must be wrapped in a block (e.g. `config.enviroment(:production) { |c| c.logger = {} }`)
819
+ - [Luca Guidi] Per environment settings must be wrapped in a block (e.g. `config.environment(:production) { |c| c.logger = {} }`)
815
820
  - [Luca Guidi] Concrete applications are no longer supported (e.g. `Web::Application` in `apps/web/application.rb`)
816
821
  - [Luca Guidi] Main routes must be configured at `config/routes.rb`:
817
822
 
@@ -1127,7 +1132,7 @@ end
1127
1132
  - [Mahesh] Fix destroy action for application architecture
1128
1133
  - [Karim Tarek & akhramov] Reference rendering errors in Rack env's `rack.exception` variable. This enables compatibility with exception reporting SaaS.
1129
1134
  - [Luca Guidi] Detect assets dependencies changes in development (Sass/SCSS)
1130
- - [Luca Guidi & Lucas Amorim] Make model generator not dependendent on the current directory name, but to the project name stored in `.hanamirc`
1135
+ - [Luca Guidi & Lucas Amorim] Make model generator not dependent on the current directory name, but to the project name stored in `.hanamirc`
1131
1136
 
1132
1137
  ### Changed
1133
1138
 
@@ -1382,7 +1387,7 @@ end
1382
1387
  - [Piotr Kurek] Allow to yield multiple configurations per application, according to the current environment
1383
1388
  - [David Celis] Allow to configure Rack middleware stack (`middleware` configuration)
1384
1389
  - [David Celis] Introduced `lotus console` command. It runs the REPL configured in `Gemfile` (eg. pry or ripl). Defaults to IRb.
1385
- - [Luca Guidi] Introduced `Lotus::Environment` which holds the informations about the current environment, and CLI arguments
1390
+ - [Luca Guidi] Introduced `Lotus::Environment` which holds the information about the current environment, and CLI arguments
1386
1391
  - [Luca Guidi] Introduced `Lotus::Application.load!` to load and configure an application without requiring user defined code (controllers, views, etc.)
1387
1392
  - [Leonard Garvey] Introduced `lotus server` command. It runs the application with the Rack server declared in `Gemfile` (eg. puma, thin, unicorn). It defaults to `WEBRick`.
1388
1393
  - [Luca Guidi] Official support for MRI 2.1 and 2.2
data/FEATURES.md CHANGED
@@ -122,7 +122,7 @@
122
122
 
123
123
  ### v0.6.0 - 2016-01-12
124
124
 
125
- - Assets preprocessors support (eg. Sass, ES6, Opal, Less, CoffeScript..)
125
+ - Assets preprocessors support (eg. Sass, ES6, Opal, Less, CoffeeScript..)
126
126
  - Assets compressors (eg. YUI, UglifyJS2, Google Closure Compiler, Sass..)
127
127
  - Assets helpers:
128
128
  - `javascript`
data/lib/hanami/app.rb CHANGED
@@ -129,7 +129,7 @@ module Hanami
129
129
  end
130
130
  end
131
131
 
132
- # When auto-registering components in app/, ignore files in `app/lib/` (these will be
132
+ # When auto-registering components in `app/`, ignore files in `app/lib/` (these will be
133
133
  # auto-registered as above), as well as the configured no_auto_register_paths
134
134
  no_auto_register_paths = ([LIB_DIR] + config.no_auto_register_paths)
135
135
  .map { |path|
@@ -159,7 +159,7 @@ module Hanami
159
159
  end
160
160
  end
161
161
 
162
- def respond_to_missing?(name, _incude_all = false)
162
+ def respond_to_missing?(name, _include_all = false)
163
163
  config.respond_to?(name) || base_config.respond_to?(name) || super
164
164
  end
165
165
  end
@@ -76,7 +76,7 @@ module Hanami
76
76
  end
77
77
  end
78
78
 
79
- def respond_to_missing?(name, _incude_all = false)
79
+ def respond_to_missing?(name, _include_all = false)
80
80
  config.respond_to?(name) || base_config.respond_to?(name) || super
81
81
  end
82
82
  end
@@ -25,7 +25,7 @@ module Hanami
25
25
  attr_reader :env
26
26
 
27
27
  # @!attribute [rw] level
28
- # Sets or returns the logger level.
28
+ # Sets or returns the logger's level.
29
29
  #
30
30
  # Defaults to `:info` for the production environment and `:debug` for all others.
31
31
  #
@@ -191,7 +191,7 @@ module Hanami
191
191
  end
192
192
 
193
193
  # @api private
194
- def respond_to_missing?(name, _incude_all = false)
194
+ def respond_to_missing?(name, _include_all = false)
195
195
  config.respond_to?(name) || super
196
196
  end
197
197
  end
data/lib/hanami/config.rb CHANGED
@@ -481,7 +481,7 @@ module Hanami
481
481
  end
482
482
  end
483
483
 
484
- def respond_to_missing?(name, _incude_all = false)
484
+ def respond_to_missing?(name, _include_all = false)
485
485
  config.respond_to?(name) || super
486
486
  end
487
487
  end
@@ -156,7 +156,7 @@ module Hanami
156
156
  @assets
157
157
  end
158
158
 
159
- # Returns the current request, if the view is rendered from within an action.
159
+ # Returns the current request, if the view is rendered from within an action.
160
160
  #
161
161
  # @return [Hanami::Action::Request] the request
162
162
  #
@@ -46,7 +46,7 @@ module Hanami
46
46
  # Standalone helpers class including both {StandardHelpers} as well as the user-defined
47
47
  # helpers for the slice.
48
48
  #
49
- # Used used where helpers should be addressed via an intermediary object (i.e. in parts),
49
+ # Used where helpers should be addressed via an intermediary object (i.e. in parts),
50
50
  # rather than mixed into a class directly.
51
51
  #
52
52
  # @api private
@@ -3,7 +3,7 @@
3
3
  module Hanami
4
4
  module Extensions
5
5
  module View
6
- # Provides slice-specific helper methods any view object requiring access to helpers.
6
+ # Provides slice-specific helper methods for any view object requiring access to helpers.
7
7
  #
8
8
  # @api public
9
9
  # @since 2.1.0
@@ -81,7 +81,7 @@ module Hanami
81
81
  # If the "CDN mode" is on, the `src` is an absolute URL of the
82
82
  # application CDN.
83
83
  #
84
- # If the "subresource integrity mode" is on, `integriy` is the
84
+ # If the "subresource integrity mode" is on, `integrity` is the
85
85
  # name of the algorithm, then a hyphen, then the hash value of the file.
86
86
  # If more than one algorithm is used, they"ll be separated by a space.
87
87
  #
@@ -185,7 +185,7 @@ module Hanami
185
185
  # If the "CDN mode" is on, the `href` is an absolute URL of the
186
186
  # application CDN.
187
187
  #
188
- # If the "subresource integrity mode" is on, `integriy` is the
188
+ # If the "subresource integrity mode" is on, `integrity` is the
189
189
  # name of the algorithm, then a hyphen, then the hashed value of the file.
190
190
  # If more than one algorithm is used, they"ll be separated by a space.
191
191
  #
@@ -270,7 +270,7 @@ module Hanami
270
270
  # Generate `img` tag for given source
271
271
  #
272
272
  # It accepts one string representing the name of the asset, if it comes
273
- # from the application or third party gems. It also accepts string
273
+ # from the application or third party gems. It also accepts strings
274
274
  # representing absolute URLs in case of public CDN (eg. Bootstrap CDN).
275
275
  #
276
276
  # `alt` Attribute is auto generated from `src`.
@@ -412,7 +412,7 @@ module Hanami
412
412
  # Generate `video` tag for given source
413
413
  #
414
414
  # It accepts one string representing the name of the asset, if it comes
415
- # from the application or third party gems. It also accepts string
415
+ # from the application or third party gems. It also accepts strings
416
416
  # representing absolute URLs in case of public CDN (eg. Bootstrap CDN).
417
417
  #
418
418
  # Alternatively, it accepts a block that allows to specify one or more
@@ -514,7 +514,7 @@ module Hanami
514
514
  # Generate `audio` tag for given source
515
515
  #
516
516
  # It accepts one string representing the name of the asset, if it comes
517
- # from the application or third party gems. It also accepts string
517
+ # from the application or third party gems. It also accepts strings
518
518
  # representing absolute URLs in case of public CDN (eg. Bootstrap CDN).
519
519
  #
520
520
  # Alternatively, it accepts a block that allows to specify one or more
@@ -190,7 +190,7 @@ module Hanami
190
190
  # @param name [String] the input name, also used as the base input name for all fields
191
191
  # within the block
192
192
  # @yieldparam [FormBuilder] the form builder for the nested fields
193
- # @yieldparam [Integer] the index of the iteration over the colletion, starting from zero
193
+ # @yieldparam [Integer] the index of the iteration over the collection, starting from zero
194
194
  # @yieldparam [Object] the value of the element from the collection
195
195
  #
196
196
  # @example Basic usage
@@ -694,7 +694,7 @@ module Hanami
694
694
  #
695
695
  # @example Advanced attributes
696
696
  # f.number_field("book.percent_read", min: 1, max: 100, step: 1)
697
- # => <input type="number" name="book[percent_read]" id="book-precent-read" value="" min="1" max="100" step="1">
697
+ # => <input type="number" name="book[percent_read]" id="book-percent-read" value="" min="1" max="100" step="1">
698
698
  #
699
699
  # @api public
700
700
  # @since 2.1.0
@@ -4,8 +4,8 @@ require "rack"
4
4
 
5
5
  module Hanami
6
6
  module Middleware
7
- # The errors app given to {Hanami::Middleware::RenderErrors}, which renders a error responses
8
- # from HTML pages kept in `public/` or as simple JSON structures.
7
+ # The errors app given to {Hanami::Middleware::RenderErrors}, which renders error responses
8
+ # from HTML pages kept in `public/` as simple JSON structures.
9
9
  #
10
10
  # @see Hanami::Middleware::RenderErrors
11
11
  #
@@ -20,8 +20,8 @@ module Hanami
20
20
  # Explicitly register the Rack middleware events on our notifications bus. The Dry::Monitor
21
21
  # rack extension (activated above) does register these globally, but if the notifications
22
22
  # bus has been used before this provider loads, then it will have created its own separate
23
- # locally copy of all registered events as of that moment in time, which will not included
24
- # the Rack events globally reigstered above.
23
+ # local copy of all registered events as of that moment in time, which will not be included
24
+ # in the Rack events globally registered above.
25
25
  notifications = target["notifications"]
26
26
  notifications.register_event(Dry::Monitor::Rack::Middleware::REQUEST_START)
27
27
  notifications.register_event(Dry::Monitor::Rack::Middleware::REQUEST_STOP)
@@ -32,7 +32,7 @@ Hanami::CLI::RakeTasks.register_tasks do
32
32
  # Please use them when you're in control of your deployment environment.
33
33
  #
34
34
  # If you're not in control and your deployment requires these "standard"
35
- # Rake tasks, they are here to solve this only specific problem.
35
+ # Rake tasks, they are here only to solve this specific problem.
36
36
  #
37
37
  # namespace :db do
38
38
  # task :migrate do
@@ -8,7 +8,7 @@ module Hanami
8
8
  # Provides user-defined settings for an Hanami app or slice.
9
9
  #
10
10
  # Define your own settings by inheriting from this class in `config/settings.rb` within an app or
11
- # slice. Your settings will be loaded from matching ENV vars (with upper-cased names) and made
11
+ # slice. Your settings will be loaded from matching ENV vars (with upper-cased names) and be
12
12
  # registered as a component as part of the Hanami app {Hanami::Slice::ClassMethods#prepare
13
13
  # prepare} step.
14
14
  #
@@ -160,8 +160,8 @@ module Hanami
160
160
  value = store.fetch(name, Undefined)
161
161
 
162
162
  if value.eql?(Undefined)
163
- # When a key is missing entirely from the store, _read_ its value from the config instead,
164
- # which ensures its setting constructor runs (with a `nil` argument given) and raises any
163
+ # When a key is missing entirely from the store, _read_ its value from the config instead.
164
+ # This ensures its setting constructor runs (with a `nil` argument given) and raises any
165
165
  # necessary errors.
166
166
  public_send(name)
167
167
  else
data/lib/hanami/slice.rb CHANGED
@@ -189,7 +189,7 @@ module Hanami
189
189
  # @api public
190
190
  # @since 2.0.0
191
191
  def root
192
- # Provide a best guess for a root when it is not yet configured.
192
+ # Provides a best guess for a root when it is not yet configured.
193
193
  #
194
194
  # This is particularly useful for user-defined slice classes that access `settings` inside
195
195
  # the class body (since the root needed to find the settings file). In this case,
@@ -265,7 +265,7 @@ module Hanami
265
265
  #
266
266
  # @example
267
267
  # module MySlice
268
- # class Sliice < Hanami::Slice
268
+ # class Slice < Hanami::Slice
269
269
  # prepare_container do |container|
270
270
  # # ...
271
271
  # end
@@ -404,7 +404,7 @@ module Hanami
404
404
  # @param key [String] the component's key
405
405
  # @param object [Object] the object to register as the component
406
406
  #
407
- # @overload reigster(key, memoize: false, &block)
407
+ # @overload register(key, memoize: false, &block)
408
408
  # Registers the given block as the component. When the component is resolved, the return
409
409
  # value of the block will be returned.
410
410
  #
@@ -422,7 +422,7 @@ module Hanami
422
422
  # @param memoize [Boolean]
423
423
  # @yieldreturn [Object] the object to register as the component
424
424
  #
425
- # @overload reigster(key, call: true, &block)
425
+ # @overload register(key, call: true, &block)
426
426
  # Registers the given block as the component. When `call: false` is given, then the block
427
427
  # itself will become the component.
428
428
  #
@@ -430,7 +430,7 @@ module Hanami
430
430
  # object for that block will be returned.
431
431
  #
432
432
  # @param key [String] the component's key
433
- # @param call [Booelan]
433
+ # @param call [Boolean]
434
434
  #
435
435
  # @return [container]
436
436
  #
@@ -493,7 +493,7 @@ module Hanami
493
493
  # namespace. May be an explicit string, or `true` for the namespace to be the provider's
494
494
  # name
495
495
  # @param from [Symbol, nil] the group for an external provider source to use, with the
496
- # provider source name inferred from `name` or passsed explicitly as `source:`
496
+ # provider source name inferred from `name` or passed explicitly as `source:`
497
497
  # @param source [Symbol, nil] the name of the external provider source to use, if different
498
498
  # from the value provided as `name`
499
499
  # @param if [Boolean] a boolean-returning expression to determine whether to register the
@@ -7,7 +7,7 @@ module Hanami
7
7
  # @api private
8
8
  module Version
9
9
  # @api public
10
- VERSION = "2.1.0"
10
+ VERSION = "2.1.1"
11
11
 
12
12
  # @since 0.9.0
13
13
  # @api private
@@ -35,8 +35,8 @@ module Hanami
35
35
  CONTENT_LENGTH = "CONTENT_LENGTH"
36
36
  private_constant :CONTENT_LENGTH
37
37
 
38
- MILISECOND = "ms"
39
- private_constant :MILISECOND
38
+ MILLISECOND = "ms"
39
+ private_constant :MILLISECOND
40
40
 
41
41
  MICROSECOND = "µs"
42
42
  private_constant :MICROSECOND
@@ -79,7 +79,7 @@ module Hanami
79
79
  end
80
80
 
81
81
  def accepts_entry_payload?(logger)
82
- logger.method(:info).parameters.last.then { |type, _| type == :keyrest }
82
+ logger.method(:info).parameters.any? { |(type, _)| type == :keyrest }
83
83
  end
84
84
  end
85
85
 
@@ -32,7 +32,7 @@ RSpec.describe "App view / Config / Template", :app_integration do
32
32
  subject(:template) { view_class.config.template }
33
33
  let(:view_class) { TestApp::Views::Article::Index }
34
34
 
35
- it "configures the tempalte to match the class name" do
35
+ it "configures the template to match the class name" do
36
36
  expect(template).to eq "article/index"
37
37
  end
38
38
  end
@@ -31,7 +31,7 @@ RSpec.describe "App view / Context / Request", :app_integration do
31
31
  end
32
32
  end
33
33
 
34
- describe "#sesion" do
34
+ describe "#session" do
35
35
  let(:session) { double(:session) }
36
36
 
37
37
  before do
@@ -80,8 +80,8 @@ RSpec.describe Hanami::Helpers::FormHelper do
80
80
  end
81
81
 
82
82
  it "allows to specify HTML attributes" do
83
- html = form_for("/books", class: "form-horizonal")
84
- expect(html).to eq %(<form action="/books" class="form-horizonal" accept-charset="utf-8" method="POST"></form>)
83
+ html = form_for("/books", class: "form-horizontal")
84
+ expect(html).to eq %(<form action="/books" class="form-horizontal" accept-charset="utf-8" method="POST"></form>)
85
85
  end
86
86
 
87
87
  context "input name" do
@@ -8,7 +8,7 @@ RSpec.describe Hanami::Slice, :app_integration do
8
8
  end
9
9
  end
10
10
 
11
- describe ".environemnt" do
11
+ describe ".environment" do
12
12
  subject(:slice) { Hanami.app.register_slice(:main) }
13
13
 
14
14
  before do
@@ -2,6 +2,6 @@
2
2
 
3
3
  RSpec.describe "Hanami::VERSION" do
4
4
  it "returns current version" do
5
- expect(Hanami::VERSION).to eq("2.1.0")
5
+ expect(Hanami::VERSION).to eq("2.1.1")
6
6
  end
7
7
  end
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.0
4
+ version: 2.1.1
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-02-27 00:00:00.000000000 Z
11
+ date: 2024-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -451,7 +451,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
451
451
  - !ruby/object:Gem::Version
452
452
  version: '0'
453
453
  requirements: []
454
- rubygems_version: 3.5.6
454
+ rubygems_version: 3.5.9
455
455
  signing_key:
456
456
  specification_version: 4
457
457
  summary: The web, with simplicity