Module: GemDandy::ConfigFile

Included in:
Configuration, RubygemsProfile
Defined in:
lib/gem_dandy/config_file.rb

Instance Method Summary collapse

Instance Method Details

#api_keysObject



3
4
5
6
7
# File 'lib/gem_dandy/config_file.rb', line 3

def api_keys
  return File.exists?( gemdandy_rc_file ) ?
    YAML::load( File.open( gemdandy_rc_file ) ) :
    {}
end

#config_file_nameObject



17
18
19
# File 'lib/gem_dandy/config_file.rb', line 17

def config_file_name
  '.gemdandyrc'
end

#find_api_key(identifier) ⇒ Object



9
10
11
# File 'lib/gem_dandy/config_file.rb', line 9

def find_api_key( identifier )
  api_keys[identifier]
end

#gemdandy_rc_fileObject



13
14
15
# File 'lib/gem_dandy/config_file.rb', line 13

def gemdandy_rc_file
  "#{File.expand_path( '~' )}/#{config_file_name}"
end