From cf4d40caffefced8d7333cc4e207b05e4bfd2cb4 Mon Sep 17 00:00:00 2001 From: Steven Sloan Date: Thu, 5 May 2016 12:08:29 -0400 Subject: [PATCH] loosen contract on Resource#source_file to Maybe[String] (#1906) this could legitimately return nil if there is no file_descriptor, as would be the case for a StringResource --- middleman-core/lib/middleman-core/sitemap/resource.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/middleman-core/lib/middleman-core/sitemap/resource.rb b/middleman-core/lib/middleman-core/sitemap/resource.rb index ce1bc100..22b13498 100644 --- a/middleman-core/lib/middleman-core/sitemap/resource.rb +++ b/middleman-core/lib/middleman-core/sitemap/resource.rb @@ -80,7 +80,7 @@ module Middleman # Backwards compatible method for turning descriptor into a string. # @return [String] - Contract String + Contract Maybe[String] def source_file file_descriptor && file_descriptor[:full_path].to_s end