https://github.com/resque/redis-namespace
This gem adds a Redis::Namespace class which can be used to namespace Redis keys.
https://github.com/resque/redis-namespace
Keywords from Contributors
activerecord mvc activejob rubygems background-jobs rack job-scheduler job-queue sinatra asynchronous-tasks
Last synced: about 22 hours ago
JSON representation
Repository metadata
This gem adds a Redis::Namespace class which can be used to namespace Redis keys.
- Host: GitHub
- URL: https://github.com/resque/redis-namespace
- Owner: resque
- License: mit
- Created: 2009-10-13T21:48:43.000Z (over 16 years ago)
- Default Branch: master
- Last Pushed: 2024-08-02T02:01:11.000Z (over 1 year ago)
- Last Synced: 2026-02-26T14:12:55.601Z (5 days ago)
- Language: Ruby
- Homepage: http://redis.io
- Size: 301 KB
- Stars: 696
- Watchers: 20
- Forks: 193
- Open Issues: 30
- Releases: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
README.md
redis-namespace
Redis::Namespace provides an interface to a namespaced subset of your redis keyspace (e.g., keys with a common beginning), and requires the redis-rb gem.
require 'redis-namespace'
# => true
redis_connection = Redis.new
# => #<Redis client v3.1.0 for redis://127.0.0.1:6379/0>
namespaced_redis = Redis::Namespace.new(:ns, redis: redis_connection)
# => #<Redis::Namespace v1.5.0 with client v3.1.0 for redis://127.0.0.1:6379/0/ns>
namespaced_redis.set('foo', 'bar') # redis_connection.set('ns:foo', 'bar')
# => "OK"
# Redis::Namespace automatically prepended our namespace to the key
# before sending it to our redis client.
namespaced_redis.get('foo')
# => "bar"
redis_connection.get('foo')
# => nil
redis_connection.get('ns:foo')
# => "bar"
namespaced_redis.del('foo')
# => 1
namespaced_redis.get('foo')
# => nil
redis_connection.get('ns:foo')
# => nil
Redis::Namespace also supports Proc as a namespace and will take the result string as namespace at runtime.
redis_connection = Redis.new
namespaced_redis = Redis::Namespace.new(Proc.new { Tenant.current_tenant }, redis: redis_connection)
Installation
Redis::Namespace is packaged as the redis-namespace gem, and hosted on rubygems.org.
From the command line:
$ gem install redis-namespace
Or in your Gemfile:
gem 'redis-namespace'
Caveats
Redis::Namespace provides a namespaced interface to Redis by keeping an internal registry of the method signatures in Redis provided by the redis-rb gem; we keep track of which arguments need the namespace added, and which return values need the namespace removed.
Blind Passthrough
If your version of this gem doesn't know about a particular command, it can't namespace it. Historically, this has meant that Redis::Namespace blindly passes unknown commands on to the underlying redis connection without modification which can lead to surprising effects.
As of v1.5.0, blind passthrough has been deprecated, and the functionality will be removed entirely in 2.0.
If you come across a command that is not yet supported, please open an issue on the issue tracker or submit a pull-request.
Administrative Commands
The effects of some redis commands cannot be limited to a particular namespace (e.g., FLUSHALL, which literally truncates all databases in your redis server, regardless of keyspace). Historically, this has meant that Redis::Namespace intentionally passes administrative commands on to the underlying redis connection without modification, which can lead to surprising effects.
As of v1.6.0, the direct use of administrative commands has been deprecated, and the functionality will be removed entirely in 2.0; while such commands are often useful for testing or administration, their meaning is inherently hidden when placed behind an interface that implies it will namespace everything.
The prefered way to send an administrative command is on the redis connection itself, which is publicly exposed as Redis::Namespace#redis:
namespaced.redis.flushall()
# => "OK"
2.x Planned Breaking Changes
As mentioned above, 2.0 will remove blind passthrough and the administrative command passthrough.
By default in 1.5+, deprecation warnings are present and enabled;
they can be silenced by initializing Redis::Namespace with warning: false or by setting the REDIS_NAMESPACE_QUIET environment variable.
Early opt-in
To enable testing against the 2.x interface before its release, in addition to deprecation warnings, early opt-in to these changes can be enabled by initializing Redis::Namespace with deprecations: true or by setting the REDIS_NAMESPACE_DEPRECATIONS environment variable.
This should only be done once all warnings have been addressed.
Authors
While there are many authors who have contributed to this project, the following have done so on an ongoing basis with at least 5 commits:
- Chris Wanstrath (@defunkt)
- Ryan Biesemeyer (@yaauie)
- Steve Klabnik (@steveklabnik)
- Terence Lee (@hone)
- Eoin Coffey (@ecoffey)
Owner metadata
- Name: Resque
- Login: resque
- Email:
- Kind: organization
- Description:
- Website:
- Location:
- Twitter:
- Company:
- Icon url: https://avatars.githubusercontent.com/u/3876747?v=4
- Repositories: 12
- Last ynced at: 2024-03-25T19:40:35.354Z
- Profile URL: https://github.com/resque
GitHub Events
Total
- Pull request event: 1
- Fork event: 2
- Watch event: 5
- Pull request review event: 1
Last Year
- Pull request event: 1
- Watch event: 2
- Pull request review event: 1
Committers metadata
Last synced: 2 days ago
Total Commits: 261
Total Committers: 104
Avg Commits per committer: 2.51
Development Distribution Score (DDS): 0.824
Commits in past year: 0
Committers in past year: 0
Avg Commits per committer in past year: 0.0
Development Distribution Score (DDS) in past year: 0.0
| Name | Commits | |
|---|---|---|
| Chris Wanstrath | c****s@o****g | 46 |
| Ryan Biesemeyer | r****n@s****m | 45 |
| Terence Lee | h****2@g****m | 11 |
| ota42y | o****y@g****m | 10 |
| Steve Klabnik | s****e@s****m | 7 |
| Stefan Budeanu | s****u@s****m | 5 |
| Jean Boussier | j****r@g****m | 5 |
| Łukasz Strzałkowski | l****i@g****m | 4 |
| Rafael Mendonça França | r****l@f****v | 4 |
| Nicholas La Roux | l****n@g****m | 4 |
| Carl Zulauf | c****l@l****m | 4 |
| Menno van der Sman | m****o@w****m | 4 |
| David Czarnecki | c****d@a****g | 4 |
| fatkodima | f****3@g****m | 3 |
| Caius Durling | d****v@c****e | 3 |
| Adam Mckaig | a****g@g****m | 3 |
| j-wilkins | p****y@m****m | 3 |
| anothermh | a****h | 2 |
| Patrick Tulskie | p****e@g****m | 2 |
| Michael Bianco | i****y@g****m | 2 |
| Jakub Suder | j****r@g****m | 2 |
| Galen O'Hanlon | g****n@p****m | 2 |
| Florian Weingarten | f****o@h****e | 2 |
| Filip Tepper | f****p@t****l | 2 |
| Denis Tataurov | s****s@m****u | 2 |
| Todd Thomas | t****s@o****m | 2 |
| Andrii Dmytrenko | a****i@f****m | 1 |
| Aliaksandr Buhayeu | a****u@g****m | 1 |
| Alexey Zapparov | i****i@m****g | 1 |
| Alexander Kahn | a****n@g****m | 1 |
| and 74 more... | ||
Committer domains:
- shopify.com: 2
- madebymany.co.uk: 1
- gnipcentral.com: 1
- viximo.com: 1
- potreromedia.com: 1
- bfrydl.com: 1
- davidczarnecki.com: 1
- mlsdev.com: 1
- maxstudio.com.br: 1
- member.fsf.org: 1
- fetlife.com: 1
- openlogic.com: 1
- mail.ru: 1
- tepper.pl: 1
- hackvalue.de: 1
- plastictrophy.com: 1
- me.com: 1
- caius.name: 1
- acm.org: 1
- wakoopa.com: 1
- linkleaf.com: 1
- franca.dev: 1
- steveklabnik.com: 1
- simplymeasured.com: 1
- gsa.gov: 1
- griffinonline.org: 1
- kmwhite.net: 1
- uberweiss.org: 1
- redhat.com: 1
- delstrother.com: 1
- ferrandis.cool: 1
- ideopolis.gr: 1
- adfitech.com: 1
- paralaus.com: 1
- sunfox.org: 1
- weppos.net: 1
- depold.com: 1
- sj26.com: 1
- ryanbigg.com: 1
- barelyenough.org: 1
- orien.io: 1
- platogo.com: 1
- productmadness.com: 1
- flowerpowered.com: 1
- northwestern.edu: 1
- saltpepper.ru: 1
- activeprospect.com: 1
- pivotallabs.com: 1
- ozmm.org: 1
Issue and Pull Request metadata
Last synced: 17 days ago
Total issues: 35
Total pull requests: 80
Average time to close issues: 10 months
Average time to close pull requests: 9 months
Total issue authors: 34
Total pull request authors: 65
Average comments per issue: 2.69
Average comments per pull request: 1.46
Merged pull request: 55
Bot issues: 0
Bot pull requests: 2
Past year issues: 0
Past year pull requests: 2
Past year average time to close issues: N/A
Past year average time to close pull requests: N/A
Past year issue authors: 0
Past year pull request authors: 1
Past year average comments per issue: 0
Past year average comments per pull request: 0.0
Past year merged pull request: 0
Past year bot issues: 0
Past year bot pull requests: 0
Top Issue Authors
- mperham (2)
- Ghanimaid (1)
- everaldo (1)
- mhenrixon (1)
- vannicktrinquier (1)
- ytaben (1)
- librato-peter (1)
- Marcellllll (1)
- pravi (1)
- Nerian (1)
- bnymn (1)
- Buk1m (1)
- ArturT (1)
- djanowski (1)
- ThomasKoppensteiner (1)
Top Pull Request Authors
- casperisfine (4)
- larouxn (3)
- fatkodima (3)
- jbmeerkat (2)
- dependabot[bot] (2)
- amatsuda (2)
- PatrickTulskie (2)
- francois-ferrandis (2)
- quentinvernot (2)
- ota42y (2)
- maximebedard (2)
- danlo (1)
- aliaksandrb (1)
- pdamer (1)
- pedrofurtado (1)
Top Issue Labels
Top Pull Request Labels
- dependencies (2)
- github_actions (2)
Package metadata
- Total packages: 13
-
Total downloads:
- rubygems: 395,884,605 total
- Total docker downloads: 923,323,282
- Total dependent packages: 302 (may contain duplicates)
- Total dependent repositories: 21,146 (may contain duplicates)
- Total versions: 140
- Total maintainers: 10
gem.coop: redis-namespace
Adds a Redis::Namespace class which can be used to namespace calls to Redis. This is useful when using a single instance of Redis with multiple, different applications.
- Homepage: https://github.com/resque/redis-namespace
- Documentation: http://www.rubydoc.info/gems/redis-namespace/
- Licenses: MIT
- Latest release: 1.11.0 (published over 2 years ago)
- Last Synced: 2026-03-01T09:02:02.150Z (2 days ago)
- Versions: 45
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 197,938,080 Total
- Docker Downloads: 461,661,641
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 0.09%
- Downloads: 0.125%
- Docker downloads count: 0.235%
- Maintainers (10)
rubygems.org: redis-namespace
Adds a Redis::Namespace class which can be used to namespace calls to Redis. This is useful when using a single instance of Redis with multiple, different applications.
- Homepage: https://github.com/resque/redis-namespace
- Documentation: http://www.rubydoc.info/gems/redis-namespace/
- Licenses: MIT
- Latest release: 1.11.0 (published over 2 years ago)
- Last Synced: 2026-03-01T15:31:57.225Z (2 days ago)
- Versions: 45
- Dependent Packages: 302
- Dependent Repositories: 21,146
- Downloads: 197,946,525 Total
- Docker Downloads: 461,661,641
-
Rankings:
- Downloads: 0.115%
- Dependent packages count: 0.142%
- Dependent repos count: 0.244%
- Docker downloads count: 0.297%
- Average: 0.825%
- Forks count: 1.939%
- Stargazers count: 2.215%
- Maintainers (10)
proxy.golang.org: github.com/resque/redis-namespace
- Homepage:
- Documentation: https://pkg.go.dev/github.com/resque/redis-namespace#section-documentation
- Licenses: mit
- Latest release: v1.11.0 (published over 2 years ago)
- Last Synced: 2026-02-28T09:28:49.800Z (3 days ago)
- Versions: 40
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent packages count: 6.515%
- Average: 6.733%
- Dependent repos count: 6.952%
ubuntu-22.04: ruby-redis-namespace
- Homepage: https://github.com/resque/redis-namespace
- Licenses:
- Latest release: 1.8.1-1 (published 18 days ago)
- Last Synced: 2026-02-13T13:24:30.716Z (18 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
ubuntu-23.04: ruby-redis-namespace
- Homepage: https://github.com/resque/redis-namespace
- Licenses:
- Latest release: 1.9.0-1 (published 20 days ago)
- Last Synced: 2026-02-11T06:48:22.213Z (20 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
ubuntu-20.04: ruby-redis-namespace
- Homepage: https://github.com/resque/redis-namespace
- Licenses:
- Latest release: 1.7.0-1 (published 18 days ago)
- Last Synced: 2026-02-13T07:21:37.869Z (18 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
debian-11: ruby-redis-namespace
- Homepage: https://github.com/resque/redis-namespace
- Documentation: https://packages.debian.org/bullseye/ruby-redis-namespace
- Licenses:
- Latest release: 1.7.0-1 (published 20 days ago)
- Last Synced: 2026-02-13T08:24:17.462Z (18 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
ubuntu-23.10: ruby-redis-namespace
- Homepage: https://github.com/resque/redis-namespace
- Licenses:
- Latest release: 1.9.0-1 (published 18 days ago)
- Last Synced: 2026-02-13T18:31:22.279Z (18 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
debian-10: ruby-redis-namespace
- Homepage: https://github.com/resque/redis-namespace
- Documentation: https://packages.debian.org/buster/ruby-redis-namespace
- Licenses:
- Latest release: 1.6.0-1 (published 20 days ago)
- Last Synced: 2026-02-13T04:25:07.677Z (18 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
debian-12: ruby-redis-namespace
- Homepage: https://github.com/resque/redis-namespace
- Documentation: https://packages.debian.org/bookworm/ruby-redis-namespace
- Licenses:
- Latest release: 1.9.0-1 (published 18 days ago)
- Last Synced: 2026-02-12T23:39:26.080Z (18 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
debian-13: ruby-redis-namespace
- Homepage: https://github.com/resque/redis-namespace
- Documentation: https://packages.debian.org/trixie/ruby-redis-namespace
- Licenses:
- Latest release: 1.11.0-2 (published 19 days ago)
- Last Synced: 2026-02-13T13:19:03.534Z (18 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
Dependencies
- rubysl-cgi >= 0
- rubysl-logger >= 0
- rubysl-net-http >= 0
- rubysl-socket >= 0
- rubysl-stringio >= 0
- rubysl-timeout >= 0
- rubysl-uri >= 0
- rubysl-zlib >= 0
- rake >= 0 development
- rspec ~> 3.7 development
- rspec-its >= 0 development
- redis >= 3.0.4
- actions/checkout v3 composite
- ruby/setup-ruby v1 composite
- redis * docker
- actions/checkout v3 composite
- github/codeql-action/analyze v2 composite
- github/codeql-action/autobuild v2 composite
- github/codeql-action/init v2 composite
Score: 32.2322550286955