Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add rack-flash

  • Loading branch information...
commit 5bc0ea70e7ada02a76bb4cdeb7a7add0c908f77b 1 parent ecae373
@rkh authored
Showing with 6 additions and 3 deletions.
  1. +2 −1  big_band.gemspec
  2. +4 −2 lib/sinatra/big_band.rb
View
3  big_band.gemspec
@@ -9,6 +9,7 @@ SPEC = Gem::Specification.new do |s|
# BigBand depedencies
Subproject.each { |p| s.add_dependency p.name, "~> #{s.version}" }
+ s.add_dependency 'rack-flash', '>= 0.1.1'
# External dependencies
s.add_development_dependency "rspec", ">= 1.3.0"
@@ -20,5 +21,5 @@ SPEC = Gem::Specification.new do |s|
s.has_rdoc = 'yard'
s.homepage = "http://github.com/rkh/#{s.name}"
s.require_paths = ["lib"]
- s.summary = s.description
+ s.summary = s.description
end
View
6 lib/sinatra/big_band.rb
@@ -1,7 +1,8 @@
require 'sinatra/base'
-require "sinatra/sugar"
+require 'sinatra/sugar'
require 'async-rack'
require 'monkey'
+require 'rack/flash'
module Sinatra
Base.ignore_caller
@@ -14,7 +15,7 @@ def self.subclass_extensions
def self.subclass_extension(path, development_only = false, parent = Sinatra, &block)
name = path.to_s.split('_').map { |e| e.capitalize }.join.to_sym
subclass_extensions[name] ||= [parent, name, development_only, block]
- parent.autoload name, "#{parent.name.downcase}/#{path}"
+ parent.autoload name, "#{parent.name.downcase}/#{path}" if parent
end
subclass_extension :advanced_routes
@@ -24,6 +25,7 @@ def self.subclass_extension(path, development_only = false, parent = Sinatra, &b
subclass_extension :namespace
subclass_extension :reloader, true
subclass_extension :sugar
+ subclass_extension(:flash, false, false) { |klass| klass.use Rack::Flash, :flash_app_class => klass }
def self.apply_options(klass)
klass.set :app_file, klass.caller_files.first.expand_path unless klass.app_file?
Please sign in to comment.
Something went wrong with that request. Please try again.