Class: Ridley::CommandContext::Unix

Inherits:
Base
  • Object
show all
Defined in:
lib/ridley/command_context.rb

Overview

A command context for Unix based OSes

Direct Known Subclasses

UnixUninstall

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

command, template_file

Constructor Details

#initialize(options = {}) ⇒ Unix

Returns a new instance of Unix.

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :sudo (Boolean) — default: true

    bootstrap with sudo (default: true)



58
59
60
61
# File 'lib/ridley/command_context.rb', line 58

def initialize(options = {})
  options = options.reverse_merge(sudo: true)
  @sudo   = options[:sudo]
end

Instance Attribute Details

#sudoBoolean (readonly)

Returns:

  • (Boolean)


54
55
56
# File 'lib/ridley/command_context.rb', line 54

def sudo
  @sudo
end

Instance Method Details

#commandString

Returns:

  • (String)


64
65
66
# File 'lib/ridley/command_context.rb', line 64

def command
  sudo ? "sudo #{super}" : super
end