Class: ExecRemote::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/exec_remote/configuration.rb

Instance Method Summary collapse

Instance Method Details

#current_dirObject



17
18
19
# File 'lib/exec_remote/configuration.rb', line 17

def current_dir
  Dir.pwd
end

#current_projectObject



21
22
23
# File 'lib/exec_remote/configuration.rb', line 21

def current_project
  File.basename(current_dir)
end

#exec_configObject



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/exec_remote/configuration.rb', line 4

def exec_config
  config = config_from_file
  updated_config = update_config_from_user(config.dup)
  
  return config if config == updated_config
  File.open(config_file, "w") do |f| 
    config_to_write = default_config.merge updated_config
    f.puts config_to_write.to_yaml
    puts "Config written to '.exec_remote.yml'. Add this file to version control ignore list."
  end
  exec_config
end

#my_current_project_dir_on_remoteObject



49
50
51
# File 'lib/exec_remote/configuration.rb', line 49

def my_current_project_dir_on_remote
  File.join(my_dir_on_remote, current_project)
end

#my_dir_on_remoteObject



45
46
47
# File 'lib/exec_remote/configuration.rb', line 45

def my_dir_on_remote
  File.join(exec_config["base_location"], exec_config["location"])
end

#remote_hostObject



25
26
27
# File 'lib/exec_remote/configuration.rb', line 25

def remote_host
  exec_config["host"]
end

#remote_passwordObject



33
34
35
# File 'lib/exec_remote/configuration.rb', line 33

def remote_password
  exec_config["password"]
end

#remote_userObject



29
30
31
# File 'lib/exec_remote/configuration.rb', line 29

def remote_user
  exec_config["user"]
end

#rsync?Boolean

Returns:

  • (Boolean)


37
38
39
# File 'lib/exec_remote/configuration.rb', line 37

def rsync?
  exec_config["rsync"]
end

#rsync_ignore_patternObject



41
42
43
# File 'lib/exec_remote/configuration.rb', line 41

def rsync_ignore_pattern
  exec_config["rsync_ignore_pattern"]
end