{"id":20454986,"url":"https://github.com/undr/bakery","last_synced_at":"2026-06-06T17:31:12.954Z","repository":{"id":136417610,"uuid":"175053588","full_name":"undr/bakery","owner":"undr","description":"Coding Challenge Solution. Bakery.","archived":false,"fork":false,"pushed_at":"2019-03-11T18:50:54.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-15T23:25:20.000Z","etag":null,"topics":["coding-challenge","ruby"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/undr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2019-03-11T17:46:48.000Z","updated_at":"2019-07-18T05:30:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"dc53cc01-d779-492b-a4c3-4d1855732f39","html_url":"https://github.com/undr/bakery","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/undr%2Fbakery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/undr%2Fbakery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/undr%2Fbakery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/undr%2Fbakery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/undr","download_url":"https://codeload.github.com/undr/bakery/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242005820,"owners_count":20056434,"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":["coding-challenge","ruby"],"created_at":"2024-11-15T11:17:40.838Z","updated_at":"2026-06-06T17:31:12.268Z","avatar_url":"https://github.com/undr.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Coding Challenge Solution. Bakery.\n\n### Requirements\n\n- Ruby (2.4.4)\n\n### Setup\n\n- Go to project's folder in your terminal\n- run `bundle install`\n- run `bin/bakery --help` to learn how it works.\n\n### Help\n\n```\n$ bin/bakery --help\nUsage: bakery --repo=FILENAME [INPUT]\n    -r, --repo=FILENAME              Bakery's data file\n    -d, --dev                        Run into development mode\n    -h, --help                       Prints this help\n```\n\nUse `--repo` option to define data file. You can find examples of this file in `./examples` folder. In interactive mode, it provides REPL terminal.  \n\n```\n$ bin/bakery -r ./examples/datafile.origin\nRead commands from console.\nAvailable commands: REPORT, PREPACK, RESET, REM code, ADD quantity code.\nPress Control+C for exit.\n\n(0.0.1)\u003e |\n```\n\nAvailable commands:\n\n- `report`  - Print order content.\n- `prepack` - Pack an order and print result.\n- `reset` - Clear order content.\n- `rem CODE` - Remove a product with provided code from an order.\n- `add QTY CODE` - Add defined quantity of product into an order.\n\nExample:\n\n```\n(0.0.1)\u003e add 13 CF\nCF item was added into order.\n(0.0.1)\u003e rem CF\nCF item was removed from order.\n(0.0.1)\u003e |\n```\n\nIt's possible to define input file with list of commands:\n\n```\n$ bin/bakery -r ./examples/datafile.origin ./examples/commands.origin\n10    VS5    $17.98\n    2 x 5    $8.99\n14    MB11   $54.8\n    1 x 8    $24.95\n    3 x 2    $9.95\n13    CF     $25.85\n    2 x 5    $9.95\n    1 x 3    $5.95\n\n```\n\n*__Hint:__ Use development mode to see all exception.*\n\n*__Hint:__ Use `datafile:origin` and `datafile:extended` rake tasks to generate data files.*\n\n```\n$ bundle exec rake datafile:origin \u003e ./datafile\n$ bundle exec rake datafile:extended \u003e ./datafile\n$ bundle exec rake datafile:origin[./datafile]\n$ bundle exec rake datafile:extended[./datafile]\n```\n\n### Specs\n\nif you want to run the specs please run `bundle exec rspec spec` in project's home directory.\n\n### Known issues and limitations\n\n- Command parser cannot recognize numeric only codes for products in some cases.\n\n  ```\n  (0.0.1)\u003e rem 10\n  unknown command: rem 10\n  (0.0.1)\u003e |\n  ```\n- It catches all exceptions, but do not log them into a file. Need to add logging system. It would be worth to log all valuable events, but not only exceptions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fundr%2Fbakery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fundr%2Fbakery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fundr%2Fbakery/lists"}