Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make epub file extension replacement case-insensitive #2

Merged
merged 1 commit into from Oct 3, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/asciidoctor-epub3/packager.rb
Expand Up @@ -313,7 +313,7 @@ def postprocess_xhtml content, format
class Packager
KINDLEGEN = ENV['KINDLEGEN'] || 'kindlegen'
EPUBCHECK = ENV['EPUBCHECK'] || %(epubcheck#{::Gem.win_platform? ? '.bat' : '.sh'})
EpubExtensionRx = /\.epub$/
EpubExtensionRx = /\.epub$/i

def initialize spine_doc, spine, format = :epub3, options = {}
@document = spine_doc
Expand Down Expand Up @@ -459,7 +459,7 @@ def distill_epub_to_mobi epub_file, target
require 'kindlegen' unless defined? ::Kindlegen
kindlegen_cmd = ::Kindlegen.command
end
mobi_file = ::File.basename(target).sub EpubExtensionRx, '.mobi'
mobi_file = ::File.basename(target.sub EpubExtensionRx, '.mobi')
::Open3.popen2e(::Shellwords.join [kindlegen_cmd, '-o', mobi_file, epub_file]) {|input, output, wait_thr|
output.each {|line| puts line }
}
Expand Down