{"id":19038251,"url":"https://github.com/tjmw/streamlet","last_synced_at":"2025-09-17T10:29:34.108Z","repository":{"id":59156584,"uuid":"120010520","full_name":"tjmw/streamlet","owner":"tjmw","description":"Chain operations which may fail or succeed in Ruby","archived":false,"fork":false,"pushed_at":"2018-02-09T15:44:00.000Z","size":14,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-15T12:06:34.694Z","etag":null,"topics":["ruby","ruby-gem"],"latest_commit_sha":null,"homepage":"https://rubygems.org/gems/streamlet","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/tjmw.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-02T17:28:03.000Z","updated_at":"2018-02-04T00:17:24.000Z","dependencies_parsed_at":"2022-09-13T20:03:46.719Z","dependency_job_id":null,"html_url":"https://github.com/tjmw/streamlet","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/tjmw/streamlet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tjmw%2Fstreamlet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tjmw%2Fstreamlet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tjmw%2Fstreamlet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tjmw%2Fstreamlet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tjmw","download_url":"https://codeload.github.com/tjmw/streamlet/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tjmw%2Fstreamlet/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275579178,"owners_count":25490045,"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","status":"online","status_checked_at":"2025-09-17T02:00:09.119Z","response_time":84,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","ruby-gem"],"created_at":"2024-11-08T22:02:05.538Z","updated_at":"2025-09-17T10:29:34.046Z","avatar_url":"https://github.com/tjmw.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Streamlet\n\n[![Build Status](https://travis-ci.org/tjmw/streamlet.svg?branch=master)](https://travis-ci.org/tjmw/streamlet)\n[![Gem Version](https://badge.fury.io/rb/streamlet.svg)](https://badge.fury.io/rb/streamlet)\n\nChain operations which may fail or succeed, inspired by forays into functional programming.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'streamlet'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install streamlet\n\n## Usage\n\n```ruby\ndef half_to_whole_number(number)\n  halved = number.to_f / 2\n  halved % 1 == 0 ? halved.to_i : nil\nend\n\nStreamlet.new { half_to_whole_number(16) }.     # =\u003e 8\n  and_then { |val| half_to_whole_number(val) }. # =\u003e 4\n  and_then { |val| half_to_whole_number(val) }. # =\u003e 2\n  and_then { |val| half_to_whole_number(val) }. # =\u003e 1\n  result # =\u003e 1\n\nStreamlet.new { half_to_whole_number(12) }.     # =\u003e 6\n  and_then { |val| half_to_whole_number(val) }. # =\u003e 3\n  and_then { |val| half_to_whole_number(val) }. # =\u003e nil\n  and_then { |val| half_to_whole_number(val) }. # no-op\n  result # =\u003e nil\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/tjmw/streamlet. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the Streamlet project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/tjmw/streamlet/blob/master/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftjmw%2Fstreamlet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftjmw%2Fstreamlet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftjmw%2Fstreamlet/lists"}