Sha256: 0d603d01408627ec425db20990e58e4d6bfcab98c143048003eb3f1963d107f3

Contents?: true

Size: 451 Bytes

Versions: 5

Compression:

Stored size: 451 Bytes

Contents

# encoding: UTF-8

module Spontaneous
  module Rack
    class AroundPreview
      def initialize(app)
        @app = app
        @renderer = Spontaneous::Output.preview_renderer
        Spontaneous::Output.renderer = @renderer
      end

      def call(env)
        env[Rack::RENDERER] = @renderer
        response = nil
        Content.with_identity_map do
          response = @app.call(env)
        end
        response
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
spontaneous-0.2.0.alpha7 lib/spontaneous/rack/around_preview.rb
spontaneous-0.2.0.alpha6 lib/spontaneous/rack/around_preview.rb
spontaneous-0.2.0.alpha5 lib/spontaneous/rack/around_preview.rb
spontaneous-0.2.0.alpha4 lib/spontaneous/rack/around_preview.rb
spontaneous-0.2.0.alpha3 lib/spontaneous/rack/around_preview.rb