harbor run -t openthoughts/tasktrove-exp-rpt-stack-ruby-v2-stack-ruby-7232harbor download openthoughts/tasktrove-exp-rpt-stack-ruby-v2-stack-ruby-7232Implement Ruby sources under /app/ so that the test file at /tests/test_solution.rb requires and runs cleanly under rspec (or plain ruby if the file uses Test::Unit / minitest).
tests/test_solution.rb)Below is a deterministic summary of what the test file expects. Use this as the source of truth for require-paths and public API. If the original task description below conflicts with this section, prefer this section.
Language: Ruby
Test framework hint: RSpec / minitest (test.sh runs rspec if RSpec/describe is detected, otherwise plain ruby)
Top-level types under test (from describe/RSpec.describe):
Hbc::DSLSymbols the test references that you likely need to define (class/module names not from Ruby/RSpec/Rails stdlib; place under /app/):
Hbc::Cask — constructed via Hbc::Cask.new(...) with arities: 1 argHbc::CaskLoaderHbc::CaskTokenMismatchErrorHbc::ConfigHbc::DSLMethods invoked on instances/objects (you must expose at least these with the indicated arity; return type is inferred from how the test uses the result):
.app(...) — called with: 1 arg.pkg(...) — called with: 1 argruby:3.2-slim with build-essential, ruby-dev, libffi-dev for native extensions.rspec, minitest. Other 3rd-party gems (see list above) are best-effort gem install-ed by tests/test.sh before running the test.tests/test.sh) runs bundle install if /app/Gemfile exists, then auto-requires every *.rb file under /app/ (recursively) via $LOAD_PATH.unshift('/app'). So you can place sources at any depth under /app/ as long as relative-require paths resolve.require 'foo/bar' in the test, ensure either the foo gem provides it OR you create /app/foo/bar.rb with the required constants.Task: Implement a minimal Homebrew Cask DSL runtime under /app to support the test-suite expectations
Objective Build a lightweight, self-contained Cask DSL runtime (Hbc namespace) that can load cask definition files, expose stanzas (url, homepage, version, name, sha256, language, app, pkg, appcast, gpg, depends_on, conflicts_with, installer, stage_only, auto_updates, etc.), provide robust header validation, warn on unknown methods, and expose artifacts in a deterministic order. The implementation must live under /app/ and be usable by the test suite as described in the provided specs.
What to implement (high level)
A loader that reads a cask file, validates its header, ensures the header token matches the file name (with a specific, test-driven error behavior), and then evaluates the cask file inside a Cask instance that includes the DSL.
A minimal Cask model that stores token, stanzas, and a collection of artifacts (with a deterministic, test-driven ordering).
A DSL module (Hbc::DSL) with methods corresponding to the stanzas used in tests. The block passed to Hbc::Cask.new or to the DSL should mutate the Cask instance accordingly.
Support for:
Error classes to support test expectations:
Minimal data helpers
The loader should cooperate with the test fixtures that call:
Concrete requirements mapped to tests
[... description truncated to fit prompt budget ...]