lib/quality/rake/task.rb in quality-0.1.0 vs lib/quality/rake/task.rb in quality-0.1.1
- old
+ new
@@ -39,12 +39,13 @@
# Use verbose output. If this is set to true, the task will print
# the reek command to stdout. Defaults to false.
attr_accessor :verbose
# Defines a new task, using the name +name+.
- def initialize(name = :quality)
- @name = name
+ def initialize(args = {})
+ @name = args[:name]
+ @name = 'quality' if @name.nil?
@libs = [File.expand_path(File.dirname(__FILE__) + '/../../../lib')]
@config_files = nil
@source_files = nil
@ruby_opts = []
@reek_opts = ''
@@ -58,11 +59,11 @@
end
private
def define # :nodoc:
- desc 'Verify quality has increased or stayed' +
+ desc 'Verify quality has increased or stayed ' +
'the same' unless ::Rake.application.last_comment
task(name) { run_task }
self
end
@@ -73,12 +74,15 @@
quality_flay
quality_rubocop
end
def ratchet_quality_cmd(cmd,
- args: nil,
- emacs_format: false,
+ options,
&process_output_line)
+
+ args ||= options[:args]
+ emacs_format ||= options[:emacs_format]
+
violations = 0
out = ""
found_output = false
full_cmd = cmd
if !args.nil?