hanami-utils 2.0.0.alpha2 → 2.0.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +163 -4
- data/README.md +16 -22
- data/hanami-utils.gemspec +3 -3
- data/lib/hanami/logger.rb +2 -0
- data/lib/hanami/utils/blank.rb +1 -1
- data/lib/hanami/utils/class.rb +1 -1
- data/lib/hanami/utils/class_attribute.rb +7 -7
- data/lib/hanami/utils/kernel.rb +3 -3
- data/lib/hanami/utils/string.rb +1 -1
- data/lib/hanami/utils/version.rb +1 -1
- metadata +10 -11
- data/lib/hanami/interactor.rb +0 -651
- data/lib/hanami/utils/basic_object.rb +0 -144
data/lib/hanami/utils/class.rb
CHANGED
@@ -75,13 +75,13 @@ module Hanami
|
|
75
75
|
def class_attribute(*attributes)
|
76
76
|
attributes.each do |attr|
|
77
77
|
singleton_class.class_eval %(
|
78
|
-
def #{attr}
|
79
|
-
class_attributes[:#{attr}]
|
80
|
-
end
|
81
|
-
|
82
|
-
def #{attr}=(value)
|
83
|
-
class_attributes[:#{attr}] = value
|
84
|
-
end
|
78
|
+
def #{attr} # def foo
|
79
|
+
class_attributes[:#{attr}] # class_attributes[:foo]
|
80
|
+
end # end
|
81
|
+
#
|
82
|
+
def #{attr}=(value) # def foo=(value)
|
83
|
+
class_attributes[:#{attr}] = value # class_attributes[:foo] = value
|
84
|
+
end # end
|
85
85
|
), __FILE__, __LINE__ - 8
|
86
86
|
end
|
87
87
|
end
|
data/lib/hanami/utils/kernel.rb
CHANGED
@@ -28,7 +28,7 @@ module Hanami
|
|
28
28
|
# @api private
|
29
29
|
#
|
30
30
|
# @see Hanami::Utils::Kernel.Integer
|
31
|
-
NUMERIC_MATCHER = %r{\A([\d/.+iE]+|NaN|Infinity)\z}
|
31
|
+
NUMERIC_MATCHER = %r{\A([\d/.+iE]+|NaN|Infinity)\z}
|
32
32
|
|
33
33
|
# @since 0.8.0
|
34
34
|
# @api private
|
@@ -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
|
1018
|
+
else # rubocop:disable Lint/DuplicateBranch
|
1019
1019
|
raise TypeError.new "can't convert #{inspect_type_error(arg)}into Symbol"
|
1020
1020
|
end
|
1021
1021
|
rescue NoMethodError
|
@@ -1043,7 +1043,7 @@ module Hanami
|
|
1043
1043
|
# @since 0.4.3
|
1044
1044
|
# @api private
|
1045
1045
|
def self.inspect_type_error(arg)
|
1046
|
-
"#{
|
1046
|
+
"#{arg.respond_to?(:inspect) ? arg.inspect : arg.to_s} "
|
1047
1047
|
rescue NoMethodError
|
1048
1048
|
# missing the #respond_to? method, fall back to returning the class' name
|
1049
1049
|
begin
|
data/lib/hanami/utils/string.rb
CHANGED
@@ -61,7 +61,7 @@ module Hanami
|
|
61
61
|
#
|
62
62
|
# @since 0.3.4
|
63
63
|
# @api private
|
64
|
-
CLASSIFY_WORD_SEPARATOR = /#{CLASSIFY_SEPARATOR}|#{NAMESPACE_SEPARATOR}|#{UNDERSCORE_SEPARATOR}|#{DASHERIZE_SEPARATOR}
|
64
|
+
CLASSIFY_WORD_SEPARATOR = /#{CLASSIFY_SEPARATOR}|#{NAMESPACE_SEPARATOR}|#{UNDERSCORE_SEPARATOR}|#{DASHERIZE_SEPARATOR}/ # rubocop:disable Layout/LineLength
|
65
65
|
|
66
66
|
@__transformations__ = Concurrent::Map.new
|
67
67
|
|
data/lib/hanami/utils/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hanami-utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0.
|
4
|
+
version: 2.0.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:
|
11
|
+
date: 2022-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-transformer
|
@@ -90,16 +90,16 @@ dependencies:
|
|
90
90
|
name: rubocop
|
91
91
|
requirement: !ruby/object:Gem::Requirement
|
92
92
|
requirements:
|
93
|
-
- -
|
93
|
+
- - "~>"
|
94
94
|
- !ruby/object:Gem::Version
|
95
|
-
version: '0
|
95
|
+
version: '1.0'
|
96
96
|
type: :development
|
97
97
|
prerelease: false
|
98
98
|
version_requirements: !ruby/object:Gem::Requirement
|
99
99
|
requirements:
|
100
|
-
- -
|
100
|
+
- - "~>"
|
101
101
|
- !ruby/object:Gem::Version
|
102
|
-
version: '0
|
102
|
+
version: '1.0'
|
103
103
|
description: Hanami utilities
|
104
104
|
email:
|
105
105
|
- me@lucaguidi.com
|
@@ -112,14 +112,12 @@ files:
|
|
112
112
|
- README.md
|
113
113
|
- hanami-utils.gemspec
|
114
114
|
- lib/hanami-utils.rb
|
115
|
-
- lib/hanami/interactor.rb
|
116
115
|
- lib/hanami/logger.rb
|
117
116
|
- lib/hanami/logger/colorizer.rb
|
118
117
|
- lib/hanami/logger/filter.rb
|
119
118
|
- lib/hanami/logger/formatter.rb
|
120
119
|
- lib/hanami/middleware.rb
|
121
120
|
- lib/hanami/utils.rb
|
122
|
-
- lib/hanami/utils/basic_object.rb
|
123
121
|
- lib/hanami/utils/blank.rb
|
124
122
|
- lib/hanami/utils/callbacks.rb
|
125
123
|
- lib/hanami/utils/class.rb
|
@@ -142,7 +140,8 @@ files:
|
|
142
140
|
homepage: http://hanamirb.org
|
143
141
|
licenses:
|
144
142
|
- MIT
|
145
|
-
metadata:
|
143
|
+
metadata:
|
144
|
+
rubygems_mfa_required: 'true'
|
146
145
|
post_install_message:
|
147
146
|
rdoc_options: []
|
148
147
|
require_paths:
|
@@ -151,14 +150,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
151
150
|
requirements:
|
152
151
|
- - ">="
|
153
152
|
- !ruby/object:Gem::Version
|
154
|
-
version:
|
153
|
+
version: '3.0'
|
155
154
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
156
155
|
requirements:
|
157
156
|
- - ">"
|
158
157
|
- !ruby/object:Gem::Version
|
159
158
|
version: 1.3.1
|
160
159
|
requirements: []
|
161
|
-
rubygems_version: 3.
|
160
|
+
rubygems_version: 3.3.3
|
162
161
|
signing_key:
|
163
162
|
specification_version: 4
|
164
163
|
summary: Ruby core extentions and Hanami utilities
|