epub-maker 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.markdown +5 -0
- data/README.markdown +12 -15
- data/lib/epub/maker.rb +3 -3
- data/lib/epub/maker/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8284f37476b729d56b4c9f57568741a32688ae05
|
4
|
+
data.tar.gz: af1bfe62426f12598dc402eb52121f73222333c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cbb15761fdcc3268c0f25ef01e2583e01431156d28d097f440273e59419f1b6a96981bcedda7d2a5919e0dd72ed25b8ca0edc4d216ebbbee28006d5cb7aebd89
|
7
|
+
data.tar.gz: f221a87aa32563df6b1223c4529111bef06bcd4c10d5f1020cf6a24c620ed2eab0296101f897e5b1b875889ae6f924aaa1bd3b8409a5e3402fb8fad7f540b4c4
|
data/CHANGELOG.markdown
CHANGED
data/README.markdown
CHANGED
@@ -150,6 +150,13 @@ You can specify target file path.
|
|
150
150
|
% ls target/dir
|
151
151
|
book.epub
|
152
152
|
|
153
|
+
It also has Ruby API.
|
154
|
+
|
155
|
+
require 'epub/maker'
|
156
|
+
|
157
|
+
EPUB::Maker.archive 'path/to/book' # => #<Pathname:path/to/book.epub>
|
158
|
+
EPUB::Maker.archive 'source/dir/book', 'target/dir/book.epub' # => #<Pathname:target/dir/book.epub>
|
159
|
+
|
153
160
|
[epzip]: https://github.com/takahashim/epzip
|
154
161
|
|
155
162
|
Requirements
|
@@ -166,6 +173,10 @@ Todo
|
|
166
173
|
|
167
174
|
Recent Changes
|
168
175
|
--------------
|
176
|
+
### 0.0.7
|
177
|
+
|
178
|
+
* Change temporary directory used by `EPUB::Maker.archive`
|
179
|
+
|
169
180
|
### 0.0.6
|
170
181
|
|
171
182
|
* Add `epub-archive` command
|
@@ -180,20 +191,6 @@ Recent Changes
|
|
180
191
|
* Bump required EPUB Parser version: 0.2.0 -> 0.2.6
|
181
192
|
* Deprecate `EPUB::OCF::PhysicalContainer.save`
|
182
193
|
|
183
|
-
### 0.0.3
|
184
|
-
* Bump up required Ruby version: >= 2.0.0 -> >= 2.1.0
|
185
|
-
|
186
|
-
### 0.0.2
|
187
|
-
* Detect media type of files more strictly
|
188
|
-
* Keep temporary directory remained on error in `EPUB::Maker.make`
|
189
|
-
* Define `EPUB::Package#edit`
|
190
|
-
* Make `EPUB::Package#save` able to replace content as well as add
|
191
|
-
* Define `EPUB::Package::Metadata::Meta#valid?`
|
192
|
-
* Drop invalid meta element in metadata on save
|
193
|
-
|
194
|
-
### 0.0.1
|
195
|
-
* Initial release!
|
196
|
-
|
197
194
|
Contributing
|
198
195
|
------------
|
199
196
|
|
@@ -201,4 +198,4 @@ Contributing
|
|
201
198
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
202
199
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
203
200
|
4. Push to the branch (`git push origin my-new-feature`)
|
204
|
-
5. Create new
|
201
|
+
5. Create new Merge Request
|
data/lib/epub/maker.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'English'
|
2
2
|
require 'pathname'
|
3
3
|
require 'fileutils'
|
4
|
+
require 'tempfile'
|
4
5
|
require 'tmpdir'
|
5
6
|
require 'time'
|
6
7
|
require 'uuid'
|
@@ -76,9 +77,8 @@ module EPUB
|
|
76
77
|
|
77
78
|
epub_file ||= source_dir.sub_ext(".epub")
|
78
79
|
epub_file = Pathname(epub_file)
|
79
|
-
|
80
|
-
|
81
|
-
temp_dest = dir/epub_file.basename
|
80
|
+
Pathname.mktmpdir "epub-maker", epub_file.dirname do |dir|
|
81
|
+
temp_dest = Pathname(Tempfile.create(epub_file.basename.to_path, dir))
|
82
82
|
temp_container = dir/source_dir.basename
|
83
83
|
|
84
84
|
temp_container.mkdir
|
data/lib/epub/maker/version.rb
CHANGED