aipim-rails 0.0.160 → 0.0.161
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/aipim-rails/parser.rb +11 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d0fc95917c3ca5a6a24635092ceaa9fdb38ba51b
|
4
|
+
data.tar.gz: 2f770c59a94da2727099e079d750d474b16f48df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf14407bbf578cf986aecf43f6e0765629e1da79f0189205e06f791b8ebca3b7573c135509421fd2b8d326c50a255290eb758bf21ab1049c9aaa9232456f16d1
|
7
|
+
data.tar.gz: 25b8ddc293ae60a7064f88aa8f55dbccdac6fb253af66f71eb79c0350536820abeb6525af996797a463018b66a1bde60adc8fb357002c2a800bb4ebab2134dd0
|
data/lib/aipim-rails/parser.rb
CHANGED
@@ -2,14 +2,17 @@ require 'aipim-rails/parser_helper'
|
|
2
2
|
|
3
3
|
module Parser
|
4
4
|
|
5
|
+
# inicia o processo de parset
|
5
6
|
def self.init(filename)
|
6
7
|
parser(filename)
|
7
8
|
end
|
8
9
|
|
9
10
|
|
10
11
|
def self.tag_screenshot(line,file,workset)
|
11
|
-
if line && ParserHelper.is_tag?(line)
|
12
|
-
|
12
|
+
if line && ParserHelper.is_tag?(line)
|
13
|
+
if ParserHelper.is_screenshot?(line)
|
14
|
+
workset[:screenshot] = true
|
15
|
+
end
|
13
16
|
line = ParserHelper::read_line(file)
|
14
17
|
end
|
15
18
|
return line, workset
|
@@ -44,11 +47,13 @@ module Parser
|
|
44
47
|
while ((line = ParserHelper::read_line(file)) && !ParserHelper.is_command?(line))
|
45
48
|
scenario_steps << line if !(line.gsub(" ", "") == "")
|
46
49
|
end
|
50
|
+
screenshot = nil
|
47
51
|
if workset[:screenshot]
|
48
52
|
screenshot = workset[:screenshots][workset[:screenshot_counter]].to_s
|
49
53
|
workset[:screenshot_counter] += 1
|
50
54
|
workset[:screenshot] = false
|
51
55
|
end
|
56
|
+
workset[:screenshot] = false
|
52
57
|
workset[:scenarios] << {name: scenario_name, steps: scenario_steps, screenshot: screenshot}
|
53
58
|
end
|
54
59
|
return line, workset
|
@@ -71,6 +76,7 @@ module Parser
|
|
71
76
|
# Get screenshot files
|
72
77
|
screenshots = get_screenshot_files(filename)
|
73
78
|
|
79
|
+
# variaveis de trabalho
|
74
80
|
workset = {
|
75
81
|
screenshot: false,
|
76
82
|
screenshot_counter: 0,
|
@@ -82,12 +88,15 @@ module Parser
|
|
82
88
|
scenarios: []
|
83
89
|
}
|
84
90
|
|
91
|
+
# esse codigo é q faz a magica
|
85
92
|
line = ParserHelper::read_line(file)
|
86
93
|
while (line)
|
87
94
|
line, workset = process_tags(line,file,workset)
|
88
95
|
end
|
89
96
|
file.close
|
97
|
+
# no final o workset vai estar com tudo que precisamos
|
90
98
|
|
99
|
+
# montar a feature com o qu eu tenho do workset
|
91
100
|
feature = {
|
92
101
|
feature_name: workset[:feature_name],
|
93
102
|
feature_description: workset[:feature_description],
|