module Locomotive::Wagon::NetrcConcern

Public Instance Methods

read_credentials_from_netrc(host) click to toggle source
# File lib/locomotive/wagon/commands/concerns/netrc_concern.rb, line 13
def read_credentials_from_netrc(host)
  if entry = Netrc.read[host]
    { email: entry.login, api_key: entry.password }
  end
end
write_credentials_to_netrc(host, email, api_key) click to toggle source
# File lib/locomotive/wagon/commands/concerns/netrc_concern.rb, line 7
def write_credentials_to_netrc(host, email, api_key)
  netrc = Netrc.read
  netrc[host] = email, api_key
  netrc.save
end