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-2.2.2 lib/roo_on_rails/shell.rb
roo_on_rails-2.2.1 lib/roo_on_rails/shell.rb
roo_on_rails-2.2.0 lib/roo_on_rails/shell.rb
roo_on_rails-2.1.2 lib/roo_on_rails/shell.rb
roo_on_rails-2.1.0 lib/roo_on_rails/shell.rb
roo_on_rails-2.0.0.pre.pre.2 lib/roo_on_rails/shell.rb
roo_on_rails-2.0.0.pre.pre.1 lib/roo_on_rails/shell.rb
roo_on_rails-1.22.0 lib/roo_on_rails/shell.rb
roo_on_rails-1.21.0 lib/roo_on_rails/shell.rb
roo_on_rails-1.20.0 lib/roo_on_rails/shell.rb
roo_on_rails-1.19.0 lib/roo_on_rails/shell.rb
roo_on_rails-1.18.0 lib/roo_on_rails/shell.rb
roo_on_rails-1.17.0 lib/roo_on_rails/shell.rb
roo_on_rails-1.16.2 lib/roo_on_rails/shell.rb
roo_on_rails-1.16.1 lib/roo_on_rails/shell.rb
roo_on_rails-1.16.0 lib/roo_on_rails/shell.rb
roo_on_rails-1.15.0 lib/roo_on_rails/shell.rb
roo_on_rails-1.14.0 lib/roo_on_rails/shell.rb
roo_on_rails-1.13.1 lib/roo_on_rails/shell.rb
roo_on_rails-1.13.0 lib/roo_on_rails/shell.rb