lib/review/tocprinter.rb in review-4.2.0 vs lib/review/tocprinter.rb in review-5.0.0
- old
+ new
@@ -48,20 +48,19 @@
def initialize
@logger = ReVIEW.logger
@config = ReVIEW::Configure.values
@yamlfile = 'config.yml'
- @book = ReVIEW::Book::Base.load
+ @book = ReVIEW::Book::Base.new('.', config: @config)
@upper = 4
@indent = true
@buildonly = nil
@detail = nil
end
def execute(*args)
parse_options(args)
- @book.config = ReVIEW::Configure.values
unless File.readable?(@yamlfile)
@logger.error("No such fiile or can't open #{@yamlfile}.")
exit 1
end
@book.load_config(@yamlfile)
@@ -106,10 +105,10 @@
end
if part.name.present? && (@buildonly.nil? || @buildonly.include?(part.name))
result_array.push({ part: 'end' })
end
end
- rescue ReVIEW::FileNotFound => e
+ rescue ReVIEW::FileNotFound, ReVIEW::CompileError => e
@logger.error e
exit 1
end
result_array