Sha256: 3406825cb37a94ae48f77aeff8ef1ab050a6e62521bb944a74dcaff0571c397b
Contents?: true
Size: 724 Bytes
Versions: 7
Compression:
Stored size: 724 Bytes
Contents
require 'English' require 'optparse' require 'irb' require 'epub/parser' shell = IRB OptionParser.new {|opt| opt.banner = <<EOB Open EPUB file in IRB Usage: #{File.basename($PROGRAM_NAME)} EPUBFILE EOB opt.on '--pry', 'Use Pry instead of IRB as shell' do require 'pry' shell = Pry end }.parse! $0 = File.basename($PROGRAM_NAME) include EPUB::Book::Features file = ARGV.shift EPUB::OCF::PhysicalContainer.adapter = :UnpackedDirectory if File.directory? file unless File.readable? file uri = URI.parse(file) rescue nil if uri EPUB::OCF::PhysicalContainer.adapter = :UnpackedURI file = uri end end EPUB::Parser.parse(file, book: self) $stderr.puts "Enter \"exit\" to exit #{shell}" shell.start
Version data entries
7 entries across 7 versions & 1 rubygems