redis_counters 1.5.1 → 1.5.2
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 +5 -5
- data/.drone.yml +0 -18
- data/Appraisals +1 -6
- data/CHANGELOG.md +8 -1
- data/Gemfile +5 -0
- data/dip.yml +2 -2
- data/lib/redis_counters/hash_counter.rb +2 -0
- data/lib/redis_counters/version.rb +1 -1
- data/redis_counters.gemspec +1 -0
- data/spec/redis_counters/hash_counter_spec.rb +21 -0
- metadata +17 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: ee8632f37abf5f884a41073d7da1d6af0d03a42124aa5667bcd4c867872f4a23
|
4
|
+
data.tar.gz: 5999cedae855634e290a58b1bc17fbbb5ab596d57ff48a6847c8e85bda013809
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 800be8089bfe3444442ac06c0c49c656aa73bcfc06282de92949a89dfc40035198ba472ae8b7d75ff9cfde680a04af96e1e97f7497b601dde17e6205fb4d4243
|
7
|
+
data.tar.gz: ec6cd875271549cff1ebce5b0febe55d4901c8f956aa5e436a3d427ec3ac83096058d87912b33e7162e8da475db713d8b1468bbe5c7675bb2d0f156810f7259b
|
data/.drone.yml
CHANGED
@@ -41,24 +41,6 @@ spec_step_common: &spec_step_common
|
|
41
41
|
- dip rspec
|
42
42
|
|
43
43
|
steps:
|
44
|
-
- name: Tests Ruby 2.2
|
45
|
-
environment:
|
46
|
-
COMPOSE_FILE_EXT: drone
|
47
|
-
DOCKER_RUBY_VERSION: 2.2
|
48
|
-
RUBY_IMAGE_TAG: 2.2-latest
|
49
|
-
REDIS_IMAGE_TAG: 4-alpine
|
50
|
-
RAILS_ENV: test
|
51
|
-
<<: *spec_step_common
|
52
|
-
|
53
|
-
- name: Tests Ruby 2.3
|
54
|
-
environment:
|
55
|
-
COMPOSE_FILE_EXT: drone
|
56
|
-
DOCKER_RUBY_VERSION: 2.3
|
57
|
-
RUBY_IMAGE_TAG: 2.3-latest
|
58
|
-
REDIS_IMAGE_TAG: 4-alpine
|
59
|
-
RAILS_ENV: test
|
60
|
-
<<: *spec_step_common
|
61
|
-
|
62
44
|
- name: Tests Ruby 2.4
|
63
45
|
environment:
|
64
46
|
COMPOSE_FILE_EXT: drone
|
data/Appraisals
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,13 @@
|
|
1
|
+
# v1.5.2
|
2
|
+
|
3
|
+
* 2022-05-05 [9c3a157](../../commit/9c3a157) - __(Igor Prudnikov)__ Release 1.5.2
|
4
|
+
* 2022-05-05 [fb05645](../../commit/fb05645) - __(Igor Prudnikov)__ fix: fix hash counter with delimeters containing non-utf8 data
|
5
|
+
https://jira.railsc.ru/browse/BPC-20533
|
6
|
+
|
7
|
+
* 2022-05-05 [e10e51d](../../commit/e10e51d) - __(Igor Prudnikov)__ chore: remove older ruby versions support
|
8
|
+
|
1
9
|
# v1.5.1
|
2
10
|
|
3
|
-
* 2021-08-06 [3302af4](../../commit/3302af4) - __(TamarinEA)__ Release 1.5.1
|
4
11
|
* 2021-08-06 [09ed078](../../commit/09ed078) - __(TamarinEA)__ chore: support ruby 2.4 and use redis in test
|
5
12
|
|
6
13
|
# v1.5.0
|
data/Gemfile
CHANGED
data/dip.yml
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'redis_counters/base_counter'
|
2
2
|
require 'redis_counters/clusterize_and_partitionize'
|
3
|
+
require 'string_tools'
|
3
4
|
|
4
5
|
module RedisCounters
|
5
6
|
# Счетчик на основе redis-hash, с возможностью партиционирования и кластеризации значений.
|
@@ -53,6 +54,7 @@ module RedisCounters
|
|
53
54
|
end
|
54
55
|
|
55
56
|
redis.hgetall(key(partition, cluster)).inject(Array.new) do |result, (key, value)|
|
57
|
+
key = key.dup.to_utf8
|
56
58
|
values = if delimiter_is_ary
|
57
59
|
if key.include?(new_delim)
|
58
60
|
key.split(new_delim, -1)
|
data/redis_counters.gemspec
CHANGED
@@ -16,6 +16,7 @@ Gem::Specification.new do |spec|
|
|
16
16
|
spec.require_paths = ['lib']
|
17
17
|
|
18
18
|
spec.add_runtime_dependency 'activesupport', '>= 4.0', '< 5'
|
19
|
+
spec.add_runtime_dependency 'string_tools'
|
19
20
|
|
20
21
|
spec.add_development_dependency 'bundler'
|
21
22
|
spec.add_development_dependency 'rake'
|
@@ -504,6 +504,27 @@ describe RedisCounters::HashCounter do
|
|
504
504
|
end
|
505
505
|
end
|
506
506
|
|
507
|
+
context 'when non-utf8 data contains delimeters' do
|
508
|
+
let(:options) do
|
509
|
+
{
|
510
|
+
counter_name: :test_counter,
|
511
|
+
group_keys: [:title, :url],
|
512
|
+
partition_keys: [:date],
|
513
|
+
key_delimiter: '&',
|
514
|
+
value_delimiter: '|'
|
515
|
+
}
|
516
|
+
end
|
517
|
+
let(:partition) { {title: "Erg\xE4nzendes", url: 'http://example.com', date: '2022-05-04'} }
|
518
|
+
|
519
|
+
before do
|
520
|
+
redis.hincrbyfloat('test_counter&2022-05-04', "Erg\xE4nzendes|http://example.com", 1.0)
|
521
|
+
end
|
522
|
+
|
523
|
+
it 'successfully splits data' do
|
524
|
+
expect(counter.data).to eq([{'value' => 1, 'title' => 'Ergänzendes', 'url' => 'http://example.com'}])
|
525
|
+
end
|
526
|
+
end
|
527
|
+
|
507
528
|
context 'when check custom increment' do
|
508
529
|
let(:options) { {
|
509
530
|
:counter_name => :test_counter,
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redis_counters
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Artem Napolskih
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-05-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -30,6 +30,20 @@ dependencies:
|
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: '5'
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: string_tools
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0'
|
40
|
+
type: :runtime
|
41
|
+
prerelease: false
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0'
|
33
47
|
- !ruby/object:Gem::Dependency
|
34
48
|
name: bundler
|
35
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -251,8 +265,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
251
265
|
- !ruby/object:Gem::Version
|
252
266
|
version: '0'
|
253
267
|
requirements: []
|
254
|
-
|
255
|
-
rubygems_version: 2.6.1
|
268
|
+
rubygems_version: 3.0.3
|
256
269
|
signing_key:
|
257
270
|
specification_version: 4
|
258
271
|
summary: Redis Counters
|