Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix spec, don't rely on __FILE__

  • Loading branch information...
commit 57c71354bf1690a47aae2153de82ba4b4065fb28 1 parent 757d01f
Konstantin Haase authored
2  async-rack.gemspec
View
@@ -2,7 +2,7 @@ SPEC = Gem::Specification.new do |s|
# Get the facts.
s.name = "async-rack"
- s.version = "0.4.0"
+ s.version = "0.4.0.1"
s.description = "Makes middleware that ships with Rack bullet-proof for async responses."
# External dependencies
6 lib/async_rack/async_callback.rb
View
@@ -86,9 +86,9 @@ def included(klass)
private
def setup_late_initialize(klass)
class << klass
- def new(*args, &block)
- return super if File.expand_path(caller.first[/^[^:]+/]) == File.expand_path(__FILE__)
- proc { |env| new(*args, &block).call(env) }
+ def new(app, *args, &block)
+ return super(*args, &block) if app == false
+ proc { |env| new(false, app, *args, &block).call(env) }
end
end
end
2  spec/async_rack/async_callback_spec.rb
View
@@ -43,7 +43,7 @@ def call(env)
end
it "runs #call again on async callback, replacing app" do
- middleware = @class.create proc { throw :async }
+ middleware = @class.new false, proc { throw :async }
catch(:async) do
middleware.call "async.callback" => proc { |x| x + 10 }
raise "should not get here"
Please sign in to comment.
Something went wrong with that request. Please try again.