Sha256: d26aa12e6625142aa38521c183de1350d2b92c73edf8803bc1f8c32f2ec9e5cb

Contents?: true

Size: 683 Bytes

Versions: 26

Compression:

Stored size: 683 Bytes

Contents

module OodAppkit
  # Middleware that serves entries below the `root` given, according to the
  # path info of the Rack request.
  # @see http://www.rubydoc.info/github/rack/rack/master/Rack/Directory Descripton of `Rack::Directory`
  class FilesRackApp
    # The root path on file system that this app serves entries from below
    # @return [String] the root path
    attr_accessor :root

    # @param root [String, #to_s] the root path
    def initialize(root: OodAppkit.dataroot)
      @root = root.to_s
    end

    # Use `Rack::Directory` as middleware with `root` set as `dataroot` by
    # default
    def call(env)
      Rack::Directory.new(root).call(env)
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
ood_appkit-2.1.4 lib/ood_appkit/files_rack_app.rb
ood_appkit-2.1.1 lib/ood_appkit/files_rack_app.rb
ood_appkit-2.1.0 lib/ood_appkit/files_rack_app.rb
ood_appkit-2.0.2 lib/ood_appkit/files_rack_app.rb
ood_appkit-1.1.5 lib/ood_appkit/files_rack_app.rb
ood_appkit-1.0.3 lib/ood_appkit/files_rack_app.rb
ood_appkit-1.0.2 lib/ood_appkit/files_rack_app.rb
ood_appkit-1.0.1 lib/ood_appkit/files_rack_app.rb
ood_appkit-1.0.0 lib/ood_appkit/files_rack_app.rb
ood_appkit-0.3.6 lib/ood_appkit/files_rack_app.rb
ood_appkit-0.3.5 lib/ood_appkit/files_rack_app.rb
ood_appkit-0.3.4 lib/ood_appkit/files_rack_app.rb
ood_appkit-0.3.3 lib/ood_appkit/files_rack_app.rb
ood_appkit-0.3.2 lib/ood_appkit/files_rack_app.rb
ood_appkit-0.3.1 lib/ood_appkit/files_rack_app.rb
ood_appkit-0.3.0 lib/ood_appkit/files_rack_app.rb
ood_appkit-0.2.8 lib/ood_appkit/files_rack_app.rb
ood_appkit-0.2.7 lib/ood_appkit/files_rack_app.rb
ood_appkit-0.2.6 lib/ood_appkit/files_rack_app.rb
ood_appkit-0.2.5 lib/ood_appkit/files_rack_app.rb