Sha256: d4f6c8ccf3136ce5f19936c38b1e9d72ab17cf861fc1a72ec0ef04682aff8a5b
Contents?: true
Size: 1.15 KB
Versions: 11
Compression:
Stored size: 1.15 KB
Contents
require 'sinatra' require 'stickler/middleware' require 'stickler/middleware/index' require 'stickler/repository/local' 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 < 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
11 entries across 11 versions & 1 rubygems