Releases: rubyworks/facets
3.2.2 — Cross-version CI fixes
Patch release with cross-version fixes surfaced by full-matrix CI — Ruby 3.1, 3.2, 3.3, 3.4, head, jruby, and truffleruby are all green.
Bug Fixes
Range.intersectionon Ruby 3.1/3.2. It usedRange#overlap?, which only exists in Ruby 3.3+; replaced with an explicit, version-independent overlap test that works for any comparable element type.- Restore
Range#overlap?for Ruby < 3.3. Dropped in 3.2.0 (Ruby 3.3 added a native one), which left 3.1/3.2 users without it. Now defined only when missing, so it never replaces the built-in on 3.3+. Binding#caller/#caller_locationsarity. Widened to accept the optionallengthargument (matchingKernel), fixing anArgumentErrorwhenwarn(uplevel:)dispatched to them under JRuby's pure-Rubywarn.
Internal
- Declare
ostructas a test dependency — it's no longer a default gem as of Ruby 3.5. Facets' OpenStruct extensions still work but now need theostructgem on 3.5+, and may be divested from Facets in a future release.
Full Changelog: 3.2.1...3.2.2
3.2.1 — Critical load fix
This is a critical fix release. If you are on 3.2.0, please upgrade.
3.2.0 shipped with stale require_relative lines pointing at method files that had been removed or renamed during the modernization, so require 'facets' raised LoadError and the gem could not be loaded at all. 3.2.1 restores loadability. Since 3.2.0 can't be loaded, 3.2.1 effectively supersedes it for anyone on ~> 3.2.
Bug Fixes
- Fix
LoadErroronrequire 'facets'. Removed the stalerequire_relativelines left pointing at removed method files (those methods are now provided natively by modern Ruby), and corrected thehash/to_proc→hash/setterrequire after that rename. All 17 broken references across the library were found and fixed. (#312, #315; thanks @lgatellier for #313, @nerdrew for #318) - Stop
Kernel::Asfrom redefiningobject_id, which printed a "redefining 'object_id' may cause serious problems" warning on every load. (#310, thanks @s2k) - Added a regression test (
test/core/load_paths_tc.rb) that statically verifies everyrequire_relativetarget resolves, so this class of breakage can't recur unnoticed.
New Modules
OpenDSL— build free-form, pluggable DSL modules from a block (require 'facets/opendsl').PIC— COBOL-style edited-picture pattern matching as a simple alternative to regular expressions (require 'facets/pic').
Upgrade Notes
- Requires Ruby 3.1+.
- If you used Facets' old
Hash#to_proc(which assigned a hash's key/value pairs as attributes on an object), it has moved toHash#setter— Facets no longer overridesHash#to_proc, since that conflicted with Ruby's own (key-lookup) version. Its option also changed fromresponse:tosafe:.
Note on versioning: the 3.2.x modernization carries breaking changes (removed/renamed methods, the Ruby 3.1+ requirement) that arguably warranted a major bump (#314). Rather than rewrite released history, that's being left for a proper 4.0.0; 3.2.1 exists to make the published 3.2 line installable again.
Full Changelog: 3.2.0...3.2.1
3.2.0 — First release in 10 years (superseded)
Superseded by 3.2.1 — please use that instead.
This was the first release in 10 years, a broad modernization of Facets for Ruby 3.1+. Unfortunately it shipped with a packaging bug: stale require_relative lines pointed at method files that had been removed or renamed, so require 'facets' raised LoadError and the gem could not be loaded. That is fixed in 3.2.1.
See HISTORY.md for the full list of changes in the 3.2.x modernization.