Class: TF::TextOutput

Inherits:
Object
  • Object
show all
Defined in:
lib/plugins/tf/text_output.rb

Constant Summary collapse

RED =
`tput setaf 1`
GREEN =
`tput setaf 2`
YELLOW =
`tput setaf 3`
BLUE =
`tput setaf 4`
RESET =
`tput sgr0`

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTextOutput

Returns a new instance of TextOutput.



12
13
# File 'lib/plugins/tf/text_output.rb', line 12

def initialize
end

Class Method Details

.argument_matches?(argument) ⇒ Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/plugins/tf/text_output.rb', line 8

def self.argument_matches? argument
  [:load] if argument == "--text"
end

Instance Method Details

#command_err(err) ⇒ Object



41
42
43
# File 'lib/plugins/tf/text_output.rb', line 41

def command_err err
  $stderr.puts err
end

#command_out(out) ⇒ Object



37
38
39
# File 'lib/plugins/tf/text_output.rb', line 37

def command_out out
  puts out
end

#end_command(line, status, env) ⇒ Object



33
34
35
# File 'lib/plugins/tf/text_output.rb', line 33

def end_command line, status, env
  #puts ": $?=#{status}"
end

#end_processingObject



18
19
# File 'lib/plugins/tf/text_output.rb', line 18

def end_processing
end

#end_test(test) ⇒ Object



25
26
27
# File 'lib/plugins/tf/text_output.rb', line 25

def end_test test
  #puts "#{BLUE}##### finished test #{test[:name]}.#{RESET}"
end

#start_command(line) ⇒ Object



29
30
31
# File 'lib/plugins/tf/text_output.rb', line 29

def start_command line
  puts "#{YELLOW}$ #{line[:cmd]}#{RESET}"
end

#start_processingObject



15
16
# File 'lib/plugins/tf/text_output.rb', line 15

def start_processing
end

#start_test(test, env) ⇒ Object



21
22
23
# File 'lib/plugins/tf/text_output.rb', line 21

def start_test test, env
  puts "#{BLUE}##### starting test #{test[:name]}.#{RESET}"
end

#test_processed(test, status, msg) ⇒ Object



45
46
47
48
49
50
51
# File 'lib/plugins/tf/text_output.rb', line 45

def test_processed test, status, msg
  if status
    puts "#{GREEN}# #{msg}#{RESET}"
  else
    puts "#{RED}# #{msg}#{RESET}"
  end
end