bin/review-compile in review-1.3.0 vs bin/review-compile in review-1.4.0

- old
+ new

@@ -88,12 +88,10 @@ end opts.on('--chapterlink', 'make chapref hyperlink') { config["chapterlink"] = true } opts.on('--stylesheet=file', 'Stylesheet file for HTML (comma separated)') {|files| config["stylesheet"] = files.split(/\s*,\s*/) } opts.on('--mathml', 'Use MathML for TeX equation in HTML') do config["mathml"] = true - require 'math_ml' - require "math_ml/symbol/character_reference" end opts.on('--htmlversion=VERSION', 'HTML version.') do |v| v = v.to_i config["htmlversion"] = v if v == 4 || v == 5 end @@ -144,33 +142,34 @@ end begin config["builder"] = target - ReVIEW.book.config = config compiler = ReVIEW::Compiler.new(load_strategy_class(target, check_only)) case mode when :files if ARGV.empty? error 'no input' exit 1 end begin ReVIEW::Book::Chapter.intern_pathes(ARGV).each do |chap| - chap.book.config = config + chap.book.config = config # needs only at the first time result = compiler.compile(chap) if output_filename write output_filename, result else puts result unless check_only end end rescue => e # PART - part = ReVIEW.book.parts_in_file.select do |part| - ARGV.map{|path| File.basename path}.include? part.path + book = ReVIEW::Book::Base.load_default + book.config = config + part = book.parts_in_file.select do |part_item| + ARGV.map{|path| File.basename path}.include? part_item.path end if part.present? result = compiler.compile(part.first) if output_filename write output_filename, result @@ -180,10 +179,11 @@ else raise e end end when :dir - book = basedir ? ReVIEW::Book.load(basedir) : ReVIEW.book + book = basedir ? ReVIEW::Book.load(basedir) : ReVIEW::Book::Base.load_default + book.config = config book.chapters.each do |chap| str = compiler.compile(chap) write "#{chap.name}#{compiler.strategy.extname}", str unless check_only end # PART