From: Bernard Lambeau Date: 2013-04-17T14:49:03+09:00 Subject: [ANN] rack-robustness 1.1.0 --089e010d85741d919b04da87eecd Content-Type: text/plain; charset=ISO-8859-1 Hi all! rack-robustness 1.1.0 is out, it provides the rescue/ensure clause of your rack stack. * http://github.com/blambeau/rack-robustness == CHANGELOG # 1.1.0 / 2013-04-16 * Fixed catching of non standard errors (e.g. SecurityError) * Global headers are now correctly overrided by specific per-exception headers * Renamed `#on` as `#rescue` for better capturing semantics of `on` blocks (now an alias). * Added last resort exception handling if an error occurs during exception handling itself. In `no_catch_all` mode, the exception is simply reraised; otherwise a default 500 error is returned with a safe message. * Added a shortcut form for `#rescue` clauses allowing values directly, e.g., use Rack::Robustness do |g| g.rescue(SecurityError, 403) end * Added suppport for ensure clause(s), always called after `rescue` blocks * Rack's `env` is now available in all error handling blocks, e.g., use Rack::Robustness do |g| g.status{|ex| ... env ... } g.body {|ex| ... env ... } g.rescue(SecurityError){|ex| ... env ... } g.ensure{|ex| ... env ... } end * Similarly, Rack::Robustness now internally uses instances of Rack::Request and Rack::Response; `request` and `response` are available in all blocks. The specific Response object to use can be built using the `response` DSL method, e.g., use Rack::Robustness do |g| g.response{|ex| MyOwnRackResponse.new } end * Rack::Robustness may now be subclassed as an alternative to inline `use`, e.g. class Shield < Rack::Robustness self.body {|ex| ... } self.rescue(SecurityError){|ex| ... } ... end # in Rack-based configuration use Shield Have a nice day! Bernard --089e010d85741d919b04da87eecd Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi all!

rack-robustness 1.1.0 is out, it provides the res= cue/ensure clause of your rack stack.

= * http://github.com/= blambeau/rack-robustness

=3D=3D CHANGELOG

=
# 1.1.0 / 2013-04-16

* Fixed catch= ing of non standard errors (e.g. SecurityError)

* = Global headers are now correctly overrided by specific per-exception header= s

* Renamed `#on` as `#rescue` for better capturing seman= tics of `on` blocks (now an alias).

* Added last r= esort exception handling if an error occurs during exception handling itsel= f.
=A0 In `no_catch_all` mode, the exception is simply reraised; otherwis= e a default 500 error
=A0 is returned with a safe message.
<= div>
* Added a shortcut form for `#rescue` clauses allowing v= alues directly, e.g.,

=A0 =A0 =A0 =A0 use Rack::Robustness do |g|
= =A0 =A0 =A0 =A0 =A0 g.rescue(SecurityError, 403)
=A0 =A0 =A0 =A0 = end

* Added suppport for ensure clause(s), always = called after `rescue` blocks

* Rack's `env` is now available in all error handli= ng blocks, e.g.,

=A0 =A0 =A0 =A0 use Rack::Robustn= ess do |g|
=A0 =A0 =A0 =A0 =A0 g.status{|ex| ... env ... }
<= div>=A0 =A0 =A0 =A0 =A0 g.body =A0{|ex| ... env ... }
=A0 =A0 =A0 =A0 =A0 g.rescue(SecurityError){|ex| ... env ... }
=A0 =A0 =A0 =A0 =A0 g.ensure{|ex| ... env ... }
=A0 =A0 =A0 = =A0 end

* Similarly, Rack::Robustness now internal= ly uses instances of Rack::Request and Rack::Response; `request` and `respo= nse` are available in all blocks. The specific Response
=A0 object to use can be built using the `response` DSL method, e.g.,<= /div>

=A0 =A0 =A0 =A0 use Rack::Robustness do |g|
<= div>=A0 =A0 =A0 =A0 =A0 g.response{|ex| MyOwnRackResponse.new }
= =A0 =A0 =A0 =A0 end

* Rack::Robustness may now be subclassed as an alternat= ive to inline `use`, e.g.

=A0 =A0 =A0 =A0 class Sh= ield < Rack::Robustness
=A0 =A0 =A0 =A0 =A0 self.body =A0{|ex|= ... }
=A0 =A0 =A0 =A0 =A0 self.rescue(SecurityError){|ex| ... }
=A0 =A0= =A0 =A0 =A0 ...
=A0 =A0 =A0 =A0 end

=A0= =A0 =A0 =A0 # in Rack-based configuration
=A0 =A0 =A0 =A0 use Sh= ield

Have a nice day!
Bernard
--089e010d85741d919b04da87eecd--