Class: Crep::CrashController
- Inherits:
-
Object
- Object
- Crep::CrashController
- Defined in:
- lib/crep/crash_controller.rb
Instance Attribute Summary collapse
-
#app_name ⇒ Object
readonly
Returns the value of attribute app_name.
-
#build ⇒ Object
readonly
Returns the value of attribute build.
-
#bundle_identifier ⇒ Object
readonly
Returns the value of attribute bundle_identifier.
-
#crashes ⇒ Object
readonly
Returns the value of attribute crashes.
-
#template_path ⇒ Object
readonly
Returns the value of attribute template_path.
-
#total_crashes ⇒ Object
readonly
Returns the value of attribute total_crashes.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize(bundle_identifier, top, crash_source, show_only_unresolved, template_path) ⇒ CrashController
constructor
A new instance of CrashController.
- #latest_top_crashes ⇒ Object
- #latest_top_crashes_with_app_source(app_source) ⇒ Object
-
#top_crashes(version, build) ⇒ Object
returns list of top crashes for the given build.
Constructor Details
#initialize(bundle_identifier, top, crash_source, show_only_unresolved, template_path) ⇒ CrashController
Returns a new instance of 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_name ⇒ Object (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 |
#build ⇒ Object (readonly)
Returns the value of attribute build.
8 9 10 |
# File 'lib/crep/crash_controller.rb', line 8 def build @build end |
#bundle_identifier ⇒ Object (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 |
#crashes ⇒ Object (readonly)
Returns the value of attribute crashes.
8 9 10 |
# File 'lib/crep/crash_controller.rb', line 8 def crashes @crashes end |
#template_path ⇒ Object (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_crashes ⇒ Object (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 |
#version ⇒ Object (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
#latest_top_crashes ⇒ Object
20 21 22 23 24 |
# File 'lib/crep/crash_controller.rb', line 20 def latest_top_crashes app_source = HockeyAppAppSource.new app_source.configure latest_top_crashes_with_app_source(app_source) end |
#latest_top_crashes_with_app_source(app_source) ⇒ Object
26 27 28 29 |
# File 'lib/crep/crash_controller.rb', line 26 def latest_top_crashes_with_app_source(app_source) latest_app = app_source.versions_for_bundle_identifier(@bundle_identifier).first top_crashes(latest_app.version, latest_app.build) end |
#top_crashes(version, build) ⇒ Object
returns list of top crashes for the given build
32 33 34 35 36 37 38 |
# File 'lib/crep/crash_controller.rb', line 32 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 |