Sha256: f57ef8ea89a79c540e5a9df72b06a6866f3b766e768d905b6a466855c44a4d17

Contents?: true

Size: 491 Bytes

Versions: 2

Compression:

Stored size: 491 Bytes

Contents

# frozen_string_literal: true

module ALSA
  module Aconnect
    class Cmd
      EXEC = 'aconnect'

      def self.run(*arguments)
        new(EXEC, arguments).run
      end

      def initialize(exec, *arguments)
        @exec = exec
        @arguments = arguments
      end

      def run
        status, out, err = Command.run(@exec, *@arguments)
        raise Error.new(status.exitstatus, err.join("\n")) if status != 0 || !err.empty?

        out.join("\n")
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
alsa_aconnect-0.1.1 lib/alsa/aconnect/cmd.rb
alsa_aconnect-0.1.0 lib/alsa/aconnect/cmd.rb