holywarez-mpt 0.1.3.9 → 0.1.3.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/CHANGELOG +2 -0
  2. data/install_gem.bat +1 -1
  3. data/lib/wrap.rb +15 -3
  4. data/mpt.gemspec +1 -1
  5. metadata +1 -1
data/CHANGELOG CHANGED
@@ -1,3 +1,5 @@
1
+ v0.1.3.11 wrappable was renamed to wrapable. "wrappable" will be removed in future versions
2
+ v0.1.3.10 wrap ability without accessor
1
3
  v0.1.3.9 cache_method helper
2
4
  v0.1.3.8 Refactoring FilterChain array subclass
3
5
  v0.1.3.7 Bug fix for clear_owner_subscribers
data/install_gem.bat CHANGED
@@ -1,5 +1,5 @@
1
1
  call rake manifest
2
2
  call rake install
3
3
  cd pkg
4
- call gem install mpt-0.1.3.9.gem
4
+ call gem install mpt-0.1.3.11.gem
5
5
  cd ..
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 #{accessor_name.to_s}_with_wrap_support
132
- MPT::Wrap.get("#{wrap_name}", Proc.new { self.send :"#{accessor_name.to_s}_without_wrap_support" })
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
- alias_method_chain :#{accessor_name.to_s}, :wrap_support
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
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{mpt}
5
- s.version = "0.1.3.9"
5
+ s.version = "0.1.3.11"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Anatoly Lapshin"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: holywarez-mpt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3.9
4
+ version: 0.1.3.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anatoly Lapshin