refinements 6.1.0 → 6.2.0
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 +0 -0
- data.tar.gz.sig +0 -0
- data/README.md +3 -3
- data/lib/refinements/arrays.rb +1 -1
- data/lib/refinements/identity.rb +1 -1
- data/lib/refinements/strings.rb +4 -4
- metadata +14 -15
- 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: adf4a5bfa549c00fa3bd61b60b06de874a1b51f5aab50b8c9eb6533782756fbc
|
4
|
+
data.tar.gz: e64e5515a48caa7676856135652d8a3db93638ed8bc7cc8c7572c4c77fb3b88e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b5b19992c8338c0d94ea23583af9ee8b28af4d745016598df6ccbad94153e86532d8b2ed6c4a4a658f33ff28acd1d40b7e27d6441c0bfddac7d4e728b54f03f
|
7
|
+
data.tar.gz: f7180a47a4e3a23bdb1f7c825fe853d5511fce6a33c48ce4f6e6fd1df4ce5cbc5ece60d1d8830d864c72dc8a543bd99237e9a71aaa1fa0d28720c48de2cadb1a
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/README.md
CHANGED
@@ -40,8 +40,8 @@ Provides additional enhancements (refinements) to core Ruby objects.
|
|
40
40
|
- Provides BigDecimal refinements:
|
41
41
|
- `#inspect` - Allows one to inspect a big decimal with numeric representation.
|
42
42
|
- Provides Hash refinements:
|
43
|
-
- `#except` - Answers new hash with given
|
44
|
-
- `#except!` - Answers new hash with given
|
43
|
+
- `#except` - Answers new hash with given keys removed without modifying calling hash.
|
44
|
+
- `#except!` - Answers new hash with given keys removed while modifying calling hash.
|
45
45
|
- `#symbolize_keys` - Converts keys to symbols without modifying itself.
|
46
46
|
- `#symbolize_keys!` - Converts keys to symbols while modifying itself.
|
47
47
|
- `#deep_merge` - Merges deeply nested hashes together without modifying itself.
|
@@ -174,7 +174,7 @@ The following sections demonstrate how each refinement enriches your objects wit
|
|
174
174
|
"example".first 4 # => "exam"
|
175
175
|
|
176
176
|
"instant".last # => "t"
|
177
|
-
"instant".
|
177
|
+
"instant".last 3 # => "ant"
|
178
178
|
|
179
179
|
" \n\t\r".blank? # => true
|
180
180
|
"example".up # => "Example"
|
data/lib/refinements/arrays.rb
CHANGED
data/lib/refinements/identity.rb
CHANGED
data/lib/refinements/strings.rb
CHANGED
@@ -51,7 +51,7 @@ module Refinements
|
|
51
51
|
end
|
52
52
|
|
53
53
|
def camelcase
|
54
|
-
if match?
|
54
|
+
if match? self.class.delimiters
|
55
55
|
result = join_parts split(%r(\s*\-\s*|\s*\/\s*|\s*\:+\s*)), method: :up, delimiter: "::"
|
56
56
|
join_parts result.split(/\s*\_\s*|\s+/), method: :up
|
57
57
|
else
|
@@ -60,7 +60,7 @@ module Refinements
|
|
60
60
|
end
|
61
61
|
|
62
62
|
def snakecase
|
63
|
-
if match?
|
63
|
+
if match? self.class.delimiters
|
64
64
|
result = join_parts split(%r(\s*\-\s*|\s*\/\s*|\s*\:+\s*)), method: :down, delimiter: "/"
|
65
65
|
join_parts result.split(/(?=[A-Z])|\s*\_\s*|\s+/), method: :down, delimiter: "_"
|
66
66
|
else
|
@@ -69,7 +69,7 @@ module Refinements
|
|
69
69
|
end
|
70
70
|
|
71
71
|
def titleize
|
72
|
-
if match?
|
72
|
+
if match? self.class.delimiters
|
73
73
|
result = join_parts split(/(?=[A-Z])|\s*\_\s*|\s*\-\s*|\s+/), method: :up, delimiter: " "
|
74
74
|
join_parts result.split(%r(\s*\/\s*|\s*\:+\s*)), method: :up, delimiter: "/"
|
75
75
|
else
|
@@ -83,7 +83,7 @@ module Refinements
|
|
83
83
|
# :reek:UtilityFunction
|
84
84
|
def join_parts parts, method:, delimiter: ""
|
85
85
|
parts.reduce "" do |result, part|
|
86
|
-
next part.__send__
|
86
|
+
next part.__send__ method if result.empty?
|
87
87
|
|
88
88
|
"#{result}#{delimiter}#{part.__send__ method}"
|
89
89
|
end
|
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.
|
4
|
+
version: 6.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brooke Kuhlmann
|
@@ -10,26 +10,25 @@ bindir: bin
|
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MIIC/jCCAeagAwIBAgIBAjANBgkqhkiG9w0BAQsFADAlMSMwIQYDVQQDDBpicm9v
|
14
|
+
a2UvREM9YWxjaGVtaXN0cy9EQz1pbzAeFw0xOTAyMTcxNjAxMTFaFw0yMDAyMTcx
|
15
|
+
NjAxMTFaMCUxIzAhBgNVBAMMGmJyb29rZS9EQz1hbGNoZW1pc3RzL0RDPWlvMIIB
|
16
16
|
IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA6l1qpXTiomH1RfMRloyw7MiE
|
17
17
|
xyVx/x8Yc3EupdH7uhNaTXQGyORN6aOY//1QXXMHIZ9tW74nZLhesWMSUMYy0XhB
|
18
18
|
brs+KkurHnc9FnEJAbG7ebGvl/ncqZt72nQvaxpDxvuCBHgJAz+8i5wl6FhLw+oT
|
19
19
|
9z0A8KcGhz67SdcoQiD7qiCjL/2NTeWHOzkpPrdGlt088+VerEEGf5I13QCvaftP
|
20
20
|
D5vkU0YlAm1r98BymuJlcQ1qdkVEI1d48ph4kcS0S0nv1RiuyVb6TCAR3Nu3VaVq
|
21
21
|
3fPzZKJLZBx67UvXdbdicWPiUR75elI4PXpLIic3xytaF52ZJYyKZCNZJhNwfQID
|
22
|
-
|
23
|
-
2CdikiiE3fJhP/
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
b4jw5t40FKyNUvLPPXYAvQALBtk=
|
22
|
+
AQABozkwNzAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQU0nzow9vc
|
23
|
+
2CdikiiE3fJhP/gY4ggwDQYJKoZIhvcNAQELBQADggEBANgfX7kPZkJvsbdWMvbe
|
24
|
+
DUUYxRTqTUzCDpLd2p3sQvgLMKjTNSKt6CFq/kh+98b6RCgO6DqiVfxvOEq02dvf
|
25
|
+
ebMN/ylQqan2FgiAs1rpP0/D4C0MlBjoDktsT+2IyLol1KmkDB20ExJ4Sf1GRNdA
|
26
|
+
hpWOtcgqHtmrc7xzgB6BuyoYufrKKUlCO3ewTM4C375D2qO7hIdKuMOO3CdPMtSk
|
27
|
+
OrWpbzCL+nbbXqeoqiHgZaUvcyyQrGj5sQRxMTzuMXzzQxtHnuTuKrcz16HMTX/O
|
28
|
+
dKvURM+1PwDCzC5tvRwjhUJIizau6+MtkFCvJHmaAj1aZL3odcPejHj5Hxt/0CUW
|
29
|
+
y84=
|
31
30
|
-----END CERTIFICATE-----
|
32
|
-
date: 2019-
|
31
|
+
date: 2019-04-01 00:00:00.000000000 Z
|
33
32
|
dependencies:
|
34
33
|
- !ruby/object:Gem::Dependency
|
35
34
|
name: awesome_print
|
@@ -294,7 +293,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
294
293
|
- !ruby/object:Gem::Version
|
295
294
|
version: '0'
|
296
295
|
requirements: []
|
297
|
-
rubygems_version: 3.0.
|
296
|
+
rubygems_version: 3.0.3
|
298
297
|
signing_key:
|
299
298
|
specification_version: 4
|
300
299
|
summary: Provides additional enhancements (refinements) to core Ruby objects.
|
metadata.gz.sig
CHANGED
Binary file
|