infield 0.2.0 → 0.3.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/README.md +2 -2
- data/lib/infield/core_ext.rb +20 -1
- data/lib/infield/heartbeat.rb +0 -1
- data/lib/infield/version.rb +1 -1
- data/lib/infield.rb +2 -2
- 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: 325524018c44e26d8fe8513f38604197def031b5582285f63c7c928b8c8d4b84
|
4
|
+
data.tar.gz: 3b04d9d84e329c69c0c5b3bb822253943f9d0ba12a5ce3d78721b25e12657d87
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f9179b0602fe9f755169b59af4a0e1ff10a62de52ac0c1cafaa96ac4653badd9a771b3cd3be5c73c35c12ddaf121a066c702c68b390d2ca123b687b8195bfee7
|
7
|
+
data.tar.gz: 0624c57b8417151e01dfdb1de57a10ab2b69656e565443f31ad848c584fcd4bb2a894dea8b3a661c38000ecf38ef9878c0922d95f13e2c663b2d840b336106c7
|
data/README.md
CHANGED
@@ -4,7 +4,7 @@ This gem handles reporting deprecation warnings to Infield from a Rails app.
|
|
4
4
|
|
5
5
|
## Setup
|
6
6
|
|
7
|
-
You'll need an API key and repo environment ID to use this gem.
|
7
|
+
You'll need an API key and repo environment ID to use this gem. You can find these at https://app.infield.ai/deprecations after signing up.
|
8
8
|
|
9
9
|
Add the gem to your gemfile:
|
10
10
|
|
@@ -15,7 +15,7 @@ Then in `config/application.rb`:
|
|
15
15
|
if ENV['INFIELD_API_KEY']
|
16
16
|
require 'infield'
|
17
17
|
Infield.run(api_key: ENV['INFIELD_API_KEY'],
|
18
|
-
repo_environment_id: ENV['INFIELD_REPO_ENVIRONMENT_ID')
|
18
|
+
repo_environment_id: ENV['INFIELD_REPO_ENVIRONMENT_ID'])
|
19
19
|
end
|
20
20
|
|
21
21
|
And in any environment you want to profile from:
|
data/lib/infield/core_ext.rb
CHANGED
@@ -10,5 +10,24 @@ module Infield
|
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
|
-
|
13
|
+
module InfieldWarningCapture
|
14
|
+
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.0")
|
15
|
+
# Ruby 3.0+ supports warn(msg, category: nil, **kwargs)
|
16
|
+
def warn(msg, category: nil, **kwargs)
|
17
|
+
super
|
18
|
+
|
19
|
+
Infield::DeprecationWarning.log(msg, callstack: caller_locations, validated: true) if category == :deprecated
|
20
|
+
end
|
21
|
+
else
|
22
|
+
# Ruby < 3.0 only provides a single argument to warn
|
23
|
+
def warn(msg)
|
24
|
+
super
|
25
|
+
|
26
|
+
Infield::DeprecationWarning.log(msg, callstack: caller_locations, validated: false)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
Kernel.extend(Core)
|
32
|
+
Warning.extend(InfieldWarningCapture)
|
14
33
|
end
|
data/lib/infield/heartbeat.rb
CHANGED
data/lib/infield/version.rb
CHANGED
data/lib/infield.rb
CHANGED
@@ -6,7 +6,7 @@ require 'net/http'
|
|
6
6
|
|
7
7
|
require_relative 'infield/version'
|
8
8
|
|
9
|
-
|
9
|
+
require_relative 'infield/core_ext'
|
10
10
|
require_relative 'infield/rails' if defined?(Rails)
|
11
11
|
|
12
12
|
module Infield
|
@@ -25,7 +25,7 @@ module Infield
|
|
25
25
|
raise 'API key is required' unless @api_key
|
26
26
|
raise 'repo_environment_id is required' unless @repo_environment_id
|
27
27
|
|
28
|
-
@environment = environment || defined?(Rails) ? Rails.env : nil
|
28
|
+
@environment = environment || (defined?(Rails) ? Rails.env : nil)
|
29
29
|
|
30
30
|
# Start the deprecation warning processor
|
31
31
|
DeprecationWarning::Runner.run(sleep_interval: sleep_interval, batch_size: batch_size, queue_limit: queue_limit)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: infield
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Infield
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-01-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: webmock
|