everylog_ruby_client 1.0.2 → 1.0.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 +3 -2
- data/lib/everylog_ruby_client/version.rb +1 -1
- data/lib/everylog_ruby_client.rb +18 -15
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d39da808eb820cc4ee1b6050bb39181825b34e853dfe17f4169019f62e4b4837
|
4
|
+
data.tar.gz: 2fbc6ea5bcca09b405cf0057da2b7d45360ceb5f876e95226a98cb012ad17432
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7252c4298498c8b6304bd975e4192a8068cde49b1ae8299cd1bf1bd6bb366fb9592d64e15303c93b33c7708787f67db0e7a8e4892200e8b6eb8502f175148646
|
7
|
+
data.tar.gz: 4899921c1743e8b35f1471ef2f513723e87a8602bf149669327765e91592bda7f961629abdf17db11e5a8ac61d0cbf7f141c82e36c33e346838dfb3e7ba37dae
|
data/README.md
CHANGED
@@ -24,11 +24,12 @@ require 'everylog_ruby_client'
|
|
24
24
|
|
25
25
|
# @param [Hash] options
|
26
26
|
# @option options [String] :api_key for authenticate against EveryLog server
|
27
|
+
# @option options [String] :projectId name of the project
|
27
28
|
# @option options [String] :everylog_url (https://api.everylog.io/api/v1/log-entries) to reach Everlog server
|
28
|
-
$EveryLogClient = EveryLog::Client.instance.setup(api_key: <YOUR_API_KEY>)
|
29
|
+
$EveryLogClient = EveryLog::Client.instance.setup(api_key: <YOUR_API_KEY>, projectId: <YOUR_PROJECT_NAME>)
|
29
30
|
|
30
31
|
# @param [Hash] options
|
31
|
-
# @option
|
32
|
+
# @option notify_options [String, options[:projectId]] :projectId name of the project
|
32
33
|
# @option options [String] :title to display in the application and if enabled in the notification
|
33
34
|
# @option options [String] :summary is a not so long text to display on the application and if enabled in the notification
|
34
35
|
# @option options [String] :body it can contain a long text simple formatted, no html to display in the application
|
data/lib/everylog_ruby_client.rb
CHANGED
@@ -10,14 +10,14 @@ module EveryLog
|
|
10
10
|
|
11
11
|
SETUP_DEFAULTS = {
|
12
12
|
api_key: nil,
|
13
|
+
projectId: nil,
|
13
14
|
everylog_url: "https://api.everylog.io/api/v1/log-entries"
|
14
15
|
}.freeze
|
15
16
|
|
16
17
|
NOTIFY_DEFAULTS = {
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
body: nil,
|
18
|
+
title: "Empty notification",
|
19
|
+
summary: "Empty summary",
|
20
|
+
body: "Empty body",
|
21
21
|
tags: [],
|
22
22
|
link: "",
|
23
23
|
push: false
|
@@ -27,20 +27,22 @@ module EveryLog
|
|
27
27
|
|
28
28
|
# @param [Hash] options
|
29
29
|
# @option options [String] :api_key for authenticate against Everylog server
|
30
|
+
# @option options [String] :projectId name of the project
|
30
31
|
# @option options [String] :everylog_url (https://api.everylog.io/api/v1/log-entries) to reach Everlog server
|
31
32
|
def setup(options = {})
|
32
33
|
@options = _parse_options(options, SETUP_DEFAULTS)
|
33
34
|
self
|
34
35
|
end
|
35
36
|
|
36
|
-
# @param [Hash]
|
37
|
-
# @option
|
38
|
-
# @option
|
39
|
-
# @option
|
40
|
-
# @option
|
41
|
-
# @option
|
42
|
-
# @option
|
43
|
-
# @option
|
37
|
+
# @param [Hash] notify_options
|
38
|
+
# @option notify_options [String, options[:projectId]] :projectId name of the project
|
39
|
+
# @option notify_options [String] :title to display in the application and if enabled in the notification
|
40
|
+
# @option notify_options [String] :summary is a not so long text to display on the application and if enabled in the notification
|
41
|
+
# @option notify_options [String] :body it can contain a long text simple formatted, no html to display in the application
|
42
|
+
# @option notify_options [Array] :tags it can be used to categorize the notification, must be strings
|
43
|
+
# @option notify_options [String] :link it can be used to display on the application and if enabled in the notification
|
44
|
+
# @option notify_options [Boolean] :push if True, a push notification is sent to application
|
45
|
+
|
44
46
|
def notify(notify_options = {})
|
45
47
|
@notify_options = _parse_options(notify_options, NOTIFY_DEFAULTS)
|
46
48
|
uri = URI(options[:everylog_url])
|
@@ -48,7 +50,8 @@ module EveryLog
|
|
48
50
|
"Content-Type": "application/json",
|
49
51
|
"Authorization": "Bearer #{options[:api_key]}"
|
50
52
|
})
|
51
|
-
|
53
|
+
merged_options = { projectId: options[:projectId] }.merge(@notify_options)
|
54
|
+
req.body = merged_options.to_json
|
52
55
|
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
|
53
56
|
http.request(req)
|
54
57
|
end
|
@@ -72,5 +75,5 @@ module EveryLog
|
|
72
75
|
|
73
76
|
result_parsed_options
|
74
77
|
end
|
75
|
-
end
|
76
|
-
end
|
78
|
+
end
|
79
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: everylog_ruby_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gilberto Maccacaro
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-04-
|
11
|
+
date: 2022-04-28 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: " A simple Ruby with no external dependencies, to easily integrate
|
14
14
|
with Everylog API\n"
|
@@ -28,9 +28,9 @@ licenses:
|
|
28
28
|
metadata:
|
29
29
|
bug_tracker_uri: https://github.com/everylogsaas/everylog_ruby_client/issues
|
30
30
|
changelog_uri: https://github.com/everylogsaas/everylog_ruby_client/blob/master/CHANGELOG.md
|
31
|
-
documentation_uri: https://www.rubydoc.info/gems/everylog_ruby_client/1.0.
|
31
|
+
documentation_uri: https://www.rubydoc.info/gems/everylog_ruby_client/1.0.3
|
32
32
|
homepage_uri: https://github.com/everylogsaas/everylog_ruby_client
|
33
|
-
source_code_uri: https://github.com/everylogsaas/everylog_ruby_client/tree/v1.0.
|
33
|
+
source_code_uri: https://github.com/everylogsaas/everylog_ruby_client/tree/v1.0.3
|
34
34
|
post_install_message:
|
35
35
|
rdoc_options: []
|
36
36
|
require_paths:
|