Sha256: 8ed6b27393b802c26c33e2b46d07e66be07e7a3ed35e66c5092158ac3a247cc1
Contents?: true
Size: 624 Bytes
Versions: 16
Compression:
Stored size: 624 Bytes
Contents
require "omnicontacts" module OmniContacts class Builder < Rack::Builder def initialize(app, &block) if rack14? super else @app = app super(&block) end end def rack14? Rack.release.split('.')[1].to_i >= 4 end def importer importer, *args middleware = OmniContacts::Importer.const_get(importer.to_s.capitalize) use middleware, *args rescue NameError raise LoadError, "Could not find importer #{importer}." end def call env @ins << @app unless rack14? || @ins.include?(@app) to_app.call(env) end end end
Version data entries
16 entries across 16 versions & 1 rubygems