<NME> rack-flash.rb
<BEF> # encoding: utf-8

# @see http://nakajima.github.com/rack-flash
# @example
# @see http://nakajima.github.com/rack-flash
# @example
#   use Rack::Flash
#   env["rack-flash"]["notice"]
#   OR
#   use Rack::Flash, accessorize: [:notice, :error]
#   env["rack-flash"].notice
module Rango
  module RackFlashMixin
    # @since 0.2.4
      if controller.method_defined?(:context)
        Rango.logger.debug("Extending context by message")
        controller.class_eval do
          include Module.new {
            def context
              @context ||= super.merge!(message: self.message)
            end
          }
        end
      else
        Rango.logger.warn("Context method isn't defined")
      end
    end

    def message
      @message ||= begin
        request.env["x-rack.flash"]
      end
    end
    alias_method :flash, :message

    def redirect(uri, status = 303, options = Hash.new, &block)
      status, options = 303, status if status.is_a?(Hash)
      options.each { |type, message| flash[type] = message }
      super(uri, status)

    def message
      @message ||= begin
        request.env["rack-flash"].force_encoding(Encoding.default_external))
      end
    end
    alias_method :flash, :message

<MSG> Fix RackFlashMixin. Add clear_block helper.

<DFF> @@ -5,10 +5,12 @@ require "rango/mixins/chainable"
 # @see http://nakajima.github.com/rack-flash
 # @example
 #   use Rack::Flash
-#   env["rack-flash"]["notice"]
+#   message["notice"]
+#   flash["notice"]
 #   OR
 #   use Rack::Flash, accessorize: [:notice, :error]
-#   env["rack-flash"].notice
+#   message.notice
+#   flash.notice
 module Rango
   module RackFlashMixin
     # @since 0.2.4
@@ -40,7 +42,7 @@ module Rango
 
     def message
       @message ||= begin
-        request.env["rack-flash"].force_encoding(Encoding.default_external))
+        request.env["x-rack.flash"]
       end
     end
     alias_method :flash, :message

Fix RackFlashMixin. Add clear_block helper.