Sha256: 08a719ac27ad453cf8b9505d5200435cc0c619bf4e54aa38622a63b2536aaed0

Contents?: true

Size: 1010 Bytes

Versions: 4

Compression:

Stored size: 1010 Bytes

Contents

#!/usr/bin/env ruby

if File.exist?(asciidoctor_epub3 = (File.expand_path '../../lib/asciidoctor-epub3', __FILE__))
  require asciidoctor_epub3
else
  require 'asciidoctor-epub3'
end
require 'asciidoctor/cli'

options = Asciidoctor::Cli::Options.new backend: 'epub3'

# FIXME provide an API in Asciidoctor for sub-components to print version information
unless ARGV != ['-v'] && (ARGV & ['-V', '--version']).empty?
  require_relative '../lib/asciidoctor-epub3/version'
  $stdout.write %(Asciidoctor EPUB3 #{Asciidoctor::Epub3::VERSION} using )
  # NOTE the print_version method was added in Asciidoctor 1.5.2
  if options.respond_to? :print_version
    options.print_version
  else
    puts %(Asciidoctor #{::Asciidoctor::VERSION} [http://asciidoctor.org])
  end
  exit 0
end

# FIXME This is a really bizarre API. Please make me simpler.
case (result = options.parse! ARGV)
when Integer
  exit result
else
  invoker = Asciidoctor::Cli::Invoker.new options
  GC.start
  invoker.invoke!
  exit invoker.code
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
asciidoctor-epub3-1.5.0.alpha.9 bin/asciidoctor-epub3
asciidoctor-epub3-1.5.0.alpha.8 bin/asciidoctor-epub3
asciidoctor-epub3-1.5.0.alpha.7 bin/asciidoctor-epub3
asciidoctor-epub3-1.5.0.alpha.6 bin/asciidoctor-epub3