holywarez-mpt 0.1.3.9 → 0.1.3.11
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.
- data/CHANGELOG +2 -0
- data/install_gem.bat +1 -1
- data/lib/wrap.rb +15 -3
- data/mpt.gemspec +1 -1
- metadata +1 -1
data/CHANGELOG
CHANGED
data/install_gem.bat
CHANGED
data/lib/wrap.rb
CHANGED
|
@@ -127,14 +127,26 @@ end
|
|
|
127
127
|
|
|
128
128
|
class Class
|
|
129
129
|
def wrappable(accessor_name, wrap_name)
|
|
130
|
+
acc_name = accessor_name.to_s
|
|
130
131
|
code = <<-EOS
|
|
131
|
-
def #{
|
|
132
|
-
MPT::Wrap.get("#{wrap_name}",
|
|
132
|
+
def #{acc_name}_with_wrap_support
|
|
133
|
+
MPT::Wrap.get( "#{wrap_name}",
|
|
134
|
+
Proc.new do
|
|
135
|
+
if self.respond_to?( :"#{acc_name}_without_wrap_support" )
|
|
136
|
+
self.send :"#{acc_name}_without_wrap_support"
|
|
137
|
+
end
|
|
138
|
+
end)
|
|
133
139
|
end
|
|
134
140
|
|
|
135
|
-
|
|
141
|
+
if self.public_instance_methods.include?( "#{acc_name}" )
|
|
142
|
+
alias_method_chain :"#{acc_name}", :wrap_support
|
|
143
|
+
else
|
|
144
|
+
alias :"#{acc_name}" :"#{acc_name}_with_wrap_support"
|
|
145
|
+
end
|
|
136
146
|
EOS
|
|
137
147
|
|
|
138
148
|
class_eval(code, __FILE__, __LINE__)
|
|
139
149
|
end
|
|
150
|
+
|
|
151
|
+
alias :wrapable :wrappable # "wrappable" will be removed in future versions
|
|
140
152
|
end
|
data/mpt.gemspec
CHANGED