## Ruby and Rails Rules Engine Framework # More detailed documentation at http://www.r3ef.com ## Installation Guide ###################################### # 1. Install the Gem sudo gem install rules_engine sudo gem install rules_engine_users sudo gem install will_paginate ###################################### # 2. Add to the existing Rails App ./script/generate rules_engine_users ###################################### # 3. Setup the Rails Environments - ./config/environment.rb Rails::Initializer.run do |config| ... config.gem 'rules_engine' config.gem 'rules_engine_users' config.gem 'will_paginate' ... config.active_record.observers = :user_observer ... end - ./config/environments/production.rb - ./config/environments/development.rb config.action_mailer.delivery_method = :smtp config.action_mailer.smtp_settings = { :address => "XXX", :port => 25, :user_name => "XXX", :password => "XXX", :domain => "XXX", :authentication => :login } RulesEngine::ControllerUserMail.host = 'domain.com' RulesEngine::ControllerUserMail.from = 'domain.com' RulesEngine::ControllerUserMail.prefix = 'My Cool App' - ./config/environments/test.rb - ./config/environments/cucumber.rb config.gem 'cucumber-rails', :lib => false, :version => '>=0.3.0' config.gem 'database_cleaner', :lib => false, :version => '>=0.5.0' config.gem 'webrat', :lib => false, :version => '>=0.7.0' config.gem "rspec", :version => '>=1.3.0', :lib => false config.gem "rspec-rails", :version => '>=1.3.2', :lib => false config.gem "faker", :version => '>=0.3.1', :lib => false config.gem "machinist", :version => '>=1.0.6', :lib => false config.gem 'rcov', :version => '>=0.9.8', :lib => false config.gem 'remarkable_rails', :version => '>=3.1.13', :lib => false require 'machinist/active_record' require 'sham' require 'faker' require 'remarkable_rails' ###################################### # 4. Add the Routes - ./config/routes.rb ActionController::Routing::Routes.draw do |map| ... map.with_options :controller => 'users', :path_prefix => '/user', :name_prefix => 'user_' do |user| user.login '/', :action => 'login_form', :conditions => { :method => :get } user.login '/', :action => 'login', :conditions => { :method => :post } user.signup '/signup', :action => 'signup_form', :conditions => { :method => :get } user.signup '/signup', :action => 'signup', :conditions => { :method => :post } user.logout '/logout', :action => 'logout' user.pswd_forgot '/pswd_forgot', :action => 'pswd_forgot_form', :conditions => { :method => :get } user.pswd_forgot '/pswd_forgot', :action => 'pswd_forgot', :conditions => { :method => :post } user.pswd_change '/pswd_change', :action => 'pswd_change_form', :conditions => { :method => :get } user.pswd_change '/pswd_change', :action => 'pswd_change', :conditions => { :method => :post } user.details '/details', :action => 'details', :conditions => { :method => :get } user.change '/change', :action => 'change_form', :conditions => { :method => :get } user.change '/change', :action => 'change', :conditions => { :method => :put } user.pswd_reset '/pswd_reset', :action => 'pswd_reset_form', :conditions => { :method => :get } user.pswd_reset '/pswd_reset', :action => 'pswd_reset', :conditions => { :method => :post } user.welcome '/welcome', :action => 'welcome_form', :conditions => { :method => :get } user.welcome '/welcome', :action => 'welcome', :conditions => { :method => :post } end map.namespace :admin do |admin| admin.index '/', :controller => 'users', :action => 'index' admin.resources :users, :controller => 'users' end ... end ###################################### # 5. Install the Required Gems rake gems:install rake gems:install RAILS_ENV=test ###################################### # 6. Migrate the Database rake db:migrate rake db:migrate RAILS_ENV=test ###################################### # 7. Run the Tests rake spec rake spec:rcov rake cucumber open coverage/index.html ###################################### # 8. Start the Server ./script/server open http://localhost:3000/re_pipelines