1
0
mirror of https://github.com/cmur2/openvpn-status-web.git synced 2024-11-05 04:56:17 +01:00

Locate template relative to current file not cwd

This commit is contained in:
cn 2013-02-16 10:45:49 +01:00
parent bdf26997a5
commit 1cdcb69652

View File

@ -1,3 +1,4 @@
#!/usr/bin/env ruby
require 'erb' require 'erb'
@ -27,7 +28,7 @@ class OpenVPNStatusWeb
end end
def call(env) def call(env)
main_tmpl = read_template('main.html.erb') main_tmpl = read_template(File.join(File.dirname(__FILE__), 'main.html.erb'))
# variables for template # variables for template
name = @name name = @name
client_list, routing_table, global_stats = read_status_log(@file) client_list, routing_table, global_stats = read_status_log(@file)