130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
|
# File 'lib/heroku/auth.rb', line 130
def read_credentials
if ENV['HEROKU_API_KEY']
['', ENV['HEROKU_API_KEY']]
else
if File.exists?(legacy_credentials_path)
@api, @client = nil
@credentials = File.read(legacy_credentials_path).split("\n")
write_credentials
FileUtils.rm_f(legacy_credentials_path)
end
if netrc
credentials = netrc["api.#{host}"]
if credentials && credentials[1].length > 40
@credentials = [ credentials[0], credentials[1][0,40] ]
write_credentials
end
netrc["api.#{host}"]
end
end
end
|