module Helper

Public Instance Methods

_cset(name, *args, &block) click to toggle source
# File lib/synchronizer/helper.rb, line 19
def _cset(name, *args, &block)
  unless exists?(name)
    set(name, *args, &block)
  end
end
clean_assets_dump() click to toggle source
# File lib/synchronizer/helper.rb, line 31
def clean_assets_dump
  if test("[ -f '#{fetch(:assets_archive_file)}' ]")
    execute :rm, '-v', fetch(:assets_archive_file)
  end
  if test("[ -f '#{fetch(:storage_archive_file)}' ]")
    execute :rm, '-v', fetch(:storage_archive_file)
  end
end
clean_db_dump() click to toggle source
# File lib/synchronizer/helper.rb, line 25
def clean_db_dump
  if test("[ -f '#{fetch(:db_dump_file)}' ]")
    execute :rm, '-v', fetch(:db_dump_file)
  end
end
destination() click to toggle source
# File lib/synchronizer/helper.rb, line 3
def destination
  puts "deprecated... will vanish soon..."
  _stage =  fetch(:stage, nil).to_s
  dest = fetch(:sync_to, nil)
  if dest
    dest
  else
    ask(:sync_to, stages.delete_if { |x| x == _stage }.join('|') )
    dest = fetch(:sync_to, nil)
  end
end
scp_file(src, dest) click to toggle source
# File lib/synchronizer/helper.rb, line 15
def scp_file(src, dest)
  capture "scp #{src} #{dest}"
end