pubgen 0.2.1 → 0.2.2
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/Rakefile +4 -0
- data/lib/pubgen/version.rb +1 -1
- data/lib/pubgen/yaml.rb +5 -4
- data/test/output/will_oldham.yml +2 -2
- data/test/toc_1/will_oldham.html +3 -3
- data/test/toc_1/will_oldham.yml +38 -38
- data/test/toc_2/couchdb.yml +5 -5
- metadata +6 -6
data/Rakefile
CHANGED
@@ -44,6 +44,8 @@ task :test_toc_2 => :test_toc_1 do |t|
|
|
44
44
|
o_yml = "#{$tmpdir}/.out.yml"
|
45
45
|
sh_echo_off("bin/pubgen -t #{$tmpdir}/couchdb.html #{$tmpdir} > #{o_yml}")
|
46
46
|
sh_echo_off("diff test/toc_2/couchdb.yml #{o_yml}")
|
47
|
+
require 'yaml'
|
48
|
+
YAML::load File.open(o_yml)
|
47
49
|
sh_echo_off("rm -rf #{$tmpdir}")
|
48
50
|
puts "done!"
|
49
51
|
end
|
@@ -54,6 +56,8 @@ task :test_toc_1 => :test_output do |t|
|
|
54
56
|
o_yml = "#{$tmpdir}/.out.yml"
|
55
57
|
sh_echo_off("bin/pubgen -t test/toc_1/will_oldham.html test/toc_1 > #{o_yml}")
|
56
58
|
sh_echo_off("diff test/toc_1/will_oldham.yml #{o_yml}")
|
59
|
+
require 'yaml'
|
60
|
+
YAML::load File.open(o_yml)
|
57
61
|
sh_echo_off("rm -rf #{$tmpdir}")
|
58
62
|
puts "done!"
|
59
63
|
end
|
data/lib/pubgen/version.rb
CHANGED
data/lib/pubgen/yaml.rb
CHANGED
@@ -89,11 +89,12 @@ EOF
|
|
89
89
|
link = rpath + (anchor ? '#' + anchor : '')
|
90
90
|
next if linkmap[link] == true
|
91
91
|
linkmap[link] = true
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
92
|
+
e = "#{text} -- #{link}"
|
93
|
+
# make text YAML friendly
|
94
|
+
if e =~ /[:"'\\\[\]]/
|
95
|
+
e = e.gsub(/\\/, "\\\\\\\\").gsub(/"/, '\\"')
|
96
96
|
end
|
97
|
+
toc << " - \"#{e}\"\n"
|
97
98
|
# add it to spine map
|
98
99
|
spinemap[rpath] = true
|
99
100
|
end
|
data/test/output/will_oldham.yml
CHANGED
@@ -35,8 +35,8 @@ toc:
|
|
35
35
|
- 1.1 Discography -- contents/a.html#discography:
|
36
36
|
- 1.1.1 Studio albums -- contents/a.html#studio_albums
|
37
37
|
- 1.2 Response -- contents/a.html#response
|
38
|
-
- 2 Film -- contents/b.html:
|
39
|
-
- 2.1
|
38
|
+
- "2 :Film -- contents/b.html":
|
39
|
+
- "2.1 \\Fi\"lmography -- will_oldham.html#Filmography"
|
40
40
|
- 3 Photography -- contents/b.html#photography
|
41
41
|
- 4 References -- contents/b.html#references
|
42
42
|
- 5 External links -- contents/b.html#external_links
|
data/test/toc_1/will_oldham.html
CHANGED
@@ -115,15 +115,15 @@
|
|
115
115
|
<ul>
|
116
116
|
<li class="toclevel-2 tocsection-2"><a href="#Discography"><span class="tocnumber">1.1</span> <span class="toctext">Discography</span></a>
|
117
117
|
<ul>
|
118
|
-
<li class="toclevel-3 tocsection-3"><a href="#Studio_albums"><span class="tocnumber">1.1.1</span> <span class="toctext">Studio albums</span></a></li>
|
118
|
+
<li class="toclevel-3 tocsection-3"><a href="#Studio_albums"><span class="tocnumber">1.1.1</span> <span class="toctext">Studio :albums</span></a></li>
|
119
119
|
</ul>
|
120
120
|
</li>
|
121
|
-
<li class="toclevel-2 tocsection-4"><a href="#Response"><span class="tocnumber">1.2</span> <span class="toctext">
|
121
|
+
<li class="toclevel-2 tocsection-4"><a href="#Response"><span class="tocnumber">1.2</span> <span class="toctext">Resp'onse</span></a></li>
|
122
122
|
</ul>
|
123
123
|
</li>
|
124
124
|
<li class="toclevel-1 tocsection-5"><a href="#Film"><span class="tocnumber">2</span> <span class="toctext">Film</span></a>
|
125
125
|
<ul>
|
126
|
-
<li class="toclevel-2 tocsection-6"><a href="#Filmography"><span class="tocnumber">2.1</span> <span class="toctext">
|
126
|
+
<li class="toclevel-2 tocsection-6"><a href="#Filmography"><span class="tocnumber">2.1</span> <span class="toctext">Fi"lmo\graphy</span></a></li>
|
127
127
|
</ul>
|
128
128
|
</li>
|
129
129
|
<li class="toclevel-1 tocsection-7"><a href="#Photography"><span class="tocnumber">3</span> <span class="toctext">Photography</span></a></li>
|
data/test/toc_1/will_oldham.yml
CHANGED
@@ -45,41 +45,41 @@ spine:
|
|
45
45
|
#
|
46
46
|
# See http://idpf.org/epub/20/spec/OPF_2.0.1_draft.htm#Section2.4.1
|
47
47
|
toc:
|
48
|
-
- navigation -- will_oldham.html#mw-head
|
49
|
-
- search -- will_oldham.html#p-search
|
50
|
-
- 1 Music -- will_oldham.html#Music
|
51
|
-
- 1.1 Discography -- will_oldham.html#Discography
|
52
|
-
- 1.1.1 Studio albums -- will_oldham.html#Studio_albums
|
53
|
-
- 1.2
|
54
|
-
- 2 Film -- will_oldham.html#Film
|
55
|
-
- 2.1
|
56
|
-
- 3 Photography -- will_oldham.html#Photography
|
57
|
-
- 4 References -- will_oldham.html#References
|
58
|
-
- 5 External links -- will_oldham.html#External_links
|
59
|
-
- [1] -- will_oldham.html#cite_note-chico-0
|
60
|
-
- [2] -- will_oldham.html#cite_note-phoenix-1
|
61
|
-
- [3] -- will_oldham.html#cite_note-2
|
62
|
-
- [4] -- will_oldham.html#cite_note-3
|
63
|
-
- [5] -- will_oldham.html#cite_note-4
|
64
|
-
- [6] -- will_oldham.html#cite_note-5
|
65
|
-
- [7] -- will_oldham.html#cite_note-6
|
66
|
-
- [8] -- will_oldham.html#cite_note-7
|
67
|
-
- [9] -- will_oldham.html#cite_note-dallasobs-8
|
68
|
-
- [10] -- will_oldham.html#cite_note-9
|
69
|
-
- [11] -- will_oldham.html#cite_note-10
|
70
|
-
- [12] -- will_oldham.html#cite_note-musicianguide-11
|
71
|
-
- a -- will_oldham.html#cite_ref-chico_0-0
|
72
|
-
- b -- will_oldham.html#cite_ref-chico_0-1
|
73
|
-
- c -- will_oldham.html#cite_ref-chico_0-2
|
74
|
-
- a -- will_oldham.html#cite_ref-phoenix_1-0
|
75
|
-
- b -- will_oldham.html#cite_ref-phoenix_1-1
|
76
|
-
- ^ -- will_oldham.html#cite_ref-2
|
77
|
-
- ^ -- will_oldham.html#cite_ref-3
|
78
|
-
- ^ -- will_oldham.html#cite_ref-4
|
79
|
-
- ^ -- will_oldham.html#cite_ref-5
|
80
|
-
- ^ -- will_oldham.html#cite_ref-6
|
81
|
-
- ^ -- will_oldham.html#cite_ref-7
|
82
|
-
- ^ -- will_oldham.html#cite_ref-dallasobs_8-0
|
83
|
-
- ^ -- will_oldham.html#cite_ref-9
|
84
|
-
- ^ -- will_oldham.html#cite_ref-10
|
85
|
-
- ^ -- will_oldham.html#cite_ref-musicianguide_11-0
|
48
|
+
- "navigation -- will_oldham.html#mw-head"
|
49
|
+
- "search -- will_oldham.html#p-search"
|
50
|
+
- "1 Music -- will_oldham.html#Music"
|
51
|
+
- "1.1 Discography -- will_oldham.html#Discography"
|
52
|
+
- "1.1.1 Studio :albums -- will_oldham.html#Studio_albums"
|
53
|
+
- "1.2 Resp'onse -- will_oldham.html#Response"
|
54
|
+
- "2 Film -- will_oldham.html#Film"
|
55
|
+
- "2.1 Fi\"lmo\\graphy -- will_oldham.html#Filmography"
|
56
|
+
- "3 Photography -- will_oldham.html#Photography"
|
57
|
+
- "4 References -- will_oldham.html#References"
|
58
|
+
- "5 External links -- will_oldham.html#External_links"
|
59
|
+
- "[1] -- will_oldham.html#cite_note-chico-0"
|
60
|
+
- "[2] -- will_oldham.html#cite_note-phoenix-1"
|
61
|
+
- "[3] -- will_oldham.html#cite_note-2"
|
62
|
+
- "[4] -- will_oldham.html#cite_note-3"
|
63
|
+
- "[5] -- will_oldham.html#cite_note-4"
|
64
|
+
- "[6] -- will_oldham.html#cite_note-5"
|
65
|
+
- "[7] -- will_oldham.html#cite_note-6"
|
66
|
+
- "[8] -- will_oldham.html#cite_note-7"
|
67
|
+
- "[9] -- will_oldham.html#cite_note-dallasobs-8"
|
68
|
+
- "[10] -- will_oldham.html#cite_note-9"
|
69
|
+
- "[11] -- will_oldham.html#cite_note-10"
|
70
|
+
- "[12] -- will_oldham.html#cite_note-musicianguide-11"
|
71
|
+
- "a -- will_oldham.html#cite_ref-chico_0-0"
|
72
|
+
- "b -- will_oldham.html#cite_ref-chico_0-1"
|
73
|
+
- "c -- will_oldham.html#cite_ref-chico_0-2"
|
74
|
+
- "a -- will_oldham.html#cite_ref-phoenix_1-0"
|
75
|
+
- "b -- will_oldham.html#cite_ref-phoenix_1-1"
|
76
|
+
- "^ -- will_oldham.html#cite_ref-2"
|
77
|
+
- "^ -- will_oldham.html#cite_ref-3"
|
78
|
+
- "^ -- will_oldham.html#cite_ref-4"
|
79
|
+
- "^ -- will_oldham.html#cite_ref-5"
|
80
|
+
- "^ -- will_oldham.html#cite_ref-6"
|
81
|
+
- "^ -- will_oldham.html#cite_ref-7"
|
82
|
+
- "^ -- will_oldham.html#cite_ref-dallasobs_8-0"
|
83
|
+
- "^ -- will_oldham.html#cite_ref-9"
|
84
|
+
- "^ -- will_oldham.html#cite_ref-10"
|
85
|
+
- "^ -- will_oldham.html#cite_ref-musicianguide_11-0"
|
data/test/toc_2/couchdb.yml
CHANGED
@@ -57,8 +57,8 @@ spine:
|
|
57
57
|
#
|
58
58
|
# See http://idpf.org/epub/20/spec/OPF_2.0.1_draft.htm#Section2.4.1
|
59
59
|
toc:
|
60
|
-
- Preface -- preface.html
|
61
|
-
- 1. Why CouchDB? -- why.html
|
62
|
-
- 2. Eventual Consistency -- consistency.html
|
63
|
-
- 3. Getting Started -- tour.html
|
64
|
-
- 4. The Core API -- api.html
|
60
|
+
- "Preface -- preface.html"
|
61
|
+
- "1. Why CouchDB? -- why.html"
|
62
|
+
- "2. Eventual Consistency -- consistency.html"
|
63
|
+
- "3. Getting Started -- tour.html"
|
64
|
+
- "4. The Core API -- api.html"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pubgen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
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: 2012-03-
|
12
|
+
date: 2012-03-07 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: zipruby
|
16
|
-
requirement: &
|
16
|
+
requirement: &12423400 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *12423400
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: hpricot
|
27
|
-
requirement: &
|
27
|
+
requirement: &12422980 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *12422980
|
36
36
|
description: Pubgen is a command-line based epub generator. Make an epub with YAML.
|
37
37
|
email:
|
38
38
|
- 9beach@gmail.com
|