gepub 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/gepub/generator.rb +14 -2
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.6
|
data/lib/gepub/generator.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
require 'rubygems'
|
3
3
|
require 'xml/libxml'
|
4
|
+
require 'zipruby'
|
4
5
|
require 'fileutils'
|
5
6
|
|
6
7
|
|
@@ -90,8 +91,19 @@ module GEPUB
|
|
90
91
|
FileUtils.cd("#{destdir}") {
|
91
92
|
|dir|
|
92
93
|
epubname = "#{realtarget}/#{epubname}.epub"
|
93
|
-
|
94
|
-
|
94
|
+
|
95
|
+
Zip::Archive.open(epubname, Zip::CREATE | Zip::TRUNC, Zip::NO_COMPRESSION) do
|
96
|
+
|epubfile|
|
97
|
+
epubfile.add_file("mimetype")
|
98
|
+
end
|
99
|
+
|
100
|
+
Zip::Archive.open(epubname, Zip::CREATE) do
|
101
|
+
|epubfile|
|
102
|
+
Dir["**/*"].each do
|
103
|
+
|file|
|
104
|
+
epubfile.add_file(f,f) unless File.basename(f) == 'mimetype'
|
105
|
+
end
|
106
|
+
end
|
95
107
|
}
|
96
108
|
end
|
97
109
|
|