class Headdesk::Report

Descriptions for APK methods

Attributes

android_sdk[R]
apk[R]
bundle_id[R]
checks[R]
file_name[R]
ipa[R]

Public Class Methods

new() click to toggle source
# File lib/headdesk/report.rb, line 13
def initialize
  @checks = []
end

Public Instance Methods

<<(value) click to toggle source
# File lib/headdesk/report.rb, line 17
def <<(value)
  @checks << value
end
color_for_status() click to toggle source
# 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() click to toggle source
# File lib/headdesk/report.rb, line 67
def describe; end
icon_for_status() click to toggle source
# File lib/headdesk/report.rb, line 21
def icon_for_status
  {
    success: '✔',
    fail: '✘',
    skip: '⇣'
  }
end
to_h() click to toggle source
# File lib/headdesk/report.rb, line 55
def to_h
  {
    bundle_id: bundle_id,
    file_name: file_name,
    checks: checks
  }
end
to_json(opts = {}) click to toggle source
# File lib/headdesk/report.rb, line 63
def to_json(opts = {})
  to_h.to_json(opts)
end
to_s() click to toggle source
# 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