-
-
Notifications
You must be signed in to change notification settings - Fork 68
/
config.ru
48 lines (40 loc) · 1.16 KB
/
config.ru
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
require 'ginatra'
require 'sprockets'
require 'bootstrap-sass'
map '/assets' do
environment = Sprockets::Environment.new
root_path = File.dirname __FILE__
environment.append_path "#{root_path}/public/js"
environment.append_path "#{root_path}/public/css"
environment.context_class.class_eval do
def asset_path(path, options = {})
end
end
run environment
end
if Ginatra.config.git_clone_enabled?
require 'mkmf'
require 'git/webby'
# Make the mkmf logger write file output to null
if RUBY_VERSION[0] == '1'
module Logging; @logfile = File::NULL; end
else
module MakeMakefile::Logging; @logfile = File::NULL; end
end
git_executable = find_executable 'git'
raise 'Git executable not found in PATH' if git_executable.nil?
root_path = File.dirname __FILE__
Git::Webby::HttpBackend.configure do |server|
server.project_root = "#{root_path}/repos"
server.git_path = git_executable
server.get_any_file = true
server.upload_pack = false
server.receive_pack = false
server.authenticate = false
end
run Rack::Cascade.new [Git::Webby::HttpBackend, Ginatra::App]
else
map '/' do
run Ginatra::App
end
end