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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 287c58d9e442e535296ee034c4e7cb254eeafb3d1b00b001daa264f142ac1e9c
4
- data.tar.gz: fd72bb7514e1a05dd4b19db2221412199c29d1ce840e1c1460f336e0dc1b2c10
3
+ metadata.gz: 8f9655518ad0bb3d8c2d3eb6616c2d9862e439d4b0ab4b45be6752b18628ecb1
4
+ data.tar.gz: 280db3869191e9c9fb318baed1b99b6ebc3f90ff24c16993523fe47eceff26fb
5
5
  SHA512:
6
- metadata.gz: 274896ccf6bd53fe6c079aefe732655b7ef6bd78149eef90cf61d7c8abb0ed9bce7a6265c423e889d5ae6bc3fe5b1075d0cef76f07e54fbf8aa32e3b32bfe073
7
- data.tar.gz: 5eacac5f15f645f41847159ca4a5824b0ae0360aabd2e24b6461509f87b67bad055e74743856eb2faa6fbb2b71b84200a43cb684b919eb282f36795ace33d757
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: 'base_extensions'` as described in *Installation*
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 'deeply_enumerable'
40
+ gem "deeply_enumerable"
41
41
  ```
42
42
 
43
43
  or this line to extend the base `Enumerable` classes:
44
44
  ```ruby
45
- gem 'deeply_enumerable', require: 'base_extensions'
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 'bundler/setup'
2
+ require "bundler/setup"
3
3
  rescue LoadError
4
- puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
4
+ puts "You must `gem install bundler` and `bundle install` to run rake tasks"
5
5
  end
6
6
 
7
- require 'rdoc/task'
7
+ require "rdoc/task"
8
8
 
9
9
  RDoc::Task.new(:rdoc) do |rdoc|
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')
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 'bundler/gem_tasks'
22
+ require "bundler/gem_tasks"
23
23
 
24
- require 'rake/testtask'
24
+ require "rake/testtask"
25
25
 
26
26
  Rake::TestTask.new(:test) do |t|
27
- t.libs << 'test'
28
- t.pattern = 'test/**/*_test.rb'
27
+ t.libs << "test"
28
+ t.pattern = "test/**/*_test.rb"
29
29
  t.verbose = false
30
30
  end
31
31
 
@@ -1,4 +1,4 @@
1
- require 'deeply_enumerable'
1
+ require "deeply_enumerable"
2
2
 
3
3
  Hash.send(:include, DeeplyEnumerable::HashExtension)
4
4
  Array.send(:include, DeeplyEnumerable::ArrayExtension)
@@ -1,4 +1,4 @@
1
- require_relative 'enumerable'
1
+ require_relative "enumerable"
2
2
 
3
3
  module DeeplyEnumerable
4
4
  module ArrayExtension
@@ -1,6 +1,6 @@
1
1
  module DeeplyEnumerable
2
2
  module Enumerable
3
- UNENUMERABLE = ['ActiveRecord::Relation']
3
+ UNENUMERABLE = ["ActiveRecord::Relation", "Range"]
4
4
 
5
5
  def self.included(klass)
6
6
  klass.extend(ClassMethods)
@@ -1,4 +1,4 @@
1
- require_relative 'enumerable'
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
 
@@ -1,3 +1,3 @@
1
1
  module DeeplyEnumerable
2
- VERSION = '0.9.3'
2
+ VERSION = "1.0.0"
3
3
  end
@@ -1,2 +1,2 @@
1
- require 'deeply_enumerable/array'
2
- require 'deeply_enumerable/hash'
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.9.3
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: 2019-12-28 00:00:00.000000000 Z
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.0.6
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: []