logsnag 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d88dde87b1c7aca08cfacee42830b74e5557f4650b369636f189ea407bc3f003
4
- data.tar.gz: ddac8e808eb01f115a30da170b9dc43ade986ff2c94ea2019afdfc4d0a312a1c
3
+ metadata.gz: 7276a357c3471e18ad7180555bd6346edce1e2745fcc25704b1f598db20cc2cf
4
+ data.tar.gz: af3f7f42a03acfa4b93592f552a01089a989f73c7db4b3fbb65773732a86ec54
5
5
  SHA512:
6
- metadata.gz: 6b72b52ac3b8c6f6b0ee5ccfea80d97225068d91ec987849d73386c97d3963cea662c7c179c0670db03fe2a86ae9c7e9919220871bea4e5db834ac881e892efa
7
- data.tar.gz: 958c8d9ceb350f4c581f093f44235de5d7d708d28e27110a7bc049c2ab81e6e36225582c1e676de8fa170db7e607f0b9fc1f1d1157fac054cb9081161b59df56
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.1.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.0)
12
- faraday-net_http (~> 2.0)
11
+ faraday (2.7.2)
12
+ faraday-net_http (>= 2.0, < 3.1)
13
13
  ruby2_keywords (>= 0.0.4)
14
- faraday-net_http (2.0.2)
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
@@ -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, :basic, token
27
+ conn.request :authorization, :Bearer, token
23
28
  conn.request :json
24
29
  conn.response :json
25
30
  conn.adapter adapter, @stubs
@@ -0,0 +1,11 @@
1
+ require "ostruct"
2
+
3
+ module LogSnag
4
+ class Insight < OpenStruct
5
+
6
+ def initialize(attributes)
7
+ super OpenStruct.new(attributes)
8
+ end
9
+
10
+ end
11
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LogSnag
4
- VERSION = "0.1.0"
4
+ VERSION = "0.2.0"
5
5
  end
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, "log_snag/client"
9
- autoload :Log, "log_snag/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.1.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: 2022-04-14 00:00:00.000000000 Z
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.2.22
68
+ rubygems_version: 3.3.7
68
69
  signing_key:
69
70
  specification_version: 4
70
71
  summary: Ruby Library for sending LogSnag events