refinements 7.7.0 → 7.8.0
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.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +3 -1
- data.tar.gz.sig +0 -0
- data/README.adoc +9 -1
- data/lib/refinements/arrays.rb +8 -0
- data/lib/refinements/identity.rb +1 -1
- data/lib/refinements/pathnames.rb +8 -2
- metadata +4 -4
- 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: dd72c4e1fda257b53dcd80a052db0ce99cd5b2987e531bea93f577e6b3b131f9
|
4
|
+
data.tar.gz: 67b83319903a39425640eb0534eab280e7cb138e588476c635c5192afb08758d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8fab91775e301f8765dd3156ab91e6abdf9395bdf767fbf859f80a5d3ea2bbebabef8dbe9e5e5a65e33443082a13e127ce3d85c1384b3939d753347384dea99e
|
7
|
+
data.tar.gz: 74934f4fbb6336ad4c434961c865b826675a71b76f846faae7635e6e09d3aa99bd74a9c74d6f0289f2d63a0c3352c9e21aecb60e35c2485664879520b20a755d
|
checksums.yaml.gz.sig
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
data/README.adoc
CHANGED
@@ -18,6 +18,8 @@ toc::[]
|
|
18
18
|
* *Arrays*:
|
19
19
|
** `#compress` - Removes `nil` and empty values without modifying itself.
|
20
20
|
** `#compress!` - Removes `nil` and empty values while modifying itself.
|
21
|
+
** `#include` - Adds given array or elements without modifying itself.
|
22
|
+
** `#exclude` - Removes given array or elements without modifying itself.
|
21
23
|
** `#ring` - Answers a circular array which can enumerate before, current, after elements.
|
22
24
|
* *BigDecimals*:
|
23
25
|
** `#inspect` - Allows one to inspect a big decimal with numeric representation.
|
@@ -54,7 +56,7 @@ file for manipulation and immediate writing back to the same file.
|
|
54
56
|
** `#files` - Answers all or filtered files for current path.
|
55
57
|
** `#gsub` - Same behavior as `String#gsub` but answers a path with patterns replaced with desired
|
56
58
|
substitutes.
|
57
|
-
** `#
|
59
|
+
** `#relative_parent` - Answers relative path from parent directory. This is a complement to
|
58
60
|
`#relative_path_from`.
|
59
61
|
** `#make_ancestors` - Ensures all ancestor directories are created for a path.
|
60
62
|
** `#rewrite` - When given a block, it provides the contents of the recently read file for
|
@@ -173,6 +175,12 @@ example = ["An", nil, "", "Example"]
|
|
173
175
|
example.compress! # => ["An", "Example"]
|
174
176
|
example # => ["An", "Example"]
|
175
177
|
|
178
|
+
[1, 2, 3].include [4, 5] # => [1, 2, 3, 4, 5]
|
179
|
+
[1, 2, 3].include 4, 5 # => [1, 2, 3, 4, 5]
|
180
|
+
|
181
|
+
[1, 2, 3, 4, 5].exclude [4, 5] # => [1, 2, 3]
|
182
|
+
[1, 2, 3, 4, 5].include 4, 5 # => [1, 2, 3, 4, 5]
|
183
|
+
|
176
184
|
example = [1, 2, 3]
|
177
185
|
example.ring # => #<Enumerator: ...>
|
178
186
|
example.ring { |(before, current, after)| puts "#{before} #{current} #{after}" }
|
data/lib/refinements/arrays.rb
CHANGED
data/lib/refinements/identity.rb
CHANGED
@@ -39,8 +39,14 @@ module Refinements
|
|
39
39
|
self.class.new to_s.gsub(pattern, replacement)
|
40
40
|
end
|
41
41
|
|
42
|
-
def
|
43
|
-
relative_path_from(
|
42
|
+
def relative_parent root_dir
|
43
|
+
relative_path_from(root_dir).parent
|
44
|
+
end
|
45
|
+
|
46
|
+
def relative_parent_from root_dir
|
47
|
+
warn "[DEPRECATION]: Pathname#relative_parent_from is deprecated, " \
|
48
|
+
"use Pathname#relative_parent instead."
|
49
|
+
relative_parent root_dir
|
44
50
|
end
|
45
51
|
|
46
52
|
def make_ancestors
|
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: 7.
|
4
|
+
version: 7.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brooke Kuhlmann
|
@@ -28,7 +28,7 @@ cert_chain:
|
|
28
28
|
2XV8FRa7/JimI07sPLC13eLY3xd/aYTi85Z782KIA4j0G8XEEWAX0ouBhlXPocZv
|
29
29
|
QWc=
|
30
30
|
-----END CERTIFICATE-----
|
31
|
-
date: 2020-08-
|
31
|
+
date: 2020-08-29 00:00:00.000000000 Z
|
32
32
|
dependencies:
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: bundler-audit
|
@@ -162,14 +162,14 @@ dependencies:
|
|
162
162
|
requirements:
|
163
163
|
- - "~>"
|
164
164
|
- !ruby/object:Gem::Version
|
165
|
-
version: '0.
|
165
|
+
version: '0.89'
|
166
166
|
type: :development
|
167
167
|
prerelease: false
|
168
168
|
version_requirements: !ruby/object:Gem::Requirement
|
169
169
|
requirements:
|
170
170
|
- - "~>"
|
171
171
|
- !ruby/object:Gem::Version
|
172
|
-
version: '0.
|
172
|
+
version: '0.89'
|
173
173
|
- !ruby/object:Gem::Dependency
|
174
174
|
name: rubocop-performance
|
175
175
|
requirement: !ruby/object:Gem::Requirement
|
metadata.gz.sig
CHANGED
Binary file
|