{"id":19866186,"url":"https://github.com/tlux/systemcall","last_synced_at":"2025-05-02T05:32:27.735Z","repository":{"id":59157094,"uuid":"183823014","full_name":"tlux/systemcall","owner":"tlux","description":"A simple wrapper around Ruby's Open3 to call CLI programs and process their output.","archived":false,"fork":false,"pushed_at":"2024-03-01T16:51:27.000Z","size":31,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-25T16:42:36.590Z","etag":null,"topics":["cli","command-line","ruby","ruby-gem","ruby-open3","rubygem","shell"],"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/tlux.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":"2019-04-27T21:25:26.000Z","updated_at":"2020-07-28T09:05:49.000Z","dependencies_parsed_at":"2024-11-12T15:32:15.575Z","dependency_job_id":"9ca2378a-5737-413f-b351-121f7c837ddc","html_url":"https://github.com/tlux/systemcall","commit_stats":{"total_commits":28,"total_committers":2,"mean_commits":14.0,"dds":0.0714285714285714,"last_synced_commit":"52e3b9785728938ae4e99c565c2d205418b3a3b7"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tlux%2Fsystemcall","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tlux%2Fsystemcall/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tlux%2Fsystemcall/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tlux%2Fsystemcall/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tlux","download_url":"https://codeload.github.com/tlux/systemcall/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251993002,"owners_count":21677022,"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":["cli","command-line","ruby","ruby-gem","ruby-open3","rubygem","shell"],"created_at":"2024-11-12T15:25:12.564Z","updated_at":"2025-05-02T05:32:22.725Z","avatar_url":"https://github.com/tlux.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# System Call\n\n[![Build Status](https://travis-ci.org/tlux/systemcall.svg?branch=master)](https://travis-ci.org/tlux/systemcall)\n[![Coverage Status](https://coveralls.io/repos/github/tlux/systemcall/badge.svg?branch=master)](https://coveralls.io/github/tlux/systemcall?branch=master)\n[![Gem Version](https://badge.fury.io/rb/systemcall.svg)](https://badge.fury.io/rb/systemcall)\n\nA simple wrapper around Ruby's Open3 to call CLI programs and process their\noutput.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'systemcall'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install systemcall\n\n## Usage\n\n### Functional\n\nTo run a CLI program use the following method:\n\n```ruby\nSystemCall.call('which', 'bash')\nSystemCall.call(['which', 'bash'])\n# =\u003e #\u003cSystemCall::Result ...\u003e\n```\n\nA command that has been executed returns a result object. When the command has\nrun successfully, the result may look like so:\n\n```ruby\nresult = SystemCall.call('which', 'bash')\nresult.exit_code # =\u003e 0\nresult.success? # =\u003e true\nresult.error? # =\u003e false\nresult.success_result # =\u003e \"/bin/bash\"\nresult.error_result # =\u003e \"\"\nresult.result # =\u003e \"/bin/bash\"\n```\n\nWhen the command failed, it may look like this:\n\n```ruby\nresult = SystemCall.call('which', 'unknown')\nresult.exit_code # =\u003e 1\nresult.success? # =\u003e false\nresult.error? # =\u003e true\n```\n\nIn critical cases, the method may also raise:\n\n```ruby\nSystemCall.call('unknown')\n# ** (Errno::ENOENT) No such file or directory - unknown\n```\n\n### Mixin\n\nAlternatively, you can include the `SystemCall` module directly in your classes\nor modules. The included method name is `system_call` but the API is the same as\nfor `SystemCall.call`.\n\n```ruby\ninclude SystemCall\n\nsystem_call('which', 'bash')\nsystem_call(['which', 'bash'])\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run\n`rake spec` to run the tests. You can also run `bin/console` for an interactive\nprompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To\nrelease a new version, update the version number in `version.rb`, and then run\n`bundle exec rake release`, which will create a git tag for the version, push\ngit commits and tags, and push the `.gem` file to\n[rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at\nhttps://github.com/tlux/systemcall.\n\n## License\n\nThe gem is available as open source under the terms of the\n\n[MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftlux%2Fsystemcall","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftlux%2Fsystemcall","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftlux%2Fsystemcall/lists"}