henrylawson/photish

View on GitHub
exe/photish

Summary

Maintainability
Test Coverage
#!/usr/bin/env ruby

$:.unshift File.join(File.dirname(__FILE__), '..', 'lib')

if ENV['COVERAGE']
  require 'simplecov'
  SimpleCov.command_name "photish-binary-#{Process.pid}"
end

if ENV['PROFILE']
  require 'ruby-prof'
  FileUtils.rm_rf('profile')
  RubyProf.start
end

require 'photish'
Photish::CLI::Interface.start

if ENV['PROFILE']
  profile_filename = "cmd-#{ARGV[0] || 'unknown'}-#{Process.pid}"
  FileUtils.mkdir_p('profile')
  RubyProf::MultiPrinter.new(RubyProf.stop)
                        .print(profile: profile_filename,
                               path: 'profile')
end