infield 0.1.2 → 0.1.4

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: a148efd7dfef4844beb8cdcd51d3f216b978cff6276d9024a41b0569adee659c
4
- data.tar.gz: 516b173ccc44026ba41b46f638661c735b69122c4a192048bf2df2cffe769078
3
+ metadata.gz: d5a5b72da6bbb6200602ff8afba391199669ca5cd265c7b134cc461756b800f1
4
+ data.tar.gz: 73f0b79b8d207468d166787b0af21461e17d875cc3423744c037046939df602f
5
5
  SHA512:
6
- metadata.gz: 4b38da3d8f7a3027aa6ec0841a09f42c9f43c479279bbf6a95d7aa74b005782e8deb02cc266430a841d8038acb5c6e92c9972169c067000058373c1f63e55ec8
7
- data.tar.gz: cadc173453c974e65441bffff71eb776f10387d1fd6d4c017ba6846c68b39c69f710fc5d36e3ade98f38cd2af2573c63993dffb2895b425ffd83c65f3c3465b5
6
+ metadata.gz: 834d0d67edfc17821d11782a91672a217533ac6069e86c4b471c873fdf037d2f075c4387ebcc754b2142f6069d5c84ed340057c58b558ea1dfb7dd5d59972067
7
+ data.tar.gz: 6150e0e43b01658417b237184ee81cfd7f2b7a6eaf78737ff844dfa4b77ac57f93b99f2b18f75aba5ee746303404a4320dcaddd74ebbb2072cb576fbfe21e391
@@ -40,10 +40,12 @@ module Infield
40
40
  end
41
41
 
42
42
  def upload_message(task)
43
- http = Net::HTTP.new(infield_api_uri.host, infield_api_uri.port)
44
- http.post('/api/raw_deprecation_warnings',
45
- default_api_params.merge(message: task.message).to_json,
46
- { 'Content-Type' => 'application/json', 'Authorization' => "bearer #{Infield.api_key}" })
43
+ uri = infield_api_uri
44
+ Net::HTTP.start(uri.host, uri.port, use_ssl: (uri.scheme == 'https')) do |http|
45
+ http.post('/api/raw_deprecation_warnings',
46
+ default_api_params.merge(message: task.message).to_json,
47
+ { 'Content-Type' => 'application/json', 'Authorization' => "bearer #{Infield.api_key}" })
48
+ end
47
49
  end
48
50
 
49
51
  def deliver
@@ -56,7 +58,6 @@ module Infield
56
58
 
57
59
  class << self
58
60
  def log(*messages, callstack: nil, validated: false)
59
- callstack ||= caller_locations(2)
60
61
  messages = messages.select(&method(:valid_message)) unless validated
61
62
  messages.each { |message| tasks << Task.new(message, callstack) }
62
63
  Runner.event.set
data/lib/infield/rails.rb CHANGED
@@ -4,7 +4,7 @@ module Infield
4
4
  class Railtie < Rails::Railtie
5
5
  initializer 'infield.deprecation_warnings', after: 'active_support.deprecation_behavior' do |_app|
6
6
  ActiveSupport::Notifications.subscribe('deprecation.rails') do |_name, _start, _finish, _id, payload|
7
- Infield::DeprecationWarning.log(payload[:message], callstack: payload[:callstack], validated: true)
7
+ Infield::DeprecationWarning.log(payload[:message], validated: true)
8
8
  end
9
9
  end
10
10
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Infield
4
- VERSION = '0.1.2'
4
+ VERSION = '0.1.4'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: infield
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Infield