Sha256: 0b5b7cddff2207926d49a241a79c46167c15920290528e09b215e97c5166f3bd

Contents?: true

Size: 353 Bytes

Versions: 2

Compression:

Stored size: 353 Bytes

Contents

module Carrasco
  class CommandExecuter
    CommandError = Class.new(StandardError)
    def execute(command)
      system(command.to_s)
      $?.exitstatus
    end

    def execute!(command)
      code = execute(command)

      unless code == 0
        raise CommandError.new("Command '#{command}' exited with code #{code}")
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
carrasco-0.1.6 lib/carrasco/command_executer.rb
carrasco-0.1.5 lib/carrasco/command_executer.rb