diff options
author | Steve Kemp <steve@steve.org.uk> | 2015-03-09 13:19:15 +0000 |
---|---|---|
committer | Steve Kemp <steve@steve.org.uk> | 2015-03-09 13:19:15 +0000 |
commit | af2ee063abea8235a8cbd1448533e4f4fbc0d0af (patch) | |
tree | 969e448e2d5995f7e838a68ef1d25d54df9b8d29 /lib/custodian/parser.rb | |
parent | bb2ec1f07af747c69f2fd1e5b70c41b35fb069e6 (diff) |
Prefer single-quotes when you don't need interpolation.
So "foo" is less good than 'foo'.
Diffstat (limited to 'lib/custodian/parser.rb')
-rw-r--r-- | lib/custodian/parser.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/custodian/parser.rb b/lib/custodian/parser.rb index c75a050..6942da8 100644 --- a/lib/custodian/parser.rb +++ b/lib/custodian/parser.rb @@ -73,7 +73,7 @@ module Custodian http.open_timeout = 60 http.read_timeout = 60 - if (url.scheme == "https") + if (url.scheme == 'https') http.use_ssl = true http.verify_mode = OpenSSL::SSL::VERIFY_NONE end @@ -89,7 +89,7 @@ module Custodian if ( response.code.to_i != 200 ) puts "Status code of #{uri_str} was #{response.code}" - puts "ABORTING" + puts 'ABORTING' exit( 0 ) end @@ -104,11 +104,11 @@ module Custodian end rescue Errno::EHOSTUNREACH => ex - raise ex, "no route to host" + raise ex, 'no route to host' rescue Timeout::Error => ex - raise ex, "timeout" + raise ex, 'timeout' rescue Errno::ECONNREFUSED => ex - raise ex, "connection refused" + raise ex, 'connection refused' end end @@ -135,7 +135,7 @@ module Custodian # # HTTP-fetch # - uri = $1.dup.chomp(".") + uri = $1.dup.chomp('.') text = get_url_contents(uri) text.split( /[\r\n]/ ).each do |line| @@ -411,7 +411,7 @@ module Custodian # def parse_file( filename ) - raise ArgumentError, "Missing configuration file!" if filename.nil? + raise ArgumentError, 'Missing configuration file!' if filename.nil? raise ArgumentError, "File not found: #{@file}" unless File.exist?( filename) # |