Class: Bits::ExecuteContext
- Inherits:
-
Object
- Object
- Bits::ExecuteContext
- Defined in:
- lib/bits/execute_context.rb
Constant Summary collapse
- SUDO =
'sudo'
Instance Method Summary collapse
-
#initialize(user) ⇒ ExecuteContext
constructor
A new instance of ExecuteContext.
-
#run(args, params = {}) ⇒ Object
Run a command and return a boolean indicating weither exitcode is 0.
- #spawn(args, params = {}) ⇒ Object
Constructor Details
#initialize(user) ⇒ ExecuteContext
Returns a new instance of ExecuteContext.
5 6 7 |
# File 'lib/bits/execute_context.rb', line 5 def initialize(user) @user = user end |
Instance Method Details
#run(args, params = {}) ⇒ Object
Run a command and return a boolean indicating weither exitcode is 0
20 21 22 23 |
# File 'lib/bits/execute_context.rb', line 20 def run(args, params={}) params[:ignore_exitcode] = true spawn(args, params) == 0 end |