h1. Ruby and Rails Rules Engine Framework h4. More detailed documentation at "www.r3ef.com":http://www.r3ef.com h2. Installation Guide h3. 1. Create the Rails App
rails new MyCoolNewApp --skip-test-unit cd MyCoolNewApp rm ./public/index.htmlh3. 2. Add & Install the gems ./Gemfile
gem 'rules_engine', '>= 0.3.0' gem 'will_paginate', '>= 3.0.pre2' gem 'acts_as_list', '>= 0.1.2' group :development, :test do gem "rspec-rails", ">= 2.0.0.beta.22" gem "webrat" gem 'faker' gem 'machinist' end bundle installh3. 3. Set a Root Path ./config/routes.rb
root :to => "re_plans#index"h3. 4. Generate the Code
script/rails generate rspec:install script/rails generate rules_engine:installh3. 5. Define the Access Levels ./app/controllers/application_controller.rb
class ApplicationController < ActionController::Base helper_method :rules_engine_reader?, :rules_engine_editor? def rules_engine_reader? # why cookies[:rules_engine_reader] ? It's a workaround for cucumber testing return cookies[:rules_engine_reader].nil? ? true : cookies[:rules_engine_reader].downcase == 'true' end def rules_engine_editor? # why cookies[:rules_engine_editor] ? It's a workaround for cucumber testing return cookies[:rules_engine_editor].nil? ? true : cookies[:rules_engine_editor].downcase == 'true' end def rules_engine_reader_access_required unless rules_engine_reader? redirect_to(root_path) flash[:success] = 'Rules Engine Access Denied.' end end def rules_engine_editor_access_required unless rules_engine_editor? redirect_to(root_path) flash[:success] = 'Rules Engine Editor Access Denied.' end endh3. 6. Migrate the Database
rake db:migrate rake db:migrate RAILS_ENV=testh3. 7. Create the Rule Scaffolds Simple Rule
script/rails generate rules_engine:rule simple my_simple_ruleComplex Rule
script/rails generate rules_engine:rule complex my_complex_ruleh3. 8. Run the Tests
rake spech3. 9. Start the Server
script/rails server open http://localhost:3000/re_pipelinesh3. 10. Create Workflows and Rules Watch the demo at "TODO":http://www.r3ef.com/