Sha256: 4afaf5c7125746d89f3c765784f74fd1585740b5b62fe63453018f695559b475

Contents?: true

Size: 463 Bytes

Versions: 1

Compression:

Stored size: 463 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
        Spontaneous::Content.scope(nil, true) do
          response = @app.call(env)
        end
        response
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
spontaneous-0.2.0.beta1 lib/spontaneous/rack/around_preview.rb