infield 0.5.0 → 0.7.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 706e3b8eb5b4a5eb812a3212a8c681021d35e0f3c5793a4ea41bbe0cf142cf9f
4
- data.tar.gz: 142dc03b525827beb632755d9700f9f8d47542d094b1e5ae07d1b7858b8f3a36
3
+ metadata.gz: 72a71c565210ec537d117093bd33a58918cc485cdcf7c3111b45033a066b8652
4
+ data.tar.gz: a5db478b896da5d88a8232f2538254e2ad9645083be7124ddedf22f7eec661c3
5
5
  SHA512:
6
- metadata.gz: 7fa4027787cfbccc543b2bf8b662b59e522908926776a14ee4d5cb11e86acb41d643c87d37dabb353c9166c636418f7b1b469325825b72bb2f3f244979347ba0
7
- data.tar.gz: ae9611ddc2352b8af6451b1842dec24d0e1487d1744c0b24d5aa29305aa59dd606fe146c33ad6ed29994d224e7de5f75a7317054150511aa2e55cc69df86d640
6
+ metadata.gz: d6a761e2ffa3c37ceefd64a85994344c0ff6f7edb9f49639df042f5c015b1db47c834d2459950e3747f90631728ad0742dabc54fa009ceed20744dffbb04d18d
7
+ data.tar.gz: 3ddfcf9a6fb943c6be184daed62b0a545287d94d36d6c8683e5da6af036023de11c55a50fca4b3cc4c462f0795abc5b4a078ef5c166ef76c450760060948ccea
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.7.0] - 2025-04-16
4
+
5
+ - Send Rails.root alongside deprecation warnings so they can be hidden from callstacks
6
+
7
+ ## [0.6.0] - 2025-04-10
8
+
9
+ - Bypass Webmock in test environments.
10
+
3
11
  ## [0.1.0] - 2023-11-14
4
12
 
5
13
  - Initial release
@@ -48,17 +48,35 @@ module Infield
48
48
  messages = tasks.map { |w| { message: w.message, callstack: w.callstack.map(&:to_s) } }
49
49
 
50
50
  uri = infield_api_uri
51
+
52
+ webmock_needs_re_enabling = false
53
+ if defined?(WebMock) && WebMock.respond_to?(:net_connect_allowed?) &&
54
+ !WebMock.net_connect_allowed?(Infield.infield_api_url)
55
+ webmock_needs_re_enabling = true
56
+ allowed = WebMock::Config.instance.allow
57
+ WebMock.disable_net_connect!(allow: Infield.infield_api_url)
58
+ end
59
+
60
+ if defined?(Rails) && Rails.respond_to?(:root)
61
+ rails_root = Rails.root.to_s
62
+ end
63
+
51
64
  Net::HTTP.start(uri.host, uri.port, use_ssl: (uri.scheme == 'https')) do |http|
52
65
  http.post('/api/raw_deprecation_warnings',
53
66
  { raw_deprecation_warnings: {
54
67
  repo_environment_id: Infield.repo_environment_id,
55
68
  environment: Infield.environment,
69
+ root_dir: rails_root,
56
70
  messages: messages
57
71
  }
58
72
  }.to_json,
59
73
  { 'Content-Type' => 'application/json', 'Authorization' => "bearer #{Infield.api_key}" })
60
74
  end
61
75
  rescue *HTTP_ERRORS => e
76
+ ensure
77
+ if webmock_needs_re_enabling
78
+ WebMock.disable_net_connect!(allow: allowed)
79
+ end
62
80
  end
63
81
 
64
82
  private
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Infield
4
- VERSION = '0.5.0'
4
+ VERSION = '0.7.0'
5
5
  end
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.5.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Infield
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-02-18 00:00:00.000000000 Z
11
+ date: 2025-04-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: webmock