url-status 1.0.6 → 1.0.7
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/README.md +1 -5
- data/exe/url-status +1 -0
- data/lib/url_status.rb +12 -1
- data/lib/url_status/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ad99add2ba051062c92bc37bedf8c7999f62df78
|
4
|
+
data.tar.gz: cc876c399262364de5277eb688028b23d4da9944
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f182c31d94f18949388b593320d902442d2793cf693c09680b721ab4431b87abd527ff1d25737b796cb20376da9281b426631ad03494c781bfd20d3c3b6fc55c
|
7
|
+
data.tar.gz: f6f8dbef88ffc6c8501e80556d49dfdf85c2860d3bd9fdba9ac55f091f9579700b0f4b6c01b40ba6359a27ac4287b7723fe1f0c3d5d4752b7002e2c51359ae80
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -25,11 +25,7 @@ If any of the urls fail, then the gem will return a status code of 1, allowing o
|
|
25
25
|
|
26
26
|
## Installation
|
27
27
|
|
28
|
-
$ gem install url-status
|
29
|
-
|
30
|
-
## Contributing
|
31
|
-
|
32
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/url_status.
|
28
|
+
$ gem install --user-install url-status
|
33
29
|
|
34
30
|
## License
|
35
31
|
|
data/exe/url-status
CHANGED
data/lib/url_status.rb
CHANGED
@@ -14,6 +14,7 @@ module UrlStatus
|
|
14
14
|
|
15
15
|
class App
|
16
16
|
def main
|
17
|
+
|
17
18
|
# we want to disable the text coloring if we are printing to a
|
18
19
|
# file, or on a platform (like windows) that likely doesn't support
|
19
20
|
# the colors
|
@@ -46,12 +47,18 @@ module UrlStatus
|
|
46
47
|
def url_list
|
47
48
|
opts = Trollop::options do
|
48
49
|
version "url-status #{UrlStatus::VERSION} (c) 2016 @reednj (reednj@gmail.com)"
|
50
|
+
banner "Usage: #{$0} [options] [urls...]"
|
49
51
|
opt :config, "YAML config file containing array of urls", :type => :string
|
50
52
|
end
|
51
53
|
|
52
54
|
if ARGV.empty?
|
55
|
+
|
56
|
+
if opts[:config].nil? && !File.exist?(default_config_file)
|
57
|
+
Trollop::educate
|
58
|
+
end
|
59
|
+
|
53
60
|
begin
|
54
|
-
data_file_name = opts[:config] ||
|
61
|
+
data_file_name = opts[:config] || default_config_file
|
55
62
|
YAML.load_file(data_file_name)
|
56
63
|
rescue => e
|
57
64
|
puts "Could not open '#{data_file_name}' (#{e})"
|
@@ -63,6 +70,10 @@ module UrlStatus
|
|
63
70
|
|
64
71
|
end
|
65
72
|
|
73
|
+
def default_config_file
|
74
|
+
"#{ENV['HOME']}/sites.yaml"
|
75
|
+
end
|
76
|
+
|
66
77
|
def get_response(url)
|
67
78
|
url = 'http://' + url unless url.start_with? 'http'
|
68
79
|
|
data/lib/url_status/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: url-status
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Reed
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-11-
|
11
|
+
date: 2016-11-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|