epub-directory 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.document +2 -0
- data/.gitignore +6 -0
- data/.yardopts +1 -0
- data/COPYING.txt +661 -0
- data/ChangeLog.md +4 -0
- data/Gemfile +13 -0
- data/README.md +57 -0
- data/Rakefile +37 -0
- data/bin/epub-directory +22 -0
- data/epub-directory.gemspec +43 -0
- data/lib/epub/directory.rb +139 -0
- data/lib/epub/directory/version.rb +23 -0
- data/templates/release-identifier.haml +37 -0
- data/test/fixtures/wasteland.html +54 -0
- data/test/fixtures/wasteland.opds +19 -0
- data/test/fixtures/wasteland.opf +32 -0
- data/test/helper.rb +13 -0
- data/test/test_epub-directory.rb +51 -0
- metadata +208 -0
@@ -0,0 +1,32 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid" xml:lang="en-US" prefix="cc: http://creativecommons.org/ns#">
|
3
|
+
<metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
|
4
|
+
<dc:identifier id="uid">code.google.com.epub-samples.wasteland-basic</dc:identifier>
|
5
|
+
<dc:title>The Waste Land</dc:title>
|
6
|
+
<dc:creator>T.S. Eliot</dc:creator>
|
7
|
+
<dc:language>en-US</dc:language>
|
8
|
+
<dc:date>2011-09-01</dc:date>
|
9
|
+
<meta property="dcterms:modified">2012-01-18T12:47:00Z</meta>
|
10
|
+
<!-- rights expressions for the work as a whole -->
|
11
|
+
<dc:rights>This work is shared with the public using the Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) license.</dc:rights>
|
12
|
+
<link rel="cc:license" href="http://creativecommons.org/licenses/by-sa/3.0/"/>
|
13
|
+
<meta property="cc:attributionURL">http://code.google.com/p/epub-samples/</meta>
|
14
|
+
<!-- rights expression for the cover image -->
|
15
|
+
<link rel="cc:license" refines="#cover" href="http://creativecommons.org/licenses/by-sa/3.0/" />
|
16
|
+
<link rel="cc:attributionURL" refines="#cover" href="http://en.wikipedia.org/wiki/Simon_Fieldhouse" />
|
17
|
+
<!-- cover meta element included for 2.0 reading system compatibility: -->
|
18
|
+
<meta name="cover" content="cover"/>
|
19
|
+
</metadata>
|
20
|
+
<manifest>
|
21
|
+
<item id="t1" href="wasteland-content.xhtml" media-type="application/xhtml+xml" />
|
22
|
+
<item id="nav" href="wasteland-nav.xhtml" properties="nav" media-type="application/xhtml+xml" />
|
23
|
+
<item id="cover" href="wasteland-cover.jpg" media-type="image/jpeg" properties="cover-image" />
|
24
|
+
<item id="css" href="wasteland.css" media-type="text/css" />
|
25
|
+
<item id="css-night" href="wasteland-night.css" media-type="text/css" />
|
26
|
+
<!-- ncx included for 2.0 reading system compatibility: -->
|
27
|
+
<item id="ncx" href="wasteland.ncx" media-type="application/x-dtbncx+xml" />
|
28
|
+
</manifest>
|
29
|
+
<spine toc="ncx">
|
30
|
+
<itemref idref="t1" />
|
31
|
+
</spine>
|
32
|
+
</package>
|
data/test/helper.rb
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
require 'helper'
|
2
|
+
require 'epub/directory'
|
3
|
+
require "tmpdir"
|
4
|
+
require "pathname"
|
5
|
+
|
6
|
+
class TestEPUBDirectory < Test::Unit::TestCase
|
7
|
+
|
8
|
+
def setup
|
9
|
+
@epub_path = Pathname.new("test/fixtures/wasteland.epub").expand_path
|
10
|
+
@opf_path = Pathname.new("test/fixtures/wasteland.opf").expand_path
|
11
|
+
@source_path = Pathname.new("src/code.google.com.epub-samples.wasteland-basic/2012-01-18T12:47:00Z.opf")
|
12
|
+
end
|
13
|
+
|
14
|
+
def test_version
|
15
|
+
version = EPUB::Directory.const_get('VERSION')
|
16
|
+
|
17
|
+
assert !version.empty?, 'should have a VERSION constant'
|
18
|
+
end
|
19
|
+
|
20
|
+
def test_add
|
21
|
+
Dir.mktmpdir do |dir|
|
22
|
+
Dir.chdir dir do
|
23
|
+
EPUB::Directory.add @epub_path
|
24
|
+
assert_path_exist @source_path
|
25
|
+
assert_equal @opf_path.read, @source_path.read
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
data(
|
31
|
+
"opf" => [:build_opf, "build/code.google.com.epub-samples.wasteland-basic/2012-01-18T12:47:00Z.opf"],
|
32
|
+
"html" => [:build_html, "build/code.google.com.epub-samples.wasteland-basic/2012-01-18T12:47:00Z.html"],
|
33
|
+
"opds" => [:build_opds, "build/code.google.com.epub-samples.wasteland-basic/2012-01-18T12:47:00Z.opds"],
|
34
|
+
"json" => [:build_json, "build/code.google.com.epub-samples.wasteland-basic/2012-01-18T12:47:00Z.json"],
|
35
|
+
)
|
36
|
+
def test_build_file(data)
|
37
|
+
build_method, dest_path = data
|
38
|
+
pend if build_method == :build_json
|
39
|
+
dest_path = Pathname.new(dest_path)
|
40
|
+
Dir.mktmpdir do |dir|
|
41
|
+
Dir.chdir dir do
|
42
|
+
EPUB::Directory.add @epub_path
|
43
|
+
EPUB::Directory.new.make_destination_directory @source_path
|
44
|
+
EPUB::Directory.new.send build_method, @source_path
|
45
|
+
assert_path_exist dest_path
|
46
|
+
assert_equal File.read(@opf_path.sub_ext(dest_path.extname)).chomp, dest_path.read.chomp
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
metadata
ADDED
@@ -0,0 +1,208 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: epub-directory
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- KITAITI Makoto
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2018-10-22 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: epub-parser
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: tomlrb
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: haml
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rss-opds
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: bundler
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '1.10'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '1.10'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rake
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '10.0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '10.0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rubygems-tasks
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0.2'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0.2'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: yard
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0.8'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0.8'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: test-unit
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: test-unit-notify
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
153
|
+
description: Builds EPUB directory static site from EPUB files, package documents
|
154
|
+
or Web Publication manifests.
|
155
|
+
email: KitaitiMakoto@gmail.com
|
156
|
+
executables:
|
157
|
+
- epub-directory
|
158
|
+
extensions: []
|
159
|
+
extra_rdoc_files: []
|
160
|
+
files:
|
161
|
+
- ".document"
|
162
|
+
- ".gitignore"
|
163
|
+
- ".yardopts"
|
164
|
+
- COPYING.txt
|
165
|
+
- ChangeLog.md
|
166
|
+
- Gemfile
|
167
|
+
- README.md
|
168
|
+
- Rakefile
|
169
|
+
- bin/epub-directory
|
170
|
+
- epub-directory.gemspec
|
171
|
+
- lib/epub/directory.rb
|
172
|
+
- lib/epub/directory/version.rb
|
173
|
+
- templates/release-identifier.haml
|
174
|
+
- test/fixtures/wasteland.html
|
175
|
+
- test/fixtures/wasteland.opds
|
176
|
+
- test/fixtures/wasteland.opf
|
177
|
+
- test/helper.rb
|
178
|
+
- test/test_epub-directory.rb
|
179
|
+
homepage: https://rubygems.org/gems/epub-directory
|
180
|
+
licenses:
|
181
|
+
- AGPL
|
182
|
+
metadata: {}
|
183
|
+
post_install_message:
|
184
|
+
rdoc_options: []
|
185
|
+
require_paths:
|
186
|
+
- lib
|
187
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
188
|
+
requirements:
|
189
|
+
- - ">="
|
190
|
+
- !ruby/object:Gem::Version
|
191
|
+
version: '0'
|
192
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
193
|
+
requirements:
|
194
|
+
- - ">="
|
195
|
+
- !ruby/object:Gem::Version
|
196
|
+
version: '0'
|
197
|
+
requirements: []
|
198
|
+
rubyforge_project:
|
199
|
+
rubygems_version: 2.7.6
|
200
|
+
signing_key:
|
201
|
+
specification_version: 4
|
202
|
+
summary: EPUB directory builder
|
203
|
+
test_files:
|
204
|
+
- test/fixtures/wasteland.html
|
205
|
+
- test/fixtures/wasteland.opds
|
206
|
+
- test/fixtures/wasteland.opf
|
207
|
+
- test/helper.rb
|
208
|
+
- test/test_epub-directory.rb
|