28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
# File 'lib/aipim/parser.rb', line 28
def self.read_content(filename)
file = File.new(filename, "r")
screenshot = false
cenario_counter = 1
result = %x[ls screenshots/].split("\n")
counter_screenshot = 0
line = read_line(file)
while (line)
if !ParserHelper.is_comando?(line) && !(line.gsub(" ", "") == "")
puts "#{line} "
line = read_line(file)
elsif ParserHelper.is_marcacao?(line)
screenshot = true
line = read_line(file)
elsif ParserHelper.is_funcionalidade?(line)
puts "# #{ParserHelper.get_funcionalidade(line)} #"
line = read_line(file)
elsif ParserHelper.is_cenario?(line)
puts "> ## #{cenario_counter}. #{ParserHelper.get_cenario(line)} ##"
cenario_counter = cenario_counter+1
while ((line = read_line(file)) && !ParserHelper.is_comando?(line))
if !(line.gsub(" ", "") == "")
puts "> #{line} "
end
end
if screenshot
puts '> [![Alt text](screenshots/'+result[counter_screenshot].to_s+')](screenshots/'+result[counter_screenshot].to_s+') '
counter_screenshot = counter_screenshot+1
screenshot = false
end
puts ''
puts '<!-- -->'
puts ''
elsif ParserHelper.is_contexto?(line)
puts "## Contexto : #{ParserHelper.get_contexto(line)} ##"
line = read_line(file)
else
line = read_line(file)
end
end
file.close
end
|