monkey-lib 0.5.1 → 0.5.2
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/lib/monkey/backend.rb +1 -1
- data/lib/monkey/ext.rb +23 -10
- metadata +4 -4
data/lib/monkey/backend.rb
CHANGED
data/lib/monkey/ext.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require "pathname"
|
2
|
+
require "monkey/engine"
|
2
3
|
|
3
4
|
module Monkey
|
4
5
|
module Ext
|
@@ -25,17 +26,29 @@ module Monkey
|
|
25
26
|
__send__(meth, *args, &blk)
|
26
27
|
end
|
27
28
|
EOS
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
29
|
+
propagate_include
|
30
|
+
end
|
31
|
+
@core_class
|
32
|
+
end
|
33
|
+
|
34
|
+
if Monkey::Engine.jruby? and JRUBY_VERSION < '1.6.0'
|
35
|
+
def each_module(&block)
|
36
|
+
list = []
|
37
|
+
ObjectSpace.each_object(Class) { |c| list << c }
|
38
|
+
list.each(&block)
|
39
|
+
end
|
40
|
+
else
|
41
|
+
def each_module(&block)
|
42
|
+
ObjectSpace.each_object(Module, &block)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def propagate_include
|
47
|
+
return if core_class.is_a? Class
|
48
|
+
each_module do |mod|
|
49
|
+
next unless mod < core_class and not mod < self
|
50
|
+
mod.send(:include, core_class)
|
37
51
|
end
|
38
|
-
return @core_class
|
39
52
|
end
|
40
53
|
|
41
54
|
def included(klass)
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: monkey-lib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 15
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 5
|
9
|
-
-
|
10
|
-
version: 0.5.
|
9
|
+
- 2
|
10
|
+
version: 0.5.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Konstantin Haase
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-07-
|
18
|
+
date: 2010-07-18 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|