Created
August 14, 2008 20:17
-
-
Save adamhjk/5479 to your computer and use it in GitHub Desktop.
This file contains 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
# Would do a real require of libraries | |
Dir[ | |
File.join( | |
File.dirname(__FILE__), | |
'foobar/**/*.rb' | |
)].sort.each { |lib| require lib } | |
# Would load a random class by name in a slightly terrifying way | |
def load_me(name, *args) | |
resource = eval(name).new(*args) | |
end | |
me = load_me('My::FooClass', :one, :two, :three) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment