uptimerobot_cmd 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/uptimerobot_cmd.rb +3 -4
- 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: 951f3eb7ede3b62e98ba0e0cd72465f2d5aaa6d1
|
4
|
+
data.tar.gz: aac7a2f6527894e3ee6f8fc4357e0d165566e392
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c4b1c9139b96f6dc6ce6b3c46912a7bd50690a77dc6e33670a913bab41845fdd635e5b8d35745f1d99d8dc9c1e3f9eaa14f9a599733d06a517b379dbb39ea0a3
|
7
|
+
data.tar.gz: 731438df1585143f37657fbb4ebcb1832ceab7f07f46ae9a48797df5e91e66a415c3c51bc539327421d63495f81e374572af85b6e4da8154ca8523f3fec952cf
|
data/README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
[![Build Status](https://travis-ci.org/vigo/uptimerobot_cmd.svg?branch=master)](https://travis-ci.org/vigo/uptimerobot_cmd)
|
2
|
-
![Version](https://img.shields.io/badge/version-0.3.
|
2
|
+
![Version](https://img.shields.io/badge/version-0.3.3-yellow.svg)
|
3
3
|
|
4
4
|
|
5
5
|
# UptimerobotCmd
|
data/lib/uptimerobot_cmd.rb
CHANGED
@@ -60,16 +60,15 @@ module UptimerobotCmd
|
|
60
60
|
output = response["monitors"]["monitor"]
|
61
61
|
|
62
62
|
if total > limit
|
63
|
-
output = []
|
64
63
|
max_pages = total / limit
|
65
64
|
left_over = total % limit
|
66
65
|
max_pages += 1 if left_over > 0
|
67
66
|
current_page = 1
|
68
|
-
while current_page
|
69
|
-
options[:offset] =
|
67
|
+
while current_page < max_pages
|
68
|
+
options[:offset] = current_page * limit
|
69
|
+
puts "fetching... #{options[:offset]}"
|
70
70
|
response = HTTParty.get(::UptimerobotCmd.build_service_url(:get_monitors, options))
|
71
71
|
output += response["monitors"]["monitor"]
|
72
|
-
offset = current_page * limit
|
73
72
|
current_page += 1
|
74
73
|
end
|
75
74
|
end
|