around_the_world 0.23.4 → 0.23.5

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
  SHA256:
3
- metadata.gz: 39523a91ec8f7bbd109e5d7f84d6c9065a005d4a68a9dfca287f5c5b3719fbc8
4
- data.tar.gz: '0875953b877c715e7cc79b43e75e279b22d67eaed7e11d43089a15a44666e2d4'
3
+ metadata.gz: 1f333b590dcf391d8183041e7e07d9a0e3449f512877fd2292303454493e5d99
4
+ data.tar.gz: 19af144b596a775a74d0c79a55cb24102d07a37b1b96051a9a968ab53caece3c
5
5
  SHA512:
6
- metadata.gz: db00f0de2c9967e679f7926525bcaca3139ea29baf66744dd5d81e67150d2ac760ababa527d3e1b0119276d3baf56924a15f40c0e12c8553d28890602ee95637
7
- data.tar.gz: b844677b2d7828aaba2591e2d2896b9fe9ea9fb80015ab4c92af69fc490d73c1671c37527e40f70256d77ba3d2ace6a0c272f16dcefc079210af3997cec49750
6
+ metadata.gz: ca64d7ef50f18b5939d927e672ab8e819b2a3e981063781141c2f96d9aedb8c81ad9c675e8f03f04f3af5c6f0f5b6ea4891c7e07605a8cbae40c1060a75cb28f
7
+ data.tar.gz: fe376821a59725a78eb8e06ce13a5f3e4cd23a14b3ae4f95bc105bebcfcf3547eb9c59051cabc2dc7d9cc56c3f87b3d3482d1788db8c7aa11c52a8ec07ab9783
data/README.md CHANGED
@@ -48,8 +48,12 @@ class SomeClass
48
48
  !!@something_happened
49
49
  end
50
50
 
51
- around_method :make_something_happen!, :did_something_happened? do |*args, **opts|
52
- things_happened = super(*args, **opts)
51
+ around_method :make_something_happen!, :did_something_happened? do |*args| # use |...| for ruby 2.7+
52
+ # For Ruby <= 2.6:
53
+ things_happened = super(*args)
54
+
55
+ #Or, for Ruby <= 2.7:
56
+ things_happened = super(...)
53
57
 
54
58
  if things_happened
55
59
  "Something happened!"
@@ -82,12 +86,12 @@ class SomeClass
82
86
  "method behavior"
83
87
  end
84
88
 
85
- around_method :some_method, prevent_double_wrapping_for: :memoization do |*args, **opts|
86
- @memoized ||= super(*args, **opts)
89
+ around_method :some_method, prevent_double_wrapping_for: :memoization do |...|
90
+ @memoized ||= super(...)
87
91
  end
88
92
 
89
- around_method :some_method, prevent_double_wrapping_for: :memoization do |*args, **opts|
90
- @memoized ||= super(*args, **opts)
93
+ around_method :some_method, prevent_double_wrapping_for: :memoization do |...|
94
+ @memoized ||= super(...)
91
95
  end
92
96
  end
93
97
  ```
@@ -108,8 +112,8 @@ class SomeClass
108
112
 
109
113
  def a_singleton_method; end
110
114
 
111
- around_method :a_singleton_method do |*args, **opts|
112
- super(*args, **opts)
115
+ around_method :a_singleton_method do |...|
116
+ super(...) # See above for ruby <= 2.6 syntax
113
117
 
114
118
  "It works for class methods too!"
115
119
  end
@@ -23,9 +23,13 @@ module AroundTheWorld
23
23
  #
24
24
  # @example
25
25
  # class SomeClass
26
- # around_method :dont_look_in_here do |*args, **opts|
27
- # things_happened = super(*args, **opts)
28
- #
26
+ # around_method :make_something_happen!, :did_something_happened? do |*args| # use |...| for ruby 2.7+
27
+ # # For Ruby <= 2.6:
28
+ # things_happened = super(*args)
29
+
30
+ # #Or, for Ruby <= 2.7:
31
+ # things_happened = super(...)
32
+
29
33
  # if things_happened
30
34
  # "Something happened!"
31
35
  # else
@@ -42,19 +46,19 @@ module AroundTheWorld
42
46
  # => "Something happened!"
43
47
  #
44
48
  # @example
45
- # around_method :dont_look_in_here, prevent_double_wrapping_for: :memoization do |*args, **opts|
46
- # @memoized ||= super(*args, **opts)
49
+ # around_method :dont_look_in_here, prevent_double_wrapping_for: :memoization do |...|
50
+ # @memoized ||= super(...)
47
51
  # end
48
52
  #
49
- # around_method :dont_look_in_here, prevent_double_wrapping_for: :memoization do |*args, **opts|
50
- # @memoized ||= super(*args, **opts)
53
+ # around_method :dont_look_in_here, prevent_double_wrapping_for: :memoization do |...|
54
+ # @memoized ||= super(...)
51
55
  # end
52
56
  # # => AroundTheWorld::DoubleWrapError:
53
57
  # "Module AroundTheWorld:ProxyModule:memoization already defines the method :dont_look_in_here"
54
58
  #
55
- # around_method :dont_look_in_here do |*args, **opts|
59
+ # around_method :dont_look_in_here do |...|
56
60
  # do_something_else
57
- # super(*args, **opts)
61
+ # super(...)
58
62
  # end
59
63
  # # => no error raised
60
64
  #
@@ -65,8 +69,8 @@ module AroundTheWorld
65
69
  # class << self
66
70
  # def a_singleton_method; end
67
71
  #
68
- # around_method :a_singleton_method do |*args, **opts|
69
- # super(*args, **opts)
72
+ # around_method :a_singleton_method do |...|
73
+ # super(...)
70
74
  # "It works for class methods too!"
71
75
  # end
72
76
  # end
@@ -2,5 +2,5 @@
2
2
 
3
3
  module AroundTheWorld
4
4
  # This constant is managed by spicerack
5
- VERSION = "0.23.4"
5
+ VERSION = "0.23.5"
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: around_the_world
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.23.4
4
+ version: 0.23.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Allen Rettberg
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-27 00:00:00.000000000 Z
11
+ date: 2020-04-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -47,7 +47,7 @@ metadata:
47
47
  homepage_uri: https://github.com/Freshly/spicerack/tree/master/around_the_world
48
48
  source_code_uri: https://github.com/Freshly/spicerack/tree/master/around_the_world
49
49
  changelog_uri: https://github.com/Freshly/spicerack/blob/master/around_the_world/CHANGELOG.md
50
- documentation_uri: https://www.rubydoc.info/gems/around_the_world/0.23.4
50
+ documentation_uri: https://www.rubydoc.info/gems/around_the_world/0.23.5
51
51
  post_install_message:
52
52
  rdoc_options: []
53
53
  require_paths:
@@ -63,7 +63,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
63
63
  - !ruby/object:Gem::Version
64
64
  version: '0'
65
65
  requirements: []
66
- rubygems_version: 3.1.2
66
+ rubyforge_project:
67
+ rubygems_version: 2.7.6
67
68
  signing_key:
68
69
  specification_version: 4
69
70
  summary: Allows you to easily wrap methods with custom logic on any class