{"id":24387159,"url":"https://github.com/kairichard/zq","last_synced_at":"2025-04-11T03:51:34.403Z","repository":{"id":14847650,"uuid":"17570724","full_name":"kairichard/zq","owner":"kairichard","description":"Unixy building blocks in ruby","archived":false,"fork":false,"pushed_at":"2020-02-28T18:38:47.000Z","size":92,"stargazers_count":1,"open_issues_count":3,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-08T21:45:43.640Z","etag":null,"topics":["composer","concept","orchestra","ruby","unix"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"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/kairichard.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}},"created_at":"2014-03-09T18:34:21.000Z","updated_at":"2019-05-27T19:24:35.000Z","dependencies_parsed_at":"2022-09-23T23:41:00.826Z","dependency_job_id":null,"html_url":"https://github.com/kairichard/zq","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kairichard%2Fzq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kairichard%2Fzq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kairichard%2Fzq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kairichard%2Fzq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kairichard","download_url":"https://codeload.github.com/kairichard/zq/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248339262,"owners_count":21087214,"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":["composer","concept","orchestra","ruby","unix"],"created_at":"2025-01-19T12:22:10.588Z","updated_at":"2025-04-11T03:51:34.388Z","avatar_url":"https://github.com/kairichard.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"ZQ - Unixy building blocks in ruby\n========\n[![Build Status](https://travis-ci.org/kairichard/zq.png?branch=master)](https://travis-ci.org/kairichard/zq) [![Gem Version](https://badge.fury.io/rb/zq.png)](https://badge.fury.io/rb/zq) [![Dependency Status](https://gemnasium.com/kairichard/zq.svg)](https://gemnasium.com/kairichard/zq) [![Coverage Status](https://coveralls.io/repos/kairichard/zq/badge.png?branch=master)](https://coveralls.io/r/kairichard/zq?branch=master)\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fkairichard%2Fzq.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fkairichard%2Fzq?ref=badge_shield)\n\n\nThis started as a simple proof of concept and looked kinda promising.\nThe hole concept is centered around an Orchestra which has a `source` where it can\nread chunks of data from. The data is than passed through chainable `composers`.\nThe source and the composers just need to implement a certain method each in order to work.\n\n#### Examples-Orchestras\nThis is how the Echo-Orchestra looks like\n```ruby\nclass Echo\n  include ZQ::Orchestra\n  source ZQ::Sources::IOSource.new $stdin\n  compose_with ZQ::Composer::Echo.new\n  desc 'prints contents from stdin'\nend\n```\nThats fairly verbose to just implement a `PIPE`. But consider the following\n```ruby\nequire 'redis'\nrequire 'zq'\n\nCLIENT = Redis.new(db: 1)\n\nclass RedisPull\n  include ZQ::Orchestra\n  source ZQ::Sources::RedisLPOP.new(CLIENT, \"incoming\")\n  compose_with ZQ::Composer::Echo.new\n  desc \"reads from redis:key:'incoming' and prints to stdout\"\nend\n```\nHere we print items from a redis list. Checkout the examples directory for more.\nAlso check the lib/source and lib/composers directory and mix and match your tool\n\n###### Synopsis\n```bash\nzq \u003ccmd\u003e \u003cORCHESTRA_NAME\u003e [--file=\u003cFILE\u003e]\n# or\nCommands:\n  zq help [COMMAND]       # Describe available commands or one specific command\n  zq list                 # List available orchestras.\n  zq play ORCHESTRA_NAME  # Start orchestrating.\n\nOptions:\n  -r, [--file=FILE]  # Require file to load orchestras from\n---\n\nUsage:\n  zq play ORCHESTRA_NAME\n\nOptions:\n  -d, [--forever], [--no-forever]  # Keep running even if source is exhausted\n  -i, [--interval=N]               # Play orchestra every N seconds\n                                   # Default: 0\n  -r, [--file=FILE]                # Require file to load orchestras from\n\nStart orchestrating.\n```\nInstalling\n-------------\nZQ comes as a gem, so given you have ruby installed simply do the following\n```bash\n\u003e gem install zq\n```\n\n## Contributing Code\n\nIf you want to contribute code, please try to:\n\n* Follow the same coding style as used in the project. Pay attention to the\n  usage of tabs, spaces, newlines and brackets. Try to copy the aesthetics the\n  best you can.\n* Add a scenario under `features` that verifies your change (test with `rake features`). Look at the existing test\n  suite to get an idea for the kind of tests I like. If you do not provide a\n  test, explain why.\n* Write [good commit messages](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html),\n  explain what your patch does, and why it is needed.\n* Keep it simple: Any patch that changes a lot of code or is difficult to\n  understand should be discussed before you put in the effort.\n\nOnce you have tried the above, create a GitHub pull request to notify me of your\nchanges.\n\n##TODO\n  * add more sources and composers\n  * better error handling for transactions\n\n\n## License\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fkairichard%2Fzq.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fkairichard%2Fzq?ref=badge_large)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkairichard%2Fzq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkairichard%2Fzq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkairichard%2Fzq/lists"}