Class: Crep::CrashController

Inherits:
Object
  • Object
show all
Defined in:
lib/crep/crash_controller.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(bundle_identifier, top, crash_source, show_only_unresolved, template_path) ⇒ CrashController


10
11
12
13
14
15
16
17
18
# File 'lib/crep/crash_controller.rb', line 10

def initialize(bundle_identifier, top, crash_source, show_only_unresolved, template_path)
  @bundle_identifier = bundle_identifier
  @top = top
  @crash_source = crash_source
  @show_only_unresolved = show_only_unresolved
  @crash_source.configure(bundle_identifier)
  @app_name = @crash_source.app.name
  @template_path = template_path
end

Instance Attribute Details

#app_nameObject (readonly)

Returns the value of attribute app_name


8
9
10
# File 'lib/crep/crash_controller.rb', line 8

def app_name
  @app_name
end

#buildObject (readonly)

Returns the value of attribute build


8
9
10
# File 'lib/crep/crash_controller.rb', line 8

def build
  @build
end

#bundle_identifierObject (readonly)

Returns the value of attribute bundle_identifier


8
9
10
# File 'lib/crep/crash_controller.rb', line 8

def bundle_identifier
  @bundle_identifier
end

#crashesObject (readonly)

Returns the value of attribute crashes


8
9
10
# File 'lib/crep/crash_controller.rb', line 8

def crashes
  @crashes
end

#template_pathObject (readonly)

Returns the value of attribute template_path


8
9
10
# File 'lib/crep/crash_controller.rb', line 8

def template_path
  @template_path
end

#total_crashesObject (readonly)

Returns the value of attribute total_crashes


8
9
10
# File 'lib/crep/crash_controller.rb', line 8

def total_crashes
  @total_crashes
end

#versionObject (readonly)

Returns the value of attribute version


8
9
10
# File 'lib/crep/crash_controller.rb', line 8

def version
  @version
end

Instance Method Details

#top_crashes(version, build) ⇒ Object

returns list of top crashes for the given build


21
22
23
24
25
26
27
# File 'lib/crep/crash_controller.rb', line 21

def top_crashes(version, build)
  @version = version
  @build = build
  @crashes = @crash_source.crashes(@top, version, build, @show_only_unresolved)
  @total_crashes = @crash_source.crash_count(version: @version, build: @build)
  report
end