Skip to content

Commit

Permalink
Fix use_in_file_templates! with jRuby on Windows
Browse files Browse the repository at this point in the history
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
undees authored and sr committed Feb 22, 2010
1 parent 3edd17d commit cf8dd2a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/sinatra/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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|
Expand Down

0 comments on commit cf8dd2a

Please sign in to comment.