lib/buildmaster/source_file_handler.rb in BuildMaster-0.5.0 vs lib/buildmaster/source_file_handler.rb in BuildMaster-0.6.0
- old
+ new
@@ -5,14 +5,14 @@
module BuildMaster
class SourceFileHandler < WEBrick::HTTPServlet::AbstractServlet
# uncomment the following for automatic servlet reloading
- def SourceFileHandler.get_instance config, *options
- load __FILE__
- SourceFileHandler.new config, *options
- end
+# def SourceFileHandler.get_instance config, *options
+# load __FILE__
+# SourceFileHandler.new config, *options
+# end
def initialize(server, spec)
super
@config = server.config
@logger = @config[:Logger]
@@ -45,20 +45,21 @@
def serve_generated_file(path, req, res)
file_path = @spec.content_dir + path
textile_file = "#{file_path}.textile"
html_file = "#{file_path}.html"
if File.file? textile_file
- stats = File::stat(textile_file)
+# stats = File::stat(textile_file)
document = FileProcessor.new(@spec.load_template, textile_file, @spec).process_textile()
elsif File.file? html_file
- stats = File::stat(html_file)
+# stats = File::stat(html_file)
document = FileProcessor.new(@spec.load_template, html_file, @spec).process_html()
end
if (document)
content = document.to_s
res['content-type'] = 'text/html'
res['content-length'] = content.length
- res['last-modified'] = stats.mtime.httpdate
+# res['last-modified'] = stats.mtime.httpdate
+ res['last-modified'] = DateTime.now
res.body = content
else
@delegate.service(req, res)
end
end
\ No newline at end of file