around_the_world 0.23.1.1 → 0.23.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -8
- data/lib/around_the_world/version.rb +1 -1
- data/lib/around_the_world.rb +10 -10
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 186df9a8c110d06b1a03a68f8cf00f49d9ad0ca97c33cad91183a0abd509ebe0
|
4
|
+
data.tar.gz: 0bf4a264d89090a55650bf3f9d5c6cd5883361b1b1fb5f4bfe42c31bbb0c0ac4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a4b0f11e4147726112eea2347eb807645e5f1e3a9e7e69fe945e770eab4ac0cfa1d1b65de92ca0ccc0a958e5dd2d6b3ac6040cd288d322d8b46adaa06f8f9e39
|
7
|
+
data.tar.gz: 543ecc59d9325f6b70c8670b417c693454855f4ee552223ce9737f6ccab86c4d2145b9649355be73a6e8f8f64babbc8ee0bc2261aba200ecac86a2b2db02b8cd
|
data/README.md
CHANGED
@@ -44,8 +44,8 @@ class SomeClass
|
|
44
44
|
true
|
45
45
|
end
|
46
46
|
|
47
|
-
around_method :did_something_happened? do |*args|
|
48
|
-
things_happened = super(*args)
|
47
|
+
around_method :did_something_happened? do |*args, **opts|
|
48
|
+
things_happened = super(*args, **opts)
|
49
49
|
|
50
50
|
if things_happened
|
51
51
|
"Something happened!"
|
@@ -72,12 +72,12 @@ class SomeClass
|
|
72
72
|
"method behavior"
|
73
73
|
end
|
74
74
|
|
75
|
-
around_method :some_method, prevent_double_wrapping_for: :memoization do |*args|
|
76
|
-
@memoized ||= super(*args)
|
75
|
+
around_method :some_method, prevent_double_wrapping_for: :memoization do |*args, **opts|
|
76
|
+
@memoized ||= super(*args, **opts)
|
77
77
|
end
|
78
78
|
|
79
|
-
around_method :some_method, prevent_double_wrapping_for: :memoization do |*args|
|
80
|
-
@memoized ||= super(*args)
|
79
|
+
around_method :some_method, prevent_double_wrapping_for: :memoization do |*args, **opts|
|
80
|
+
@memoized ||= super(*args, **opts)
|
81
81
|
end
|
82
82
|
end
|
83
83
|
```
|
@@ -98,8 +98,8 @@ class SomeClass
|
|
98
98
|
|
99
99
|
def a_singleton_method; end
|
100
100
|
|
101
|
-
around_method :a_singleton_method do |*args|
|
102
|
-
super(*args)
|
101
|
+
around_method :a_singleton_method do |*args, **opts|
|
102
|
+
super(*args, **opts)
|
103
103
|
|
104
104
|
"It works for class methods too!"
|
105
105
|
end
|
data/lib/around_the_world.rb
CHANGED
@@ -23,8 +23,8 @@ module AroundTheWorld
|
|
23
23
|
#
|
24
24
|
# @example
|
25
25
|
# class SomeClass
|
26
|
-
# around_method :dont_look_in_here do |*args|
|
27
|
-
# things_happened = super(*args)
|
26
|
+
# around_method :dont_look_in_here do |*args, **opts|
|
27
|
+
# things_happened = super(*args, **opts)
|
28
28
|
#
|
29
29
|
# if things_happened
|
30
30
|
# "Something happened!"
|
@@ -42,19 +42,19 @@ module AroundTheWorld
|
|
42
42
|
# => "Something happened!"
|
43
43
|
#
|
44
44
|
# @example
|
45
|
-
# around_method :dont_look_in_here, prevent_double_wrapping_for: :memoization do |*args|
|
46
|
-
# @memoized ||= super(*args)
|
45
|
+
# around_method :dont_look_in_here, prevent_double_wrapping_for: :memoization do |*args, **opts|
|
46
|
+
# @memoized ||= super(*args, **opts)
|
47
47
|
# end
|
48
48
|
#
|
49
|
-
# around_method :dont_look_in_here, prevent_double_wrapping_for: :memoization do |*args|
|
50
|
-
# @memoized ||= super(*args)
|
49
|
+
# around_method :dont_look_in_here, prevent_double_wrapping_for: :memoization do |*args, **opts|
|
50
|
+
# @memoized ||= super(*args, **opts)
|
51
51
|
# end
|
52
52
|
# # => AroundTheWorld::DoubleWrapError:
|
53
53
|
# "Module AroundTheWorld:ProxyModule:memoization already defines the method :dont_look_in_here"
|
54
54
|
#
|
55
|
-
# around_method :dont_look_in_here do |*args|
|
55
|
+
# around_method :dont_look_in_here do |*args, **opts|
|
56
56
|
# do_something_else
|
57
|
-
# super(*args)
|
57
|
+
# super(*args, **opts)
|
58
58
|
# end
|
59
59
|
# # => no error raised
|
60
60
|
#
|
@@ -65,8 +65,8 @@ module AroundTheWorld
|
|
65
65
|
# class << self
|
66
66
|
# def a_singleton_method; end
|
67
67
|
#
|
68
|
-
# around_method :a_singleton_method do |*args|
|
69
|
-
# super(*args)
|
68
|
+
# around_method :a_singleton_method do |*args, **opts|
|
69
|
+
# super(*args, **opts)
|
70
70
|
# "It works for class methods too!"
|
71
71
|
# end
|
72
72
|
# 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.1.
|
4
|
+
version: 0.23.1.2
|
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-
|
11
|
+
date: 2020-03-10 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.1.
|
50
|
+
documentation_uri: https://www.rubydoc.info/gems/around_the_world/0.23.1.2
|
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.
|
66
|
+
rubygems_version: 3.1.2
|
67
67
|
signing_key:
|
68
68
|
specification_version: 4
|
69
69
|
summary: Allows you to easily wrap methods with custom logic on any class
|