Class: DRbQS::Config::SSHHost
- Inherits:
-
Object
- Object
- DRbQS::Config::SSHHost
- Defined in:
- lib/drbqs/config/ssh_host.rb
Instance Method Summary collapse
- #config_names ⇒ Object
- #get_options(name) ⇒ Object
- #get_path(name) ⇒ Object
-
#initialize(dir) ⇒ SSHHost
constructor
A new instance of SSHHost.
Constructor Details
#initialize(dir) ⇒ SSHHost
Returns a new instance of SSHHost.
4 5 6 |
# File 'lib/drbqs/config/ssh_host.rb', line 4 def initialize(dir) @dir = File.(dir) end |
Instance Method Details
#config_names ⇒ Object
13 14 15 16 17 |
# File 'lib/drbqs/config/ssh_host.rb', line 13 def config_names config_files.map do |s| File.basename(s).sub(/\.ya?ml$/, '') end end |
#get_options(name) ⇒ Object
32 33 34 35 36 37 |
# File 'lib/drbqs/config/ssh_host.rb', line 32 def (name) if path = get_path(name) return [path, YAML.load_file(path)] end [nil, {}] end |
#get_path(name) ⇒ Object
26 27 28 29 |
# File 'lib/drbqs/config/ssh_host.rb', line 26 def get_path(name) name = name.to_s name.size > 0 && find_file(name) end |