bin/genZPK in genZPK-0.1.4 vs bin/genZPK in genZPK-0.1.5
- old
+ new
@@ -72,15 +72,10 @@
Dir.chdir dir do
requireCondition system("git pull origin master"), "Unable to update code via git. Exiting..."
end
end
-
-
-
-
-
if configHash["system"].has_key? "name"
if not configHash["system"]["name"] == options[:system]
warn "Could not find system \"#{options[:system]}\" in configuration. Please run genZPK --configure to setup checks for this system or verify the system name."
exit -1
end
@@ -157,28 +152,34 @@
next
end
contents = File.read(dir + filepath)
matches = contents.scan(regex)
-
+ results = ""
+ passes = 0
for i in 0..(matches.size - 1)
match = matches[i]
if not match[matchgrp] == matchval
- display << "." * (80 - "FAIL".size - desc.size)
- display << "FAIL\n"
- display << "\t#{dir + filepath}\n"
- display << "\tValue found: #{match[matchgrp]}\n"
- display << "\tRequired value: #{matchval}"
- puts display
- next
+ results << "\t#{dir + filepath}\n"
+ results << "\tValue found: #{match[matchgrp]}\n"
+ results << "\tRequired value: #{matchval}\n"
+ else
+ passes += 1
end
end
- display << "." * (80 - "SUCCESS".size - desc.size)
- display << "SUCCESS"
- puts display
- successes += 1
+ if passes == matches.size
+ display << "." * (80 - "SUCCESS".size - desc.size)
+ display << "SUCCESS"
+ puts display
+ successes += 1
+ else
+ display << "." * (80 - "FAIL".size - desc.size)
+ display << "FAIL"
+ puts display
+ puts results
+ end
end
puts "-" * 80
if not successes == checks.size
\ No newline at end of file