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 +4 -4
- data/lib/rudash.rb +8 -0
- data/lib/rudash/capitalize.rb +10 -0
- data/lib/rudash/intersection.rb +15 -0
- data/lib/rudash/join.rb +7 -0
- data/lib/rudash/without.rb +10 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1185187b5c978193c2c50118c55fb0dd5e09dc149cfddd3dc859cc130afd84df
|
4
|
+
data.tar.gz: 0368d04fb8feab44c597596efd6739e021a4853e4c464188cba7cfdad8829873
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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,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
|
data/lib/rudash/join.rb
ADDED
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
|
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:
|
83
|
+
summary: Rudash - Lodash for Ruby Apps
|
80
84
|
test_files: []
|