Sha256: e832caaefc0796712e490187634c08e1c4dde225724c9c9e9753d5de9a07eb5f
Contents?: true
Size: 727 Bytes
Versions: 19
Compression:
Stored size: 727 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
19 entries across 19 versions & 1 rubygems