Skip to content

Instantly share code, notes, and snippets.

@adamhjk
Created August 14, 2008 20:17
Show Gist options
  • Save adamhjk/5479 to your computer and use it in GitHub Desktop.
Save adamhjk/5479 to your computer and use it in GitHub Desktop.
# 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