class SSH::Ident::Config
ssh ident config
Public Class Methods
defaults()
click to toggle source
# File lib/ssh/ident/config.rb, line 8 def self.defaults { 'FILE_USER_CONFIG' => "#{ENV['HOME']}/.ssh-ident", 'DIR_IDENTITIES' => "#{ENV['HOME']}/.ssh/identities", 'DIR_AGENTS' => "#{ENV['HOME']}/.ssh/agents", 'DEFAULT_IDENTITY' => "#{ENV['USER']}", 'SSH_ADD_OPTIONS' => '-t 7200' } end
new()
click to toggle source
# File lib/ssh/ident/config.rb, line 18 def initialize @values = load end
Public Instance Methods
get(param)
click to toggle source
# File lib/ssh/ident/config.rb, line 31 def get(param) result = ENV[param] result ||= @values[param] if @values result ||= Config.defaults[param] fail "failed to find parameter #{param}" if result.nil? return File.expand_path(result) if result.is_a?(String) && result.include?('~') result end
load()
click to toggle source
# File lib/ssh/ident/config.rb, line 22 def load if respond_to?(:load_custom) return load_custom end path = get('FILE_USER_CONFIG') return {} unless File.exist?(path) YAML.load(File.read(path)) end
set(param, value)
click to toggle source
# File lib/ssh/ident/config.rb, line 40 def set(param, value) @values[param] = value end