summaryrefslogtreecommitdiff
path: root/lib/custodian/parser.rb
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2015-03-09 13:21:36 +0000
committerSteve Kemp <steve@steve.org.uk>2015-03-09 13:21:36 +0000
commitd07ac8ecbedb4831e5aa677b8878f0e8eb37e363 (patch)
treef7bc6a6fdd381ffa7d73f487d3f10f6e65a798e4 /lib/custodian/parser.rb
parent16b766cff0984494c7b81c1efc08e6386ae819f8 (diff)
Whitespace fixups.
These were all identified and suggested by rubocop.
Diffstat (limited to 'lib/custodian/parser.rb')
-rw-r--r--lib/custodian/parser.rb13
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/custodian/parser.rb b/lib/custodian/parser.rb
index b0626f5..c7002e0 100644
--- a/lib/custodian/parser.rb
+++ b/lib/custodian/parser.rb
@@ -63,7 +63,7 @@ module Custodian
#
# Retrieve a HTTP/HTTPS page from the web, for macro-expansion.
#
- def get_url_contents (uri_str)
+ def get_url_contents(uri_str)
begin
uri_str = 'http://' + uri_str unless uri_str.match(/^http/)
url = URI.parse(uri_str)
@@ -96,8 +96,7 @@ module Custodian
case response
when Net::HTTPRedirection
then
- newURL = response['location'].match(/^http/)?
- response['Location']:uri_str+response['Location']
+ newURL = response['location'].match(/^http/) ? response['Location'] : uri_str + response['Location']
return(get_url_contents(newURL))
else
return response.body
@@ -215,8 +214,8 @@ module Custodian
r = []
if input =~ /^(\S+)\s+(.*)$/
- macro=$1.dup
- rest=$2.dup
+ macro = $1.dup
+ rest = $2.dup
end
@@ -237,7 +236,7 @@ module Custodian
#
def parse_line(line)
- raise ArgumentError, "Line is not a string: #{line}" unless(line.kind_of? String)
+ raise ArgumentError, "Line is not a string: #{line}" unless line.kind_of? String
line.chomp! if !line.nil?
@@ -275,7 +274,7 @@ module Custodian
if line =~ /except\s+between/i
return nil if inside
else
- return nil if ! inside
+ return nil if !inside
end
end