{"id":19840521,"url":"https://github.com/zefer/redised","last_synced_at":"2026-05-15T19:31:25.370Z","repository":{"id":3901479,"uuid":"4989693","full_name":"zefer/redised","owner":"zefer","description":"a simple module that allows you to setup your class or module with a redis connection","archived":false,"fork":false,"pushed_at":"2012-04-09T06:31:19.000Z","size":80,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-28T22:22:46.611Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":false,"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/zefer.png","metadata":{"files":{"readme":"README.rdoc","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":"2012-07-11T13:53:30.000Z","updated_at":"2017-04-04T16:58:14.000Z","dependencies_parsed_at":"2022-09-09T05:41:28.066Z","dependency_job_id":null,"html_url":"https://github.com/zefer/redised","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/zefer/redised","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zefer%2Fredised","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zefer%2Fredised/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zefer%2Fredised/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zefer%2Fredised/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zefer","download_url":"https://codeload.github.com/zefer/redised/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zefer%2Fredised/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33076154,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T11:35:32.926Z","status":"ssl_error","status_checked_at":"2026-05-15T11:35:31.362Z","response_time":103,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-11-12T12:27:14.016Z","updated_at":"2026-05-15T19:31:25.356Z","avatar_url":"https://github.com/zefer.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"= redised\n\nRedised provides a simple module for establishing reusable class level namespaced redis connections\nin your vanilla Ruby classes.\n\n== Why?\n\nWe use redis a lot throughout our apps. This pattern of having a class level `redis` method\nthats already namespaced and connected to a specific server via a config has served us well. \nIt has allowed us to split different usages across different namespaces and eventually\ndifferent hosts/servers.\n\n== Usage\n\nYou can include Redised as a module in your class.\n\n    class MyRedisClass\n      include Redised\n    end\n\nThis now gives you the power to assign the url of the redis server you want to connect to\nas a string:\n\n    MyRedisClass.redis = 'localhost:6739:1/myredisclass' # hostname:port:db/namespace\n    # also accepts a Redis or Redis::Namespace object\n\nThis gets a little easier and more powerful when you setup a YAML config:\n\n    # in config/redis.yml \n    ---\n    mynamespace:\n      development: localhost:6379\n      production: redis01:6379/mynamespace\n    othernamespace:\n      development: localhost:6379\n      production: redis01:6379/othernamespace\n\nYou can tell redised where this config lives:\n\n    Redised.redised_config_path = File.join(Rails.root, 'config', 'redis.yml')\n\nAnd what the 'env' is (will try to pull from RACK_ENV and RAILS_ENV):\n\n    Redised.redised_env = Rails.env #=\u003e 'production'\n\nThen in your class you tell it what namespace config this class points to:\n\n    class MyRedisClass\n      include Redised\n\n      redised_namespace 'mynamespace'\n\n    end\n\nIt will now automatically load the correct redis connection for your namespace/env:\n\n    MyRedisClass.redis #=\u003e #\u003cRedis::Namespace ..\u003e\n    MyRedisClass.redis.client.host #=\u003e 'redis01'\n    MyRedisClass.namespace #=\u003e 'mynamespace'\n\nThe implementation of the `self.redis` method is very close to the `Resque.redis` method and is\nactually a drop in replacement (if you want to load your connection settings from a config). Our\n`config/initializers/resque.rb` looks like:\n\n      module Resque\n        include Redised\n        extend self\n\n        redised_namespace 'paperless'\n      end\n\n== Acknowledgments\n\nThe original parsing of URL idea came from @defunkt/resque.\n\n== Contributing to redised\n \n* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.\n* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.\n* Fork the project.\n* Start a feature/bugfix branch.\n* Commit and push until you are happy with your contribution.\n* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.\n* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.\n\n== Copyright\n\nCopyright (c) 2012 Aaron Quint, Paperless Inc. See LICENSE.txt for further details.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzefer%2Fredised","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzefer%2Fredised","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzefer%2Fredised/lists"}