class Crep::Crashes

Constants

DEFAULT_TEMPLATE
DEFAULT_TOP_COUNT

Public Class Methods

new(argv) click to toggle source
Calls superclass method
# File lib/crep/command/crashes.rb, line 33
def initialize(argv)
  super

  @show_only_unresolved = argv.flag?('only-unresolved', false)
  @top = argv.option('top', DEFAULT_TOP_COUNT)
  @bundle_identifier = argv.option('identifier')
  @version = argv.option('version')
  @build = argv.option('build')
  @template = argv.option('template', DEFAULT_TEMPLATE)
end
options() click to toggle source
Calls superclass method
# File lib/crep/command/crashes.rb, line 14
def self.options
  [
    ['--top=5', "If set, Crep will show the top x crashes. #{DEFAULT_TOP_COUNT} by default."],
    ['--identifier=<com.company.app>', 'Crep will show crashes for the app with this bundle identifier'],
    ['--version=<7.10.0>', 'The version of the App.'],
    ['--build=<24>', 'The Build number of the App.'],
    ['--only-unresolved', 'If set, resolved crashes will be filtered out.'],
    ['--template=templates/defaul_crash_report.txt.erb', 'Set this to specify a erb template for the report format. If no value is specifed the default temapate will be used.']
  ].concat(super)
end

Public Instance Methods

run() click to toggle source
# File lib/crep/command/crashes.rb, line 50
def run
  crash_datasource = HockeyAppCrashSource.new
  crash_controller = CrashController.new(@bundle_identifier, @top, crash_datasource, @show_only_unresolved, @template)
  if @version && @build
    crash_controller.top_crashes(@version, @build)
  else
    crash_controller.latest_top_crashes
  end
end
validate!() click to toggle source
Calls superclass method
# File lib/crep/command/crashes.rb, line 44
def validate!
  super

  help! 'The identifier (--identifier) is a required parameter' unless @bundle_identifier
end