lib/warder/code_duplication_runner.rb in warder-0.1.1 vs lib/warder/code_duplication_runner.rb in warder-0.1.2
- old
+ new
@@ -1,22 +1,14 @@
module Warder
# responsible for run code duplication validation
class CodeDuplicationRunner < Runner
FLAY_SCORE = SCORE / 2
+ COMMAND_NAME = 'flay'
+ FAILURE_REGEXP = /Total score \(lower is better\) = (\d+)/
- def initialize(options = {})
- @options = options
- end
-
private
- def command
- "flay -d -m #{FLAY_SCORE} #{@options.files}"
- end
-
- def failed?(line)
- match = line.match(/Total score \(lower is better\) = (\d+)/)
-
- match && match[1].to_i != 0
+ def command_with_options
+ "#{COMMAND_NAME} -d -m #{FLAY_SCORE} #{@options.files}"
end
end
end