Put back request_path, I get it now

This commit is contained in:
Ben Hollis 2014-05-30 22:46:15 -07:00
parent b0ea4e7608
commit 2beb774eb9
3 changed files with 10 additions and 4 deletions

View file

@ -254,7 +254,7 @@ module Middleman::Cli
FileUtils.cp(resource.source_file, output_file)
else
begin
response = @rack.get(URI.escape(resource.destination_path))
response = @rack.get(URI.escape(resource.request_path))
if response.status == 200
base.create_file(output_file, binary_encode(response.body))

View file

@ -49,12 +49,13 @@ module Middleman
class EndpointResource < ::Middleman::Sitemap::Resource
attr_accessor :output
def initialize(store, path, source_file)
@request_path = ::Middleman::Util.normalize_path(source_file)
def initialize(store, path, request_path)
super(store, path)
@request_path = ::Middleman::Util.normalize_path(request_path)
end
attr_reader :request_path
def template?
true
end

View file

@ -20,6 +20,11 @@ module Middleman
# @return [String]
attr_accessor :destination_path
# The path to use when requesting this resource. Normally it's
# the same as {#destination_path} but it can be overridden in subclasses.
# @return [String]
alias_method :request_path, :destination_path
# Set the on-disk source file for this resource
# @return [String]
def source_file