{"id":27954327,"url":"https://github.com/michaeleisel/exeggutor","last_synced_at":"2025-05-07T17:25:09.208Z","repository":{"id":278996828,"uuid":"937293179","full_name":"michaeleisel/Exeggutor","owner":"michaeleisel","description":"A Simple, Capable, and Unified Interface for Managing Subprocesses in Ruby","archived":false,"fork":false,"pushed_at":"2025-03-04T23:15:25.000Z","size":429,"stargazers_count":44,"open_issues_count":4,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-07T13:57:54.155Z","etag":null,"topics":[],"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/michaeleisel.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2025-02-22T19:40:33.000Z","updated_at":"2025-04-13T16:18:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"58904a04-3d98-4c20-a29a-78194cb86425","html_url":"https://github.com/michaeleisel/Exeggutor","commit_stats":null,"previous_names":["michaeleisel/exeggutor"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaeleisel%2FExeggutor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaeleisel%2FExeggutor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaeleisel%2FExeggutor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaeleisel%2FExeggutor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michaeleisel","download_url":"https://codeload.github.com/michaeleisel/Exeggutor/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252923670,"owners_count":21825905,"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":[],"created_at":"2025-05-07T17:25:07.010Z","updated_at":"2025-05-07T17:25:09.197Z","avatar_url":"https://github.com/michaeleisel.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Exeggutor 🌴\n\n#### A Simple, Capable, and Unified Interface for Managing Subprocesses in Ruby\n\nTired of juggling `system(...)`, `` `...` ``, and `Open3`? Exeggutor provides one simple method that handles many different use cases - safely spawn processes with real-time output, captured stdout/stderr, and sane error handling.\n\nFrom this:\n\n\u003cimg src=\"./misc/left.png\" alt=\"Before using Exeggutor\"\u003e\n\nTo this:\n\n\u003cimg src=\"./misc/right.png\" alt=\"After using Exeggutor\" width=\"500\"\u003e\n\n#### Examples\n\n```ruby\n# Copy old_file to #{new_dir}/foo, and raise an exception if it fails\nexeg(%W[cp #{old_file} #{new_dir}/foo]) # Exception raised by default on failure\n\n# Collect stdout from a long-running build task while showing the progress updates as they're\n# printed out to stderr\noutput = exeg(%W[run_build.sh], show_stderr: true).stdout\n\n# Lots of overrides\nresult = exeg(\n  %W[foo bar],\n  env: {SOME_OVERRIDE: \"1\"}, # Override env vars\n  chdir: \"/path/to/...\", # Run the process in a different working directory\n  can_fail: true, # Don't throw an exception, handle the error manually or ignore\n  stdin: \"foo\", # Send this data to stdin as soon as the process starts\n)\n\n# Async execution - like popen3, but without its deadlock issue\nhandle = exeg_async(%W[long_running_process.sh])\nhandle.stdin.write(\"request\")\nresponse = handle.stdout.gets\n```\n\n#### Overview\n\nAlthough Ruby has many different ways of running a subprocess, they all have various drawbacks and quirks. Also, some of the most convenient ways of calling a process, e.g. with backticks, are the most dangerous, because they spawn a subshell. Here's an overview of how Exeggutor solves these shortcomings:\n\n|Problem with Standard Ruby APIs|Exeggutor Solution|\n|-|-|\n|Subshells are slow to spawn, error-prone, and insecure | Exeggutor never uses a subshell and always runs processes directly|\n|Non-subshells use ugly varargs syntax (e.g. `system('cp', old, \"#{new}/foo\")`)        |Exeggutor encourages elegant %W syntax by taking an array for the arguments parameter (e.g. `exeg(%W[cp #{old} #{new}/foo])`)|\n|Process failures are silent, requiring manual checks|Exeggutor raises an exception on failure by default (with rich error context)|\n|No simple way to both capture stdout/stderr as strings afterwards and also print them to the shell in real-time |Exeggutor always captures stdout/stderr, and can optionally print them in real-time|\n|Different APIs for different use cases|Exeggutor provides a single method for blocking calls and another for non-blocking execution, with smart defaults and flexible named parameters|\n\n#### Installation\n\n```\ngem install exeggutor\n```\n\n#### Documentation\n\nDocs are available [here](https://www.rubydoc.info/gems/exeggutor/toplevel).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaeleisel%2Fexeggutor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichaeleisel%2Fexeggutor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaeleisel%2Fexeggutor/lists"}