Switch back to single-variable storage for Sitemap::Resource#destination_path

This commit is contained in:
Ben Hollis 2013-11-27 00:19:59 -08:00
parent fd9f726b9a
commit 9e8a16cd6d

View file

@ -23,6 +23,10 @@ module Middleman
# @return [String] # @return [String]
attr_reader :path attr_reader :path
# The output path for this resource
# @return [String]
attr_accessor :destination_path
# Set the on-disk source file for this resource # Set the on-disk source file for this resource
# @return [String] # @return [String]
# attr_reader :source_file # attr_reader :source_file
@ -40,8 +44,7 @@ module Middleman
@app = @store.app @app = @store.app
@path = path.gsub(' ', '%20') # handle spaces in filenames @path = path.gsub(' ', '%20') # handle spaces in filenames
@source_file = source_file @source_file = source_file
@destination_path = @path
@destination_paths = [@path]
@local_metadata = { :options => {}, :locals => {}, :page => {}, :blocks => [] } @local_metadata = { :options => {}, :locals => {}, :page => {}, :blocks => [] }
end end
@ -85,18 +88,9 @@ module Middleman
@local_metadata[:blocks] += [ block ] if block_given? @local_metadata[:blocks] += [ block ] if block_given?
end end
# Get the output/preview URL for this resource # The output/preview URL for this resource
# @return [String] # @return [String]
def destination_path attr_accessor :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
# Extension of the path (i.e. '.js') # Extension of the path (i.e. '.js')
# @return [String] # @return [String]