redis-objects-daily-counter 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 8a1d7cbeced820236792c71dd5f82f33a0bcfbe9ebc897ad8001d70740ca939b
4
+ data.tar.gz: 2ca71fab3345471d86ad5ce86866132fae367dfc72bd450b3f8398a40c14015b
5
+ SHA512:
6
+ metadata.gz: c8810d8da10897dce9c887421acf923b2f5e4ac944c7267dd5d8df61f226dd70e5bd8da55398ada1bc0dfcb2c67c3190f8e3467ef329c2c9f226d43fac091993
7
+ data.tar.gz: 6fff807b98113bfddde1a0957b8e95f371d054f920b32cff9ddf6376f1e3cefbf6f05efaed83d8193e8463eec63a64fa9d9485e43565e2c5d2026218544df0b0
@@ -0,0 +1,204 @@
1
+ # Ruby CircleCI 2.0 configuration file
2
+ #
3
+ # Check https://circleci.com/docs/2.0/language-ruby/ for more details
4
+ #
5
+ version: 2.1
6
+
7
+ orbs:
8
+ ruby-orbs: sue445/ruby-orbs@1.6.2
9
+ code-climate: rvla/code-climate@0.0.2
10
+
11
+ references:
12
+ - &ruby_version
13
+ ruby_version:
14
+ type: enum
15
+ enum: ['2.6', '2.7', '3.0']
16
+ default: '3.0'
17
+
18
+ executors:
19
+ default:
20
+ parameters:
21
+ <<: *ruby_version
22
+ docker:
23
+ - image: circleci/ruby:<< parameters.ruby_version >>
24
+ - image: redis:latest
25
+ name: redis
26
+ working_directory: ~/repo
27
+
28
+ commands:
29
+ run_rspec:
30
+ description: 'Run RSpec'
31
+ steps:
32
+ - run:
33
+ name: 'Execute RSpec'
34
+ command: |
35
+ mkdir /tmp/test-results
36
+ TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)"
37
+ cc-test-reporter before-build
38
+ bundle exec rspec --format documentation \
39
+ --color \
40
+ --format RspecJunitFormatter \
41
+ --out /tmp/test-results/rspec.xml \
42
+ $TEST_FILES
43
+ - code-climate/format-coverage:
44
+ input-type: simplecov
45
+ prefix: $(readlink -f .)
46
+ coverage-file: coverage/coverage.json
47
+ output: coverage/codeclimate.$CIRCLE_BUILD_NUM.json
48
+ - persist_to_workspace:
49
+ root: coverage
50
+ paths:
51
+ - codeclimate.*.json
52
+ - store_test_results:
53
+ path: /tmp/test-results
54
+ - store_artifacts:
55
+ path: /tmp/test-results
56
+ destination: test-results
57
+ rubocop:
58
+ steps:
59
+ - run:
60
+ name: Run RuboCop
61
+ command: bundle exec rubocop
62
+ yardoc:
63
+ description: 'Generate YARDoc'
64
+ steps:
65
+ - run: bundle exec yardoc -o ./yardoc
66
+ - store_artifacts:
67
+ path: ./yardoc
68
+ destination: yardoc
69
+ rake_build:
70
+ steps:
71
+ - run:
72
+ name: Rake Build
73
+ command: bundle exec rake build
74
+ rubocop_challenge:
75
+ steps:
76
+ - run:
77
+ name: Rubocop Challenge
78
+ command: |
79
+ gem install rubocop_challenger --pre
80
+ rubocop_challenger go --email=ryz310@gmail.com --name=ryz310
81
+ release:
82
+ description: Release to RubyGems.org
83
+ steps:
84
+ - run:
85
+ name: Create Rubygems Credentials
86
+ command: |
87
+ mkdir ~/.gem || true
88
+ echo -e "---\n:rubygems_api_key: ${RUBYGEMS_API_KEY}" > ~/.gem/credentials
89
+ chmod 0600 ~/.gem/credentials
90
+ - run:
91
+ name: Release Gem
92
+ command: |
93
+ git push --set-upstream origin ${CIRCLE_BRANCH}
94
+ bundle exec rake release --trace
95
+ setup:
96
+ description: Setup for Job Working
97
+ parameters:
98
+ <<: *ruby_version
99
+ steps:
100
+ - checkout
101
+ - run:
102
+ name: Install Bundler 2.x
103
+ command: gem install bundler:2.1.4
104
+ - ruby-orbs/bundle-install:
105
+ cache_key_prefix: v1-dependencies-<< parameters.ruby_version >>
106
+ test_and_build:
107
+ description: Build the RubyGem
108
+ steps:
109
+ - code-climate/install
110
+ - run_rspec
111
+ - rake_build
112
+
113
+ jobs:
114
+ build:
115
+ parameters:
116
+ <<: *ruby_version
117
+ executor:
118
+ name: default
119
+ ruby_version: << parameters.ruby_version >>
120
+ steps:
121
+ - setup:
122
+ ruby_version: << parameters.ruby_version >>
123
+ - test_and_build
124
+ upload-coverage:
125
+ executor: default
126
+ steps:
127
+ - attach_workspace:
128
+ at: ~/repo
129
+ - code-climate/install
130
+ - code-climate/sum-coverage:
131
+ input: codeclimate.*.json
132
+ parts: 3
133
+ - code-climate/upload-coverage
134
+ rubocop:
135
+ executor: default
136
+ steps:
137
+ - setup
138
+ - rubocop
139
+ yardoc:
140
+ executor: default
141
+ steps:
142
+ - setup
143
+ - yardoc
144
+ rubocop_challenge:
145
+ executor: default
146
+ steps:
147
+ - checkout
148
+ - rubocop_challenge
149
+ release:
150
+ executor: default
151
+ steps:
152
+ - setup
153
+ - release
154
+
155
+ workflows:
156
+ version: 2
157
+
158
+ commit:
159
+ jobs:
160
+ - build:
161
+ name: build_on_ruby_2.6
162
+ ruby_version: '2.6'
163
+ - build:
164
+ name: build_on_ruby_2.7
165
+ ruby_version: '2.7'
166
+ - build:
167
+ name: build_on_ruby_3.0
168
+ ruby_version: '3.0'
169
+ - rubocop
170
+ - yardoc
171
+ - upload-coverage:
172
+ requires:
173
+ - build_on_ruby_2.6
174
+ - build_on_ruby_2.7
175
+ - build_on_ruby_3.0
176
+ - release:
177
+ context: RubyGems API Key
178
+ requires:
179
+ - build_on_ruby_2.6
180
+ - build_on_ruby_2.7
181
+ - build_on_ruby_3.0
182
+ - rubocop
183
+ filters:
184
+ branches:
185
+ only:
186
+ - release
187
+
188
+ challenge:
189
+ triggers:
190
+ - schedule:
191
+ cron: "30 23 * * *" # 8:30am every day (JST)
192
+ filters:
193
+ branches:
194
+ only:
195
+ - master
196
+ jobs:
197
+ - rubocop_challenge
198
+
199
+ experimental:
200
+ notify:
201
+ branches:
202
+ only:
203
+ - master
204
+ - release
data/.gem_comet.yml ADDED
@@ -0,0 +1,24 @@
1
+ # [Usage]
2
+ #
3
+ # $ gem install gem_comet
4
+ # $ gem_comet init
5
+ # $ gem_comet release {version number, like as "1.2.3"}
6
+ # $ gem_comet changelog
7
+ # $ gem_comet versions
8
+
9
+ version: 1.2
10
+
11
+ release:
12
+ base_branch: master
13
+ release_branch: release
14
+ version_file_path: lib/redis/objects/daily-counter/version.rb
15
+ changelog_file_path: CHANGELOG.md # optional
16
+ changelog:
17
+ categories:
18
+ - Feature
19
+ - Bugfix
20
+ - Security
21
+ - Breaking Change
22
+ - Rubocop Challenge
23
+ - Dependabot
24
+ - Misc
data/.gitignore ADDED
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,39 @@
1
+ inherit_from: .rubocop_todo.yml
2
+
3
+ require:
4
+ - rubocop-performance
5
+ - rubocop-rspec
6
+
7
+ AllCops:
8
+ TargetRubyVersion: 2.6
9
+ NewCops: enable
10
+
11
+ Layout/LineLength:
12
+ Max: 100
13
+
14
+ Metrics/BlockLength:
15
+ Exclude:
16
+ - 'spec/**/*'
17
+ - 'redis-objects-daily-counter.gemspec'
18
+
19
+ Metrics/MethodLength:
20
+ Max: 15
21
+
22
+ Naming/FileName:
23
+ Exclude:
24
+ - 'lib/redis-objects-daily-counter.rb'
25
+
26
+ Style/TrailingCommaInArrayLiteral:
27
+ EnforcedStyleForMultiline: comma
28
+
29
+ Style/TrailingCommaInHashLiteral:
30
+ EnforcedStyleForMultiline: comma
31
+
32
+ RSpec/ExampleLength:
33
+ Max: 10
34
+
35
+ RSpec/NestedGroups:
36
+ Max: 5
37
+
38
+ RSpec/MultipleExpectations:
39
+ Max: 4
data/.rubocop_todo.yml ADDED
@@ -0,0 +1,32 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2021-09-19 14:21:58 UTC using RuboCop version 0.93.1.
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: 6
10
+ # Configuration parameters: IgnoredMethods.
11
+ Metrics/AbcSize:
12
+ Max: 21
13
+
14
+ # Offense count: 21
15
+ Style/Documentation:
16
+ Exclude:
17
+ - 'spec/**/*'
18
+ - 'test/**/*'
19
+ - 'lib/redis-objects-daily-counter.rb'
20
+ - 'lib/redis/annual_counter.rb'
21
+ - 'lib/redis/base_counter_object.rb'
22
+ - 'lib/redis/daily_counter.rb'
23
+ - 'lib/redis/hourly_counter.rb'
24
+ - 'lib/redis/minutely_counter.rb'
25
+ - 'lib/redis/monthly_counter.rb'
26
+ - 'lib/redis/objects/annual_counters.rb'
27
+ - 'lib/redis/objects/daily_counters.rb'
28
+ - 'lib/redis/objects/hourly_counters.rb'
29
+ - 'lib/redis/objects/minutely_counters.rb'
30
+ - 'lib/redis/objects/monthly_counters.rb'
31
+ - 'lib/redis/objects/weekly_counters.rb'
32
+ - 'lib/redis/weekly_counter.rb'
data/CHANGELOG.md ADDED
@@ -0,0 +1,21 @@
1
+ # Change log
2
+
3
+ ## v0.2.0 (Sep 20, 2021)
4
+
5
+ ### Feature
6
+
7
+ * [#3](https://github.com/ryz310/redis-objects-daily-counter/pull/3) Support time zone ([@ryz310](https://github.com/ryz310))
8
+ * [#4](https://github.com/ryz310/redis-objects-daily-counter/pull/4) Add daily counter family ([@ryz310](https://github.com/ryz310))
9
+ * `annual_counter`
10
+ * `monthly_counter`
11
+ * `weekly_counter`
12
+ * `hourly_counter`
13
+ * `minutely_counter`
14
+
15
+ ### Misc
16
+
17
+ * [#2](https://github.com/ryz310/redis-objects-daily-counter/pull/2) Install circle ci ([@ryz310](https://github.com/ryz310))
18
+
19
+ ## v0.1.0 (Sep 12, 2021)
20
+
21
+ * The first release :tada:
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at ryz310@gmail.com. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Dockerfile ADDED
@@ -0,0 +1,7 @@
1
+ FROM ruby:2.6
2
+
3
+ RUN mkdir /my_app
4
+ WORKDIR /my_app
5
+ COPY . /my_app
6
+
7
+ RUN gem install bundler && bundle
data/Gemfile ADDED
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ # Specify your gem's dependencies in redis-objects-daily-counter.gemspec
6
+ gemspec
7
+
8
+ gem 'bundler', '>= 2.0'
9
+ gem 'pry-byebug'
10
+ gem 'rake', '~> 13.0'
11
+ gem 'rspec', '~> 3.0'
12
+ gem 'rspec_junit_formatter'
13
+ gem 'rubocop', '~> 0.80'
14
+ gem 'rubocop-performance'
15
+ gem 'rubocop-rspec'
16
+ gem 'simplecov', '0.21.2'
17
+ gem 'timecop'
18
+ gem 'yard'
data/Gemfile.lock ADDED
@@ -0,0 +1,95 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ redis-objects-daily-counter (0.2.0)
5
+ redis-objects
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ ast (2.4.2)
11
+ byebug (11.1.3)
12
+ coderay (1.1.3)
13
+ diff-lcs (1.4.4)
14
+ docile (1.4.0)
15
+ method_source (1.0.0)
16
+ parallel (1.21.0)
17
+ parser (3.0.2.0)
18
+ ast (~> 2.4.1)
19
+ pry (0.13.1)
20
+ coderay (~> 1.1)
21
+ method_source (~> 1.0)
22
+ pry-byebug (3.9.0)
23
+ byebug (~> 11.0)
24
+ pry (~> 0.13.0)
25
+ rainbow (3.0.0)
26
+ rake (13.0.6)
27
+ redis (4.4.0)
28
+ redis-objects (1.5.1)
29
+ redis (~> 4.2)
30
+ regexp_parser (2.1.1)
31
+ rexml (3.2.5)
32
+ rspec (3.10.0)
33
+ rspec-core (~> 3.10.0)
34
+ rspec-expectations (~> 3.10.0)
35
+ rspec-mocks (~> 3.10.0)
36
+ rspec-core (3.10.1)
37
+ rspec-support (~> 3.10.0)
38
+ rspec-expectations (3.10.1)
39
+ diff-lcs (>= 1.2.0, < 2.0)
40
+ rspec-support (~> 3.10.0)
41
+ rspec-mocks (3.10.2)
42
+ diff-lcs (>= 1.2.0, < 2.0)
43
+ rspec-support (~> 3.10.0)
44
+ rspec-support (3.10.2)
45
+ rspec_junit_formatter (0.4.1)
46
+ rspec-core (>= 2, < 4, != 2.12.0)
47
+ rubocop (0.93.1)
48
+ parallel (~> 1.10)
49
+ parser (>= 2.7.1.5)
50
+ rainbow (>= 2.2.2, < 4.0)
51
+ regexp_parser (>= 1.8)
52
+ rexml
53
+ rubocop-ast (>= 0.6.0)
54
+ ruby-progressbar (~> 1.7)
55
+ unicode-display_width (>= 1.4.0, < 2.0)
56
+ rubocop-ast (1.11.0)
57
+ parser (>= 3.0.1.1)
58
+ rubocop-performance (1.10.2)
59
+ rubocop (>= 0.90.0, < 2.0)
60
+ rubocop-ast (>= 0.4.0)
61
+ rubocop-rspec (1.44.1)
62
+ rubocop (~> 0.87)
63
+ rubocop-ast (>= 0.7.1)
64
+ ruby-progressbar (1.11.0)
65
+ simplecov (0.21.2)
66
+ docile (~> 1.1)
67
+ simplecov-html (~> 0.11)
68
+ simplecov_json_formatter (~> 0.1)
69
+ simplecov-html (0.12.3)
70
+ simplecov_json_formatter (0.1.3)
71
+ timecop (0.9.4)
72
+ unicode-display_width (1.8.0)
73
+ yard (0.9.26)
74
+
75
+ PLATFORMS
76
+ aarch64-linux
77
+ x86_64-darwin-19
78
+ x86_64-linux
79
+
80
+ DEPENDENCIES
81
+ bundler (>= 2.0)
82
+ pry-byebug
83
+ rake (~> 13.0)
84
+ redis-objects-daily-counter!
85
+ rspec (~> 3.0)
86
+ rspec_junit_formatter
87
+ rubocop (~> 0.80)
88
+ rubocop-performance
89
+ rubocop-rspec
90
+ simplecov (= 0.21.2)
91
+ timecop
92
+ yard
93
+
94
+ BUNDLED WITH
95
+ 2.2.27
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2021 Ryosuke Sato
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.