Sha256: f32ad7f87b1e281e67d83d38f5d0bf58c5d356002c170c25e8292c05906f9242

Contents?: true

Size: 312 Bytes

Versions: 3

Compression:

Stored size: 312 Bytes

Contents

class UState::Dash::Static
  def initialize(app, options = {})
    @app = app
    @root = options[:root] or raise ArgumentError, "no root"
    @file_server = ::Rack::File.new(@root)
  end

  def call(env)
    r = @file_server.call env
    if r[0] == 404   
      @app.call env
    else
      r
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ustate-client-0.0.8 lib/ustate/dash/rack/static.rb
ustate-client-0.0.7 lib/ustate/dash/rack/static.rb
ustate-client-0.0.6 lib/ustate/dash/rack/static.rb