{"id":26941477,"url":"https://github.com/vagascom/somecache","last_synced_at":"2025-08-04T16:43:04.390Z","repository":{"id":56896456,"uuid":"249461132","full_name":"VAGAScom/somecache","owner":"VAGAScom","description":"Somecache is a micro library to create and reuse cache configurations","archived":false,"fork":false,"pushed_at":"2022-07-22T05:42:12.000Z","size":16,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-02T15:39:23.538Z","etag":null,"topics":["cache","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/VAGAScom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-23T14:57:24.000Z","updated_at":"2020-06-04T01:23:37.000Z","dependencies_parsed_at":"2022-08-20T17:10:28.908Z","dependency_job_id":null,"html_url":"https://github.com/VAGAScom/somecache","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VAGAScom%2Fsomecache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VAGAScom%2Fsomecache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VAGAScom%2Fsomecache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VAGAScom%2Fsomecache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VAGAScom","download_url":"https://codeload.github.com/VAGAScom/somecache/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248044097,"owners_count":21038541,"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":["cache","ruby"],"created_at":"2025-04-02T16:19:51.952Z","updated_at":"2025-04-09T12:38:14.571Z","avatar_url":"https://github.com/VAGAScom.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Somecache\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'somecache'\n```\n\nAnd then execute:\n\n    $ bundle install\n\nOr install it yourself as:\n\n    $ gem install somecache\n\n## Usage\n\nSomecache is a wrapper to cache objects (following the `read`, `write`, `fetch` and `delete` api)\n\nThe aim is to easily create custom caches (with custom namespace or expiration options)\n\nWhen working with cache is easy to spread the logic of creation and deletion, like so:\n\n```ruby\n# Some Class\nRails.cache.fetch(\"products/#{product_id}\", expires_in: 1.day) { Product.find(product_id) }\n\n# Some Worker\nRails.cache.delete(\"products/#{product_id}\")\n```\n\nSomecache allows you to create and use the cache without spreading cache logic (like the namespace)\n\n```ruby\n# product_cache.rb\nProductCache = Somecache::Custom.new(namespace: 'products' , cache: Rails.cache, expires_in: 1.day)\n\n# Some Class\nProductCache.fetch(product_id) { Product.find(product_id) }\n\n# Some Worker\nProductCache.delete(product_id)\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/VAGAScom/somecache.\n\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvagascom%2Fsomecache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvagascom%2Fsomecache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvagascom%2Fsomecache/lists"}