-
Notifications
You must be signed in to change notification settings - Fork 215
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
Refactor EPUBMaker #1640
Merged
Merged
Refactor EPUBMaker #1640
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
No arguments are used in the call of `EPUBCommon#cover`, so simplified it.
just import `@config` and `@contents`, not Producer itself
Their methods are used only in EPUBv2
|
ありがとうございます、今週中には手元データでいろいろ比較しておきます。 |
Merged
use more templates
明らかな問題なさそうなのでこれでマージしてみます。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#1575 に関連して、独立したライブラリではなくなったということでEPUBMaker自体を整理します。
Producer
とEPUBv(2|3)
(+EPUBCommon
)の役割を整理するProducer
とEPUBv(2|3)
との結合が強すぎるので、メソッドを移動して整理します。大まかな分担としては、
Producer
はいわゆるファサード的な、「外から呼び出してEPUBを作る」ということに特化させて、実際にEPUB用の個別ファイルを生成する機能はEPUBv(2|3)
に寄せるようにします。最終的には、
EPUBv(2|3)
には@producer
は不要で、@config
と@contents
だけProducer
から渡すのでも十分なはずです。→
@producer
を消しました。結果、Producerとの相互依存ではなく、Producerから一方的に依存してるだけになりました。EPUBv(2|3)
内の@producer.config
はconfig
にする 9220d97@producer
は極力使わないように。mimetype
等のメソッドにIO
を渡すのはやめてString
を返すようにする 96497aemimetype
等のメソッドはProducer
ではなくEPUBv(2|3)
かEPUBCommon
に移動する bd18b63上記2つが混沌としがちな原因だったので、ここを切り分けます。
EPUBCommon
等で@producer.res.v
を呼ぶのを止め、直接ReVIEW::I18n.t
を呼ぶようにする cf6def8Re:VIEWへの依存度を極力下げる必要がなければ、普通に書いた方が素直なはずです。
EPUBv(2|3)
で定義されるメソッドをEPUBCommon
でもNotImplemented
で定義しておく bd18b63なくても困らないですが、分かりやすさのため。
EPUBv2
でしか使われないEPUBCommon
のメソッドをEPUBv2
に移動する 2587023主に
ncx_*
メソッドを対象としています。