bin/bumbler in bumbler-0.3.0 vs bin/bumbler in bumbler-0.3.1
- old
+ new
@@ -1,8 +1,13 @@
#!/usr/bin/env ruby
-$LOAD_PATH << File.join(File.dirname(__FILE__), '..', 'lib')
+add_load_path = lambda do
+ path = File.join(File.dirname(__FILE__), '..', 'lib')
+ $LOAD_PATH << path unless $LOAD_PATH.include? path
+end
+add_load_path.call # in case we execute via ./bin
+
require 'optparse'
require 'bumbler'
options = {}
OptionParser.new do |parser|
@@ -22,14 +27,15 @@
Bumbler::Hooks.slow_threshold = options[:threshold] if options[:threshold]
if options[:initializers]
require './config/application'
+ add_load_path.call # bundler kicks us out
require 'bumbler/track_initializers'
require './config/environment'
else
require 'bumbler/go'
require './config/environment'
+ add_load_path.call # bundler kicks us out
end
-$LOAD_PATH << File.join(File.dirname(__FILE__), '..', 'lib') # bundler kicks us out
Bumbler::Stats.all_slow_items