During this talk, I'll introduce you to the rb_import gem.
This gem brings a new method import to your Ruby VM so that you can load classes without polluting the global VM constant table:
module MyModule
SomeModel = import './some_model.rb' # => SomeModel is at the top-level
class Foo
SomeModel.new.blablabla
end
end
another example:
module Foo
Bar = import '/path/to/bar.rb' # this file defines a Bar class
end
Bar.new # => NameError: uninitialized constant Bar
Foo::Bar.new # => #<Foo::Bar:0x0000000206a390>
During this talk, I'll introduce you to the
rb_import
gem.This gem brings a new method
import
to your Ruby VM so that you can load classes without polluting the global VM constant table:another example: