gepub 0.0.3 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +21 -0
- data/VERSION +1 -1
- data/lib/gepub/generator.rb +8 -0
- data/spec/gepub_spec.rb +12 -17
- metadata +4 -3
data/.gitignore
ADDED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.5
|
data/lib/gepub/generator.rb
CHANGED
data/spec/gepub_spec.rb
CHANGED
@@ -3,26 +3,11 @@ require File.dirname(__FILE__) + '/spec_helper.rb'
|
|
3
3
|
require 'rubygems'
|
4
4
|
require 'xml/libxml'
|
5
5
|
|
6
|
-
# for parsing only elements. DO I REALLY NEED THIS !?
|
7
|
-
class LibXML::XML::Node
|
8
|
-
def next_element
|
9
|
-
r = self.next
|
10
|
-
r = r.next while !r.element?
|
11
|
-
r
|
12
|
-
end
|
13
|
-
|
14
|
-
def first_child_element
|
15
|
-
r = self.first
|
16
|
-
r = r.next_element if !r.element?
|
17
|
-
r
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
|
22
6
|
describe GEPUB::Generator do
|
23
7
|
before do
|
24
8
|
@generator = GEPUB::Generator.new('thetitle')
|
25
9
|
@generator.author = "theauthor"
|
10
|
+
@generator.contributor = "contributors contributors!"
|
26
11
|
@generator.publisher = "thepublisher"
|
27
12
|
@generator.date = "2010-05-05"
|
28
13
|
@generator.identifier = "http://example.jp/foobar/"
|
@@ -111,5 +96,15 @@ describe GEPUB::Generator do
|
|
111
96
|
spine['toc'].should == 'ncx'
|
112
97
|
spine.find_first('a:itemref')['idref'].should == 'c1'
|
113
98
|
end
|
114
|
-
|
99
|
+
|
100
|
+
it "should have correct cover image" do
|
101
|
+
|
102
|
+
@generator.addCoverImage("/path/to/cover.jpg")
|
103
|
+
opf = LibXML::XML::Parser.string(@generator.opf_xml).parse
|
104
|
+
opf.root.namespaces.default_prefix='a'
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
end
|
109
|
+
|
115
110
|
end
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 5
|
9
|
+
version: 0.0.5
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- KOJIMA Satoshi
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-
|
17
|
+
date: 2010-06-11 00:00:00 +09:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -40,6 +40,7 @@ extensions: []
|
|
40
40
|
extra_rdoc_files:
|
41
41
|
- README.rdoc
|
42
42
|
files:
|
43
|
+
- .gitignore
|
43
44
|
- README.rdoc
|
44
45
|
- Rakefile
|
45
46
|
- VERSION
|