jekyll-toc 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -2
- data/.travis.yml +10 -1
- data/Appraisals +8 -0
- data/gemfiles/jekyll_3.2.gemfile +7 -0
- data/gemfiles/jekyll_3.3.gemfile +7 -0
- data/jekyll-toc.gemspec +4 -2
- data/lib/version.rb +1 -1
- data/test/test_helper.rb +3 -3
- data/test/test_inject_anchors_filter.rb +2 -3
- data/test/test_toc_filter.rb +2 -2
- data/test/test_toc_only_filter.rb +2 -3
- metadata +12 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bbddbd6bb394ec1243767ad0b733114aa23b5578
|
4
|
+
data.tar.gz: 05a92654374c3bfa4007c899f1da2b9c5e4d4564
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa6f2079888e3ffca856dcf8f10f294a87094b2f871b5625aef907be9f112cba64c8cf9e4c089882c36a67c0a8b3ce6968ae037dbf4e9e275f4463bc4b625604
|
7
|
+
data.tar.gz: 8dee11cb55c9459a5dc4c7ea3a2c7cfd09cff538196967ab0266d89b01b3c341b2e77e4c116b7492de2438b490088fe3244ee43395a64c6751f397b6639e5987
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -1,12 +1,21 @@
|
|
1
1
|
language: ruby
|
2
|
+
cache: bundler
|
2
3
|
rvm:
|
3
|
-
- 2.0
|
4
4
|
- 2.1
|
5
5
|
- 2.2
|
6
|
+
- 2.3.1
|
7
|
+
- 2.4.0
|
8
|
+
# Put this in your .travis.yml
|
6
9
|
gemfile:
|
10
|
+
- gemfiles/jekyll_3.3.gemfile
|
11
|
+
- gemfiles/jekyll_3.2.gemfile
|
7
12
|
- gemfiles/jekyll_3.1.gemfile
|
8
13
|
- gemfiles/jekyll_3.gemfile
|
9
14
|
- gemfiles/jekyll_2.gemfile
|
15
|
+
matrix:
|
16
|
+
exclude:
|
17
|
+
- rvm: 2.4.0
|
18
|
+
gemfile: gemfiles/jekyll_2.gemfile
|
10
19
|
addons:
|
11
20
|
code_climate:
|
12
21
|
repo_token: 6b81e393ea6ad38560386f650ea2fb0e57a7beb5e20f8c8364fabee30d5bff07
|
data/Appraisals
CHANGED
data/jekyll-toc.gemspec
CHANGED
@@ -15,11 +15,13 @@ Gem::Specification.new do |spec|
|
|
15
15
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
16
16
|
spec.require_paths = ["lib"]
|
17
17
|
|
18
|
+
spec.required_ruby_version = ">= 2.1.0"
|
19
|
+
|
18
20
|
spec.add_runtime_dependency "nokogiri", "~> 1.6"
|
19
21
|
|
20
22
|
spec.add_development_dependency 'minitest', "~> 5.0"
|
21
23
|
spec.add_development_dependency "appraisal"
|
22
|
-
spec.add_development_dependency "codeclimate-test-reporter"
|
23
|
-
spec.add_development_dependency "jekyll", "
|
24
|
+
spec.add_development_dependency "codeclimate-test-reporter", "~> 1.0"
|
25
|
+
spec.add_development_dependency "jekyll", ">= 2.0"
|
24
26
|
spec.add_development_dependency "rake"
|
25
27
|
end
|
data/lib/version.rb
CHANGED
data/test/test_helper.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
require
|
2
|
-
|
1
|
+
require 'simplecov'
|
2
|
+
SimpleCov.start
|
3
3
|
|
4
4
|
require 'jekyll'
|
5
5
|
require 'minitest/autorun'
|
@@ -16,6 +16,6 @@ EOL
|
|
16
16
|
module TestHelpers
|
17
17
|
def read_html_and_create_parser
|
18
18
|
@parser = Jekyll::TableOfContents::Parser.new(SIMPLE_HTML)
|
19
|
-
assert_match
|
19
|
+
assert_match(/Simple H1/, @parser.doc.inner_html)
|
20
20
|
end
|
21
21
|
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
require_relative '../lib/jekyll-toc'
|
3
3
|
|
4
|
-
|
5
4
|
class TestTOCOnlyFilter < Minitest::Test
|
6
5
|
include TestHelpers
|
7
6
|
|
@@ -12,12 +11,12 @@ class TestTOCOnlyFilter < Minitest::Test
|
|
12
11
|
def test_injects_anchors_into_content
|
13
12
|
html = @parser.inject_anchors_into_html
|
14
13
|
|
15
|
-
assert_match
|
14
|
+
assert_match(/<a id="simple\-h1" class="anchor" href="#simple\-h1" aria\-hidden="true"><span.*span><\/a>Simple H1/, html)
|
16
15
|
end
|
17
16
|
|
18
17
|
def test_does_not_inject_toc
|
19
18
|
html = @parser.inject_anchors_into_html
|
20
19
|
|
21
|
-
assert_nil
|
20
|
+
assert_nil(/<ul class="section-nav">/ =~ html)
|
22
21
|
end
|
23
22
|
end
|
data/test/test_toc_filter.rb
CHANGED
@@ -12,12 +12,12 @@ class TestTOCFilter < Minitest::Test
|
|
12
12
|
def test_injects_anchors
|
13
13
|
html = @parser.toc
|
14
14
|
|
15
|
-
assert_match
|
15
|
+
assert_match(/<a id="simple\-h1" class="anchor" href="#simple\-h1" aria\-hidden="true"><span.*span><\/a>Simple H1/, html)
|
16
16
|
end
|
17
17
|
|
18
18
|
def test_injects_toc_container
|
19
19
|
html = @parser.toc
|
20
20
|
|
21
|
-
assert_match
|
21
|
+
assert_match(/<ul class="section-nav">/, html)
|
22
22
|
end
|
23
23
|
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
require_relative '../lib/jekyll-toc'
|
3
3
|
|
4
|
-
|
5
4
|
class TestTOCOnlyFilter < Minitest::Test
|
6
5
|
include TestHelpers
|
7
6
|
|
@@ -12,12 +11,12 @@ class TestTOCOnlyFilter < Minitest::Test
|
|
12
11
|
def test_injects_toc_container
|
13
12
|
html = @parser.build_toc
|
14
13
|
|
15
|
-
assert_match
|
14
|
+
assert_match(/<ul class="section-nav">/, html)
|
16
15
|
end
|
17
16
|
|
18
17
|
def test_does_not_return_content
|
19
18
|
html = @parser.build_toc
|
20
19
|
|
21
|
-
assert_nil
|
20
|
+
assert_nil(/<h1>Simple H1<\/h1>/ =~ html)
|
22
21
|
end
|
23
22
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-toc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Toshimaru
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2017-01-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|
@@ -57,28 +57,28 @@ dependencies:
|
|
57
57
|
name: codeclimate-test-reporter
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
|
-
- - "
|
60
|
+
- - "~>"
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version: '0'
|
62
|
+
version: '1.0'
|
63
63
|
type: :development
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
|
-
- - "
|
67
|
+
- - "~>"
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: '0'
|
69
|
+
version: '1.0'
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: jekyll
|
72
72
|
requirement: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
|
-
- - "
|
74
|
+
- - ">="
|
75
75
|
- !ruby/object:Gem::Version
|
76
76
|
version: '2.0'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
79
|
version_requirements: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
|
-
- - "
|
81
|
+
- - ">="
|
82
82
|
- !ruby/object:Gem::Version
|
83
83
|
version: '2.0'
|
84
84
|
- !ruby/object:Gem::Dependency
|
@@ -111,6 +111,8 @@ files:
|
|
111
111
|
- Rakefile
|
112
112
|
- gemfiles/jekyll_2.gemfile
|
113
113
|
- gemfiles/jekyll_3.1.gemfile
|
114
|
+
- gemfiles/jekyll_3.2.gemfile
|
115
|
+
- gemfiles/jekyll_3.3.gemfile
|
114
116
|
- gemfiles/jekyll_3.gemfile
|
115
117
|
- jekyll-toc.gemspec
|
116
118
|
- lib/jekyll-toc.rb
|
@@ -132,7 +134,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
132
134
|
requirements:
|
133
135
|
- - ">="
|
134
136
|
- !ruby/object:Gem::Version
|
135
|
-
version:
|
137
|
+
version: 2.1.0
|
136
138
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
137
139
|
requirements:
|
138
140
|
- - ">="
|
@@ -140,7 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
140
142
|
version: '0'
|
141
143
|
requirements: []
|
142
144
|
rubyforge_project:
|
143
|
-
rubygems_version: 2.
|
145
|
+
rubygems_version: 2.5.2
|
144
146
|
signing_key:
|
145
147
|
specification_version: 4
|
146
148
|
summary: Jekyll Table of Contents plugin
|