Created
April 25, 2009 23:11
-
-
Save dyoder/101795 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'autocode' | |
class Object | |
include AutoCode | |
# fall back to creating a module that automatically loads | |
# from a directory of the snake-cased name, ex: Foo::Bar => 'foo/bar.rb' | |
auto_create_module true, Module.new do | |
auto_load true, :directory => lambda { self.class.name.snake_case } | |
end | |
# but first check to make sure 'foo.rb' isn't already there | |
auto_load true | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment