holywarez-mpt 0.1.3.8 → 0.1.3.9

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 +1 -0
  2. data/install_gem.bat +1 -1
  3. data/lib/system.rb +17 -0
  4. data/mpt.gemspec +1 -1
  5. metadata +1 -1
data/CHANGELOG CHANGED
@@ -1,3 +1,4 @@
1
+ v0.1.3.9 cache_method helper
1
2
  v0.1.3.8 Refactoring FilterChain array subclass
2
3
  v0.1.3.7 Bug fix for clear_owner_subscribers
3
4
  v0.1.3.6 Bug fix for Wrap.get default value
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.8.gem
4
+ call gem install mpt-0.1.3.9.gem
5
5
  cd ..
data/lib/system.rb CHANGED
@@ -8,3 +8,20 @@ class Object
8
8
  mod.send :undef_method, :mpt_instance_with_args_handler
9
9
  end
10
10
  end
11
+
12
+ class Class
13
+ def cache_method(method_name, cache_name = nil)
14
+ cache_attr_name = cache_name
15
+ cache_attr_name = "#{method_name.to_s}_cache" if cache_name.blank?
16
+
17
+ class_eval(<<-EOS, __FILE__, __LINE__)
18
+ def #{method_name.to_s}_with_cache_support(*args)
19
+ @#{cache_attr_name} ||= {}
20
+ @#{cache_attr_name}[args] ||= #{method_name.to_s}_without_cache_support( *args )
21
+ end
22
+
23
+ alias_method_chain :#{method_name.to_s}, :cache_support
24
+ EOS
25
+
26
+ end
27
+ 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.8"
5
+ s.version = "0.1.3.9"
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.8
4
+ version: 0.1.3.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anatoly Lapshin