redis-objects-daily-counter 0.4.0 → 0.4.1

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: d7df523f0449f89d1c4208f2ff1d950e3781fa4d4b7b35a2628176001fde9fb0
4
- data.tar.gz: 24bd7fdbf06221392984bac90426c6357b93bf70b64b9fe91d43d49df7f7f1b0
3
+ metadata.gz: 760920dc267e96b1d638c4042cc62e72cf60530b2514da0e1a7732d81c4ef364
4
+ data.tar.gz: 4cb2aa6680dc646b7b1020b63f0270eb242c5a4336b85f6a8038467fc7790b21
5
5
  SHA512:
6
- metadata.gz: 41e8781fe5227151c9134803d89f92fa1802e1681dbba2b65ce0c1a8e2e43565647927438574639f9d4e3620bd5fcc3746e9ddea6204f3e861db4a1189fd2c88
7
- data.tar.gz: 6183fe989bae2284fd4ff9fe000468d0ddb8c180baa7c363a1d903267f0b5685c04150d656be9d92a5daf2d81f593b9e304f7ce3df5b0027ef1b2bdf1f4a96a4
6
+ metadata.gz: d709dfc9e258729aac1b0eb2779a447691d7ebaea6094e572d09d0074e8ce37d6da092baede5e26de64d02792a0e7ed952ba8fc5388b2a6e01411fb7a9a07393
7
+ data.tar.gz: f391c8bb7d9db95bad3561b628d8e668d5b6e99940f28d8473d54ed4d2e7307e20616842b6122c401a342636be1f986ecb425bab1783d70f1529332d8b34b470
data/.gem_comet.yml CHANGED
@@ -11,7 +11,7 @@ version: 1.2
11
11
  release:
12
12
  base_branch: master
13
13
  release_branch: release
14
- version_file_path: lib/redis/objects/daily-counter/version.rb
14
+ version_file_path: lib/redis/objects/periodical/version.rb
15
15
  changelog_file_path: CHANGELOG.md # optional
16
16
  changelog:
17
17
  categories:
data/.rubocop.yml CHANGED
@@ -15,13 +15,14 @@ Metrics/BlockLength:
15
15
  Exclude:
16
16
  - "spec/**/*"
17
17
  - "redis-objects-daily-counter.gemspec"
18
+ - "redis-objects-periodical.gemspec"
18
19
 
19
20
  Metrics/MethodLength:
20
21
  Max: 15
21
22
 
22
23
  Naming/FileName:
23
24
  Exclude:
24
- - "lib/redis-objects-daily-counter.rb"
25
+ - "lib/redis-objects-periodical.rb"
25
26
 
26
27
  Style/TrailingCommaInArrayLiteral:
27
28
  EnforcedStyleForMultiline: comma
data/CHANGELOG.md CHANGED
@@ -1,32 +1,38 @@
1
1
  # Change log
2
2
 
