Sha256: d45a395bce516a15504edf4e8fa1096f8e4e8001f3159010583bd9e626026da9
Contents?: true
Size: 546 Bytes
Versions: 9
Compression:
Stored size: 546 Bytes
Contents
module EZAPIClient class ExecCommand include Virtus.model attribute :command, String def self.call(command) self.new(command: command).() end def call stdout_str, stderr_str, status = Open3.capture3(command) unless status.success? error_msgs = [ stdout_str, stderr_str, ].reject { |str| str == "" }.compact.join("; ") msg = ["Error executing command:", error_msgs].join(" ") fail ArgumentError, msg end stdout_str.chomp end end end
Version data entries
9 entries across 9 versions & 1 rubygems