Sha256: 2d81f3544c4d7d01c62223832a53c98a8f69baca752fea63f4770b066d8552c0

Contents?: true

Size: 1.19 KB

Versions: 1

Compression:

Stored size: 1.19 KB

Contents

# Experiment::Light

Turn features on or off in various rails environments

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'experiment_light'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install experiment_light

## Usage

Run install generator:

    $ rails generate experiment_light:install

A yaml file named `experiment.yml` will be added into `config/` after running install generator, now your can define your experimental features:

    foo:
        development: true
        test: true
        production: false

    bar:
        development: false
        test: true
        production: false

Now you can use it in your views like this:

    <% if ExperimentLight::Experiment.on?(:foo) %>
        <p>Experiment foo is on</p>
    <% end %>

    <% if ExperimentLight::Experiment.off?(:bar) %>
        <p>Experiment bar is off</p>
    <% end %>

## Contributing

1. Fork it ( https://github.com/[my-github-username]/experiment_light/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
experiment_light-0.1.0 README.md