{"id":16746722,"url":"https://github.com/samuelgiles/there_was_an_attempt","last_synced_at":"2025-10-08T19:11:55.076Z","repository":{"id":56211354,"uuid":"252153823","full_name":"samuelgiles/there_was_an_attempt","owner":"samuelgiles","description":"A small utility designed to be used alongside Dry::Monads::Result to repeatedly attempt an operation sleeping between failed attempts.","archived":false,"fork":false,"pushed_at":"2020-11-20T08:55:50.000Z","size":11,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-07T09:55:06.965Z","etag":null,"topics":["backoff","backoff-strategy","exponential-backoff","http","monads","rails","ruby"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/samuelgiles.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-01T11:20:14.000Z","updated_at":"2022-06-23T12:16:27.000Z","dependencies_parsed_at":"2022-08-15T14:41:06.966Z","dependency_job_id":null,"html_url":"https://github.com/samuelgiles/there_was_an_attempt","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/samuelgiles/there_was_an_attempt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samuelgiles%2Fthere_was_an_attempt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samuelgiles%2Fthere_was_an_attempt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samuelgiles%2Fthere_was_an_attempt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samuelgiles%2Fthere_was_an_attempt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samuelgiles","download_url":"https://codeload.github.com/samuelgiles/there_was_an_attempt/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samuelgiles%2Fthere_was_an_attempt/sbom","scorecard":{"id":798392,"data":{"date":"2025-08-11","repo":{"name":"github.com/samuelgiles/there_was_an_attempt","commit":"478f0921d6c82c858368d8e012a9136cb2d6d585"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.1,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/rspec.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/rspec.yml:9: update your workflow using https://app.stepsecurity.io/secureworkflow/samuelgiles/there_was_an_attempt/rspec.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/rspec.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/samuelgiles/there_was_an_attempt/rspec.yml/master?enable=pin","Info:   0 out of   1 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Code-Review","score":0,"reason":"Found 0/5 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-23T09:41:04.567Z","repository_id":56211354,"created_at":"2025-08-23T09:41:04.567Z","updated_at":"2025-08-23T09:41:04.567Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278931654,"owners_count":26070789,"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-10-08T02:00:06.501Z","response_time":56,"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":["backoff","backoff-strategy","exponential-backoff","http","monads","rails","ruby"],"created_at":"2024-10-13T02:08:12.957Z","updated_at":"2025-10-08T19:11:55.040Z","avatar_url":"https://github.com/samuelgiles.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"![There was an attempt](https://user-images.githubusercontent.com/2643026/78128526-ff02ec80-740d-11ea-9226-40b15c437518.png)\n\n# There was an attempt [![Gem Version](https://badge.fury.io/rb/there_was_an_attempt.svg)](https://badge.fury.io/rb/there_was_an_attempt) ![RSpec](https://github.com/samuelgiles/there_was_an_attempt/workflows/RSpec/badge.svg)\n\nA small utility designed to be used alongside [Dry::Monads::Result](https://dry-rb.org/gems/dry-monads/) to repeatedly attempt an operation sleeping between failed attempts.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'there_was_an_attempt'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install there_was_an_attempt\n\n## Usage\n\nWithout any arguments given to the constructor a basic backoff interval (2, 4, 8, 16 to be precise) is used with `sleep` being used to wait, as a nicety this is available as `.attempt`:\n\n```ruby\n# Shortcut for: ThereWasAnAttempt.new.attempt\nThereWasAnAttempt.attempt do\n    Dry::Monads::Success(true)\nend\n```\n\nYou can specify your backoff intervals manually:\n\n```ruby\nThereWasAnAttempt.new(intervals: [1,2,4,8]).attempt do\n    Dry::Monads::Success(true)\nend\n```\n\nYou can optionally specify your own \"wait\" logic. This might be useful for logging \u0026 tracking your retries:\n\n```ruby\nThereWasAnAttempt.new(\n    intervals: [1,2,4,8],\n    wait: -\u003e(seconds) { puts seconds; sleep seconds }\n).attempt do\n    Dry::Monads::Success(true)\nend\n```\n\nAnd more importantly you can optionally specify your own \"reattempt\" condition so as to only retry when the condition is true. This is really useful for dealing with network requests when you might only want to retry for specific network errors and works great when combined with [`Dry::Monads::Try`](https://dry-rb.org/gems/dry-monads/master/try/).\n\n```ruby\nThereWasAnAttempt.new(\n    reattempt: -\u003e (failure) { failure.is_a?(Net::HTTPRetriableError) }\n).attempt do\n    Dry::Monads::Try(Net::HTTPExceptions) do\n        Dry::Monads::Success(true)\n    end.to_result\nend\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/samuelgiles/there_was_an_attempt.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamuelgiles%2Fthere_was_an_attempt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamuelgiles%2Fthere_was_an_attempt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamuelgiles%2Fthere_was_an_attempt/lists"}