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 +4 -4
- data/lib/uptimerobot_cmd/cli.rb +12 -2
- data/lib/uptimerobot_cmd/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: e3e5cd0aad64bbe3fbce46fc80a92dfa3e7c1c8b
|
4
|
+
data.tar.gz: 89a016e9dda8eeb34ccc8621e8e89c17752739ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7cc85742f734664769d4bc8452a1dd6aa7ab31b2cdfbe5893d094b0511ab0349f1cbe6262dec8557c513e7ca6e94c99bcb6d7bd51196a07341ef16e15a6b9124
|
7
|
+
data.tar.gz: 04aae677f793bca3011a95c157d527bcec5d87553a54450f1e7cb245505f4531543bcce5969e9aafbafdf99c74c35726af232581543766bc3d800e680866b999
|
data/lib/uptimerobot_cmd/cli.rb
CHANGED
@@ -35,7 +35,7 @@ module UptimerobotCmd
|
|
35
35
|
end
|
36
36
|
|
37
37
|
option :url, :required => true
|
38
|
-
option :contact_id
|
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
|
-
|
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)
|