lib/reek/source/config_file.rb
#
# Load the file path with which this was initialized.
# Empty files are ignored with a warning. All other errors are to be
# handled farther up the stack.
#
Load the file path with which this was initialized.
Empty files are ignored with a warning. All other errors are to be
handled farther up the stack.
Load the file path with which this was initialized . Empty files are ignored with a warning . All other errors are to be handled farther up the stack .
def load
        if File.size(@file_path) == 0
          report_problem('Empty file')
          return {}
        end
        begin
          result = YAML.load_file(@file_path) || {}
        rescue => error
          report_error(error.to_s)
        end
        report_error('Not a hash') unless result.is_a? Hash
        result
      end
def load if File . size ( @file_path ) == 0 report_problem ( 'Empty file' ) return { } end begin result = YAML . load_file ( @file_path ) || { } rescue => error report_error ( error . to_s ) end report_error ( 'Not a hash' ) unless result . is_a? Hash result end
Load the file path with which this was initialized.
Load the file path with which this was initialized .