kitabu 1.0.5 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec +1 -1
- data/Gemfile.lock +44 -30
- data/README.rdoc +1 -1
- data/kitabu.gemspec +3 -5
- data/lib/kitabu.rb +15 -14
- data/lib/kitabu/generator.rb +10 -0
- data/lib/kitabu/version.rb +1 -1
- data/spec/kitabu/cli/new_spec.rb +4 -2
- data/spec/kitabu/cli/permalinks_spec.rb +1 -0
- data/spec/kitabu/cli/stats_spec.rb +6 -3
- data/spec/kitabu/cli/version_spec.rb +1 -1
- data/spec/kitabu/extensions/redcloth_spec.rb +11 -11
- data/spec/kitabu/extensions/string_spec.rb +1 -1
- data/spec/kitabu/parser/epub_spec.rb +1 -1
- data/spec/kitabu/parser/html_spec.rb +19 -19
- data/spec/kitabu/parser/pdf_spec.rb +1 -1
- data/spec/kitabu/stats_spec.rb +8 -5
- data/spec/kitabu/syntax_spec.rb +33 -33
- data/spec/kitabu/toc/html_spec.rb +19 -19
- data/spec/spec_helper.rb +7 -1
- data/spec/support/exit_with_code.rb +2 -2
- data/spec/support/have_tag.rb +1 -1
- data/spec/support/shared.rb +22 -18
- data/templates/Gemfile +3 -0
- metadata +86 -72
- data/spec/kitabu_spec.rb +0 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ef382447f8d4fb0eef52e1d9e6ffa6ffd9733d2
|
4
|
+
data.tar.gz: 77062a208f61b31f2a1b79575c094f5f8f64800a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f5737248a3a0fdf2aca5ee16c88e5484d5cc124aa2d86472c75fb21dfd47a6569a838e694e9d51091ffcd2c2952cb6755bb11b6af7763123c32cdfd518e78e4
|
7
|
+
data.tar.gz: 7c106d90e9d1c4a5d122b669dfb2f7c70d5a0234edeca6a0fa8c66e3653158f46be8d25f16b3728b3173c9a5241ee6a93de440c85879c17ca313c7c8eedfa16d
|
data/.rspec
CHANGED
@@ -1 +1 @@
|
|
1
|
-
--color
|
1
|
+
--color
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
kitabu (1.0.
|
4
|
+
kitabu (1.0.6)
|
5
5
|
RedCloth
|
6
6
|
activesupport
|
7
7
|
coderay
|
@@ -10,68 +10,82 @@ PATH
|
|
10
10
|
nokogiri
|
11
11
|
notifier
|
12
12
|
rdiscount
|
13
|
-
rubyzip
|
13
|
+
rubyzip
|
14
14
|
thor
|
15
|
+
zip-zip
|
15
16
|
|
16
17
|
GEM
|
17
18
|
remote: https://rubygems.org/
|
18
19
|
specs:
|
19
20
|
RedCloth (4.2.9)
|
20
|
-
activesupport (4.0.
|
21
|
-
i18n (~> 0.6, >= 0.6.
|
21
|
+
activesupport (4.0.4)
|
22
|
+
i18n (~> 0.6, >= 0.6.9)
|
22
23
|
minitest (~> 4.2)
|
23
24
|
multi_json (~> 1.3)
|
24
25
|
thread_safe (~> 0.1)
|
25
26
|
tzinfo (~> 0.3.37)
|
26
|
-
atomic (1.1.
|
27
|
+
atomic (1.1.16)
|
27
28
|
awesome_print (1.2.0)
|
28
29
|
builder (3.2.2)
|
29
|
-
coderay (1.0
|
30
|
-
|
30
|
+
coderay (1.1.0)
|
31
|
+
columnize (0.3.6)
|
32
|
+
debugger (1.6.6)
|
33
|
+
columnize (>= 0.3.1)
|
34
|
+
debugger-linecache (~> 1.2.0)
|
35
|
+
debugger-ruby_core_source (~> 1.3.2)
|
36
|
+
debugger-linecache (1.2.0)
|
37
|
+
debugger-ruby_core_source (1.3.2)
|
38
|
+
diff-lcs (1.2.5)
|
31
39
|
eeepub-with-cover-support (0.8.8)
|
32
40
|
builder
|
33
41
|
rubyzip
|
34
|
-
i18n (0.6.
|
42
|
+
i18n (0.6.9)
|
35
43
|
method_source (0.8.2)
|
36
|
-
mini_portile (0.5.
|
44
|
+
mini_portile (0.5.3)
|
37
45
|
minitest (4.7.5)
|
38
|
-
multi_json (1.
|
39
|
-
nokogiri (1.6.
|
46
|
+
multi_json (1.9.2)
|
47
|
+
nokogiri (1.6.1)
|
40
48
|
mini_portile (~> 0.5.0)
|
41
49
|
notifier (0.4.1)
|
42
|
-
pry (0.9.12.
|
43
|
-
coderay (~> 1.0
|
50
|
+
pry (0.9.12.6)
|
51
|
+
coderay (~> 1.0)
|
44
52
|
method_source (~> 0.8)
|
45
53
|
slop (~> 3.4)
|
46
|
-
pry-
|
54
|
+
pry-debugger (0.2.2)
|
55
|
+
debugger (~> 1.3)
|
47
56
|
pry (~> 0.9.10)
|
48
|
-
|
57
|
+
pry-meta (0.0.6)
|
58
|
+
awesome_print
|
59
|
+
pry
|
60
|
+
pry-debugger
|
61
|
+
pry-remote
|
62
|
+
pry-remote (0.1.8)
|
63
|
+
pry (~> 0.9)
|
64
|
+
slop (~> 3.0)
|
65
|
+
rake (10.2.2)
|
49
66
|
rdiscount (2.1.7)
|
50
67
|
rspec (2.14.1)
|
51
68
|
rspec-core (~> 2.14.0)
|
52
69
|
rspec-expectations (~> 2.14.0)
|
53
70
|
rspec-mocks (~> 2.14.0)
|
54
|
-
rspec-core (2.14.
|
55
|
-
rspec-expectations (2.14.
|
71
|
+
rspec-core (2.14.8)
|
72
|
+
rspec-expectations (2.14.5)
|
56
73
|
diff-lcs (>= 1.1.3, < 2.0)
|
57
|
-
rspec-mocks (2.14.
|
58
|
-
rubyzip (
|
59
|
-
slop (3.
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
74
|
+
rspec-mocks (2.14.6)
|
75
|
+
rubyzip (1.1.2)
|
76
|
+
slop (3.5.0)
|
77
|
+
thor (0.19.1)
|
78
|
+
thread_safe (0.3.1)
|
79
|
+
atomic (>= 1.1.7, < 2)
|
80
|
+
tzinfo (0.3.39)
|
81
|
+
zip-zip (0.2)
|
82
|
+
rubyzip (>= 1.0.0)
|
66
83
|
|
67
84
|
PLATFORMS
|
68
85
|
ruby
|
69
86
|
|
70
87
|
DEPENDENCIES
|
71
|
-
awesome_print
|
72
88
|
kitabu!
|
73
|
-
pry
|
74
|
-
pry-nav
|
89
|
+
pry-meta
|
75
90
|
rake
|
76
91
|
rspec
|
77
|
-
test_notifier
|
data/README.rdoc
CHANGED
@@ -111,7 +111,7 @@ We use CodeRay[http://rubygems.org/gems/coderay] for syntax highlighting. To hig
|
|
111
111
|
end
|
112
112
|
@@@
|
113
113
|
|
114
|
-
If can replace CodeRay by Pygments; just install the gem pygments.rb[http://rubygems.org/pygments.rb].
|
114
|
+
If can replace CodeRay by Pygments; just install the gem pygments.rb[http://rubygems.org/gems/pygments.rb].
|
115
115
|
|
116
116
|
<b>Don't indent</b> the source block or will end up with unexpected results.
|
117
117
|
|
data/kitabu.gemspec
CHANGED
@@ -28,12 +28,10 @@ Gem::Specification.new do |s|
|
|
28
28
|
s.add_dependency "eeepub-with-cover-support"
|
29
29
|
s.add_dependency "coderay"
|
30
30
|
s.add_dependency "notifier"
|
31
|
-
s.add_dependency "rubyzip"
|
31
|
+
s.add_dependency "rubyzip"
|
32
|
+
s.add_dependency "zip-zip"
|
32
33
|
|
33
34
|
s.add_development_dependency "rspec"
|
34
|
-
s.add_development_dependency "test_notifier"
|
35
35
|
s.add_development_dependency "rake"
|
36
|
-
s.add_development_dependency "pry"
|
37
|
-
s.add_development_dependency "pry-nav"
|
38
|
-
s.add_development_dependency "awesome_print"
|
36
|
+
s.add_development_dependency "pry-meta"
|
39
37
|
end
|
data/lib/kitabu.rb
CHANGED
@@ -16,6 +16,8 @@ require "thor/group"
|
|
16
16
|
require "yaml"
|
17
17
|
require "cgi"
|
18
18
|
|
19
|
+
I18n.enforce_available_locales = false
|
20
|
+
|
19
21
|
%w[pygments.rb coderay].each do |lib|
|
20
22
|
begin
|
21
23
|
require lib
|
@@ -37,23 +39,22 @@ Encoding.default_internal = "utf-8"
|
|
37
39
|
Encoding.default_external = "utf-8"
|
38
40
|
|
39
41
|
module Kitabu
|
42
|
+
ROOT = Pathname.new(File.dirname(__FILE__) + "/..")
|
43
|
+
|
40
44
|
require "kitabu/extensions/string"
|
41
45
|
require "kitabu/extensions/redcloth"
|
42
46
|
require "kitabu/errors"
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
autoload :Stream, "kitabu/stream"
|
55
|
-
autoload :Dependency, "kitabu/dependency"
|
56
|
-
autoload :Stats, "kitabu/stats"
|
47
|
+
require "kitabu/version"
|
48
|
+
require "kitabu/generator"
|
49
|
+
require "kitabu/toc"
|
50
|
+
require "kitabu/cli"
|
51
|
+
require "kitabu/adapters/markdown"
|
52
|
+
require "kitabu/parser"
|
53
|
+
require "kitabu/exporter"
|
54
|
+
require "kitabu/syntax"
|
55
|
+
require "kitabu/stream"
|
56
|
+
require "kitabu/dependency"
|
57
|
+
require "kitabu/stats"
|
57
58
|
|
58
59
|
def self.config(root_dir = nil)
|
59
60
|
root_dir ||= Pathname.new(Dir.pwd)
|
data/lib/kitabu/generator.rb
CHANGED
@@ -43,6 +43,10 @@ module Kitabu
|
|
43
43
|
copy_file "helper.rb", "config/helper.rb"
|
44
44
|
end
|
45
45
|
|
46
|
+
def copy_gemfile
|
47
|
+
copy_file "Gemfile", "Gemfile"
|
48
|
+
end
|
49
|
+
|
46
50
|
def create_directories
|
47
51
|
empty_directory "output"
|
48
52
|
empty_directory "images"
|
@@ -63,6 +67,12 @@ module Kitabu
|
|
63
67
|
copy_file "Guardfile", "Guardfile"
|
64
68
|
end
|
65
69
|
|
70
|
+
def bundle_install
|
71
|
+
inside destination_root do
|
72
|
+
run "bundle install"
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
66
76
|
private
|
67
77
|
# Retrieve user's name using finger.
|
68
78
|
# Defaults to <tt>John Doe</tt>.
|
data/lib/kitabu/version.rb
CHANGED
data/spec/kitabu/cli/new_spec.rb
CHANGED
@@ -4,7 +4,9 @@ describe Kitabu::Cli do
|
|
4
4
|
context "while running new" do
|
5
5
|
context "when all params are valid" do
|
6
6
|
before do
|
7
|
-
capture(:stdout){
|
7
|
+
capture(:stdout){
|
8
|
+
Kitabu::Cli.start(["new", tmpdir.join("mybook").to_s])
|
9
|
+
}
|
8
10
|
end
|
9
11
|
|
10
12
|
it_behaves_like "e-book"
|
@@ -15,7 +17,7 @@ describe Kitabu::Cli do
|
|
15
17
|
capture(:stderr){ Kitabu::Cli.start(["new"]) }
|
16
18
|
}.to exit_with_code(1)
|
17
19
|
|
18
|
-
File.
|
20
|
+
expect(File).not_to be_directory(tmpdir.join("mybook"))
|
19
21
|
end
|
20
22
|
end
|
21
23
|
end
|
@@ -11,8 +11,8 @@ describe Kitabu::Cli, "while running stats" do
|
|
11
11
|
end
|
12
12
|
|
13
13
|
it "initializes stats with root dir" do
|
14
|
-
Kitabu::Stats
|
15
|
-
.
|
14
|
+
expect(Kitabu::Stats)
|
15
|
+
.to receive(:new)
|
16
16
|
.with(root_dir)
|
17
17
|
.and_return(double.as_null_object)
|
18
18
|
|
@@ -29,7 +29,10 @@ describe Kitabu::Cli, "while running stats" do
|
|
29
29
|
:code_blocks => 25
|
30
30
|
})}
|
31
31
|
|
32
|
-
before {
|
32
|
+
before {
|
33
|
+
allow(Kitabu::Stats).to receive_message_chain(:new).and_return(stats)
|
34
|
+
}
|
35
|
+
|
33
36
|
subject(:output) {
|
34
37
|
capture(:stdout) { Kitabu::Cli.start(["stats"]) }
|
35
38
|
}
|
@@ -5,7 +5,7 @@ describe Kitabu::Cli do
|
|
5
5
|
it "outputs version" do
|
6
6
|
%w[version -v --version].each do |arg|
|
7
7
|
output = capture(:stdout){ Kitabu::Cli.start([arg]) }.chomp
|
8
|
-
output.
|
8
|
+
expect(output).to eq("Kitabu version #{Kitabu::Version::STRING}")
|
9
9
|
end
|
10
10
|
end
|
11
11
|
end
|
@@ -4,9 +4,9 @@ describe RedCloth do
|
|
4
4
|
describe "#figure" do
|
5
5
|
it "renders html" do
|
6
6
|
html = RedCloth.convert("figure(The Rails logo). rails.png")
|
7
|
-
html.
|
8
|
-
p.
|
9
|
-
p.
|
7
|
+
expect(html).to have_tag("p.figure") do |p|
|
8
|
+
expect(p).to have_tag("img[@src='../images/rails.png'][@alt='The Rails logo']")
|
9
|
+
expect(p).to have_tag("span.caption", "The Rails logo")
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
@@ -14,24 +14,24 @@ describe RedCloth do
|
|
14
14
|
describe "#note" do
|
15
15
|
it "renders html" do
|
16
16
|
html = RedCloth.convert("note. Some important note!")
|
17
|
-
html.
|
17
|
+
expect(html).to have_tag("p.note", "Some important note!")
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
21
|
describe "#attention" do
|
22
22
|
it "renders html" do
|
23
23
|
html = RedCloth.convert("attention. Some warning note!")
|
24
|
-
html.
|
24
|
+
expect(html).to have_tag("p.attention", "Some warning note!")
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
28
|
describe "#file" do
|
29
29
|
it "renders html" do
|
30
|
-
Kitabu.
|
30
|
+
allow(Kitabu).to receive_message_chain(:config).and_return(base_url: "http://example.com")
|
31
31
|
html = RedCloth.convert("file. app/models/users.rb")
|
32
32
|
|
33
|
-
html.
|
34
|
-
p.
|
33
|
+
expect(html).to have_tag("p.file") do |p|
|
34
|
+
expect(p).to have_tag("a[@href='http://example.com/app/models/users.rb']", "app/models/users.rb")
|
35
35
|
end
|
36
36
|
end
|
37
37
|
end
|
@@ -39,19 +39,19 @@ describe RedCloth do
|
|
39
39
|
context "custom footnote helper" do
|
40
40
|
it "renders html" do
|
41
41
|
html = RedCloth.convert("Writing some text with a footnote %{this is a footnote}")
|
42
|
-
html.
|
42
|
+
expect(html).to eq(%[<p>Writing some text with a footnote<span class="footnote">this is a footnote</span></p>])
|
43
43
|
end
|
44
44
|
|
45
45
|
it "ignores escaped notations" do
|
46
46
|
html = RedCloth.convert("It must skip \\%{this}")
|
47
|
-
html.
|
47
|
+
expect(html).to eq(%[<p>It must skip %{this}</p>])
|
48
48
|
end
|
49
49
|
end
|
50
50
|
|
51
51
|
context "custom url helper" do
|
52
52
|
it "renders html" do
|
53
53
|
html = RedCloth.convert("<http://example.com>")
|
54
|
-
html.
|
54
|
+
expect(html).to eq(%[<p><a href="http://example.com">http://example.com</a></p>])
|
55
55
|
end
|
56
56
|
end
|
57
57
|
end
|
@@ -14,7 +14,7 @@ describe String do
|
|
14
14
|
"Don't Repeat Yourself (DRY)" => 'don-t-repeat-yourself-dry',
|
15
15
|
"Text\nwith\nline\n\n\tbreaks" => 'text-with-line-breaks'
|
16
16
|
}.each do |dirty, normalized|
|
17
|
-
dirty.to_permalink.
|
17
|
+
expect(dirty.to_permalink).to eq(normalized)
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
@@ -9,33 +9,33 @@ describe Kitabu::Parser::HTML do
|
|
9
9
|
|
10
10
|
context "when filtering entries" do
|
11
11
|
it "skips dot directories" do
|
12
|
-
relative.
|
13
|
-
relative.
|
12
|
+
expect(relative).not_to include(".")
|
13
|
+
expect(relative).not_to include("..")
|
14
14
|
end
|
15
15
|
|
16
16
|
it "skips dot files" do
|
17
|
-
relative.
|
17
|
+
expect(relative).not_to include(".gitkeep")
|
18
18
|
end
|
19
19
|
|
20
20
|
it "skips files that start with underscore" do
|
21
|
-
relative.
|
21
|
+
expect(relative).not_to include("_00_Introduction.markdown")
|
22
22
|
end
|
23
23
|
|
24
24
|
it "skips other files" do
|
25
|
-
relative.
|
26
|
-
relative.
|
25
|
+
expect(relative).not_to include("CHANGELOG.textile")
|
26
|
+
expect(relative).not_to include("TOC.textile")
|
27
27
|
end
|
28
28
|
|
29
29
|
it "returns only first-level entries" do
|
30
|
-
relative.
|
30
|
+
expect(relative).not_to include("04_With_Directory/Some_Chapter.mkdn")
|
31
31
|
end
|
32
32
|
|
33
33
|
it "returns entries" do
|
34
|
-
relative.first.
|
35
|
-
relative.second.
|
36
|
-
relative.third.
|
37
|
-
relative.fourth.
|
38
|
-
relative.fifth.
|
34
|
+
expect(relative.first).to eq("01_Markdown_Chapter.markdown")
|
35
|
+
expect(relative.second).to eq("02_Textile_Chapter.textile")
|
36
|
+
expect(relative.third).to eq("03_HTML_Chapter.html")
|
37
|
+
expect(relative.fourth).to eq("04_With_Directory")
|
38
|
+
expect(relative.fifth).to be_nil
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
@@ -45,31 +45,31 @@ describe Kitabu::Parser::HTML do
|
|
45
45
|
before { parser.parse }
|
46
46
|
|
47
47
|
it "has several chapters" do
|
48
|
-
html.
|
48
|
+
expect(html).to have_tag("div.chapter", 4)
|
49
49
|
end
|
50
50
|
|
51
51
|
it "renders .markdown" do
|
52
|
-
html.
|
52
|
+
expect(html).to have_tag("div.chapter > h2#markdown", "Markdown")
|
53
53
|
end
|
54
54
|
|
55
55
|
it "renders .mkdn" do
|
56
|
-
html.
|
56
|
+
expect(html).to have_tag("div.chapter > h2#some-chapter", "Some Chapter")
|
57
57
|
end
|
58
58
|
|
59
59
|
it "renders .textile" do
|
60
|
-
html.
|
60
|
+
expect(html).to have_tag("div.chapter > h2#textile", "Textile")
|
61
61
|
end
|
62
62
|
|
63
63
|
it "renders .html" do
|
64
|
-
html.
|
64
|
+
expect(html).to have_tag("div.chapter > h2#html", "HTML")
|
65
65
|
end
|
66
66
|
|
67
67
|
it "uses config file" do
|
68
|
-
html.
|
68
|
+
expect(html).to have_tag("div.imprint p", "Copyright (C) 2010 John Doe.")
|
69
69
|
end
|
70
70
|
|
71
71
|
it "renders changelog" do
|
72
|
-
html.
|
72
|
+
expect(html).to have_tag("div.changelog h2", "Revisions")
|
73
73
|
end
|
74
74
|
end
|
75
75
|
end
|
data/spec/kitabu/stats_spec.rb
CHANGED
@@ -5,12 +5,15 @@ describe Kitabu::Stats do
|
|
5
5
|
let(:parser) { double("parser").as_null_object }
|
6
6
|
let(:content) { "" }
|
7
7
|
subject(:stats) { Kitabu::Stats.new(root_dir) }
|
8
|
-
|
8
|
+
|
9
|
+
before {
|
10
|
+
allow(stats).to receive_message_chain(:content).and_return(content)
|
11
|
+
}
|
9
12
|
|
10
13
|
context "getting content" do
|
11
14
|
it "parses content" do
|
12
|
-
Kitabu::Parser::HTML
|
13
|
-
.
|
15
|
+
expect(Kitabu::Parser::HTML)
|
16
|
+
.to receive(:new)
|
14
17
|
.with(root_dir)
|
15
18
|
.and_return(parser)
|
16
19
|
|
@@ -18,8 +21,8 @@ describe Kitabu::Stats do
|
|
18
21
|
end
|
19
22
|
|
20
23
|
it "returns parser content" do
|
21
|
-
Kitabu::Parser::HTML.
|
22
|
-
parser.
|
24
|
+
allow(Kitabu::Parser::HTML).to receive_message_chain(:new).and_return(parser)
|
25
|
+
allow(parser).to receive_message_chain(:content).and_return("some content")
|
23
26
|
|
24
27
|
expect(Kitabu::Stats.new(root_dir).content).to eql("some content")
|
25
28
|
end
|
data/spec/kitabu/syntax_spec.rb
CHANGED
@@ -13,94 +13,94 @@ describe Kitabu::Syntax do
|
|
13
13
|
CODE
|
14
14
|
|
15
15
|
before do
|
16
|
-
Kitabu::Dependency.
|
16
|
+
allow(Kitabu::Dependency).to receive_message_chain(:pygments_rb?).and_return(false)
|
17
17
|
end
|
18
18
|
|
19
19
|
let(:root) { SPECDIR.join("support/mybook") }
|
20
20
|
|
21
21
|
it "renders inline code" do
|
22
22
|
content = Kitabu::Syntax.render(root, :markdown, INLINE)
|
23
|
-
content.
|
24
|
-
Nokogiri::HTML(content).text.
|
23
|
+
expect(content).to have_tag("pre", 1)
|
24
|
+
expect(Nokogiri::HTML(content).text).to match(/class Sample/)
|
25
25
|
end
|
26
26
|
|
27
27
|
it "renders line range" do
|
28
28
|
content = Kitabu::Syntax.render(root, :markdown, "@@@ ruby code.rb:3,5 @@@")
|
29
|
-
content.
|
29
|
+
expect(content).to have_tag("pre", 1)
|
30
30
|
html = Nokogiri::HTML(content)
|
31
|
-
html.text.
|
32
|
-
html.text.
|
31
|
+
expect(html.text).not_to match(/class HelloWorld/)
|
32
|
+
expect(html.text).to match(/def self\.say/)
|
33
33
|
end
|
34
34
|
|
35
35
|
it "renders first block by its name" do
|
36
36
|
content = Kitabu::Syntax.render(root, :markdown, "@@@ ruby code.rb#method @@@")
|
37
|
-
content.
|
37
|
+
expect(content).to have_tag("pre", 1)
|
38
38
|
html = Nokogiri::HTML(content)
|
39
|
-
html.text.
|
40
|
-
html.text.
|
41
|
-
html.text.
|
39
|
+
expect(html.text).not_to match(/class HelloWorld/)
|
40
|
+
expect(html.text).not_to match(/def self\.shout/)
|
41
|
+
expect(html.text).to match(/def self\.say/)
|
42
42
|
end
|
43
43
|
|
44
44
|
it "renders second block by its name" do
|
45
45
|
content = Kitabu::Syntax.render(root, :markdown, "@@@ ruby code.rb#another_method @@@")
|
46
|
-
content.
|
46
|
+
expect(content).to have_tag("pre", 1)
|
47
47
|
html = Nokogiri::HTML(content)
|
48
|
-
html.text.
|
49
|
-
html.text.
|
50
|
-
html.text.
|
48
|
+
expect(html.text).not_to match(/class HelloWorld/)
|
49
|
+
expect(html.text).not_to match(/def self\.say/)
|
50
|
+
expect(html.text).to match(/def self\.shout/)
|
51
51
|
end
|
52
52
|
|
53
53
|
it "renders missing block message" do
|
54
54
|
content = Kitabu::Syntax.render(root, :markdown, "@@@ ruby code.rb#invalid @@@")
|
55
|
-
content.
|
55
|
+
expect(content).to have_tag("pre", 1)
|
56
56
|
html = Nokogiri::HTML(content)
|
57
|
-
html.text.
|
58
|
-
html.text.
|
59
|
-
html.text.
|
60
|
-
html.text.
|
57
|
+
expect(html.text).not_to match(/class HelloWorld/)
|
58
|
+
expect(html.text).not_to match(/def self\.say/)
|
59
|
+
expect(html.text).not_to match(/def self\.shout/)
|
60
|
+
expect(html.text).to match(/\[missing 'invalid' block name\]/)
|
61
61
|
end
|
62
62
|
|
63
63
|
it "renders missing file message" do
|
64
64
|
content = Kitabu::Syntax.render(root, :markdown, "@@@ ruby invalid.rb @@@")
|
65
|
-
content.
|
65
|
+
expect(content).to have_tag("pre", 1)
|
66
66
|
html = Nokogiri::HTML(content)
|
67
|
-
html.text.
|
68
|
-
html.text.
|
69
|
-
html.text.
|
70
|
-
html.text.
|
67
|
+
expect(html.text).not_to match(/class HelloWorld/)
|
68
|
+
expect(html.text).not_to match(/def self\.say/)
|
69
|
+
expect(html.text).not_to match(/def self\.shout/)
|
70
|
+
expect(html.text).to match(/\[missing 'code\/invalid.rb' file\]/)
|
71
71
|
end
|
72
72
|
|
73
73
|
it "renders file" do
|
74
74
|
content = Kitabu::Syntax.render(root, :markdown, "@@@ ruby code.rb @@@")
|
75
75
|
html = Nokogiri::HTML(content)
|
76
|
-
html.text.
|
77
|
-
html.text.
|
76
|
+
expect(html.text).to match(/class HelloWorld/)
|
77
|
+
expect(html.text).to match(/def self\.say/)
|
78
78
|
end
|
79
79
|
|
80
80
|
it "adds CodeRay class" do
|
81
|
-
Kitabu::Syntax.render(root, :markdown, "@@@ ruby code.rb @@@").
|
81
|
+
expect(Kitabu::Syntax.render(root, :markdown, "@@@ ruby code.rb @@@")).to have_tag("div.CodeRay", 1)
|
82
82
|
end
|
83
83
|
|
84
84
|
it "adds language class" do
|
85
|
-
Kitabu::Syntax.render(root, :markdown, "@@@ ruby code.rb @@@").
|
85
|
+
expect(Kitabu::Syntax.render(root, :markdown, "@@@ ruby code.rb @@@")).to have_tag("div.CodeRay.ruby", 1)
|
86
86
|
end
|
87
87
|
|
88
88
|
it "wraps code in pre tag" do
|
89
|
-
Kitabu::Syntax.render(root, :markdown, "@@@ ruby code.rb @@@").
|
89
|
+
expect(Kitabu::Syntax.render(root, :markdown, "@@@ ruby code.rb @@@")).to have_tag("pre", 1)
|
90
90
|
end
|
91
91
|
|
92
92
|
it "wraps source in code tag" do
|
93
|
-
Kitabu::Syntax.render(root, :markdown, "@@@ ruby code.rb @@@").
|
93
|
+
expect(Kitabu::Syntax.render(root, :markdown, "@@@ ruby code.rb @@@")).to have_tag("pre > code", 1)
|
94
94
|
end
|
95
95
|
|
96
96
|
it "wraps code in notextile tag" do
|
97
|
-
Kitabu::Syntax.render(root, :textile, "@@@ ruby code.rb @@@").
|
97
|
+
expect(Kitabu::Syntax.render(root, :textile, "@@@ ruby code.rb @@@")).to have_tag("notextile", 1)
|
98
98
|
end
|
99
99
|
|
100
100
|
it "removes block annotations" do
|
101
101
|
content = Kitabu::Syntax.render(root, :markdown, "@@@ ruby code.rb @@@")
|
102
102
|
html = Nokogiri::HTML(content)
|
103
|
-
html.text.
|
104
|
-
html.text.
|
103
|
+
expect(html.text).not_to match(/@begin/)
|
104
|
+
expect(html.text).not_to match(/@end/)
|
105
105
|
end
|
106
106
|
end
|
@@ -22,34 +22,34 @@ describe Kitabu::TOC::HTML do
|
|
22
22
|
let(:content) { toc.content }
|
23
23
|
|
24
24
|
it "has no body tag" do
|
25
|
-
content.
|
25
|
+
expect(content).not_to match(/<body>/)
|
26
26
|
end
|
27
27
|
|
28
28
|
it "generates toc" do
|
29
|
-
html.
|
30
|
-
html.
|
31
|
-
html.
|
32
|
-
html.
|
33
|
-
html.
|
34
|
-
html.
|
29
|
+
expect(html).to have_tag("div.level1.item-1", "Item 1")
|
30
|
+
expect(html).to have_tag("div.level2.item-1-2", "Item 1.2")
|
31
|
+
expect(html).to have_tag("div.level3.item-1-1-3", "Item 1.1.3")
|
32
|
+
expect(html).to have_tag("div.level4.item-1-1-1-4", "Item 1.1.1.4")
|
33
|
+
expect(html).to have_tag("div.level5.item-1-1-1-1-5", "Item 1.1.1.1.5")
|
34
|
+
expect(html).to have_tag("div.level6.item-1-1-1-1-1-6", "Item 1.1.1.1.1.6")
|
35
35
|
|
36
|
-
html.
|
37
|
-
html.
|
36
|
+
expect(html).to have_tag("div.level2.item-2-1", "Item 2.1")
|
37
|
+
expect(html).to have_tag("div.level2.item-2-1-again", "Item 2.1 again")
|
38
38
|
|
39
|
-
html.
|
39
|
+
expect(html).to have_tag("div.level2.internacionalizacao", "Internacionalização")
|
40
40
|
end
|
41
41
|
|
42
42
|
it "adds id attribute to content" do
|
43
|
-
content.
|
44
|
-
content.
|
45
|
-
content.
|
46
|
-
content.
|
47
|
-
content.
|
48
|
-
content.
|
43
|
+
expect(content).to have_tag("h1#item-1", "Item 1")
|
44
|
+
expect(content).to have_tag("h2#item-1-2", "Item 1.2")
|
45
|
+
expect(content).to have_tag("h3#item-1-1-3", "Item 1.1.3")
|
46
|
+
expect(content).to have_tag("h4#item-1-1-1-4", "Item 1.1.1.4")
|
47
|
+
expect(content).to have_tag("h5#item-1-1-1-1-5", "Item 1.1.1.1.5")
|
48
|
+
expect(content).to have_tag("h6#item-1-1-1-1-1-6", "Item 1.1.1.1.1.6")
|
49
49
|
|
50
|
-
content.
|
51
|
-
content.
|
50
|
+
expect(content).to have_tag("h2#item-2-1", "Item 2.1")
|
51
|
+
expect(content).to have_tag("h2#item-2-1-again", "Item 2.1 again")
|
52
52
|
|
53
|
-
content.
|
53
|
+
expect(content).to have_tag("h2#internacionalizacao", "Internacionalização")
|
54
54
|
end
|
55
55
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,12 +1,18 @@
|
|
1
1
|
require "kitabu"
|
2
2
|
require "pathname"
|
3
|
-
require "test_notifier/runner/rspec"
|
4
3
|
|
5
4
|
SPECDIR = Pathname.new(File.dirname(__FILE__))
|
6
5
|
TMPDIR = SPECDIR.join("tmp")
|
7
6
|
|
8
7
|
Dir[File.dirname(__FILE__) + "/support/**/*.rb"].each {|r| require r}
|
9
8
|
|
9
|
+
# Disable the bundle install command.
|
10
|
+
# TODO: Figure out the best way of doing it so.
|
11
|
+
class Kitabu::Generator < Thor::Group
|
12
|
+
def bundle_install
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
10
16
|
RSpec.configure do |config|
|
11
17
|
config.include(SpecHelper)
|
12
18
|
config.include(Matchers)
|
@@ -11,12 +11,12 @@ RSpec::Matchers.define :exit_with_code do |code|
|
|
11
11
|
actual && actual == code
|
12
12
|
end
|
13
13
|
|
14
|
-
|
14
|
+
failure_message do |block|
|
15
15
|
"expected block to call exit(#{code}) but exit" +
|
16
16
|
(actual ? "(#{actual}) was called" : " not called")
|
17
17
|
end
|
18
18
|
|
19
|
-
|
19
|
+
failure_message_when_negated do |block|
|
20
20
|
"expected block not to call exit(#{code})"
|
21
21
|
end
|
22
22
|
|
data/spec/support/have_tag.rb
CHANGED
@@ -62,7 +62,7 @@ module Matchers
|
|
62
62
|
"expected\n#{doc.to_s}\nto have #{failure_count_phrase} #{failure_selector_phrase}, #{explanation}"
|
63
63
|
end
|
64
64
|
|
65
|
-
def
|
65
|
+
def failure_message_when_negated
|
66
66
|
explanation = actual_count ? "but found #{actual_count}" : "but did"
|
67
67
|
"expected\n#{doc.to_s}\nnot to have #{failure_count_phrase} #{failure_selector_phrase}, #{explanation}"
|
68
68
|
end
|
data/spec/support/shared.rb
CHANGED
@@ -2,52 +2,56 @@ shared_examples_for "e-book" do
|
|
2
2
|
let(:mybook) { tmpdir.join("mybook") }
|
3
3
|
|
4
4
|
it "generates e-book" do
|
5
|
-
mybook.
|
5
|
+
expect(mybook).to be_directory
|
6
6
|
end
|
7
7
|
|
8
8
|
it "creates images directory" do
|
9
|
-
mybook.join("images").
|
9
|
+
expect(mybook.join("images")).to be_directory
|
10
10
|
end
|
11
11
|
|
12
12
|
it "creates text directory" do
|
13
|
-
mybook.join("text").
|
13
|
+
expect(mybook.join("text")).to be_directory
|
14
14
|
end
|
15
15
|
|
16
16
|
it "creates code directory" do
|
17
|
-
mybook.join("code").
|
17
|
+
expect(mybook.join("code")).to be_directory
|
18
18
|
end
|
19
19
|
|
20
20
|
it "creates template directory" do
|
21
|
-
mybook.join("templates").
|
21
|
+
expect(mybook.join("templates")).to be_directory
|
22
22
|
end
|
23
23
|
|
24
24
|
it "creates configuration file" do
|
25
|
-
mybook.join("config/kitabu.yml").
|
25
|
+
expect(mybook.join("config/kitabu.yml")).to be_file
|
26
26
|
end
|
27
27
|
|
28
28
|
it "creates helper file" do
|
29
|
-
mybook.join("config/helper.rb").
|
29
|
+
expect(mybook.join("config/helper.rb")).to be_file
|
30
30
|
end
|
31
31
|
|
32
32
|
it "copies sample page" do
|
33
|
-
mybook.join("text/01_Welcome.md")
|
33
|
+
expect(mybook.join("text/01_Welcome.md")).to be_file
|
34
34
|
end
|
35
35
|
|
36
36
|
it "copies Guardfile" do
|
37
|
-
mybook.join("Guardfile")
|
37
|
+
expect(mybook.join("Guardfile")).to be_file
|
38
|
+
end
|
39
|
+
|
40
|
+
it "copies Gemfile" do
|
41
|
+
expect(mybook.join("Gemfile")).to be_file
|
38
42
|
end
|
39
43
|
|
40
44
|
it "copies html template files" do
|
41
|
-
mybook.join("templates/html/user.css").
|
42
|
-
mybook.join("templates/html/layout.css").
|
43
|
-
mybook.join("templates/html/layout.erb").
|
44
|
-
mybook.join("templates/html/syntax.css").
|
45
|
+
expect(mybook.join("templates/html/user.css")).to be_file
|
46
|
+
expect(mybook.join("templates/html/layout.css")).to be_file
|
47
|
+
expect(mybook.join("templates/html/layout.erb")).to be_file
|
48
|
+
expect(mybook.join("templates/html/syntax.css")).to be_file
|
45
49
|
end
|
46
50
|
|
47
51
|
it "copies epub template files" do
|
48
|
-
mybook.join("templates/epub/user.css").
|
49
|
-
mybook.join("templates/epub/cover.erb").
|
50
|
-
mybook.join("templates/epub/cover.png").
|
51
|
-
mybook.join("templates/epub/page.erb").
|
52
|
+
expect(mybook.join("templates/epub/user.css")).to be_file
|
53
|
+
expect(mybook.join("templates/epub/cover.erb")).to be_file
|
54
|
+
expect(mybook.join("templates/epub/cover.png")).to be_file
|
55
|
+
expect(mybook.join("templates/epub/page.erb")).to be_file
|
52
56
|
end
|
53
|
-
end
|
57
|
+
end
|
data/templates/Gemfile
ADDED
metadata
CHANGED
@@ -1,237 +1,209 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kitabu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nando Vieira
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: nokogiri
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: RedCloth
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rdiscount
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: i18n
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: thor
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '0'
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: eeepub-with-cover-support
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- -
|
101
|
+
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: '0'
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- -
|
108
|
+
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: coderay
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- -
|
115
|
+
- - ">="
|
116
116
|
- !ruby/object:Gem::Version
|
117
117
|
version: '0'
|
118
118
|
type: :runtime
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- -
|
122
|
+
- - ">="
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: notifier
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
|
-
- -
|
129
|
+
- - ">="
|
130
130
|
- !ruby/object:Gem::Version
|
131
131
|
version: '0'
|
132
132
|
type: :runtime
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
|
-
- -
|
136
|
+
- - ">="
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: rubyzip
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
|
-
- -
|
144
|
-
- !ruby/object:Gem::Version
|
145
|
-
version: 1.0.0
|
146
|
-
type: :runtime
|
147
|
-
prerelease: false
|
148
|
-
version_requirements: !ruby/object:Gem::Requirement
|
149
|
-
requirements:
|
150
|
-
- - <
|
151
|
-
- !ruby/object:Gem::Version
|
152
|
-
version: 1.0.0
|
153
|
-
- !ruby/object:Gem::Dependency
|
154
|
-
name: rspec
|
155
|
-
requirement: !ruby/object:Gem::Requirement
|
156
|
-
requirements:
|
157
|
-
- - '>='
|
143
|
+
- - ">="
|
158
144
|
- !ruby/object:Gem::Version
|
159
145
|
version: '0'
|
160
|
-
type: :
|
161
|
-
prerelease: false
|
162
|
-
version_requirements: !ruby/object:Gem::Requirement
|
163
|
-
requirements:
|
164
|
-
- - '>='
|
165
|
-
- !ruby/object:Gem::Version
|
166
|
-
version: '0'
|
167
|
-
- !ruby/object:Gem::Dependency
|
168
|
-
name: test_notifier
|
169
|
-
requirement: !ruby/object:Gem::Requirement
|
170
|
-
requirements:
|
171
|
-
- - '>='
|
172
|
-
- !ruby/object:Gem::Version
|
173
|
-
version: '0'
|
174
|
-
type: :development
|
146
|
+
type: :runtime
|
175
147
|
prerelease: false
|
176
148
|
version_requirements: !ruby/object:Gem::Requirement
|
177
149
|
requirements:
|
178
|
-
- -
|
150
|
+
- - ">="
|
179
151
|
- !ruby/object:Gem::Version
|
180
152
|
version: '0'
|
181
153
|
- !ruby/object:Gem::Dependency
|
182
|
-
name:
|
154
|
+
name: zip-zip
|
183
155
|
requirement: !ruby/object:Gem::Requirement
|
184
156
|
requirements:
|
185
|
-
- -
|
157
|
+
- - ">="
|
186
158
|
- !ruby/object:Gem::Version
|
187
159
|
version: '0'
|
188
|
-
type: :
|
160
|
+
type: :runtime
|
189
161
|
prerelease: false
|
190
162
|
version_requirements: !ruby/object:Gem::Requirement
|
191
163
|
requirements:
|
192
|
-
- -
|
164
|
+
- - ">="
|
193
165
|
- !ruby/object:Gem::Version
|
194
166
|
version: '0'
|
195
167
|
- !ruby/object:Gem::Dependency
|
196
|
-
name:
|
168
|
+
name: rspec
|
197
169
|
requirement: !ruby/object:Gem::Requirement
|
198
170
|
requirements:
|
199
|
-
- -
|
171
|
+
- - ">="
|
200
172
|
- !ruby/object:Gem::Version
|
201
173
|
version: '0'
|
202
174
|
type: :development
|
203
175
|
prerelease: false
|
204
176
|
version_requirements: !ruby/object:Gem::Requirement
|
205
177
|
requirements:
|
206
|
-
- -
|
178
|
+
- - ">="
|
207
179
|
- !ruby/object:Gem::Version
|
208
180
|
version: '0'
|
209
181
|
- !ruby/object:Gem::Dependency
|
210
|
-
name:
|
182
|
+
name: rake
|
211
183
|
requirement: !ruby/object:Gem::Requirement
|
212
184
|
requirements:
|
213
|
-
- -
|
185
|
+
- - ">="
|
214
186
|
- !ruby/object:Gem::Version
|
215
187
|
version: '0'
|
216
188
|
type: :development
|
217
189
|
prerelease: false
|
218
190
|
version_requirements: !ruby/object:Gem::Requirement
|
219
191
|
requirements:
|
220
|
-
- -
|
192
|
+
- - ">="
|
221
193
|
- !ruby/object:Gem::Version
|
222
194
|
version: '0'
|
223
195
|
- !ruby/object:Gem::Dependency
|
224
|
-
name:
|
196
|
+
name: pry-meta
|
225
197
|
requirement: !ruby/object:Gem::Requirement
|
226
198
|
requirements:
|
227
|
-
- -
|
199
|
+
- - ">="
|
228
200
|
- !ruby/object:Gem::Version
|
229
201
|
version: '0'
|
230
202
|
type: :development
|
231
203
|
prerelease: false
|
232
204
|
version_requirements: !ruby/object:Gem::Requirement
|
233
205
|
requirements:
|
234
|
-
- -
|
206
|
+
- - ">="
|
235
207
|
- !ruby/object:Gem::Version
|
236
208
|
version: '0'
|
237
209
|
description: A framework that generates PDF and e-Pub from Markdown, Textile, and
|
@@ -243,9 +215,9 @@ executables:
|
|
243
215
|
extensions: []
|
244
216
|
extra_rdoc_files: []
|
245
217
|
files:
|
246
|
-
- .gitignore
|
247
|
-
- .gitmodules
|
248
|
-
- .rspec
|
218
|
+
- ".gitignore"
|
219
|
+
- ".gitmodules"
|
220
|
+
- ".rspec"
|
249
221
|
- Gemfile
|
250
222
|
- Gemfile.lock
|
251
223
|
- README.rdoc
|
@@ -316,7 +288,6 @@ files:
|
|
316
288
|
- spec/kitabu/stats_spec.rb
|
317
289
|
- spec/kitabu/syntax_spec.rb
|
318
290
|
- spec/kitabu/toc/html_spec.rb
|
319
|
-
- spec/kitabu_spec.rb
|
320
291
|
- spec/spec_helper.rb
|
321
292
|
- spec/support/exit_with_code.rb
|
322
293
|
- spec/support/have_tag.rb
|
@@ -345,6 +316,7 @@ files:
|
|
345
316
|
- spec/support/mybook/text/TOC.textile
|
346
317
|
- spec/support/mybook/text/_00_Introduction.markdown
|
347
318
|
- spec/support/shared.rb
|
319
|
+
- templates/Gemfile
|
348
320
|
- templates/Guardfile
|
349
321
|
- templates/config.erb
|
350
322
|
- templates/cover.erb
|
@@ -368,19 +340,61 @@ require_paths:
|
|
368
340
|
- lib
|
369
341
|
required_ruby_version: !ruby/object:Gem::Requirement
|
370
342
|
requirements:
|
371
|
-
- -
|
343
|
+
- - ">="
|
372
344
|
- !ruby/object:Gem::Version
|
373
345
|
version: '1.9'
|
374
346
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
375
347
|
requirements:
|
376
|
-
- -
|
348
|
+
- - ">="
|
377
349
|
- !ruby/object:Gem::Version
|
378
350
|
version: '0'
|
379
351
|
requirements: []
|
380
352
|
rubyforge_project:
|
381
|
-
rubygems_version: 2.
|
353
|
+
rubygems_version: 2.2.2
|
382
354
|
signing_key:
|
383
355
|
specification_version: 4
|
384
356
|
summary: A framework that generates PDF and e-Pub from Markdown, Textile, and HTML
|
385
357
|
files.
|
386
|
-
test_files:
|
358
|
+
test_files:
|
359
|
+
- spec/kitabu/cli/export_spec.rb
|
360
|
+
- spec/kitabu/cli/new_spec.rb
|
361
|
+
- spec/kitabu/cli/permalinks_spec.rb
|
362
|
+
- spec/kitabu/cli/stats_spec.rb
|
363
|
+
- spec/kitabu/cli/version_spec.rb
|
364
|
+
- spec/kitabu/extensions/redcloth_spec.rb
|
365
|
+
- spec/kitabu/extensions/string_spec.rb
|
366
|
+
- spec/kitabu/generator_spec.rb
|
367
|
+
- spec/kitabu/parser/epub_spec.rb
|
368
|
+
- spec/kitabu/parser/html_spec.rb
|
369
|
+
- spec/kitabu/parser/pdf_spec.rb
|
370
|
+
- spec/kitabu/stats_spec.rb
|
371
|
+
- spec/kitabu/syntax_spec.rb
|
372
|
+
- spec/kitabu/toc/html_spec.rb
|
373
|
+
- spec/spec_helper.rb
|
374
|
+
- spec/support/exit_with_code.rb
|
375
|
+
- spec/support/have_tag.rb
|
376
|
+
- spec/support/helper.rb
|
377
|
+
- spec/support/mybook/.gitignore
|
378
|
+
- spec/support/mybook/code/.gitkeep
|
379
|
+
- spec/support/mybook/code/code.rb
|
380
|
+
- spec/support/mybook/config/helper.rb
|
381
|
+
- spec/support/mybook/config/kitabu.yml
|
382
|
+
- spec/support/mybook/images/.gitkeep
|
383
|
+
- spec/support/mybook/images/logo.gif
|
384
|
+
- spec/support/mybook/output/.gitkeep
|
385
|
+
- spec/support/mybook/templates/epub/cover.erb
|
386
|
+
- spec/support/mybook/templates/epub/page.erb
|
387
|
+
- spec/support/mybook/templates/epub/style.css
|
388
|
+
- spec/support/mybook/templates/html/layout.css
|
389
|
+
- spec/support/mybook/templates/html/layout.erb
|
390
|
+
- spec/support/mybook/templates/html/syntax.css
|
391
|
+
- spec/support/mybook/templates/html/user.css
|
392
|
+
- spec/support/mybook/text/.gitkeep
|
393
|
+
- spec/support/mybook/text/01_Markdown_Chapter.markdown
|
394
|
+
- spec/support/mybook/text/02_Textile_Chapter.textile
|
395
|
+
- spec/support/mybook/text/03_HTML_Chapter.html
|
396
|
+
- spec/support/mybook/text/04_With_Directory/Some_Chapter.mkdn
|
397
|
+
- spec/support/mybook/text/CHANGELOG.textile
|
398
|
+
- spec/support/mybook/text/TOC.textile
|
399
|
+
- spec/support/mybook/text/_00_Introduction.markdown
|
400
|
+
- spec/support/shared.rb
|
data/spec/kitabu_spec.rb
DELETED