Sha256: 40cf4e19bfa9ef77683e408ed8af9ab47b5b1c39ee8edd2cfc367acc9ab766d7
Contents?: true
Size: 1.09 KB
Versions: 4
Compression:
Stored size: 1.09 KB
Contents
require 'stickler/middleware/index' module Stickler::Middleware # # A Sinatra middleware that implements the HTTP portions of a Modern gem server. # It sits on top of a Repository::Local and serves up the gems in it. # # It utilizies a Stickler::Repository::Local, and the :repo_root option # is passed directly to it. # # == Options # # <b>:serve_indexes</b>:: the same as the Index middleware # # <b>:repo_root</b>:: The path that is to be the root of the # Repository instance managed by this server. # # The <b>:repo_root</b> option is required. # # == Usage # # use Stickler::Middleware::Local, :repo_root => '/path/to/repository' # # use Stickler::Middleware::Local, :repo_root => '/path/to/repository', # :serve_indexes => true # class Local < ::Stickler::Middleware::Index def initialize( app = nil, opts = {} ) super( app, opts ) # overwrite the repo that is set in the parent @repo = ::Stickler::Repository::Local.new( opts[:repo_root] ) end end end
Version data entries
4 entries across 4 versions & 1 rubygems