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

Returns:

  • (Boolean)


12
13
14
15
# File 'lib/gemfury/command/authorization.rb', line 12

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

#wipe_credentials!Object



6
7
8
9
10
# File 'lib/gemfury/command/authorization.rb', line 6

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