Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

source 'https://rubygems.org'

gem 'fbe', '>0'
gem 'judges', '>0', require: false
gem 'fbe', '~>0'
gem 'judges', '~>0', require: false
gem 'minitest', '~>6.0', require: false
gem 'minitest-reporters', '~>1.7', require: false
gem 'rake', '~>13.2', require: false
Expand Down
76 changes: 42 additions & 34 deletions Gemfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ based on business rules. Judges run in cycles until no new facts are produced.

## Project Structure

```
```text
judges/<name>/<name>.rb — judge implementation, auto-discovered
judges/<name>/<name>.yml — YAML test for the judge (data-driven)
lib/ — shared Ruby libraries
Expand All @@ -41,7 +41,7 @@ bundle exec rake
mkdir judges/hello-world
```

2. Write the judge logic in `judges/hello-world/hello-world.rb`:
1. Write the judge logic in `judges/hello-world/hello-world.rb`:

```ruby
# frozen_string_literal: true
Expand All @@ -56,7 +56,7 @@ Fbe.fb.query('(and (exists hi) (absent hello))').each do |f|
end
```

3. Write a YAML test in `judges/hello-world/hello-world.yml`:
1. Write a YAML test in `judges/hello-world/hello-world.yml`:

```yaml
# SPDX-FileCopyrightText: Copyright (c) 2024-2026 Zerocracy
Expand All @@ -74,13 +74,13 @@ expected:
- /fb/f[_id=1]/hello
```

4. Run the judge YAML tests:
1. Run the judge YAML tests:

```bash
bundle exec judges test --no-log --disable live --lib lib judges
```

5. Run the full build:
1. Run the full build:

```bash
bundle exec rake
Expand All @@ -90,13 +90,15 @@ If everything is clean, your judge is ready.

## Commands

<!-- markdownlint-disable MD013 -->
| Command | Purpose |
|---------|---------|
| ------- | ------- |
| `bundle exec rake` | Full build (test + judges + rubocop) |
| `bundle exec rake test` | Ruby unit tests only |
| `bundle exec judges test --no-log --disable live --lib lib judges` | Judge YAML tests |
| `bundle exec rubocop` | Code style check |
| `docker build -t swarm .` | Build Docker image (requires Dockerfile) |
<!-- markdownlint-enable MD013 -->

## How to Contribute

Expand Down
Loading