benelux 0.5.15 → 0.5.16
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES.txt +6 -0
- data/benelux.gemspec +1 -1
- data/lib/benelux.rb +1 -1
- data/lib/benelux/packer.rb +21 -1
- data/lib/benelux/stats.rb +2 -1
- metadata +2 -2
data/CHANGES.txt
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
BENELUX, CHANGES
|
2
2
|
|
3
3
|
|
4
|
+
#### 0.5.16 (2010-06-08) ##############################
|
5
|
+
|
6
|
+
* ADDED: Support for timing class methods.
|
7
|
+
* ADDED: New Calculator attribute: time
|
8
|
+
|
9
|
+
|
4
10
|
#### 0.5.15 (2010-04-03) ##############################
|
5
11
|
|
6
12
|
* FIXED: require 'storable'. Rookie!
|
data/benelux.gemspec
CHANGED
data/lib/benelux.rb
CHANGED
data/lib/benelux/packer.rb
CHANGED
@@ -41,8 +41,18 @@ module Benelux
|
|
41
41
|
thread_id, call_id = Thread.current.object_id.abs, @klass.object_id.abs
|
42
42
|
@methorig = methorig = :"__benelux_#{@meth}_#{thread_id}_#{call_id}"
|
43
43
|
Benelux.ld "%20s: %s" % ['Alias', @methorig]
|
44
|
+
|
44
45
|
@klass.module_eval do
|
45
|
-
|
46
|
+
Benelux.ld [:def, self, m,
|
47
|
+
MethodPacker.method_defined?(self, m),
|
48
|
+
MethodPacker.class_method_defined?(self, m)].inspect
|
49
|
+
if MethodPacker.method_defined?(self, m)
|
50
|
+
alias_method methorig, m # Can't use the instance variables
|
51
|
+
elsif MethodPacker.class_method_defined?(self, m)
|
52
|
+
eval "class << self; alias #{methorig} #{m}; end"
|
53
|
+
else
|
54
|
+
raise BeneluxError, "No such method: #{self}.#{m}"
|
55
|
+
end
|
46
56
|
end
|
47
57
|
install_method # see generate_packed_method
|
48
58
|
self.add_tags :class => @klass.to_s.to_sym,
|
@@ -55,6 +65,16 @@ module Benelux
|
|
55
65
|
Benelux.packed_methods[:all] << self
|
56
66
|
|
57
67
|
end
|
68
|
+
def self.method_defined?(klass, meth)
|
69
|
+
meth &&= meth.to_s if RUBY_VERSION < "1.9"
|
70
|
+
klass.method_defined?(meth) ||
|
71
|
+
klass.private_method_defined?(meth) ||
|
72
|
+
klass.protected_method_defined?(meth)
|
73
|
+
end
|
74
|
+
def self.class_method_defined?(klass, meth)
|
75
|
+
meth &&= meth.to_s if RUBY_VERSION < "1.9"
|
76
|
+
klass.singleton_methods.member? meth
|
77
|
+
end
|
58
78
|
def install_method
|
59
79
|
raise "You need to implement this method"
|
60
80
|
end
|
data/lib/benelux/stats.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: benelux
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Delano Mandelbaum
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-
|
12
|
+
date: 2010-06-08 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|