tocer 10.2.0 → 11.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/LICENSE.adoc +1 -1
- data/README.adoc +20 -20
- data/lib/tocer/builder.rb +1 -1
- data/lib/tocer/identity.rb +1 -1
- data/lib/tocer/parsers/header.rb +1 -1
- data/lib/tocer/transformers/finder.rb +10 -2
- metadata +8 -218
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6b4583b216f68071636986d14fe2b040725502fa5300aadff20f2d8bb16a2cf5
|
4
|
+
data.tar.gz: 48b3e8f67be165818bc653e6d028528dc379af6774aa41be093d9d9ddff7776d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4733bf65a9dc96e38f2be2a81459b7063e9421a0e2a7b76ed0ef7314368d985fb53bc3a6aed288b337cdb3ea94997529e2d1bf75a45e57356a0616748ddca8d
|
7
|
+
data.tar.gz: 78d688eaa26d96615b69e357ebe70773b1a4a4bb508328abf04ba45d27ad10a45c6c08b7356a2aeff78c94028a6d3b685bb664c314e297defca1bd2e60f8b165
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/LICENSE.adoc
CHANGED
@@ -150,7 +150,7 @@ additional liability.
|
|
150
150
|
|
151
151
|
END OF TERMS AND CONDITIONS
|
152
152
|
|
153
|
-
Copyright link:https://www.alchemists.io[
|
153
|
+
Copyright 2015 link:https://www.alchemists.io/team/brooke_kuhlmann[Brooke Kuhlmann].
|
154
154
|
|
155
155
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
|
156
156
|
compliance with the License. You may obtain a link:https://www.apache.org/licenses/LICENSE-2.0[copy]
|
data/README.adoc
CHANGED
@@ -6,6 +6,8 @@
|
|
6
6
|
|
7
7
|
[link=http://badge.fury.io/rb/tocer]
|
8
8
|
image::https://badge.fury.io/rb/tocer.svg[Gem Version]
|
9
|
+
[link=https://www.alchemists.io/projects/code_quality]
|
10
|
+
image::https://img.shields.io/badge/code_style-alchemists-brightgreen.svg[Alchemists Style Guide]
|
9
11
|
[link=https://circleci.com/gh/bkuhlmann/tocer]
|
10
12
|
image::https://circleci.com/gh/bkuhlmann/tocer.svg?style=svg[Circle CI Status]
|
11
13
|
|
@@ -32,8 +34,6 @@ toc::[]
|
|
32
34
|
|
33
35
|
== Setup
|
34
36
|
|
35
|
-
=== Production
|
36
|
-
|
37
37
|
To install, run:
|
38
38
|
|
39
39
|
[source,bash]
|
@@ -41,24 +41,6 @@ To install, run:
|
|
41
41
|
gem install tocer
|
42
42
|
----
|
43
43
|
|
44
|
-
=== Development
|
45
|
-
|
46
|
-
To contribute, run:
|
47
|
-
|
48
|
-
[source,bash]
|
49
|
-
----
|
50
|
-
git clone https://github.com/bkuhlmann/tocer.git
|
51
|
-
cd tocer
|
52
|
-
bin/setup
|
53
|
-
----
|
54
|
-
|
55
|
-
You can also use the IRB console for direct access to all objects:
|
56
|
-
|
57
|
-
[source,bash]
|
58
|
-
----
|
59
|
-
bin/console
|
60
|
-
----
|
61
|
-
|
62
44
|
== Usage
|
63
45
|
|
64
46
|
=== Command Line Interface (CLI)
|
@@ -172,6 +154,24 @@ rake toc[label,includes] # Add/Update Table of Contents (README)
|
|
172
154
|
rake toc["## Example, *.md"]
|
173
155
|
----
|
174
156
|
|
157
|
+
== Development
|
158
|
+
|
159
|
+
To contribute, run:
|
160
|
+
|
161
|
+
[source,bash]
|
162
|
+
----
|
163
|
+
git clone https://github.com/bkuhlmann/tocer.git
|
164
|
+
cd tocer
|
165
|
+
bin/setup
|
166
|
+
----
|
167
|
+
|
168
|
+
You can also use the IRB console for direct access to all objects:
|
169
|
+
|
170
|
+
[source,bash]
|
171
|
+
----
|
172
|
+
bin/console
|
173
|
+
----
|
174
|
+
|
175
175
|
== Tests
|
176
176
|
|
177
177
|
To test, run:
|
data/lib/tocer/builder.rb
CHANGED
@@ -52,7 +52,7 @@ module Tocer
|
|
52
52
|
end
|
53
53
|
|
54
54
|
def transform markdown
|
55
|
-
Transformers::Finder.call(markdown).then do |transformer|
|
55
|
+
Transformers::Finder.new.call(markdown).then do |transformer|
|
56
56
|
url = transformer.url
|
57
57
|
link = transformer.call url_suffix: url_suffix(url)
|
58
58
|
url_count[url] += 1
|
data/lib/tocer/identity.rb
CHANGED
data/lib/tocer/parsers/header.rb
CHANGED
@@ -9,10 +9,18 @@ module Tocer
|
|
9
9
|
/.*/ => Transformers::Text
|
10
10
|
}.freeze
|
11
11
|
|
12
|
-
def
|
13
|
-
|
12
|
+
def initialize transformers: TRANSFORMERS
|
13
|
+
@transformers = transformers
|
14
|
+
end
|
15
|
+
|
16
|
+
def call markdown
|
17
|
+
transformers.find { |pattern, transformer| break transformer if pattern.match? markdown }
|
14
18
|
.then { |transformer| transformer.new markdown }
|
15
19
|
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
attr_reader :transformers
|
16
24
|
end
|
17
25
|
end
|
18
26
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tocer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 11.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brooke Kuhlmann
|
@@ -28,7 +28,7 @@ cert_chain:
|
|
28
28
|
2XV8FRa7/JimI07sPLC13eLY3xd/aYTi85Z782KIA4j0G8XEEWAX0ouBhlXPocZv
|
29
29
|
QWc=
|
30
30
|
-----END CERTIFICATE-----
|
31
|
-
date: 2020-
|
31
|
+
date: 2020-12-29 00:00:00.000000000 Z
|
32
32
|
dependencies:
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: refinements
|
@@ -36,28 +36,28 @@ dependencies:
|
|
36
36
|
requirements:
|
37
37
|
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: '
|
39
|
+
version: '8.0'
|
40
40
|
type: :runtime
|
41
41
|
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
44
|
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: '
|
46
|
+
version: '8.0'
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: runcom
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
51
|
- - "~>"
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: '
|
53
|
+
version: '7.0'
|
54
54
|
type: :runtime
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
58
|
- - "~>"
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: '
|
60
|
+
version: '7.0'
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: thor
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,216 +72,6 @@ dependencies:
|
|
72
72
|
- - "~>"
|
73
73
|
- !ruby/object:Gem::Version
|
74
74
|
version: '0.20'
|
75
|
-
- !ruby/object:Gem::Dependency
|
76
|
-
name: bundler-audit
|
77
|
-
requirement: !ruby/object:Gem::Requirement
|
78
|
-
requirements:
|
79
|
-
- - "~>"
|
80
|
-
- !ruby/object:Gem::Version
|
81
|
-
version: '0.6'
|
82
|
-
type: :development
|
83
|
-
prerelease: false
|
84
|
-
version_requirements: !ruby/object:Gem::Requirement
|
85
|
-
requirements:
|
86
|
-
- - "~>"
|
87
|
-
- !ruby/object:Gem::Version
|
88
|
-
version: '0.6'
|
89
|
-
- !ruby/object:Gem::Dependency
|
90
|
-
name: climate_control
|
91
|
-
requirement: !ruby/object:Gem::Requirement
|
92
|
-
requirements:
|
93
|
-
- - "~>"
|
94
|
-
- !ruby/object:Gem::Version
|
95
|
-
version: '0.1'
|
96
|
-
type: :development
|
97
|
-
prerelease: false
|
98
|
-
version_requirements: !ruby/object:Gem::Requirement
|
99
|
-
requirements:
|
100
|
-
- - "~>"
|
101
|
-
- !ruby/object:Gem::Version
|
102
|
-
version: '0.1'
|
103
|
-
- !ruby/object:Gem::Dependency
|
104
|
-
name: gemsmith
|
105
|
-
requirement: !ruby/object:Gem::Requirement
|
106
|
-
requirements:
|
107
|
-
- - "~>"
|
108
|
-
- !ruby/object:Gem::Version
|
109
|
-
version: '14.2'
|
110
|
-
type: :development
|
111
|
-
prerelease: false
|
112
|
-
version_requirements: !ruby/object:Gem::Requirement
|
113
|
-
requirements:
|
114
|
-
- - "~>"
|
115
|
-
- !ruby/object:Gem::Version
|
116
|
-
version: '14.2'
|
117
|
-
- !ruby/object:Gem::Dependency
|
118
|
-
name: git-lint
|
119
|
-
requirement: !ruby/object:Gem::Requirement
|
120
|
-
requirements:
|
121
|
-
- - "~>"
|
122
|
-
- !ruby/object:Gem::Version
|
123
|
-
version: '1.0'
|
124
|
-
type: :development
|
125
|
-
prerelease: false
|
126
|
-
version_requirements: !ruby/object:Gem::Requirement
|
127
|
-
requirements:
|
128
|
-
- - "~>"
|
129
|
-
- !ruby/object:Gem::Version
|
130
|
-
version: '1.0'
|
131
|
-
- !ruby/object:Gem::Dependency
|
132
|
-
name: guard-rspec
|
133
|
-
requirement: !ruby/object:Gem::Requirement
|
134
|
-
requirements:
|
135
|
-
- - "~>"
|
136
|
-
- !ruby/object:Gem::Version
|
137
|
-
version: '4.7'
|
138
|
-
type: :development
|
139
|
-
prerelease: false
|
140
|
-
version_requirements: !ruby/object:Gem::Requirement
|
141
|
-
requirements:
|
142
|
-
- - "~>"
|
143
|
-
- !ruby/object:Gem::Version
|
144
|
-
version: '4.7'
|
145
|
-
- !ruby/object:Gem::Dependency
|
146
|
-
name: pry
|
147
|
-
requirement: !ruby/object:Gem::Requirement
|
148
|
-
requirements:
|
149
|
-
- - "~>"
|
150
|
-
- !ruby/object:Gem::Version
|
151
|
-
version: '0.13'
|
152
|
-
type: :development
|
153
|
-
prerelease: false
|
154
|
-
version_requirements: !ruby/object:Gem::Requirement
|
155
|
-
requirements:
|
156
|
-
- - "~>"
|
157
|
-
- !ruby/object:Gem::Version
|
158
|
-
version: '0.13'
|
159
|
-
- !ruby/object:Gem::Dependency
|
160
|
-
name: pry-byebug
|
161
|
-
requirement: !ruby/object:Gem::Requirement
|
162
|
-
requirements:
|
163
|
-
- - "~>"
|
164
|
-
- !ruby/object:Gem::Version
|
165
|
-
version: '3.9'
|
166
|
-
type: :development
|
167
|
-
prerelease: false
|
168
|
-
version_requirements: !ruby/object:Gem::Requirement
|
169
|
-
requirements:
|
170
|
-
- - "~>"
|
171
|
-
- !ruby/object:Gem::Version
|
172
|
-
version: '3.9'
|
173
|
-
- !ruby/object:Gem::Dependency
|
174
|
-
name: rake
|
175
|
-
requirement: !ruby/object:Gem::Requirement
|
176
|
-
requirements:
|
177
|
-
- - "~>"
|
178
|
-
- !ruby/object:Gem::Version
|
179
|
-
version: '13.0'
|
180
|
-
type: :development
|
181
|
-
prerelease: false
|
182
|
-
version_requirements: !ruby/object:Gem::Requirement
|
183
|
-
requirements:
|
184
|
-
- - "~>"
|
185
|
-
- !ruby/object:Gem::Version
|
186
|
-
version: '13.0'
|
187
|
-
- !ruby/object:Gem::Dependency
|
188
|
-
name: reek
|
189
|
-
requirement: !ruby/object:Gem::Requirement
|
190
|
-
requirements:
|
191
|
-
- - "~>"
|
192
|
-
- !ruby/object:Gem::Version
|
193
|
-
version: '6.0'
|
194
|
-
type: :development
|
195
|
-
prerelease: false
|
196
|
-
version_requirements: !ruby/object:Gem::Requirement
|
197
|
-
requirements:
|
198
|
-
- - "~>"
|
199
|
-
- !ruby/object:Gem::Version
|
200
|
-
version: '6.0'
|
201
|
-
- !ruby/object:Gem::Dependency
|
202
|
-
name: rspec
|
203
|
-
requirement: !ruby/object:Gem::Requirement
|
204
|
-
requirements:
|
205
|
-
- - "~>"
|
206
|
-
- !ruby/object:Gem::Version
|
207
|
-
version: '3.9'
|
208
|
-
type: :development
|
209
|
-
prerelease: false
|
210
|
-
version_requirements: !ruby/object:Gem::Requirement
|
211
|
-
requirements:
|
212
|
-
- - "~>"
|
213
|
-
- !ruby/object:Gem::Version
|
214
|
-
version: '3.9'
|
215
|
-
- !ruby/object:Gem::Dependency
|
216
|
-
name: rubocop
|
217
|
-
requirement: !ruby/object:Gem::Requirement
|
218
|
-
requirements:
|
219
|
-
- - "~>"
|
220
|
-
- !ruby/object:Gem::Version
|
221
|
-
version: '0.83'
|
222
|
-
type: :development
|
223
|
-
prerelease: false
|
224
|
-
version_requirements: !ruby/object:Gem::Requirement
|
225
|
-
requirements:
|
226
|
-
- - "~>"
|
227
|
-
- !ruby/object:Gem::Version
|
228
|
-
version: '0.83'
|
229
|
-
- !ruby/object:Gem::Dependency
|
230
|
-
name: rubocop-performance
|
231
|
-
requirement: !ruby/object:Gem::Requirement
|
232
|
-
requirements:
|
233
|
-
- - "~>"
|
234
|
-
- !ruby/object:Gem::Version
|
235
|
-
version: '1.5'
|
236
|
-
type: :development
|
237
|
-
prerelease: false
|
238
|
-
version_requirements: !ruby/object:Gem::Requirement
|
239
|
-
requirements:
|
240
|
-
- - "~>"
|
241
|
-
- !ruby/object:Gem::Version
|
242
|
-
version: '1.5'
|
243
|
-
- !ruby/object:Gem::Dependency
|
244
|
-
name: rubocop-rake
|
245
|
-
requirement: !ruby/object:Gem::Requirement
|
246
|
-
requirements:
|
247
|
-
- - "~>"
|
248
|
-
- !ruby/object:Gem::Version
|
249
|
-
version: '0.5'
|
250
|
-
type: :development
|
251
|
-
prerelease: false
|
252
|
-
version_requirements: !ruby/object:Gem::Requirement
|
253
|
-
requirements:
|
254
|
-
- - "~>"
|
255
|
-
- !ruby/object:Gem::Version
|
256
|
-
version: '0.5'
|
257
|
-
- !ruby/object:Gem::Dependency
|
258
|
-
name: rubocop-rspec
|
259
|
-
requirement: !ruby/object:Gem::Requirement
|
260
|
-
requirements:
|
261
|
-
- - "~>"
|
262
|
-
- !ruby/object:Gem::Version
|
263
|
-
version: '1.39'
|
264
|
-
type: :development
|
265
|
-
prerelease: false
|
266
|
-
version_requirements: !ruby/object:Gem::Requirement
|
267
|
-
requirements:
|
268
|
-
- - "~>"
|
269
|
-
- !ruby/object:Gem::Version
|
270
|
-
version: '1.39'
|
271
|
-
- !ruby/object:Gem::Dependency
|
272
|
-
name: simplecov
|
273
|
-
requirement: !ruby/object:Gem::Requirement
|
274
|
-
requirements:
|
275
|
-
- - "~>"
|
276
|
-
- !ruby/object:Gem::Version
|
277
|
-
version: '0.18'
|
278
|
-
type: :development
|
279
|
-
prerelease: false
|
280
|
-
version_requirements: !ruby/object:Gem::Requirement
|
281
|
-
requirements:
|
282
|
-
- - "~>"
|
283
|
-
- !ruby/object:Gem::Version
|
284
|
-
version: '0.18'
|
285
75
|
description:
|
286
76
|
email:
|
287
77
|
- brooke@alchemists.io
|
@@ -325,14 +115,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
325
115
|
requirements:
|
326
116
|
- - "~>"
|
327
117
|
- !ruby/object:Gem::Version
|
328
|
-
version: '
|
118
|
+
version: '3.0'
|
329
119
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
330
120
|
requirements:
|
331
121
|
- - ">="
|
332
122
|
- !ruby/object:Gem::Version
|
333
123
|
version: '0'
|
334
124
|
requirements: []
|
335
|
-
rubygems_version: 3.
|
125
|
+
rubygems_version: 3.2.3
|
336
126
|
signing_key:
|
337
127
|
specification_version: 4
|
338
128
|
summary: A command line interface for generating table of contents for Markdown files.
|
metadata.gz.sig
CHANGED
Binary file
|