Class: RemoteSh::HostsConfiguration
- Inherits:
-
Object
- Object
- RemoteSh::HostsConfiguration
- Includes:
- Singleton
- Defined in:
- lib/remote_sh/hosts_configuration.rb
Constant Summary collapse
- CONFIGURATION_PATH =
"#{Dir.home}/.config/remote_sh"
- CONFIGURATION_FILE =
"#{CONFIGURATION_PATH}/servers.yaml"
Class Method Summary collapse
-
.config ⇒ Object
servers: - name: main host: [email protected] blacklist_ports: [‘22’, ‘25’, ‘631’].
Instance Method Summary collapse
Class Method Details
.config ⇒ Object
servers:
-
name: main host: [email protected] blacklist_ports: [‘22’, ‘25’, ‘631’]
17 18 19 |
# File 'lib/remote_sh/hosts_configuration.rb', line 17 def self.config instance.config end |
Instance Method Details
#config ⇒ Object
26 27 28 |
# File 'lib/remote_sh/hosts_configuration.rb', line 26 def config @config || parse end |
#parse ⇒ Object
21 22 23 24 |
# File 'lib/remote_sh/hosts_configuration.rb', line 21 def parse FileUtils.mkdir_p(CONFIGURATION_PATH) @config = YAML.load_file(CONFIGURATION_FILE) end |