extras 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/extras/array.rb +16 -6
- data/lib/extras/hash.rb +18 -7
- data/lib/extras/version.rb +1 -1
- 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: 40b076f20b355bcdbfb57904221ba29f661a3689
|
4
|
+
data.tar.gz: 8f8094cf422cf7fa467b5ba4676ca047eedfc726
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 673b899ad2314bccd0ee859dfb67f64fd1bb3117f96d800b4930830649b4a2d7308fa35421b6b3dbae5490d2b58812b70e41437843f4c66e920c55fcabd31fef
|
7
|
+
data.tar.gz: 984a1f52639f4e085f4fe5c1616875d60c9dbea4268ead07959782b02317e482c37fe1c1d39cb1f8ac789c60b64b73e9de80381018504d5745dc47a473740fb7
|
data/lib/extras/array.rb
CHANGED
@@ -8,12 +8,22 @@ module Extras
|
|
8
8
|
module Array
|
9
9
|
module ClassMethods
|
10
10
|
def allowed
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
11
|
+
if RUBY_VERSION < "2.4"
|
12
|
+
@allowed ||= begin
|
13
|
+
out = {
|
14
|
+
:keys => [::NilClass, ::Hash, ::TrueClass, \
|
15
|
+
::FalseClass, ::Regexp, ::Array, ::Set, ::Fixnum,
|
16
|
+
::Bignum, ::Float]
|
17
|
+
}
|
18
|
+
end
|
19
|
+
else
|
20
|
+
@allowed ||= begin
|
21
|
+
out = {
|
22
|
+
:keys => [::NilClass, ::Hash, ::TrueClass, \
|
23
|
+
::FalseClass, ::Regexp, ::Array, ::Set, ::Integer, \
|
24
|
+
::Float]
|
25
|
+
}
|
26
|
+
end
|
17
27
|
end
|
18
28
|
end
|
19
29
|
end
|
data/lib/extras/hash.rb
CHANGED
@@ -8,13 +8,24 @@ module Extras
|
|
8
8
|
module Hash
|
9
9
|
module ClassMethods
|
10
10
|
def allowed
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
11
|
+
if RUBY_VERSION < "2.4"
|
12
|
+
@allowed ||= begin
|
13
|
+
{
|
14
|
+
:keys => [],
|
15
|
+
:vals => [::NilClass, ::Hash, ::TrueClass, \
|
16
|
+
::FalseClass, ::Regexp, ::Array, ::Set, ::Fixnum,
|
17
|
+
::Bignum, ::Float]
|
18
|
+
}
|
19
|
+
end
|
20
|
+
else
|
21
|
+
@allowed ||= begin
|
22
|
+
{
|
23
|
+
:keys => [],
|
24
|
+
:vals => [::NilClass, ::Hash, ::TrueClass, \
|
25
|
+
::FalseClass, ::Regexp, ::Array, ::Set, ::Integer,
|
26
|
+
::Float]
|
27
|
+
}
|
28
|
+
end
|
18
29
|
end
|
19
30
|
end
|
20
31
|
end
|
data/lib/extras/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: extras
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jordon Bedwell
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-06-
|
11
|
+
date: 2017-06-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: forwardable-extended
|