Skip to content

Commit

Permalink
Update to latest rails main
Browse files Browse the repository at this point in the history
- Drop Rails 7.0 and 7.1 tests, add separate 7.2 tests
- Update behaviour tests from main
- Add instrumentation for increment and decrement
- Don't lock the gemfiles
  • Loading branch information
djmb committed Sep 2, 2024
1 parent b610333 commit d548600
Show file tree
Hide file tree
Showing 37 changed files with 271 additions and 2,056 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/.bundle/
/doc/
/gemfiles/*.gemfile.lock
/log/*.log
/pkg/
/tmp/
Expand Down
236 changes: 0 additions & 236 deletions gemfiles/rails_7_2.gemfile.lock

This file was deleted.

47 changes: 21 additions & 26 deletions gemfiles/rails_main.gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
GIT
remote: https://github.com/rails/rails.git
revision: abc4538300e8a2897f350611666d7e64021e6d16
revision: 8bac99ad7a403ef52a5c97e7afa73c7bbcc67110
branch: main
specs:
actionpack (8.0.0.alpha)
actionview (= 8.0.0.alpha)
activesupport (= 8.0.0.alpha)
nokogiri (>= 1.8.5)
racc
rack (>= 2.2.4)
rack-session (>= 1.0.1)
rack-test (>= 0.6.3)
Expand Down Expand Up @@ -86,11 +85,11 @@ GEM
reline (>= 0.4.2)
json (2.7.2)
language_server-protocol (3.17.0.3)
logger (1.6.0)
logger (1.6.1)
loofah (2.22.0)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
minitest (5.24.1)
minitest (5.25.1)
mocha (2.4.5)
ruby2_keywords (>= 0.0.5)
msgpack (1.7.2)
Expand All @@ -107,7 +106,7 @@ GEM
racc (~> 1.4)
nokogiri (1.16.7-x86_64-linux)
racc (~> 1.4)
parallel (1.26.2)
parallel (1.26.3)
parser (3.3.4.2)
ast (~> 2.4.1)
racc
Expand Down Expand Up @@ -137,35 +136,32 @@ GEM
regexp_parser (2.9.2)
reline (0.5.9)
io-console (~> 0.5)
rexml (3.3.5)
strscan
rubocop (1.65.1)
rubocop (1.66.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.4, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-ast (>= 1.32.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.32.0)
rubocop-ast (1.32.1)
parser (>= 3.3.1.0)
rubocop-md (1.2.2)
rubocop (>= 1.0)
rubocop-minitest (0.35.1)
rubocop-minitest (0.36.0)
rubocop (>= 1.61, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-packaging (0.5.2)
rubocop (>= 1.33, < 2.0)
rubocop-performance (1.21.1)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rails (2.25.1)
rubocop-rails (2.26.0)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0)
rubocop (>= 1.52.0, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
Expand All @@ -177,19 +173,18 @@ GEM
actionpack (>= 6.1)
activesupport (>= 6.1)
sprockets (>= 3.0.0)
sqlite3 (2.0.3-aarch64-linux-gnu)
sqlite3 (2.0.3-aarch64-linux-musl)
sqlite3 (2.0.3-arm-linux-gnu)
sqlite3 (2.0.3-arm-linux-musl)
sqlite3 (2.0.3-arm64-darwin)
sqlite3 (2.0.3-x86-linux-gnu)
sqlite3 (2.0.3-x86-linux-musl)
sqlite3 (2.0.3-x86_64-darwin)
sqlite3 (2.0.3-x86_64-linux-gnu)
sqlite3 (2.0.3-x86_64-linux-musl)
sqlite3 (2.0.4-aarch64-linux-gnu)
sqlite3 (2.0.4-aarch64-linux-musl)
sqlite3 (2.0.4-arm-linux-gnu)
sqlite3 (2.0.4-arm-linux-musl)
sqlite3 (2.0.4-arm64-darwin)
sqlite3 (2.0.4-x86-linux-gnu)
sqlite3 (2.0.4-x86-linux-musl)
sqlite3 (2.0.4-x86_64-darwin)
sqlite3 (2.0.4-x86_64-linux-gnu)
sqlite3 (2.0.4-x86_64-linux-musl)
stringio (3.1.1)
strscan (3.1.0)
thor (1.3.1)
thor (1.3.2)
timeout (0.4.1)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
Expand Down
14 changes: 12 additions & 2 deletions lib/solid_cache/store/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,21 @@ def initialize(options = {})
end

def increment(name, amount = 1, options = nil)
adjust(name, amount, options)
options = merged_options(options)
key = normalize_key(name, options)

instrument :increment, key, amount: amount do
adjust(name, amount, options)
end
end

def decrement(name, amount = 1, options = nil)
adjust(name, -amount, options)
options = merged_options(options)
key = normalize_key(name, options)

instrument :decrement, key, amount: amount do
adjust(name, -amount, options)
end
end

def cleanup(options = nil)
Expand Down
Loading

0 comments on commit d548600

Please sign in to comment.