Skip to content

Commit 9089c6e

Browse files
committed
📚 Fix documentation accuracy and repository references
- Clarify that gem supports Ruby 2.7+ through multiple implementations - Document three modes: safe (default), native C extension, Ruby fallback - Switch from Code Climate to qlty badges and links - Fix incorrect GitHub repository references (active_record-framing → thaw) - Correct typos in installation section - Add comprehensive warnings about dangers of all implementations - Emphasize Object#dup as the strongly recommended alternative
1 parent 900fccb commit 9089c6e

1 file changed

Lines changed: 38 additions & 8 deletions

File tree

README.md

Lines changed: 38 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
[![Version ](https://img.shields.io/gem/v/thaw.svg)](https://rubygems.org/gems/thaw)
2-
[![Build Status ](https://travis-ci.org/TwilightCoders/thaw.svg)](https://travis-ci.org/TwilightCoders/thaw)
3-
[![Dependencies ](https://img.shields.io/librariesio/github/twilightcoders/thaw)](https://github.com/TwilightCoders/thaw/network/dependencies)
4-
[![Test Coverage](https://api.codeclimate.com/v1/badges/606df1b8c3c69772a11d/test_coverage)](https://codeclimate.com/github/TwilightCoders/thaw/test_coverage)
5-
[![Code Climate ](https://api.codeclimate.com/v1/badges/606df1b8c3c69772a11d/maintainability)](https://codeclimate.com/github/TwilightCoders/thaw/maintainability)
1+
[![Gem Version](https://badge.fury.io/rb/thaw.svg)](https://badge.fury.io/rb/thaw)
2+
[![CI](https://github.com/TwilightCoders/thaw/actions/workflows/ci.yml/badge.svg)](https://github.com/TwilightCoders/thaw/actions/workflows/ci.yml)
3+
[![Maintainability](https://qlty.sh/badges/8dcc3d6f-7bae-4b03-bd4a-aba0103be001/maintainability.svg)](https://qlty.sh/TwilightCoders/thaw)
4+
[![Test Coverage](https://qlty.sh/badges/8dcc3d6f-7bae-4b03-bd4a-aba0103be001/test_coverage.svg)](https://qlty.sh/gh/TwilightCoders/projects/thaw/metrics/code?sort=coverageRating)
5+
![GitHub License](https://img.shields.io/github/license/twilightcoders/thaw)
66

77
## Thaw
88

@@ -12,11 +12,41 @@ Note: You probably don't need to use this gem, you probably want to [`.dup`](htt
1212

1313
### Compatibility
1414

15-
To-date, `thaw` works in Ruby `2.0` through `2.6`<sup>1</sup>.
15+
The gem **supports Ruby 2.7+ through multiple implementations** but with significant safety concerns:
1616

17-
Check the [build status](https://travis-ci.org/TwilightCoders/thaw) for the most current compatibility.
17+
- **Safe mode (default)**: Loads without dangerous functionality, shows warnings
18+
- **Native C extension**: Attempts to support modern Ruby but has compilation/stability issues
19+
- **Ruby fallback**: Original Fiddle-based implementation (crashes on Ruby 2.7+)
1820

19-
<sup>1</sup>There seems to be a segmentation fault in Ruby `2.7` that I haven't had time to investigate.
21+
**⚠️ IMPORTANT:** All implementations are **extremely dangerous** and may cause crashes, memory corruption, or undefined behavior.
22+
23+
**Strong Recommendation:** Use [`Object#dup`](https://www.rubyguides.com/2018/11/dup-vs-clone/) instead of trying to unfreeze objects.
24+
25+
### Native C Extension (Experimental)
26+
27+
For users who absolutely need this functionality despite the risks, a **native C extension** is available:
28+
29+
```bash
30+
THAW_BUILD_NATIVE=true gem install thaw
31+
```
32+
33+
**⚠️ EXTREME WARNING:** The native extension:
34+
- Manipulates Ruby's internal object representation directly
35+
- **Will likely cause segmentation faults** on modern Ruby versions
36+
- Has platform-specific compilation issues
37+
- May not compile on all systems
38+
- Goes against Ruby's fundamental design principles
39+
40+
### Fallback Ruby Implementation
41+
42+
For legacy support or testing purposes, you can force loading the original Ruby implementation with `ENV['THAW_FORCE_LOAD'] = 'true'`, but this is **strongly discouraged** as it will crash your Ruby process.
43+
44+
### Current Status
45+
46+
The gem is maintained for:
47+
- Historical compatibility and documentation
48+
- Clear deprecation warnings to guide users toward better alternatives
49+
- Demonstration of the risks involved in low-level object manipulation
2050

2151
### Installation
2252

0 commit comments

Comments
 (0)