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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 860a265e5780c5528761f44f949e04751d3a41d2
4
- data.tar.gz: b4b2f922ab71513630eca2896e3c540f09371f96
3
+ metadata.gz: 2ea02e9c6921486a1fc170beebc4dc04925a457a
4
+ data.tar.gz: e5112eb6eda95000aa5d6ada5719dc90019e41ed
5
5
  SHA512:
6
- metadata.gz: 651632272c2fe6be77d97d1f8215f19080f07223a589d0012bb8096b7edf2824d143ff5e8975812fbfc1ff02f9323e4dea36d966e5e4af837a609f69ff2a9712
7
- data.tar.gz: 525b87f19d85383389dfd53e501bfab796ca6fa5ec0d3b93d67713270aab3736301f62263d3dc3e267ee30bc361fe0ce810d5691326493ce922ddfcc4bfbbd8e
6
+ metadata.gz: a4752a592201dbb6cc79f4679e74efa620f5a94e7021ab6d917fc627c4c0a6f2e859bce5fcfb0059724dba7be7b4db4fd64cff1bc1e941772e20fd0ff8b86af3
7
+ data.tar.gz: 0a18310b600a6176c7fcbe0c78c5cd88eb4fcf296752d31b5a6887f3d5437e52faed6ea361fdf88b84b9ee1d6d10482fe7cc191f8a4f5003f836a437db0d9cb2
@@ -30,7 +30,10 @@ module TryChain
30
30
  symbols.compact!
31
31
 
32
32
  symbols.reduce(self) do |result, symbol|
33
- result = result.try(symbol)
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!(symbol)
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
@@ -1,3 +1,3 @@
1
1
  module TryChain
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -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.3
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: 2013-11-19 00:00:00.000000000 Z
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: '0'
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: '0'
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.0.3
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