tocer 10.1.0 → 10.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f96f8f4040d155551b11770a7aa0322fb991b40e952370e2263cc04f2bb76184
4
- data.tar.gz: 1004e0f4bf571f7c7f12c3f39ad70898b4de9c18701e749939a138e5144db4ae
3
+ metadata.gz: 452eb2486a977b33b270cb7b27a6e8727bf041c81688109e5224aaf5ef979ad5
4
+ data.tar.gz: '0197473f62a7ced04811202ab00ec744d8ffb0057c1863960fd7fc3f604d5cde'
5
5
  SHA512:
6
- metadata.gz: f02d957b5de932d91556ebaf16ecade9e17f71f0e476744586b253d957dc5649b9057e61e1d46cdfd5b9f38dc032c25fc212a3e2fd2f7f77bf136ea6fcbe384f
7
- data.tar.gz: ff709e8f67157b5f1eac1600bd5e3cfe02e57f3362d0b3b6b3516d11221dc013620c7223c088f1de556df8a19cae5c26b2989ea724108e85602a6fe383035e51
6
+ metadata.gz: 4e27b3e32c8d35da618c53e84a78f034a80b5d18fcbc5cb695d82f2d7ff872a41451d0d1fa6f26ab3c89110fc93c714919a88000a96449a58e6e83097e1471c7
7
+ data.tar.gz: 3be7dff91e1d60b442a35f34f21b91c6570b73ae81dc7a080444a3c91c2dda99bc84f9ac08eec090d29af438accaab1cfdfc6328df2da8aa9c465c3835a6d126
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -150,7 +150,7 @@ additional liability.
150
150
 
151
151
  END OF TERMS AND CONDITIONS
152
152
 
153
- Copyright link:https://www.alchemists.io[Alchemists].
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]
@@ -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
 
@@ -28,12 +30,10 @@ toc::[]
28
30
  == Requirements
29
31
 
30
32
  . A UNIX-based system.
31
- . https://www.ruby-lang.org[Ruby 2.7.x].
33
+ . link:https://www.ruby-lang.org[Ruby].
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:
@@ -208,4 +208,4 @@ Read link:CHANGES.adoc[CHANGES] for details.
208
208
 
209
209
  == Credits
210
210
 
211
- Engineered by link:https://www.alchemists.io/team/brooke_kuhlmann.html[Brooke Kuhlmann].
211
+ Engineered by link:https://www.alchemists.io/team/brooke_kuhlmann[Brooke Kuhlmann].
@@ -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
@@ -5,7 +5,7 @@ module Tocer
5
5
  # Represents a table of contents start and finish comment block.
6
6
  class CommentBlock
7
7
  def self.index lines, id
