Permalink
Browse files

Note moved status

  • Loading branch information...
jnunemaker committed Apr 28, 2015
1 parent c24fda5 commit c0516b2dd9f4f0e116db8cd6542646166f9d64a8
Showing with 4 additions and 592 deletions.
  1. +0 −18 .gitignore
  2. +0 −11 .travis.yml
  3. +0 −13 Gemfile
  4. +0 −18 Guardfile
  5. +0 −22 LICENSE
  6. +4 −117 README.md
  7. +0 −5 Rakefile
  8. +0 −27 examples/basic.rb
  9. +0 −71 examples/internals.rb
  10. +0 −20 flipper-redis.gemspec
  11. +0 −1 lib/flipper-redis.rb
  12. +0 −142 lib/flipper/adapters/redis.rb
  13. +0 −7 lib/flipper/adapters/redis/version.rb
  14. +0 −21 script/bootstrap
  15. +0 −42 script/release
  16. +0 −23 script/test
  17. +0 −23 spec/flipper/redis_spec.rb
  18. +0 −11 spec/helper.rb
View
@@ -1,18 +0,0 @@
-*.gem
-*.rbc
-.bundle
-.config
-.yardoc
-Gemfile.lock
-InstalledFiles
-_yardoc
-coverage
-doc/
-lib/bundler/man
-pkg
-rdoc
-spec/reports
-test/tmp
-test/version_tmp
-tmp
-log
View
@@ -1,11 +0,0 @@
-language: ruby
-rvm:
- - 1.8.7
- - ree
- - 1.9.3
-notifications:
- email: false
-bundler_args: --without guard
-before_script: sudo service redis-server status
-services:
- - redis-server
View
13 Gemfile
@@ -1,13 +0,0 @@
-source 'https://rubygems.org'
-gemspec
-
-gem 'redis-namespace', :require => false
-gem 'rake'
-gem 'rspec'
-
-group(:guard) do
- gem 'guard'
- gem 'guard-rspec'
- gem 'guard-bundler'
- gem 'rb-fsevent'
-end
View
@@ -1,18 +0,0 @@
-# A sample Guardfile
-# More info at https://github.com/guard/guard#readme
-
-guard 'bundler' do
- watch('Gemfile')
- watch(/^.+\.gemspec/)
-end
-
-rspec_options = {
- :all_after_pass => false,
- :all_on_start => false,
-}
-
-guard 'rspec', rspec_options do
- watch(%r{^spec/.+_spec\.rb$}) { "spec" }
- watch(%r{^lib/(.+)\.rb$}) { "spec" }
- watch('spec/helper.rb') { "spec" }
-end
View
22 LICENSE
@@ -1,22 +0,0 @@
-Copyright (c) 2012 John Nunemaker
-
-MIT License
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
121 README.md
@@ -1,119 +1,6 @@
-# Flipper Redis
+# MOVED
-A [Redis](https://github.com/redis/redis-rb) adapter for [Flipper](https://github.com/jnunemaker/flipper).
+This repo has merged with the main flipper repo. The gem is still separate. You can read more over at the main flipper repo:
-## Installation
-
-Add this line to your application's Gemfile:
-
- gem 'flipper-redis'
-
-And then execute:
-
- $ bundle
-
-Or install it yourself with:
-
- $ gem install flipper-redis
-
-## Usage
-
-```ruby
-require 'flipper/adapters/redis'
-client = Redis.new
-adapter = Flipper::Adapters::Redis.new(client)
-flipper = Flipper.new(adapter)
-# profit...
-```
-
-## Internals
-
-Each feature is stored in a redis hash, which means getting a feature is single query.
-
-```ruby
-require 'flipper/adapters/redis'
-require 'redis/namespace'
-
-client = Redis.new
-namespaced_client = Redis::Namespace.new(:flipper, :redis => client)
-adapter = Flipper::Adapters::Redis.new(namespaced_client)
-flipper = Flipper.new(adapter)
-
-# Register a few groups.
-Flipper.register(:admins) { |thing| thing.admin? }
-Flipper.register(:early_access) { |thing| thing.early_access? }
-
-# Create a user class that has flipper_id instance method.
-User = Struct.new(:flipper_id)
-
-flipper[:stats].enable
-flipper[:stats].enable flipper.group(:admins)
-flipper[:stats].enable flipper.group(:early_access)
-flipper[:stats].enable User.new('25')
-flipper[:stats].enable User.new('90')
-flipper[:stats].enable User.new('180')
-flipper[:stats].enable flipper.random(15)
-flipper[:stats].enable flipper.actors(45)
-
-flipper[:search].enable
-
-print 'all keys: '
-pp namespaced_client.keys
-# all keys: ["stats", "flipper_features", "search"]
-
-print "known flipper features: "
-pp namespaced_client.smembers("flipper_features")
-# known flipper features: ["stats", "search"]
-
-puts 'stats keys'
-pp namespaced_client.hgetall('stats')
-# stats keys
-# {"boolean"=>"true",
-# "groups/admins"=>"1",
-# "actors/25"=>"1",
-# "percentage_of_random"=>"15",
-# "percentage_of_actors"=>"45",
-# "groups/early_access"=>"1",
-# "actors/90"=>"1",
-# "actors/180"=>"1"}
-
-puts 'search keys'
-pp namespaced_client.hgetall('search')
-# search keys
-# {"boolean"=>"true"}
-
-puts 'flipper get of feature'
-pp adapter.get(flipper[:stats])
-# flipper get of feature
-# {:boolean=>"true",
-# :groups=>#<Set: {"admins", "early_access"}>,
-# :actors=>#<Set: {"25", "90", "180"}>,
-# :percentage_of_actors=>"45",
-# :percentage_of_random=>"15"}
-```
-
-## `script/bootstrap`
-
-This script will get all the dependencies ready so you can start hacking.
-
-```
-# to learn more about script/bootstrap
-script/bootstrap help
-```
-
-## `script/test`
-
-For your convenience, there is a script to run the tests. It will also perform `script/bootstrap`, which bundles and all that jazz.
-
-```
-# to learn more about script test
-script/test help
-```
-
-## Contributing
-
-1. Fork it
-2. Create your feature branch (`git checkout -b my-new-feature`)
-3. Commit your changes (`git commit -am 'Added some feature'`)
-4. Push to the branch (`git push origin my-new-feature`)
-5. Create new Pull Request
+https://github.com/jnunemaker/flipper
+https://github.com/jnunemaker/flipper/blob/master/docs/redis/README.md
View
@@ -1,5 +0,0 @@
-#!/usr/bin/env rake
-require 'rspec/core/rake_task'
-RSpec::Core::RakeTask.new
-
-task :default => :spec
View
@@ -1,27 +0,0 @@
-require 'pathname'
-require 'logger'
-
-root_path = Pathname(__FILE__).dirname.join('..').expand_path
-lib_path = root_path.join('lib')
-$:.unshift(lib_path)
-
-require 'flipper/adapters/redis'
-client = Redis.new
-adapter = Flipper::Adapters::Redis.new(client)
-flipper = Flipper.new(adapter)
-
-flipper[:stats].enable
-
-if flipper[:stats].enabled?
- puts "Enabled!"
-else
- puts "Disabled!"
-end
-
-flipper[:stats].disable
-
-if flipper[:stats].enabled?
- puts "Enabled!"
-else
- puts "Disabled!"
-end
View
@@ -1,71 +0,0 @@
-require 'pp'
-require 'pathname'
-require 'logger'
-
-root_path = Pathname(__FILE__).dirname.join('..').expand_path
-lib_path = root_path.join('lib')
-$:.unshift(lib_path)
-
-require 'flipper/adapters/redis'
-require 'redis/namespace'
-
-client = Redis.new
-namespaced_client = Redis::Namespace.new(:flipper, :redis => client)
-adapter = Flipper::Adapters::Redis.new(namespaced_client)
-flipper = Flipper.new(adapter)
-
-# Register a few groups.
-Flipper.register(:admins) { |thing| thing.admin? }
-Flipper.register(:early_access) { |thing| thing.early_access? }
-
-# Create a user class that has flipper_id instance method.
-User = Struct.new(:flipper_id)
-
-flipper[:stats].enable
-flipper[:stats].enable flipper.group(:admins)
-flipper[:stats].enable flipper.group(:early_access)
-flipper[:stats].enable User.new('25')
-flipper[:stats].enable User.new('90')
-flipper[:stats].enable User.new('180')
-flipper[:stats].enable flipper.random(15)
-flipper[:stats].enable flipper.actors(45)
-
-flipper[:search].enable
-
-print 'all keys: '
-pp namespaced_client.keys
-# all keys: ["stats", "flipper_features", "search"]
-puts
-
-print "known flipper features: "
-pp namespaced_client.smembers("flipper_features")
-# known flipper features: ["stats", "search"]
-puts
-
-puts 'stats keys'
-pp namespaced_client.hgetall('stats')
-# stats keys
-# {"boolean"=>"true",
-# "groups/admins"=>"1",
-# "actors/25"=>"1",
-# "percentage_of_random"=>"15",
-# "percentage_of_actors"=>"45",
-# "groups/early_access"=>"1",
-# "actors/90"=>"1",
-# "actors/180"=>"1"}
-puts
-
-puts 'search keys'
-pp namespaced_client.hgetall('search')
-# search keys
-# {"boolean"=>"true"}
-puts
-
-puts 'flipper get of feature'
-pp adapter.get(flipper[:stats])
-# flipper get of feature
-# {:boolean=>"true",
-# :groups=>#<Set: {"admins", "early_access"}>,
-# :actors=>#<Set: {"25", "90", "180"}>,
-# :percentage_of_actors=>"45",
-# :percentage_of_random=>"15"}
View
@@ -1,20 +0,0 @@
-# -*- encoding: utf-8 -*-
-require File.expand_path('../lib/flipper/adapters/redis/version', __FILE__)
-
-Gem::Specification.new do |gem|
- gem.name = "flipper-redis"
- gem.version = Flipper::Adapters::Redis::VERSION
- gem.authors = ["John Nunemaker"]
- gem.email = ["nunemaker@gmail.com"]
- gem.description = %q{Redis adapter for Flipper}
- gem.summary = %q{Redis adapter for Flipper}
- gem.homepage = "http://jnunemaker.github.com/flipper-redis"
- gem.require_paths = ["lib"]
-
- gem.files = `git ls-files`.split($/)
- gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
- gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
-
- gem.add_dependency 'flipper', '~> 0.7.0.beta1'
- gem.add_dependency 'redis', '>= 2.2', '< 4.0.0'
-end
View
@@ -1 +0,0 @@
-require 'flipper/adapters/redis'
Oops, something went wrong.

0 comments on commit c0516b2

Please sign in to comment.