From 1c57626445e27e35621242e9b8f5e30977e3af96 Mon Sep 17 00:00:00 2001 From: PiotrMisiurek Date: Fri, 6 May 2016 09:12:03 +0200 Subject: [PATCH] Fix contract for Sitemap::Store.register_resource_list_manipulator (#1907) Contract said that optional param priority can be only a number. But the code also handle the boolean as a value to be compatibile with old versions Change contract to accept both Num and Bool --- middleman-core/lib/middleman-core/sitemap/store.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/middleman-core/lib/middleman-core/sitemap/store.rb b/middleman-core/lib/middleman-core/sitemap/store.rb index 47e678ba..25913c7e 100644 --- a/middleman-core/lib/middleman-core/sitemap/store.rb +++ b/middleman-core/lib/middleman-core/sitemap/store.rb @@ -102,7 +102,7 @@ module Middleman # @param [Numeric] priority Sets the order of this resource list manipulator relative to the rest. By default this is 50, and manipulators run in the order they are registered, but if a priority is provided then this will run ahead of or behind other manipulators. # @param [Symbol] custom_name The method name to execute. # @return [void] - Contract Symbol, RespondTo[:manipulate_resource_list], Maybe[Num], Maybe[Symbol] => Any + Contract Symbol, RespondTo[:manipulate_resource_list], Maybe[Num, Bool], Maybe[Symbol] => Any def register_resource_list_manipulator(name, manipulator, priority=50, custom_name=nil) # The third argument used to be a boolean - handle those who still pass one priority = 50 unless priority.is_a? Numeric