Permalink
Browse files

Fix use_in_file_templates! with jRuby on Windows

It's actually a workaround for a jRuby issue.

  http://jira.codehaus.org/browse/JRUBY-61

Signed-off-by: Simon Rozet <simon@rozet.name>
  • Loading branch information...
1 parent 3edd17d commit cf8dd2ac4a88017f3b160b530bfd1de9ae40397d @undees undees committed with sr Oct 3, 2009
Showing with 1 addition and 2 deletions.
  1. +1 −2 lib/sinatra/base.rb
View
@@ -689,13 +689,12 @@ def inline_templates=(file=nil)
begin
app, data =
- ::IO.read(file).split(/^__END__$/, 2)
+ ::IO.read(file).gsub("\r\n", "\n").split(/^__END__$/, 2)
rescue Errno::ENOENT
app, data = nil
end
if data
- data.gsub!(/\r\n/, "\n")
lines = app.count("\n") + 1
template = nil
data.each_line do |line|

0 comments on commit cf8dd2a

Please sign in to comment.