Module: Cloner::Internal

Extended by:
ActiveSupport::Concern
Includes:
Ar, DockerCompose, MongoDB, MySQL, Postgres, RSync, SSH
Defined in:
lib/cloner/internal.rb

Instance Method Summary collapse

Methods included from RSync

#rsync, #rsync_compression, #rsync_flags, #rsync_public

Methods included from SSH

#check_ssh_err, #do_ssh, #ssh_exec!, #ssh_opts

Methods included from MySQL

#clone_my, #my_bin_path, #my_dump_copy, #my_dump_param, #my_dump_remote, #my_dump_restore, #my_local_auth, #my_local_bin_path, #my_path, #my_remote_auth, #my_remote_bin_path, #my_restore_param

Methods included from Postgres

#clone_pg, #pg_bin_path, #pg_dump_copy, #pg_dump_extra, #pg_dump_param, #pg_dump_remote, #pg_dump_restore, #pg_local_auth, #pg_local_bin_path, #pg_path, #pg_remote_auth, #pg_remote_bin_path, #pg_restore_param

Methods included from Ar

#ar_conf, #ar_r_conf, #ar_to, #clone_ar, #clone_databases, #db_file_name, #env_database, #multi_db?, #read_ar_conf, #read_ar_r_conf, #run_clone_ar

Methods included from MongoDB

#clone_mongodb, #mongodb_bin_path, #mongodb_conf, #mongodb_dump_copy, #mongodb_dump_extra, #mongodb_dump_remote, #mongodb_dump_restore, #mongodb_local_auth, #mongodb_local_bin_path, #mongodb_path, #mongodb_r_conf, #mongodb_remote_bin_path, #mongodb_to

Methods included from DockerCompose

#docker_compose_exec, #docker_compose_file, #docker_compose_path, #docker_compose_service, #local_db_config, #local_docker_compose?, #local_docker_compose_exec, #local_docker_compose_file, #local_docker_compose_path, #local_docker_compose_service, #local_env_content, #local_env_vars, #read_local_env, #read_remote_env, #remote_db_config, #remote_docker_compose?, #remote_docker_compose_exec, #remote_docker_compose_file, #remote_docker_compose_path, #remote_docker_compose_service, #remote_env_content, #remote_env_vars, #use_docker_compose?, #wrap_command

Instance Method Details

#clone_dbObject



29
30
31
32
33
34
35
# File 'lib/cloner/internal.rb', line 29

def clone_db
  if defined?(Mongoid)
    clone_mongodb
  else
    clone_ar
  end
end

#e(str) ⇒ Object



11
12
13
# File 'lib/cloner/internal.rb', line 11

def e(str)
  Shellwords.escape(str)
end

#env_fromObject



25
26
27
# File 'lib/cloner/internal.rb', line 25

def env_from
  ENV['CLONE_FROM'] || 'production'
end

#load_envObject



15
16
17
18
19
20
# File 'lib/cloner/internal.rb', line 15

def load_env
  unless defined?(Rails)
    require rails_path
  end
  require 'net/ssh'
end

#verbose?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/cloner/internal.rb', line 22

def verbose?
  false
end