metrics 0.3.0 → 0.3.1

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: 8db52b23e0e9f9fc5b7b1253667da5ee801eea1f2e0555908cb51f698c3e3ae7
4
- data.tar.gz: b428e08aeb5d30604a19e69058567ba0be4bdd188ac6bad8d7a15c64766f9dc1
3
+ metadata.gz: b26074298faafd29789b9d427673f76c593a069c4e856f3fe2b9f9d8d10f5e43
4
+ data.tar.gz: a8f90e0e6cb4c6149be3862c76d5c42d52cada561c98c638cf3e3d8bb83ed7f0
5
5
  SHA512:
6
- metadata.gz: 397fa3e698ffbcabe00733a9c2370e9d4fb96320669fd546a547f01dae73c90f97932ee4eb19f9f5ce6579e123ad0931d62635b3539e6bc46cb5db5605e3073f
7
- data.tar.gz: 9a60eb2350b9d7ee760636c45392d0aa3ee198c90ebc7d51ee3f9556f4b75c8c9af7aff4ffdc9edc5ac2a904d551d5b504818ff8a67cfcbf4b6b2078681c3d5b
6
+ metadata.gz: d19300ba3d4fffcac5d3d5c988e2b57e28ed54ae8904215bb58ed7a3ff9d17cabbf64fb14f1dcdab6721f78eff6ee95fff012dbb4b0b7982ca6f11051390ba84
7
+ data.tar.gz: 9732393526909a7b3231fc7cb1601e045978cfc31452ecdb8fcb7bc7c78d16207bdada5d31b5e26f7f38bc3b060cc37283672d128c4747172bbb8106cd07c539
checksums.yaml.gz.sig CHANGED
Binary file
@@ -36,10 +36,10 @@ module Metrics
36
36
  end
37
37
 
38
38
  tags&.each do |tag|
39
- raise ArgumentError, "Invalid tag, must be string!" unless tag.is_a?(String)
39
+ raise ArgumentError, "Invalid tag (must be String): #{tag.inspect}!" unless tag.is_a?(String)
40
40
 
41
41
  unless tag =~ VALID_TAG
42
- raise ArgumentError, "Invalid tag, must match #{VALID_TAG}!"
42
+ raise ArgumentError, "Invalid tag (must match #{VALID_TAG}): #{tag.inspect}!"
43
43
  end
44
44
  end
45
45
  end
@@ -48,28 +48,28 @@ module Metrics
48
48
  module Interface
49
49
  def metric(name, type, description: nil, unit: nil, &block)
50
50
  unless name.is_a?(String)
51
- raise ArgumentError, "Invalid name, must be string!"
51
+ raise ArgumentError, "Invalid name (must be String): #{name.inspect}!"
52
52
  end
53
53
 
54
54
  unless name =~ VALID_METRIC_NAME
55
- raise ArgumentError, "Invalid name, must match #{VALID_METRIC_NAME}!"
55
+ raise ArgumentError, "Invalid name (must match #{VALID_METRIC_NAME}): #{name.inspect}!"
56
56
  end
57
57
 
58
58
  unless type.is_a?(Symbol)
59
- raise ArgumentError, "Invalid type, must be symbol!"
59
+ raise ArgumentError, "Invalid type (must be Symbol): #{type.inspect}!"
60
60
  end
61
61
 
62
62
  # Description is optional but must be string if given:
63
63
  if description
64
64
  unless description.is_a?(String)
65
- raise ArgumentError, "Invalid description, must be string!"
65
+ raise ArgumentError, "Invalid description (must be String): #{description.inspect}!"
66
66
  end
67
67
  end
68
68
 
69
69
  # Unit is optional but must be string if given:
70
70
  if unit
71
71
  unless unit.is_a?(String)
72
- raise ArgumentError, "Invalid unit, must be string!"
72
+ raise ArgumentError, "Invalid unit (must be String): #{unit.inspect}!"
73
73
  end
74
74
  end
75
75
 
@@ -23,6 +23,7 @@
23
23
  require_relative 'backend'
24
24
 
25
25
  module Metrics
26
+ # @returns [Boolean] Whether there is an active backend.
26
27
  def self.enabled?
27
28
  self.const_defined?(:Backend)
28
29
  end
@@ -21,5 +21,5 @@
21
21
  # THE SOFTWARE.
22
22
 
23
23
  module Metrics
24
- VERSION = "0.3.0"
24
+ VERSION = "0.3.1"
25
25
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metrics
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -36,7 +36,7 @@ cert_chain:
36
36
  RAOsIl+HOBTb252nx1kIRN5hqQx272AJCbCjKx8egcUQKffFVVCI0nye09v5CK+a
37
37
  HiLJ8VOFx6w=
38
38
  -----END CERTIFICATE-----
39
- date: 2021-10-26 00:00:00.000000000 Z
39
+ date: 2022-01-27 00:00:00.000000000 Z
40
40
  dependencies:
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
metadata.gz.sig CHANGED
Binary file