lib/swagalicious/example_helpers.rb in swagalicious-0.5.1 vs lib/swagalicious/example_helpers.rb in swagalicious-0.5.2
- old
+ new
@@ -18,10 +18,16 @@
@headers = {}
end
end
def app
- @app ||= defined?(Rails) ? Rails.application : Rack::Builder.parse_file("config.ru").first
+ @app ||= if defined?(Rails)
+ Rails.application
+ elsif Rack::RELEASE >= "3.0.0"
+ Rack::Builder.parse_file("config.ru")
+ else
+ Rack::Builder.parse_file("config.ru").first
+ end
end
def client
@client ||= Faraday.new do |b|
b.adapter Faraday::Adapter::Rack, app