lazy_load 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +5 -0
- data/README.md +2 -0
- data/lib/lazy_load.rb +6 -1
- metadata +2 -2
data/CHANGELOG
CHANGED
data/README.md
CHANGED
@@ -4,6 +4,8 @@ LazyLoad
|
|
4
4
|
|
5
5
|
**Autoload with custom callbacks**
|
6
6
|
|
7
|
+
Tested and working on: 1.8.7, 1.9.2, jruby 1.5.2, rubinius 1.0.1
|
8
|
+
|
7
9
|
---
|
8
10
|
|
9
11
|
LazyLoad is a slightly more elaborate alternative to [autoload](http://ruby-doc.org/core/classes/Module.html#M000443). It helps deal with "soft" dependencies, where dependencies are "preferred", rather than strictly needed. It is very simple, but provides:
|
data/lib/lazy_load.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
|
4
4
|
module LazyLoad
|
5
5
|
|
6
|
-
VERSION = '0.1.
|
6
|
+
VERSION = '0.1.2'
|
7
7
|
|
8
8
|
module Mixin
|
9
9
|
|
@@ -33,6 +33,7 @@ module LazyLoad
|
|
33
33
|
def group(name, *constants)
|
34
34
|
@groups[name] = constants
|
35
35
|
end
|
36
|
+
alias :prefer :group
|
36
37
|
|
37
38
|
def unmap(name)
|
38
39
|
@actions.delete(name)
|
@@ -95,7 +96,11 @@ module LazyLoad
|
|
95
96
|
|
96
97
|
end
|
97
98
|
|
99
|
+
Wrapper = Mixin::Wrapper
|
100
|
+
|
98
101
|
extend Mixin
|
99
102
|
|
103
|
+
def self.new(*prms) self.scope(*prms); end
|
104
|
+
|
100
105
|
end
|
101
106
|
|