refinements 6.2.1 → 6.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +4 -4
- data.tar.gz.sig +0 -0
- data/lib/refinements/hashes.rb +3 -2
- data/lib/refinements/identity.rb +1 -1
- data/lib/refinements/strings.rb +10 -7
- metadata +14 -14
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d5ba775099d5db3e1c9d5cc47aa06412cc0adeddfbfc52f6cf8862f13af7441a
|
4
|
+
data.tar.gz: 3ee7c50aa7c658d0eab3dba89079bfe34c1b8c36935a5747248956fc27444e5e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 24d00666e8499824b2434a49b145811f9b227c7990c1dd83dcacb369869636b445564d14027893a7ed8b4c661619101bfa285985a2916757ffbfa6115b0f9b74
|
7
|
+
data.tar.gz: 3ef9f9fc3b89754eca711a5152bbef5ac2bc5cbc5ad320d147f6585f699df6ff097e718f7de5ca498b0e269b2b686b1bc18f8f7a94c162504cff0ba8252cbe4d
|
checksums.yaml.gz.sig
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
p
|
2
|
-
|
3
|
-
|
4
|
-
��
|
1
|
+
O'�la-U�2e��p�<��%1
|
2
|
+
(La����}<�����g<}&6 �wb�`WĦH��w��>�4�(����|����l2���ǹ��ٓ��݁3��
|
3
|
+
�'U���#;(�Jݒ�Ry
|
4
|
+
�Lc���A�V����pH�PX��_w�犕A+�ì��,����B�='oy���B���� �\E�/�cp��Z +=#N�g4�|�d�5���S�N�U�]Y~������?�9'��<C,��� ���X��x
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/refinements/hashes.rb
CHANGED
@@ -47,8 +47,9 @@ module Refinements
|
|
47
47
|
def use &block
|
48
48
|
return [] unless block_given?
|
49
49
|
|
50
|
-
|
51
|
-
|
50
|
+
block.parameters
|
51
|
+
.map { |(_type, key)| self[key] }
|
52
|
+
.then { |values| yield values }
|
52
53
|
end
|
53
54
|
end
|
54
55
|
end
|
data/lib/refinements/identity.rb
CHANGED
data/lib/refinements/strings.rb
CHANGED
@@ -52,8 +52,9 @@ module Refinements
|
|
52
52
|
|
53
53
|
def camelcase
|
54
54
|
if match? self.class.delimiters
|
55
|
-
|
56
|
-
|
55
|
+
split(%r(\s*\-\s*|\s*\/\s*|\s*\:+\s*)).then { |parts| combine parts, :up, "::" }
|
56
|
+
.then { |text| text.split(/\s*\_\s*|\s+/) }
|
57
|
+
.then { |parts| combine parts, :up }
|
57
58
|
else
|
58
59
|
up
|
59
60
|
end
|
@@ -61,8 +62,9 @@ module Refinements
|
|
61
62
|
|
62
63
|
def snakecase
|
63
64
|
if match? self.class.delimiters
|
64
|
-
|
65
|
-
|
65
|
+
split(%r(\s*\-\s*|\s*\/\s*|\s*\:+\s*)).then { |parts| combine parts, :down, "/" }
|
66
|
+
.then { |txt| txt.split(/(?=[A-Z])|\s*\_\s*|\s+/) }
|
67
|
+
.then { |parts| combine parts, :down, "_" }
|
66
68
|
else
|
67
69
|
downcase
|
68
70
|
end
|
@@ -70,8 +72,9 @@ module Refinements
|
|
70
72
|
|
71
73
|
def titleize
|
72
74
|
if match? self.class.delimiters
|
73
|
-
|
74
|
-
|
75
|
+
split(/(?=[A-Z])|\s*\_\s*|\s*\-\s*|\s+/).then { |parts| combine parts, :up, " " }
|
76
|
+
.then { |text| text.split %r(\s*\/\s*|\s*\:+\s*) }
|
77
|
+
.then { |parts| combine parts, :up, "/" }
|
75
78
|
else
|
76
79
|
capitalize
|
77
80
|
end
|
@@ -81,7 +84,7 @@ module Refinements
|
|
81
84
|
|
82
85
|
# :reek:DuplicateMethodCall
|
83
86
|
# :reek:UtilityFunction
|
84
|
-
def
|
87
|
+
def combine parts, method, delimiter = ""
|
85
88
|
parts.reduce "" do |result, part|
|
86
89
|
next part.__send__ method if result.empty?
|
87
90
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: refinements
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.2.
|
4
|
+
version: 6.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brooke Kuhlmann
|
@@ -28,7 +28,7 @@ cert_chain:
|
|
28
28
|
dKvURM+1PwDCzC5tvRwjhUJIizau6+MtkFCvJHmaAj1aZL3odcPejHj5Hxt/0CUW
|
29
29
|
y84=
|
30
30
|
-----END CERTIFICATE-----
|
31
|
-
date: 2019-
|
31
|
+
date: 2019-06-01 00:00:00.000000000 Z
|
32
32
|
dependencies:
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: awesome_print
|
@@ -78,28 +78,28 @@ dependencies:
|
|
78
78
|
requirements:
|
79
79
|
- - "~>"
|
80
80
|
- !ruby/object:Gem::Version
|
81
|
-
version: '13.
|
81
|
+
version: '13.5'
|
82
82
|
type: :development
|
83
83
|
prerelease: false
|
84
84
|
version_requirements: !ruby/object:Gem::Requirement
|
85
85
|
requirements:
|
86
86
|
- - "~>"
|
87
87
|
- !ruby/object:Gem::Version
|
88
|
-
version: '13.
|
88
|
+
version: '13.5'
|
89
89
|
- !ruby/object:Gem::Dependency
|
90
90
|
name: git-cop
|
91
91
|
requirement: !ruby/object:Gem::Requirement
|
92
92
|
requirements:
|
93
93
|
- - "~>"
|
94
94
|
- !ruby/object:Gem::Version
|
95
|
-
version: '3.
|
95
|
+
version: '3.5'
|
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: '3.
|
102
|
+
version: '3.5'
|
103
103
|
- !ruby/object:Gem::Dependency
|
104
104
|
name: guard-rspec
|
105
105
|
requirement: !ruby/object:Gem::Requirement
|
@@ -176,14 +176,14 @@ dependencies:
|
|
176
176
|
requirements:
|
177
177
|
- - "~>"
|
178
178
|
- !ruby/object:Gem::Version
|
179
|
-
version: '5.
|
179
|
+
version: '5.4'
|
180
180
|
type: :development
|
181
181
|
prerelease: false
|
182
182
|
version_requirements: !ruby/object:Gem::Requirement
|
183
183
|
requirements:
|
184
184
|
- - "~>"
|
185
185
|
- !ruby/object:Gem::Version
|
186
|
-
version: '5.
|
186
|
+
version: '5.4'
|
187
187
|
- !ruby/object:Gem::Dependency
|
188
188
|
name: rspec
|
189
189
|
requirement: !ruby/object:Gem::Requirement
|
@@ -204,42 +204,42 @@ dependencies:
|
|
204
204
|
requirements:
|
205
205
|
- - "~>"
|
206
206
|
- !ruby/object:Gem::Version
|
207
|
-
version: '0.
|
207
|
+
version: '0.69'
|
208
208
|
type: :development
|
209
209
|
prerelease: false
|
210
210
|
version_requirements: !ruby/object:Gem::Requirement
|
211
211
|
requirements:
|
212
212
|
- - "~>"
|
213
213
|
- !ruby/object:Gem::Version
|
214
|
-
version: '0.
|
214
|
+
version: '0.69'
|
215
215
|
- !ruby/object:Gem::Dependency
|
216
216
|
name: rubocop-performance
|
217
217
|
requirement: !ruby/object:Gem::Requirement
|
218
218
|
requirements:
|
219
219
|
- - "~>"
|
220
220
|
- !ruby/object:Gem::Version
|
221
|
-
version: '1.
|
221
|
+
version: '1.3'
|
222
222
|
type: :development
|
223
223
|
prerelease: false
|
224
224
|
version_requirements: !ruby/object:Gem::Requirement
|
225
225
|
requirements:
|
226
226
|
- - "~>"
|
227
227
|
- !ruby/object:Gem::Version
|
228
|
-
version: '1.
|
228
|
+
version: '1.3'
|
229
229
|
- !ruby/object:Gem::Dependency
|
230
230
|
name: rubocop-rspec
|
231
231
|
requirement: !ruby/object:Gem::Requirement
|
232
232
|
requirements:
|
233
233
|
- - "~>"
|
234
234
|
- !ruby/object:Gem::Version
|
235
|
-
version: '1.
|
235
|
+
version: '1.33'
|
236
236
|
type: :development
|
237
237
|
prerelease: false
|
238
238
|
version_requirements: !ruby/object:Gem::Requirement
|
239
239
|
requirements:
|
240
240
|
- - "~>"
|
241
241
|
- !ruby/object:Gem::Version
|
242
|
-
version: '1.
|
242
|
+
version: '1.33'
|
243
243
|
- !ruby/object:Gem::Dependency
|
244
244
|
name: simplecov
|
245
245
|
requirement: !ruby/object:Gem::Requirement
|
metadata.gz.sig
CHANGED
Binary file
|