From 9e8a16cd6dfd4ae1d781d3c63876a87d791ed92e Mon Sep 17 00:00:00 2001 From: Ben Hollis Date: Wed, 27 Nov 2013 00:19:59 -0800 Subject: [PATCH] Switch back to single-variable storage for Sitemap::Resource#destination_path --- .../lib/middleman-core/sitemap/resource.rb | 20 +++++++------------ 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/middleman-core/lib/middleman-core/sitemap/resource.rb b/middleman-core/lib/middleman-core/sitemap/resource.rb index d3566033..d33260b3 100644 --- a/middleman-core/lib/middleman-core/sitemap/resource.rb +++ b/middleman-core/lib/middleman-core/sitemap/resource.rb @@ -23,6 +23,10 @@ module Middleman # @return [String] attr_reader :path + # The output path for this resource + # @return [String] + attr_accessor :destination_path + # Set the on-disk source file for this resource # @return [String] # attr_reader :source_file @@ -40,8 +44,7 @@ module Middleman @app = @store.app @path = path.gsub(' ', '%20') # handle spaces in filenames @source_file = source_file - - @destination_paths = [@path] + @destination_path = @path @local_metadata = { :options => {}, :locals => {}, :page => {}, :blocks => [] } end @@ -85,18 +88,9 @@ module Middleman @local_metadata[:blocks] += [ block ] if block_given? end - # Get the output/preview URL for this resource + # The output/preview URL for this resource # @return [String] - def destination_path - @destination_paths.last - end - - # Set the output/preview URL for this resource - # @param [String] path - # @return [void] - def destination_path=(path) - @destination_paths << path - end + attr_accessor :destination_path # Extension of the path (i.e. '.js') # @return [String]