Class: Headdesk::Report
- Inherits:
-
Object
- Object
- Headdesk::Report
- Defined in:
- lib/headdesk/report.rb
Overview
Descriptions for APK methods
Instance Attribute Summary collapse
-
#android_sdk ⇒ Object
readonly
Returns the value of attribute android_sdk.
-
#apk ⇒ Object
readonly
Returns the value of attribute apk.
-
#bundle_id ⇒ Object
readonly
Returns the value of attribute bundle_id.
-
#checks ⇒ Object
readonly
Returns the value of attribute checks.
-
#file_name ⇒ Object
readonly
Returns the value of attribute file_name.
-
#ipa ⇒ Object
readonly
Returns the value of attribute ipa.
Instance Method Summary collapse
- #<<(value) ⇒ Object
- #color_for_status ⇒ Object
- #describe ⇒ Object
- #icon_for_status ⇒ Object
-
#initialize ⇒ Report
constructor
A new instance of Report.
- #link ⇒ Object
- #to_h ⇒ Object
- #to_json(opts = {}) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize ⇒ Report
Returns a new instance of Report.
13 14 15 |
# File 'lib/headdesk/report.rb', line 13 def initialize @checks = [] end |
Instance Attribute Details
#android_sdk ⇒ Object (readonly)
Returns the value of attribute android_sdk.
11 12 13 |
# File 'lib/headdesk/report.rb', line 11 def android_sdk @android_sdk end |
#apk ⇒ Object (readonly)
Returns the value of attribute apk.
11 12 13 |
# File 'lib/headdesk/report.rb', line 11 def apk @apk end |
#bundle_id ⇒ Object (readonly)
Returns the value of attribute bundle_id.
11 12 13 |
# File 'lib/headdesk/report.rb', line 11 def bundle_id @bundle_id end |
#checks ⇒ Object (readonly)
Returns the value of attribute checks.
11 12 13 |
# File 'lib/headdesk/report.rb', line 11 def checks @checks end |
#file_name ⇒ Object (readonly)
Returns the value of attribute file_name.
11 12 13 |
# File 'lib/headdesk/report.rb', line 11 def file_name @file_name end |
#ipa ⇒ Object (readonly)
Returns the value of attribute ipa.
11 12 13 |
# File 'lib/headdesk/report.rb', line 11 def ipa @ipa end |
Instance Method Details
#<<(value) ⇒ Object
17 18 19 |
# File 'lib/headdesk/report.rb', line 17 def <<(value) @checks << value end |
#color_for_status ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/headdesk/report.rb', line 29 def color_for_status { success: "\e[32m%s\e[0m", fail: "\e[31m%s\e[0m", skip: "\e[36m%s\e[0m" } end |
#describe ⇒ Object
67 |
# File 'lib/headdesk/report.rb', line 67 def describe; end |
#icon_for_status ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/headdesk/report.rb', line 21 def icon_for_status { success: '✔', fail: '✘', skip: '⇣' } end |
#link ⇒ Object
37 38 39 |
# File 'lib/headdesk/report.rb', line 37 def link "\e[37;4m%s\e[0m" end |
#to_h ⇒ Object
55 56 57 58 59 60 61 |
# File 'lib/headdesk/report.rb', line 55 def to_h { bundle_id: bundle_id, file_name: file_name, checks: checks } end |
#to_json(opts = {}) ⇒ Object
63 64 65 |
# File 'lib/headdesk/report.rb', line 63 def to_json(opts = {}) to_h.to_json(opts) end |
#to_s ⇒ Object
41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/headdesk/report.rb', line 41 def to_s ERB.new(<<~DESCRIPTION, nil, '>').result(binding) Bundle Id: <%= bundle_id %>\n <%= describe %>\n <% for @check in checks %> <%= color_for_status[@check[:status]] % icon_for_status[@check[:status]] %> <%= color_for_status[@check[:status]] % @check[:description] %> (<%= link % @check[:doc] %>)\n <% for @step in @check[:steps] %> ↳ <%= color_for_status[@step[:status]] % icon_for_status[@step[:status]] %> <%= color_for_status[@step[:status]] % @step[:description] %>\n <% end %> <% unless @check[:export].empty? %><%= " 💾 " + @check[:export].to_json + "\n" %><% end %>\n <% end %> DESCRIPTION end |