rails/kredis
60.9
Adequate · 19 September 2026
1k
lines of production code
Ruby
primary language
1
measurement over time
What this system is
Kredis is a Ruby library that provides typed, high-level Redis data structures and integrates them seamlessly with Active Model and Active Record models. It allows developers to define Redis-backed attributes with automatic serialization, type casting, and support for various data types such as counters, lists, sets, and JSON. The system includes features for managing key migrations, logging, and configuration, ensuring compatibility with both Rails and standalone Ruby applications.
Features
Add kredis installation task with REDIS\_URL support
Users can now run the \kredis:install\ rake task to automatically generate a \config/redis/shared.yml\ file. This configuration file sets up Redis connection details for production, development, and test environments, defaulting to the \REDIS\_URL\ environment variable (falling back to \redis://127.0.0.1:6379/0\) and including a 1-second timeout. The generated file also provides commented-out examples for specifying host, port, and database separately.
lib/install · high confidence
Initial release of Kredis with typed Redis data structures and model integration
Introduces Kredis, a library that encapsulates higher-level Redis data structures (such as strings, integers, lists, sets, hashes, counters, enums, flags, slots, and limiters) into typed, coherent objects. Users can now interact with Redis keys as native Ruby types with automatic serialization and deserialization, and declaratively define these structures as attributes within Active Model and Active Record models using a DSL. The release also includes comprehensive documentation with usage examples for all supported types.
(repo-wide) · high confidence
New development, testing, and release scripts
Added four new executable scripts to the bin directory to streamline the development workflow and release process. The new bin/console script provides an interactive IRB environment with the debug gem and a mock Kredis configurator for easier local debugging. bin/test sets up the test runner using Rails plugin test infrastructure. bin/release automates the version bumping, tagging, and gem publishing workflow to RubyGems. Additionally, bin/rubocop was added as a binstub to ensure consistent code style checking.
bin · high confidence
Behavioural changes
Improved non-Rails compatibility and added configuration/logging capabilities
Kredis now works outside of Rails by explicitly requiring ActiveSupport core extensions and conditionally loading the Railtie only when Rails is present. The library exposes a \Kredis.logger\ attribute for configuration and provides a \Kredis.redis\ method to access the underlying Redis connection. Additionally, it introduces \Kredis.instrument\ for logging via ActiveSupport Notifications and autoloads the Migration class, while also including TypeCasting functionality.
lib · high confidence
Kredis 1.8.0: Major API overhaul with typed attributes, migration DSL, and logging
This release introduces a comprehensive behavioral change to the Kredis API, replacing the previous \redis\\\ attribute methods (e.g., \redis\list\) with a new set of \kredis\\*\ methods (e.g., \kredis\_list\, \kredis\_string\, \kredis\_counter\) that support explicit type casting, default values, expiration, and custom keys. A new migration DSL (\Kredis::Migration\) is added to allow copying keys between namespaces and deleting old keys, utilizing Redis SCAN to avoid locking. The library now includes a \LogSubscriber\ for structured logging of proxy and migration events, and connection handling is refactored to support custom connectors and global namespacing. The \Kredis::Proxy\ class is removed in favor of specific type implementations, and the version is bumped to 1.8.0.
lib/kredis · high confidence
New type handlers for Boolean, DateTime, and JSON storage
This change introduces dedicated type handlers in lib/kredis/type to manage how data is serialized and deserialized when stored in Redis. The new Boolean handler stores values as 1 or 0 for efficiency. The DateTime handler now serializes times to UTC ISO8601 strings and casts them back to Time objects, ensuring consistent timezone handling. A new Json handler allows storing and retrieving arbitrary JSON structures by parsing and dumping them during read/write operations.
lib/kredis/type · high confidence
Redesigned Redis types with unified proxying, callbacks, and new collection types
The \lib/kredis/types\ module has been refactored to use a new \Kredis::Types::Proxying\ base class and a \CallbacksProxy\ mechanism, enabling automatic \after\_change\ callbacks for operations like \increment\, \mark\, or \append\ across all types. This change introduces several new data structures: a \Cycle\ type for rotating through values, an \Enum\ type with dynamic predicate methods (e.g., \active?\), a \Limiter\ type for rate-limiting with fail-safe behavior, and an \OrderedSet\ type that maintains insertion order using sorted sets. Existing types like \Counter\, \List\, \Hash\, \Set\, and \Flag\ have been updated to support type casting (\typed\ option), default values, and clearer Ruby-native APIs (e.g., \\[\]=\ for Hash, \\<\<\ for List/Set). The legacy \Mutex\ type has been removed, and the \Slots\ type now uses atomic operations for reservation. Users benefit from more consistent, idiomatic Ruby interfaces and the ability to hook into state changes across all collections.
lib/kredis/types · high confidence
Test coverage
Added test coverage for Kredis typed collections; Comprehensive test suite for Kredis attributes, callbacks, and migrations.
Dependencies
Upgrade to Rails 8 and modernize dependencies
The library now requires Ruby 2.7+ and upgrades its runtime dependencies to support Rails 8.0.2, replacing the broad 'rails' dependency with specific 'activesupport' and 'activemodel' requirements. Redis support has been expanded to versions 4.2 through 5.x, and development dependencies have been updated, notably replacing 'byebug' with the 'debug' gem and adding 'rubocop-rails-omakase' for code style enforcement.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Baseline
- First survey — no prior run to compare against. CAI 61.
Lenses
- Code Health 100
- Architecture 69
- Maturity 49
- Readiness 67
- Security 78
Changes since last survey
- 300 commits — 281 feature/other, 19 fixes
By area
- lib/kredis — 152 commits
- (root) — 69 commits
- (repo) — 42 commits
- .github/workflows — 7 commits
- test/types — 6 commits
- lib/kredis.rb — 4 commits
- test/test_helper.rb — 4 commits
- test/callbacks_test.rb — 3 commits
- test/log_subscriber_test.rb — 3 commits
- bin/console — 2 commits
- bin/release — 2 commits
- .github/dependabot.yml — 1 commit
- lib/install — 1 commit
- test/attributes_callbacks_test.rb — 1 commit
- test/attributes_test.rb — 1 commit
- test/connections_test.rb — 1 commit
- test/migration_test.rb — 1 commit
Notable commits
- fix: Audit callbacks proxy mutators and regression tests
- fix: Fix Redis client language seeping into Ruby API-land
- fix: Fix examples in README
- fix: Fix missed [] example in README
- fix: Fix ordered set prepend bug (#115)
- fix: Fix possible deserialization of untrusted data
- fix: Fix test assertion style
- fix: Fix typed Hash example in README
- fix: Merge branch 'fix-unexpected-deserialization'
- fix: Merge pull request #10 from SashkaSh/Fix-some-words-in-README
- fix: Merge pull request #56 from excid3/fix-unique-list-with-limit
- fix: Revert "Improved version of UniqueList: OrderedSet (#76)" (#111)
- fix: Revert "Otherwise we fail in production"
- fix: Revert "Trial out a common trimming abstraction"
- fix: Revert "Trial out a general purpose value type to base other's off of"
- fix: Revert "Use block parameter to pipeline in Redis#multi (#68)"
- fix: add more redis commands to the readme. Fix some incorrect commands
- fix: fix after_change callback for unique_list (#65)
- fix: gemspec: fix ruby version requirement
- change: A config example
- …and 280 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
rails/kredis was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 19 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit a6643a0b4cfa6512159d0a98638ba20401da917d — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-b51f968c9b10.