@@ -259,7 +259,9 @@ def self.common_facts
259259
260260 @common_facts [ :mco_version ] = MCollective ::VERSION if mcollective?
261261
262- @common_facts [ :augeasversion ] = Augeas . open ( nil , nil , Augeas ::NO_MODL_AUTOLOAD ) . get ( '/augeas/version' ) if augeas?
262+ if augeas?
263+ @common_facts [ :augeasversion ] = Augeas . open ( nil , nil , Augeas ::NO_MODL_AUTOLOAD ) . get ( '/augeas/version' )
264+ end
263265 @common_facts = stringify_keys ( @common_facts ) if RSpec . configuration . facterdb_string_keys
264266
265267 @common_facts
@@ -296,7 +298,9 @@ def self.mcollective?
296298 # @return [Array<Hash>]
297299 # @api private
298300 def self . meta_supported_os
299- raise StandardError , 'Unknown operatingsystem support in the metadata file!' unless metadata [ 'operatingsystem_support' ] . is_a? Array
301+ unless metadata [ 'operatingsystem_support' ] . is_a? Array
302+ raise StandardError , 'Unknown operatingsystem support in the metadata file!'
303+ end
300304
301305 metadata [ 'operatingsystem_support' ]
302306 end
@@ -308,7 +312,9 @@ def self.meta_supported_os
308312 # @api private
309313 def self . metadata
310314 return @metadata if @metadata
311- raise StandardError , "Can't find metadata.json... dunno why" unless File . file? metadata_file
315+ unless File . file? metadata_file
316+ raise StandardError , "Can't find metadata.json... dunno why"
317+ end
312318
313319 content = File . read metadata_file
314320 @metadata = JSON . parse content
@@ -375,6 +381,9 @@ def self.facter_version_to_loose_requirement_string(version)
375381 elsif /\A [0-9]+\Z / . match? ( version )
376382 # Interpret 3 as < 4
377383 "< #{ version . to_i + 1 } "
384+ else # rubocop:disable Style/EmptyElse
385+ # This would be the same as the strict requirement
386+ nil
378387 end
379388 end
380389
0 commit comments