{"id":15404378,"url":"https://github.com/agis/multi_io","last_synced_at":"2025-04-16T20:53:07.689Z","repository":{"id":145391673,"uuid":"260294755","full_name":"agis/multi_io","owner":"agis","description":"A Ruby IO object that can be composed of other IO objects","archived":false,"fork":false,"pushed_at":"2020-08-30T00:20:28.000Z","size":17,"stargazers_count":13,"open_issues_count":3,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-29T05:41:33.588Z","etag":null,"topics":["io","ruby","ruby-gem","ruby-io","ruby-library"],"latest_commit_sha":null,"homepage":"https://rubygems.org/gems/multi_io","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/agis.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":"2020-04-30T19:00:24.000Z","updated_at":"2020-05-20T00:37:06.000Z","dependencies_parsed_at":"2023-06-03T16:45:40.143Z","dependency_job_id":null,"html_url":"https://github.com/agis/multi_io","commit_stats":{"total_commits":14,"total_committers":2,"mean_commits":7.0,"dds":0.0714285714285714,"last_synced_commit":"0b10badbbc8e5c1227d227e72b6fbab367dbffc5"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agis%2Fmulti_io","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agis%2Fmulti_io/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agis%2Fmulti_io/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agis%2Fmulti_io/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/agis","download_url":"https://codeload.github.com/agis/multi_io/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249275774,"owners_count":21242284,"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":["io","ruby","ruby-gem","ruby-io","ruby-library"],"created_at":"2024-10-01T16:12:32.163Z","updated_at":"2025-04-16T20:53:07.684Z","avatar_url":"https://github.com/agis.png","language":"Ruby","readme":"multi_io\n==============================================================================\n[![Gem Version](https://badge.fury.io/rb/multi_io.svg)](https://badge.fury.io/rb/multi_io)\n[![Build Status](https://travis-ci.org/agis/multi_io.svg?branch=master)](https://travis-ci.org/agis/multi_io)\n[![License](https://img.shields.io/github/license/mashape/apistatus.svg)](LICENSE)\n\n`MultiIO` is a Ruby [`IO`](https://ruby-doc.org/core-2.7.1/IO.html) object that\nis composed of other IO objects. It is meant to be used as a drop-in replacement for\nregular IO objects like files, sockets, stdout/stderr streams etc.\n\nThis is useful, for example, when one wants to duplicate writes to multiple destinations (e.g. standard output, a\nfile and a socket). Similarly, it can be used to read the concatenation of multiple IO sources.\n\n\n\n\nUsage\n------------------------------------------------------------------------------\n\nAssuming we want to duplicate writes to a string buffer, stdout and a file:\n\n```ruby\n\u003e require \"stringio\"\n\u003e str = StringIO.new\n\u003e io = MultiIO.new(str, $stdout, File.new(\"foo\", \"w\"))\n\n\u003e # write a message to all underlying IO objects (stdout is printed immediately\n\u003e # since it's attached to the terminal)\n\u003e io.puts \"bar\"\nbar\n\n\u003e io.flush\n\u003e str.string # =\u003e \"bar\\n\"\n\u003e File.read(\"foo\") # =\u003e \"bar\\n\"\n```\n\nStatus\n------------------------------------------------------------------------------\nThis is an alpha release. Not all methods from IO are implemented yet so it\ncan't be used in all cases as a drop-in replacement for regular IO objects.\n\nThe goal is to eventually implement the complete [`IO`](https://ruby-doc.org/core-2.7.1/IO.html)\ninterface.\n\nIO methods implemented:\n\n- `#close`\n- `#flush`\n- `#puts`\n- `#read`\n- `#rewind`\n- `#write`\n\nFeel free to submit a patch if you need something that's missing.\n\n\n\nDevelopment\n------------------------------------------------------------------------------\nRunning the tests:\n\n```shell\n$ bundle exec rake\n```\n\nLicense\n--------------------------------------------------------------------------\nMultiIO is licensed under MIT. See [LICENSE](LICENSE).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagis%2Fmulti_io","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagis%2Fmulti_io","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagis%2Fmulti_io/lists"}