honeycomb-rails 0.7.1 → 0.7.2

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: 0a2b71f4dd7faf9e77bb9c81f3ff4accefb56ff90b80f6aec3146968e9cb4aae
4
- data.tar.gz: 0d41717e62b0c6a2f0ec8095e19e4e4380d72ea73f05a95a8e16c02a9db872d1
3
+ metadata.gz: 017fdc196902aa439d9db39265aa6184ca8c13c40bb79bcb770c29d7f8621ab1
4
+ data.tar.gz: 575023c210eade7f3f1dd18ba720937f82e055b72c9c7d556879acdf84807bd2
5
5
  SHA512:
6
- metadata.gz: 749e9fdfe9b1c29368e03a4758e71aa1add18def3cf9b9147fd1a77fd81b065e7bd9e4bd16bfc053b6252c668b7aba678a2df26f706fa63e2491e869977cbc3e
7
- data.tar.gz: 4f232b225976ff82f71d93a866cefef47c31bb72244a7e6f06f56e756aca8045f27d1c89b6af76a2e7afd151d7986f514acc7d452c9aaafd9283995b1727776e
6
+ metadata.gz: 4d630a38edf0578e6cd0eccdcaaf82a3347225f477c1bb239c2b67a796f32b21dd6eba172870fae4216cb344f4d8c95092c5d6e1552ea8c885b2fbcb2189aaa5
7
+ data.tar.gz: 36d6080273a54706b3e57cd61b1231418ecd45b082134a4bf9c103697abba09f02a485ca33966d3eddcac6b96e5a6f7fbc7ab0f3cacc3e953935a45fd2237f0c
@@ -21,37 +21,30 @@ module HoneycombRails
21
21
 
22
22
  @libhoney = HoneycombRails.config.client || begin
23
23
  writekey = HoneycombRails.config.writekey
24
- if writekey.blank?
25
- HoneycombRails.config.logger.warn("No write key defined! (Check your config's `writekey` value in config/initializers/honeycomb.rb) No events will be sent to Honeycomb.")
24
+ default_dataset = HoneycombRails.config.dataset
25
+ if writekey.blank? || default_dataset.blank?
26
+ missing = writekey.blank? ? 'writekey' : 'dataset'
27
+ warn "No #{missing} defined! (Check your config's `#{missing}` value in config/initializers/honeycomb.rb) No events will be sent to Honeycomb."
28
+ Libhoney::NullClient.new
29
+ else
30
+ Libhoney::Client.new(
31
+ writekey: writekey,
32
+ dataset: default_dataset,
33
+ user_agent_addition: HoneycombRails::USER_AGENT_SUFFIX,
34
+ )
26
35
  end
27
-
28
- Libhoney::Client.new(
29
- writekey: writekey,
30
- user_agent_addition: HoneycombRails::USER_AGENT_SUFFIX,
31
- )
32
36
  end
33
37
  end
34
38
 
35
39
  config.after_initialize do
36
- subscribers = []
37
-
38
- if !HoneycombRails.config.dataset.blank?
39
- req_builder = @libhoney.builder
40
- req_builder.dataset = HoneycombRails.config.dataset
41
- subscribers.push(Subscribers::ProcessAction.new(req_builder))
42
- end
40
+ req_builder = @libhoney.builder
41
+ Subscribers::ProcessAction.new(req_builder).subscribe!
43
42
 
44
43
  if !HoneycombRails.config.db_dataset.blank?
45
44
  db_builder = @libhoney.builder
46
45
  db_builder.dataset = HoneycombRails.config.db_dataset
47
- subscribers.push(Subscribers::ActiveRecord.new(db_builder))
46
+ Subscribers::ActiveRecord.new(db_builder).subscribe!
48
47
  end
49
-
50
- if subscribers.empty?
51
- HoneycombRails.config.logger.warn("No subscribers defined (are both HoneycombRails.config.dataset and HoneycombRails.config.db_dataset both blank?)")
52
- end
53
-
54
- subscribers.each(&:subscribe!)
55
48
  end
56
49
  end
57
50
  end
@@ -1,7 +1,7 @@
1
1
  module HoneycombRails
2
2
  GEM_NAME = 'honeycomb-rails'
3
3
 
4
- VERSION = '0.7.1'
4
+ VERSION = '0.7.2'
5
5
 
6
6
  USER_AGENT_SUFFIX = "#{GEM_NAME}/#{VERSION}".freeze
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: honeycomb-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Stokes
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-05-22 00:00:00.000000000 Z
12
+ date: 2018-06-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: libhoney
@@ -17,14 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - ">="
19
19
  - !ruby/object:Gem::Version
20
- version: 1.5.0
20
+ version: 1.8.1
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - ">="
26
26
  - !ruby/object:Gem::Version
27
- version: 1.5.0
27
+ version: 1.8.1
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: rails
30
30
  requirement: !ruby/object:Gem::Requirement