{"id":18026839,"url":"https://github.com/yegor256/judges","last_synced_at":"2025-08-24T06:18:55.346Z","repository":{"id":239289785,"uuid":"799113787","full_name":"yegor256/judges","owner":"yegor256","description":"Executor of Ruby scripts that update a Factbase both adding new and modifying facts inside it","archived":false,"fork":false,"pushed_at":"2024-05-19T11:55:32.000Z","size":235,"stargazers_count":1,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-05-19T14:07:23.606Z","etag":null,"topics":["ruby","ruby-gem","zerocracy"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yegor256.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-11T08:10:36.000Z","updated_at":"2024-07-22T10:00:22.298Z","dependencies_parsed_at":"2024-05-21T03:38:56.542Z","dependency_job_id":null,"html_url":"https://github.com/yegor256/judges","commit_stats":null,"previous_names":["yegor256/judges"],"tags_count":61,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yegor256%2Fjudges","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yegor256%2Fjudges/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yegor256%2Fjudges/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yegor256%2Fjudges/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yegor256","download_url":"https://codeload.github.com/yegor256/judges/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247240667,"owners_count":20906862,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ruby","ruby-gem","zerocracy"],"created_at":"2024-10-30T08:08:14.666Z","updated_at":"2025-08-24T06:18:54.914Z","avatar_url":"https://github.com/yegor256.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Judges over a Factbase Executor\n\n[![DevOps By Rultor.com](https://www.rultor.com/b/yegor256/judges)](https://www.rultor.com/p/yegor256/judges)\n[![We recommend RubyMine](https://www.elegantobjects.org/rubymine.svg)](https://www.jetbrains.com/ruby/)\n\n[![rake](https://github.com/yegor256/judges/actions/workflows/rake.yml/badge.svg)](https://github.com/yegor256/judges/actions/workflows/rake.yml)\n[![PDD status](https://www.0pdd.com/svg?name=yegor256/judges)](https://www.0pdd.com/p?name=yegor256/judges)\n[![Gem Version](https://badge.fury.io/rb/judges.svg)](https://badge.fury.io/rb/judges)\n[![Test Coverage](https://img.shields.io/codecov/c/github/yegor256/judges.svg)](https://codecov.io/github/yegor256/judges?branch=master)\n[![Yard Docs](https://img.shields.io/badge/yard-docs-blue.svg)](https://rubydoc.info/github/yegor256/judges/master/frames)\n[![Hits-of-Code](https://hitsofcode.com/github/yegor256/judges)](https://hitsofcode.com/view/github/yegor256/judges)\n[![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/yegor256/judges/blob/master/LICENSE.txt)\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fyegor256%2Fjudges.svg?type=shield\u0026issueType=license)](https://app.fossa.com/projects/git%2Bgithub.com%2Fyegor256%2Fjudges?ref=badge_shield\u0026issueType=license)\n\nA command line tool and a Ruby gem for running so-called judges against a\n[factbase](https://github.com/yegor256/factbase).\n\nEvery \"judge\" is a directory with a single `.rb` file and a number\nof `.yml` files. A script in the Ruby file is executed with the following\nglobal variables available to it:\n\n* `$fb` — an instance\n  of [`Factbase`](https://www.rubydoc.info/gems/factbase/0.0.22/Factbase),\n  where facts may be added/updated;\n* `$loog` — an instance\n  of [`Loog`](https://www.rubydoc.info/gems/loog/0.5.1/Loog),\n  where `.info` and `.debug` logs are welcome;\n* `$options` — a holder of options coming from either the `--option` command\n  line flag or the `.yml` file during testing;\n* `$local` — a hash map that is cleaned up when the execution of\n  a judge is finished;\n* `$global` — a hash map that is never cleaned up;\n* `$judge` — the basename of the directory, where the `.rb` script is located.\n* `$start` — the time moment when plugin was started\n\nEvery `.yml` file must be formatted as such:\n\n```yaml\nbefore:\n  - abc\ncategory: slow\nruns: 1\nskip: false\nrepeat: 20\ninput:\n  -\n    foo: 42\n    bar: Hello, world!\n    many: [1, 2, -10]\noptions:\n  max: 100\nexpected:\n  - /fb[count(f)=1]\nexpected_failure:\n  - 'file not found'\nafter:\n  - first.rb\n  - second.rb\n```\n\nHere, the `input` is an array of facts to be placed into the Factbase before\nthe test starts; the `options` is a hash map of options as if they are passed\nvia the command line `--option` flag of the `update` command; and `expected` is\nan array of XPath expressions that must be present in the XML of the Factbase\nwhen the test is finished.\n\nThe `category` (default: `[]`) may have one category or an array of categories,\nwhich then may be turned on via the `--category` command line flag.\n\nThe `repeat` (default: `1`) makes the `input` to be repeated multiple times\n(mostly useful for speed measuring on big data inputs).\n\nThe `runs` (default: `1`) is the number of times the `.rb` script should\nbe executed. After each execution, all expected XPath expressions are validated.\n\nThe `before` (default: `[]`) is a list of judges that must be executed before\nthe current one.\n\nThe `after` (default: `[]`) is a list of relative file names\nof Ruby scripts that are executed after the judge\n(`$fb` and `$loog` are passed into them).\n\nThe `expected_failure` (default: `[]`) is a list of strings that must\nbe present in the message of the exception being raised.\n\n## How to contribute\n\nRead\n[these guidelines](https://www.yegor256.com/2014/04/15/github-guidelines.html).\nMake sure your build is green before you contribute\nyour pull request. You will need to have\n[Ruby](https://www.ruby-lang.org/en/) 3.0+ and\n[Bundler](https://bundler.io/) installed. Then:\n\n```bash\nbundle update\nbundle exec rake\n```\n\nIf it's clean and you don't see any error messages, submit your pull request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyegor256%2Fjudges","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyegor256%2Fjudges","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyegor256%2Fjudges/lists"}