lib/review/textmaker.rb in review-4.2.0 vs lib/review/textmaker.rb in review-5.0.0
- old
+ new
@@ -73,24 +73,17 @@
cleanup_mathimg('_review_math_text')
FileUtils.rm_rf(path)
end
def execute(*args)
- @config = ReVIEW::Configure.values
- @config.maker = 'textmaker'
cmd_config, yamlfile = parse_opts(args)
error "#{yamlfile} not found." unless File.exist?(yamlfile)
- begin
- loader = ReVIEW::YAMLLoader.new
- @config.deep_merge!(loader.load_file(yamlfile))
- rescue => e
- error "yaml error #{e.message}"
- end
+ @config = ReVIEW::Configure.create(maker: 'textmaker',
+ yamlfile: yamlfile,
+ config: cmd_config)
- # YAML configs will be overridden by command line options.
- @config.deep_merge!(cmd_config)
I18n.setup(@config['language'])
begin
generate_text_files(yamlfile)
rescue ApplicationError => e
raise if @config['debug']
@@ -107,11 +100,10 @@
@basedir = File.dirname(yamlfile)
@path = build_path
remove_old_files(@path)
Dir.mkdir(@path)
- @book = ReVIEW::Book.load(@basedir)
- @book.config = @config
+ @book = ReVIEW::Book::Base.new(@basedir, config: @config)
build_body(@path, yamlfile)
end
def build_body(basetmpdir, _yamlfile)