module Revamp

Top level module for Revamp

Top level module for Revamp

Constants

DESCRIPTION

A description info

HOMEPAGE

A homepage for Herald

LICENSE

Lincense for Herald

NAME

Project name

PACKAGE

Package (gem) for Herald

SUMMARY

A summary info

VERSION

Version for Herald

Attributes

logger[R]

Logger for CLI interface @return [Logger] logger for CLI

Public Class Methods

bug(ex) click to toggle source

Reports a bug in desired format

@param ex [Exception] an exception that was thrown @return [Hash] a hash with info about bug to be displayed to user

# File lib/revamp.rb, line 23
def bug(ex)
  file = Tempfile.new(['revamp-bug', '.log'])
  filepath = file.path
  file.close
  file.unlink
  message = "v#{Revamp::VERSION} #{ex.class}: #{ex.message}"
  contents = message + "\n\n" + ex.backtrace.join("\n") + "\n"
  File.write(filepath, contents)
  bugo = {
    message: message,
    homepage: Revamp::HOMEPAGE,
    bugfile: filepath,
    help: "Please report this bug to #{Revamp::HOMEPAGE} by passing contents of bug file: #{filepath}"
  }
  bugo
end