From 8054989137b84edfa6bf061f708716536dc05d59 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 8 Apr 2010 17:26:27 -0700 Subject: unicorn_rails: respect user's encoding in config.ru in 1.9 Do not assume the user wants config.ru to be Encoding::BINARY for 1.9. This is a followup to a4a8bf7604d1c15c5a8fb9cb6be37e8bccb32e52 --- bin/unicorn_rails | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/unicorn_rails b/bin/unicorn_rails index de2361e..7c4afec 100755 --- a/bin/unicorn_rails +++ b/bin/unicorn_rails @@ -146,7 +146,7 @@ def rails_builder(config, daemonize) ActionController::Dispatcher.new end when /\.ru$/ - raw = File.open(config, "rb") { |fp| fp.sysread(fp.stat.size) } + raw = File.read(config) raw.sub!(/^__END__\n.*/, '') eval("Rack::Builder.new {(#{raw}\n)}.to_app", TOPLEVEL_BINDING, config) else -- cgit v1.2.3-24-ge0c7