summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2012-01-05 23:09:50 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2012-01-05 23:09:50 +0100
commit7eb6a22e5549d25b95292c23498bd07f44c18fc8 (patch)
tree26168f5190befb94bba9736b94197b08ccb1ae0f /lib
parent8ffd9c7637bb0b9b25f87097d7df5626d2af306d (diff)
downloadzorglub-7eb6a22e5549d25b95292c23498bd07f44c18fc8.zip
zorglub-7eb6a22e5549d25b95292c23498bd07f44c18fc8.tar.gz
Node: static, write mime in front of content to speed up data retrieval
Diffstat (limited to 'lib')
-rw-r--r--lib/zorglub/node.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/zorglub/node.rb b/lib/zorglub/node.rb
index 850cffd..d38862c 100644
--- a/lib/zorglub/node.rb
+++ b/lib/zorglub/node.rb
@@ -141,10 +141,10 @@ module Zorglub
compile!
Dir.mkdir Config.static_base_path
Dir.mkdir File.dirname path
- File.open(path, 'w') {|f| f.write(@content); f.write("\n@mime:"+@mime) }
+ File.open(path, 'w') {|f| f.write("@mime:"+@mime+"\n"); f.write(@content); }
else
content = File.open(path, 'r') {|f| f.read }
- @content = content.sub /\n@mime:(.*)$/,''
+ @content = content.sub /^@mime:(.*)\n/,''
@mime = $1
end
end