mobj 2.9.2 → 2.9.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/ext/array.rb +2 -2
- data/lib/ext/hash.rb +3 -3
- data/lib/ext/nil.rb +4 -0
- data/lib/ext/object.rb +8 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
M2JjNWRjYWY5ZGY0ZmI5NjNkOGExMmMyNDQwNWZlNDVhZmU4NTQ4NQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NjIyZjE5YWUxODEwZmRmNDczODM5Y2MxODA4MTQ1ZmFmZjlkMjdhYg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YmYwMjg2NGYyNTMzZTdkY2QwNmY3YjkxMWFmZjIxZTAxNzBmMDNhNTM5OTg4
|
10
|
+
ZjdmMTE2MzgzMzBjN2JhODEwMjdlZmRiODFhN2VmZWZmMDM0MDk5MTIyNGZj
|
11
|
+
NzMzNDNkYjMyYWJlYzBiYmVkODI0Yzg5YjJlMDcyMDc3MjJmM2Y=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YzE1YzE3NmI4NGI3NjhmYzNmYTgyMjg5NDAwMjI5YTk0NTc4MzNjMzAzZTc2
|
14
|
+
N2I5ZGJjNjFlZmEyZDY5ZWNlYjAyOWI2Nzc2N2JmOTI2NzhkZTZhZmFkMTQz
|
15
|
+
NGIwOTgyZmMxN2MxMDA4N2Y3ZDUwN2FmYzg0ZjA4OGNmZTFiMDE=
|
data/lib/ext/array.rb
CHANGED
data/lib/ext/hash.rb
CHANGED
@@ -65,9 +65,9 @@ module Mobj
|
|
65
65
|
class ::Hash
|
66
66
|
include HashEx
|
67
67
|
|
68
|
-
|
69
|
-
|
70
|
-
|
68
|
+
alias_method :mlookup, :[]
|
69
|
+
alias_method :mdef, :default
|
70
|
+
alias_method :mfetch, :fetch
|
71
71
|
|
72
72
|
def [](*fkeys)
|
73
73
|
fkeys.map { |key| mlookup(key) || mfetch(key.sym) { mfetch(key.to_s) { mfetch(ki(key).sym) { mfetch(ki(key).to_s) { mdef(key) } } } } }.sequester
|
data/lib/ext/nil.rb
CHANGED
data/lib/ext/object.rb
CHANGED
@@ -1,7 +1,14 @@
|
|
1
1
|
module Mobj
|
2
2
|
|
3
3
|
class ::Object
|
4
|
-
|
4
|
+
alias_method :responds_to?, :respond_to?
|
5
|
+
|
6
|
+
def i!() respond_to?(:to_i) ? to_i : to_s.to_i end
|
7
|
+
def f!() respond_to?(:to_f) ? to_f : to_s.to_f end
|
8
|
+
def z?() respond_to?(:zero?) ? zero? : f!.zero? end
|
9
|
+
def zeno!() z? ? 1 : self end
|
10
|
+
|
11
|
+
alias_method :n?, :nil?
|
5
12
|
|
6
13
|
def rand?
|
7
14
|
rand(1000000).odd?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mobj
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.9.
|
4
|
+
version: 2.9.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mason
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-05-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|