duck_puncher 2.12.1 → 2.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/lib/duck_puncher/ducks/array.rb +4 -0
- data/lib/duck_puncher/version.rb +1 -1
- data/test/lib/duck_puncher/array_test.rb +6 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2bd0730996e1455c059a2357503204895c4b4106
|
4
|
+
data.tar.gz: e21eca26c8bd137164357e6978b234fd927bf768
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 812763952014159ac97bce9d7eabe39cfb89f1957a1e9ec081f263151d40acbc3d5176f50a9b42964f9abcb69563f239747bfa20411d556cad53bb14ce2aaa1d
|
7
|
+
data.tar.gz: 364d76cc5f8d900f2fbea362f8876251e0453504da3ef8423f2024edc36955f4cde85d43b865121d9b0a4659b3009bcbbd30fea3faff679661f3590be9a78b47
|
data/README.md
CHANGED
@@ -12,6 +12,7 @@ Default extensions:
|
|
12
12
|
Array #m => `[].m(:to_s)` => `[].map(&:to_s)`
|
13
13
|
#mm => `[].mm(:sub, /[aeiou]/, '*')` => `[].map { |x| x.sub(/[aeiou]/, '*') }`
|
14
14
|
#get => `[].methods.get('ty?')` => [:empty?]
|
15
|
+
#except => `[].except('foo', 'bar')` => `[] - ['foo', 'bar']`
|
15
16
|
Hash #dig => `{a: 1, b: {c: 2}}.dig(:b, :c)` => 2 (Part of standard lib in Ruby >= 2.3)
|
16
17
|
Numeric #to_currency => `25.245.to_currency` => 25.25
|
17
18
|
#to_duration => `10_000.to_duration` => '2 h 46 min'
|
data/lib/duck_puncher/version.rb
CHANGED
@@ -25,4 +25,10 @@ class ArrayTest < MiniTest::Test
|
|
25
25
|
assert_equal [].methods.punch.get(/ty\?/), [:empty?]
|
26
26
|
assert_equal [].methods.punch.get('ty?'), [:empty?]
|
27
27
|
end
|
28
|
+
|
29
|
+
def test_except
|
30
|
+
assert_equal subject.except('a'), %w[b c d e f g h i j k l m]
|
31
|
+
assert_equal subject.except('a', 'b', 'c'), %w[d e f g h i j k l m]
|
32
|
+
assert_equal subject.except, subject
|
33
|
+
end
|
28
34
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: duck_puncher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.13.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Buckley
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: usable
|