Sha256: 5d8a2ee33d4cf57a0ca918bea51169d43925cd0e0ad02a7484d77b9a6bf78229

Contents?: true

Size: 382 Bytes

Versions: 35

Compression:

Stored size: 382 Bytes

Contents

require 'bundler'
require 'roo_on_rails/checks'

module RooOnRails
  class Shell
    CommandFailed = Class.new(StandardError)

    def run(cmd)
      result = Bundler.with_clean_env { %x{#{cmd}} }
      return [$?.success?, result]
    end

    def run!(cmd)
      raise CommandFailed.new(cmd) unless run(cmd).first
    end

    def run?(cmd)
      run(cmd).first
    end
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
roo_on_rails-1.12.0 lib/roo_on_rails/shell.rb
roo_on_rails-1.11.1 lib/roo_on_rails/shell.rb
roo_on_rails-1.11.0 lib/roo_on_rails/shell.rb
roo_on_rails-1.10.0 lib/roo_on_rails/shell.rb
roo_on_rails-1.9.0 lib/roo_on_rails/shell.rb
roo_on_rails-1.8.1 lib/roo_on_rails/shell.rb
roo_on_rails-1.8.0 lib/roo_on_rails/shell.rb
roo_on_rails-1.7.0 lib/roo_on_rails/shell.rb
roo_on_rails-1.6.0 lib/roo_on_rails/shell.rb
roo_on_rails-1.5.0 lib/roo_on_rails/shell.rb
roo_on_rails-1.4.0 lib/roo_on_rails/shell.rb
roo_on_rails-1.3.1 lib/roo_on_rails/shell.rb
roo_on_rails-1.3.0 lib/roo_on_rails/shell.rb
roo_on_rails-1.2.0 lib/roo_on_rails/shell.rb
roo_on_rails-1.1.0 lib/roo_on_rails/shell.rb