infield 0.7.0 → 0.8.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/CHANGELOG.md +4 -0
- data/README.md +6 -2
- data/lib/infield/deprecation_warning.rb +33 -0
- data/lib/infield/version.rb +1 -1
- 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: 1241f08f96db62746028c06238171f5f35746ddf1a3cf1cfb6d05bce76b5f35e
|
4
|
+
data.tar.gz: 944956884697ae42c1287e49a57533be4fbcb8b0bdbc8de2c36bb0d76fb5d297
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '00847fe3105a43e0b81938b311dd4940118fa7317489ff49b5be694760c22286f9e86b81252c98859a95f781d23bfb57ab3b9ef5ef971a786c24ca8a716c8da1'
|
7
|
+
data.tar.gz: c5d79c364ed252a53d07f1a6396916b5510459786b66b17a55601885c99138d904bef355606b11060fd3b7136a76b22280043177796bad8afa9a576da71f5f8c
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,10 @@
|
|
1
|
-
#
|
1
|
+
# What is this gem for?
|
2
2
|
|
3
|
-
This gem
|
3
|
+
Maintainers use deprecation warnings to inform developers about breaking changes coming in new versions. To make these warnings actionable you need to monitor for them. This gem takes care of aggregating these warnings from any environment and sending them to the Infield API. Within Infield you can see all deprecations being thrown and verify once they've been fixed.
|
4
|
+
|
5
|
+
This differs from local-only tools like deprecation_toolkit in that warnings are sent up to a cloud-hosted API rather than stored in files locally. This makes it possible to profile for deprecations not just in dev/test but staging and production too.
|
6
|
+
|
7
|
+
`infield` supports warnings coming from gems and Ruby itself.
|
4
8
|
|
5
9
|
## Setup
|
6
10
|
|
@@ -49,6 +49,8 @@ module Infield
|
|
49
49
|
|
50
50
|
uri = infield_api_uri
|
51
51
|
|
52
|
+
git_branch, git_sha = git_info
|
53
|
+
|
52
54
|
webmock_needs_re_enabling = false
|
53
55
|
if defined?(WebMock) && WebMock.respond_to?(:net_connect_allowed?) &&
|
54
56
|
!WebMock.net_connect_allowed?(Infield.infield_api_url)
|
@@ -67,6 +69,8 @@ module Infield
|
|
67
69
|
repo_environment_id: Infield.repo_environment_id,
|
68
70
|
environment: Infield.environment,
|
69
71
|
root_dir: rails_root,
|
72
|
+
git_sha: git_sha,
|
73
|
+
git_branch: git_branch,
|
70
74
|
messages: messages
|
71
75
|
}
|
72
76
|
}.to_json,
|
@@ -94,6 +98,35 @@ module Infield
|
|
94
98
|
environment: Infield.environment }
|
95
99
|
end
|
96
100
|
|
101
|
+
def git_info
|
102
|
+
branch = nil
|
103
|
+
sha = nil
|
104
|
+
|
105
|
+
if ENV['CIRCLE_SHA1']
|
106
|
+
sha = ENV['CIRCLE_SHA1']
|
107
|
+
branch = ENV['CIRCLE_BRANCH']
|
108
|
+
elsif ENV['GITHUB_SHA']
|
109
|
+
sha = ENV['GITHUB_SHA']
|
110
|
+
if ENV['GITHUB_REF_NAME']
|
111
|
+
branch = ENV['GITHUB_REF_NAME']
|
112
|
+
elsif ENV['GITHUB_REF']&.start_with?('refs/heads/')
|
113
|
+
branch = ENV['GITHUB_REF'].split('/', 3).last
|
114
|
+
elsif ENV['GITHUB_HEAD_REF']
|
115
|
+
branch = ENV['GITHUB_HEAD_REF']
|
116
|
+
end
|
117
|
+
elsif ENV['HEROKU_SLUG_COMMIT']
|
118
|
+
sha = ENV['HEROKU_SLUG_COMMIT']
|
119
|
+
elsif defined?(Rails) && Rails.respond_to?(:root)
|
120
|
+
root = Rails.root.to_s
|
121
|
+
if system('git', '-C', root, 'rev-parse', '--is-inside-work-tree', out: File::NULL, err: File::NULL)
|
122
|
+
sha = `git -C #{root} rev-parse HEAD`.strip
|
123
|
+
branch = `git -C #{root} rev-parse --abbrev-ref HEAD`.strip
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
[branch, sha]
|
128
|
+
end
|
129
|
+
|
97
130
|
def infield_api_uri
|
98
131
|
URI.parse(Infield.infield_api_url)
|
99
132
|
end
|
data/lib/infield/version.rb
CHANGED
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.8.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-
|
11
|
+
date: 2025-07-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: webmock
|