class Ossy::Engine::Rubocop::Run
Public Instance Methods
call(path:, format: "json", args: [])
click to toggle source
# File lib/ossy/engine/rubocop/run.rb, line 99 def call(path:, format: "json", args: []) extra_opts = args.join(" ") result, output = exec("rubocop #{path} --format #{format} #{extra_opts}".strip) case format when "json" then Result.build(JSON.parse(output)) else [result, output] end end
exec(cmd, opts = {})
click to toggle source
# File lib/ossy/engine/rubocop/run.rb, line 110 def exec(cmd, opts = {}) Open3.popen3(cmd, opts) do |_stdin, stdout, _stderr, wait_thr| [wait_thr.value, stdout.read] end end