da_huangs_ruby_extensions 0.0.11 → 0.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/lib/array_ext.rb +18 -2
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.12
|
data/lib/array_ext.rb
CHANGED
@@ -39,8 +39,24 @@ module DaHuang
|
|
39
39
|
map{|t| t.try(:send, attrib)}
|
40
40
|
end
|
41
41
|
|
42
|
-
def minus(obj)
|
43
|
-
reject{|t| t
|
42
|
+
def minus(*obj)
|
43
|
+
reject{|t| obj.include? t}
|
44
|
+
end
|
45
|
+
|
46
|
+
def only(*obj)
|
47
|
+
select{|t| obj.include? t}
|
48
|
+
end
|
49
|
+
|
50
|
+
def minus!(*obj)
|
51
|
+
each do |t|
|
52
|
+
delete(t) if obj.include? t
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
def only!(*obj)
|
57
|
+
each do |t|
|
58
|
+
delete(t) unless obj.include? t
|
59
|
+
end
|
44
60
|
end
|
45
61
|
|
46
62
|
def strip_all
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: da_huangs_ruby_extensions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 7
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 12
|
10
|
+
version: 0.0.12
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Tyler Gannon
|