wavefront-sdk 5.2.0 → 5.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +7 -37
- data/HISTORY.md +3 -0
- data/lib/wavefront-sdk/defs/version.rb +3 -1
- data/lib/wavefront-sdk/distribution.rb +2 -0
- data/lib/wavefront-sdk/writers/core.rb +2 -2
- data/spec/.rubocop.yml +9 -40
- data/spec/support/minitest_assertions.rb +5 -11
- data/spec/wavefront-sdk/core/logger_spec.rb +3 -3
- data/spec/wavefront-sdk/credentials_spec.rb +2 -0
- data/spec/wavefront-sdk/writers/core_spec.rb +1 -1
- data/wavefront-sdk.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5e623522f872c4204c1e723ee5a399c513251933e64445f6f5b65ff66d2fbffc
|
4
|
+
data.tar.gz: 6f55f44177169c24d4c0aa89490464097a6fe2278e24a1e3b83e5f7520757dfd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 58bb998cc92b36c369497631f766af8844a692fbd10508962ee7bd30f4fbe65d222bc512d06b63feb19ca94cdcc4e8429b8c61f6227e4ff1041cd6ffff141758
|
7
|
+
data.tar.gz: 198dfadd7561b5c3772211716d23f9653ace3bbf472e41d12fa8b64d744ed16567bb11796ef3aff252054bc0945200ea71e454b5989824656c178e74503b4675
|
data/.rubocop.yml
CHANGED
@@ -2,47 +2,17 @@
|
|
2
2
|
|
3
3
|
AllCops:
|
4
4
|
TargetRubyVersion: 2.4
|
5
|
+
NewCops: enable
|
5
6
|
|
6
7
|
Metrics/ClassLength:
|
7
8
|
Max: 150
|
8
9
|
|
9
|
-
# New cops
|
10
|
-
#
|
11
|
-
Lint/RaiseException:
|
12
|
-
Enabled: true
|
13
|
-
Lint/StructNewOverride:
|
14
|
-
Enabled: true
|
15
|
-
Style/ExponentialNotation:
|
16
|
-
Enabled: true
|
17
|
-
Style/HashEachMethods:
|
18
|
-
Enabled: true
|
19
|
-
Style/HashTransformKeys:
|
20
|
-
Enabled: true
|
21
|
-
Style/HashTransformValues:
|
22
|
-
Enabled: true
|
23
|
-
Layout/EmptyLinesAroundAttributeAccessor:
|
24
|
-
Enabled: true
|
25
|
-
Layout/SpaceAroundMethodCallOperator:
|
26
|
-
Enabled: true
|
27
|
-
Style/SlicingWithRange:
|
28
|
-
Enabled: true
|
29
|
-
Lint/DeprecatedOpenSSLConstant:
|
30
|
-
Enabled: true
|
31
|
-
Lint/MixedRegexpCaptureTypes:
|
32
|
-
Enabled: true
|
33
|
-
Style/RedundantRegexpCharacterClass:
|
34
|
-
Enabled: true
|
35
|
-
Style/RedundantRegexpEscape:
|
36
|
-
Enabled: true
|
37
|
-
Style/AccessorGrouping:
|
38
|
-
Enabled: true
|
39
|
-
Style/BisectedAttrAccessor:
|
40
|
-
Enabled: true
|
41
|
-
Style/RedundantAssignment:
|
42
|
-
Enabled: true
|
43
|
-
Style/RedundantFetchBlock:
|
44
|
-
Enabled: true
|
45
|
-
|
46
10
|
# Is nothing sacred?
|
47
11
|
Layout/LineLength:
|
48
12
|
Max: 80
|
13
|
+
|
14
|
+
Style/StringConcatenation:
|
15
|
+
Enabled: false
|
16
|
+
|
17
|
+
Style/OptionalBooleanParameter:
|
18
|
+
Enabled: false
|
data/HISTORY.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 5.2.1 (2020-09-18)
|
4
|
+
* Remove necessity for user to `require 'pathname'`
|
5
|
+
|
3
6
|
## 5.2.0 (2020-09-03)
|
4
7
|
* Add `:raise_on_no_profile` option to `Wavefront::Credentials` constructor
|
5
8
|
options. If this is true and a specific config stanza is requested but not
|
@@ -65,6 +65,7 @@ module Wavefront
|
|
65
65
|
raise Wavefront::Exception::InvalidDistribution
|
66
66
|
end
|
67
67
|
|
68
|
+
# rubocop:disable Metrics/AbcSize
|
68
69
|
def dist_hash(dist)
|
69
70
|
dist.dup.tap do |d|
|
70
71
|
d[:interval] = distribution_interval(dist)
|
@@ -75,6 +76,7 @@ module Wavefront
|
|
75
76
|
d[:opttags] = tags_or_nothing(opts[:tags])
|
76
77
|
end
|
77
78
|
end
|
79
|
+
# rubocop:enable Metrics/AbcSize
|
78
80
|
|
79
81
|
def distribution_timestamp(dist)
|
80
82
|
parse_time(dist.fetch(:ts, Time.now))
|
@@ -138,8 +138,8 @@ module Wavefront
|
|
138
138
|
end
|
139
139
|
|
140
140
|
def log_invalid_point(rawpoint, exception)
|
141
|
-
logger.log('Invalid point, skipping.', :
|
142
|
-
logger.log(exception.class, :
|
141
|
+
logger.log('Invalid point, skipping.', :warn)
|
142
|
+
logger.log(exception.class, :warn)
|
143
143
|
logger.log(format('Invalid point: %<rawpoint>s (%<message>s)',
|
144
144
|
rawpoint: rawpoint,
|
145
145
|
message: exception.to_s), :debug)
|
data/spec/.rubocop.yml
CHANGED
@@ -1,54 +1,23 @@
|
|
1
|
-
|
1
|
+
AllCops:
|
2
|
+
NewCops: enable
|
3
|
+
|
2
4
|
Metrics/AbcSize:
|
3
5
|
Max: 64
|
4
6
|
|
5
|
-
# Offense count: 5
|
6
7
|
# Configuration parameters: CountComments.
|
7
8
|
Metrics/ClassLength:
|
8
9
|
Max: 400
|
9
10
|
|
10
|
-
# Offense count: 46
|
11
11
|
# Configuration parameters: CountComments, ExcludedMethods.
|
12
12
|
Metrics/MethodLength:
|
13
13
|
Max: 39
|
14
14
|
|
15
|
-
# New cops
|
16
|
-
#
|
17
|
-
Lint/RaiseException:
|
18
|
-
Enabled: true
|
19
|
-
Lint/StructNewOverride:
|
20
|
-
Enabled: true
|
21
|
-
Style/ExponentialNotation:
|
22
|
-
Enabled: true
|
23
|
-
Style/HashEachMethods:
|
24
|
-
Enabled: true
|
25
|
-
Style/HashTransformKeys:
|
26
|
-
Enabled: true
|
27
|
-
Style/HashTransformValues:
|
28
|
-
Enabled: true
|
29
|
-
Layout/EmptyLinesAroundAttributeAccessor:
|
30
|
-
Enabled: true
|
31
|
-
Layout/SpaceAroundMethodCallOperator:
|
32
|
-
Enabled: true
|
33
|
-
Style/SlicingWithRange:
|
34
|
-
Enabled: true
|
35
|
-
Lint/DeprecatedOpenSSLConstant:
|
36
|
-
Enabled: true
|
37
|
-
Lint/MixedRegexpCaptureTypes:
|
38
|
-
Enabled: true
|
39
|
-
Style/RedundantRegexpCharacterClass:
|
40
|
-
Enabled: true
|
41
|
-
Style/RedundantRegexpEscape:
|
42
|
-
Enabled: true
|
43
|
-
Style/AccessorGrouping:
|
44
|
-
Enabled: true
|
45
|
-
Style/BisectedAttrAccessor:
|
46
|
-
Enabled: true
|
47
|
-
Style/RedundantAssignment:
|
48
|
-
Enabled: true
|
49
|
-
Style/RedundantFetchBlock:
|
50
|
-
Enabled: true
|
51
|
-
|
52
15
|
# Is nothing sacred?
|
53
16
|
Layout/LineLength:
|
54
17
|
Max: 80
|
18
|
+
|
19
|
+
Style/StringConcatenation:
|
20
|
+
Enabled: false
|
21
|
+
|
22
|
+
Style/OptionalBooleanParameter:
|
23
|
+
Enabled: false
|
@@ -95,18 +95,12 @@ module Minitest
|
|
95
95
|
end
|
96
96
|
|
97
97
|
def header_lookup(type)
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
'application/json'
|
103
|
-
when :octet
|
104
|
-
'application/octet-stream'
|
105
|
-
when :form
|
106
|
-
'application/x-www-form-urlencoded'
|
107
|
-
end
|
98
|
+
ctypes = { plain: 'text/plain',
|
99
|
+
json: 'application/json',
|
100
|
+
octet: 'application/octet-stream',
|
101
|
+
form: 'application/x-www-form-urlencoded' }
|
108
102
|
|
109
|
-
{ 'Content-Type':
|
103
|
+
{ 'Content-Type': ctypes[type], Accept: 'application/json' }
|
110
104
|
end
|
111
105
|
end
|
112
106
|
end
|
@@ -41,21 +41,21 @@ class WavefrontLoggerTest < MiniTest::Test
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def test_log_logger_debug
|
44
|
-
l = Wavefront::Logger.new(logger: Logger.new(
|
44
|
+
l = Wavefront::Logger.new(logger: Logger.new($stdout))
|
45
45
|
out, err = capture_subprocess_io { l.log('my message', :debug) }
|
46
46
|
assert_match(/DEBUG -- : my message$/, out)
|
47
47
|
assert_empty(err)
|
48
48
|
end
|
49
49
|
|
50
50
|
def test_log_logger_info
|
51
|
-
l = Wavefront::Logger.new(logger: Logger.new(
|
51
|
+
l = Wavefront::Logger.new(logger: Logger.new($stdout))
|
52
52
|
out, err = capture_subprocess_io { l.log('my message', :info) }
|
53
53
|
assert_match(/INFO -- : my message$/, out)
|
54
54
|
assert_empty(err)
|
55
55
|
end
|
56
56
|
|
57
57
|
def test_log_logger_error
|
58
|
-
l = Wavefront::Logger.new(logger: Logger.new(
|
58
|
+
l = Wavefront::Logger.new(logger: Logger.new($stdout))
|
59
59
|
out, err = capture_subprocess_io { l.log('my message', :error) }
|
60
60
|
assert_match(/ERROR -- : my message$/, out)
|
61
61
|
assert_empty(err)
|
@@ -60,9 +60,11 @@ end
|
|
60
60
|
# Test individual methods. We must override the constructor to do
|
61
61
|
# this.
|
62
62
|
#
|
63
|
+
# rubocop:disable Lint/MissingSuper
|
63
64
|
class Giblets < Wavefront::Credentials
|
64
65
|
def initialize; end
|
65
66
|
end
|
67
|
+
# rubocop:enable Lint/MissingSuper
|
66
68
|
|
67
69
|
# And here are the tests
|
68
70
|
#
|
data/wavefront-sdk.gemspec
CHANGED
@@ -29,7 +29,7 @@ Gem::Specification.new do |gem|
|
|
29
29
|
|
30
30
|
gem.add_development_dependency 'minitest', '~> 5.14'
|
31
31
|
gem.add_development_dependency 'rake', '~> 13.0'
|
32
|
-
gem.add_development_dependency 'rubocop', '0.
|
32
|
+
gem.add_development_dependency 'rubocop', '0.91.0'
|
33
33
|
gem.add_development_dependency 'simplecov', '~> 0.18'
|
34
34
|
gem.add_development_dependency 'spy', '1.0.0'
|
35
35
|
gem.add_development_dependency 'webmock', '~> 3.8'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wavefront-sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.2.
|
4
|
+
version: 5.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Fisher
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-09-
|
11
|
+
date: 2020-09-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -100,14 +100,14 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - '='
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 0.
|
103
|
+
version: 0.91.0
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - '='
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: 0.
|
110
|
+
version: 0.91.0
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: simplecov
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|