Skip to content

Handle scalar hours when combining natural intervals - #134

Open
OskarEichler wants to merge 1 commit into
floraison:masterfrom
OskarEichler:codex/handle-single-hours-in-natural-intervals
Open

Handle scalar hours when combining natural intervals#134
OskarEichler wants to merge 1 commit into
floraison:masterfrom
OskarEichler:codex/handle-single-hours-in-natural-intervals

Conversation

@OskarEichler

Copy link
Copy Markdown

Summary

Combining a minute interval with a specific numeric hour probes that hour for range syntax using Integer#match, which does not exist. Convert the range candidate to text before matching, leaving the original scalar/array values unchanged.

Reproduction

Run after require 'fugit':

p Fugit.parse_nat('every 10 minutes at 5').to_cron_s
# "0,10,20,30,40,50 5 * * *"; previously NoMethodError
p Fugit.parse_nat('every 10 minutes from 5 to 8').to_cron_s
# unchanged "0,10,20,30,40,50 5,6,7 * * *"

Verification

  • rbenv Ruby 4.0.6, TZ=UTC. Master baseline and this individual patch: 1,524 existing tests, 3,379 assertions, zero failures, one existing pending test.
  • 4 focused checks for this change, run outside the repository. The combined release-based branch passes 1,517 existing RSpec examples, zero failures, one pending, plus 998 focused checks.
  • Also checked the combined master changes with unmodified registry EtOrbi 1.4.1/Raabro 1.5.0: 1,524 tests/3,379 assertions, zero failures, one pending, and 997 focused checks. The extra blank-line check requires the independently fixed Raabro empty-input behavior; it is not claimed to pass on unmodified Raabro.
  • Individual/release checks used the same versions of EtOrbi/Raabro with their separately proposed fixes. Syntax and whitespace checks pass. Combined source has the same 18 pre-existing Lint warnings, with no new warnings. Release gem packaging checked.

Compatibility and limitations

Valid interval-plus-hour expressions now parse instead of raising. Existing hour-range behavior is preserved. This does not redefine how separate hours combine into multiple crons; multi:true can still return separate schedules.

No dependency/version upgrades, test additions or test modifications are included. The task's no-new-tests constraint was followed; reproduction/check scripts stayed outside the repository. Other Ruby versions and platforms await upstream CI. No production execution was performed. Prepared with Codex assistance.

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