Add rack 2 check

This commit is contained in:
Thomas Walpole 2015-08-20 16:46:02 -07:00
parent 9184d30f6c
commit bfe063f12a
1 changed files with 5 additions and 1 deletions

View File

@ -2,7 +2,7 @@ module OmniAuth
class Builder < ::Rack::Builder
def initialize(app, &block)
@options = nil
if rack14?
if rack14? || rack2?
super
else
@app = app
@ -15,6 +15,10 @@ module OmniAuth
Rack.release.split('.')[1].to_i >= 4
end
def rack2?
Rack.release.start_with? '2.'
end
def on_failure(&block)
OmniAuth.config.on_failure = block
end