sleeping_king_studios-tools 1.1.0.rc.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8e06daa0cd40dd75a70bd47807132708527dbee294dc0abef34d870180ca3e66
4
- data.tar.gz: 4ee981bc8dd164c52d399cbf73f14b07b2ccc027759e894a12502b3d7f7347fc
3
+ metadata.gz: 1dd9156b88b3c8b653f2b7a6f37321fee99f0f482ae0bfb79d0ee1c0679e09f6
4
+ data.tar.gz: e5e398fc406be87504dba6b55cba7e2e97d5712a232c9ac094c5bfbd0a8904a9
5
5
  SHA512:
6
- metadata.gz: 8be13ff1e4b825a1f449d0b4f073336a3b86b9616f2abd2dd196eb33f5d169ab7e1bf7611a036794a1b4991a363a5b438c1145aec6a741cea4a9fec5481465ca
7
- data.tar.gz: 717bbc4c705590b75786933480570c7dd55b792a17616888bc10c4eb459bb99b7c78b2d285dba83125774cf2a40beca54151eada287dbfc69ccbf074f666170c
6
+ metadata.gz: e716bab1aed4107cd5bd5ed501786f41ee6733aff280bfd2f4817e7f394edb834fe8aa0cfda73b73dc5a59ac1ac51631c56cdad1a7737607adef79c7c4555789
7
+ data.tar.gz: 18f416503f480b2115d5c45497f149ba5e5ca54bc559edb4e01be3d0d460dc6eeff6987abc72ea594674527e1781bae8547344cc37dbf072dbdaccc2e02924e1
data/CHANGELOG.md CHANGED
@@ -1,10 +1,14 @@
1
1
  # Changelog
2
2
 
3
- ### 1.1.0
3
+ ## 1.1.1
4
+
5
+ Fixed support for keyword parameters in `ObjectTools#apply` in Ruby 3.2.
6
+
7
+ ## 1.1.0
4
8
 
5
9
  Files in the `Toolbox` are now autoloaded.
6
10
 
7
- #### Tools
11
+ ### Tools
8
12
 
9
13
  Implemented `SleepingKingStudios::Tools::Assertions` with the following methods:
10
14
 
@@ -19,32 +23,32 @@ Each method raises an exception if its condition is not met. `Assertions` also d
19
23
 
20
24
  Added :deprecation_caller_depth option to CoreTools. When calling #deprecate with the default strategy of 'warn', will print the specified number of lines from the caller. The default value is 3.
21
25
 
22
- #### Toolbelt
26
+ ### Toolbelt
23
27
 
24
28
  - Added `#assertions` to Toolbelt.
25
29
 
26
- #### Toolbox
30
+ ### Toolbox
27
31
 
28
32
  Implemented `SleepingKingStudios::Tools::Toolbox::Subclass`, which implements partial application for constructor parameters.
29
33
 
30
- ### 1.0.2
34
+ ## 1.0.2
31
35
 
32
36
  Updated gem metadata.
33
37
 
34
- ### 1.0.1
38
+ ## 1.0.1
35
39
 
36
40
  Added a missing `require 'set'` to Toolbox::Inflector::Rules.
37
41
 
38
- ### 1.0.0
42
+ ## 1.0.0
39
43
 
40
44
  Removed all deprecated code from pre-1.0 releases.
41
45
 
42
- #### Toolbox
46
+ ### Toolbox
43
47
 
44
48
  Added some Hash-like methods to ConstantMap - `#each_key`, `#each_value`,
45
49
  `#keys`, `#to_h`, and `#values`.
46
50
 
47
- ### 0.8.0
51
+ ## 0.8.0
48
52
 
49
53
  Last minor release before 1.0.0.
50
54
 
@@ -55,14 +59,14 @@ in version 1.0.0. Update dependent code accordingly.
55
59
  functionality is still available as
56
60
  SleepingKingStudios::Tools::Toolbox::SemanticVersion.
57
61
 
58
- #### Tools
62
+ ### Tools
59
63
 
60
64
  - Refactored all Tools modules to classes.
61
65
  - Removed StringTools::PluralInflector. It's functionality is now handled by
62
66
  Toolbox::Inflector.
63
67
  - Added support for deprecation strategy to CoreTools#deprecate.
64
68
 
65
- #### Toolbelt
69
+ ### Toolbelt
66
70
 
67
71
  - Refactored Toolbelt to reference Tools instances rather than classes.
68
72
  - Defined new abbreviated helpers #ary, #hsh, #int, #obj, #str.
