url-status 1.0.7 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/url_status.rb +3 -2
- data/lib/url_status/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7f406b5fc4ed560b48cd7e27d21dd60dff9fa3bc
|
|
4
|
+
data.tar.gz: 0d7f62a678a4083b7b3e6a4cd5c43879ad460344
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 14d724df41c907433c29a9be6dd8c917cef977eea82f82ace3c535ce6fc8545102c8e5899a7acdb388cbe709db62cd5b791f7f41ac07f7c80003b47592d165f5
|
|
7
|
+
data.tar.gz: f88524229231b04ac6fddca6842ea0806a91dbc939afa91865324a37cea7ea62ab90c7b476c708e03a807faa36a5b35ad4f0b86181e40e201c76f5c098f3d513
|
data/Gemfile.lock
CHANGED
data/lib/url_status.rb
CHANGED
|
@@ -47,7 +47,7 @@ module UrlStatus
|
|
|
47
47
|
def url_list
|
|
48
48
|
opts = Trollop::options do
|
|
49
49
|
version "url-status #{UrlStatus::VERSION} (c) 2016 @reednj (reednj@gmail.com)"
|
|
50
|
-
banner "Usage:
|
|
50
|
+
banner "Usage: url-status [options] [urls...]"
|
|
51
51
|
opt :config, "YAML config file containing array of urls", :type => :string
|
|
52
52
|
end
|
|
53
53
|
|
|
@@ -75,10 +75,11 @@ module UrlStatus
|
|
|
75
75
|
end
|
|
76
76
|
|
|
77
77
|
def get_response(url)
|
|
78
|
+
user_agent = "url-status/#{UrlStatus::VERSION}"
|
|
78
79
|
url = 'http://' + url unless url.start_with? 'http'
|
|
79
80
|
|
|
80
81
|
begin
|
|
81
|
-
return RestClient.get(url)
|
|
82
|
+
return RestClient.get(url, :user_agent => user_agent)
|
|
82
83
|
rescue RestClient::ExceptionWithResponse => e
|
|
83
84
|
raise e if e.response.nil?
|
|
84
85
|
return e.response
|
data/lib/url_status/version.rb
CHANGED