Module: Sprinkle::Sudo

Included in:
Installers::Installer, Verify
Defined in:
lib/sprinkle/extensions/sudo.rb

Instance Method Summary collapse

Instance Method Details

#sudo?Boolean

Returns:

  • (Boolean)

8
9
10
# File 'lib/sprinkle/extensions/sudo.rb', line 8

def sudo?
  sudo_stack.detect { |x| x==true or x==false }
end

#sudo_cmdObject


4
5
6
# File 'lib/sprinkle/extensions/sudo.rb', line 4

def sudo_cmd
  return "#{@delivery.try(:sudo_command) || "sudo"} " if sudo?
end

#sudo_stackObject


12
13
14
# File 'lib/sprinkle/extensions/sudo.rb', line 12

def sudo_stack
  [ options[:sudo], package.sudo?, @delivery.try(:sudo?) ]
end