Class: ExecRemote::Configuration
- Inherits:
-
Object
- Object
- ExecRemote::Configuration
- Defined in:
- lib/exec_remote/configuration.rb
Instance Method Summary collapse
- #current_dir ⇒ Object
- #current_project ⇒ Object
- #exec_config ⇒ Object
- #my_current_project_dir_on_remote ⇒ Object
- #my_dir_on_remote ⇒ Object
- #remote_host ⇒ Object
- #remote_password ⇒ Object
- #remote_user ⇒ Object
- #rsync? ⇒ Boolean
- #rsync_ignore_pattern ⇒ Object
Instance Method Details
#current_dir ⇒ Object
17 18 19 |
# File 'lib/exec_remote/configuration.rb', line 17 def current_dir Dir.pwd end |
#current_project ⇒ Object
21 22 23 |
# File 'lib/exec_remote/configuration.rb', line 21 def current_project File.basename(current_dir) end |
#exec_config ⇒ Object
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_remote ⇒ Object
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_remote ⇒ Object
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_host ⇒ Object
25 26 27 |
# File 'lib/exec_remote/configuration.rb', line 25 def remote_host exec_config["host"] end |
#remote_password ⇒ Object
33 34 35 |
# File 'lib/exec_remote/configuration.rb', line 33 def remote_password exec_config["password"] end |
#remote_user ⇒ Object
29 30 31 |
# File 'lib/exec_remote/configuration.rb', line 29 def remote_user exec_config["user"] end |
#rsync? ⇒ Boolean
37 38 39 |
# File 'lib/exec_remote/configuration.rb', line 37 def rsync? exec_config["rsync"] end |
#rsync_ignore_pattern ⇒ Object
41 42 43 |
# File 'lib/exec_remote/configuration.rb', line 41 def rsync_ignore_pattern exec_config["rsync_ignore_pattern"] end |