class Rgversion::Terminal

Public Class Methods

new(command, results) click to toggle source
# File lib/rgversion/terminal.rb, line 3
def initialize(command, results)
  @command = command
  @results = results
end

Public Instance Methods

copy_to_clipboard() click to toggle source
# File lib/rgversion/terminal.rb, line 13
def copy_to_clipboard
  return if @output.blank?
  clipboard = Clipboard.new(@output, @command)
  clipboard.copy
end
report() click to toggle source
# File lib/rgversion/terminal.rb, line 8
def report
  render_errors
  render_output
end

Private Instance Methods

render_errors() click to toggle source
# File lib/rgversion/terminal.rb, line 21
def render_errors
  return if @results[:errors].blank?
  puts @results[:errors].join("\n").red
  puts unless @results[:gems].blank?
end
render_output() click to toggle source
# File lib/rgversion/terminal.rb, line 27
def render_output
  return if @results[:gems].blank?
  @output = @results[:gems].join("\n")
  puts @output
end