mirror of
https://github.com/rest-client/rest-client.git
synced 2022-11-09 13:49:40 -05:00
whitespace fixes
This commit is contained in:
parent
662972ce1a
commit
aca9945cb9
1 changed files with 4 additions and 4 deletions
|
|
@ -6,7 +6,7 @@ require 'rest_client'
|
||||||
require "yaml"
|
require "yaml"
|
||||||
|
|
||||||
def usage(why = nil)
|
def usage(why = nil)
|
||||||
puts "failed for reason: #{why}" if why
|
puts "failed for reason: #{why}" if why
|
||||||
puts "usage: restclient url|name [username] [password]"
|
puts "usage: restclient url|name [username] [password]"
|
||||||
exit(1)
|
exit(1)
|
||||||
end
|
end
|
||||||
|
|
@ -16,9 +16,9 @@ end
|
||||||
config = YAML.load(File.read(ENV['HOME'] + "/.restclient")) rescue {}
|
config = YAML.load(File.read(ENV['HOME'] + "/.restclient")) rescue {}
|
||||||
|
|
||||||
@url, @username, @password = if c = config[@url]
|
@url, @username, @password = if c = config[@url]
|
||||||
[c[:url], c[:username], c[:password]]
|
[c[:url], c[:username], c[:password]]
|
||||||
else
|
else
|
||||||
[@url, *ARGV]
|
[@url, *ARGV]
|
||||||
end
|
end
|
||||||
|
|
||||||
usage("invalid url '#{@url}") unless @url =~ /^https?/
|
usage("invalid url '#{@url}") unless @url =~ /^https?/
|
||||||
|
|
@ -52,7 +52,7 @@ require 'irb'
|
||||||
require 'irb/completion'
|
require 'irb/completion'
|
||||||
|
|
||||||
if File.exists? ".irbrc"
|
if File.exists? ".irbrc"
|
||||||
ENV['IRBRC'] = ".irbrc"
|
ENV['IRBRC'] = ".irbrc"
|
||||||
end
|
end
|
||||||
|
|
||||||
if File.exists?(rcfile = "~/.restclientrc")
|
if File.exists?(rcfile = "~/.restclientrc")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue