Sha256: 9695da399489a8fc74d035405bbf7945f3d16266088c8b7ec292f76a4dad6364

Contents?: true

Size: 1.02 KB

Versions: 1

Compression:

Stored size: 1.02 KB

Contents

#!/usr/bin/env ruby
# Copyright (c) 2010-2017 Kenshi Muto and Masayoshi Takahashi
#
# 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.
# For details of the GNU LGPL, see the file "COPYING".
#
require 'pathname'
require 'optparse'
bindir = Pathname.new(__FILE__).realpath.dirname
$LOAD_PATH.unshift((bindir + '../lib').realpath)
require 'review/epubmaker'
require 'review/version'

@logger = ReVIEW.logger

rv = ReVIEW::EPUBMaker.new

opts = OptionParser.new
opts.version = ReVIEW::VERSION
opts.banner = "Usage: #{File.basename($PROGRAM_NAME)} [options] YAML_filename [export_filename]"
opts.on('--help', 'Prints this message and quit.') do
  puts opts.help
  exit 0
end

begin
  opts.parse!
rescue OptionParser::ParseError => err
  @logger.error err.message
  $stderr.puts opts.help
  exit 1
end

if ARGV.size < 1 || !File.exist?(ARGV[0])
  puts opts.help
  exit 1
end

yaml_file = ARGV[0]
bookname = ARGV[1]
rv.produce(yaml_file, bookname)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
review-2.4.0 bin/review-epubmaker