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
make epub file extension replacement case-insensitive #2
Conversation
Now if the user specifies |
I think it make complex to understand what is mobi output result. Output name should base on Problem come form epub converter support two format but only set I think current fix-out-file-option branch is good for fix |
bde5540
to
7aecb0c
Compare
I see your concern. Technically, the epub_file is derived from the target, so the two files have the same rootname, but I agree that it is clearer to rebuild the path off the target directly. I have updated my pull request. I think it satisfies your concern while still maintaining compatibility with existing behavior. (I realize that we are still lacking tests...I am testing against editions to make sure that it continues to work. Clearly, we need to get tests setup...that's a major error in my part that I skipped that step). |
7aecb0c
to
60b1bbc
Compare
@@ -459,7 +460,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 =~ MobiExtensionRx ? target : %(#{::Asciidoctor::Helpers.rootname target}.mobi)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now we only substitute if the extension isn't .mobi
. That's the one thing we are enforcing. The extension of the mobi file must be .mobi
(case insensitive).
I still think it's not necessary to have a guard to check target is end with /.mobi/i , But I accept it that let things move on, it's not a big problem... |
Now I see why you were replacing the epub extension with mobi. It took me a while to understand why you were doing it that way, but now I totally see it. Sorry it took me so long to make the connection. |
60b1bbc
to
69bef53
Compare
The only change that remains is to make the epub extension regex case-insensitive. Once that's merged in, then I think we'll finally have it sorted out. |
make epub file extension replacement case-insensitive
Great! |
No description provided.