deeply_enumerable 0.9.3 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/Rakefile +12 -12
- data/lib/base_extensions.rb +1 -1
- data/lib/deeply_enumerable/array.rb +1 -1
- data/lib/deeply_enumerable/enumerable.rb +1 -1
- data/lib/deeply_enumerable/hash.rb +2 -2
- data/lib/deeply_enumerable/version.rb +1 -1
- data/lib/deeply_enumerable.rb +2 -2
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8f9655518ad0bb3d8c2d3eb6616c2d9862e439d4b0ab4b45be6752b18628ecb1
|
4
|
+
data.tar.gz: 280db3869191e9c9fb318baed1b99b6ebc3f90ff24c16993523fe47eceff26fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6939a317d815e1c0d6cfdc65f75f506cb549978b8338ef4f604086cb5efe7b4959d3ab3112691d068fa8f28082cb6753d3ae9177c5909ec56e0dd537c9c557b5
|
7
|
+
data.tar.gz: 3d07a34bb72ed5c3f37ce106daf0c30eef47d46af22e29e3278cfcefbbafdd607db395abbb38b4b34531aceaef9af8c46a29d37587b170703dc4aafb17edafd6
|
data/README.md
CHANGED
@@ -23,7 +23,7 @@ $ DeeplyEnumerable::Array.deep_compact(Array)
|
|
23
23
|
|
24
24
|
These methos will retrun a `DeeplyEnumerable` type object matching the object passed, e.g: `Array` will return a `DeeplyEnumerable::Array`
|
25
25
|
|
26
|
-
You may also extend base classes if you `require:
|
26
|
+
You may also extend base classes if you `require: "base_extensions"` as described in *Installation*
|
27
27
|
```ruby
|
28
28
|
$ Hash#reverse_deep_merge(DeeplyEnumerable::Hash)
|
29
29
|
$ Hash#reverse_deep_merge!(DeeplyEnumerable::Hash)
|
@@ -37,12 +37,12 @@ $ Array#deep_compact!
|
|
37
37
|
## Installation
|
38
38
|
Add this line to your application's Gemfile:
|
39
39
|
```ruby
|
40
|
-
gem
|
40
|
+
gem "deeply_enumerable"
|
41
41
|
```
|
42
42
|
|
43
43
|
or this line to extend the base `Enumerable` classes:
|
44
44
|
```ruby
|
45
|
-
gem
|
45
|
+
gem "deeply_enumerable", require: "base_extensions"
|
46
46
|
```
|
47
47
|
|
48
48
|
And then execute:
|
data/Rakefile
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
begin
|
2
|
-
require
|
2
|
+
require "bundler/setup"
|
3
3
|
rescue LoadError
|
4
|
-
puts
|
4
|
+
puts "You must `gem install bundler` and `bundle install` to run rake tasks"
|
5
5
|
end
|
6
6
|
|
7
|
-
require
|
7
|
+
require "rdoc/task"
|
8
8
|
|
9
9
|
RDoc::Task.new(:rdoc) do |rdoc|
|
10
|
-
rdoc.rdoc_dir =
|
11
|
-
rdoc.title =
|
12
|
-
rdoc.options <<
|
13
|
-
rdoc.rdoc_files.include(
|
14
|
-
rdoc.rdoc_files.include(
|
10
|
+
rdoc.rdoc_dir = "rdoc"
|
11
|
+
rdoc.title = "DeeplyEnumerable"
|
12
|
+
rdoc.options << "--line-numbers"
|
13
|
+
rdoc.rdoc_files.include("README.md")
|
14
|
+
rdoc.rdoc_files.include("lib/**/*.rb")
|
15
15
|
end
|
16
16
|
|
17
17
|
|
@@ -19,13 +19,13 @@ end
|
|
19
19
|
|
20
20
|
|
21
21
|
|
22
|
-
require
|
22
|
+
require "bundler/gem_tasks"
|
23
23
|
|
24
|
-
require
|
24
|
+
require "rake/testtask"
|
25
25
|
|
26
26
|
Rake::TestTask.new(:test) do |t|
|
27
|
-
t.libs <<
|
28
|
-
t.pattern =
|
27
|
+
t.libs << "test"
|
28
|
+
t.pattern = "test/**/*_test.rb"
|
29
29
|
t.verbose = false
|
30
30
|
end
|
31
31
|
|
data/lib/base_extensions.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require_relative
|
1
|
+
require_relative "enumerable"
|
2
2
|
|
3
3
|
module DeeplyEnumerable
|
4
4
|
module HashExtension
|
@@ -37,7 +37,7 @@ module DeeplyEnumerable
|
|
37
37
|
compact_method = %i[deep_compact! deep_compact compact! compact].detect{ |m| value.respond_to?(m) }
|
38
38
|
next unless compact_method
|
39
39
|
|
40
|
-
original_empty = value.respond_to?(:empty?) ? value.empty? : value.respond_to?(:none?) ? value.none? : false
|
40
|
+
original_empty = value.respond_to?(:empty?) ? value.empty? : value.respond_to?(:none?) ? value.none? : false rescue false
|
41
41
|
compact_value = value.send(*[compact_method].concat(value.method(compact_method).parameters.collect { |_,param| binding.local_variable_get(param) } ).compact) || value
|
42
42
|
compact_empty = compact_value.respond_to?(:empty?) ? compact_value.empty? : compact_value.respond_to?(:none?) ? compact_value.none? : false
|
43
43
|
|
data/lib/deeply_enumerable.rb
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
require
|
2
|
-
require
|
1
|
+
require "deeply_enumerable/array"
|
2
|
+
require "deeply_enumerable/hash"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deeply_enumerable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- chaunce
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -44,7 +44,7 @@ homepage: https://github.com/chaunce/deeply_enumerable
|
|
44
44
|
licenses:
|
45
45
|
- MIT
|
46
46
|
metadata: {}
|
47
|
-
post_install_message:
|
47
|
+
post_install_message:
|
48
48
|
rdoc_options: []
|
49
49
|
require_paths:
|
50
50
|
- lib
|
@@ -59,8 +59,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
59
59
|
- !ruby/object:Gem::Version
|
60
60
|
version: '0'
|
61
61
|
requirements: []
|
62
|
-
rubygems_version: 3.
|
63
|
-
signing_key:
|
62
|
+
rubygems_version: 3.4.3
|
63
|
+
signing_key:
|
64
64
|
specification_version: 4
|
65
65
|
summary: recusrive support for enumerable operations
|
66
66
|
test_files: []
|