backports 3.11.2 → 3.11.3

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: 544fc0fdfde45e2f7545c55cc240f9ea59d66107
4
- data.tar.gz: 62f0dbfd4df084022ab983e17ab040647e906ef2
3
+ metadata.gz: 6221e2957392ceef7046212b4700e72a29c465e1
4
+ data.tar.gz: cb89d81be38cee787dd485539c569b829239f4f9
5
5
  SHA512:
6
- metadata.gz: b9659fda7635ff3b7c9949a72394ce390c52cb077f9ce46143cc89ad8d599c8653edc8b800a88a07581a3f562433bae32a4ff64b3ea9ed5b971f830173363fcb
7
- data.tar.gz: 4c88602d22577ab20dd5fe704a0b043f76353856f6e52274159f575c6233386e27c1e27561e47aedccf78b4130b32b685b3f0bf781c90e2899733dfe2ebcc778
6
+ metadata.gz: 95ed8884c48d73fd8a256a8349b1a6153f87c470b59192a68077007faf20d1060c4eab829e78593551ba83ed2c1167c883c2c06ff35e7c3313add7bbd061c0b9
7
+ data.tar.gz: 3dfa16f8fb066bddc0aee4258fc0d3d21d23c518570e13a4fb5ce9b202a61768a11d621daf04900533c1343eeedcf7f4785862115263380a203f17e5e463bcb5
@@ -4,7 +4,17 @@
4
4
  unless Object.method_defined? :try
5
5
  class Object
6
6
  def try(*a, &b)
7
- try!(*a, &b) if a.empty? || respond_to?(a.first)
7
+ if a.empty? || respond_to?(a.first)
8
+ if a.empty? && block_given?
9
+ if b.arity == 0
10
+ instance_eval(&b)
11
+ else
12
+ yield self
13
+ end
14
+ else
15
+ public_send(*a, &b)
16
+ end
17
+ end
8
18
  end
9
19
  end
10
20
 
@@ -1,3 +1,3 @@
1
1
  module Backports
2
- VERSION = "3.11.2" unless const_defined? :VERSION # the guard is against a redefinition warning that happens on Travis
2
+ VERSION = "3.11.3" unless const_defined? :VERSION # the guard is against a redefinition warning that happens on Travis
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: backports
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.11.2
4
+ version: 3.11.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marc-André Lafortune
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-10 00:00:00.000000000 Z
11
+ date: 2018-04-16 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Essential backports that enable many of the nice features of Ruby 1.8.7
14
14
  up to 2.1.0 for earlier versions.
@@ -991,7 +991,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
991
991
  version: '0'
992
992
  requirements: []
993
993
  rubyforge_project:
994
- rubygems_version: 2.6.13
994
+ rubygems_version: 2.6.14
995
995
  signing_key:
996
996
  specification_version: 4
997
997
  summary: Backports of Ruby features for older Ruby.