Skip to content

Instantly share code, notes, and snippets.

@bil-bas
Forked from drewdeponte/gist:3420790
Created August 22, 2012 00:46
Show Gist options
  • Save bil-bas/3420977 to your computer and use it in GitHub Desktop.
Save bil-bas/3420977 to your computer and use it in GitHub Desktop.
Require inside module try #1
# code.rb contains:
# class Frog
# end
module MyModule
class_eval File.read("./code.rb"), "code.rb", 1
end
p MyModule::Frog # Will succeed.
p Frog # Will fail.
@bil-bas
Copy link
Author

bil-bas commented Aug 22, 2012

class Frog
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment