tally 2.0.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2326dfbbdcb9474f788b14370829771c27cf8945d9a2c4c07208ef78a157bcfa
4
- data.tar.gz: 852b21044a153ba21c0eb3f48f282a3157a55f4e535fed2006ea80652263f7b2
3
+ metadata.gz: a1c7ca6dc7f3a11bd24936a64edb11c8b18a21ef0788b09598a45a5eb746237d
4
+ data.tar.gz: 112af234512f74e6e284ed8f210084c586bc7eb3b36a7f1c1c12a9d21f373403
5
5
  SHA512:
6
- metadata.gz: 16d1b206ded32742d3fc04973bb52fc066ba2618ee70a692e3b73322b0950957b34534bd9b3e6c5bfc555de5149ca9f61455265ed91d254962077ba0c689a20f
7
- data.tar.gz: 5610ac5ba2038971c7aa9e3fb6694971a7cea354939c0a6c65e94515ca6757cc22f4e00a3c095671bf39321d40f6fd9471906a714077e44695be308eb9ac557c
6
+ metadata.gz: 61eb9b0fc574bfcbc23585cdef758bde1b9f9e57afcff608b7b99131ce6b847dedd051d7d358fcc22287547a473da4f75ad3b1e4ece5951ad23dcbc58e253e7e
7
+ data.tar.gz: 455f9248a7f3427ef635209b806e7b69a17dace683821621b47bcd0608f3efa9d4257575c86fcb9bfad2517d768a7cd47b80c0f6312b25fe1c156f54088130f5
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Tally
2
2
 
3
- [![CircleCI](https://circleci.com/gh/jdtornow/tally.svg?style=svg)](https://circleci.com/gh/jdtornow/tally)
3
+ [![Tests](https://github.com/jdtornow/tally/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/jdtornow/tally/actions/workflows/tests.yml)
4
4
 
5
5
  Tally is a simple Rails engine for capturing counts of various activities around an app. These counts are quickly captured in Redis then are archived periodically within the app's default relational database.
6
6
 
@@ -12,8 +12,8 @@ _[Read more about Tally in my blog post introducing it ...](https://johntornow.c
12
12
 
13
13
  ## Requirements
14
14
 
15
- * Ruby 3.0.3+
16
- * Rails 6.1+
15
+ * Ruby 3.2+
16
+ * Rails 7+
17
17
  * Redis 4+
18
18
 
19
19
  ## Installation
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Tally
4
+ class ArchiverJob < ApplicationJob
5
+
6
+ def perform(day = "today")
7
+ case day.to_s
8
+ when /^\d{4}-\d{2}-\d{2}$/
9
+ Tally::Archiver.archive! day: Date.parse(day)
10
+ when "yesterday"
11
+ Tally::Archiver.archive! day: 1.day.ago.to_date
12
+ else
13
+ Tally::Archiver.archive!
14
+ end
15
+ end
16
+
17
+ end
18
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Tally
4
+ class SweeperJob < ApplicationJob
5
+
6
+ def perform
7
+ Tally::Sweeper.sweep!
8
+ end
9
+
10
+ end
11
+ end
data/lib/tally/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Tally
2
2
 
3
- VERSION = "2.0.0"
3
+ VERSION = "2.1.0"
4
4
 
5
5
  end
@@ -1,21 +1,21 @@
1
1
  namespace :tally do
2
2
  desc "Sweep all outdated keys from the data store"
3
- task :sweep => :environment do
4
- Tally::Sweeper.sweep!
3
+ task sweep: :environment do
4
+ Tally::SweeperJob.perform_now
5
5
 
6
6
  Rake::Task["tally:wait_for_async_queue"].execute
7
7
  end
8
8
 
9
9
  desc "Archive today's temporary keys into record entries in the database"
10
- task :archive => :environment do
11
- Tally::Archiver.archive!
10
+ task archive: :environment do
11
+ Tally::ArchiverJob.perform_now
12
12
 
13
13
  Rake::Task["tally:wait_for_async_queue"].execute
14
14
  end
15
15
 
16
16
  desc "Archive yesterday's temporary keys into record entries in the database"
17
- task "archive:yesterday" => :environment do
18
- Tally::Archiver.archive! day: 1.day.ago
17
+ task "archive:yesterday": :environment do
18
+ Tally::ArchiverJob.perform_now("yesterday")
19
19
 
20
20
  Rake::Task["tally:wait_for_async_queue"].execute
21
21
  end
@@ -24,7 +24,7 @@ namespace :tally do
24
24
  #
25
25
  # This is not needed for other adapters besides async, but since it is the
26
26
  # Rails default, we're accounting for it here.
27
- task :wait_for_async_queue => :environment do
27
+ task wait_for_async_queue: :environment do
28
28
  if Rails.application.config.active_job.queue_adapter == :async
29
29
  ActiveJob::Base.queue_adapter.shutdown(wait: true)
30
30
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tally
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - John D. Tornow
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2022-12-19 00:00:00.000000000 Z
10
+ date: 2025-01-21 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: rails
@@ -19,7 +18,7 @@ dependencies:
19
18
  version: 5.2.0
20
19
  - - "<"
21
20
  - !ruby/object:Gem::Version
22
- version: '8'
21
+ version: '9'
23
22
  type: :runtime
24
23
  prerelease: false
25
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +28,7 @@ dependencies:
29
28
  version: 5.2.0
30
29
  - - "<"
31
30
  - !ruby/object:Gem::Version
32
- version: '8'
31
+ version: '9'
33
32
  - !ruby/object:Gem::Dependency
34
33
  name: redis
35
34
  requirement: !ruby/object:Gem::Requirement
@@ -191,7 +190,9 @@ files:
191
190
  - app/helpers/tally/application_helper.rb
192
191
  - app/helpers/tally/increment_helper.rb
193
192
  - app/jobs/tally/application_job.rb
193
+ - app/jobs/tally/archiver_job.rb
194
194
  - app/jobs/tally/calculator_runner_job.rb
195
+ - app/jobs/tally/sweeper_job.rb
195
196
  - app/models/tally/application_record.rb
196
197
  - app/models/tally/record.rb
197
198
  - app/presenters/tally/record_presenter.rb
@@ -222,7 +223,6 @@ metadata:
222
223
  homepage_uri: https://github.com/jdtornow/tally
223
224
  source_code_uri: https://github.com/jdtornow/tally
224
225
  wiki_uri: https://github.com/jdtornow/tally/wiki
225
- post_install_message:
226
226
  rdoc_options: []
227
227
  require_paths:
228
228
  - lib
@@ -237,8 +237,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
237
237
  - !ruby/object:Gem::Version
238
238
  version: 1.8.11
239
239
  requirements: []
240
- rubygems_version: 3.3.26
241
- signing_key:
240
+ rubygems_version: 3.6.3
242
241
  specification_version: 4
243
242
  summary: Stats collection and reporting
244
243
  test_files: []