From 1cdcb696526ca455022cfc63a3bda75c160498d4 Mon Sep 17 00:00:00 2001 From: cn Date: Sat, 16 Feb 2013 10:45:49 +0100 Subject: [PATCH] Locate template relative to current file not cwd --- status.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/status.rb b/status.rb index 4ccce8e..976fc8f 100644 --- a/status.rb +++ b/status.rb @@ -1,3 +1,4 @@ +#!/usr/bin/env ruby require 'erb' @@ -27,7 +28,7 @@ class OpenVPNStatusWeb end 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 name = @name client_list, routing_table, global_stats = read_status_log(@file)