@@ -100,11 +100,7 @@ def build(logger = Logger.new(StringIO.new))
100100 validate_references
101101 return unless valid?
102102
103- if supports_compare_file_text?
104- convert_file_resources ( logger )
105- elsif @options [ :compare_file_text ]
106- logger . debug "Disabling --compare-file-text; not supported by #{ self . class } "
107- end
103+ convert_file_resources if @options [ :compare_file_text ]
108104
109105 true
110106 end
@@ -144,12 +140,10 @@ def compilation_dir=(dir)
144140 @override_compilation_dir = dir
145141 end
146142
147- # Stub method for "convert_file_resources" to raise an error if the backend doesn't support this.
148- # Getting here is expected to be a bug condition.
149- def convert_file_resources ( _logger = Logger . new ( StringIO . new ) )
150- # :nocov:
151- raise "convert_file_resources was called on but is not supported by #{ self . class } "
152- # :nocov:
143+ # Stub method for "convert_file_resources" -- returns false because if the underlying class does
144+ # not implement this method, it's not supported.
145+ def convert_file_resources ( _dry_run = false )
146+ false
153147 end
154148
155149 # Retrieve the error message.
@@ -211,12 +205,6 @@ def retries
211205 nil
212206 end
213207
214- # By default, catalogs do not support converting and comparing file resources. This can be overridden
215- # by backends that do support it.
216- def supports_compare_file_text?
217- false
218- end
219-
220208 # Determine if the catalog build was successful.
221209 # @return [Boolean] Whether the catalog is valid
222210 def valid?
@@ -332,16 +320,5 @@ def build_resource_hash
332320 end
333321 end
334322 end
335-
336- # Private method: A common way of running convert_file_resources for backends that allow it.
337- def convert_file_resources_real ( logger = Logger . new ( StringIO . new ) )
338- return false unless @options [ :compare_file_text ]
339- if @options [ :basedir ]
340- OctocatalogDiff ::CatalogUtil ::FileResources . convert_file_resources ( self , environment )
341- else
342- logger . debug "Disabling --compare-file-text; not supported by #{ self . class } without basedir"
343- false
344- end
345- end
346323 end
347324end
0 commit comments