inst_statsd 3.0.4 → 3.0.6

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: a91fe00f6ca513926589fdd5d3cb3f316e26a6fc5bb5b8ceb1a49ba20f42769f
4
- data.tar.gz: 82a6dd4759cb55054a20e6c394d19c000b571aabe8df48251f0661fdb86de7ec
3
+ metadata.gz: 1f7ff23c72ad7a2d4055a5b511bc358d452d596b5a70b91b48dbab2837b57789
4
+ data.tar.gz: e90e0dafba21a6cd519ab4341963007132be3e7722bc81d8d013f250c3794cc4
5
5
  SHA512:
6
- metadata.gz: dbddd5f2e3069681cd2f6e4b2843d4c7ea123cbaee2a3537cd35ef4b6fffe8f2c90b20b4bf30d5e109967151d29926ad993597575ee6042942587ef7ba75fa43
7
- data.tar.gz: e5d8af2078d7d320732285b3e071c1c18da70e9aeb0cad060eb589b8b1de592d6093fab0d836c74a9380e10df19e3f46090edb73a14bf1a18e8a2e5d95bf51fa
6
+ metadata.gz: 721e8a6e1805deb8c63a2ccc9a69d29621e99d4e699f7faf9fac7d96e86396a358da68f49d391586bbda59414ce61143139f6bc551fdc8a85987c2fb7d579ec6
7
+ data.tar.gz: 57eabc93c85a1e6f2bd92632d8e1aa78ec365236c4d54f3ad3feffd934fba500f6357f4661b4172064376c825ff720bfde4f9428442858fa19d22f1e9350cad2
@@ -57,7 +57,7 @@ module InstStatsd
57
57
 
58
58
  def tags_from_opts(tags, type, dd_tags)
59
59
  custom_tags = tags.merge(dd_tags)
60
- custom_tags[:type] = type if SUPPORTED_TYPES.include? type
60
+ custom_tags[:type] = type.to_sym if SUPPORTED_TYPES.include? type&.to_sym
61
61
  custom_tags.compact
62
62
  end
63
63
  end
@@ -150,6 +150,10 @@ module InstStatsd
150
150
  @data_dog
151
151
  end
152
152
 
153
+ def self.initialized?
154
+ defined?(@statsd)
155
+ end
156
+
153
157
  def self.reset_instance
154
158
  remove_instance_variable(:@statsd) if defined?(@statsd)
155
159
  Thread.current[:inst_statsd] = nil
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module InstStatsd
4
- VERSION = "3.0.4"
4
+ VERSION = "3.0.6"
5
5
  end
@@ -105,6 +105,20 @@ RSpec.describe InstStatsd::Event do
105
105
  end
106
106
  end
107
107
 
108
+ context "with a valid type set as a string" do
109
+ let(:opts) { { type: "deploy" } }
110
+
111
+ it "sets the valid aggregation key" do
112
+ expect(instance).to receive(:event).with(
113
+ title,
114
+ text,
115
+ tags: { type: :deploy }
116
+ )
117
+
118
+ subject
119
+ end
120
+ end
121
+
108
122
  context "with custom tags" do
109
123
  let(:opts) { { tags: { project: "cool-project" } } }
110
124
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inst_statsd
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.4
4
+ version: 3.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Cloward
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-09-19 00:00:00.000000000 Z
12
+ date: 2024-11-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: aroi