rudash 2.8.2 → 2.8.3

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: c10d55f0e8a0c9fa3172f01030876b2094501ee6dec705d6b97c09de1b2870fe
4
- data.tar.gz: 47c4324b5f508c47222dafdff4ea24dd2511d5bbce0d6d8599b4d130df621d5e
3
+ metadata.gz: dc7aaeca7e82e07a1facc3dad834177b254a6d2e56d1b494855c1922e4ec48d3
4
+ data.tar.gz: 0f7aa124d2b72b1c12ec77f3c942f7c4315d6f19d5c91460ddd5d55056bf9d20
5
5
  SHA512:
6
- metadata.gz: aac039a0e05f5fd2ddb67eee5a997acdac8274495cca9f1a074e9418720798d4dd48f531dbb4c00f1c6a4ea4b37e89ba76c9751fdab0ecae15359e7bcd127b59
7
- data.tar.gz: 18f0778caae5e1fb1b3386f648061c415ceecb7d17a655e9401ce08bb5735b06cfd3622fb5f580e527318da6ab06cede06d9b875d0e7cba8ac7bf64bd3191c0b
6
+ metadata.gz: 77a0eb97316bb07b9703b7d3659a139834ab79483ecf225b68e089646e93ee267d7d5357653bbb6ba981557ae65c964eca482ab4eeb5172ca958ba120df6ad31
7
+ data.tar.gz: d3b83b741229716e0dc356610564773d818169371dcf0b866d7db098c804f72782e34a3d44de04567011d7e8fece2176dfb638fff3a9c4271b672ddd201cc8ee
data/lib/rudash/at.rb CHANGED
@@ -1,10 +1,5 @@
1
- require_relative 'get.rb'
2
- require_relative 'map.rb'
3
-
4
1
  module Rudash
5
2
  module At
6
- extend Rudash
7
-
8
3
  def at(object, paths)
