gepub 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
- === 0.0.1 2010-05-05
1
+ === 0.0.2-05-065
2
2
 
3
3
  * 1 major enhancement:
4
4
  * Initial release
@@ -77,7 +77,7 @@ a good-enough EPUB generator library.
77
77
 
78
78
  == INSTALL:
79
79
 
80
- * rake install_gem
80
+ * gem install gepub
81
81
 
82
82
  == LICENSE:
83
83
 
@@ -4,5 +4,5 @@ $:.unshift(File.dirname(__FILE__)) unless
4
4
  require 'gepub/generator'
5
5
 
6
6
  module GEPUB
7
- VERSION = '0.0.1'
7
+ VERSION = '0.0.2'
8
8
  end
@@ -8,7 +8,7 @@ module GEPUB
8
8
  class Generator
9
9
 
10
10
  attr_accessor :spine
11
-
11
+
12
12
  def initialize(title)
13
13
  @metadata = Hash.new
14
14
  @manifest = Hash.new
@@ -16,9 +16,12 @@ module GEPUB
16
16
  @toc = Array.new
17
17
  @metadata[:title] = title
18
18
  @manifest['ncx'] = { :href => 'toc.ncx', :mediatype => 'application/x-dtbncx+xml' }
19
-
19
+ @contents_prefix = "" # may insert "OEBPS/"
20
20
  end
21
21
 
22
+ def contents_prefix=(prefix)
23
+ @contents_prefix = prefix + "/"
24
+ end
22
25
  def title
23
26
  @metadata[:title]
24
27
  end
@@ -101,7 +104,7 @@ EOF
101
104
  <?xml version="1.0" encoding="UTF-8"?>
102
105
  <container version="1.0" xmlns="urn:oasis:names:tc:opendocument:xmlns:container">
103
106
  <rootfiles>
104
- <rootfile full-path="content.opf" media-type="application/oebps-package+xml"/>
107
+ <rootfile full-path="#{@contents_prefix}content.opf" media-type="application/oebps-package+xml"/>
105
108
  </rootfiles>
106
109
  </container>
107
110
  EOF
@@ -162,7 +165,7 @@ EOF
162
165
  end
163
166
 
164
167
  def create_opf(destdir)
165
- File.open(destdir + "/content.opf", 'w') { | file | file << opf_xml }
168
+ File.open(destdir + "/" + @contents_prefix + "content.opf", 'w') { | file | file << opf_xml }
166
169
  end
167
170
 
168
171
  def ncx_xml
@@ -215,7 +218,7 @@ EOF
215
218
  end
216
219
 
217
220
  def create_toc(destdir)
218
- File.open(destdir + "/toc.ncx", 'w') {
221
+ File.open(destdir + "/" + @contents_prefix + "toc.ncx", 'w') {
219
222
  |file|
220
223
  file << ncx_xml
221
224
  }
metadata CHANGED
@@ -1,7 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gepub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 0
8
+ - 2
9
+ version: 0.0.2
5
10
  platform: ruby
6
11
  authors:
7
12
  - KOJIMA Satoshi
@@ -9,29 +14,37 @@ autorequire:
9
14
  bindir: bin
10
15
  cert_chain: []
11
16
 
12
- date: 2010-05-05 00:00:00 +09:00
17
+ date: 2010-05-07 00:00:00 +09:00
13
18
  default_executable:
14
19
  dependencies:
15
20
  - !ruby/object:Gem::Dependency
16
21
  name: rubyforge
17
- type: :development
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
20
24
  requirements:
21
25
  - - ">="
22
26
  - !ruby/object:Gem::Version
27
+ segments:
28
+ - 2
29
+ - 0
30
+ - 4
23
31
  version: 2.0.4
24
- version:
32
+ type: :development
33
+ version_requirements: *id001
25
34
  - !ruby/object:Gem::Dependency
26
35
  name: hoe
27
- type: :development
28
- version_requirement:
29
- version_requirements: !ruby/object:Gem::Requirement
36
+ prerelease: false
37
+ requirement: &id002 !ruby/object:Gem::Requirement
30
38
  requirements:
31
39
  - - ">="
32
40
  - !ruby/object:Gem::Version
41
+ segments:
42
+ - 2
43
+ - 6
44
+ - 0
33
45
  version: 2.6.0
34
- version:
46
+ type: :development
47
+ version_requirements: *id002
35
48
  description: a good-enough EPUB generator library.
36
49
  email:
37
50
  - skoji@skoji.jp
@@ -70,18 +83,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
70
83
  requirements:
71
84
  - - ">="
72
85
  - !ruby/object:Gem::Version
86
+ segments:
87
+ - 0
73
88
  version: "0"
74
- version:
75
89
  required_rubygems_version: !ruby/object:Gem::Requirement
76
90
  requirements:
77
91
  - - ">="
78
92
  - !ruby/object:Gem::Version
93
+ segments:
94
+ - 0
79
95
  version: "0"
80
- version:
81
96
  requirements: []
82
97
 
83
98
  rubyforge_project: gepub
84
- rubygems_version: 1.3.5
99
+ rubygems_version: 1.3.6
85
100
  signing_key:
86
101
  specification_version: 3
87
102
  summary: a good-enough EPUB generator library.