bin/setup # bundle install (+ any local setup)
bin/console # IRB with the gem loadedRequirements: Ruby >= 2.7 (CI tests 2.7–3.2), Bundler. The test suite needs no external services (sqlite3 in-repo dummy app).
bundle exec rake # DEFAULT task = rspec + rubocop; the pre-push check
bundle exec rake rspec # tests only
bundle exec rubocop # lint only (or: bundle exec rubocop -a for safe autocorrect)
bundle exec rubocop --config .rubocop.yml --parallel # exactly what CI runsStyle highlights (.rubocop.yml): target Ruby 2.7, single quotes, 120-char lines, Style/Documentation off, method/ABC limits at 30. The codebase currently has no rubocop:disable comments — prefer refactoring (extracted helpers, constants) over adding them.
- Every Ruby file starts with
# frozen_string_literal: true. - Library code resolves the token model and controller through
Devise.api.config— see the invariants in architecture.md. - User-facing strings live in
config/locales/en.ymlonly (keys underdevise.api.error_response). The install generator copies this file into host apps asdevise_api.en.yml— additions are picked up by new installs automatically, but existing apps keep their copied version. - Commit style in history: conventional-commit-ish prefixes (
feat:,fix:,docs:) with PR number suffix, e.g.fix: nil memoization (#48).
- Version constant:
lib/devise/api/version.rb(currently0.2.0). SemVer intent; still pre-1.0 so minor bumps may break. CHANGELOG.mdexists but has not been maintained past the initial release — update it as part of any release work.- Release flow (maintainer): bump
version.rb→ update CHANGELOG →bundle exec rake release(tags, pushes, publishes to rubygems.org). Gem files aregit ls-filesminusbin|test|spec|features(see gemspec) — nothing inspec/dummyships.
Two workflows on every push, matrix over Ruby 3.2 / 3.3 / 3.4 / 4.0 (the development Gemfile.lock resolves to Rails 8.x, which needs Ruby >= 3.2; the gemspec still allows Ruby >= 2.7 for host apps):
test.yml—bundle install+bundle exec rake rspecrubocop.yml—bundle exec rubocop --config .rubocop.yml --parallel
SimpleCov coverage runs with the suite (95% line minimum enforced on full-suite runs — see testing.md). No scheduled builds, no release automation.
| Change | Touch points |
|---|---|
| New endpoint action | rails/routes.rb, Devise.add_module route list in lib/devise/api.rb, controller, service, TokenResponse::ACTIONS, request specs, api-reference.md |
| New error type | service, ErrorResponse::ERROR_TYPES + #status mapping, config/locales/en.yml, specs, api-reference.md |
| New config setting | configuration.rb, use site(s), configuration_spec.rb, README config block, configuration.md |
| Schema change | generator template, dummy migrations + schema, Token model, upgrade migration guidance, data-model.md |