Class: Niman::Library::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/niman/library/command.rb

Instance Method Summary collapse

Instance Method Details

#descriptionObject



17
18
19
20
21
22
23
# File 'lib/niman/library/command.rb', line 17

def description
  if use_sudo == :sudo
    "sudo #{command}"
  else
    command
  end
end

#errorsObject



13
14
15
# File 'lib/niman/library/command.rb', line 13

def errors
  "command must not be empty"
end

#valid?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/niman/library/command.rb', line 9

def valid?
  !command.empty? && [:no_sudo, :sudo].include?(use_sudo)
end