Don't insert livereload script tag after <header> tags

This commit is contained in:
Sam Hunter 2012-12-10 02:48:41 -05:00
parent ebeb331f0f
commit 25a0d6465c
2 changed files with 2 additions and 2 deletions

View File

@ -1,6 +1,6 @@
require "rack/livereload" require "rack/livereload"
class Rack::LiveReload class Rack::LiveReload
VERSION = '0.3.9' VERSION = '0.4.0'
end end

View File

@ -77,7 +77,7 @@ module Rack
template = ERB.new(::File.read(::File.expand_path('../../../skel/livereload.html.erb', __FILE__))) template = ERB.new(::File.read(::File.expand_path('../../../skel/livereload.html.erb', __FILE__)))
if line['<head'] if line['<head']
line.gsub!(/<head[^>]*>/) { |match| %{#{match}#{template.result(binding)}} } line.gsub!(/<head(\s[^>])*>/) { |match| %{#{match}#{template.result(binding)}} }
end end
headers["X-Rack-LiveReload"] = '1' headers["X-Rack-LiveReload"] = '1'