rubbr 1.1.3 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +5 -0
- data/lib/rubbr.rb +1 -1
- data/lib/rubbr/runner.rb +13 -5
- metadata +1 -1
data/History.txt
CHANGED
data/lib/rubbr.rb
CHANGED
data/lib/rubbr/runner.rb
CHANGED
@@ -16,13 +16,16 @@ module Rubbr
|
|
16
16
|
# Contains a list of possible warnings after a run.
|
17
17
|
attr_accessor :warnings
|
18
18
|
|
19
|
+
# Contains a list of possible verboser warnings after a run.
|
20
|
+
attr_accessor :verboser_warnings
|
21
|
+
|
19
22
|
# Contains a list of possible errors after a run.
|
20
23
|
attr_accessor :errors
|
21
24
|
|
22
25
|
def initialize(input_file, executable)
|
23
26
|
@input_file = input_file
|
24
27
|
@executable = valid_executable executable
|
25
|
-
@
|
28
|
+
@verboser_warnings = []
|
26
29
|
@errors = []
|
27
30
|
|
28
31
|
if File.exists? @input_file
|
@@ -40,17 +43,16 @@ module Rubbr
|
|
40
43
|
|
41
44
|
run = `#@executable #@input_file`
|
42
45
|
lines = run.split("\n")
|
46
|
+
@warnings = run.grep(messages).sort
|
43
47
|
|
44
48
|
if Rubbr.options[:verboser]
|
45
49
|
|
46
50
|
lines.each_with_index do |line, i|
|
47
51
|
if line =~ verbose_messages
|
48
|
-
@
|
49
|
-
@
|
52
|
+
@verboser_warnings << line
|
53
|
+
@verboser_warnings << lines[i+1]
|
50
54
|
end
|
51
55
|
end
|
52
|
-
else
|
53
|
-
@warnings = run.grep(messages).sort
|
54
56
|
end
|
55
57
|
|
56
58
|
while lines.shift
|
@@ -68,6 +70,12 @@ module Rubbr
|
|
68
70
|
warning message
|
69
71
|
end
|
70
72
|
end
|
73
|
+
unless @verboser_warnings.empty?
|
74
|
+
notice "Verboser warnings from #@executable:"
|
75
|
+
@verboser_warnings.each do |message|
|
76
|
+
warning message
|
77
|
+
end
|
78
|
+
end
|
71
79
|
unless @errors.empty?
|
72
80
|
notice "Errors from #@executable:"
|
73
81
|
@errors.each do |message|
|