monkey-lib 0.3.5.3 → 0.3.5.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/monkey/autoloader.rb +18 -0
  2. metadata +1 -1
@@ -1,5 +1,23 @@
1
1
  require "monkey"
2
2
 
3
+ Module.class_eval do
4
+ alias const_missing_without_detection const_missing
5
+
6
+ def const_missing(const_name)
7
+ if parent.autoloader? and not is_a? Monkey::Autoloader
8
+ extend Monkey::Autoloader
9
+ const_missing const_name
10
+ else
11
+ const_missing_without_detection const_name
12
+ end
13
+ end
14
+
15
+ def autoloader?
16
+ is_a? Monkey::Autoloader or (parent != self and parent.autoloader?)
17
+ end
18
+
19
+ end
20
+
3
21
  module Monkey
4
22
  module Autoloader
5
23
  def const_missing(const_name)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: monkey-lib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5.3
4
+ version: 0.3.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konstantin Haase