lib/truck/context.rb in truck-0.8.4 vs lib/truck/context.rb in truck-0.8.6

- old
+ new

@@ -38,31 +38,33 @@ load_file rb_file end end def load_file(rb_file) - mod.module_eval File.read(rb_file), rb_file.to_s + ruby_code = File.read rb_file + mod.module_eval ruby_code, rb_file.to_s end def parent return Object unless @parent Truck.contexts.fetch(@parent.to_sym).mod end - def resolve_const(expanded_const) - build_const_resolver(expanded_const).resolve + def resolve_const(expanded_const, skip: nil) + build_const_resolver(expanded_const, Array[skip]).resolve end def shutdown! parent.send :remove_const, name end private - def build_const_resolver(expanded_const) + def build_const_resolver(expanded_const, skip_files) ConstResolver.new( context: self, expanded_const: String(expanded_const).dup.freeze, + skip_files: skip_files, ) end def build_mod mod = Module.new