aws-embedded-metrics-customink 0.2.0 → 0.3.0

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: dc12276136937bb9f0fe45dfecb340e136b262e3f147bfb1c7449a94092fcaa9
4
- data.tar.gz: bca1439d7fd26e6368410f3e6aa92189a98b3e9d5c6d9aae1c67b79300f9467b
3
+ metadata.gz: 19f47b8f7cd28ca38f035c2535f415bad2b1c202ddb10a95493c5d4bbe6d04f0
4
+ data.tar.gz: 236ed5cab1638a2a730320b844fc7a9e8384bf7f245cf13b206d9be6f3d8698c
5
5
  SHA512:
6
- metadata.gz: 4c3b5dedf5d198a08f6d4863c6c5cd50b194d124f0e619a46600742d2bb46d2560ba4709d8ddba88009e0b0251fe9efc7bf6ae29e2fa0c58c889647b883ce065
7
- data.tar.gz: 822ba5fe608f5aae296f5903b173d1dfc893dceaa7d7007921cec664856ebd7a1b4d1de7dbcc9b3d67e0f0bf2ee2c8a2677a6c7c2e7e4b130ba8f90912c1bd93
6
+ metadata.gz: 55b668526bbccc83bb7a72e1dd41475f15d271f74dc54b3d47ac8019f8ab0ef59e208cde9065845ba32236268801d8afd6267598184e7500c462d16d95721b18
7
+ data.tar.gz: 67b6a9ea9d13bb39a20db4b4ddb368e7eece759409d9df42a1232575aea1bd06189d7bcf5d2fe4828462c2408551e260e0f667fac50c62220979f292aec43d0a
@@ -0,0 +1,23 @@
1
+ name: Lint
2
+ on: [push]
3
+ jobs:
4
+ test:
5
+ runs-on: ubuntu-latest
6
+ strategy:
7
+ matrix:
8
+ ruby:
9
+ - '2.5'
10
+ - '2.7'
11
+ steps:
12
+ - name: Checkout
13
+ uses: actions/checkout@v1
14
+ - name: Setup Ruby
15
+ uses: actions/setup-ruby@v1
16
+ with:
17
+ ruby-version: ${{ matrix.ruby }}
18
+ - name: Bundle
19
+ run: |
20
+ ./bin/setup
21
+ - name: Rubocop
22
+ run: |
23
+ ./bin/bundle exec rubocop --parallel
@@ -0,0 +1,89 @@
1
+ inherit_from: .rubocop_todo.yml
2
+
3
+ AllCops:
4
+ Exclude:
5
+ - "test/**/*"
6
+ - "bin/**/*"
7
+ - "*.gemspec"
8
+ - Rakefile
9
+
10
+ Style/Documentation:
11
+ Enabled: false
12
+
13
+ Style/FrozenStringLiteralComment: # PENDING: [Ruby3.x] Remove this, autofix, test, conform.
14
+ Enabled: false
15
+
16
+ Layout/EmptyLinesAroundAttributeAccessor:
17
+ Enabled: true
18
+
19
+ Layout/EmptyLinesAroundClassBody:
20
+ Enabled: false
21
+
22
+ Layout/EmptyLinesAroundModuleBody:
23
+ Enabled: false
24
+
25
+ Layout/SpaceAroundMethodCallOperator:
26
+ Enabled: true
27
+
28
+ Lint/DeprecatedOpenSSLConstant:
29
+ Enabled: true
30
+
31
+ Lint/DuplicateElsifCondition:
32
+ Enabled: true
33
+
34
+ Lint/MixedRegexpCaptureTypes:
35
+ Enabled: true
36
+
37
+ Lint/RaiseException:
38
+ Enabled: true
39
+
40
+ Lint/StructNewOverride:
41
+ Enabled: true
42
+
43
+ Style/AccessorGrouping:
44
+ Enabled: true
45
+
46
+ Style/ArrayCoercion:
47
+ Enabled: true
48
+
49
+ Style/BisectedAttrAccessor:
50
+ Enabled: true
51
+
52
+ Style/CaseLikeIf:
53
+ Enabled: true
54
+
55
+ Style/ExponentialNotation:
56
+ Enabled: true
57
+
58
+ Style/HashAsLastArrayItem:
59
+ Enabled: true
60
+
61
+ Style/HashEachMethods:
62
+ Enabled: true
63
+
64
+ Style/HashLikeCase:
65
+ Enabled: true
66
+
67
+ Style/HashTransformKeys:
68
+ Enabled: true
69
+
70
+ Style/HashTransformValues:
71
+ Enabled: true
72
+
73
+ Style/RedundantAssignment:
74
+ Enabled: true
75
+
76
+ Style/RedundantFetchBlock:
77
+ Enabled: true
78
+
79
+ Style/RedundantFileExtensionInRequire:
80
+ Enabled: true
81
+
82
+ Style/RedundantRegexpCharacterClass:
83
+ Enabled: true
84
+
85
+ Style/RedundantRegexpEscape:
86
+ Enabled: true
87
+
88
+ Style/SlicingWithRange:
89
+ Enabled: true
@@ -0,0 +1,19 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2020-07-30 18:19:25 UTC using RuboCop version 0.88.0.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 1
10
+ # Configuration parameters: CountComments, CountAsOne, ExcludedMethods.
11
+ Metrics/MethodLength:
12
+ Max: 15
13
+
14
+ # Offense count: 1
15
+ # Configuration parameters: ExpectMatchingDefinition, CheckDefinitionPathHierarchy, Regex, IgnoreExecutableScripts, AllowedAcronyms.
16
+ # AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS
17
+ Naming/FileName:
18
+ Exclude:
19
+ - 'lib/aws-embedded-metrics-customink.rb'
@@ -3,6 +3,12 @@
3
3
 
