class Aka::App
Public Class Methods
go!()
click to toggle source
# File lib/aka/app.rb, line 20 def self.go! setup_defaults opts.post_setup opts.parse! opts.check_args! result = call_main if result.kind_of? Integer exit result else exit 0 end rescue OptionParser::ParseError => ex logger.error ex.message puts store = Aka::Store.new store.help(nil, nil) exit 64 # Linux standard for bad command line end
which(executable)
click to toggle source
# File lib/aka/app.rb, line 9 def self.which(executable) if File.file?(executable) && File.executable?(executable) executable elsif ENV['PATH'] path = ENV['PATH'].split(File::PATH_SEPARATOR).find do |p| File.executable?(File.join(p, executable)) end path && File.expand_path(executable, path) end end