Class: RooOnRails::Shell
- Inherits:
-
Object
- Object
- RooOnRails::Shell
- Defined in:
- lib/roo_on_rails/shell.rb
Constant Summary collapse
- CommandFailed =
Class.new(StandardError)
Instance Method Summary collapse
Instance Method Details
#run(cmd) ⇒ Object
8 9 10 11 |
# File 'lib/roo_on_rails/shell.rb', line 8 def run(cmd) result = Bundler.with_clean_env { %x{#{cmd}} } return [$?.success?, result] end |
#run!(cmd) ⇒ Object
13 14 15 |
# File 'lib/roo_on_rails/shell.rb', line 13 def run!(cmd) raise CommandFailed.new(cmd) unless run(cmd).first end |
#run?(cmd) ⇒ Boolean
17 18 19 |
# File 'lib/roo_on_rails/shell.rb', line 17 def run?(cmd) run(cmd).first end |