uptimerobot_cmd 0.1.0 → 0.1.1

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: abe16a955cd130f4aae5a525042264de95ae12ff
4
- data.tar.gz: cee9bd9976dc375f82f364736ecc8449a0925e9e
3
+ metadata.gz: e3e5cd0aad64bbe3fbce46fc80a92dfa3e7c1c8b
4
+ data.tar.gz: 89a016e9dda8eeb34ccc8621e8e89c17752739ca
5
5
  SHA512:
6
- metadata.gz: 26f524767f3cbc3de44392f3dc534918f7e0990e2c757dda35a6ae2dc7fd4290247a853caf042296a3e260d8dc0ba033d7f72817e3c8cda4c85ea6384a89506d
7
- data.tar.gz: 433c385f12f480f83e6eb93a9875e92b5eac1bc29330a68a50d3e7a252def14a03aafee5fb2fdac52b74b75b2747b018eed68ac91f3358e16f8eac4cabdad258
6
+ metadata.gz: 7cc85742f734664769d4bc8452a1dd6aa7ab31b2cdfbe5893d094b0511ab0349f1cbe6262dec8557c513e7ca6e94c99bcb6d7bd51196a07341ef16e15a6b9124
7
+ data.tar.gz: 04aae677f793bca3011a95c157d527bcec5d87553a54450f1e7cb245505f4531543bcce5969e9aafbafdf99c74c35726af232581543766bc3d800e680866b999
@@ -35,7 +35,7 @@ module UptimerobotCmd
35
35
  end
36
36
 
37
37
  option :url, :required => true
38
- option :contact_id, :required => true
38
+ option :contact_id
39
39
  option :name
40
40
  desc "add_new_monitor", "Add new service for monitor"
41
41
  long_desc <<-LONGDESC
@@ -47,7 +47,17 @@ module UptimerobotCmd
47
47
  def add_new_monitor
48
48
  my_options = {}
49
49
  my_options[:monitor_url] = options[:url]
50
- my_options[:contact_id] = options[:contact_id]
50
+ if ENV['UPTIMEROBOT_DEFAULT_CONTACT']
51
+ my_options[:contact_id] = ENV['UPTIMEROBOT_DEFAULT_CONTACT']
52
+ else
53
+ my_options[:contact_id] = options[:contact_id] if options[:contact_id]
54
+ end
55
+
56
+ unless my_options[:contact_id]
57
+ puts "Please provice --contact-id or set UPTIMEROBOT_DEFAULT_CONTACT environment variable"
58
+ exit
59
+ end
60
+
51
61
  my_options[:friendly_name] = options[:name] if options[:name]
52
62
  begin
53
63
  response = UptimerobotCmd.add_new_monitor(my_options)
@@ -1,3 +1,3 @@
1
1
  module UptimerobotCmd
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uptimerobot_cmd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Uğur Özyılmazel