logsnag 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +5 -4
- data/README.md +6 -0
- data/lib/log_snag/client.rb +6 -1
- data/lib/log_snag/insight.rb +11 -0
- data/lib/log_snag/version.rb +1 -1
- data/lib/log_snag.rb +3 -2
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7276a357c3471e18ad7180555bd6346edce1e2745fcc25704b1f598db20cc2cf
|
4
|
+
data.tar.gz: af3f7f42a03acfa4b93592f552a01089a989f73c7db4b3fbb65773732a86ec54
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: facc6e65d24474bab843cbdaa44d9ddfcce5d560910b9979de807e6fe3178c7aa6928302effb93f80bd2f3c5ba7e3e22f093e57aaf7eb2882d452ba8b09b16e6
|
7
|
+
data.tar.gz: c22bbbb4e742284caf3c93397b5936883857c275c6fe900a2742be5cce362951cc4577650e38aa953f659c49c1d31e80b77fa3255a62d8852929cf37434f9df0
|
data/Gemfile.lock
CHANGED
@@ -1,21 +1,22 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
logsnag (0.
|
4
|
+
logsnag (0.2.0)
|
5
5
|
faraday (~> 2.0)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
10
|
dotenv (2.7.6)
|
11
|
-
faraday (2.2
|
12
|
-
faraday-net_http (
|
11
|
+
faraday (2.7.2)
|
12
|
+
faraday-net_http (>= 2.0, < 3.1)
|
13
13
|
ruby2_keywords (>= 0.0.4)
|
14
|
-
faraday-net_http (
|
14
|
+
faraday-net_http (3.0.2)
|
15
15
|
rake (13.0.6)
|
16
16
|
ruby2_keywords (0.0.5)
|
17
17
|
|
18
18
|
PLATFORMS
|
19
|
+
arm64-darwin-21
|
19
20
|
x86_64-linux
|
20
21
|
|
21
22
|
DEPENDENCIES
|
data/README.md
CHANGED
@@ -26,6 +26,12 @@ Firstly you'll need to set an API Token.
|
|
26
26
|
@logsnag.log(project: "my-project", channel: "channel", event: "my-event")
|
27
27
|
```
|
28
28
|
|
29
|
+
### Sending an Insight
|
30
|
+
|
31
|
+
```ruby
|
32
|
+
@logsnag.insight(project: "my-project", title: "Title of Insight", value: "the-value")
|
33
|
+
```
|
34
|
+
|
29
35
|
Available Options:
|
30
36
|
|
31
37
|
- description
|
data/lib/log_snag/client.rb
CHANGED
@@ -17,9 +17,14 @@ module LogSnag
|
|
17
17
|
Log.new post_request("log", body: attributes.merge(params)).body
|
18
18
|
end
|
19
19
|
|
20
|
+
def insight(project:, title:, value:, **params)
|
21
|
+
attributes = {project: project, title: title, value: value}
|
22
|
+
Insight.new post_request("insight", body: attributes.merge(params)).body
|
23
|
+
end
|
24
|
+
|
20
25
|
def connection
|
21
26
|
@connection ||= Faraday.new(BASE_URL) do |conn|
|
22
|
-
conn.request :authorization, :
|
27
|
+
conn.request :authorization, :Bearer, token
|
23
28
|
conn.request :json
|
24
29
|
conn.response :json
|
25
30
|
conn.adapter adapter, @stubs
|
data/lib/log_snag/version.rb
CHANGED
data/lib/log_snag.rb
CHANGED
@@ -5,7 +5,8 @@ require_relative "log_snag/version"
|
|
5
5
|
module LogSnag
|
6
6
|
class Error < StandardError; end
|
7
7
|
|
8
|
-
autoload :Client,
|
9
|
-
autoload :Log,
|
8
|
+
autoload :Client, "log_snag/client"
|
9
|
+
autoload :Log, "log_snag/log"
|
10
|
+
autoload :Insight, "log_snag/insight"
|
10
11
|
|
11
12
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logsnag
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dean Perry
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -39,6 +39,7 @@ files:
|
|
39
39
|
- Rakefile
|
40
40
|
- lib/log_snag.rb
|
41
41
|
- lib/log_snag/client.rb
|
42
|
+
- lib/log_snag/insight.rb
|
42
43
|
- lib/log_snag/log.rb
|
43
44
|
- lib/log_snag/version.rb
|
44
45
|
- lib/logsnag.rb
|
@@ -64,7 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
64
65
|
- !ruby/object:Gem::Version
|
65
66
|
version: '0'
|
66
67
|
requirements: []
|
67
|
-
rubygems_version: 3.
|
68
|
+
rubygems_version: 3.3.7
|
68
69
|
signing_key:
|
69
70
|
specification_version: 4
|
70
71
|
summary: Ruby Library for sending LogSnag events
|