prometheus-client-mmap 0.9.8 → 0.9.9

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: 699286c1c257884747f07061bf5dcb7c078720b5c8c81826965e826b3c3e727a
4
- data.tar.gz: 61d2caba4d09883699471a4c631a60168fed152d38a59ff069be08527a3f65f5
3
+ metadata.gz: 1d91955fd1bff2e44c6ed44d4e6558518a685c9ce12df2e155cbecc40c81f76e
4
+ data.tar.gz: 583d07d3faddba5776042683697f2b25c686baf3aaa1fa3d7dc66a206ce7ead2
5
5
  SHA512:
6
- metadata.gz: ac048db43f14bc544fbd199b178e62536b6a4f2ebb1e13f33d7540d847bf3c0e44ee9af97693a26ea3b227aebc29568a9fbedce8fac467e591329090ce6aadbf
7
- data.tar.gz: 5185dbbd600e6fb91615361a5621feefb1ac2fd65f90439a9daf9e7b69d59a72e083ef7d174b97f92109056396c5afccfd0961a9c6d6bcc52267e43f9db9c19b
6
+ metadata.gz: eeb429459334fc67b1b59aa1dab32ad27283375905fba601a15611aea8655a94a3d086d022541cf6e9d65a988525ed36c7b3431f7e98098010ca98c08af1a5a2
7
+ data.tar.gz: e0c0ff5bcb6726e7ffc1f87e3e05f580f740167c3d730f97f4be1adc2c060b8015e17d062e882d834d977ca7a82d4bc0846c8d975b8f5573d8de28feafd3abd5
@@ -19,14 +19,15 @@ module Prometheus
19
19
  end
20
20
 
21
21
  def valid?(labels)
22
- unless labels.respond_to?(:all?)
22
+ unless labels.is_a?(Hash)
23
23
  raise InvalidLabelSetError, "#{labels} is not a valid label set"
24
24
  end
25
25
 
26
- labels.all? do |key, _|
26
+ labels.all? do |key, value|
27
27
  validate_symbol(key)
28
28
  validate_name(key)
29
29
  validate_reserved_key(key)
30
+ validate_value(key, value)
30
31
  end
31
32
  end
32
33
 
@@ -65,6 +66,17 @@ module Prometheus
65
66
 
66
67
  raise ReservedLabelError, "#{key} is reserved"
67
68
  end
69
+
70
+ def validate_value(key, value)
71
+ return true if value.is_a?(String) ||
72
+ value.is_a?(Numeric) ||
73
+ value.is_a?(Symbol) ||
74
+ value.is_a?(FalseClass) ||
75
+ value.is_a?(TrueClass) ||
76
+ value.nil?
77
+
78
+ raise InvalidLabelError, "#{key} does not contain a valid value (type #{value.class})"
79
+ end
68
80
  end
69
81
  end
70
82
  end
@@ -1,5 +1,5 @@
1
1
  module Prometheus
2
2
  module Client
3
- VERSION = '0.9.8'.freeze
3
+ VERSION = '0.9.9'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prometheus-client-mmap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.8
4
+ version: 0.9.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Schmidt
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-07-08 00:00:00.000000000 Z
12
+ date: 2019-08-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fuzzbert