Module: UglyFace

Defined in:
lib/ugly_face.rb,
lib/ugly_face/version.rb,
lib/ugly_face/formatter/html.rb,
lib/ugly_face/formatter/report.rb,
lib/ugly_face/formatter/view_helper.rb

Defined Under Namespace

Modules: Formatter

Constant Summary collapse

VERSION =
"0.2"

Class Method Summary collapse

Class Method Details

.add_msg(key = '', msg = '') ⇒ Object



11
12
13
# File 'lib/ugly_face.rb', line 11

def self.add_msg(key='', msg='')
  @scenario_msgs[:"#{key}"] = msg
end

.formatted_cliObject



36
37
38
# File 'lib/ugly_face.rb', line 36

def self.formatted_cli
  @cli_output
end

.formatted_htmlObject



40
41
42
# File 'lib/ugly_face.rb', line 40

def self.formatted_html
  @html_output
end

.pop_scenarioObject



31
32
33
34
# File 'lib/ugly_face.rb', line 31

def self.pop_scenario
  @msg_storage.at(@index)
  @index+=1
end

.process_scenarioObject



15
16
17
18
19
20
21
22
23
# File 'lib/ugly_face.rb', line 15

def self.process_scenario
  raw_output=''
  @scenario_msgs.each { |key, value| raw_output << "+#{key}:+ #{value}+" }
  raw_output= raw_output.gsub("+ ++","++")
  @cli_output= raw_output.gsub("+","\n")
  @html_output= raw_output.gsub("+","<br />")
  @msg_storage.push(@html_output)
  $stdout.puts @cli_output unless ENV['DEBUG']== 'FALSE'
end

.resetObject



25
26
27
28
29
# File 'lib/ugly_face.rb', line 25

def self.reset
  @scenario_msgs= {}
  @cli_output= ''
  @html_output= ''
end