lib/bogus/overwrites_classes.rb in bogus-0.0.2 vs lib/bogus/overwrites_classes.rb in bogus-0.0.3.rc.1

- old
+ new

@@ -1,7 +1,7 @@ class Bogus::OverwritesClasses - def overwrite(klass, new_klass) - modules = klass.name.split('::') + def overwrite(full_name, new_klass) + modules = full_name.split('::') klass_name = modules.pop parent_module = modules.reduce(Object) { |mod, name| mod.const_get(name) } parent_module.send(:remove_const, klass_name) parent_module.const_set(klass_name, new_klass) end