Sha256: 68ead044e9698325b6feedd7b8dc958ffe7fa913969b88936087446de753027b
Contents?: true
Size: 701 Bytes
Versions: 6
Compression:
Stored size: 701 Bytes
Contents
module CopycopterClient # Rack middleware that synchronizes with Copycopter during each request. # # This is injected into the Rails middleware stack in development environments. class RequestSync # @param app [Rack] the upstream app into whose responses to inject the editor # @param options [Hash] # @option options [Sync] :sync agent that should be flushed after each request def initialize(app, options) @app = app @sync = options[:sync] end # Invokes the upstream Rack application and flushes the sync after each # request. def call(env) @sync.download response = @app.call(env) @sync.flush response end end end
Version data entries
6 entries across 6 versions & 1 rubygems