bin/review-epubmaker-legacy in review-1.6.0 vs bin/review-epubmaker-legacy in review-1.7.0
- old
+ new
@@ -26,11 +26,11 @@
require 'review/i18n'
require 'review/htmlutils'
include ReVIEW::HTMLUtils
-$essential_files = ['top', 'toc', 'colophon']
+@essential_files = ['top', 'toc', 'colophon']
def main
opts = OptionParser.new
opts.version = ReVIEW::VERSION
opts.banner = "Usage: #{File.basename($0)} [options] configfile"
opts.on('-h', '--help', 'print this message and quit.') {
@@ -55,11 +55,11 @@
end
yamlfile = ARGV[0]
values = ReVIEW::Configure.values.merge(YAML.load_file(yamlfile))
bookname = values["bookname"]
- $essential_files <<= bookname
+ @essential_files <<= bookname
tmp = values["debug"].nil? ? Dir.mktmpdir : "."
@bookdir = "#{tmp}/#{bookname}-epub"
@epubversion = values["epubversion"] || 2
@htmlversion = values["htmlversion"] || 4
if @epubversion == 3
@@ -772,12 +772,12 @@
}
end
def output_chaps_by_file(l, values)
file_id = File.basename(l.chomp.strip,".*")
- if (idx = $essential_files.index(file_id))
- if idx == $essential_files.size - 1
+ if (idx = @essential_files.index(file_id))
+ if idx == @essential_files.size - 1
STDERR.puts "#{file_id} is book name. Please rename #{l.chomp.strip}."
else
STDERR.puts "#{file_id} is special name. Please rename #{l.chomp.strip}."
end
exit 1
@@ -798,11 +798,11 @@
REXML::Document.new(f).each_element("//math"){
return true
}
return false
}
- rescue
- false
+rescue
+ false
end
def getFigId(filename)
figid = filename.sub(/\.(png|gif|jpg|jpeg|svg)$/, '')
"fig-#{figid}"