public
Description: A developer's QA "caddy" that aids in QA'ing, debugging, and otherwise navigating your application during development and/or QA.
Homepage:
Clone URL: git://github.com/jtrupiano/rails-caddy.git
name age message
file .gitignore Wed Apr 15 12:38:45 -0700 2009 ignore test/rails/**/* [George Anderson]
file IMPLEMENTATION Sat Mar 14 14:31:25 -0700 2009 Pulling the tests together for the Timecop-spec... [jtrupiano]
file LICENSE Wed Mar 11 16:42:39 -0700 2009 Set description in README [jtrupiano]
file README.rdoc Sun Apr 19 13:58:06 -0700 2009 Release to RubyForge required update of Rakefil... [jtrupiano]
file Rakefile Sat Apr 25 08:33:18 -0700 2009 Update the sanitize_email dependency to 0.1.1, ... [jtrupiano]
file TESTING Sun Apr 12 15:46:45 -0700 2009 Remove some unnecessary files, update some docs. [jtrupiano]
file TODO Tue Apr 14 12:23:17 -0700 2009 Documentation [jtrupiano]
file VERSION.yml Sun Apr 19 13:36:54 -0700 2009 Version bump to 0.0.8 [jtrupiano]
directory lib/ Sun Apr 19 14:01:10 -0700 2009 Fix RailsCaddy.isExtended equality comparison. [jtrupiano]
file rails-caddy.gemspec Sat Apr 25 08:33:18 -0700 2009 Update the sanitize_email dependency to 0.1.1, ... [jtrupiano]
directory rails/ Tue Apr 14 12:07:22 -0700 2009 Comment out rails/init.rb (can't get it to actu... [jtrupiano]
directory test/ Wed Apr 15 18:50:48 -0700 2009 easier testing/debugging with removal of public... [George Anderson]
README.rdoc

rails-caddy

A developer’s QA "caddy" that aids in QA’ing, debugging, and otherwise navigating your application during development and/or QA.

Rails Compatibility

Tests cover rails 2.1.2, 2.2.2, and 2.3.2 specifically. Previous releases on each minor version have not been explicitly tested, but I suspect they should all function equally well.

Installing

The gem is hosted on RubyForge.

    sudo gem install rails-caddy

Usage

RULE #1: DO NOT DEPLOY THIS TO PRODUCTION. I WILL HAVE NO EMPATHY WHATSOEVER IF YOU DO NOT HEED MY WARNING. THIS IS A VERY DANGEROUS GEM THAT WILL DEFINITELY SCREW YOU OVER IF YOU DEPLOY IT TO PRODUCTION.

This process is not currently scripted, but following these steps will get you off and running.

  • edit application.rb
      if Object.const_defined?(:RailsCaddy)
        helper RailsCaddyHelper
        around_filter :handle_sanitize_email
        around_filter :handle_timecop_offset, :except => [:timecop_update, :timecop_reset]
      end
    
  • edit config/environments/development.rb — DO NOT MAKE THIS AVAILABLE TO PRODUCTION!!!
      config.gem "rails-caddy"
    
      config.after_initialize do
        require 'rails-caddy'
        require_dependency 'application_controller' # 'application' if pre rails 2.3
        RailsCaddy.init!
    
        ActionMailer::Base.sanitized_recipients = "nobody@smartlogicsolutions.com"
      end
    
  • add just before you close your body tag in your layout (it’s actually unimportant where you place it, as long as it’s in the body):
      <%= rails_caddy if Object.const_defined?(:RailsCaddy) %>
    
  • add to the top of config/routes.rb
      RailsCaddy.define_routes!(map) if Object.const_defined?(:RailsCaddy)
    

RDoc

Dependencies

rails-caddy is dependent on the sanitize_email gem. Unfortunately, for the time being you’ll need to build and install that locally. Why? Because the dependency is on sanitize_email and NOT jtrupiano-sanitize_email, the latter of which can be installed remotely. Hopefully this will change soon.

Building/Testing

In order to run the tests, you’ll want to build the gem. Why? Because rake test:rails_compatibility tests all supported versions of rails (see Rails Compatibility, above). It does this by creating mini-Rails apps for each version and config-gem’ing rails-caddy (config.gem ‘rails-caddy’). If you don’t build the gem and try to run the tests, you’ll get an error telling you to run `rake gems:install`.

The easiest way to build the gem is to install technicalpickle's jeweler gem: sudo gem install jeweler.

After jeweler is installed, you can build and install with some handy rake tasks:

    rake build
    rake install

n.b. rake install uses sudo

(Problems? See Dependencies, above.)

Now you can run your tests:

    rake test:all                  # Run all test suites.
    rake test:rails_compatibility  # Test all supported versions of rails.

Copyright

Copyright © 2009 John Trupiano. See LICENSE for details.