rudash 2.0.1 → 2.1.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: b336f27996bcb36b58f5a598755be3bd844f47420149b922bf8cc8b445bbf31b
4
- data.tar.gz: 1ae1eaf5fe6ba29b29c8410ab699969f90a9fd5d2a08a8187f5e24b274556af5
3
+ metadata.gz: 1185187b5c978193c2c50118c55fb0dd5e09dc149cfddd3dc859cc130afd84df
4
+ data.tar.gz: 0368d04fb8feab44c597596efd6739e021a4853e4c464188cba7cfdad8829873
5
5
  SHA512:
6
- metadata.gz: 1da384b4cd9739c915b66ece7e005dafd9ddd6ea78acc3e4fe27e4ef7ded7dd3b994282c09b6a68338c9e8e42da6905cf1bfe4501e5eb3088ec74c61f8b58298
7
- data.tar.gz: fffac7f39596c84bdf4e554646d10b938af2f7a420f43f110599bb2060b3117e6a240ea64cd44b19e6b890bcfbb13aa64942560f702da84b2c4113360a110cce
6
+ metadata.gz: ad84f156d45283ea1cac6d3f7d24a069b25d8468da8d465d8d156d232771df1d77a72b4fdb3fbdc8fb597e33e2e7ab3f42078e367b572d9c2d27ba5e1df4bb91
7
+ data.tar.gz: 750eefc1c8f0bc1f5510036c9f9a29a2033c3aed16f021b0ee1d67dd4149db9af8256b1ed6e32e11954c01a11c4d11b057496546daf64679c34dc4cd385ce4b4
data/lib/rudash.rb CHANGED
@@ -33,6 +33,10 @@ require_relative './rudash/eq.rb'
33
33
  require_relative './rudash/each_right.rb'
34
34
  require_relative './rudash/at.rb'
35
35
  require_relative './rudash/negate.rb'
36
+ require_relative './rudash/capitalize.rb'
37
+ require_relative './rudash/without.rb'
38
+ require_relative './rudash/intersection.rb'
39
+ require_relative './rudash/join.rb'
36
40
 
37
41
  class R_
38
42
  extend Map
@@ -70,4 +74,8 @@ class R_
70
74
  extend EachRight
71
75
  extend At
72
76
  extend Negate
77
+ extend Capitalize
78
+ extend Without
79
+ extend Intersection
80
+ extend Join
73
81
  end
@@ -0,0 +1,10 @@
1
+ module Capitalize
2
+ def capitalize(value)
3
+ case value
4
+ when String
5
+ value.capitalize
6
+ else
7
+ value.to_s
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,15 @@
1
+ require_relative 'reduce.rb'
2
+
3
+ module Intersection
4
+ extend Reduce
5
+
6
+ def intersection(*values)
7
+
8
+ intersection_reducer = -> (acc, current) {
9
+ return [] if !current.is_a?(Array) or !acc.is_a?(Array)
10
+ acc & current
11
+ }
12
+
13
+ self.reduce(values, intersection_reducer, values[0])
14
+ end
15
+ end
@@ -0,0 +1,7 @@
1
+ module Join
2
+ def join(array, separator = ',')
3
+ return '' if !array.is_a?(Array)
4
+ stringified_separator = separator.is_a?(String) ? separator : separator.to_s
5
+ array.join(stringified_separator)
6
+ end
7
+ end
@@ -0,0 +1,10 @@
1
+ require_relative 'difference.rb'
2
+
3
+ module Without
4
+ extend Difference
5
+
6
+ def without(array, *values)
7
+ return [] if !array.is_a?(Array)
8
+ self.difference(array, values)
9
+ end
10
+ end
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.0.1
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Islam Attrash
@@ -18,6 +18,7 @@ extra_rdoc_files: []
18
18
  files:
19
19
  - lib/rudash.rb
20
20
  - lib/rudash/at.rb
21
+ - lib/rudash/capitalize.rb
21
22
  - lib/rudash/compact.rb
22
23
  - lib/rudash/concat.rb
23
24
  - lib/rudash/curry.rb
@@ -33,6 +34,7 @@ files:
33
34
  - lib/rudash/get.rb
34
35
  - lib/rudash/head.rb
35
36
  - lib/rudash/identity.rb
37
+ - lib/rudash/intersection.rb
36
38
  - lib/rudash/is_array.rb
37
39
  - lib/rudash/is_empty.rb
38
40
  - lib/rudash/is_equal.rb
@@ -41,6 +43,7 @@ files:
41
43
  - lib/rudash/is_number.rb
42
44
  - lib/rudash/is_proc.rb
43
45
  - lib/rudash/is_string.rb
46
+ - lib/rudash/join.rb
44
47
  - lib/rudash/keys.rb
45
48
  - lib/rudash/last.rb
46
49
  - lib/rudash/map.rb
@@ -52,6 +55,7 @@ files:
52
55
  - lib/rudash/some.rb
53
56
  - lib/rudash/tail.rb
54
57
  - lib/rudash/uniq.rb
58
+ - lib/rudash/without.rb
55
59
  homepage: https://github.com/Attrash-Islam/rudash
56
60
  licenses:
57
61
  - MIT
@@ -76,5 +80,5 @@ rubyforge_project:
76
80
  rubygems_version: 2.7.8
77
81
  signing_key:
78
82
  specification_version: 4
79
- summary: rudash is the best Lodash utility ever
83
+ summary: Rudash - Lodash for Ruby Apps
80
84
  test_files: []