Skip to content

Commit

Permalink
Rack::Builder: Allow more than one line of DATA-block
Browse files Browse the repository at this point in the history
  • Loading branch information
judofyr committed Oct 13, 2011
1 parent bd3dcda commit ff47d6a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rack/builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def self.parse_file(config, opts = Server::Options.new)
if cfgfile[/^#\\(.*)/] && opts
options = opts.parse! $1.split(/\s+/)
end
cfgfile.sub!(/^__END__\n.*/, '')
cfgfile.sub!(/^__END__\n.*\Z/m, '')
app = eval "Rack::Builder.new {\n" + cfgfile + "\n}.to_app",
TOPLEVEL_BINDING, config
else
Expand Down
2 changes: 2 additions & 0 deletions test/builder/end.ru
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
run lambda { |env| [200, {'Content-Type' => 'text/plain'}, ['OK']] }
__END__
Should not be evaluated
Neither should
This

0 comments on commit ff47d6a

Please sign in to comment.