durable_decorator 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -1
- data/lib/durable_decorator/base.rb +8 -2
- data/lib/durable_decorator/version.rb +1 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -133,7 +133,7 @@ def one_param_method param
|
|
133
133
|
end
|
134
134
|
```
|
135
135
|
|
136
|
-
### No more
|
136
|
+
### No more surprise monkey patching
|
137
137
|
Once you decorate the method and seal it with its SHA, if some gem tries to come in and overwrite your work **BEFORE** decorate-time, DurableDecorator will warn you. Similarly, expect to see an exception bubble up if the definition of the original method has changed and requires a review and a re-hash.
|
138
138
|
|
139
139
|
The usefulness is for gem consumers, and their application-level specs.
|
@@ -96,6 +96,14 @@ module DurableDecorator
|
|
96
96
|
end
|
97
97
|
|
98
98
|
def determine_sha target
|
99
|
+
Util.method_sha extract_method(target)
|
100
|
+
end
|
101
|
+
|
102
|
+
def determine_arity target
|
103
|
+
extract_method(target).arity
|
104
|
+
end
|
105
|
+
|
106
|
+
def extract_method target
|
99
107
|
raise "Please provide a fully qualified method name: Module::Clazz#instance_method or .clazz_method" unless target && target.match(/\.|#/)
|
100
108
|
|
101
109
|
class_name, separator, method_name = target.match(/(.*)(\.|#)(.*)/)[1..3]
|
@@ -105,8 +113,6 @@ module DurableDecorator
|
|
105
113
|
else
|
106
114
|
clazz.method(method_name)
|
107
115
|
end
|
108
|
-
|
109
|
-
Util.method_sha(method)
|
110
116
|
end
|
111
117
|
end
|
112
118
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: durable_decorator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-08-
|
12
|
+
date: 2013-08-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: method_source
|