everylog_ruby_client 1.0.1 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -0
- data/README.md +11 -10
- data/lib/everylog_ruby_client/version.rb +1 -1
- data/lib/everylog_ruby_client.rb +23 -23
- 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: 8442bcf4e02820f0f7f7f7123d36bea5f3d151be485b722fbb6976690325077a
|
4
|
+
data.tar.gz: 03f5023f50b0112fcb799747e3b4485caa2ead5da297761043eac1271cf576be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb5325df0a8340ab4cee5793aa88cf6bf7e525599460bebc56fe674c31b87be34f2fcd9a6b4714f72cb807c2c2ef81fc129f57d62257657d18f0fedcd8f61440
|
7
|
+
data.tar.gz: eaf091ad48aa507c6ee7c6495d26a09ac467cfacc12f1b9a277bd5b991e928900065ce657a79702ba169e9f3135018b029b381edd417c417195660d006e65f8f
|
data/CHANGELOG.md
CHANGED
@@ -3,3 +3,17 @@
|
|
3
3
|
## [1.0.0] - 2022-04-22
|
4
4
|
|
5
5
|
- Initial release
|
6
|
+
|
7
|
+
## [1.0.2] - 2022-04-22
|
8
|
+
|
9
|
+
- Bump version
|
10
|
+
|
11
|
+
## [1.0.3] - 2022-04-28
|
12
|
+
|
13
|
+
- pass on setup projectId
|
14
|
+
- add possibility to override on notify the projectId
|
15
|
+
- update readme
|
16
|
+
|
17
|
+
## [1.0.4] - 2022-04-28
|
18
|
+
|
19
|
+
- fix http call
|
data/README.md
CHANGED
@@ -24,17 +24,18 @@ 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
|
-
|
30
|
-
# @param [Hash]
|
31
|
-
# @option
|
32
|
-
# @option
|
33
|
-
# @option
|
34
|
-
# @option
|
35
|
-
# @option
|
36
|
-
# @option
|
37
|
-
# @option
|
29
|
+
$EveryLogClient = EveryLog::Client.instance.setup(api_key: <YOUR_API_KEY>, projectId: <YOUR_PROJECT_NAME>)
|
30
|
+
|
31
|
+
# @param [Hash] notify_options
|
32
|
+
# @option notify_options [String, options[:projectId]] :projectId name of the project
|
33
|
+
# @option notify_options [String] :title to display in the application and if enabled in the notification
|
34
|
+
# @option notify_options [String] :summary is a not so long text to display on the application and if enabled in the notification
|
35
|
+
# @option notify_options [String] :body it can contain a long text simple formatted, no html to display in the application
|
36
|
+
# @option notify_options [Array] :tags it can be used to categorize the notification, must be strings
|
37
|
+
# @option notify_options [String] :link it can be used to display on the application and if enabled in the notification
|
38
|
+
# @option notify_options [Boolean] :push if True, a push notification is sent to application
|
38
39
|
$EveryLogClient.notify(...)
|
39
40
|
```
|
40
41
|
## Contributing
|
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,31 +27,31 @@ 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
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
req.body
|
52
|
-
res
|
53
|
-
http.request(req)
|
54
|
-
end
|
48
|
+
merged_options = { projectId: options[:projectId] }.merge(@notify_options)
|
49
|
+
uri = URI(options[:everylog_url])
|
50
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
51
|
+
http.use_ssl = true
|
52
|
+
req = Net::HTTP::Post.new(uri.path, 'Content-Type' => 'application/json', "Authorization": "Bearer #{options[:api_key]}")
|
53
|
+
req.body = merged_options.to_json
|
54
|
+
res = http.request(req)
|
55
55
|
res.body
|
56
56
|
end
|
57
57
|
|
@@ -72,5 +72,5 @@ module EveryLog
|
|
72
72
|
|
73
73
|
result_parsed_options
|
74
74
|
end
|
75
|
-
end
|
76
|
-
end
|
75
|
+
end
|
76
|
+
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.4
|
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-
|
11
|
+
date: 2022-05-25 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.4
|
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.4
|
34
34
|
post_install_message:
|
35
35
|
rdoc_options: []
|
36
36
|
require_paths:
|