Sha256: 54a8b222381063812fd7455943c53c1f54511d7874d969d910d9ebe35b4dd0d5
Contents?: true
Size: 1003 Bytes
Versions: 8
Compression:
Stored size: 1003 Bytes
Contents
# -*- ruby -*- baseurl = nil basepath = '' themedir = nil %w[theme bitclust/theme ../bitclust/theme].each do |theme| dir = File.expand_path(theme, File.dirname(__FILE__)) if File.directory?(dir) themedir = dir end end $LOAD_PATH.unshift File.expand_path('lib', File.dirname(__FILE__)) $LOAD_PATH.unshift File.expand_path('bitclust/lib', File.dirname(__FILE__)) require 'bitclust/app' dbpath = Dir.glob("db-*") if dbpath.empty? raise 'database not found' unless File.directory? 'db' app = BitClust::App.new( :dbpath => 'db', :viewpath => "/view/", :rack => true ) app.interfaces.each do |viewpath, interface| map viewpath do run interface end end else app = BitClust::App.new( :dbpath => dbpath, :rack => true ) app.interfaces.each do |version, interface| map "#{basepath}/#{version}/" do run interface end end end map "#{basepath}/" do run app end map File.join(basepath, 'theme/') do run Rack::File.new(themedir) end
Version data entries
8 entries across 4 versions & 1 rubygems