lib/nanoc/helpers/xml_sitemap.rb in nanoc-4.7.9 vs lib/nanoc/helpers/xml_sitemap.rb in nanoc-4.7.10
- old
+ new
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
module Nanoc::Helpers
# @see http://nanoc.ws/doc/reference/helpers/#xmlsitemap
module XMLSitemap
# @option params [Array] :items
# @option params [Proc] :rep_select
@@ -11,10 +13,10 @@
# Extract parameters
items = params.fetch(:items) { @items.reject { |i| i[:is_hidden] } }
select_proc = params.fetch(:rep_select, nil)
# Create builder
- buffer = ''
+ buffer = String.new
xml = Builder::XmlMarkup.new(target: buffer, indent: 2)
# Check for required attributes
if @config[:base_url].nil?
raise 'The Nanoc::Helpers::XMLSitemap helper requires the site configuration to specify the base URL for the site.'