Class: Ridley::CommandContext::Unix
- Defined in:
- lib/ridley/command_context.rb
Overview
A command context for Unix based OSes
Direct Known Subclasses
Instance Attribute Summary collapse
- #sudo ⇒ Boolean readonly
Instance Method Summary collapse
- #command ⇒ String
-
#initialize(options = {}) ⇒ Unix
constructor
A new instance of Unix.
Methods inherited from Base
Constructor Details
#initialize(options = {}) ⇒ Unix
Returns a new instance of Unix.
58 59 60 61 |
# File 'lib/ridley/command_context.rb', line 58 def initialize( = {}) = .reverse_merge(sudo: true) @sudo = [:sudo] end |
Instance Attribute Details
#sudo ⇒ Boolean (readonly)
54 55 56 |
# File 'lib/ridley/command_context.rb', line 54 def sudo @sudo end |
Instance Method Details
#command ⇒ String
64 65 66 |
# File 'lib/ridley/command_context.rb', line 64 def command sudo ? "sudo #{super}" : super end |