Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
480ea78
docs: READMEを再構成し実挙動と同期 / Restructure README and sync with actual beh…
inakaegg Jul 25, 2026
3311a84
fix: CLI境界とRunner検出を修正 / Repair CLI and runner boundaries
inakaegg Jul 25, 2026
39df58a
fix: Runnerの検査境界を修正 / Repair runner check boundaries
inakaegg Jul 25, 2026
399f661
fix: 引数と注釈の対応を修正 / Align arguments with annotations
inakaegg Jul 25, 2026
b4e849c
fix: 実行状態と結果出力を隔離 / Isolate runtime state and output
inakaegg Jul 25, 2026
99fbecf
fix: eval構文エラーを正規化 / Normalize eval syntax errors
inakaegg Jul 25, 2026
caaab2e
test: カバレッジゲートと実行経路を強化 / Enforce coverage across runtime paths
inakaegg Jul 25, 2026
f088eb0
fix: レビューで確認した境界不具合を修正 / Fix reviewed boundary regressions
inakaegg Jul 25, 2026
a200ce3
fix: RubyセットアップActionを更新 / Update Ruby setup action
inakaegg Jul 25, 2026
dc43262
fix: Ruby 3.0と4.0のCI互換性を修正 / Fix Ruby 3.0 and 4.0 CI compatibility
inakaegg Jul 25, 2026
9eeb997
fix: Ruby 3.0のMinitest互換性を固定 / Pin Ruby 3.0 Minitest compatibility
inakaegg Jul 25, 2026
f9f322f
fix: Codexレビュー指摘を修正 / Fix Codex review findings
inakaegg Jul 25, 2026
20729ea
fix: 最新レビュー指摘を修正 / Fix latest review findings
inakaegg Jul 25, 2026
bee411e
fix: 実行分岐の定数捕捉を修正 / Fix runtime branch capture
inakaegg Jul 25, 2026
e8be1b6
fix: 定数guardと負数値を修正 / Fix constant guards and negatives
inakaegg Jul 25, 2026
a6ed557
fix: 定数再読込の実行判定を厳密化 / Track completed constant definitions
inakaegg Jul 25, 2026
b513698
fix: 追加レビューの境界入力を処理 / Handle review edge cases
inakaegg Jul 25, 2026
a668fd1
fix: レビュー境界の解析を補強 / Harden review edge parsing
inakaegg Jul 25, 2026
cb9c8e0
fix: 静的解析の副作用を防止 / Avoid analysis side effects
inakaegg Jul 25, 2026
6941eab
fix: 存在ガードの解決範囲を拡張 / Resolve loop and qualified guards
inakaegg Jul 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Test

on:
push:
pull_request:

permissions:
contents: read

jobs:
test:
name: Ruby ${{ matrix.ruby }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby:
- "3.0"
- "3.2"
- "3.4"
- "4.0"

steps:
- name: Check out repository
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
- name: Set up Ruby
uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Install Ruby 3.0 test compatibility
if: matrix.ruby == '3.0'
run: gem install minitest --version 5.26.1 --no-document
- name: Install Ruby 4 test compatibility
if: matrix.ruby == '4.0'
run: gem install minitest-mock --version 5.27.0 --no-document
- name: Run tests
run: ruby -Ilib:test -e 'Dir["test/*_test.rb"].sort.each { |file| require File.expand_path(file) }'

coverage:
name: Coverage
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
fetch-depth: 0
- name: Set up Ruby
uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1
with:
ruby-version: "3.4"
- name: Enforce coverage thresholds
run: ruby -Ilib:test test/coverage_runner.rb
env:
COVERAGE_BASE_REF: ${{ github.event_name == 'push' && github.event.created == false && github.event.deleted == false && github.event.before || format('origin/{0}', github.base_ref || github.event.repository.default_branch) }}
34 changes: 33 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,38 @@
# Changelog

# Changelog
## [Unreleased]

### Fixed
- Parameterless commands now reject unexpected arguments without invoking the target method or attempting implicit return-value traversal.
- Required options now report a missing value instead of consuming the following option token, while explicit values such as `true` remain valid.
- Required options accept negative exponent, digit-separated decimal, and radix notation such as `-1e3`, `-1_000`, and `-0x10` without mistaking them for another option.
- Required options in eval mode accept space-separated lambda and unary expressions without consuming known option tokens as values.
- Constant discovery now includes classes and modules assigned with `Class.new` / `Module.new` during the target file load.
- Repeated loads retain assigned constant aliases when the source file is unchanged.
- Repeated loads retain aliases from completed direct, multiple, and `const_set` assignments or matching fully qualified existence guards, including loop initializers and receivers found by Ruby's lexical constant fallback, without reviving failed assignments or aliases behind disabled conditions.
- Constant discovery analyzes the preloaded source without triggering autoloads, so inactive autoload branches and self-removing target files do not add side effects or fail after a successful load.
- Constructor arity errors raised by `--new` are now wrapped in Rubycli's user-facing runner error.
- Framework argument errors raised by constructors are also wrapped in the same user-facing runner error.
- Positional type conversion now waits for JSON/eval coercion, matching keyword-option behavior and preserving `--new` JSON/eval inputs.
- Runner tests now execute without terminating the Minitest process and assert converted command arguments instead of stubbed targets.
- `--check --new` now inspects exposed instance/class commands without running constructors, while `--check` rejects pre-scripts instead of evaluating them.
- `--check` now inspects explicitly selected commands even when their methods or defining procs come from required files.
- Explicit nested constant names no longer fall back to inherited top-level constants, and malformed pre-scripts now produce contextual Rubycli errors.
- Rest, optional-before-required, and trailing-required positional arguments now follow Ruby's argument binding rules for conversion, validation, and help output.
- Documented scalar/list conversions now preserve numeric-, boolean-, and null-looking strings, handle repeated booleans, return real `DateTime` values, accept JSON arrays, and reject scalar/array values where `JSON`/`Hash` shapes do not allow them.
- Positional `Symbol` annotations preserve colon-prefixed symbol literals instead of embedding the colon in the symbol name.
- Assignment-like positional values remain positional unless they match a keyword, while matching assignments use the same documented conversion as long options.
- YARD positional tags are aligned by parameter name instead of comment order.
- Eval-mode local variables and command-line strict/check/result-output flags no longer leak across separate programmatic runs.
- Constructor and command eval arguments share one binding per Runner execution without enabling eval mode while the target file loads.
- Required options accept a lone `-` value, bare rest placeholders render with an ellipsis, and quoted positional/option `String[]` elements remain strings.
- Invalid Ruby syntax passed through strict eval mode now produces a user-facing Rubycli argument error instead of leaking a `SyntaxError` backtrace.
- Circular arrays/hashes returned by commands now fall back to inspected output instead of raising a JSON nesting error.

### Testing
- Added dependency-free overall line, branch, and changed-line coverage gates plus GitHub Actions checks spanning the supported Ruby range.
- Changed-line coverage now treats new library files that were never loaded by the test suite as uncovered, including non-ASCII paths quoted by Git.
- Push coverage compares against the previous commit and falls back to the default branch when a new ref has no previous commit or a ref is deleted.

## [0.1.7] - 2025-11-12

Expand Down
Loading