eeepub 0.8.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- data/eeepub.gemspec +1 -1
- data/lib/eeepub/container_item.rb +1 -1
- data/lib/eeepub/maker.rb +2 -0
- data/lib/eeepub/opf.rb +2 -0
- data/spec/eeepub/container_item_spec.rb +20 -0
- data/spec/eeepub/maker_spec.rb +5 -0
- data/spec/eeepub/opf_spec.rb +6 -1
- metadata +56 -16
data/eeepub.gemspec
CHANGED
data/lib/eeepub/maker.rb
CHANGED
@@ -53,6 +53,7 @@ module EeePub
|
|
53
53
|
:uid,
|
54
54
|
:files,
|
55
55
|
:nav,
|
56
|
+
:cover,
|
56
57
|
:ncx_file,
|
57
58
|
:opf_file
|
58
59
|
].each do |name|
|
@@ -130,6 +131,7 @@ module EeePub
|
|
130
131
|
:subject => @subjects,
|
131
132
|
:description => @descriptions,
|
132
133
|
:rights => @rightss,
|
134
|
+
:cover => @cover,
|
133
135
|
:relation => @relations,
|
134
136
|
:manifest => @files.map{|file|
|
135
137
|
case file
|
data/lib/eeepub/opf.rb
CHANGED
@@ -0,0 +1,20 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
2
|
+
|
3
|
+
describe "EeePub::ContainerItem" do
|
4
|
+
|
5
|
+
context 'guess media type' do
|
6
|
+
|
7
|
+
before :each do
|
8
|
+
@container_item = EeePub::ContainerItem.new []
|
9
|
+
end
|
10
|
+
|
11
|
+
it 'should be application/xhtml+xml' do
|
12
|
+
media_type = 'application/xhtml+xml'
|
13
|
+
['test.htm', 'test.html', 'test.xhtm', 'test.xhtml'].each do |file_name|
|
14
|
+
@container_item.send(:guess_media_type, file_name).should == media_type
|
15
|
+
end
|
16
|
+
@container_item.send(:guess_media_type, "test.xml").should_not == media_type
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
data/spec/eeepub/maker_spec.rb
CHANGED
@@ -16,6 +16,7 @@ describe "EeePub::Maker" do
|
|
16
16
|
uid 'http://example.com/book/foo'
|
17
17
|
ncx_file 'toc.ncx'
|
18
18
|
opf_file 'content.opf'
|
19
|
+
cover 'cover.jpg'
|
19
20
|
files ['foo.html', 'bar.html']
|
20
21
|
nav [
|
21
22
|
{:label => '1. foo', :content => 'foo.html'},
|
@@ -32,6 +33,7 @@ describe "EeePub::Maker" do
|
|
32
33
|
it { @maker.instance_variable_get(:@uid).should == 'http://example.com/book/foo' }
|
33
34
|
it { @maker.instance_variable_get(:@ncx_file).should == 'toc.ncx' }
|
34
35
|
it { @maker.instance_variable_get(:@opf_file).should == 'content.opf' }
|
36
|
+
it { @maker.instance_variable_get(:@cover).should == 'cover.jpg' }
|
35
37
|
it { @maker.instance_variable_get(:@files).should == ['foo.html', 'bar.html'] }
|
36
38
|
it {
|
37
39
|
@maker.instance_variable_get(:@nav).should == [
|
@@ -61,6 +63,7 @@ describe "EeePub::Maker" do
|
|
61
63
|
:rights => ['xxx'],
|
62
64
|
:relation => ['xxx'],
|
63
65
|
:ncx => "toc.ncx",
|
66
|
+
:cover => 'cover.jpg',
|
64
67
|
:publisher => ["jugyo.org"],
|
65
68
|
:unique_identifier=>"http://example.com/book/foo",
|
66
69
|
:identifier => [{:value => "http://example.com/book/foo", :scheme => "URL", :id => "http://example.com/book/foo"}],
|
@@ -90,6 +93,7 @@ describe "EeePub::Maker" do
|
|
90
93
|
uid 'http://example.com/book/foo'
|
91
94
|
ncx_file 'toc.ncx'
|
92
95
|
opf_file 'content.opf'
|
96
|
+
cover 'cover.jpg'
|
93
97
|
files [{'foo.html' => 'foo/bar'}, {'bar.html' => 'foo/bar/baz'}]
|
94
98
|
nav [
|
95
99
|
{:label => '1. foo', :content => 'foo.html'},
|
@@ -113,6 +117,7 @@ describe "EeePub::Maker" do
|
|
113
117
|
:rights => ['xxx'],
|
114
118
|
:relation => ['xxx'],
|
115
119
|
:ncx => "toc.ncx",
|
120
|
+
:cover => 'cover.jpg',
|
116
121
|
:publisher => ["jugyo.org"],
|
117
122
|
:unique_identifier=>"http://example.com/book/foo",
|
118
123
|
:identifier => [{:value => "http://example.com/book/foo", :scheme => "URL", :id=>"http://example.com/book/foo"}],
|
data/spec/eeepub/opf_spec.rb
CHANGED
@@ -118,7 +118,8 @@ describe "EeePub::OPF" do
|
|
118
118
|
:relation => 'relation',
|
119
119
|
:creator => 'creator',
|
120
120
|
:publisher => 'publisher',
|
121
|
-
:rights => 'rights'
|
121
|
+
:rights => 'rights',
|
122
|
+
:cover => 'cover.jpg'
|
122
123
|
)
|
123
124
|
end
|
124
125
|
|
@@ -144,6 +145,10 @@ describe "EeePub::OPF" do
|
|
144
145
|
identifier.attribute('id').value.should == @opf.unique_identifier
|
145
146
|
identifier.attribute('scheme').value.should == @opf.identifier[0][:scheme]
|
146
147
|
identifier.inner_text.should == @opf.identifier[0][:value]
|
148
|
+
|
149
|
+
identifier = metadata.at('meta')
|
150
|
+
identifier.attribute('name').value.should == 'cover'
|
151
|
+
identifier.attribute('content').value.should == 'cover.jpg'
|
147
152
|
end
|
148
153
|
end
|
149
154
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eeepub
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-03-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: builder
|
16
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,15 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
25
30
|
- !ruby/object:Gem::Dependency
|
26
31
|
name: rubyzip
|
27
|
-
requirement:
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
28
33
|
none: false
|
29
34
|
requirements:
|
30
35
|
- - ! '>='
|
@@ -32,10 +37,15 @@ dependencies:
|
|
32
37
|
version: '0'
|
33
38
|
type: :runtime
|
34
39
|
prerelease: false
|
35
|
-
version_requirements:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
36
46
|
- !ruby/object:Gem::Dependency
|
37
47
|
name: rspec
|
38
|
-
requirement:
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
39
49
|
none: false
|
40
50
|
requirements:
|
41
51
|
- - ! '>='
|
@@ -43,10 +53,15 @@ dependencies:
|
|
43
53
|
version: '0'
|
44
54
|
type: :development
|
45
55
|
prerelease: false
|
46
|
-
version_requirements:
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
47
62
|
- !ruby/object:Gem::Dependency
|
48
63
|
name: nokogiri
|
49
|
-
requirement:
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
50
65
|
none: false
|
51
66
|
requirements:
|
52
67
|
- - ! '>='
|
@@ -54,10 +69,15 @@ dependencies:
|
|
54
69
|
version: '0'
|
55
70
|
type: :development
|
56
71
|
prerelease: false
|
57
|
-
version_requirements:
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
58
78
|
- !ruby/object:Gem::Dependency
|
59
79
|
name: rr
|
60
|
-
requirement:
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
61
81
|
none: false
|
62
82
|
requirements:
|
63
83
|
- - ! '>='
|
@@ -65,10 +85,15 @@ dependencies:
|
|
65
85
|
version: '0'
|
66
86
|
type: :development
|
67
87
|
prerelease: false
|
68
|
-
version_requirements:
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
69
94
|
- !ruby/object:Gem::Dependency
|
70
95
|
name: simplecov
|
71
|
-
requirement:
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
72
97
|
none: false
|
73
98
|
requirements:
|
74
99
|
- - ! '>='
|
@@ -76,7 +101,12 @@ dependencies:
|
|
76
101
|
version: '0'
|
77
102
|
type: :development
|
78
103
|
prerelease: false
|
79
|
-
version_requirements:
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
80
110
|
description: EeePub is a Ruby ePub generator.
|
81
111
|
email:
|
82
112
|
- jugyo.org@gmail.com
|
@@ -100,6 +130,7 @@ files:
|
|
100
130
|
- lib/eeepub/ncx.rb
|
101
131
|
- lib/eeepub/ocf.rb
|
102
132
|
- lib/eeepub/opf.rb
|
133
|
+
- spec/eeepub/container_item_spec.rb
|
103
134
|
- spec/eeepub/easy_spec.rb
|
104
135
|
- spec/eeepub/maker_spec.rb
|
105
136
|
- spec/eeepub/ncx_spec.rb
|
@@ -127,8 +158,17 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
127
158
|
version: '0'
|
128
159
|
requirements: []
|
129
160
|
rubyforge_project:
|
130
|
-
rubygems_version: 1.8.
|
161
|
+
rubygems_version: 1.8.24
|
131
162
|
signing_key:
|
132
163
|
specification_version: 3
|
133
164
|
summary: ePub generator
|
134
|
-
test_files:
|
165
|
+
test_files:
|
166
|
+
- spec/eeepub/container_item_spec.rb
|
167
|
+
- spec/eeepub/easy_spec.rb
|
168
|
+
- spec/eeepub/maker_spec.rb
|
169
|
+
- spec/eeepub/ncx_spec.rb
|
170
|
+
- spec/eeepub/ocf_spec.rb
|
171
|
+
- spec/eeepub/opf_spec.rb
|
172
|
+
- spec/eeepub_spec.rb
|
173
|
+
- spec/spec_helper.rb
|
174
|
+
has_rdoc:
|