Exceptional

Exceptional is a plugin for Ruby on Rails that brings exception handling into the world of RoR filters. Through two declarative statements that are similar in style to filter declarations in your controllers you get easy and powerful exception handling in your application.

handles:
The handles method allows you to specify a method that will handle an exception that is raised within your application and not caught by a normal rescue claus
raises:
The raises directive provides a exception-based version of the verify directive built into ruby on rails. This directive achieves its work using standard before_filters under the covers, and as such it follows the normal filter semantics.
Additionally, this plugin provides a framework for creating you own Exceptions that fit in with the Rails ecosystem.

Install

script/plugin install http://code.nullstyle.com/git/exceptional

See the README for the full docs. See below to see some sample incovations of the Exceptional plugin to get an idea of what you can do with it.

An invocation of the handles directive

    class SampleController < ApplicationController
      handles AccessDeniedError,
        :with => :accessdenied,
        :only => [:supahsekret_akshun]

  def supah_sekret_akshun
    ...
    raise AccessDeniedError
    ...
  end

  private
  def access_denied
    render :text =&gt; 'no, u kant'
  end
end

Sample invocations of the raises directive

    class SampleController < ApplicationController
      raises InvalidUpdateError, :unless => {:params => :id}, :only => :update
      raises BadJuju, :if => {:flash => :notice}, :only => :new

  raises AccessDeniedError :except =&gt; [:show, :list] do
    !@account.authorize :write, :update, :destroy
  end
end

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • DZone
  • Digg
  • Reddit
  • del.icio.us
  • Blue Dot
  • StumbleUpon
  • Netscape
  • Ma.gnolia
  • Slashdot
  • Technorati
  • NewsVine
  • Netvouz

Warning: touch() [function.touch]: Utime failed: Operation not permitted in /home/swampcat/nullstyle.com/wp-content/plugins/PHP Markdown 1.0.1k/markdown.php(1542) : runtime-created function on line 187
  • Viagra ordre
  • Cialis en ligne
  • Levitra en ligne
  • Propecia acheter
  • Viagra acheter
  • Acheter cialis
  • Ordre levitra
  • Ordre propecia
  • En ligne viagra
  • Vente cialis
  • Levitra bon marche
  • Propecia en ligne
  • Viagra online
  • Buy cialis
  • Order Levitra
  • Buy propecia
  • Buy viagra
  • Cheap cialis
  • Cheap Levitra
  • propecia online
  • Viagra prescription
  • Cialis online
  • Buy Levitra
  • Order propecia