around_the_world 0.23.4 → 0.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 39523a91ec8f7bbd109e5d7f84d6c9065a005d4a68a9dfca287f5c5b3719fbc8
4
- data.tar.gz: '0875953b877c715e7cc79b43e75e279b22d67eaed7e11d43089a15a44666e2d4'
3
+ metadata.gz: 547a9d3c61c5dfe4e82a1981a2654289ece99846b91fb8897470b83a48a2d7c7
4
+ data.tar.gz: 330e189d0daf3ca880b33618c4032c5ce620a6832c5f5fae09704c00b520374d
5
5
  SHA512:
6
- metadata.gz: db00f0de2c9967e679f7926525bcaca3139ea29baf66744dd5d81e67150d2ac760ababa527d3e1b0119276d3baf56924a15f40c0e12c8553d28890602ee95637
7
- data.tar.gz: b844677b2d7828aaba2591e2d2896b9fe9ea9fb80015ab4c92af69fc490d73c1671c37527e40f70256d77ba3d2ace6a0c272f16dcefc079210af3997cec49750
6
+ metadata.gz: 8a4a5f9799131e97ecff99d8d84090a1aef316528d687a17798d8665d9d18a4b1be062c93b8f229556b1d23da1505fc7b941e551cd20d5d71daae31fa3c3c5df
7
+ data.tar.gz: 17bcba1c91f1fc05e2d32b2b694ad7d844a1508da0c68a6fbb7e4c7261b03eecc471a0145257a0871416330fedb101d100a081bfaf27b1b4f369c0577e42794f
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.24.0"
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.24.0
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-07-28 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.24.0
51
51
  post_install_message:
52
52
  rdoc_options: []
53
53
  require_paths:
@@ -63,7 +63,7 @@ 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
+ rubygems_version: 3.1.4
67
67
  signing_key:
68
68
  specification_version: 4
69
69
  summary: Allows you to easily wrap methods with custom logic on any class