9
4
  get_mapper = -> (path) {
10
5
  self.get(object, path)
@@ -1,9 +1,5 @@
1
- require_relative 'is_nil.rb'
2
-
3
1
  module Rudash
4
2
  module Compact
5
- extend Rudash
6
-
7
3
  def compact(array)
8
4
  return [] if !array.is_a?(Array)
9
5
  array.compact
data/lib/rudash/concat.rb CHANGED
@@ -1,9 +1,5 @@
1
- require_relative 'is_nil.rb'
2
-
3
1
  module Rudash
4
2
  module Concat
5
- extend Rudash
6
-
7
3
  def concat(head, *values)
8
4
  head_arr = head.is_a?(Array) ? head : [head]
9
5
  if values.size == 0
@@ -1,9 +1,5 @@
1
- require_relative 'reduce.rb'
2
-
3
1
  module Rudash
4
2
  module Difference
5
- extend Rudash
6
-
7
3
  def difference(*values)
8
4
  diff_reducer = -> (acc, current) {
9
5
  return [] if !acc.is_a?(Array)
data/lib/rudash/each.rb CHANGED
@@ -1,9 +1,5 @@
1
- require_relative 'map.rb'
2
-
3
1
  module Rudash
4
2
  module Each
5
- extend Rudash
6
-
7
3
  def each(collection, *rest_args)
8
4
  self.map(collection, *rest_args)
9
5
  collection
@@ -1,10 +1,7 @@
1
- require_relative 'each.rb'
2
1
  require_relative '../utils/index.rb'
3
2
 
4
3
  module Rudash
5
4
  module EachRight
6
- extend Rudash
7
-
8
5
  def each_right(collection, *rest_args)
9
6
  reversed_collection = Rudash::Utils.force_reverse(collection)
10
7
 
data/lib/rudash/every.rb CHANGED
@@ -1,9 +1,5 @@
1
- require_relative 'filter.rb'
2
-
3
1
  module Rudash
4
2
  module Every
5
- extend Rudash
6
-
7
3
  def every?(array, filter)
8
4
  filtered_arr = self.filter(array, filter)
9
5
  filtered_arr.length == array.length
data/lib/rudash/filter.rb CHANGED
@@ -1,12 +1,7 @@
1
- require_relative 'is_nil.rb'
2
- require_relative 'identity.rb'
3
- require_relative 'head.rb'
4
1
  require_relative '../utils/subset_deep_match.rb'
5
2
 
6
3
  module Rudash
7
4
  module Filter
8
- extend Rudash
9
-
10
5
  def filter(collection, *rest_args)
11
6
  filter = self.head(rest_args) || self.method(:identity)
12
7
 
data/lib/rudash/find.rb CHANGED
@@ -1,11 +1,5 @@
1
- require_relative 'filter.rb'
2
- require_relative 'head.rb'
3
- require_relative 'identity.rb'
4
-
5
1
  module Rudash
6
2
  module Find
7
- extend Rudash
8
-
9
3
  def find(collection, *rest_args)
10
4
  filter_proc = self.head(rest_args) || self.method(:identity)
11
5
  filtered_arr = self.filter(collection, filter_proc)
@@ -1,10 +1,5 @@
1
- require_relative 'filter.rb'
2
- require_relative 'identity.rb'
3
-
4
1
  module Rudash
5
2
  module FindLast
6
- extend Rudash
7
-
8
3
  def find_last(collection, *rest_args)
9
4
  filter_proc = self.head(rest_args) || self.method(:identity)
10
5
  filtered_arr = self.filter(collection, filter_proc)
data/lib/rudash/get.rb CHANGED
@@ -1,12 +1,8 @@
1
- require_relative 'reduce.rb'
2
- require_relative 'filter.rb'
3
1
  require_relative '../utils/path_resolver.rb'
4
2
  require_relative '../utils/index.rb'
5
3
 
6
4
  module Rudash
7
5
  module Get
8
- extend Rudash
9
-
10
6
  def get(hash, path, *rest_args)
11
7
  return nil if !path.is_a?(String) && !path.is_a?(Array)
12
8
  return nil if !hash.is_a?(Array) && !hash.is_a?(Hash)
@@ -1,9 +1,5 @@
1
- require_relative 'reduce.rb'
2
-
3
1
  module Rudash
4
2
  module Intersection
5
- extend Rudash
6
-
7
3
  def intersection(*values)
8
4
 
9
5
  intersection_reducer = -> (acc, current) {
data/lib/rudash/map.rb CHANGED
@@ -1,10 +1,5 @@
1
- require_relative 'head.rb'
2
- require_relative 'identity.rb'
3
-
4
1
  module Rudash
5
2
  module Map
6
- extend Rudash
7
-
8
3
  def map(collection, *rest_args)
9
4
  mapper_proc = self.head(rest_args) || self.method(:identity)
10
5
 
data/lib/rudash/pick.rb CHANGED
@@ -1,11 +1,5 @@
1
- require_relative 'each.rb'
2
- require_relative 'get.rb'
3
- require_relative 'set.rb'
4
-
5
1
  module Rudash
6
2
  module Pick
7
- extend Rudash
8
-
9
3
  def pick(hash, paths)
10
4
  return self.pick(hash, [paths]) if !paths.is_a?(Array)
11
5
  return {} if !hash.is_a?(Hash)
@@ -1,10 +1,7 @@
1
- require_relative 'reduce.rb'
2
1
  require_relative '../utils/index.rb'
3
2
 
4
3
  module Rudash
5
4
  module ReduceRight
6
- extend Rudash
7
-
8
5
  def reduce_right(collection, *rest_args)
9
6
  reversed_collection = Rudash::Utils.force_reverse(collection)
10
7
  self.reduce(reversed_collection, *rest_args)
data/lib/rudash/remove.rb CHANGED
@@ -1,10 +1,5 @@
1
- require_relative 'identity.rb'
2
- require_relative 'filter.rb'
3
-
4
1
  module Rudash
5
2
  module Remove
6
- extend Rudash
7
-
8
3
  def remove(array, *rest_args)
9
4
  predicate = self.head(rest_args) || self.method(:identity)
10
5
  return [] if !array.is_a?(Array)
data/lib/rudash/set.rb CHANGED
@@ -1,12 +1,9 @@
1
1
  require_relative '../utils/path_resolver.rb'
2
2
  require_relative '../utils/nested_path_creator.rb'
3
3
  require_relative '../utils/index.rb'
4
- require_relative 'get.rb'
5
4
 
6
5
  module Rudash
7
6
  module Set
8
- extend Rudash
9
-
10
7
  def set(object, path, value)
11
8
  return object if !object.is_a?(Hash) && !object.is_a?(Array)
12
9
 
data/lib/rudash/size.rb CHANGED
@@ -1,9 +1,5 @@
1
- require_relative 'is_nil.rb'
2
-
3
1
  module Rudash
4
2
  module Size
5
- extend Rudash
6
-
7
3
  def size(something)
8
4
  return 0 if self.is_nil?(something)
9
5
  something.size
data/lib/rudash/some.rb CHANGED
@@ -1,9 +1,5 @@
1
- require_relative 'filter.rb'
2
-
3
1
  module Rudash
4
2
  module Some
5
- extend Rudash
6
-
7
3
  def some?(array, filter)
8
4
  filtered_arr = self.filter(array, filter)
9
5
  filtered_arr.length != 0
data/lib/rudash/union.rb CHANGED
@@ -1,11 +1,5 @@
1
- require_relative 'reduce.rb'
2
- require_relative 'head.rb'
3
- require_relative 'filter.rb'
4
-
5
1
  module Rudash
6
2
  module Union
7
- extend Rudash
8
-
9
3
  def union(*values)
10
4
 
11
5
  union_reducer = -> (acc, current) {
data/lib/rudash/update.rb CHANGED
@@ -1,12 +1,5 @@
1
- require_relative 'identity.rb'
2
- require_relative 'get.rb'
3
- require_relative 'set.rb'
4
- require_relative 'head.rb'
5
-
6
1
  module Rudash
7
2
  module Update
8
- extend Rudash
9
-
10
3
  def update(object, path, *rest_args)
11
4
  updater = self.head(rest_args) || self.method(:identity)
12
5
  current_value = self.get(object, path)
@@ -1,9 +1,5 @@
1
- require_relative 'difference.rb'
2
-
3
1
  module Rudash
4
2
  module Without
5
- extend Rudash
6
-
7
3
  def without(array, *values)
8
4
  return [] if !array.is_a?(Array)
9
5
  self.difference(array, values)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rudash
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.2
4
+ version: 2.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Islam Attrash