deprecations 1.0.4 → 1.0.6

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: 8f3f137ca9a5beb63eb3bdd08488fff97528ca7b
4
- data.tar.gz: d7ea7405ba490ee635a0a299acb96af174ac4f10
3
+ metadata.gz: 064a99641237ee41d70976c9c5cafa6dc8a0be84
4
+ data.tar.gz: 7e7319c47c7a1a139f91f72eb85a118c3af23d36
5
5
  SHA512:
6
- metadata.gz: 80b8a7f300eac8799d2b813e0eee5481da2dc06716893a851585c876c21f32c68952f38f30e1233e440decc2249a48163a023b6a3cf74dd9056bbb60058ee25d
7
- data.tar.gz: ca23236eda75c3e37649cd464bb9fe22f4944fbd260a318c9980ff6acf63656b1641342f1e0e60baa6fa4856b4f99cfe56f661e9e51348f7797a6e7a036a5b09
6
+ metadata.gz: d310d9d4976fa37ecf45553cb7293b700038b2edd3a55b62b25d7fbae189b7ef7cf17fc0bc038c8ff04365ec12667b0f04792ca8839b093a93ce5d169b2ea279
7
+ data.tar.gz: e14e5e36289647e13f9d3aac770f7ccac25cfbed20c4f9e9471f8270c4865fc96838a3d1a0421f65859dc9cbd71663720c05e5bcc8483a58ecfb1b06d387bb56
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ### deprecations 1.0.6
2
+ - support for textual alternative of deprecated methods
3
+
1
4
  ### deprecations 1.0.4
2
5
  - less code, better algorithm to overload deprecated methods
3
6
  - no more private «shadow methods»
@@ -18,7 +18,7 @@ module Deprecations
18
18
  decorated = Class === self ? "#{self}." : "#{self.class}#"
19
19
  Deprecations.call(
20
20
  "#{decorated}#{__method__}",
21
- alternative.nil? ? nil : "#{decorated}#{alternative.name}",
21
+ UnboundMethod === alternative ? "#{decorated}#{alternative.name}" : alternative,
22
22
  outdated
23
23
  )
24
24
  method.bind(self).call(*a, &b)
@@ -37,7 +37,7 @@ module Deprecations
37
37
 
38
38
  def deprecated(method_name, alternative = nil, outdated = nil)
39
39
  m = __method(method_name) or __method_not_found!(method_name)
40
- a = alternative.nil? ? nil : (__method(alternative) or __method_not_found!(alternative))
40
+ a = Symbol === alternative ? (__method(alternative) or __method_not_found!(alternative)) : alternative
41
41
  __method_deprecated!(m, a, outdated)
42
42
  end
43
43
  end
@@ -48,7 +48,7 @@ module Deprecations
48
48
 
49
49
  def deprecated(method_name, alternative = nil, outdated = nil)
50
50
  m = __method(method_name) or return singleton_class.send(:deprecated, method_name, alternative, outdated)
51
- a = alternative.nil? ? nil : (__method(alternative) or __method_not_found!(alternative))
51
+ a = Symbol === alternative ? (__method(alternative) or __method_not_found!(alternative)) : alternative
52
52
  __method_deprecated!(m, a, outdated)
53
53
  end
54
54
 
@@ -1,3 +1,3 @@
1
1
  module Deprecations
2
- VERSION = '1.0.4'
2
+ VERSION = '1.0.6'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deprecations
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Blumtritt