Skip to content
CAI
Software that uses CAICheck a score

ankane/pretender

66.6

Adequate · 19 September 2026

71

lines of production code

Ruby

primary language

1

measurement over time

CAI band scale
CAI lens gauges

What this system is

This system is a Ruby gem that enables user impersonation within Rails applications, allowing administrators to act as other users. It provides core logic for switching identities and stopping impersonation, with specific support for Action Cable and Mongoid. The library includes comprehensive test coverage and maintains compatibility with modern Rails and Ruby versions.

Behavioural changes

Refactored impersonation logic for robustness and Action Cable support

The core impersonation mechanism has been rewritten to improve security and compatibility. The library now explicitly checks if the user is logged in before attempting to restore an impersonation session, stopping impersonation if the true user is not authenticated. It also handles Mongoid compatibility by converting resource IDs to strings when necessary. Additionally, the loading pattern has been updated to use ActiveSupport hooks, ensuring the methods are available in both Action Controller and Action Cable contexts.

lib · high confidence

Test coverage

Added integration tests for the impersonation feature; Added test fixtures for user impersonation.

Dependencies

Added CI gemfiles for Rails 7.2 and 8.0 testing

New gemfiles (rails72.gemfile and rails80.gemfile) have been added to the gemfiles directory to enable testing against Rails versions 7.2.0 and 8.0.0 respectively. These files configure the necessary dependencies, including the gemspec, rake, minitest, combustion, sqlite3, and the specific Rails version constraints, allowing the CI pipeline to validate compatibility with these releases.

gemfiles · high confidence

Updated gemspec and Gemfile for Rails 8.1 and Ruby 3.3 compatibility

The gemspec and Gemfile have been updated to require Ruby 3.3+ and ActionPack 7.2+, with the Gemfile now explicitly pinning Rails 8.1.0 for development and testing. Development dependencies like rake, minitest, and combustion have been moved into the Gemfile, and the gemspec has been cleaned up to use require\_relative and specify files more precisely.

(dependencies) · high confidence

Housekeeping

Pretender library version updated to 1.0.0

The Pretender library's version constant has been updated from 0.0.1 to 1.0.0. This change reflects the current release version of the library but does not indicate any specific functional changes, new features, or behavioral modifications within the provided code diff.

lib/pretender · 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 67.

Lenses

  • Code Health 96
  • Architecture 69
  • Maturity 57
  • Readiness 70
  • Security 100

Changes since last survey

  • 164 commits — 151 feature/other, 13 fixes

By area

  • (root) — 104 commits
  • lib/pretender.rb — 24 commits
  • .github/workflows — 12 commits
  • (repo) — 7 commits
  • lib/pretender — 6 commits
  • test/internal — 5 commits
  • test/pretender_test.rb — 2 commits
  • test/test_helper.rb — 2 commits
  • gemfiles/rails71.gemfile — 1 commit
  • test/gemfiles — 1 commit

Notable commits

  • fix: Added support for Rails API - fixes #12 and fixes #13
  • fix: Always delegate to true_method when impersonation not set - fixes #34
  • fix: Fixed compatibility with Clearance - fixes #17
  • fix: Fixed error with Action Cable and eager loading - #39
  • fix: Fixed extension
  • fix: Fixed gemspec
  • fix: Fixed long code lines in readme
  • fix: Fixed stack level too deep error - #19
  • fix: Fixed test
  • fix: Fixed undefined method and nil out impersonation instead of raise security error - closes #2
  • fix: Fixed warnings
  • fix: Revert "Use Railtie for better loading pattern"
  • fix: Revert "Use request.session everywhere [skip ci]"
  • change: "[skip ci]" is supported by GitHub Actions (#53)
  • change: Add only necessary methods to controller
  • change: Add tests
  • change: Added Rails 7.1 to CI
  • change: Added Ruby 3.2 to CI
  • change: Added Travis
  • change: Added better error - closes #7
  • …and 144 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

ankane/pretender 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 8cc0f37ed7acbf0f5fe69130ae27471f0b559db4 — 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.