Module: VladExtras::Remote

Defined in:
lib/vlad-extras/remote.rb

Class Method Summary collapse

Class Method Details

.copy_local_to_remote(local, remote) ⇒ Object


8
9
10
11
12
# File 'lib/vlad-extras/remote.rb', line 8

def self.copy_local_to_remote(local, remote)
  dir = File.dirname(remote)
  `ssh #{domain} 'mkdir -p #{dir}'` if dir
  `scp -r #{local} #{domain}:#{remote}`
end

.exists?(path) ⇒ Boolean

Returns:

  • (Boolean)

3
4
5
6
# File 'lib/vlad-extras/remote.rb', line 3

def self.exists?(path)
  out = "#{path} does not exist"
  run("test -e #{path} || echo '#{out}'").strip != out
end