Skip to content

0.2.0#6

Merged
bnlucas merged 2 commits intomainfrom
0.2.0
May 1, 2025
Merged

0.2.0#6
bnlucas merged 2 commits intomainfrom
0.2.0

Conversation

@bnlucas
Copy link
Owner

@bnlucas bnlucas commented May 1, 2025

Changed

  • Replaced cattr and iattr with unified cattri DSL

    • All attributes now use cattri, with scope: :class or scope: :instance
    • iattr and cattr are no longer public API
  • Attribute behavior is now centralized via:

    • Cattri::Attribute and Cattri::AttributeOptions
    • Cattri::Context and ContextRegistry
    • Cattri::InternalStore for safe write-once value storage
  • Final attributes (final: true) now enforced at the store level, with safe write-once semantics

  • Visibility and exposure are fully separated:

    • visibility: :public|:protected|:private sets method scope
    • expose: :read_write|:read|:write|:none controls which methods are generated
  • New predicate handling via predicate: true, with visibility inheritance

Added

  • Support for scope: to explicitly declare attribute scope
  • InitializerPatch to apply default values for final instance attributes
  • memoize_default_value helper to simplify accessor generation
  • 100% RSpec coverage and branch coverage
  • Steep RBS type signatures for public and internal API
  • Full introspection via .attributes, .attribute, .attribute_methods, .attribute_source

Removed

  • iattr, cattr, iattr_alias, cattr_alias, and setter helpers (*_setter)
  • Legacy inheritance hook logic and module-style patching

Notes

This release consolidates and simplifies the attribute system into a modern, safer, and more flexible DSL. All existing functionality is preserved through the cattri interface.

This version introduces breaking changes to the DSL. Migration guide available in the README.

@codecov
Copy link

codecov bot commented May 1, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (479470c) to head (6255d12).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main        #6   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            9        15    +6     
  Lines          343       363   +20     
  Branches        44        49    +5     
=========================================
+ Hits           343       363   +20     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bnlucas bnlucas merged commit 02c6642 into main May 1, 2025
4 checks passed
@bnlucas bnlucas deleted the 0.2.0 branch May 1, 2025 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant