Take the 2008 Git User's Survey and help out! [ hide ]

public
Fork of animoto/feature-hider
Description: A way to hide features based on Rails environment.
Clone URL: git://github.com/nakajima/feature-hider.git
Search Repo:
name age message
folder MIT-LICENSE Tue Jun 17 13:28:58 -0700 2008 initial commit [nakajima]
folder README Tue Jun 17 13:34:03 -0700 2008 added a TODO to README [nakajima]
folder Rakefile Tue Jun 17 13:28:58 -0700 2008 initial commit [nakajima]
folder init.rb Tue Jun 17 13:28:58 -0700 2008 initial commit [nakajima]
folder install.rb Tue Jun 17 13:28:58 -0700 2008 initial commit [nakajima]
folder lib/ Tue Jun 17 13:28:58 -0700 2008 initial commit [nakajima]
folder tasks/ Tue Jun 17 13:28:58 -0700 2008 initial commit [nakajima]
folder test/ Tue Jun 17 13:28:58 -0700 2008 initial commit [nakajima]
folder uninstall.rb Tue Jun 17 13:28:58 -0700 2008 initial commit [nakajima]
README
Feature Hider
============

Hide features based on the current Rails environment.

Example
=======

First, specify your new features in config/features.yml. You can
generate this file by running the following rake task:

  $ rake hider:config:generate

Let's say you're about to release a feature you call "chunky bacon" 
that you only want active in development and staging for now. Here's
how you'd specify that in features.yml:

  chunky_bacon:
    test: true
    development: true
    staging: false
    production: false


So now in your view, you can do something like this:

  <%- if FEATURES[:chunky_bacon].active? -%>
    This is where the chunky bacon goes.
  <%- else -%>
    No chunky bacon here... yet.
  <%- end -%>

Obviously, when you're ready to push the feature out to all of your
environments, you can just remove the conditional.

That's pretty much it for now.

TODO
====

* Time-based feature activations (so a feature would go active at a certain date/time)

Copyright (c) 2008 Pat Nakajima, Animoto Productions, released under the MIT license