Sha256: e0f6af4253b5babf1848a15f9ee85b837aa57d3fd29b8b4e6f3b592bd375d735

Contents?: true

Size: 384 Bytes

Versions: 23

Compression:

Stored size: 384 Bytes

Contents

require 'dragonfly'

module Dragonfly
  class Middleware

    def initialize(app, dragonfly_app_name=nil)
      @app = app
      @dragonfly_app_name = dragonfly_app_name
    end

    def call(env)
      response = Dragonfly.app(@dragonfly_app_name).call(env)
      if response[1]['X-Cascade'] == 'pass'
        @app.call(env)
      else
        response
      end
    end

  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
dragonfly-1.4.0 lib/dragonfly/middleware.rb
dragonfly-1.3.0 lib/dragonfly/middleware.rb
dragonfly-1.2.1 lib/dragonfly/middleware.rb
dragonfly-1.2.0 lib/dragonfly/middleware.rb
dragonfly-1.1.5 lib/dragonfly/middleware.rb
dragonfly-1.1.4 lib/dragonfly/middleware.rb
dragonfly-1.1.3 lib/dragonfly/middleware.rb
dragonfly-1.1.2 lib/dragonfly/middleware.rb
dragonfly-1.1.1 lib/dragonfly/middleware.rb
dragonfly-1.1.0 lib/dragonfly/middleware.rb
dragonfly-1.0.12 lib/dragonfly/middleware.rb
dragonfly-1.0.11 lib/dragonfly/middleware.rb
dragonfly-1.0.10 lib/dragonfly/middleware.rb
dragonfly-1.0.9 lib/dragonfly/middleware.rb
dragonfly-1.0.8 lib/dragonfly/middleware.rb
dragonfly-1.0.7 lib/dragonfly/middleware.rb
dragonfly-1.0.6 lib/dragonfly/middleware.rb
dragonfly-1.0.5 lib/dragonfly/middleware.rb
dragonfly-1.0.4 lib/dragonfly/middleware.rb
dragonfly-1.0.3 lib/dragonfly/middleware.rb