Module: Gemfury::Command::Authorization

Includes:
Platform
Included in:
App
Defined in:
lib/gemfury/command/authorization.rb

Instance Method Summary collapse

Methods included from Platform

#config_path, #home_directory, #on_mac?, #on_windows?

Instance Method Details

#has_credentials?Boolean


10
11
12
13
# File 'lib/gemfury/command/authorization.rb', line 10

def has_credentials?
  !!netrc_conf[netrc_api_host] ||
  read_config_file.key?(:gemfury_api_key)
end

#wipe_credentials!Object


4
5
6
7
8
# File 'lib/gemfury/command/authorization.rb', line 4

def wipe_credentials!
  FileUtils.rm(config_path, :force => true) # never raises exception
  each_netrc_host { |h| netrc_conf.delete(h) }
  netrc_conf.save
end