informant-common 1.2.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ed34407cec544b01391b2ac8902ed3a2667ee575976388dc3a2a97afcb0264d3
4
- data.tar.gz: 0feab82bf1ce36d13a633dad8841b084f889447a36c7145ff8c56366200eac7b
3
+ metadata.gz: 702054d537adb792b65754f4fb418ec7b07e5b103c2b09148fa147abd2b74fe5
4
+ data.tar.gz: 6e063df535bc3c723c0af1bbfe19a7c3f7598b5344fd304000e698a2de957881
5
5
  SHA512:
6
- metadata.gz: 6cce15623638121d186749153fe78f1b95e043099e1a41350bf9a92eaecf086e1519ba74729fcb135ff5f37a92e23053a94a718c91fd7f31e36067169a4ef001
7
- data.tar.gz: 5dc1b56de742f50e76b994c2260e7858ef191f1e031d6ea6a1d76c7b35a8bee32239932dec92a1c578419f443be00439941469aa053423bbb8622351fd72617d
6
+ metadata.gz: 9d9a5ed4cc9496a203eba8edee1b4302f24cc9a3f29599ca9871c834233f2144518f2dbcd9350c1b4a2c0a98d354c706672170c953e8d739efcf7158780d29ea
7
+ data.tar.gz: 03217a93301d05ee70a84192ce4f4bb28b7ac4413ae02b6aaacdd470995a6f105753b0548cf5b32d1c84c32dbda3ce3921330840cf49063f7471f1dbd538a438
@@ -7,7 +7,7 @@ module InformantCommon
7
7
  attr_writer :api_token, :exclude_models, :filter_parameters, :value_tracking
8
8
 
9
9
  def api_token
10
- @api_token ||= ENV['INFORMANT_API_KEY']
10
+ @api_token ||= ENV.fetch('INFORMANT_API_KEY', nil)
11
11
  end
12
12
 
13
13
  def enabled?
@@ -31,7 +31,7 @@ module InformantCommon
31
31
  end
32
32
 
33
33
  def self.collector_host
34
- @collector_host ||= ENV['INFORMANT_COLLECTOR_HOST'] || 'https://collector-api.informantapp.com'
34
+ @collector_host ||= ENV.fetch('INFORMANT_COLLECTOR_HOST', 'https://collector-api.informantapp.com')
35
35
  end
36
36
 
37
37
  def self.configure
@@ -1,9 +1,10 @@
1
1
  module InformantCommon
2
2
  module Event
3
- class AgentInfo < InformantCommon::Event::Base
3
+ class AgentInfo < Base
4
4
  attr_accessor :agent_identifier, :framework_version
5
5
 
6
6
  def initialize(agent_identifier: nil, framework_version: nil)
7
+ super()
7
8
  self.agent_identifier = agent_identifier
8
9
  self.framework_version = framework_version
9
10
  end
@@ -2,9 +2,12 @@ module InformantCommon
2
2
  module Model
3
3
  class ActiveModel < Base
4
4
  def initialize(active_model)
5
- self.id = active_model.object_id
6
- self.name = active_model.class.name
7
- self.errors = []
5
+ super(
6
+ id: active_model.object_id,
7
+ name: active_model.class.name,
8
+ field_errors: []
9
+ )
10
+
8
11
  active_model.errors.messages.each do |field, errors|
9
12
  add_error(field.to_s, extract_value(active_model, field), errors.first)
10
13
  end
@@ -1,3 +1,3 @@
1
1
  module InformantCommon
2
- VERSION = '1.2.0'.freeze
2
+ VERSION = '1.3.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: informant-common
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Informant, LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-09 00:00:00.000000000 Z
11
+ date: 2022-06-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: appraisal
@@ -60,7 +60,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
60
60
  requirements:
61
61
  - - ">="
62
62
  - !ruby/object:Gem::Version
63
- version: 2.6.0
63
+ version: 2.7.0
64
64
  required_rubygems_version: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - ">="