{"id":21487265,"url":"https://github.com/dtinth/thru","last_synced_at":"2025-03-17T10:14:44.846Z","repository":{"id":19466664,"uuid":"22711733","full_name":"dtinth/thru","owner":"dtinth","description":"Pipe a string through a shell command.","archived":false,"fork":false,"pushed_at":"2014-08-07T06:59:47.000Z","size":124,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-23T19:48:07.841Z","etag":null,"topics":["ruby"],"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/dtinth.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}},"created_at":"2014-08-07T06:59:03.000Z","updated_at":"2021-09-16T21:48:35.000Z","dependencies_parsed_at":"2022-07-22T10:22:21.462Z","dependency_job_id":null,"html_url":"https://github.com/dtinth/thru","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/dtinth%2Fthru","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dtinth%2Fthru/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dtinth%2Fthru/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dtinth%2Fthru/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dtinth","download_url":"https://codeload.github.com/dtinth/thru/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244014187,"owners_count":20383716,"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":["ruby"],"created_at":"2024-11-23T13:27:43.482Z","updated_at":"2025-03-17T10:14:44.342Z","avatar_url":"https://github.com/dtinth.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Thru\n\nPipes a string through a shell command's STDIN and returns STDOUT.\n\n## Installation\n\n    gem install thru\n\n## Usage\n\n### Basic Usage\n\n    require 'thru'\n    text = \"Hello world!\"\n\n    text.thru('uuencode -')\n    # =\u003e \"begin 644 -\\n,2\u00265L;\u0026\\\\@=V]R;\u00260A\\n`\\nend\\n\"\n\n    text | 'uuencode -'\n    # =\u003e \"begin 644 -\\n,2\u00265L;\u0026\\\\@=V]R;\u00260A\\n`\\nend\\n\"\n\n\n### Real-world Usage. Let's Convert Markdown to LaTeX!\n\nUsing [Pandoc](http://johnmacfarlane.net/pandoc/).\n\n    markdown = File.read('README.md')\n    latex    = markdown | 'pandoc -f markdown -t latex'\n\n\n## API\n\n### String#thru(*command) \u0026rarr; str\u003cbr\u003estr | command \u0026rarr; str\n\nPasses the string through a shell command's STDIN. Captures and returns its STDOUT.\n\nRaises a `RuntimeError` if the command returned non-zero exit code.\n\n    'wow' | 'gcc'\n    # (STDERR) gcc: fatal error: no input files\n    # (STDERR) compilation terminated.\n    # RuntimeError: pid 93761 exit 1\n\nTo suppress the error, true!\n\n    'wow' | 'gcc; true'\n    # (STDERR) gcc: fatal error: no input files\n    # (STDERR) compilation terminated.\n    # =\u003e \"\"\n\n\n## Contributing\n\n1. Fork it ( https://github.com/dtinth/thru/fork )\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdtinth%2Fthru","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdtinth%2Fthru","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdtinth%2Fthru/lists"}