lib/review/volumeprinter.rb in review-5.0.0 vs lib/review/volumeprinter.rb in review-5.1.0

- old
+ new

@@ -1,7 +1,7 @@ # -# Copyright (c) 2014-2020 Minero Aoki, Kenshi Muto +# Copyright (c) 2014-2021 Minero Aoki, Kenshi Muto # 2003-2014 Minero Aoki # # This program is free software. # You can distribute or modify this program under the terms of # the GNU LGPL, Lesser General Public License version 2.1. @@ -20,22 +20,21 @@ new.execute(*args) end def initialize @logger = ReVIEW.logger - @config = ReVIEW::Configure.values @yamlfile = 'config.yml' end def execute(*args) parse_options(args) + @config = ReVIEW::Configure.create(yamlfile: @yamlfile) @book = ReVIEW::Book::Base.new('.', config: @config) unless File.readable?(@yamlfile) @logger.error("No such fiile or can't open #{@yamlfile}.") exit 1 end - @book.load_config(@yamlfile) I18n.setup(@book.config['language']) begin @book.each_part do |part| if part.number @@ -43,11 +42,11 @@ end part.each_chapter do |chap| print_chapter_volume(chap) end end - rescue ReVIEW::FileNotFound, ReVIEW::CompileError => e - @logger.error e + rescue ReVIEW::FileNotFound, ReVIEW::CompileError, ReVIEW::ApplicationError => e + @logger.error e.message exit 1 end puts '=============================' print_volume(@book.volume) end