lib/epuber/compiler/file_database.rb in epuber-0.6.0 vs lib/epuber/compiler/file_database.rb in epuber-0.7.0

- old
+ new

@@ -1,11 +1,9 @@ -# encoding: utf-8 # frozen_string_literal: true -require 'yaml' +require 'psych' - module Epuber class Compiler require_relative 'file_stat' class FileDatabase @@ -20,11 +18,11 @@ # @param [String] path # def initialize(path) @store_file_path = path - @all_files = YAML.load_file(path) || {} - rescue + @all_files = Psych.load_file(path, permitted_classes: [Epuber::Compiler::FileStat, Time]) || {} + rescue StandardError @all_files = {} end # @param [String] file_path #