Sha256: 887fad629bc5533470f6a7a8b15fcb1878efc8061f025a02227012b3596f2592

Contents?: true

Size: 436 Bytes

Versions: 10

Compression:

Stored size: 436 Bytes

Contents

def sudo(command)
  sh "sudo #{command}"
end

def ssh(host, command, options = {})
  target = [ options.delete(:user), host ].compact.join('@')

  arguments = []

  arguments << "-p #{options.delete(:port)}" if options[:port]
  arguments = arguments + options.collect do |key, value|
    formatted_key = key.to_s.gsub('_','')
    "-o '#{formatted_key} #{value}'"
  end
  
  sh "ssh -t #{arguments.join(' ')} #{target} '#{command}'"
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
albanpeignier-gepetto-0.0.3 tasks/utils.rake
albanpeignier-gepetto-0.0.4 tasks/utils.rake
albanpeignier-gepetto-0.0.5 tasks/utils.rake
albanpeignier-gepetto-0.0.6 tasks/utils.rake
albanpeignier-gepetto-0.0.7 tasks/utils.rake
gepetto-0.0.12 tasks/utils.rake
gepetto-0.0.11 tasks/utils.rake
gepetto-0.0.10 tasks/utils.rake
gepetto-0.0.9 tasks/utils.rake
gepetto-0.0.8 tasks/utils.rake