diff options
author | Steve Kemp <steve@steve.org.uk> | 2015-03-09 13:21:36 +0000 |
---|---|---|
committer | Steve Kemp <steve@steve.org.uk> | 2015-03-09 13:21:36 +0000 |
commit | 0c2d64d6daf9a9a901a3b67730680e3e97c60f8d (patch) | |
tree | 623a1932c32dcf6cbac9254334690db82ac3816e /lib/custodian/parser.rb | |
parent | 6d95fd2e13f23037bbae89b5627caf53aa346e73 (diff) |
Whitespace fixups.
These were all identified and suggested by rubocop.
Diffstat (limited to 'lib/custodian/parser.rb')
-rw-r--r-- | lib/custodian/parser.rb | 13 |
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 |