Sha256: e84db82d7ad2b9f15114dda83cc8fc674aac9bff27247eadfe2fdaf859f7fc95

Contents?: true

Size: 1.03 KB

Versions: 1

Compression:

Stored size: 1.03 KB

Contents

#!/usr/bin/env ruby
$LOAD_PATH << File.join(File.dirname(__FILE__), '..', 'lib')

require 'optparse'
require 'bumbler'

options = {}
OptionParser.new do |parser|
  parser.banner = <<BANNER
Bumbler shows how long loading your bundle components take.

Usage:
    bumbler

Options:
BANNER
  parser.on("-t", "--threshold MILISECONDS", Integer, "Threshold in ms to be listed as slow") { |t| options[:threshold] = t }
  parser.on("--initializers", "Show load time of initializers") { options[:initializers] = true }
  parser.on("-h", "--help", "Show this.") { puts parser; exit }
  parser.on('-v', '--version', 'Show Version'){ puts Bumbler::VERSION; exit}
end.parse!

Bumbler::Hooks.slow_threshold = options[:threshold] if options[:threshold]

if options[:initializers]
  require './config/application'
  require 'bumbler/track_initializers'
  require './config/environment'
else
  require 'bumbler/go'
  require './config/environment'
end

$LOAD_PATH << File.join(File.dirname(__FILE__), '..', 'lib') # bundler kicks us out
Bumbler::Stats.all_slow_items

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bumbler-0.3.0 bin/bumbler