puma-cloudwatch 0.4.2 → 0.4.3

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: 5964a498ab8a2aa58273a7c67b6718cf68049638a7309de78417eb23bdb822cb
4
- data.tar.gz: ff5d0c7dbee00986d2a8c0992bd0f444d15e6de55f921eba0889e4a5d0911f4e
3
+ metadata.gz: 9ae42ac19375d8bf29b099ca8e66fdbfb11721d9d7b1e0b92c927b215543f0db
4
+ data.tar.gz: fe0cac1930260bf4f1d511c98ba5bcd0b0abb041e3f6450f40977b6106f5e630
5
5
  SHA512:
6
- metadata.gz: c02a7fe762c110e421d1936fb3fd1357aa116953206fa040099194d2295c9c50e46ec58b19b70050e24a3382ab3028dceedc9602c529674a499e91baba788ce4
7
- data.tar.gz: 03740b86cbe85a8c55ffdbba28a5deb100d075cd485029fc58fbf7f6e052107d80a8dabbace92d06ef2e03d0c4110b822ff3e664104a1c82c70512ca88e22a4c
6
+ metadata.gz: f1f315d96f54cb4d39b6d5485f226fec8dcc5f6d6097f3fee0989d72424763d93d36f37c02f41e41085fd76edcdfa8f26f9ee8c38ef222ffe0de7d93b41a4678
7
+ data.tar.gz: 0b350e8c303d4a9c5dd89ecf1a97d6a1f3f3c5e659a4df84d3495ab7950a67fbdc1501d492548a44739285261958bd15a072c066a05a2c966043e6d2b2820341
data/CHANGELOG.md CHANGED
@@ -3,6 +3,9 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  This project *loosely tries* to adhere to [Semantic Versioning](http://semver.org/).
5
5
 
6
+ ## [0.4.3]
7
+ - #3 Eliminate the need to add Array#sum
8
+
6
9
  ## [0.4.2]
7
10
  - #2 keep looper running on adversities
8
11
 
@@ -2,6 +2,5 @@
2
2
  major, minor, _ = RUBY_VERSION.split('.')
3
3
  if major == '2' && minor == '3'
4
4
  require "puma_cloudwatch/core_ext/thread"
5
- require "puma_cloudwatch/core_ext/array"
6
5
  require "pp"
7
6
  end
@@ -57,7 +57,7 @@ class PumaCloudwatch::Metrics
57
57
  dimensions: dimensions,
58
58
  statistic_values: {
59
59
  sample_count: values.length,
60
- sum: values.sum,
60
+ sum: values.inject(0) { |sum, el| sum += el },
61
61
  minimum: values.min,
62
62
  maximum: values.max
63
63
  }
@@ -1,3 +1,3 @@
1
1
  module PumaCloudwatch
2
- VERSION = "0.4.2"
2
+ VERSION = "0.4.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puma-cloudwatch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-05-20 00:00:00.000000000 Z
11
+ date: 2020-05-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-cloudwatch
@@ -87,7 +87,6 @@ files:
87
87
  - lib/puma/plugin/cloudwatch.rb
88
88
  - lib/puma_cloudwatch.rb
89
89
  - lib/puma_cloudwatch/core_ext.rb
90
- - lib/puma_cloudwatch/core_ext/array.rb
91
90
  - lib/puma_cloudwatch/core_ext/thread.rb
92
91
  - lib/puma_cloudwatch/metrics.rb
93
92
  - lib/puma_cloudwatch/metrics/fetcher.rb
@@ -1,7 +0,0 @@
1
- class Array
2
- # Note: Array#sum only available in ruby 2.4+
3
- # Thanks: http://www.viarails.net/q/How-to-sum-an-array-of-numbers-in-Ruby
4
- def sum
5
- inject(0) {|sum, i| sum + i }
6
- end
7
- end