3
+ ## v0.4.1 (Jul 27, 2022)
4
+
5
+ ### Misc
6
+
7
+ - [#22](https://github.com/ryz310/redis-object-periodical/pull/22) Rename from redis-object-daily-counter to redis-object-periodical ([@ryz310](https://github.com/ryz310))
8
+
3
9
  ## v0.4.0 (Jul 26, 2022)
4
10
 
5
11
  ### Feature
6
12
 
7
- - [#17](https://github.com/ryz310/redis-object-daily-counter/pull/17) Support `Redis::HashKey` as a recurring object ([@ryz310](https://github.com/ryz310))
13
+ - [#17](https://github.com/ryz310/redis-object-periodical/pull/17) Support `Redis::HashKey` as a recurring object ([@ryz310](https://github.com/ryz310))
8
14
 
9
15
  ### Breaking Change
10
16
 
11
- - [#18](https://github.com/ryz310/redis-object-daily-counter/pull/18) Bump up Ruby 3.1 and drop support Ruby 2.6 ([@ryz310](https://github.com/ryz310))
17
+ - [#18](https://github.com/ryz310/redis-object-periodical/pull/18) Bump up Ruby 3.1 and drop support Ruby 2.6 ([@ryz310](https://github.com/ryz310))
12
18
 
13
19
  ### Dependabot
14
20
 
15
- - [#16](https://github.com/ryz310/redis-object-daily-counter/pull/16) Bump yard from 0.9.26 to 0.9.28 ([@ryz310](https://github.com/ryz310))
16
- - [#15](https://github.com/ryz310/redis-object-daily-counter/pull/15) Bump rspec_junit_formatter from 0.4.1 to 0.5.1 ([@ryz310](https://github.com/ryz310))
17
- - [#13](https://github.com/ryz310/redis-object-daily-counter/pull/13) Bump rspec from 3.10.0 to 3.11.0 ([@ryz310](https://github.com/ryz310))
18
- - [#14](https://github.com/ryz310/redis-object-daily-counter/pull/14) Bump timecop from 0.9.4 to 0.9.5 ([@ryz310](https://github.com/ryz310))
19
- - [#12](https://github.com/ryz310/redis-object-daily-counter/pull/12) Bump redis-objects from 1.5.1 to 1.7.0 ([@ryz310](https://github.com/ryz310))
21
+ - [#16](https://github.com/ryz310/redis-object-periodical/pull/16) Bump yard from 0.9.26 to 0.9.28 ([@ryz310](https://github.com/ryz310))
22
+ - [#15](https://github.com/ryz310/redis-object-periodical/pull/15) Bump rspec_junit_formatter from 0.4.1 to 0.5.1 ([@ryz310](https://github.com/ryz310))
23
+ - [#13](https://github.com/ryz310/redis-object-periodical/pull/13) Bump rspec from 3.10.0 to 3.11.0 ([@ryz310](https://github.com/ryz310))
24
+ - [#14](https://github.com/ryz310/redis-object-periodical/pull/14) Bump timecop from 0.9.4 to 0.9.5 ([@ryz310](https://github.com/ryz310))
25
+ - [#12](https://github.com/ryz310/redis-object-periodical/pull/12) Bump redis-objects from 1.5.1 to 1.7.0 ([@ryz310](https://github.com/ryz310))
20
26
 
21
27
  ### Misc
22
28
 
23
- - [#19](https://github.com/ryz310/redis-object-daily-counter/pull/19) Reduce similar source codes with meta programming ([@ryz310](https://github.com/ryz310))
29
+ - [#19](https://github.com/ryz310/redis-object-periodical/pull/19) Reduce similar source codes with meta programming ([@ryz310](https://github.com/ryz310))
24
30
 
25
31
  ## v0.3.0 (Sep 23, 2021)
26
32
 
27
33
  ### Feature
28
34
 
29
- - [#7](https://github.com/ryz310/redis-object-daily-counter/pull/7) Add daily set ([@ryz310](https://github.com/ryz310))
35
+ - [#7](https://github.com/ryz310/redis-object-periodical/pull/7) Add daily set ([@ryz310](https://github.com/ryz310))
30
36
 
31
37
  > You can use `daily_set` in addition to the standard features of Redis::Objects.
32
38
  >
@@ -69,7 +75,7 @@
69
75
 
70
76
  ### Breaking Change
71
77
 
72
- - [#7](https://github.com/ryz310/redis-object-daily-counter/pull/7) Add daily set ([@ryz310](https://github.com/ryz310))
78
+ - [#7](https://github.com/ryz310/redis-object-periodical/pull/7) Add daily set ([@ryz310](https://github.com/ryz310))
73
79
 
74
80
  > Rename the method from #delete to #delete_at a73251f
75
81
  >
@@ -95,8 +101,8 @@
95
101
 
96
102
  ### Feature
97
103
 
98
- - [#3](https://github.com/ryz310/redis-objects-daily-counter/pull/3) Support time zone ([@ryz310](https://github.com/ryz310))
99
- - [#4](https://github.com/ryz310/redis-objects-daily-counter/pull/4) Add daily counter family ([@ryz310](https://github.com/ryz310))
104
+ - [#3](https://github.com/ryz310/redis-objects-periodical/pull/3) Support time zone ([@ryz310](https://github.com/ryz310))
105
+ - [#4](https://github.com/ryz310/redis-objects-periodical/pull/4) Add daily counter family ([@ryz310](https://github.com/ryz310))
100
106
  - `annual_counter`
101
107
  - `monthly_counter`
102
108
  - `weekly_counter`
@@ -105,7 +111,7 @@
105
111
 
106
112
  ### Misc
107
113
 
108
- - [#2](https://github.com/ryz310/redis-objects-daily-counter/pull/2) Install circle ci ([@ryz310](https://github.com/ryz310))
114
+ - [#2](https://github.com/ryz310/redis-objects-periodical/pull/2) Install circle ci ([@ryz310](https://github.com/ryz310))
109
115
 
110
116
  ## v0.1.0 (Sep 12, 2021)
111
117
 
data/Gemfile CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  source 'https://rubygems.org'
4
4
 
5
- # Specify your gem's dependencies in redis-objects-daily-counter.gemspec
6
- gemspec
5
+ # Specify your gem's dependencies in redis-objects-periodical.gemspec
6
+ gemspec name: 'redis-objects-periodical'
7
7
 
8
8
  gem 'bundler', '>= 2.0'
9
9
  gem 'pry-byebug'
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- redis-objects-daily-counter (0.4.0)
4
+ redis-objects-periodical (0.4.1)
5
5
  redis-objects
6
6
 
7
7
  GEM
@@ -84,7 +84,7 @@ DEPENDENCIES
84
84
  bundler (>= 2.0)
85
85
  pry-byebug
86
86
  rake (~> 13.0)
87
- redis-objects-daily-counter!
87
+ redis-objects-periodical!
88
88
  rspec (~> 3.11)
89
89
  rspec_junit_formatter
90
90
  rubocop (~> 0.80)
@@ -95,4 +95,4 @@ DEPENDENCIES
95
95
  yard
96
96
 
97
97
  BUNDLED WITH
98
- 2.2.27
98
+ 2.3.11
data/README.md CHANGED
@@ -1,15 +1,15 @@
1
- [![CircleCI](https://circleci.com/gh/ryz310/redis-objects-daily-counter.svg?style=svg)](https://circleci.com/gh/ryz310/redis-objects-daily-counter) [![Gem Version](https://badge.fury.io/rb/redis-objects-daily-counter.svg)](https://badge.fury.io/rb/redis-objects-daily-counter) [![Maintainability](https://api.codeclimate.com/v1/badges/1e1cb0d70e4f80e0fdd5/maintainability)](https://codeclimate.com/github/ryz310/redis-objects-daily-counter/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/1e1cb0d70e4f80e0fdd5/test_coverage)](https://codeclimate.com/github/ryz310/redis-objects-daily-counter/test_coverage)
1
+ [![CircleCI](https://circleci.com/gh/ryz310/redis-objects-periodical.svg?style=svg)](https://circleci.com/gh/ryz310/redis-objects-periodical) [![Gem Version](https://badge.fury.io/rb/redis-objects-periodical.svg)](https://badge.fury.io/rb/redis-objects-periodical) [![Maintainability](https://api.codeclimate.com/v1/badges/deebb6c406c306a6f337/maintainability)](https://codeclimate.com/github/ryz310/redis-objects-periodical/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/deebb6c406c306a6f337/test_coverage)](https://codeclimate.com/github/ryz310/redis-objects-periodical/test_coverage)
2
2
 
3
- # Redis::Objects::Daily::Counter and Daily::Set
3
+ # Redis::Objects::Periodical
4
4
 
5
- This is a gem which extends [Redis::Objects](https://github.com/nateware/redis-objects) gem. Once install this gem, you can use the daily counter, the daily set, etc. in addition to the standard features of Redis::Objects. These counters and sets are useful for measuring conversions, implementing API rate limiting, MAU, DAU, and more.
5
+ This is a gem which extends [Redis::Objects](https://github.com/nateware/redis-objects) gem. Once install this gem, you can use the periodical counter, the periodical set, etc. in addition to the standard features of Redis::Objects. These counters and sets are useful for measuring conversions, implementing API rate limiting, MAU, DAU, and more.
6
6
 
7
7
  ## Installation
8
8
 
9
9
  Add this line to your application's Gemfile:
10
10
 
11
11
  ```ruby
12
- gem 'redis-objects-daily-counter'
12
+ gem 'redis-objects-periodical'
13
13
  ```
14
14
 
15
15
  If you want to know about installation and standard usage, please see Redis::Objects' GitHub page.
@@ -58,9 +58,9 @@ end_date = Date.new(2021, 4, 2)
58
58
  homepage.pv.range(start_date, end_date) # [3, 2]
59
59
  ```
60
60
 
61
- ### Daily Counters
61
+ ### Periodical Counters
62
62
 
63
- The daily counter automatically switches the save destination when the date changes.
63
+ The periodical counters automatically switches the save destination when the date changes.
64
64
  You can access past dates counted values like Ruby arrays:
65
65
 
66
66
  ```rb
@@ -83,7 +83,7 @@ homepage.pv.at(Date.new(2021, 4, 2)) # => #<Redis::Counter key="homepage:1:pv:20
83
83
  homepage.pv.at(Date.new(2021, 4, 2)).value # 2
84
84
  ```
85
85
 
86
- #### Daily Counters Family
86
+ #### Periodical Counters Family
87
87
 
88
88
  - `annual_counter`
89
89
  - Key format: `model_name:id:field_name:yyyy`
@@ -99,9 +99,9 @@ homepage.pv.at(Date.new(2021, 4, 2)).value # 2
99
99
  - `minutely_counter`
100
100
  - Key format: `model_name:id:field_name:yyyy-mm-ddThh:mi`
101
101
 
102
- ### Daily Hashes
102
+ ### Periodical Hashes
103
103
 
104
- The daily hash also automatically switches the save destination when the date changes.
104
+ The periodical hashes also automatically switches the save destination when the date changes.
105
105
 
106
106
  ```rb
107
107
  # 2021-04-01
@@ -131,7 +131,7 @@ homepage.browsing_history.at(Date.new(2021, 4, 2)) # => #<Redis::HashKey key="ho
131
131
  homepage.browsing_history.at(Date.new(2021, 4, 2)).all # { 'item1' => '3', 'item3' => '5' }
132
132
  ```
133
133
 
134
- #### Daily Hashes Family
134
+ #### Periodical Hashes Family
135
135
 
136
136
  - `annual_hash_key`
137
137
  - Key format: `model_name:id:field_name:yyyy`
@@ -147,9 +147,9 @@ homepage.browsing_history.at(Date.new(2021, 4, 2)).all # { 'item1' => '3', 'item
147
147
  - `minutely_hash_key`
148
148
  - Key format: `model_name:id:field_name:yyyy-mm-ddThh:mi`
149
149
 
150
- ### Daily Sets
150
+ ### Periodical Sets
151
151
 
152
- The daily set also automatically switches the save destination when the date changes.
152
+ The periodical sets also automatically switches the save destination when the date changes.
153
153
 
154
154
  ```rb
155
155
  # 2021-04-01
@@ -179,7 +179,7 @@ homepage.dau.at(Date.new(2021, 4, 2)) # => #<Redis::Set key="homepage:1:dau:2021
179
179
  homepage.dau.at(Date.new(2021, 4, 2)).members # ['user2', 'user3']
180
180
  ```
181
181
 
182
- #### Daily Sets Family
182
+ #### Periodical Sets Family
183
183
 
184
184
  - `annual_set`
185
185
  - Key format: `model_name:id:field_name:yyyy`
@@ -211,7 +211,7 @@ Please use the following command:
211
211
 
212
212
  ## Contributing
213
213
 
214
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/redis-objects-daily-counter. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/redis-objects-daily-counter/blob/master/CODE_OF_CONDUCT.md).
214
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/redis-objects-periodical. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/redis-objects-periodical/blob/master/CODE_OF_CONDUCT.md).
215
215
 
216
216
  ## License
217
217
 
@@ -219,4 +219,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
219
219
 
220
220
  ## Code of Conduct
221
221
 
222
- Everyone interacting in the Redis::Objects::Daily::Counter project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/redis-objects-daily-counter/blob/master/CODE_OF_CONDUCT.md).
222
+ Everyone interacting in the Redis::Objects::Daily::Counter project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/redis-objects-periodical/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile CHANGED
@@ -1,6 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'bundler/gem_tasks'
3
+ require 'bundler/gem_helper'
4
+
5
+ Bundler::GemHelper.install_tasks(name: 'redis-objects-daily-counter')
6
+
4
7
  require 'rspec/core/rake_task'
5
8
 
6
9
  RSpec::Core::RakeTask.new(:spec)
data/bin/console CHANGED
@@ -2,7 +2,7 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  require 'bundler/setup'
5
- require 'redis-objects-daily-counter'
5
+ require 'redis-objects-periodical'
6
6
 
7
7
  Redis::Objects.redis = Redis.new(host: 'redis', port: 6379)
8
8
 
@@ -2,10 +2,8 @@
2
2
 
3
3
  class Redis
4
4
  module Objects
5
- module Daily
6
- module Counter
7
- VERSION = '0.4.0'
8
- end
5
+ module Periodical
6
+ VERSION = '0.4.1'
9
7
  end
10
8
  end
11
9
  end
@@ -1,15 +1,16 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'lib/redis/objects/daily-counter/version'
4
-
5
3
  Gem::Specification.new do |spec|
6
4
  spec.name = 'redis-objects-daily-counter'
7
- spec.version = Redis::Objects::Daily::Counter::VERSION
5
+ spec.version = '0.4.1'
8
6
  spec.authors = ['ryz310']
9
7
  spec.email = ['ryz310@gmail.com']
10
8
 
11
9
  spec.summary = 'Daily counter within Redis::Objects'
12
10
  spec.description = 'Daily counter within Redis::Objects. Works with any class or ORM.'
11
+ spec.post_install_message = 'The redis-objects-daily-counter gem has been deprecated and has '\
12
+ 'been replaced by redis-objects-periodical. Please switch to '\
13
+ 'redis-objects-periodical as soon as possible.'
13
14
  spec.homepage = 'https://github.com/ryz310/redis-objects-daily-counter'
14
15
  spec.license = 'MIT'
15
16
 
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'lib/redis/objects/periodical/version'
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = 'redis-objects-periodical'
7
+ spec.version = Redis::Objects::Periodical::VERSION
8
+ spec.authors = ['ryz310']
9
+ spec.email = ['ryz310@gmail.com']
10
+
11
+ spec.summary = 'Extends Redis::Objects as periodical.'
12
+ spec.description = 'Extends Redis::Objects to switch automatically the save destination ' \
13
+ 'within Redis on changing dates.'
14
+ spec.homepage = 'https://github.com/ryz310/redis-objects-periodical'
15
+ spec.license = 'MIT'
16
+
17
+ spec.metadata['homepage_uri'] = spec.homepage
18
+ spec.metadata['source_code_uri'] = 'https://github.com/ryz310/redis-objects-periodical'
19
+ spec.metadata['changelog_uri'] = 'https://github.com/ryz310/redis-objects-periodical/blob/master/CHANGELOG.md'
20
+
21
+ # Specify which files should be added to the gem when it is released.
22
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
23
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
24
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
25
+ end
26
+ spec.bindir = 'exe'
27
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
28
+ spec.require_paths = ['lib']
29
+
30
+ spec.required_ruby_version = '>= 2.7.0'
31
+
32
+ spec.add_dependency 'redis-objects'
33
+
34
+ # For more information and examples about making a new gem, checkout our
35
+ # guide at: https://bundler.io/guides/creating_gem.html
36
+ end
metadata CHANGED
@@ -1,11 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis-objects-daily-counter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - ryz310
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
11
  date: 2022-07-26 00:00:00.000000000 Z
@@ -49,11 +49,11 @@ files:
49
49
  - bin/console
50
50
  - bin/setup
51
51
  - docker-compose.yml
52
- - lib/redis-objects-daily-counter.rb
52
+ - lib/redis-objects-periodical.rb
53
53
  - lib/redis/base_counter_object.rb
54
54
  - lib/redis/base_hash_key_object.rb
55
55
  - lib/redis/base_set_object.rb
56
- - lib/redis/objects/daily-counter/version.rb
56
+ - lib/redis/objects/periodical/version.rb
57
57
  - lib/redis/objects/periodical_counters.rb
58
58
  - lib/redis/objects/periodical_hashes.rb
59
59
  - lib/redis/objects/periodical_sets.rb
@@ -68,6 +68,7 @@ files:
68
68
  - lib/redis/recurring_at_intervals/monthly.rb
69
69
  - lib/redis/recurring_at_intervals/weekly.rb
70
70
  - redis-objects-daily-counter.gemspec
71
+ - redis-objects-periodical.gemspec
71
72
  homepage: https://github.com/ryz310/redis-objects-daily-counter
72
73
  licenses:
73
74
  - MIT
@@ -75,7 +76,9 @@ metadata:
75
76
  homepage_uri: https://github.com/ryz310/redis-objects-daily-counter
76
77
  source_code_uri: https://github.com/ryz310/redis-objects-daily-counter
77
78
  changelog_uri: https://github.com/ryz310/redis-objects-daily-counter/blob/master/CHANGELOG.md
78
- post_install_message:
79
+ post_install_message: The redis-objects-daily-counter gem has been deprecated and
80
+ has been replaced by redis-objects-periodical. Please switch to redis-objects-periodical
81
+ as soon as possible.
79
82
  rdoc_options: []
80
83
  require_paths:
81
84
  - lib
@@ -90,8 +93,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
90
93
  - !ruby/object:Gem::Version
91
94
  version: '0'
92
95
  requirements: []
93
- rubygems_version: 3.3.11
94
- signing_key:
96
+ rubygems_version: 3.3.7
97
+ signing_key:
95
98
  specification_version: 4
96
99
  summary: Daily counter within Redis::Objects
97
100
  test_files: []