lib/iblinter/iblinter.rb in danger-iblinter-0.0.1 vs lib/iblinter/iblinter.rb in danger-iblinter-0.0.2
- old
+ new
@@ -1,18 +1,19 @@
# frozen_string_literal: true
-class IBLinter
+class IBLinterRunner
def initialize(binary_path)
@binary_path = binary_path
end
def run(command)
`#{command}`
end
def lint(path, options)
+ command = lint_command(options)
Dir.chdir path
- JSON.parse(run(lint_command(options)))
+ JSON.parse(run(command))
end
def lint_command(options)
abs_binary_path = @binary_path.nil? ? "iblinter" : File.absolute_path(@binary_path)
"#{abs_binary_path} lint #{arguments(options.merge(reporter: 'json'))}"