25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
# File 'lib/wsoc/course.rb', line 25
def self.included(base)
base.module_eval do
set :host, Config::DEFAULT_HOST
set :port, Config::DEFAULT_PORT
set :root, File.expand_path(File.join(File.dirname(__FILE__),'..','..'))
set :course, File.join(self.root,'course')
enable :static, :sessions
helpers WSOC::Helpers
def self.course_template(path)
name = path[1..-1].gsub(/\.\S*$/,'').gsub(/\/+/,'_').to_sym
get(path) do
erb name, :layout => false
end
end
def self.course_pass(path)
get(path) do
erb :course_pass, :layout => false
end
end
end
end
|