hanami-controller 2.3.1 → 2.3.2

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.
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015-2026 Hanakai team
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -1,22 +1,9 @@
1
- # Hanami::Controller
1
+ <!--- This file is synced from hanakai-rb/repo-sync -->
2
2
 
3
- Complete, fast, and testable actions for Rack and [Hanami](http://hanamirb.org)
4
-
5
- ## Status
6
-
7
- [![Gem Version](https://badge.fury.io/rb/hanami-controller.svg)](https://badge.fury.io/rb/hanami-controller)
8
- [![CI](https://github.com/hanami/hanami-controller/actions/workflows/ci.yml/badge.svg)](https://github.com/hanami/hanami-controller/actions?query=workflow%3Aci+branch%3Amain)
9
- [![Test Coverage](https://codecov.io/gh/hanami/hanami-controller/branch/main/graph/badge.svg)](https://codecov.io/gh/hanami/hanami-controller)
10
-
11
- ## Contact
12
-
13
- * Home page: http://hanamirb.org
14
- * Community: http://hanamirb.org/community
15
- * Guides: https://guides.hanamirb.org
16
- * Mailing List: http://hanamirb.org/mailing-list
17
- * API Doc: http://rubydoc.info/gems/hanami-controller
18
- * Chat: http://chat.hanamirb.org
3
+ [rubygem]: https://rubygems.org/gems/hanami-controller
4
+ [actions]: https://github.com/hanami/hanami-controller/actions
19
5
 
6
+ # Hanami Controller [![Gem Version](https://badge.fury.io/rb/hanami-controller.svg)][rubygem] [![CI Status](https://github.com/hanami/hanami-controller/workflows/CI/badge.svg)][actions]
20
7
 
21
8
  ## Installation
22
9
 
@@ -936,10 +923,6 @@ end
936
923
 
937
924
  An Action is **immutable**, it works without global state, so it's thread-safe by design.
938
925
 
939
- ## Versioning
940
-
941
- __Hanami::Controller__ uses [Semantic Versioning 2.0.0](http://semver.org)
942
-
943
926
  ## Contributing
944
927
 
945
928
  1. Fork it
@@ -948,6 +931,13 @@ __Hanami::Controller__ uses [Semantic Versioning 2.0.0](http://semver.org)
948
931
  4. Push to the branch (`git push origin my-new-feature`)
949
932
  5. Create new Pull Request
950
933
 
951
- ## Copyright
934
+ ## Links
935
+
936
+ - [User documentation](https://hanamirb.org)
937
+ - [API documentation](http://rubydoc.info/gems/hanami-controller)
938
+
939
+
940
+ ## License
941
+
942
+ See `LICENSE` file.
952
943
 
953
- Copyright © 2014–2024 Hanami Team – Released under MIT License
@@ -1,33 +1,40 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- lib = File.expand_path("../lib", __FILE__)
3
+ # This file is synced from hanakai-rb/repo-sync. To update it, edit repo-sync.yml.
4
+
5
+ lib = File.expand_path("lib", __dir__)
4
6
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
7
  require "hanami/controller/version"
6
8
 
7
9
  Gem::Specification.new do |spec|
8
10
  spec.name = "hanami-controller"
9
- spec.version = Hanami::Controller::VERSION
10
11
  spec.authors = ["Hanakai team"]
11
12
  spec.email = ["info@hanakai.org"]
12
- spec.description = "Complete, fast and testable actions for Rack"
13
- spec.summary = "Complete, fast and testable actions for Rack and Hanami"
14
- spec.homepage = "http://hanamirb.org"
15
13
  spec.license = "MIT"
14
+ spec.version = Hanami::Controller::VERSION.dup
16
15
 
17
- spec.files = `git ls-files -- lib/* CHANGELOG.md LICENSE.md README.md hanami-controller.gemspec`.split($/)
18
- spec.executables = []
16
+ spec.summary = "Complete, fast and testable actions for Rack and Hanami"
17
+ spec.description = spec.summary
18
+ spec.homepage = "https://hanamirb.org"
19
+ spec.files = Dir["CHANGELOG.md", "LICENSE", "README.md", "hanami-controller.gemspec", "lib/**/*"]
20
+ spec.bindir = "exe"
21
+ spec.executables = Dir["exe/*"].map { |f| File.basename(f) }
19
22
  spec.require_paths = ["lib"]
20
- spec.metadata["rubygems_mfa_required"] = "true"
21
- spec.required_ruby_version = ">= 3.2"
22
23
 
23
- spec.add_dependency "rack", ">= 2.1"
24
- spec.add_dependency "hanami-utils", "~> 2.3.0"
25
- spec.add_dependency "dry-configurable", "~> 1.0", "< 2"
26
- spec.add_dependency "dry-core", "~> 1.0"
27
- spec.add_dependency "zeitwerk", "~> 2.6"
24
+ spec.extra_rdoc_files = ["README.md", "CHANGELOG.md", "LICENSE"]
28
25
 
29
- spec.add_development_dependency "rack-test", "~> 2.0"
30
- spec.add_development_dependency "rake", "~> 13"
31
- spec.add_development_dependency "rspec", "~> 3.9"
32
- spec.add_development_dependency "rubocop", "~> 1.0"
26
+ spec.metadata["allowed_push_host"] = "https://rubygems.org"
27
+ spec.metadata["changelog_uri"] = "https://github.com/hanami/hanami-controller/blob/main/CHANGELOG.md"
28
+ spec.metadata["source_code_uri"] = "https://github.com/hanami/hanami-controller"
29
+ spec.metadata["bug_tracker_uri"] = "https://github.com/hanami/hanami-controller/issues"
30
+ spec.metadata["funding_uri"] = "https://github.com/sponsors/hanami"
31
+
32
+ spec.required_ruby_version = ">= 3.2"
33
+
34
+ spec.add_runtime_dependency "rack", ">= 2.2.16"
35
+ spec.add_runtime_dependency "hanami-utils", "~> 2.3.0"
36
+ spec.add_runtime_dependency "dry-configurable", "~> 1.0", "< 2"
37
+ spec.add_runtime_dependency "dry-core", "~> 1.0"
38
+ spec.add_runtime_dependency "zeitwerk", "~> 2.6"
33
39
  end
40
+
@@ -86,7 +86,7 @@ module Hanami
86
86
 
87
87
  # @since 0.3.0
88
88
  # @api private
89
- def fresh? # rubocop:disable Naming/PredicateMethod
89
+ def fresh?
90
90
  yield if @validations.any?(&:fresh?)
91
91
  end
92
92
 
@@ -67,7 +67,7 @@ module Hanami
67
67
 
68
68
  # @since 2.0.0
69
69
  # @api private
70
- private def initialize_copy(original) # rubocop:disable Style/AccessModifierDeclarations
70
+ private def initialize_copy(original)
71
71
  super
72
72
  @accepted = original.accepted.dup
73
73
  @default = original.default
@@ -158,7 +158,7 @@ module Hanami
158
158
  if no_arg
159
159
  @next.merge!(@flash)
160
160
  else
161
- self[key] = self[key] # rubocop:disable Lint/SelfAssignment
161
+ self[key] = self[key]
162
162
  end
163
163
  end
164
164
 
@@ -8,7 +8,7 @@ require_relative "errors"
8
8
  module Hanami
9
9
  class Action
10
10
  # @api private
11
- module Mime # rubocop:disable Metrics/ModuleLength
11
+ module Mime
12
12
  # Most commom media types used for responses
13
13
  #
14
14
  # @since 1.0.0
@@ -48,7 +48,7 @@ module Hanami
48
48
 
49
49
  # @since 2.0.0
50
50
  # @api private
51
- def initialize(request:, config:, content_type: nil, env: {}, headers: {}, view_options: nil, session_enabled: false) # rubocop:disable Layout/LineLength, Metrics/ParameterLists
51
+ def initialize(request:, config:, content_type: nil, env: {}, headers: {}, view_options: nil, session_enabled: false) # rubocop:disable Layout/LineLength
52
52
  super([], 200, headers.dup)
53
53
  self.content_type = content_type if content_type
54
54
 
data/lib/hanami/action.rb CHANGED
@@ -7,11 +7,11 @@ require "hanami/utils/kernel"
7
7
  require "hanami/utils/string"
8
8
  require "rack"
9
9
  require "rack/utils"
10
- require "hanami/action/rack_utils"
11
10
  require "zeitwerk"
12
11
 
13
12
  require_relative "action/constants"
14
13
  require_relative "action/errors"
14
+ require_relative "action/rack_utils"
15
15
 
16
16
  module Hanami
17
17
  # An HTTP endpoint
@@ -40,7 +40,7 @@ module Hanami
40
40
  loader.ignore(
41
41
  "#{root}/hanami-controller.rb",
42
42
  "#{root}/hanami/controller/version.rb",
43
- "#{root}/hanami/action/{constants,errors,validatable}.rb"
43
+ "#{root}/hanami/action/{constants,errors,rack_utils,validatable}.rb"
44
44
  )
45
45
  loader.inflector.inflect("csrf_protection" => "CSRFProtection")
46
46
  end
@@ -8,6 +8,6 @@ module Hanami
8
8
  #
9
9
  # @since 0.1.0
10
10
  # @api public
11
- VERSION = "2.3.1"
11
+ VERSION = "2.3.2"
12
12
  end
13
13
  end
metadata CHANGED
@@ -1,11 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hanami-controller
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.1
4
+ version: 2.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hanakai team
8
- bindir: bin
8
+ bindir: exe
9
9
  cert_chain: []
10
10
  date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
@@ -15,14 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - ">="
17
17
  - !ruby/object:Gem::Version
18
- version: '2.1'
18
+ version: 2.2.16
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - ">="
24
24
  - !ruby/object:Gem::Version
25
- version: '2.1'
25
+ version: 2.2.16
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: hanami-utils
28
28
  requirement: !ruby/object:Gem::Requirement
@@ -85,71 +85,18 @@ dependencies:
85
85
  - - "~>"
86
86
  - !ruby/object:Gem::Version
87
87
  version: '2.6'
88
- - !ruby/object:Gem::Dependency
89
- name: rack-test
90
- requirement: !ruby/object:Gem::Requirement
91
- requirements:
92
- - - "~>"
93
- - !ruby/object:Gem::Version
94
- version: '2.0'
95
- type: :development
96
- prerelease: false
97
- version_requirements: !ruby/object:Gem::Requirement
98
- requirements:
99
- - - "~>"
100
- - !ruby/object:Gem::Version
101
- version: '2.0'
102
- - !ruby/object:Gem::Dependency
103
- name: rake
104
- requirement: !ruby/object:Gem::Requirement
105
- requirements:
106
- - - "~>"
107
- - !ruby/object:Gem::Version
108
- version: '13'
109
- type: :development
110
- prerelease: false
111
- version_requirements: !ruby/object:Gem::Requirement
112
- requirements:
113
- - - "~>"
114
- - !ruby/object:Gem::Version
115
- version: '13'
116
- - !ruby/object:Gem::Dependency
117
- name: rspec
118
- requirement: !ruby/object:Gem::Requirement
119
- requirements:
120
- - - "~>"
121
- - !ruby/object:Gem::Version
122
- version: '3.9'
123
- type: :development
124
- prerelease: false
125
- version_requirements: !ruby/object:Gem::Requirement
126
- requirements:
127
- - - "~>"
128
- - !ruby/object:Gem::Version
129
- version: '3.9'
130
- - !ruby/object:Gem::Dependency
131
- name: rubocop
132
- requirement: !ruby/object:Gem::Requirement
133
- requirements:
134
- - - "~>"
135
- - !ruby/object:Gem::Version
136
- version: '1.0'
137
- type: :development
138
- prerelease: false
139
- version_requirements: !ruby/object:Gem::Requirement
140
- requirements:
141
- - - "~>"
142
- - !ruby/object:Gem::Version
143
- version: '1.0'
144
- description: Complete, fast and testable actions for Rack
88
+ description: Complete, fast and testable actions for Rack and Hanami
145
89
  email:
146
90
  - info@hanakai.org
147
91
  executables: []
148
92
  extensions: []
149
- extra_rdoc_files: []
93
+ extra_rdoc_files:
94
+ - CHANGELOG.md
95
+ - LICENSE
96
+ - README.md
150
97
  files:
151
98
  - CHANGELOG.md
152
- - LICENSE.md
99
+ - LICENSE
153
100
  - README.md
154
101
  - hanami-controller.gemspec
155
102
  - lib/hanami-controller.rb
@@ -182,11 +129,15 @@ files:
182
129
  - lib/hanami/controller.rb
183
130
  - lib/hanami/controller/version.rb
184
131
  - lib/hanami/http/status.rb
185
- homepage: http://hanamirb.org
132
+ homepage: https://hanamirb.org
186
133
  licenses:
187
134
  - MIT
188
135
  metadata:
189
- rubygems_mfa_required: 'true'
136
+ allowed_push_host: https://rubygems.org
137
+ changelog_uri: https://github.com/hanami/hanami-controller/blob/main/CHANGELOG.md
138
+ source_code_uri: https://github.com/hanami/hanami-controller
139
+ bug_tracker_uri: https://github.com/hanami/hanami-controller/issues
140
+ funding_uri: https://github.com/sponsors/hanami
190
141
  rdoc_options: []
191
142
  require_paths:
192
143
  - lib
data/LICENSE.md DELETED
@@ -1,22 +0,0 @@
1
- Copyright © 2014 Hanami Team
2
-
3
- MIT License
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- "Software"), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.