url-status 1.0.6 → 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ff659559d0b7430b3a3000c0159aec2e554a2d33
4
- data.tar.gz: 919fea9eef1c6c398e7b80eee3b4a1beb14f7efb
3
+ metadata.gz: ad99add2ba051062c92bc37bedf8c7999f62df78
4
+ data.tar.gz: cc876c399262364de5277eb688028b23d4da9944
5
5
  SHA512:
6
- metadata.gz: 46c9ff467f262e5fb7de36d5b8ac8fff59eb025816e43e0ce8f6e18487f709252c5b1dd26790ea07df834a0bd876dbf1dfbe3816d51ac63b7be88d3cc2e76d79
7
- data.tar.gz: f7496bbdd88f63638843a9f11a1d442ace86ca3df15755ff2a7c86e1783864a75323fe588ebca79a9eb9e99a02bb3a47c946164fd0b39ab8903bed9077c31910
6
+ metadata.gz: f182c31d94f18949388b593320d902442d2793cf693c09680b721ab4431b87abd527ff1d25737b796cb20376da9281b426631ad03494c781bfd20d3c3b6fc55c
7
+ data.tar.gz: f6f8dbef88ffc6c8501e80556d49dfdf85c2860d3bd9fdba9ac55f091f9579700b0f4b6c01b40ba6359a27ac4287b7723fe1f0c3d5d4752b7002e2c51359ae80
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- url-status (1.0.5)
4
+ url-status (1.0.7)
5
5
  colorize
6
6
  rest-client (~> 1.8)
7
7
  trollop
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
 
@@ -1,3 +1,4 @@
1
1
  #!/usr/bin/env ruby
2
+
2
3
  require 'url_status'
3
4
  UrlStatus::App.new.main
@@ -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] || "#{ENV['HOME']}/sites.yaml"
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
 
@@ -1,3 +1,3 @@
1
1
  module UrlStatus
2
- VERSION = "1.0.6"
2
+ VERSION = "1.0.7"
3
3
  end
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.6
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-08 00:00:00.000000000 Z
11
+ date: 2016-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client