gepub 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +2 -1
- data/Rakefile +2 -0
- data/VERSION +1 -1
- data/lib/gepub/generator.rb +6 -1
- data/spec/gepub_spec.rb +5 -2
- metadata +31 -3
data/README.rdoc
CHANGED
data/Rakefile
CHANGED
@@ -11,6 +11,8 @@ begin
|
|
11
11
|
gem.homepage = "http://github.com/skoji/gepub"
|
12
12
|
gem.authors = ["KOJIMA Satoshi"]
|
13
13
|
gem.add_development_dependency "rspec", ">= 1.2.9"
|
14
|
+
gem.add_dependency('libxml-ruby', ">= 1.1.4")
|
15
|
+
gem.add_dependency('zipruby', ">= 0.3.6")
|
14
16
|
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
15
17
|
end
|
16
18
|
Jeweler::GemcutterTasks.new
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.7
|
data/lib/gepub/generator.rb
CHANGED
@@ -23,6 +23,7 @@ module GEPUB
|
|
23
23
|
def contents_prefix=(prefix)
|
24
24
|
@contents_prefix = prefix + "/"
|
25
25
|
end
|
26
|
+
|
26
27
|
def title
|
27
28
|
@metadata[:title]
|
28
29
|
end
|
@@ -79,6 +80,10 @@ module GEPUB
|
|
79
80
|
@toc.push({ :id => id, :text => text, :ref => ref})
|
80
81
|
end
|
81
82
|
|
83
|
+
def addCoverImage(id, href)
|
84
|
+
|
85
|
+
end
|
86
|
+
|
82
87
|
def create(destdir)
|
83
88
|
create_mimetype(destdir)
|
84
89
|
create_container(destdir)
|
@@ -100,7 +105,7 @@ module GEPUB
|
|
100
105
|
Zip::Archive.open(epubname, Zip::CREATE) do
|
101
106
|
|epubfile|
|
102
107
|
Dir["**/*"].each do
|
103
|
-
|
|
108
|
+
|f|
|
104
109
|
epubfile.add_file(f,f) unless File.basename(f) == 'mimetype'
|
105
110
|
end
|
106
111
|
end
|
data/spec/gepub_spec.rb
CHANGED
@@ -99,12 +99,15 @@ describe GEPUB::Generator do
|
|
99
99
|
|
100
100
|
it "should have correct cover image" do
|
101
101
|
|
102
|
-
@generator.addCoverImage("
|
102
|
+
@generator.addCoverImage("theId", "path/to/cover.jpg")
|
103
103
|
opf = LibXML::XML::Parser.string(@generator.opf_xml).parse
|
104
104
|
opf.root.namespaces.default_prefix='a'
|
105
105
|
|
106
|
+
metadata = opf.find_first('a:metadata')
|
107
|
+
metacover = metadata.find_first('meta')
|
108
|
+
metacover['name'].should == 'cover'
|
109
|
+
metacover['content'].should == 'theId'
|
106
110
|
|
107
|
-
|
108
111
|
end
|
109
112
|
|
110
113
|
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
|
+
- 7
|
9
|
+
version: 0.0.7
|
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-06-
|
17
|
+
date: 2010-06-13 00:00:00 +09:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -31,6 +31,34 @@ dependencies:
|
|
31
31
|
version: 1.2.9
|
32
32
|
type: :development
|
33
33
|
version_requirements: *id001
|
34
|
+
- !ruby/object:Gem::Dependency
|
35
|
+
name: libxml-ruby
|
36
|
+
prerelease: false
|
37
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ">="
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
segments:
|
42
|
+
- 1
|
43
|
+
- 1
|
44
|
+
- 4
|
45
|
+
version: 1.1.4
|
46
|
+
type: :runtime
|
47
|
+
version_requirements: *id002
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: zipruby
|
50
|
+
prerelease: false
|
51
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
segments:
|
56
|
+
- 0
|
57
|
+
- 3
|
58
|
+
- 6
|
59
|
+
version: 0.3.6
|
60
|
+
type: :runtime
|
61
|
+
version_requirements: *id003
|
34
62
|
description: an easy-to-use (and easy-to-implement) EPUB generator.
|
35
63
|
email: skoji@skoji.jp
|
36
64
|
executables: []
|