@@ -71,36 +75,36 @@ in version 1.0.0. Update dependent code accordingly.
71
75
  - Deprecated old abbreviated helpers #array, #core, #hash, #integer, #object,
72
76
  #string.
73
77
 
74
- #### Toolbox
78
+ ### Toolbox
75
79
 
76
80
  - Deprecate Toolbox::Configuration. Use a struct instead.
77
81
  - Deprecate Toolbox::Delegator. Use the stdlib Forwardable module instead.
78
82
  - Implement Toolbox::Inflector, which serves as a delegate for StringTools.
79
83
 
80
- ### 0.7.1
84
+ ## 0.7.1
81
85
 
82
86
  - Implement CoreTools#empty_binding.
83
87
  - Implement HashTools#generate_binding.
84
88
 
85
- ### 0.7.0
89
+ ## 0.7.0
86
90
 
87
- #### Tools
91
+ ### Tools
88
92
 
89
93
  - Support symbol arguments to StringTools methods.
90
94
  - Implement StringTools#chain.
91
95
  - Implement StringTools#indent.
92
96
  - Implement StringTools#map_lines.
93
97
 
94
- #### Toolbox
98
+ ### Toolbox
95
99
 
96
100
  - Implement Toolbox::Configuration.
97
101
 
98
- #### Misc.
102
+ ### Misc.
99
103
 
100
104
  - IntegerTools#pluralize now accepts 2..3 arguments, and will automatically generate the plural string using StringTools#pluralize if an explicit plural is not given.
101
105
  - SleepingKingStudios::Tools::Toolbelt is now autoloaded from SleepingKingStudios::Tools.
102
106
 
103
- ### 0.6.0
107
+ ## 0.6.0
104
108
 
105
109
  - Implement HashTools#convert_keys_to_strings and #convert_keys_to_symbols.
106
110
  - Implement ObjectTools#dig.
@@ -110,69 +114,67 @@ in version 1.0.0. Update dependent code accordingly.
110
114
  - Implement Toolbox::Mixin.
111
115
  - Add support for Ruby 2.4.0.
112
116
 
113
- ### 0.5.0
117
+ ## 0.5.0
114
118
 
115
119
  - Implement CoreTools#require_each.
116
120
  - Implement StringTools#camelize.
117
121
  - Add an optional block argument to ArrayTools#humanize_list.
118
122
 
119
- #### Toolbox
123
+ ### Toolbox
120
124
 
121
125
  - Implement Delegator#delegate, Delegator#wrap_delegate.
122
126
  - Refactor SemanticVersion to the Toolbox namespace. Accessing SemanticVersion as Tools::SemanticVersion is now deprecated, use Tools::Toolbox::SemanticVersion.
123
127
 
124
- #### Identity Methods
128
+ ### Identity Methods
125
129
 
126
130
  - Implement a set of methods to classify objects by type: ArrayTools#array?, HashTools#hash?, IntegerTools#integer?, ObjectTools#object?, and StringTools#string?.
127
131
 
128
- #### Mutability Methods
132
+ ### Mutability Methods
129
133
 
130
134
  Implement #immutable? and #mutable? for ObjectTools, ArrayTools, and HashTools, which indicate whether or not a given object is mutable.
131
135
 
132
136
  Implement #deep_freeze for ObjectTools, ArrayTools, and HashTools which recursively freezes the object and any children (array items, hash keys, and hash values).
133
137
 
134
- ## Previous Releases
135
-
136
- ### 0.4.0
138
+ ## 0.4.0
137
139
 
138
- #### CoreTools
140
+ ### CoreTools
139
141
 
140
142
  Implement CoreTools#deprecate.
141
143
 
142
- #### IntegerTools
144
+ ### IntegerTools
143
145
 
144
146
  Implement #pluralize.
145
147
 
146
- #### StringTools
148
+ ### StringTools
147
149
 
148
150
  Implement #pluralize and #singularize. The previous behavior of #pluralize is deprecated; use IntegerTools#pluralize.
149
151
 
150
- ### 0.3.0
152
+ ## 0.3.0
151
153
 
152
154
  Implement ArrayTools#bisect and ArrayTools#splice.
153
155
 
154
- #### StringTools
156
+ ### StringTools
155
157
 
156
158
  Implement #underscore.
157
159
 
158
- ### 0.2.0
160
+ ## 0.2.0
159
161
 
160
162
  Split EnumerableTools into ArrayTools and HashTools.
161
163
 
162
164
  Implement ArrayTools#deep_dup, HashTools#deep_dup and ObjectTools#deep_dup.
