mirroring_test 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/mirroring_test.rb +17 -3
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 820d2afb55da2cf69a3bc2aa663c70a797967e1dfe8c5b2a23e14d6bf80116cf
4
- data.tar.gz: f731d0ec78d34dd3c4230b5b03029e8960e5f01e9529a8dd68ab14e444697586
3
+ metadata.gz: 257f84450a88b161b2b8289bb154d8c687186138b07d0ad44791a846dd07a8b6
4
+ data.tar.gz: bd9d2ab10d68a23f738f8c620e9d588e9d5f8bb5514c48cffd43b0b53597602f
5
5
  SHA512:
6
- metadata.gz: '03049dd3c5413c9d7ea32ee0f1ff3141c27461fcefd45443b59c8b516a4c88e5faa32d95086f713bef3e680bf93a3309a5ad879fac18bc9c1118cfadaf0e7da1'
7
- data.tar.gz: 9a275f9a0c48c65e7b50684f972b12de344005eaea8e57a3e9434157bc2eae53ed462e75bd0bc9e85b99cf8139aa334355515ea4ef1c8ea213d1dc417b110260
6
+ metadata.gz: 06110ffa9eefb7fc1da3a1455a7a74f045e1334dc4d90e5e942c6aaf48499cfb4fe1c339736f6c90bd0bc14f50b01855b1abab9262cc92ac4f12cdf129980fe0
7
+ data.tar.gz: a18d5d1cc91db0740b21ede163463933878668e2f0680aa6055c053c59c823153bd55ea3566a6dae4c73667c5dcf3ae52b6e5e3a7521e8b10b76b18631539e3e
@@ -19,10 +19,24 @@ class MirroringTest
19
19
 
20
20
  private
21
21
 
22
- def method_missing(method_name, *args, &block) # rubocop:disable Style/MethodMissingSuper
23
- @receivers.map do |r|
24
- r.send(method_name, *args, &block) if r.respond_to?(method_name)
22
+ def method_missing(method_name, *args, &block)
23
+ first_ret_pair = @receivers.map do |r|
24
+ ret = [nil, nil]
25
+
26
+ next(ret) unless r.respond_to?(method_name)
27
+
28
+ begin
29
+ ret[0] = r.send(method_name, *args, &block)
30
+ rescue StandardError => e
31
+ ret[1] = e
32
+ end
33
+
34
+ ret
25
35
  end.first
36
+
37
+ raise(first_ret_pair[1]) unless first_ret_pair[1].nil?
38
+
39
+ first_ret_pair[0]
26
40
  end
27
41
 
28
42
  def respond_to_missing?(symbol, include_private)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mirroring_test
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
  - Taishi Kasuga
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-16 00:00:00.000000000 Z
11
+ date: 2020-04-27 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Call a same method for multiple receivers
14
14
  email: supercaracal@yahoo.co.jp