lib/apkstats/command/apk_analyzer.rb in danger-apkstats-0.2.0 vs lib/apkstats/command/apk_analyzer.rb in danger-apkstats-0.3.0
- old
+ new
@@ -3,11 +3,11 @@
module Apkstats::Command
class ApkAnalyzer
include Apkstats::Command::Executable
def initialize(opts)
- @command_path = opts[:command_path] || "#{ENV.fetch('ANDROID_HOME')}/tools/bin/apkanalyzer"
+ @command_path = opts.fetch(:command_path)
end
def file_size(apk_filepath)
run_command("apk", "file-size", apk_filepath)
end
@@ -78,11 +78,12 @@
end
private
def run_command(*args)
- out, err, status = Open3.capture3("#{command_path} #{args.join(' ')}")
+ out, err, status = Open3.capture3(command_path, *args)
raise err unless status.success?
+
out.rstrip
end
end
end