logsnag-ruby 0.1.2 → 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/.rubocop.yml +1 -1
- data/CHANGELOG.md +7 -0
- data/lib/logsnag/configuration.rb +8 -0
- data/lib/logsnag/version.rb +1 -1
- data/lib/logsnag.rb +4 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '08a757173a28ae4dd7526530a3d556a550f063f6f7abb15b14c582e041a08221'
|
|
4
|
+
data.tar.gz: 8a71ba4b2441402bf93e3a34b05479a7812cf2887e9ae448c5a6603fa62c9a77
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: defcc554de6957ed3f791011499ea275036b0e0a58c59b847357da3a02f1385f5bf1c491a714fb1eb5785f04be3e0eeb9d64cf2fa2ec9c58fb7205793d8200f9
|
|
7
|
+
data.tar.gz: ce7477ca23df46a57ea92cbc7991d455a7153f87071d67904b84ae3192e27dadfef88b971a37c41e4b89755a138966ca33bfd9f7bbfd7e16e00df1e0a19e8339
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.2.0](https://github.com/damonbauer/logsnag-ruby/compare/v0.1.2...v0.2.0) (2026-04-01)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add enabled option to disable event sending ([2614f09](https://github.com/damonbauer/logsnag-ruby/commit/2614f093f28a6f228e1afe788e5c4713b2b7216b)), closes [#20](https://github.com/damonbauer/logsnag-ruby/issues/20)
|
|
9
|
+
|
|
3
10
|
## [0.1.2](https://github.com/damonbauer/logsnag-ruby/compare/v0.1.1...v0.1.2) (2026-03-17)
|
|
4
11
|
|
|
5
12
|
|
|
@@ -5,6 +5,14 @@ module LogSnag
|
|
|
5
5
|
class Configuration
|
|
6
6
|
attr_accessor :logger
|
|
7
7
|
attr_reader :api_token, :project
|
|
8
|
+
attr_writer :enabled
|
|
9
|
+
|
|
10
|
+
def enabled
|
|
11
|
+
return @enabled unless @enabled.nil?
|
|
12
|
+
return false if ENV["LOGSNAG_ENABLED"]&.downcase == "false"
|
|
13
|
+
|
|
14
|
+
true
|
|
15
|
+
end
|
|
8
16
|
|
|
9
17
|
def api_token=(token)
|
|
10
18
|
raise ArgumentError, "API token cannot be nil" if token.nil? || token.empty?
|
data/lib/logsnag/version.rb
CHANGED
data/lib/logsnag.rb
CHANGED
|
@@ -117,6 +117,8 @@ module LogSnag
|
|
|
117
117
|
# @param body [LogSnag::Log,LogSnag::Identify,LogSnag::Insight] The body of the request.
|
|
118
118
|
# @return [LogSnag::Result] The formatted result from the request.
|
|
119
119
|
def execute_post(path, body)
|
|
120
|
+
return Result.new(success: true, data: nil, status_code: nil, error_message: nil) unless config.enabled
|
|
121
|
+
|
|
120
122
|
response = post(
|
|
121
123
|
path,
|
|
122
124
|
body: body.to_json,
|
|
@@ -133,6 +135,8 @@ module LogSnag
|
|
|
133
135
|
# @param body [LogSnag::Insight] The body of the request.
|
|
134
136
|
# @return [LogSnag::Result] The formatted result from the request.
|
|
135
137
|
def execute_patch(path, body)
|
|
138
|
+
return Result.new(success: true, data: nil, status_code: nil, error_message: nil) unless config.enabled
|
|
139
|
+
|
|
136
140
|
response = patch(
|
|
137
141
|
path,
|
|
138
142
|
body: {
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: logsnag-ruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Damon Bauer
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-04-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: httparty
|