4
4
  See this http://keepachangelog.com link for information on how we want this documented formatted.
5
5
 
6
+ ## v0.3.0
7
+
8
+ ### Added
9
+
10
+ - New `benchmark` helper.
11
+
6
12
  ## v0.2.0
7
13
 
8
14
  ### Changed
data/Gemfile CHANGED
@@ -1,8 +1,9 @@
1
- source "https://rubygems.org"
1
+ source 'https://rubygems.org'
2
2
  gemspec
3
3
 
4
- gem 'rake'
5
4
  gem 'minitest'
5
+ gem 'rake'
6
+ gem 'rubocop'
6
7
 
7
8
  group :test do
8
9
  gem 'mocha'
@@ -6,14 +6,34 @@ PATH
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
+ ast (2.4.1)
9
10
  coderay (1.1.3)
10
11
  method_source (1.0.0)
11
12
  minitest (5.14.1)
12
13
  mocha (1.11.2)
14
+ parallel (1.19.2)
15
+ parser (2.7.1.4)
16
+ ast (~> 2.4.1)
13
17
  pry (0.13.1)
14
18
  coderay (~> 1.1)
15
19
  method_source (~> 1.0)
20
+ rainbow (3.0.0)
16
21
  rake (13.0.1)
22
+ regexp_parser (1.7.1)
23
+ rexml (3.2.3)
24
+ rubocop (0.88.0)
25
+ parallel (~> 1.10)
26
+ parser (>= 2.7.1.1)
27
+ rainbow (>= 2.2.2, < 4.0)
28
+ regexp_parser (>= 1.7)
29
+ rexml
30
+ rubocop-ast (>= 0.1.0, < 1.0)
31
+ ruby-progressbar (~> 1.7)
32
+ unicode-display_width (>= 1.4.0, < 2.0)
33
+ rubocop-ast (0.2.0)
34
+ parser (>= 2.7.0.1)
35
+ ruby-progressbar (1.10.1)
36
+ unicode-display_width (1.7.0)
17
37
 
18
38
  PLATFORMS
19
39
  ruby
@@ -24,6 +44,7 @@ DEPENDENCIES
24
44
  mocha
25
45
  pry
26
46
  rake
47
+ rubocop
27
48
 
28
49
  BUNDLED WITH
29
50
  2.1.2
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
3
+ load Gem.bin_path('bundler', 'bundle')
@@ -27,7 +27,7 @@ module Aws
27
27
  end
28
28
  end
29
29
 
30
- extend self
30
+ module_function :config, :configure, :reconfigure, :logger
31
31
 
32
32
  end
33
33
  end
@@ -18,7 +18,7 @@ module Aws
18
18
  @config ||= Configuration.new
19
19
  end
20
20
 
21
- extend self
21
+ module_function :configure, :reconfigure, :config
22
22
 
23
23
  class Configuration
24
24
 
@@ -21,15 +21,22 @@ module Aws
21
21
  @sink.accept(message) unless empty?
22
22
  end
23
23
 
24
+ def benchmark
25
+ value = nil
26
+ seconds = Benchmark.realtime { value = yield }
27
+ milliseconds = (seconds * 1000).to_i
28
+ [value, milliseconds]
29
+ end
30
+
24
31
  def put_dimension(name, value)
25
32
  @dimensions << { name => value }
26
33
  self
27
34
  end
28
35
 
29
36
  def put_metric(name, value, unit = nil)
30
- @metrics << { 'Name' => name }.tap { |m|
37
+ @metrics << { 'Name' => name }.tap do |m|
31
38
  m['Unit'] = unit if unit
32
- }
39
+ end
33
40
  set_property name, value
34
41
  end
35
42
 
@@ -39,7 +46,7 @@ module Aws
39
46
  end
40
47
 
41
48
  def empty?
42
- [@dimensions, @metrics, @properties].all? { |x| x.empty? }
49
+ [@dimensions, @metrics, @properties].all?(&:empty?)
43
50
  end
44
51
 
45
52
  def message
@@ -1,7 +1,7 @@
1
1
  module Aws
2
2
  module Embedded
3
3
  module Metrics
4
- VERSION = '0.2.0'.freeze
4
+ VERSION = '0.3.0'.freeze
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-embedded-metrics-customink
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ken Collins
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-07-30 00:00:00.000000000 Z
11
+ date: 2020-08-07 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Amazon CloudWatch Embedded Metric Format Client Library for Ruby.
14
14
  email:
@@ -18,7 +18,10 @@ extensions: []
18
18
  extra_rdoc_files: []
19
19
  files:
20
20
  - ".github/workflows/ci.yml"
21
+ - ".github/workflows/lint.yml"
21
22
  - ".gitignore"
23
+ - ".rubocop.yml"
24
+ - ".rubocop_todo.yml"
22
25
  - CHANGELOG.md
23
26
  - CODE_OF_CONDUCT.md
24
27
  - Gemfile
@@ -27,6 +30,7 @@ files:
27
30
  - README.md
28
31
  - Rakefile
29
32
  - aws-embedded-metrics-customink.gemspec
33
+ - bin/bundle
30
34
  - bin/console
31
35
  - bin/setup
32
36
  - bin/test