Homebrew formula updater generates invalid Ruby class names with prerelease versions

Open Beginner friendly
#1,355 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
85/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
ruby, shell
Domain
tooling

Research direction

Start with .github/homebrew_formula_up.sh at lines 42-43 and reproduce it with the v0.40.0-alpha.1 example. Check the generated Formula/eolang@.rb and verify that the archived formula's Ruby class name is valid and accepted by Homebrew for prerelease versions.

Written by the indexing model from the issue text.

Description

bug good-title

Symptom

The Homebrew formula updater turns a version into a Ruby class name by merely removing dots. Prerelease versions can contain hyphens, which are not valid in Ruby constants.

Steps to reproduce

  1. Run .github/homebrew_formula_up.sh <token> v0.40.0-alpha.1.
  2. Inspect the archived formula produced under Formula/eolang@<old>.rb.

Actual result

DOTLESS_VERSION becomes 0400-alpha1, and line 43 writes class EolangAT0400-alpha1. Ruby parses the hyphen as subtraction, so Homebrew rejects the formula instead of accepting the prerelease archive.

Expected result

Normalize prerelease identifiers into a valid constant name, or skip archival class renaming for versions that cannot be represented as a Ruby constant.

Evidence

.github/homebrew_formula_up.sh:42-43 removes only . and then inserts the result verbatim into a Ruby class declaration.

Dominant language
JavaScript
Stars
36
Forks
64
Avg merge
1d 14h
Merged PRs (30d)
17

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from objectionary/eoc

All issues in objectionary/eoc

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.