8
- (lines.index { |line| line =~ /\<\!\-\-.*#{Regexp.escape id}.*\-\-\>/ }).to_i
8
+ (lines.index { |line| line =~ /<!--.*#{Regexp.escape id}.*-->/ }).to_i
9
9
  end
10
10
 
11
11
  def initialize start_id: "Tocer[start]",
@@ -5,7 +5,7 @@ module Tocer
5
5
  module Identity
6
6
  NAME = "tocer"
7
7
  LABEL = "Tocer"
8
- VERSION = "10.1.0"
8
+ VERSION = "10.4.1"
9
9
  VERSION_LABEL = "#{LABEL} #{VERSION}"
10
10
  end
11
11
  end
@@ -11,7 +11,7 @@ module Tocer
11
11
  end
12
12
 
13
13
  def prefix
14
- String markdown[/#{PUNCTUATION}{1,}/]
14
+ String markdown[/#{PUNCTUATION}{1,}/o]
15
15
  end
16
16
 
17
17
  def content
@@ -9,10 +9,18 @@ module Tocer
9
9
  /.*/ => Transformers::Text
10
10
  }.freeze
11
11
 
12
- def self.call markdown
13
- TRANSFORMERS.find { |pattern, transformer| break transformer if pattern.match? markdown }
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,11 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tocer
3
3
  version: !ruby/object:Gem::Version
4
- version: 10.1.0
4
+ version: 10.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brooke Kuhlmann
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain:
11
11
  - |
@@ -28,7 +28,7 @@ cert_chain:
28
28
  2XV8FRa7/JimI07sPLC13eLY3xd/aYTi85Z782KIA4j0G8XEEWAX0ouBhlXPocZv
29
29
  QWc=
30
30
  -----END CERTIFICATE-----
31
- date: 2020-04-01 00:00:00.000000000 Z
31
+ date: 2020-11-21 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: '7.0'
39
+ version: '7.15'
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: '7.0'
46
+ version: '7.15'
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: '6.0'
53
+ version: '6.4'
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: '6.0'
60
+ version: '6.4'
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: thor
63
63
  requirement: !ruby/object:Gem::Requirement
@@ -78,14 +78,28 @@ dependencies:
78
78
  requirements:
79
79
  - - "~>"
80
80
  - !ruby/object:Gem::Version
81
- version: '0.6'
81
+ version: '0.7'
82
82
  type: :development
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
86
  - - "~>"
87
87
  - !ruby/object:Gem::Version
88
- version: '0.6'
88
+ version: '0.7'
89
+ - !ruby/object:Gem::Dependency
90
+ name: bundler-leak
91
+ requirement: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - "~>"
94
+ - !ruby/object:Gem::Version
95
+ version: '0.2'
96
+ type: :development
97
+ prerelease: false
98
+ version_requirements: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - "~>"
101
+ - !ruby/object:Gem::Version
102
+ version: '0.2'
89
103
  - !ruby/object:Gem::Dependency
90
104
  name: climate_control
91
105
  requirement: !ruby/object:Gem::Requirement
@@ -106,28 +120,28 @@ dependencies:
106
120
  requirements:
107
121
  - - "~>"
108
122
  - !ruby/object:Gem::Version
109
- version: '14.0'
123
+ version: '14.8'
110
124
  type: :development
111
125
  prerelease: false
112
126
  version_requirements: !ruby/object:Gem::Requirement
113
127
  requirements:
114
128
  - - "~>"
115
129
  - !ruby/object:Gem::Version
116
- version: '14.0'
130
+ version: '14.8'
117
131
  - !ruby/object:Gem::Dependency
118
- name: git-cop
132
+ name: git-lint
119
133
  requirement: !ruby/object:Gem::Requirement
120
134
  requirements:
121
135
  - - "~>"
122
136
  - !ruby/object:Gem::Version
123
- version: '4.0'
137
+ version: '1.3'
124
138
  type: :development
125
139
  prerelease: false
126
140
  version_requirements: !ruby/object:Gem::Requirement
127
141
  requirements:
128
142
  - - "~>"
129
143
  - !ruby/object:Gem::Version
130
- version: '4.0'
144
+ version: '1.3'
131
145
  - !ruby/object:Gem::Dependency
132
146
  name: guard-rspec
133
147
  requirement: !ruby/object:Gem::Requirement
@@ -148,28 +162,28 @@ dependencies:
148
162
  requirements:
149
163
  - - "~>"
150
164
  - !ruby/object:Gem::Version
151
- version: '0.12'
165
+ version: '0.13'
152
166
  type: :development
153
167
  prerelease: false
154
168
  version_requirements: !ruby/object:Gem::Requirement
155
169
  requirements:
156
170
  - - "~>"
157
171
  - !ruby/object:Gem::Version
158
- version: '0.12'
172
+ version: '0.13'
159
173
  - !ruby/object:Gem::Dependency
160
174
  name: pry-byebug
161
175
  requirement: !ruby/object:Gem::Requirement
162
176
  requirements:
163
177
  - - "~>"
164
178
  - !ruby/object:Gem::Version
165
- version: '3.7'
179
+ version: '3.9'
166
180
  type: :development
167
181
  prerelease: false
168
182
  version_requirements: !ruby/object:Gem::Requirement
169
183
  requirements:
170
184
  - - "~>"
171
185
  - !ruby/object:Gem::Version
172
- version: '3.7'
186
+ version: '3.9'
173
187
  - !ruby/object:Gem::Dependency
174
188
  name: rake
175
189
  requirement: !ruby/object:Gem::Requirement
@@ -204,42 +218,42 @@ dependencies:
204
218
  requirements:
205
219
  - - "~>"
206
220
  - !ruby/object:Gem::Version
207
- version: '3.9'
221
+ version: '3.10'
208
222
  type: :development
209
223
  prerelease: false
210
224
  version_requirements: !ruby/object:Gem::Requirement
211
225
  requirements:
212
226
  - - "~>"
213
227
  - !ruby/object:Gem::Version
214
- version: '3.9'
228
+ version: '3.10'
215
229
  - !ruby/object:Gem::Dependency
216
230
  name: rubocop
217
231
  requirement: !ruby/object:Gem::Requirement
218
232
  requirements:
219
233
  - - "~>"
220
234
  - !ruby/object:Gem::Version
221
- version: '0.79'
235
+ version: '1.3'
222
236
  type: :development
223
237
  prerelease: false
224
238
  version_requirements: !ruby/object:Gem::Requirement
225
239
  requirements:
226
240
  - - "~>"
227
241
  - !ruby/object:Gem::Version
228
- version: '0.79'
242
+ version: '1.3'
229
243
  - !ruby/object:Gem::Dependency
230
244
  name: rubocop-performance
231
245
  requirement: !ruby/object:Gem::Requirement
232
246
  requirements:
233
247
  - - "~>"
234
248
  - !ruby/object:Gem::Version
235
- version: '1.5'
249
+ version: '1.8'
236
250
  type: :development
237
251
  prerelease: false
238
252
  version_requirements: !ruby/object:Gem::Requirement
239
253
  requirements:
240
254
  - - "~>"
241
255
  - !ruby/object:Gem::Version
242
- version: '1.5'
256
+ version: '1.8'
243
257
  - !ruby/object:Gem::Dependency
244
258
  name: rubocop-rake
245
259
  requirement: !ruby/object:Gem::Requirement
@@ -260,29 +274,29 @@ dependencies:
260
274
  requirements:
261
275
  - - "~>"
262
276
  - !ruby/object:Gem::Version
263
- version: '1.37'
277
+ version: '2.0'
264
278
  type: :development
265
279
  prerelease: false
266
280
  version_requirements: !ruby/object:Gem::Requirement
267
281
  requirements:
268
282
  - - "~>"
269
283
  - !ruby/object:Gem::Version
270
- version: '1.37'
284
+ version: '2.0'
271
285
  - !ruby/object:Gem::Dependency
272
286
  name: simplecov
273
287
  requirement: !ruby/object:Gem::Requirement
274
288
  requirements:
275
289
  - - "~>"
276
290
  - !ruby/object:Gem::Version
277
- version: '0.18'
291
+ version: '0.19'
278
292
  type: :development
279
293
  prerelease: false
280
294
  version_requirements: !ruby/object:Gem::Requirement
281
295
  requirements:
282
296
  - - "~>"
283
297
  - !ruby/object:Gem::Version
284
- version: '0.18'
285
- description:
298
+ version: '0.19'
299
+ description:
286
300
  email:
287
301
  - brooke@alchemists.io
288
302
  executables:
@@ -317,7 +331,7 @@ metadata:
317
331
  changelog_uri: https://www.alchemists.io/projects/tocer/changes.html
318
332
  documentation_uri: https://www.alchemists.io/projects/tocer
319
333
  source_code_uri: https://github.com/bkuhlmann/tocer
320
- post_install_message:
334
+ post_install_message:
321
335
  rdoc_options: []
322
336
  require_paths:
323
337
  - lib
@@ -332,8 +346,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
332
346
  - !ruby/object:Gem::Version
333
347
  version: '0'
334
348
  requirements: []
335
- rubygems_version: 3.1.2
336
- signing_key:
349
+ rubygems_version: 3.1.4
350
+ signing_key:
337
351
  specification_version: 4
338
352
  summary: A command line interface for generating table of contents for Markdown files.
339
353
  test_files: []
metadata.gz.sig CHANGED
Binary file