lib/bumbler/track_initializers.rb in bumbler-0.3.2 vs lib/bumbler/track_initializers.rb in bumbler-0.4.0

- old
+ new

@@ -1,14 +1,13 @@ -Rails::Engine.class_eval do - def load(initializer) - initializer = initializer.sub(Rails.root.to_s, ".") +Rails::Engine.prepend(Module.new do + def load(file, *) + initializer = file.sub(Rails.root.to_s, ".") Bumbler::Hooks.benchmark(initializer) { super }.last end -end +end) -Rails::Initializable::Initializer.class_eval do - alias_method :run_without_bumbler, :run - def run(*args) +Rails::Initializable::Initializer.prepend(Module.new do + def run(*) name = (@name.is_a?(Symbol) ? @name.inspect : @name) - Bumbler::Hooks.benchmark(name) { run_without_bumbler(*args) }.last + Bumbler::Hooks.benchmark(name) { super }.last end -end +end)