README.md in experiment_light-0.2.0 vs README.md in experiment_light-0.3.0
- old
+ new
@@ -1,7 +1,10 @@
-# Experiment::Light
+# ExperimentLight
+[![Code Climate](https://codeclimate.com/github/Sen-Zhang/experiment_light/badges/gpa.svg)](https://codeclimate.com/github/Sen-Zhang/experiment_light)
+[![Build Status](https://travis-ci.org/Sen-Zhang/experiment_light.svg)](https://travis-ci.org/Sen-Zhang/experiment_light)
+
Turn features on or off in various rails environments
## Installation
Add this line to your application's Gemfile:
@@ -18,10 +21,12 @@
$ gem install experiment_light
## Usage
+### Basic
+
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:
@@ -75,9 +80,25 @@
<% end %>
<% if experiment_off?(:bar) %>
<p>Experiment bar is off</p>
<% end %>
+
+### Toggel feature from view
+
+Run install generator:
+
+ $ rails generate experiment_light:install_toggle
+
+- A controller file named `experiments_controller.rb` will be added into `app/controllers`
+- A view template file name 'index.html.erb' will be added into `app/views/experiments`
+- The following two routes will be added:
+
+ ```ruby
+ get 'experiments' => 'experiments#index'
+ post 'update_experiment' => 'experiments#update'
+ ```
+You may want to customize the newly generated files base on your need. Now you are ready to go to `localhost:3000/experiments` to check out and toggle your features.
## Contributing
1. Fork it ( https://github.com/[my-github-username]/experiment_light/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)