cronjob_service 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/cronjob_service.rb +13 -4
- data/lib/cronjob_service/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: b7dbd0e2e3892ff18428b830d033d2b1672660e1
|
4
|
+
data.tar.gz: a46909e8a2a5b45a4c6e241ff3759cc3934910fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c9fb1eaa5760691493443e0f28048402042ec8c7cae7117f7ed374186b0e15ed620218934d88392133fffbbb8fddd6e98143d4eac5c7174a77bd23d5ac3bf42
|
7
|
+
data.tar.gz: 8488e9fbc46b987adc2f73151aa7734366eeee6c58a54464c5f521cd0bcc8b661ba00a60daf983e88319e507c81506993aa2f46431e010ce3cf9b218b4e00046
|
data/Gemfile.lock
CHANGED
data/lib/cronjob_service.rb
CHANGED
@@ -2,6 +2,9 @@
|
|
2
2
|
|
3
3
|
require "open-uri"
|
4
4
|
require "cronjob_service/version"
|
5
|
+
require 'net/http'
|
6
|
+
require 'uri'
|
7
|
+
require 'json'
|
5
8
|
|
6
9
|
module CronjobService
|
7
10
|
class Notifier
|
@@ -14,11 +17,17 @@ module CronjobService
|
|
14
17
|
post_url = ["#{base_url}/#{project_id}?title=#{cron_identifier}", parameterized_options].join("&")
|
15
18
|
|
16
19
|
begin
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
+
uri = URI.parse(post_url)
|
21
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
22
|
+
http.use_ssl = true
|
23
|
+
request = Net::HTTP::Post.new(uri.request_uri, {})
|
24
|
+
request.body = ({ title: cron_identifier }.merge(options)).to_json
|
25
|
+
|
26
|
+
# Send the request
|
27
|
+
response = http.request(request)
|
28
|
+
rescue => e
|
29
|
+
puts "https://dashboard.smart-village.app Error: #{e.inspect}"
|
20
30
|
end
|
21
31
|
end
|
22
|
-
|
23
32
|
end
|
24
33
|
end
|