{"id":15392668,"url":"https://github.com/jackdbd/pegthing","last_synced_at":"2025-03-27T23:41:56.695Z","repository":{"id":82381065,"uuid":"252758123","full_name":"jackdbd/pegthing","owner":"jackdbd","description":"My implementation of the Peg Thing game in Clojure for the Brave and True","archived":false,"fork":false,"pushed_at":"2022-02-03T21:15:48.000Z","size":202,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-02T01:43:37.312Z","etag":null,"topics":["clojure","functional-programming"],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jackdbd.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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":"2020-04-03T14:36:44.000Z","updated_at":"2022-02-03T21:15:51.000Z","dependencies_parsed_at":"2023-06-15T11:00:33.800Z","dependency_job_id":null,"html_url":"https://github.com/jackdbd/pegthing","commit_stats":{"total_commits":10,"total_committers":1,"mean_commits":10.0,"dds":0.0,"last_synced_commit":"20fabd8d9f4b277c37abbd630ac294fc76c1ce17"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackdbd%2Fpegthing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackdbd%2Fpegthing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackdbd%2Fpegthing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackdbd%2Fpegthing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jackdbd","download_url":"https://codeload.github.com/jackdbd/pegthing/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245944062,"owners_count":20697948,"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":["clojure","functional-programming"],"created_at":"2024-10-01T15:15:37.866Z","updated_at":"2025-03-27T23:41:56.674Z","avatar_url":"https://github.com/jackdbd.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Peg Thing\n\n[![Build Status](https://travis-ci.com/jackdbd/pegthing.svg?branch=master)](https://travis-ci.org/jackdbd/pegthing)\n\nA game developed for the Functional Programming chapter of [Clojure for the Brave and True](https://www.braveclojure.com/functional-programming/).\n\n![Peg Thing](https://www.braveclojure.com/assets/images/cftbat/functional-programming/peg-thing-starting.png \"Peg Thing\").\n\n![Demo of Peg Thing](https://raw.githubusercontent.com/jackdbd/pegthing/master/images/demo.png \"Demo of Peg Thing\")\n\n![Dependency hierarchy graph](https://raw.githubusercontent.com/jackdbd/pegthing/master/images/ns-hierarchy.png \"Dependency hierarchy graph generated with lein-hiera\")\n\n## Usage\n\nThis project uses the [Clojure tools CLI](https://clojure.org/reference/deps_and_cli) and [tools.build](https://clojure.org/guides/tools_build).\n\nPlay the game:\n\n```sh\nclj -X:play\n```\n\n## Build\n\nIn order to build the uberjar using [tools.build](https://clojure.org/guides/tools_build) you will need Clojure CLI 1.10.3.933 or higher. Download the latest version from [here](https://clojure.org/guides/getting_started#_clojure_installer_and_cli_tools).\n\n```sh\ncurl -O https://download.clojure.org/install/linux-install-1.10.3.1075.sh\nchmod +x linux-install-1.10.3.1075.sh\nsudo ./linux-install-1.10.3.1075.sh\n```\n\nRunning a tool with `-T` will create a classpath that does not include the project `:paths` and `:deps`. Using `-T:build` will use only the `:paths` and `:deps` from the `:build` alias.\n\nBuild the uberjar using tools.build:\n\n```sh\nclj -T:build uber\n# or, equivalently\nclj -X:uberjar\n```\n\nThen run the standalone uberjar:\n\n```sh\njava -jar target/pegthing.core-1.2.9-standalone.jar\n```\n\n## Tests\n\nRun all tests with [kaocha](https://github.com/lambdaisland/kaocha):\n\n```sh\nbin/kaocha\n\n# for a more verbose output, use this reporter\nbin/kaocha --reporter kaocha.report/documentation\n```\n\n## Containerize the app\n\nCreate the container image using [pack](https://github.com/buildpacks/pack) and the [Paketo Tiny Builder](https://github.com/paketo-buildpacks/tiny-builder) (`BP` stands for Buildpack).\n\n```sh\npack build pegthing:latest --builder paketobuildpacks/builder:tiny \\\n  --env BP_JVM_TYPE=JRE \\\n  --env BP_JVM_VERSION=11 \\\n  --env BP_CLJ_TOOLS_BUILD_ARGUMENTS=\"-T:build uber\"\n```\n\nConfiguration with build-time environment variables:\n\n- [Paketo BellSoft Liberica Buildpack](https://github.com/paketo-buildpacks/bellsoft-liberica#configuration)\n- [Paketo Clojure Tools Buildpack](https://github.com/paketo-buildpacks/clojure-tools/blob/main/README.md#configuration)\n\nPlay the game inside a container:\n\n```sh\ndocker run --rm --interactive --tty pegthing:latest\n```\n\nInspect the generated container image with [dive](https://github.com/wagoodman/dive). For example you could try building the container image with `--env BP_JVM_TYPE=JDK` first, and `--env BP_JVM_TYPE=JRE` second. You will see that the container image containing the JRE is much smaller than the one containing the JDK.\n\n```sh\ndive pegthing:latest\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjackdbd%2Fpegthing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjackdbd%2Fpegthing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjackdbd%2Fpegthing/lists"}