-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.rb
44 lines (30 loc) · 808 Bytes
/
main.rb
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
lib = File.expand_path(File.dirname(__FILE__) + '/../lib')
$LOAD_PATH.unshift(lib) if File.directory?(lib) && !$LOAD_PATH.include?(lib)
point = File.expand_path(File.dirname(__FILE__))
$LOAD_PATH.unshift(point) if File.directory?(point) && !$LOAD_PATH.include?(point)
require 'rubygems'
require 'sinatra'
require 'dm-core'
require 'dm-migrations'
require 'haml'
DataMapper.setup(:default, ENV['DATABASE_URL'] || "sqlite3://#{Dir.pwd}/db/test.db")
require 'models/buildopt'
require 'models/slave'
require 'models/project'
require 'models/build'
#
# Apps
#
$menu = {}
$menu[:Home] = "/"
require 'app/slave'
require 'app/project'
require 'app/build'
require 'app/buildopt'
get '/' do
@projects = Project.all
@builds = Build.all
@slaves = Slave.all
haml :home
end
DataMapper.auto_upgrade!