Skip to content

Modernize the project - #16

Merged
trans merged 3 commits into
masterfrom
modernize
Nov 17, 2026
Merged

trans merged 3 commits into
masterfrom
modernize

Conversation

@trans

@trans trans commented Nov 17, 2026

Copy link
Copy Markdown
Member

Radix's first changes since 2015. The library does what it did; this brings the project up to the Rubies and tooling in use today. No version bump: the changes are under Unreleased in HISTORY.md.

Tooling

  • A standard radix.gemspec, a Rakefile (rake runs the demos; Bundler's gem tasks, tagging plain version numbers as before) and GitHub Actions on Ruby 2.7 to 4.0, with a frozen-string-literal run on 4.0.
  • Removed: .gemspec, .index, index/, Assembly, MANIFEST, .travis.yml.
  • required_ruby_version is >= 2.7.

Code

  • Radix::VERSION is an ordinary constant in lib/radix/version.rb. Radix.metadata, the const_missing that read other constants from it, and lib/radix.yml are gone.
  • Removed the Float#to_r defined for Ruby 1.8, and fixed an indentation warning in float.rb.

String#b (#10)

Ruby has had its own String#b since 2.0. Radix 2.2.1 already worked around it: without a base, Radix's #b calls Ruby's. This drops the fallback for Rubies without String#b, guards the alias against the file being loaded twice, documents the behaviour, and adds demo/issues/010_string_b.md, which checks that "…".b with Radix loaded returns a new ASCII-8BIT string with the same bytes.

README

  • Includes the commits from :doc: Fix custom character set. #14 (Javier Cejudo: the custom character set example used U twice) and readme: .to_s() works with base bigger than 62. #15 (Jakukyo Friel: string output isn't limited to base 62), with their authorship.
  • New badges and install section; a note on String#b and on using Radix::Integer.new directly.
  • Two wrong examples fixed: 255.to_s(16) is "ff", and [100, 10] in base 256 is 100*256 + 10.

Testing

  • bundle exec rake: 8 demos, 114 steps, 259 assertions, all passing on Ruby 3.4.9, with and without --enable=frozen-string-literal, and in a ruby:2.7 container.
  • ruby -w loads the library without warnings.
  • The gem builds.

🤖 Generated with Claude Code

javiercejudo and others added 3 commits November 17, 2026 15:00
Replace the Indexer, Assembly and Travis CI files with a standard gemspec,
a Rakefile and GitHub Actions, testing on Ruby 2.7 to 4.0. Require Ruby
2.7 or later.

Remove Radix.metadata and the YAML file behind it, keeping Radix::VERSION
as an ordinary constant, and the Float#to_r that was defined for Ruby 1.8.
Fix an indentation warning.

String#b without a base has been Ruby's own method since the 2.2.1
workaround. Drop the fallback for Rubies that lack it, and add a demo
that checks it (#10).

Bring the README up to date, and fix its examples: hex output is lower
case, and [100, 10] in base 256 is 100*256 + 10.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@trans
trans merged commit a2ce407 into master Nov 17, 2026
14 checks passed
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.

3 participants