Class: SshShort::Parser
- Inherits:
-
Object
- Object
- SshShort::Parser
- Defined in:
- lib/ssh_short/parser.rb
Class Method Summary collapse
Class Method Details
.config_file_exists? ⇒ Boolean
13 14 15 |
# File 'lib/ssh_short/parser.rb', line 13 def self.config_file_exists? File.exist? SshShort::CONFIG_FILE end |
.parse_config ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/ssh_short/parser.rb', line 5 def self.parse_config abort "Error: Cannot find config file #{SshShort::CONFIG_FILE}" unless config_file_exists? config = YAML.load_file(SshShort::CONFIG_FILE) abort 'Error: Keys directory must be specified' unless config[:keys_dir] config[:keys_dir] = File.(config[:keys_dir]) config end |
.parse_input(config, args) ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/ssh_short/parser.rb', line 17 def self.parse_input(config, args) = self. args, {} = self.alias_option args, = self. args, = self. args, = self. args, , config[:ip_mask] end |