redis_counters 1.4.0 → 1.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.drone.yml +64 -0
- data/.rspec +5 -0
- data/Appraisals +4 -0
- data/CHANGELOG.md +66 -41
- data/Gemfile +5 -3
- data/README.md +1 -1
- data/dip.yml +42 -0
- data/docker-compose.development.yml +13 -0
- data/docker-compose.drone.yml +7 -0
- data/docker-compose.yml +16 -0
- data/lib/redis_counters/base_counter.rb +6 -7
- data/lib/redis_counters/clusterize_and_partitionize.rb +1 -1
- data/lib/redis_counters/hash_counter.rb +24 -8
- data/lib/redis_counters/version.rb +2 -2
- data/lib/redis_counters.rb +1 -3
- data/redis_counters.gemspec +5 -4
- data/spec/redis_counters/base_spec.rb +2 -2
- data/spec/redis_counters/hash_counter_spec.rb +116 -37
- data/spec/redis_counters/unique_hash_counter_spec.rb +5 -5
- data/spec/redis_counters/unique_values_lists/blocking_spec.rb +2 -2
- data/spec/spec_helper.rb +7 -9
- data/spec/support/unique_values_lists/common.rb +12 -13
- data/spec/support/unique_values_lists/expirable.rb +2 -3
- data/spec/support/unique_values_lists/set.rb +2 -3
- metadata +91 -51
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
ADDED
@@ -0,0 +1,64 @@
|
|
1
|
+
name: build
|
2
|
+
|
3
|
+
kind: pipeline
|
4
|
+
type: docker
|
5
|
+
|
6
|
+
volumes:
|
7
|
+
- name: rubygems
|
8
|
+
host:
|
9
|
+
path: /home/data/drone/rubygems
|
10
|
+
- name: images
|
11
|
+
host:
|
12
|
+
path: /home/data/drone/images
|
13
|
+
- name: bundle
|
14
|
+
host:
|
15
|
+
path: /home/data/drone/gems
|
16
|
+
- name: keys
|
17
|
+
host:
|
18
|
+
path: /home/data/drone/key_cache
|
19
|
+
|
20
|
+
spec_step_common: &spec_step_common
|
21
|
+
image: abakpress/dind-testing:1.0.3
|
22
|
+
pull: if-not-exists
|
23
|
+
privileged: true
|
24
|
+
volumes:
|
25
|
+
- name: images
|
26
|
+
path: /images
|
27
|
+
- name: bundle
|
28
|
+
path: /bundle
|
29
|
+
- name: keys
|
30
|
+
path: /ssh_keys
|
31
|
+
commands:
|
32
|
+
- prepare-build
|
33
|
+
|
34
|
+
- fetch-images
|
35
|
+
--image whilp/ssh-agent
|
36
|
+
--image abakpress/ruby-app:$RUBY_IMAGE_TAG
|
37
|
+
--image redis:$REDIS_IMAGE_TAG
|
38
|
+
|
39
|
+
- dip ssh add -T -v /ssh_keys -k /ssh_keys/id_rsa
|
40
|
+
- dip provision
|
41
|
+
- dip rspec
|
42
|
+
|
43
|
+
steps:
|
44
|
+
- name: Tests Ruby 2.4
|
45
|
+
environment:
|
46
|
+
COMPOSE_FILE_EXT: drone
|
47
|
+
DOCKER_RUBY_VERSION: 2.4
|
48
|
+
RUBY_IMAGE_TAG: 2.4-latest
|
49
|
+
REDIS_IMAGE_TAG: 4-alpine
|
50
|
+
RAILS_ENV: test
|
51
|
+
<<: *spec_step_common
|
52
|
+
|
53
|
+
- name: release
|
54
|
+
image: abakpress/gem-publication:latest
|
55
|
+
pull: if-not-exists
|
56
|
+
when:
|
57
|
+
event: push
|
58
|
+
branch: master
|
59
|
+
status: success
|
60
|
+
volumes:
|
61
|
+
- name: rubygems
|
62
|
+
path: /root/.gem
|
63
|
+
commands:
|
64
|
+
- release-gem --public
|
data/.rspec
ADDED
data/Appraisals
ADDED
data/CHANGELOG.md
CHANGED
@@ -1,42 +1,67 @@
|
|
1
|
+
# v1.5.2
|
1
2
|
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
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
|
+
|
9
|
+
# v1.5.1
|
10
|
+
|
11
|
+
* 2021-08-06 [09ed078](../../commit/09ed078) - __(TamarinEA)__ chore: support ruby 2.4 and use redis in test
|
12
|
+
|
13
|
+
# v1.5.0
|
14
|
+
|
15
|
+
* 2017-04-21 [d64da5e](../../commit/d64da5e) - __(Pavel Galkin)__ feat: support two value delimiters
|
16
|
+
https://jira.railsc.ru/browse/CK-862
|
17
|
+
|
18
|
+
* 2017-04-21 [a4f458c](../../commit/a4f458c) - __(Pavel Galkin)__ chore: update infrastructure
|
19
|
+
|
20
|
+
# v1.4.0
|
21
|
+
|
22
|
+
* 2016-07-20 [e6be297](../../commit/e6be297) - __(Stanislav Gordanov)__ feat: переместит значение инкремента в начало массива данных
|
23
|
+
* 2015-07-26 [e4771c5](../../commit/e4771c5) - __(Artem Napolskih)__ Update README.md
|
24
|
+
* 2015-02-19 [c86a1aa](../../commit/c86a1aa) - __(bibendi)__ commit changelog after generate it
|
25
|
+
* 2015-02-19 [b5ec9f8](../../commit/b5ec9f8) - __(bibendi)__ change releasing tasks to upload on rubygems
|
26
|
+
|
27
|
+
# v1.2.0
|
28
|
+
|
29
|
+
* 2014-11-10 [6257dc2](../../commit/6257dc2) - __(Artem Napolskih)__ feature(hash_counter): added float mode
|
30
|
+
* 2014-10-17 [48deb40](../../commit/48deb40) - __(Artem Napolskih)__ feature(unique_values_list): introduced a list of unique values to expiry of the members
|
31
|
+
* 2014-10-17 [e1206b7](../../commit/e1206b7) - __(Artem Napolskih)__ feature(unique_values_list): introduce has_value? method
|
32
|
+
* 2014-10-17 [cccc2be](../../commit/cccc2be) - __(Artem Napolskih)__ feature(unique_values_list): rename Standard and Fast unique values list to Blocking and NonBlocking respectively
|
33
|
+
* 2014-10-17 [7521fd8](../../commit/7521fd8) - __(Artem Napolskih)__ chore(specs): reorganize unique lists specs
|
34
|
+
* 2014-04-23 [94fada3](../../commit/94fada3) - __(Artem Napolskih)__ chore(all): fix circleci badge
|
35
|
+
* 2013-11-20 [0ae5531](../../commit/0ae5531) - __(Artem Napolskih)__ Release 1.1.0
|
36
|
+
|
37
|
+
# v1.1.0
|
38
|
+
|
39
|
+
* 2013-11-20 [3897988](../../commit/3897988) - __(Artem Napolskih)__ refactor(all): back delete_all! methods
|
40
|
+
* 2013-11-15 [2d1c733](../../commit/2d1c733) - __(Artem Napolskih)__ refactor(all): extract Cluster and Partition classes
|
41
|
+
* 2013-10-22 [020cc8e](../../commit/020cc8e) - __(Napolskih)__ refactor(all): shared code of clustering and partitioning extracted into module - group_keys -> cluster_keys - shared code of clustering and partitioning extracted into module
|
42
|
+
|
43
|
+
# v1.0.1
|
44
|
+
|
45
|
+
* 2013-10-21 [bfa328a](../../commit/bfa328a) - __(Artem Napolskih)__ feature(hash_counter): method date when called with a block, now returns the total number of lines
|
46
|
+
* 2013-10-21 [6d04c95](../../commit/6d04c95) - __(Artem Napolskih)__ Release 1.0.0
|
47
|
+
* 2013-10-10 [b29eab7](../../commit/b29eab7) - __(Artem Napolskih)__ feature(unique_values_lists): added methods to read and delete data
|
48
|
+
* 2013-10-10 [67c5200](../../commit/67c5200) - __(Artem Napolskih)__ feature(unique_hash_counter): introduce unique list postfix delimiter
|
49
|
+
* 2013-10-08 [8a9a2a9](../../commit/8a9a2a9) - __(Artem Napolskih)__ feature(hash_counter): added methods to read and delete data
|
50
|
+
* 2013-09-13 [f8d037c](../../commit/f8d037c) - __(Artem Napolskih)__ docs(all): documenting
|
51
|
+
|
52
|
+
# v1.0.0beta1
|
53
|
+
|
54
|
+
# v1.0.0
|
55
|
+
|
56
|
+
* 2013-10-10 [b29eab7](../../commit/b29eab7) - __(Artem Napolskih)__ feature(unique_values_lists): added methods to read and delete data
|
57
|
+
* 2013-10-10 [67c5200](../../commit/67c5200) - __(Artem Napolskih)__ feature(unique_hash_counter): introduce unique list postfix delimiter
|
58
|
+
* 2013-10-08 [8a9a2a9](../../commit/8a9a2a9) - __(Artem Napolskih)__ feature(hash_counter): added methods to read and delete data
|
59
|
+
* 2013-09-13 [f8d037c](../../commit/f8d037c) - __(Artem Napolskih)__ docs(all): documenting
|
60
|
+
* 2013-09-12 [0a176fa](../../commit/0a176fa) - __(Artem Napolskih)__ feature(all) introduce key and value delimiters
|
61
|
+
* 2013-09-12 [addbb40](../../commit/addbb40) - __(Artem Napolskih)__ feature(unique_values_list): fast (non blocking) unique values list added
|
62
|
+
- refactoring unique_values_list;
|
63
|
+
- fast (non blocking) unique values list added;
|
64
|
+
- unique_list[:list_class] property introduced on UniqueHashCounter.
|
65
|
+
|
66
|
+
* 2013-08-23 [897418d](../../commit/897418d) - __(Artem Napolskih)__ Initial commit
|
67
|
+
* 2013-08-21 [21ed53b](../../commit/21ed53b) - __(napolskih)__ dummy commit
|
data/Gemfile
CHANGED
@@ -1,6 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
source 'https://rubygems.org'
|
2
3
|
|
3
|
-
gem 'json', '< 2' if RUBY_VERSION < '2'
|
4
|
-
gem 'activesupport', '< 5' if RUBY_VERSION < '2'
|
5
|
-
|
6
4
|
gemspec
|
5
|
+
|
6
|
+
gem 'nokogiri', '< 1.11.0', require: false
|
7
|
+
gem 'parallel', '< 1.21.0'
|
8
|
+
gem 'racc', ' < 1.6.0', require: false
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# RedisCounters
|
2
2
|
|
3
|
-
[![
|
3
|
+
[![Build Status](https://drone.railsc.ru/api/badges/abak-press/redis_counters/status.svg)](https://drone.railsc.ru/abak-press/redis_counters)
|
4
4
|
[![Code Climate](https://codeclimate.com/github/abak-press/redis_counters/badges/gpa.svg)](https://codeclimate.com/github/abak-press/redis_counters)
|
5
5
|
[![Test Coverage](https://codeclimate.com/github/abak-press/redis_counters/badges/coverage.svg)](https://codeclimate.com/github/abak-press/redis_counters/coverage)
|
6
6
|
|
data/dip.yml
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
version: '1'
|
2
|
+
|
3
|
+
environment:
|
4
|
+
DOCKER_RUBY_VERSION: 2.4
|
5
|
+
RUBY_IMAGE_TAG: 2.4-latest
|
6
|
+
REDIS_IMAGE_TAG: 4-alpine
|
7
|
+
COMPOSE_FILE_EXT: development
|
8
|
+
RAILS_ENV: test
|
9
|
+
|
10
|
+
compose:
|
11
|
+
files:
|
12
|
+
- docker-compose.yml
|
13
|
+
- docker-compose.${COMPOSE_FILE_EXT}.yml
|
14
|
+
|
15
|
+
interaction:
|
16
|
+
sh:
|
17
|
+
service: app
|
18
|
+
|
19
|
+
irb:
|
20
|
+
service: app
|
21
|
+
command: irb
|
22
|
+
|
23
|
+
bundle:
|
24
|
+
service: app
|
25
|
+
command: bundle
|
26
|
+
|
27
|
+
rake:
|
28
|
+
service: app
|
29
|
+
command: bundle exec rake
|
30
|
+
|
31
|
+
rspec:
|
32
|
+
service: app
|
33
|
+
command: bundle exec rspec
|
34
|
+
|
35
|
+
clean:
|
36
|
+
service: app
|
37
|
+
command: rm -f Gemfile.lock gemfiles/*.gemfile.*
|
38
|
+
|
39
|
+
provision:
|
40
|
+
- docker volume create --name bundler_data
|
41
|
+
- dip clean
|
42
|
+
- dip bundle install
|
data/docker-compose.yml
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
version: '2'
|
2
|
+
|
3
|
+
services:
|
4
|
+
app:
|
5
|
+
image: abakpress/ruby-app:$RUBY_IMAGE_TAG
|
6
|
+
environment:
|
7
|
+
- BUNDLE_PATH=/bundle/$DOCKER_RUBY_VERSION
|
8
|
+
- BUNDLE_CONFIG=/app/.bundle/config
|
9
|
+
- TEST_REDIS_HOST=redis
|
10
|
+
command: bash
|
11
|
+
depends_on:
|
12
|
+
- redis
|
13
|
+
|
14
|
+
redis:
|
15
|
+
image: redis:$REDIS_IMAGE_TAG
|
16
|
+
command: 'redis-server --bind 0.0.0.0'
|
@@ -1,11 +1,8 @@
|
|
1
|
-
# coding: utf-8
|
2
1
|
require 'forwardable'
|
3
2
|
require 'active_support/core_ext/class/attribute'
|
4
3
|
|
5
4
|
module RedisCounters
|
6
|
-
|
7
5
|
# Базовый класс счетчика на основе Redis.
|
8
|
-
|
9
6
|
class BaseCounter
|
10
7
|
extend Forwardable
|
11
8
|
|
@@ -22,10 +19,13 @@ module RedisCounters
|
|
22
19
|
# opts - Hash - хеш опций счетчика:
|
23
20
|
# counter_name - Symbol/String - идентификатор счетчика.
|
24
21
|
# key_delimiter - String - разделитель ключа (опционально).
|
25
|
-
# value_delimiter - String
|
22
|
+
# value_delimiter - Array[String] или String, разделитель значений. Если это массив, то первый элемент будет
|
23
|
+
# считатся новым разделителем, а второй старым. Все данные будут записываться, используя
|
24
|
+
# новый. Старый будет использоваться только для старых данных. Так что если надо сменить
|
25
|
+
# делимитр у счётчика, например с ':' на '�', то сперва надо будет установить его на ['�',
|
26
|
+
# ':'], а после дампа старых данных в БД, на '�'.
|
26
27
|
#
|
27
28
|
# Returns RedisCounters::BaseCounter.
|
28
|
-
#
|
29
29
|
def self.create(redis, opts)
|
30
30
|
counter_class = opts.fetch(:counter_class).to_s.constantize
|
31
31
|
counter_class.new(redis, opts)
|
@@ -80,5 +80,4 @@ module RedisCounters
|
|
80
80
|
|
81
81
|
def_delegator :redis, :multi, :transaction
|
82
82
|
end
|
83
|
-
|
84
|
-
end
|
83
|
+
end
|
@@ -1,11 +1,9 @@
|
|
1
|
-
# coding: utf-8
|
2
1
|
require 'redis_counters/base_counter'
|
3
2
|
require 'redis_counters/clusterize_and_partitionize'
|
3
|
+
require 'string_tools'
|
4
4
|
|
5
5
|
module RedisCounters
|
6
|
-
|
7
6
|
# Счетчик на основе redis-hash, с возможностью партиционирования и кластеризации значений.
|
8
|
-
|
9
7
|
class HashCounter < BaseCounter
|
10
8
|
include ClusterizeAndPartitionize
|
11
9
|
|
@@ -24,7 +22,11 @@ module RedisCounters
|
|
24
22
|
group_params = [field_name]
|
25
23
|
end
|
26
24
|
|
27
|
-
|
25
|
+
if value_delimiter.is_a?(Array)
|
26
|
+
group_params.join(value_delimiter.first)
|
27
|
+
else
|
28
|
+
group_params.join(value_delimiter)
|
29
|
+
end
|
28
30
|
end
|
29
31
|
|
30
32
|
def field_name
|
@@ -43,12 +45,27 @@ module RedisCounters
|
|
43
45
|
# cluster - Array - листовой кластер - массив параметров однозначно идентифицирующий кластер.
|
44
46
|
# partition - Array - листовая партиция - массив параметров однозначно идентифицирующий партицию.
|
45
47
|
#
|
46
|
-
# Returns Array of
|
47
|
-
#
|
48
|
+
# Returns Array of HashWithIndifferentAccess.
|
48
49
|
def partition_data(cluster, partition)
|
49
50
|
keys = group_keys.dup.unshift(:value)
|
51
|
+
|
52
|
+
if delimiter_is_ary = value_delimiter.is_a?(Array)
|
53
|
+
new_delim, old_delim = value_delimiter
|
54
|
+
end
|
55
|
+
|
50
56
|
redis.hgetall(key(partition, cluster)).inject(Array.new) do |result, (key, value)|
|
51
|
-
|
57
|
+
key = key.dup.to_utf8
|
58
|
+
values = if delimiter_is_ary
|
59
|
+
if key.include?(new_delim)
|
60
|
+
key.split(new_delim, -1)
|
61
|
+
else
|
62
|
+
key.split(old_delim, -1)
|
63
|
+
end
|
64
|
+
else
|
65
|
+
key.split(value_delimiter, -1)
|
66
|
+
end
|
67
|
+
|
68
|
+
values = values.map(&:presence).unshift(format_value(value))
|
52
69
|
values.delete_at(1) unless group_keys.present?
|
53
70
|
result << Hash[keys.zip(values)].with_indifferent_access
|
54
71
|
end
|
@@ -66,5 +83,4 @@ module RedisCounters
|
|
66
83
|
@float_mode ||= options.fetch(:float_mode, false)
|
67
84
|
end
|
68
85
|
end
|
69
|
-
|
70
86
|
end
|
@@ -1,3 +1,3 @@
|
|
1
1
|
module RedisCounters
|
2
|
-
VERSION = '1.
|
3
|
-
end
|
2
|
+
VERSION = '1.5.2'.freeze
|
3
|
+
end
|
data/lib/redis_counters.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
# encoding: utf-8
|
2
1
|
require 'redis_counters/version'
|
3
2
|
require 'redis_counters/base_counter'
|
4
3
|
require 'redis_counters/hash_counter'
|
@@ -12,10 +11,9 @@ require 'active_support'
|
|
12
11
|
require 'active_support/core_ext'
|
13
12
|
|
14
13
|
module RedisCounters
|
15
|
-
|
16
14
|
def create_counter(redis, opts)
|
17
15
|
BaseCounter.create(redis, opts)
|
18
16
|
end
|
19
17
|
|
20
18
|
module_function :create_counter
|
21
|
-
end
|
19
|
+
end
|
data/redis_counters.gemspec
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
# coding: utf-8
|
2
1
|
lib = File.expand_path('../lib', __FILE__)
|
3
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
3
|
require 'redis_counters/version'
|
@@ -16,16 +15,18 @@ Gem::Specification.new do |spec|
|
|
16
15
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
17
16
|
spec.require_paths = ['lib']
|
18
17
|
|
19
|
-
spec.
|
18
|
+
spec.add_runtime_dependency 'activesupport', '>= 4.0', '< 5'
|
19
|
+
spec.add_runtime_dependency 'string_tools'
|
20
20
|
|
21
21
|
spec.add_development_dependency 'bundler'
|
22
22
|
spec.add_development_dependency 'rake'
|
23
23
|
spec.add_development_dependency 'rspec', '~> 2.14.0'
|
24
|
-
spec.add_development_dependency '
|
24
|
+
spec.add_development_dependency 'redis', '>= 3.0'
|
25
|
+
spec.add_development_dependency 'appraisal', '>= 1.0.2'
|
25
26
|
spec.add_development_dependency 'timecop'
|
26
27
|
spec.add_development_dependency 'codeclimate-test-reporter', '>= 0.4.1'
|
27
28
|
spec.add_development_dependency 'simplecov'
|
28
29
|
spec.add_development_dependency 'cane', '>= 2.6.0'
|
29
30
|
spec.add_development_dependency 'bundler-audit'
|
30
|
-
spec.add_development_dependency '
|
31
|
+
spec.add_development_dependency 'pry-byebug'
|
31
32
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe RedisCounters::BaseCounter do
|
4
|
-
let(:redis) {
|
4
|
+
let(:redis) { Redis.current }
|
5
5
|
|
6
6
|
let(:options) { {
|
7
7
|
:counter_class => RedisCounters::HashCounter,
|
@@ -26,4 +26,4 @@ describe RedisCounters::BaseCounter do
|
|
26
26
|
|
27
27
|
it { expect { counter }.to raise_error KeyError }
|
28
28
|
end
|
29
|
-
end
|
29
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe RedisCounters::HashCounter do
|
4
|
-
let(:redis) {
|
4
|
+
let(:redis) { Redis.current }
|
5
5
|
let(:value) { rand(10) + 1 }
|
6
6
|
let(:options) { { :counter_name => :test_counter, :field_name => :test_field } }
|
7
7
|
let(:counter) { described_class.new(redis, options) }
|
@@ -89,8 +89,7 @@ describe RedisCounters::HashCounter do
|
|
89
89
|
before { 3.times { counter.process(:param1 => 21, :param2 => 22, :param3 => 33) } }
|
90
90
|
|
91
91
|
it { expect(redis.keys('*')).to have(2).key }
|
92
|
-
it { expect(redis.keys('*')
|
93
|
-
it { expect(redis.keys('*').last).to eq 'test_counter:21:22' }
|
92
|
+
it { expect(redis.keys('*')).to match_array ['test_counter:11:22', 'test_counter:21:22'] }
|
94
93
|
it { expect(redis.hexists('test_counter:11:22', 'test_field')).to be_true }
|
95
94
|
it { expect(redis.hget('test_counter:11:22', 'test_field')).to eq value.to_s }
|
96
95
|
it { expect(redis.hexists('test_counter:21:22', 'test_field')).to be_true }
|
@@ -108,8 +107,7 @@ describe RedisCounters::HashCounter do
|
|
108
107
|
before { 3.times { counter.process(:param1 => 2, :param2 => 2) } }
|
109
108
|
|
110
109
|
it { expect(redis.keys('*')).to have(2).key }
|
111
|
-
it { expect(redis.keys('*')
|
112
|
-
it { expect(redis.keys('*').last).to eq 'test_counter:false' }
|
110
|
+
it { expect(redis.keys('*')).to match_array ['test_counter:true', 'test_counter:false'] }
|
113
111
|
it { expect(redis.hexists('test_counter:true', 'test_field')).to be_true }
|
114
112
|
it { expect(redis.hget('test_counter:true', 'test_field')).to eq 2.to_s }
|
115
113
|
it { expect(redis.hexists('test_counter:false', 'test_field')).to be_true }
|
@@ -129,9 +127,7 @@ describe RedisCounters::HashCounter do
|
|
129
127
|
before { 1.times { counter.process(:param1 => 21, :param2 => '', :param3 => 33) } }
|
130
128
|
|
131
129
|
it { expect(redis.keys('*')).to have(3).key }
|
132
|
-
it { expect(redis.keys('*')
|
133
|
-
it { expect(redis.keys('*').second).to eq 'test_counter:21:22' }
|
134
|
-
it { expect(redis.keys('*').third).to eq 'test_counter:21:' }
|
130
|
+
it { expect(redis.keys('*')).to match_array ['test_counter:11:22', 'test_counter:21:22', 'test_counter:21:'] }
|
135
131
|
it { expect(redis.hexists('test_counter:11:22', 'test_field')).to be_true }
|
136
132
|
it { expect(redis.hget('test_counter:11:22', 'test_field')).to eq value.to_s }
|
137
133
|
it { expect(redis.hexists('test_counter:21:22', 'test_field')).to be_true }
|
@@ -153,9 +149,13 @@ describe RedisCounters::HashCounter do
|
|
153
149
|
before { 1.times { counter.process(:param1 => 2, :param2 => 2, :date => '2013-04-28') } }
|
154
150
|
|
155
151
|
it { expect(redis.keys('*')).to have(3).key }
|
156
|
-
it
|
157
|
-
|
158
|
-
|
152
|
+
it do
|
153
|
+
expect(redis.keys('*')).to match_array [
|
154
|
+
'test_counter:2013-04-27:true',
|
155
|
+
'test_counter:2013-04-27:false',
|
156
|
+
'test_counter:2013-04-28:false'
|
157
|
+
]
|
158
|
+
end
|
159
159
|
it { expect(redis.hexists('test_counter:2013-04-27:true', 'test_field')).to be_true }
|
160
160
|
it { expect(redis.hget('test_counter:2013-04-27:true', 'test_field')).to eq 3.to_s }
|
161
161
|
it { expect(redis.hexists('test_counter:2013-04-27:false', 'test_field')).to be_true }
|
@@ -182,17 +182,14 @@ describe RedisCounters::HashCounter do
|
|
182
182
|
|
183
183
|
context 'when no partition params given' do
|
184
184
|
it { expect(counter.partitions).to have(3).partition }
|
185
|
-
it { expect(counter.partitions
|
186
|
-
it { expect(counter.partitions.second).to eq partition_2 }
|
187
|
-
it { expect(counter.partitions.third).to eq partition_3 }
|
185
|
+
it { expect(counter.partitions).to match_array [partition_1, partition_2, partition_3] }
|
188
186
|
end
|
189
187
|
|
190
188
|
context 'when one partition param given' do
|
191
189
|
it { expect(counter.partitions(:param1 => 11)).to have(1).partition }
|
192
190
|
it { expect(counter.partitions(:param1 => 11).first).to eq partition_1 }
|
193
191
|
it { expect(counter.partitions(:param1 => 21)).to have(2).partition }
|
194
|
-
it { expect(counter.partitions(:param1 => 21)
|
195
|
-
it { expect(counter.partitions('param1' => 21).second).to eq partition_3 }
|
192
|
+
it { expect(counter.partitions(:param1 => 21)).to match_array [partition_2, partition_3] }
|
196
193
|
end
|
197
194
|
|
198
195
|
context 'when two partition params given' do
|
@@ -231,9 +228,7 @@ describe RedisCounters::HashCounter do
|
|
231
228
|
before { 4.times { counter.process(:param1 => 21, :param2 => '', :param3 => 31) } }
|
232
229
|
|
233
230
|
it { expect(counter.data(partitions)).to have(3).row }
|
234
|
-
it { expect(counter.data(partitions)
|
235
|
-
it { expect(counter.data(partitions).second[:value]).to eq 2 }
|
236
|
-
it { expect(counter.data(partitions).third[:value]).to eq 5 }
|
231
|
+
it { expect(counter.data(partitions)).to match_array [{'value' => 3}, {'value' => 2}, {'value' => 5}] }
|
237
232
|
end
|
238
233
|
|
239
234
|
context 'when group_keys and one group key is nil' do
|
@@ -257,7 +252,7 @@ describe RedisCounters::HashCounter do
|
|
257
252
|
it { expect(counter.data(partitions).first[:param4]).to eq '1' }
|
258
253
|
it { expect(counter.data(partitions).second[:value]).to eq 5 }
|
259
254
|
it { expect(counter.data(partitions).second[:param3]).to eq '31' }
|
260
|
-
it { expect(counter.data(partitions).second[:param4]).to eq
|
255
|
+
it { expect(counter.data(partitions).second[:param4]).to eq nil }
|
261
256
|
end
|
262
257
|
|
263
258
|
context 'when group_keys given' do
|
@@ -375,8 +370,7 @@ describe RedisCounters::HashCounter do
|
|
375
370
|
before { counter.delete_partitions!(partition_2) }
|
376
371
|
|
377
372
|
it { expect(counter.partitions).to have(2).row }
|
378
|
-
it { expect(counter.partitions
|
379
|
-
it { expect(counter.partitions.last).to eq partition_3 }
|
373
|
+
it { expect(counter.partitions).to match_array [partition_1, partition_3] }
|
380
374
|
end
|
381
375
|
|
382
376
|
context 'when not leaf partition given' do
|
@@ -396,9 +390,7 @@ describe RedisCounters::HashCounter do
|
|
396
390
|
before { counter.delete_partitions!(:param1 => 21, &error_proc) rescue nil }
|
397
391
|
|
398
392
|
it { expect(counter.partitions).to have(3).row }
|
399
|
-
it { expect(counter.partitions
|
400
|
-
it { expect(counter.partitions.second).to eq partition_2 }
|
401
|
-
it { expect(counter.partitions.last).to eq partition_3 }
|
393
|
+
it { expect(counter.partitions).to match_array [partition_1, partition_2, partition_3] }
|
402
394
|
end
|
403
395
|
end
|
404
396
|
|
@@ -407,8 +399,7 @@ describe RedisCounters::HashCounter do
|
|
407
399
|
before { counter.delete_partitions!(partition_2) }
|
408
400
|
|
409
401
|
it { expect(counter.partitions).to have(2).row }
|
410
|
-
it { expect(counter.partitions
|
411
|
-
it { expect(counter.partitions.last).to eq partition_3 }
|
402
|
+
it { expect(counter.partitions).to match_array [partition_1, partition_3] }
|
412
403
|
end
|
413
404
|
|
414
405
|
context 'when not leaf partition given' do
|
@@ -434,16 +425,104 @@ describe RedisCounters::HashCounter do
|
|
434
425
|
before { 2.times { counter.process(partition_2) } }
|
435
426
|
before { 3.times { counter.process(partition_3) } }
|
436
427
|
|
437
|
-
it
|
438
|
-
|
439
|
-
|
428
|
+
it do
|
429
|
+
expect(counter.partitions).to match_array [
|
430
|
+
{'param1' => '11', 'param2' => '22:35'},
|
431
|
+
{'param1' => '11', 'param2' => '23:26'},
|
432
|
+
{'param1' => '11', 'param2' => '24:26'}
|
433
|
+
]
|
434
|
+
end
|
440
435
|
|
441
|
-
it
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
436
|
+
it do
|
437
|
+
expect(counter.data).to match_array [
|
438
|
+
{'value' => 1, 'param3' => '11:64'},
|
439
|
+
{'value' => 2, 'param3' => '11:36'},
|
440
|
+
{'value' => 3, 'param3' => '21:54'}
|
441
|
+
]
|
442
|
+
end
|
443
|
+
end
|
444
|
+
|
445
|
+
context 'two delimiters' do
|
446
|
+
let(:options) do
|
447
|
+
{
|
448
|
+
counter_name: :test_counter,
|
449
|
+
group_keys: [:title, :url],
|
450
|
+
partition_keys: [:date],
|
451
|
+
key_delimiter: '&',
|
452
|
+
value_delimiter: %W(\uFFFD :)
|
453
|
+
}
|
454
|
+
end
|
455
|
+
let(:partition) { {title: 'Main', url: 'http://example.com', date: '2017-04-21'} }
|
456
|
+
|
457
|
+
before { counter.increment(partition) }
|
458
|
+
|
459
|
+
it 'uses the first (new) delimiter for writing' do
|
460
|
+
expect(counter.send(:field)).to eq('Main�http://example.com')
|
461
|
+
expect(counter.data).to eq([{'value' => 1, 'title' => 'Main', 'url' => 'http://example.com'}])
|
462
|
+
end
|
463
|
+
end
|
464
|
+
|
465
|
+
context 'new delimiter added when there is data separated by the old one' do
|
466
|
+
let(:options) do
|
467
|
+
{
|
468
|
+
counter_name: :test_counter,
|
469
|
+
group_keys: [:title, :url],
|
470
|
+
partition_keys: [:date],
|
471
|
+
key_delimiter: '&',
|
472
|
+
value_delimiter: %W(\uFFFD :)
|
473
|
+
}
|
474
|
+
end
|
475
|
+
let(:partition) { {title: 'Main', url: 'http://example.com', date: '2017-04-21'} }
|
476
|
+
|
477
|
+
before do
|
478
|
+
redis.hincrbyfloat('test_counter&2017-04-21', 'Main:/about', 1.0)
|
479
|
+
end
|
480
|
+
|
481
|
+
it 'understands the old delimiter' do
|
482
|
+
expect(counter.data).to eq([{'value' => 1, 'title' => 'Main', 'url' => '/about'}])
|
483
|
+
end
|
484
|
+
end
|
485
|
+
|
486
|
+
context 'new delimiter added and there is data separated by it but contains the old delimiter' do
|
487
|
+
let(:options) do
|
488
|
+
{
|
489
|
+
counter_name: :test_counter,
|
490
|
+
group_keys: [:title, :url],
|
491
|
+
partition_keys: [:date],
|
492
|
+
key_delimiter: '&',
|
493
|
+
value_delimiter: %W(\uFFFD :)
|
494
|
+
}
|
495
|
+
end
|
496
|
+
let(:partition) { {title: 'Main', url: 'http://example.com', date: '2017-04-21'} }
|
497
|
+
|
498
|
+
before do
|
499
|
+
redis.hincrbyfloat('test_counter&2017-04-21', 'Main�http://example.com', 1.0)
|
500
|
+
end
|
501
|
+
|
502
|
+
it 'uses the new delimiter' do
|
503
|
+
expect(counter.data).to eq([{'value' => 1, 'title' => 'Main', 'url' => 'http://example.com'}])
|
504
|
+
end
|
505
|
+
end
|
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
|
447
526
|
end
|
448
527
|
|
449
528
|
context 'when check custom increment' do
|
@@ -459,4 +538,4 @@ describe RedisCounters::HashCounter do
|
|
459
538
|
it { expect(redis.hexists('test_counter', 'test_field')).to be_true }
|
460
539
|
it { expect(redis.hget('test_counter', 'test_field').to_f).to be_within(0.001).of value*0.2.to_f }
|
461
540
|
end
|
462
|
-
end
|
541
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe RedisCounters::UniqueHashCounter do
|
4
|
-
let(:redis) {
|
4
|
+
let(:redis) { Redis.current }
|
5
5
|
let(:unique_list_postfix) { described_class.const_get(:UNIQUE_LIST_POSTFIX) }
|
6
6
|
|
7
7
|
let(:options) { {
|
@@ -76,8 +76,8 @@ describe RedisCounters::UniqueHashCounter do
|
|
76
76
|
|
77
77
|
it { expect(redis.lrange('test_counter_uq:1:partitions', 0, -1)).to eq ['2013-04-28', '2013-04-27'] }
|
78
78
|
it { expect(redis.lrange('test_counter_uq:2:partitions', 0, -1)).to eq ['2013-04-27'] }
|
79
|
-
it { expect(redis.smembers('test_counter_uq:1:2013-04-27')).to
|
80
|
-
it { expect(redis.smembers('test_counter_uq:2:2013-04-27')).to
|
81
|
-
it { expect(redis.smembers('test_counter_uq:1:2013-04-28')).to
|
79
|
+
it { expect(redis.smembers('test_counter_uq:1:2013-04-27')).to match_array ['4'] }
|
80
|
+
it { expect(redis.smembers('test_counter_uq:2:2013-04-27')).to match_array ['3', '2', '1'] }
|
81
|
+
it { expect(redis.smembers('test_counter_uq:1:2013-04-28')).to match_array ['5', '1'] }
|
82
82
|
end
|
83
|
-
end
|
83
|
+
end
|
@@ -5,7 +5,7 @@ describe RedisCounters::UniqueValuesLists::Blocking do
|
|
5
5
|
it_behaves_like 'unique_values_lists/set'
|
6
6
|
|
7
7
|
context 'when check partitions list' do
|
8
|
-
let(:redis) {
|
8
|
+
let(:redis) { Redis.current }
|
9
9
|
let(:values) { rand(10) + 1 }
|
10
10
|
let(:partitions_list_postfix) { described_class.const_get(:PARTITIONS_LIST_POSTFIX) }
|
11
11
|
|
@@ -91,4 +91,4 @@ describe RedisCounters::UniqueValuesLists::Blocking do
|
|
91
91
|
end
|
92
92
|
end
|
93
93
|
end
|
94
|
-
end
|
94
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,16 +1,16 @@
|
|
1
|
-
require 'rubygems'
|
2
1
|
require 'bundler/setup'
|
3
2
|
require 'rspec'
|
4
|
-
require 'mock_redis'
|
5
3
|
require 'timecop'
|
6
|
-
|
7
4
|
require 'codeclimate-test-reporter'
|
8
|
-
CodeClimate::TestReporter.start
|
9
|
-
|
10
5
|
require 'simplecov'
|
6
|
+
require 'pry-byebug'
|
7
|
+
|
11
8
|
SimpleCov.start('test_frameworks')
|
12
9
|
|
13
10
|
require 'redis_counters'
|
11
|
+
require 'redis'
|
12
|
+
|
13
|
+
Redis.current = Redis.new(host: ENV['TEST_REDIS_HOST'])
|
14
14
|
|
15
15
|
# require helpers
|
16
16
|
support_dir = File.expand_path(File.join('..', 'support'), __FILE__)
|
@@ -18,7 +18,5 @@ Dir[File.join(support_dir, '**', '*.rb')].each { |f| require f }
|
|
18
18
|
|
19
19
|
RSpec.configure do |config|
|
20
20
|
config.backtrace_exclusion_patterns = [/lib\/rspec\/(core|expectations|matchers|mocks)/]
|
21
|
-
config.
|
22
|
-
|
23
|
-
config.order = 'random'
|
24
|
-
end
|
21
|
+
config.before { Redis.current.flushdb }
|
22
|
+
end
|
@@ -1,6 +1,5 @@
|
|
1
|
-
# coding: utf-8
|
2
1
|
shared_examples_for 'unique_values_lists/common' do
|
3
|
-
let(:redis) {
|
2
|
+
let(:redis) { Redis.current }
|
4
3
|
let(:values) { rand(10) + 1 }
|
5
4
|
|
6
5
|
let(:options) { {
|
@@ -139,9 +138,10 @@ shared_examples_for 'unique_values_lists/common' do
|
|
139
138
|
|
140
139
|
context 'when no partition given' do
|
141
140
|
it { expect(counter.partitions(cluster1_subcluster1)).to have(3).partitions }
|
142
|
-
it
|
143
|
-
|
144
|
-
|
141
|
+
it do
|
142
|
+
expect(counter.partitions(cluster1_subcluster1)).
|
143
|
+
to match_array [part1_subpart1, part1_subpart2, part2_subpart1]
|
144
|
+
end
|
145
145
|
#
|
146
146
|
it { expect(counter.partitions(cluster2_subcluster1)).to have(1).partitions }
|
147
147
|
it { expect(counter.partitions(cluster2_subcluster1).first).to eq part1_subpart1 }
|
@@ -149,8 +149,10 @@ shared_examples_for 'unique_values_lists/common' do
|
|
149
149
|
|
150
150
|
context 'when not leaf partition given' do
|
151
151
|
it { expect(counter.partitions(cluster1_subcluster1.merge(:part => :part1))).to have(2).partitions }
|
152
|
-
it
|
153
|
-
|
152
|
+
it do
|
153
|
+
expect(counter.partitions(cluster1_subcluster1.merge(:part => :part1))).
|
154
|
+
to match_array [part1_subpart1, part1_subpart2]
|
155
|
+
end
|
154
156
|
end
|
155
157
|
|
156
158
|
context 'when leaf partition given' do
|
@@ -182,15 +184,12 @@ shared_examples_for 'unique_values_lists/common' do
|
|
182
184
|
|
183
185
|
context 'when no partition given' do
|
184
186
|
it { expect(counter.partitions).to have(3).partitions }
|
185
|
-
it { expect(counter.partitions
|
186
|
-
it { expect(counter.partitions.second).to eq part1_subpart2 }
|
187
|
-
it { expect(counter.partitions.third).to eq part2_subpart1 }
|
187
|
+
it { expect(counter.partitions).to match_array [part1_subpart1, part1_subpart2, part2_subpart1] }
|
188
188
|
end
|
189
189
|
|
190
190
|
context 'when not leaf partition given' do
|
191
191
|
it { expect(counter.partitions(:part => :part1)).to have(2).partitions }
|
192
|
-
it { expect(counter.partitions(:part => :part1)
|
193
|
-
it { expect(counter.partitions(:part => :part1).second).to eq part1_subpart2 }
|
192
|
+
it { expect(counter.partitions(:part => :part1)).to match_array [part1_subpart1, part1_subpart2] }
|
194
193
|
end
|
195
194
|
|
196
195
|
context 'when leaf partition given' do
|
@@ -560,4 +559,4 @@ shared_examples_for 'unique_values_lists/common' do
|
|
560
559
|
end
|
561
560
|
end
|
562
561
|
end
|
563
|
-
end
|
562
|
+
end
|
@@ -1,6 +1,5 @@
|
|
1
|
-
# coding: utf-8
|
2
1
|
shared_examples_for 'unique_values_lists/expirable' do
|
3
|
-
let(:redis) {
|
2
|
+
let(:redis) { Redis.current }
|
4
3
|
let(:counter) { described_class.new(redis, options) }
|
5
4
|
|
6
5
|
after do
|
@@ -159,4 +158,4 @@ shared_examples_for 'unique_values_lists/expirable' do
|
|
159
158
|
end
|
160
159
|
end
|
161
160
|
end
|
162
|
-
end
|
161
|
+
end
|
@@ -1,6 +1,5 @@
|
|
1
|
-
# coding: utf-8
|
2
1
|
shared_examples_for 'unique_values_lists/set' do
|
3
|
-
let(:redis) {
|
2
|
+
let(:redis) { Redis.current }
|
4
3
|
let(:values) { rand(10) + 1 }
|
5
4
|
|
6
5
|
let(:counter) { described_class.new(redis, options) }
|
@@ -116,4 +115,4 @@ shared_examples_for 'unique_values_lists/set' do
|
|
116
115
|
it { expect(redis.smembers("test_counter:cluster2")).to include '4:5' }
|
117
116
|
end
|
118
117
|
end
|
119
|
-
end
|
118
|
+
end
|
metadata
CHANGED
@@ -1,169 +1,203 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redis_counters
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
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
|
+
name: activesupport
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '4.0'
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '5'
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
14
25
|
version_requirements: !ruby/object:Gem::Requirement
|
15
26
|
requirements:
|
16
|
-
- -
|
27
|
+
- - ">="
|
17
28
|
- !ruby/object:Gem::Version
|
18
|
-
version: '
|
19
|
-
|
29
|
+
version: '4.0'
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '5'
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: string_tools
|
20
35
|
requirement: !ruby/object:Gem::Requirement
|
21
36
|
requirements:
|
22
|
-
- -
|
37
|
+
- - ">="
|
23
38
|
- !ruby/object:Gem::Version
|
24
|
-
version: '
|
39
|
+
version: '0'
|
25
40
|
type: :runtime
|
26
41
|
prerelease: false
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
42
|
version_requirements: !ruby/object:Gem::Requirement
|
29
43
|
requirements:
|
30
|
-
- -
|
44
|
+
- - ">="
|
31
45
|
- !ruby/object:Gem::Version
|
32
46
|
version: '0'
|
47
|
+
- !ruby/object:Gem::Dependency
|
33
48
|
name: bundler
|
34
49
|
requirement: !ruby/object:Gem::Requirement
|
35
50
|
requirements:
|
36
|
-
- -
|
51
|
+
- - ">="
|
37
52
|
- !ruby/object:Gem::Version
|
38
53
|
version: '0'
|
39
54
|
type: :development
|
40
55
|
prerelease: false
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
56
|
version_requirements: !ruby/object:Gem::Requirement
|
43
57
|
requirements:
|
44
|
-
- -
|
58
|
+
- - ">="
|
45
59
|
- !ruby/object:Gem::Version
|
46
60
|
version: '0'
|
61
|
+
- !ruby/object:Gem::Dependency
|
47
62
|
name: rake
|
48
63
|
requirement: !ruby/object:Gem::Requirement
|
49
64
|
requirements:
|
50
|
-
- -
|
65
|
+
- - ">="
|
51
66
|
- !ruby/object:Gem::Version
|
52
67
|
version: '0'
|
53
68
|
type: :development
|
54
69
|
prerelease: false
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
70
|
version_requirements: !ruby/object:Gem::Requirement
|
57
71
|
requirements:
|
58
|
-
- -
|
72
|
+
- - ">="
|
59
73
|
- !ruby/object:Gem::Version
|
60
|
-
version:
|
74
|
+
version: '0'
|
75
|
+
- !ruby/object:Gem::Dependency
|
61
76
|
name: rspec
|
62
77
|
requirement: !ruby/object:Gem::Requirement
|
63
78
|
requirements:
|
64
|
-
- - ~>
|
79
|
+
- - "~>"
|
65
80
|
- !ruby/object:Gem::Version
|
66
81
|
version: 2.14.0
|
67
82
|
type: :development
|
68
83
|
prerelease: false
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
84
|
version_requirements: !ruby/object:Gem::Requirement
|
71
85
|
requirements:
|
72
|
-
- -
|
86
|
+
- - "~>"
|
73
87
|
- !ruby/object:Gem::Version
|
74
|
-
version:
|
75
|
-
|
88
|
+
version: 2.14.0
|
89
|
+
- !ruby/object:Gem::Dependency
|
90
|
+
name: redis
|
76
91
|
requirement: !ruby/object:Gem::Requirement
|
77
92
|
requirements:
|
78
|
-
- -
|
93
|
+
- - ">="
|
79
94
|
- !ruby/object:Gem::Version
|
80
|
-
version: '0'
|
95
|
+
version: '3.0'
|
81
96
|
type: :development
|
82
97
|
prerelease: false
|
98
|
+
version_requirements: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - ">="
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '3.0'
|
83
103
|
- !ruby/object:Gem::Dependency
|
104
|
+
name: appraisal
|
105
|
+
requirement: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - ">="
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: 1.0.2
|
110
|
+
type: :development
|
111
|
+
prerelease: false
|
84
112
|
version_requirements: !ruby/object:Gem::Requirement
|
85
113
|
requirements:
|
86
|
-
- -
|
114
|
+
- - ">="
|
87
115
|
- !ruby/object:Gem::Version
|
88
|
-
version:
|
116
|
+
version: 1.0.2
|
117
|
+
- !ruby/object:Gem::Dependency
|
89
118
|
name: timecop
|
90
119
|
requirement: !ruby/object:Gem::Requirement
|
91
120
|
requirements:
|
92
|
-
- -
|
121
|
+
- - ">="
|
93
122
|
- !ruby/object:Gem::Version
|
94
123
|
version: '0'
|
95
124
|
type: :development
|
96
125
|
prerelease: false
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
126
|
version_requirements: !ruby/object:Gem::Requirement
|
99
127
|
requirements:
|
100
|
-
- -
|
128
|
+
- - ">="
|
101
129
|
- !ruby/object:Gem::Version
|
102
|
-
version: 0
|
130
|
+
version: '0'
|
131
|
+
- !ruby/object:Gem::Dependency
|
103
132
|
name: codeclimate-test-reporter
|
104
133
|
requirement: !ruby/object:Gem::Requirement
|
105
134
|
requirements:
|
106
|
-
- -
|
135
|
+
- - ">="
|
107
136
|
- !ruby/object:Gem::Version
|
108
137
|
version: 0.4.1
|
109
138
|
type: :development
|
110
139
|
prerelease: false
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
140
|
version_requirements: !ruby/object:Gem::Requirement
|
113
141
|
requirements:
|
114
|
-
- -
|
142
|
+
- - ">="
|
115
143
|
- !ruby/object:Gem::Version
|
116
|
-
version:
|
144
|
+
version: 0.4.1
|
145
|
+
- !ruby/object:Gem::Dependency
|
117
146
|
name: simplecov
|
118
147
|
requirement: !ruby/object:Gem::Requirement
|
119
148
|
requirements:
|
120
|
-
- -
|
149
|
+
- - ">="
|
121
150
|
- !ruby/object:Gem::Version
|
122
151
|
version: '0'
|
123
152
|
type: :development
|
124
153
|
prerelease: false
|
125
|
-
- !ruby/object:Gem::Dependency
|
126
154
|
version_requirements: !ruby/object:Gem::Requirement
|
127
155
|
requirements:
|
128
|
-
- -
|
156
|
+
- - ">="
|
129
157
|
- !ruby/object:Gem::Version
|
130
|
-
version:
|
158
|
+
version: '0'
|
159
|
+
- !ruby/object:Gem::Dependency
|
131
160
|
name: cane
|
132
161
|
requirement: !ruby/object:Gem::Requirement
|
133
162
|
requirements:
|
134
|
-
- -
|
163
|
+
- - ">="
|
135
164
|
- !ruby/object:Gem::Version
|
136
165
|
version: 2.6.0
|
137
166
|
type: :development
|
138
167
|
prerelease: false
|
139
|
-
- !ruby/object:Gem::Dependency
|
140
168
|
version_requirements: !ruby/object:Gem::Requirement
|
141
169
|
requirements:
|
142
|
-
- -
|
170
|
+
- - ">="
|
143
171
|
- !ruby/object:Gem::Version
|
144
|
-
version:
|
172
|
+
version: 2.6.0
|
173
|
+
- !ruby/object:Gem::Dependency
|
145
174
|
name: bundler-audit
|
146
175
|
requirement: !ruby/object:Gem::Requirement
|
147
176
|
requirements:
|
148
|
-
- -
|
177
|
+
- - ">="
|
149
178
|
- !ruby/object:Gem::Version
|
150
179
|
version: '0'
|
151
180
|
type: :development
|
152
181
|
prerelease: false
|
153
|
-
- !ruby/object:Gem::Dependency
|
154
182
|
version_requirements: !ruby/object:Gem::Requirement
|
155
183
|
requirements:
|
156
|
-
- -
|
184
|
+
- - ">="
|
157
185
|
- !ruby/object:Gem::Version
|
158
186
|
version: '0'
|
159
|
-
|
187
|
+
- !ruby/object:Gem::Dependency
|
188
|
+
name: pry-byebug
|
160
189
|
requirement: !ruby/object:Gem::Requirement
|
161
190
|
requirements:
|
162
|
-
- -
|
191
|
+
- - ">="
|
163
192
|
- !ruby/object:Gem::Version
|
164
193
|
version: '0'
|
165
194
|
type: :development
|
166
195
|
prerelease: false
|
196
|
+
version_requirements: !ruby/object:Gem::Requirement
|
197
|
+
requirements:
|
198
|
+
- - ">="
|
199
|
+
- !ruby/object:Gem::Version
|
200
|
+
version: '0'
|
167
201
|
description:
|
168
202
|
email:
|
169
203
|
- napolskih@gmail.com
|
@@ -171,12 +205,19 @@ executables: []
|
|
171
205
|
extensions: []
|
172
206
|
extra_rdoc_files: []
|
173
207
|
files:
|
174
|
-
- .
|
208
|
+
- ".drone.yml"
|
209
|
+
- ".gitignore"
|
210
|
+
- ".rspec"
|
211
|
+
- Appraisals
|
175
212
|
- CHANGELOG.md
|
176
213
|
- Gemfile
|
177
214
|
- Makefile
|
178
215
|
- README.md
|
179
216
|
- Rakefile
|
217
|
+
- dip.yml
|
218
|
+
- docker-compose.development.yml
|
219
|
+
- docker-compose.drone.yml
|
220
|
+
- docker-compose.yml
|
180
221
|
- lib/redis_counters.rb
|
181
222
|
- lib/redis_counters/base_counter.rb
|
182
223
|
- lib/redis_counters/bucket.rb
|
@@ -215,17 +256,16 @@ require_paths:
|
|
215
256
|
- lib
|
216
257
|
required_ruby_version: !ruby/object:Gem::Requirement
|
217
258
|
requirements:
|
218
|
-
- -
|
259
|
+
- - ">="
|
219
260
|
- !ruby/object:Gem::Version
|
220
261
|
version: '0'
|
221
262
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
222
263
|
requirements:
|
223
|
-
- -
|
264
|
+
- - ">="
|
224
265
|
- !ruby/object:Gem::Version
|
225
266
|
version: '0'
|
226
267
|
requirements: []
|
227
|
-
|
228
|
-
rubygems_version: 2.4.6
|
268
|
+
rubygems_version: 3.0.3
|
229
269
|
signing_key:
|
230
270
|
specification_version: 4
|
231
271
|
summary: Redis Counters
|