mobj 2.9.6 → 3.0.0
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 +10 -2
- data/lib/ext/basic_object.rb +8 -0
- data/lib/ext/hash.rb +6 -0
- data/lib/ext/nil.rb +12 -0
- data/lib/ext/proc.rb +9 -0
- data/lib/mobj.rb +1 -1
- metadata +7 -18
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YjgyNWY0ZmU0NTFiNjg5MTVhZjVkYmFiODExZGEyYTNlODBjMjcxYQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZTEwN2FmZGM4YWVkYTU3NmM3NmI0MWM0ZWY1MDlmMjViOTU1M2I0Yg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YWY0Y2I2MDNiNzIwMmE0OTIyMDhlMDdhZGQ0MTIyYjcyYTlhMTIxZmI5MWFh
|
10
|
+
ZmUzYTk2M2M2MjA4NDJmOWViYWIwZjUyYzZmYTlkZDMyMzI2MGZmN2Q3OWU0
|
11
|
+
ZWRmNjNkZDgzY2UxZDExZjcwNjg1ZDA1NzExN2I2MGI4YjlhODk=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
N2EwYjBkNTIzNzAxOWVjMDAxNTQwZDAyZmFkZjhiZWQwZmViZDAzOGMwODQ4
|
14
|
+
ZDZkNWY4MmMyMzdjY2NjMTlkYTIzZDI3OWE1OTFlMzU4MDFiMTIwMTVkNzI5
|
15
|
+
MjBjZmIyYTNhMmFmMjRiNDQ0ODM2MDkwZGE3MjAwNzJmNDgyZTI=
|
data/lib/ext/array.rb
CHANGED
@@ -47,8 +47,16 @@ module Mobj
|
|
47
47
|
|
48
48
|
alias_method :earliest, :return_first
|
49
49
|
|
50
|
-
def msym
|
51
|
-
|
50
|
+
def msym() map(&:sym) end
|
51
|
+
|
52
|
+
def apply(to)
|
53
|
+
map do |m|
|
54
|
+
if m.is_a?(Symbol)
|
55
|
+
to.send(m)
|
56
|
+
else
|
57
|
+
m.to_s.walk(to)
|
58
|
+
end
|
59
|
+
end
|
52
60
|
end
|
53
61
|
|
54
62
|
def meach(*args, &block)
|
data/lib/ext/basic_object.rb
CHANGED
data/lib/ext/hash.rb
CHANGED
data/lib/ext/nil.rb
CHANGED
@@ -14,6 +14,18 @@ module Mobj
|
|
14
14
|
true
|
15
15
|
end
|
16
16
|
|
17
|
+
def tru?(_=nil, f=nil, &block)
|
18
|
+
f
|
19
|
+
end
|
20
|
+
|
21
|
+
def fals?(val=nil, &block)
|
22
|
+
if block
|
23
|
+
block.call(val)
|
24
|
+
else
|
25
|
+
val
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
17
29
|
def null?(*)
|
18
30
|
@@null ||= nil
|
19
31
|
@@null && @@null == __mobj__caller
|
data/lib/ext/proc.rb
ADDED
data/lib/mobj.rb
CHANGED
@@ -43,7 +43,7 @@ module Mobj
|
|
43
43
|
path.map { |pth| obj[pth.sym] }
|
44
44
|
elsif path[0] == '*' && obj.respond_to?(path[1..-1].sym)
|
45
45
|
obj.__send__(path[1..-1].sym)
|
46
|
-
elsif obj.respond_to?
|
46
|
+
elsif obj.respond_to?(:[]) && (obj.is_a?(Hash) || path.to_s =~ /[0-9.-]+/)
|
47
47
|
if obj.is_a?(Hash)
|
48
48
|
obj[path.sym]
|
49
49
|
else
|
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:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
- Mason
|
7
|
+
- Mason Glaves
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-06-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -24,20 +24,6 @@ dependencies:
|
|
24
24
|
- - ! '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: rr
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ! '>='
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ! '>='
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: awesome_print
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -52,7 +38,9 @@ dependencies:
|
|
52
38
|
- - ! '>='
|
53
39
|
- !ruby/object:Gem::Version
|
54
40
|
version: '0'
|
55
|
-
description: Utils and extentions for various ruby objects
|
41
|
+
description: ! 'Utils and extentions for various ruby objects
|
42
|
+
|
43
|
+
'
|
56
44
|
email: mobj@chipped.net
|
57
45
|
executables: []
|
58
46
|
extensions: []
|
@@ -67,6 +55,7 @@ files:
|
|
67
55
|
- lib/ext/match_data.rb
|
68
56
|
- lib/ext/nil.rb
|
69
57
|
- lib/ext/object.rb
|
58
|
+
- lib/ext/proc.rb
|
70
59
|
- lib/ext/string.rb
|
71
60
|
- lib/ext/symbol.rb
|
72
61
|
- lib/mobj.rb
|