diff --git a/anne-survey.rb b/anne-survey.rb index 1924898..7707122 100644 --- a/anne-survey.rb +++ b/anne-survey.rb @@ -7,7 +7,8 @@ Markaby::Builder.set(:indent, 2) Camping.goes :Anne -IMAGE_DIR = Pathname.new(__FILE__).dirname + "images" +PUBLIC_DIR = Pathname.new(__FILE__).dirname + "public" +IMAGE_DIR = PUBLIC_DIR + "images" module Anne @@ -117,7 +118,8 @@ module Anne::Controllers def get(file) unless file =~ /\.\./ headers["Content-Type"] = "image/png" - headers["X-Sendfile"] = (IMAGE_DIR + file).to_s + headers["X-Sendfile"] = + (IMAGE_DIR.relative_path_from(PUBLIC_DIR) + file).to_s else @status = 403 "You're not allowed to retrieve #{file}!" diff --git a/config.ru b/config.ru new file mode 100644 index 0000000..6c1f549 --- /dev/null +++ b/config.ru @@ -0,0 +1,11 @@ +#!/usr/bin/env rackup1.8 + +$LOAD_PATH.unshift "/home/paul/Projects/anne-survey/lib" + +require "anne-survey" + +Camping::Models::Base.establish_connection( :adapter => 'sqlite3', + :database => '/home/paul/.camping.db', + :timeout => 10000 ) + +run Anne diff --git a/public/images/tuelogo.gif b/public/images/tuelogo.gif new file mode 100644 index 0000000..a889cf2 Binary files /dev/null and b/public/images/tuelogo.gif differ