gepub 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/VERSION +1 -1
  2. data/lib/gepub/generator.rb +14 -2
  3. metadata +2 -2
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.5
1
+ 0.0.6
@@ -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
- %x(zip -0X \"#{epubname}\" \"mimetype\")
94
- %x(zip -r9XD \"#{epubname}\" * -x mimetype)
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
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 5
9
- version: 0.0.5
8
+ - 6
9
+ version: 0.0.6
10
10
  platform: ruby
11
11
  authors:
12
12
  - KOJIMA Satoshi