From f10db73346b6ffc5de8fb26c39c58e5e82bc15ca Mon Sep 17 00:00:00 2001 From: Thomas Reynolds Date: Sat, 19 Nov 2011 19:04:06 -0800 Subject: [PATCH] simplify create_file --- lib/middleman/builder.rb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/middleman/builder.rb b/lib/middleman/builder.rb index fed9880c..3cb70526 100644 --- a/lib/middleman/builder.rb +++ b/lib/middleman/builder.rb @@ -19,12 +19,8 @@ module Middleman begin destination, request_path = SHARED_SERVER_INST.reroute_builder(destination, request_path) - request_path.gsub!(/\s/, "%20") - response = Middleman::Builder.shared_rack.get(request_path) - - create_file destination, nil, config do - response.body - end if response.status == 200 + response = Middleman::Builder.shared_rack.get(request_path.gsub(/\s/, "%20")) + create_file(destination, response.body, config) if response.status == 200 rescue say_status :error, destination, :red end