163
165
 
164
- ### 0.1.3
166
+ ## 0.1.3
165
167
 
166
168
  Properly support both keywords and optional arguments in ObjectTools#apply.
167
169
 
168
- ### 0.1.2
170
+ ## 0.1.2
169
171
 
170
172
  Fix loading order issues when loading SemanticVersion in isolation.
171
173
 
172
- ### 0.1.1
174
+ ## 0.1.1
173
175
 
174
176
  Add configuration options to EnumerableTools#humanize_list.
175
177
 
176
- ### 0.1.0
178
+ ## 0.1.0
177
179
 
178
180
  Initial release.
data/README.md CHANGED
@@ -4,7 +4,7 @@ A library of utility services and concerns to expand the functionality of core c
4
4
 
5
5
  ## About
6
6
 
7
- SleepingKingStudios::Tools is tested against MRI Ruby 2.6 through 3.1.
7
+ SleepingKingStudios::Tools is tested against MRI Ruby 2.7 through 3.2.
8
8
 
9
9
  ### Documentation
10
10
 
@@ -177,8 +177,8 @@ module SleepingKingStudios::Tools
177
177
  return if (ROMANIZE_MIN..ROMANIZE_MAX).include?(integer)
178
178
 
179
179
  error_message =
180
- "integer to romanize must be within range #{ROMANIZE_MIN} to" \
181
- " #{ROMANIZE_MAX}"
180
+ "integer to romanize must be within range #{ROMANIZE_MIN} to " \
181
+ "#{ROMANIZE_MAX}"
182
182
 
183
183
  raise RangeError, error_message, caller(1..-1)
184
184
  end
@@ -29,21 +29,23 @@ module SleepingKingStudios::Tools
29
29
  # @param [Object] receiver The receiver. The proc will be called in the
30
30
  # context of this object.
31
31
  # @param [Proc] proc The proc or lambda to call.
32
- # @param [Array] args Optional. Additional arguments to pass in to the
33
- # proc or lambda.
32
+ # @param [Array] args Optional. Additional arguments to pass in to the proc
33
+ # or lambda.
34
+ # @param [Hash] kwargs Optional. Additional keywords to pass in to the proc
35
+ # or lambda.
34
36
  # @param [block] block Optional. If present, will be passed in to proc or
35
37
  # lambda.
36
38
  #
37
39
  # @return The result of calling the proc or lambda with the given
38
40
  # receiver and any additional arguments or block.
39
- def apply(receiver, proc, *args, &block)
40
- return receiver.instance_exec(*args, &proc) unless block_given?
41
+ def apply(receiver, proc, *args, **kwargs, &block)
42
+ return receiver.instance_exec(*args, **kwargs, &proc) unless block_given?
41
43
 
42
44
  method_name =
43
45
  Kernel.format(TEMPORARY_METHOD_NAME, Thread.current.object_id)
44
46
 
45
47
  with_temporary_method(receiver, method_name, proc) do
46
- receiver.send(method_name, *args, &block)
48
+ receiver.send(method_name, *args, **kwargs, &block)
47
49
  end
48
50
  end
49
51
 
@@ -15,11 +15,11 @@ module SleepingKingStudios
15
15
  # Minor version.
16
16
  MINOR = 1
17
17
  # Patch version.
18
- PATCH = 0
18
+ PATCH = 1
19
19
  # Prerelease version.
20
- PRERELEASE = :rc
20
+ PRERELEASE = nil
21
21
  # Build metadata.
22
- BUILD = 0
22
+ BUILD = nil
23
23
  end
24
24
 
25
25
  # The current version of the gem.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sleeping_king_studios-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0.rc.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rob "Merlin" Smith
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-25 00:00:00.000000000 Z
11
+ date: 2022-12-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '1.29'
61
+ version: '1.35'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '1.29'
68
+ version: '1.35'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rubocop-rake
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '2.10'
89
+ version: '2.12'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '2.10'
96
+ version: '2.12'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: simplecov
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -186,11 +186,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
186
186
  version: 2.7.0
187
187
  required_rubygems_version: !ruby/object:Gem::Requirement
188
188
  requirements:
189
- - - ">"
189
+ - - ">="
190
190
  - !ruby/object:Gem::Version
191
- version: 1.3.1
191
+ version: '0'
192
192
  requirements: []
193
- rubygems_version: 3.2.3
193
+ rubygems_version: 3.4.1
194
194
  signing_key:
195
195
  specification_version: 4
196
196
  summary: A library of utility services and concerns.