0.0
No commit activity in last 3 years
No release in over 3 years
simple features: the cheap ass'ed flag flipper
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.15
~> 10.0
~> 3.0
 Project Readme

SimpleFeatures

Gem Version

Build Status

This gem was design to just one thing and do it well. (me thinks)

This gem is an overly simple implementation of feature flagging. The reason for that was, I found it easier to write a gem and learn how feature flagging works as opposed to learning from one of the existing feature gems.

Installation

Add this line to your application's Gemfile:

gem 'simple_features'

And then execute:

$ bundle

Or install it yourself as:

$ gem install simple_features

Usage

Basic usage

this can be assigned any where in code as

features = SimpleFeatures::Features.new( { feature_a: true, feature_a: false } )

puts "feature_a" if features.feature_a?
puts "feature_b" if features.feature_b?

Via Config file

features = SimpleFeatures::Features.load_config('config/simple_features.yml')

example config file

production:
  feature_one: true
  feature_two: false
  feature_three: true
puts features.feature_one?
>> true

puts features.feature_two?
>> false

puts features.feature_three?
>> true

Rails & Rails Helpers

Rails only needs to have the config file in config/simple_features.yml

rails generate simple_features

this will drop a template config: config/simple_features.yml

if you want to use the generator to create with feature names do the following

rails generate simple_features --features new_tool old_tool new_idea

puts features.new_idea?
>> true

examples

within Rails Views

<body>
<%= link_to 'New Feature', new_feature_path if features.new_feature? %>
</body>

“it’s simple” using simple features wrap around debugging coding (dont do this , its an example )

logger.debug "some aweomse words!" if features.debugging?

Tests

Some!. “it’s simple...” ok you got me I should write MOAR! tests.