try_chain 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/try_chain.rb +8 -2
- data/lib/try_chain/version.rb +1 -1
- data/try_chain.gemspec +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ea02e9c6921486a1fc170beebc4dc04925a457a
|
4
|
+
data.tar.gz: e5112eb6eda95000aa5d6ada5719dc90019e41ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a4752a592201dbb6cc79f4679e74efa620f5a94e7021ab6d917fc627c4c0a6f2e859bce5fcfb0059724dba7be7b4db4fd64cff1bc1e941772e20fd0ff8b86af3
|
7
|
+
data.tar.gz: 0a18310b600a6176c7fcbe0c78c5cd88eb4fcf296752d31b5a6887f3d5437e52faed6ea361fdf88b84b9ee1d6d10482fe7cc191f8a4f5003f836a437db0d9cb2
|
data/lib/try_chain.rb
CHANGED
@@ -30,7 +30,10 @@ module TryChain
|
|
30
30
|
symbols.compact!
|
31
31
|
|
32
32
|
symbols.reduce(self) do |result, symbol|
|
33
|
-
result = result.try
|
33
|
+
result = result.try do |selph|
|
34
|
+
selph.__send__(symbol) if selph.respond_to?(symbol, true)
|
35
|
+
end
|
36
|
+
|
34
37
|
break nil if result.nil?
|
35
38
|
result
|
36
39
|
end
|
@@ -43,7 +46,10 @@ module TryChain
|
|
43
46
|
symbols.compact!
|
44
47
|
|
45
48
|
symbols.reduce(self) do |result, symbol|
|
46
|
-
result = result.try!
|
49
|
+
result = result.try! do |selph|
|
50
|
+
selph.__send__(symbol)
|
51
|
+
end
|
52
|
+
|
47
53
|
break nil if result.nil?
|
48
54
|
result
|
49
55
|
end
|
data/lib/try_chain/version.rb
CHANGED
data/try_chain.gemspec
CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |gem|
|
|
20
20
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
21
21
|
gem.require_paths = ["lib"]
|
22
22
|
|
23
|
-
gem.add_dependency "activesupport"
|
23
|
+
gem.add_dependency "activesupport", ">= 3.1.0"
|
24
24
|
|
25
25
|
gem.add_development_dependency "bundler", "~> 1.3"
|
26
26
|
gem.add_development_dependency "rake"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: try_chain
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Dewitt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-05-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '>='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 3.1.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 3.1.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -103,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
103
103
|
version: '0'
|
104
104
|
requirements: []
|
105
105
|
rubyforge_project:
|
106
|
-
rubygems_version: 2.
|
106
|
+
rubygems_version: 2.2.2
|
107
107
|
signing_key:
|
108
108
|
specification_version: 4
|
109
109
|
summary: don't use this unless you really need to use it, it is bad form to have "try
|