1
0
Fork 0
mirror of https://github.com/rest-client/rest-client.git synced 2022-11-09 13:49:40 -05:00

Fix assignments in conditions.

This commit is contained in:
Andy Brody 2014-07-08 02:03:41 -07:00
parent 7502ce3e97
commit 39c5b12273
2 changed files with 6 additions and 5 deletions

View file

@ -26,10 +26,10 @@ end
config = YAML.load(File.read(ENV['HOME'] + "/.restclient")) rescue {}
@url, @username, @password = if c = config[@url]
[c['url'], c['username'], c['password']]
if (c = config[@url])
@url, @username, @password = [c['url'], c['username'], c['password']]
else
[@url, * ARGV]
@url, @username, @password = [@url, * ARGV]
end
usage("invalid url '#{@url}") unless @url =~ /^https?/
@ -83,7 +83,8 @@ if File.exists? ".irbrc"
ENV['IRBRC'] = ".irbrc"
end
if File.exists?(File.expand_path(rcfile = "~/.restclientrc"))
rcfile = File.expand_path("~/.restclientrc")
if File.exists?(rcfile)
load(rcfile)
end