Class: SSHKit::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/sshkit/sudo/command.rb

Instance Method Summary collapse

Instance Method Details

#with(&_block) ⇒ Object



7
8
9
10
11
12
# File 'lib/sshkit/sudo/command.rb', line 7

def with(&_block)
  return yield if options[:user]
  env_string = environment_string
  return yield if env_string.empty?
  "( export #{env_string} ; #{yield} )"
end