Skip to content
Browse files

actually use block

  • Loading branch information...
1 parent b573eb8 commit ecae373d44636dc0cd5b40af05f86819cc554f72 @rkh committed May 2, 2010
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/sinatra/big_band.rb
View
8 lib/sinatra/big_band.rb
@@ -28,7 +28,7 @@ def self.subclass_extension(path, development_only = false, parent = Sinatra, &b
def self.apply_options(klass)
klass.set :app_file, klass.caller_files.first.expand_path unless klass.app_file?
klass.set :haml, :format => :html5, :escape_html => true
- enable :sessions
+ enable :sessions, :method_override, :show_exceptions
end
def self.subclass_for(list, inspection = nil)
@@ -48,10 +48,10 @@ def self.generate_subclass(options = {})
options[:except] ||= []
options.keys.each { |k| raise ArgumentError, "unkown option #{k.inspect}" unless k == :except }
options[:except] = [*options[:except]]
- list = subclass_extensions.inject([]) do |chosen, (ident, (parent, name, dev))|
+ list = subclass_extensions.inject([]) do |chosen, (ident, (parent, name, dev, block))|
next chosen if options[:except].include? ident or (dev and not development?)
- extension = parent.const_get name
- chosen << proc { |klass| klass.register extension }
+ block ||= proc { |klass| klass.register parent.const_get(name) }
+ chosen << block
end
subclass_for list, "#{self}(#{options.inspect[1..-2]})"
end

0 comments on commit ecae373

Please sign in to comment.
Something went wrong with that request. Please try again.