hanami-utils 2.3.0.beta2 → 3.0.0.rc1

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,27 +1,17 @@
1
- # Hanami::Utils
1
+ <!--- This file is synced from hanakai-rb/repo-sync -->
2
2
 
3
- Ruby core extensions and class utilities for [Hanami](http://hanamirb.org)
3
+ [actions]: https://github.com/hanami/hanami-utils/actions
4
+ [chat]: https://discord.gg/naQApPAsZB
5
+ [forum]: https://discourse.hanamirb.org
6
+ [rubygem]: https://rubygems.org/gems/hanami-utils
4
7
 
5
- ## Status
6
-
7
- [![Gem Version](https://badge.fury.io/rb/hanami-utils.svg)](https://badge.fury.io/rb/hanami-utils)
8
- [![CI](https://github.com/hanami/utils/actions/workflows/ci.yml/badge.svg)](https://github.com/hanami/utils/actions?query=workflow%3Aci+branch%3Amain)
9
- [![Test Coverage](https://codecov.io/gh/hanami/utils/branch/main/graph/badge.svg)](https://codecov.io/gh/hanami/utils)
10
- [![Depfu](https://badges.depfu.com/badges/a8545fb67cf32a2c75b6227bc0821027/overview.svg)](https://depfu.com/github/hanami/utils?project=Bundler)
11
-
12
- ## Contact
13
-
14
- - Home page: http://hanamirb.org
15
- - Mailing List: http://hanamirb.org/mailing-list
16
- - API Doc: http://rubydoc.info/gems/hanami-utils
17
- - Bugs/Issues: https://github.com/hanami/utils/issues
18
- - Chat: http://chat.hanamirb.org
8
+ # Hanami Utils [![Gem Version](https://badge.fury.io/rb/hanami-utils.svg)][rubygem] [![CI Status](https://github.com/hanami/hanami-utils/workflows/CI/badge.svg)][actions]
19
9
 
10
+ [![Forum](https://img.shields.io/badge/Forum-dc360f?logo=discourse&logoColor=white)][forum]
11
+ [![Chat](https://img.shields.io/badge/Chat-717cf8?logo=discord&logoColor=white)][chat]
20
12
 
21
13
  ## Installation
22
14
 
23
- **Hanami::Utils** supports Ruby (MRI) 3.1+.
24
-
25
15
  Add this line to your application's Gemfile:
26
16
 
27
17
  ```ruby
@@ -107,10 +97,6 @@ Shell colorizer [[API doc](http://www.rubydoc.info/gems/hanami-utils/Hanami/Util
107
97
 
108
98
  Enhanced version of Ruby's `String`. [[API doc](http://www.rubydoc.info/gems/hanami-utils/Hanami/Utils/String)]
109
99
 
110
- ## Versioning
111
-
112
- **Hanami::Utils** uses [Semantic Versioning 2.0.0](http://semver.org)
113
-
114
100
  ## Contributing
115
101
 
116
102
  1. Fork it ( https://github.com/hanami/utils/fork )
@@ -119,6 +105,13 @@ Enhanced version of Ruby's `String`. [[API doc](http://www.rubydoc.info/gems/han
119
105
  4. Push to the branch (`git push origin my-new-feature`)
120
106
  5. Create new Pull Request
121
107
 
122
- ## Copyright
108
+ ## Links
109
+
110
+ - [User documentation](https://hanamirb.org)
111
+ - [API documentation](http://rubydoc.info/gems/hanami-utils)
112
+
113
+
114
+ ## License
115
+
116
+ See `LICENSE` file.
123
117
 
124
- Copyright © 2014–2024 Hanami Team – Released under MIT License
data/hanami-utils.gemspec CHANGED
@@ -1,32 +1,38 @@
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/utils/version"
6
8
 
7
9
  Gem::Specification.new do |spec|
8
10
  spec.name = "hanami-utils"
9
- spec.version = Hanami::Utils::VERSION
10
- spec.authors = ["Luca Guidi"]
11
- spec.email = ["me@lucaguidi.com"]
12
- spec.description = "Hanami utilities"
13
- spec.summary = "Ruby core extentions and Hanami utilities"
14
- spec.homepage = "http://hanamirb.org"
11
+ spec.authors = ["Hanakai team"]
12
+ spec.email = ["info@hanakai.org"]
15
13
  spec.license = "MIT"
14
+ spec.version = Hanami::Utils::VERSION.dup
16
15
 
17
- spec.files = `git ls-files -- lib/* CHANGELOG.md LICENSE.md README.md hanami-utils.gemspec`.split($/)
18
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
16
+ spec.summary = "Ruby core extentions and Hanami utilities"
17
+ spec.description = spec.summary
18
+ spec.homepage = "https://hanamirb.org"
19
+ spec.files = Dir["CHANGELOG.md", "LICENSE", "README.md", "hanami-utils.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
- spec.add_dependency "dry-core", "~> 1.0", "< 2"
24
- spec.add_dependency "dry-transformer", "~> 1.0", "< 2"
25
- spec.add_dependency "concurrent-ruby", "~> 1.0"
26
- spec.add_dependency "bigdecimal", "~> 3.1"
27
-
28
- spec.add_development_dependency "bundler", ">= 1.6", "< 3"
29
- spec.add_development_dependency "rake", "~> 13"
30
- spec.add_development_dependency "rspec", "~> 3.9"
31
- spec.add_development_dependency "rubocop", "~> 1.0"
23
+
24
+ spec.extra_rdoc_files = ["README.md", "CHANGELOG.md", "LICENSE"]
25
+
26
+ spec.metadata["changelog_uri"] = "https://github.com/hanami/hanami-utils/blob/main/CHANGELOG.md"
27
+ spec.metadata["source_code_uri"] = "https://github.com/hanami/hanami-utils"
28
+ spec.metadata["bug_tracker_uri"] = "https://github.com/hanami/hanami-utils/issues"
29
+ spec.metadata["funding_uri"] = "https://github.com/sponsors/hanami"
30
+
31
+ spec.required_ruby_version = ">= 3.3"
32
+
33
+ spec.add_runtime_dependency "dry-core", "~> 1.0", "< 2"
34
+ spec.add_runtime_dependency "dry-transformer", "~> 1.0", "< 2"
35
+ spec.add_runtime_dependency "concurrent-ruby", "~> 1.0"
36
+ spec.add_runtime_dependency "bigdecimal", "~> 3.1"
32
37
  end
38
+
@@ -67,7 +67,11 @@ module Hanami
67
67
 
68
68
  # @api private
69
69
  def caller_index
70
- Utils.jruby? || Utils.rubinius? ? 1 : 2
70
+ if RUBY_VERSION >= "4.0" && RUBY_ENGINE != "jruby"
71
+ 1
72
+ else
73
+ 2
74
+ end
71
75
  end
72
76
  end
73
77
  end
@@ -9,7 +9,7 @@ module Hanami
9
9
  # Files utilities
10
10
  #
11
11
  # @since 1.1.0
12
- module Files # rubocop:disable Metrics/ModuleLength
12
+ module Files
13
13
  # Creates an empty file for the given path.
14
14
  # All the intermediate directories are created.
15
15
  # If the path already exists, it doesn't change the contents
@@ -21,7 +21,7 @@ module Hanami
21
21
  module Utils
22
22
  # Kernel utilities
23
23
  # @since 0.1.1
24
- module Kernel # rubocop:disable Metrics/ModuleLength
24
+ module Kernel
25
25
  # Matcher for numeric values
26
26
  #
27
27
  # @since 0.3.3
@@ -1015,7 +1015,7 @@ module Hanami
1015
1015
  case arg
1016
1016
  when "" then raise TypeError.new "can't convert #{inspect_type_error(arg)}into Symbol"
1017
1017
  when ->(a) { a.respond_to?(:to_sym) } then arg.to_sym
1018
- else # rubocop:disable Lint/DuplicateBranch
1018
+ else
1019
1019
  raise TypeError.new "can't convert #{inspect_type_error(arg)}into Symbol"
1020
1020
  end
1021
1021
  rescue NoMethodError
@@ -4,8 +4,7 @@ module Hanami
4
4
  module Utils
5
5
  # The current hanami-utils version.
6
6
  #
7
- # @since 0.1.0
8
7
  # @api public
9
- VERSION = "2.3.0.beta2"
8
+ VERSION = "3.0.0.rc1"
10
9
  end
11
10
  end
metadata CHANGED
@@ -1,11 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hanami-utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0.beta2
4
+ version: 3.0.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
- - Luca Guidi
8
- bindir: bin
7
+ - Hanakai team
8
+ bindir: exe
9
9
  cert_chain: []
10
10
  date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
@@ -77,77 +77,18 @@ dependencies:
77
77
  - - "~>"
78
78
  - !ruby/object:Gem::Version
79
79
  version: '3.1'
80
- - !ruby/object:Gem::Dependency
81
- name: bundler
82
- requirement: !ruby/object:Gem::Requirement
83
- requirements:
84
- - - ">="
85
- - !ruby/object:Gem::Version
86
- version: '1.6'
87
- - - "<"
88
- - !ruby/object:Gem::Version
89
- version: '3'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- version: '1.6'
97
- - - "<"
98
- - !ruby/object:Gem::Version
99
- version: '3'
100
- - !ruby/object:Gem::Dependency
101
- name: rake
102
- requirement: !ruby/object:Gem::Requirement
103
- requirements:
104
- - - "~>"
105
- - !ruby/object:Gem::Version
106
- version: '13'
107
- type: :development
108
- prerelease: false
109
- version_requirements: !ruby/object:Gem::Requirement
110
- requirements:
111
- - - "~>"
112
- - !ruby/object:Gem::Version
113
- version: '13'
114
- - !ruby/object:Gem::Dependency
115
- name: rspec
116
- requirement: !ruby/object:Gem::Requirement
117
- requirements:
118
- - - "~>"
119
- - !ruby/object:Gem::Version
120
- version: '3.9'
121
- type: :development
122
- prerelease: false
123
- version_requirements: !ruby/object:Gem::Requirement
124
- requirements:
125
- - - "~>"
126
- - !ruby/object:Gem::Version
127
- version: '3.9'
128
- - !ruby/object:Gem::Dependency
129
- name: rubocop
130
- requirement: !ruby/object:Gem::Requirement
131
- requirements:
132
- - - "~>"
133
- - !ruby/object:Gem::Version
134
- version: '1.0'
135
- type: :development
136
- prerelease: false
137
- version_requirements: !ruby/object:Gem::Requirement
138
- requirements:
139
- - - "~>"
140
- - !ruby/object:Gem::Version
141
- version: '1.0'
142
- description: Hanami utilities
80
+ description: Ruby core extentions and Hanami utilities
143
81
  email:
144
- - me@lucaguidi.com
82
+ - info@hanakai.org
145
83
  executables: []
146
84
  extensions: []
147
- extra_rdoc_files: []
85
+ extra_rdoc_files:
86
+ - CHANGELOG.md
87
+ - LICENSE
88
+ - README.md
148
89
  files:
149
90
  - CHANGELOG.md
150
- - LICENSE.md
91
+ - LICENSE
151
92
  - README.md
152
93
  - hanami-utils.gemspec
153
94
  - lib/hanami-utils.rb
@@ -171,11 +112,14 @@ files:
171
112
  - lib/hanami/utils/shell_color.rb
172
113
  - lib/hanami/utils/string.rb
173
114
  - lib/hanami/utils/version.rb
174
- homepage: http://hanamirb.org
115
+ homepage: https://hanamirb.org
175
116
  licenses:
176
117
  - MIT
177
118
  metadata:
178
- rubygems_mfa_required: 'true'
119
+ changelog_uri: https://github.com/hanami/hanami-utils/blob/main/CHANGELOG.md
120
+ source_code_uri: https://github.com/hanami/hanami-utils
121
+ bug_tracker_uri: https://github.com/hanami/hanami-utils/issues
122
+ funding_uri: https://github.com/sponsors/hanami
179
123
  rdoc_options: []
180
124
  require_paths:
181
125
  - lib
@@ -183,7 +127,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
183
127
  requirements:
184
128
  - - ">="
185
129
  - !ruby/object:Gem::Version
186
- version: '3.2'
130
+ version: '3.3'
187
131
  required_rubygems_version: !ruby/object:Gem::Requirement
188
132
  requirements:
189
133
  - - ">="
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.