tocer 10.1.1 → 10.5.0

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: ee5569d8544f2723e5b2bc8314a0dca6ea59a3fe2b196b3c70de4b622c5dc925
4
- data.tar.gz: cffb679fb505d874f1b76cd244e1d6f07bd721b6007cf549b5eee1175fb064a9
3
+ metadata.gz: 0ba1e651bf48853c263f315d485ec8bcda29f9139b28eac4910c0e5f6b856008
4
+ data.tar.gz: e86c40bbb6076d4b9cdb086eda67a2e3259d8cee340a4a5905eeba2b76ef749b
5
5
  SHA512:
6
- metadata.gz: 6c1de2eb5a46c60c18e6b4b4e0eec19b4729607cbaccdbfea922bc618f34991629c3c0b78a0f020a7c1e485976aee43ef073255b12483937eda344f9e3a74293
7
- data.tar.gz: 72951617e458dc3c823fd17940ec68076235b88a8912e9c6ad17b10f960469020b337dc1708d819aec308c9c0cb4cec30b2cab48fe3f4e462815d8f7e426047b
6
+ metadata.gz: 8c4bbe93b91fa446d7af523ac0c884f0c80183e869851b3376231f734eb00cd5d165c39c7cb5715d76fed135057ce06b0e3fa6a2b164682f57d890cc13d04731
7
+ data.tar.gz: 6abf86c41ce959e5803484c96f37a444c5a092d149089500dcd82d21cdc0d69684c0243a2ea0cad7d4732402b586328f372dff9286e178568083ffaf0821ac11
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:
@@ -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.1"
8
+ VERSION = "10.5.0"
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.1
4
+ version: 10.5.0
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-05-21 00:00:00.000000000 Z
31
+ date: 2020-12-13 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.4'
39
+ version: '7.16'
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.4'
46
+ version: '7.16'
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
@@ -72,217 +72,7 @@ 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.0'
110
- type: :development
111
- prerelease: false
112
- version_requirements: !ruby/object:Gem::Requirement
113
- requirements:
114
- - - "~>"
115
- - !ruby/object:Gem::Version
116
- version: '14.0'
117
- - !ruby/object:Gem::Dependency
118
- name: git-cop
119
- requirement: !ruby/object:Gem::Requirement
120
- requirements:
121
- - - "~>"
122
- - !ruby/object:Gem::Version
123
- version: '4.0'
124
- type: :development
125
- prerelease: false
126
- version_requirements: !ruby/object:Gem::Requirement
127
- requirements:
128
- - - "~>"
129
- - !ruby/object:Gem::Version
130
- version: '4.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
- description:
75
+ description:
286
76
  email:
287
77
  - brooke@alchemists.io
288
78
  executables:
@@ -317,7 +107,7 @@ metadata:
317
107
  changelog_uri: https://www.alchemists.io/projects/tocer/changes.html
318
108
  documentation_uri: https://www.alchemists.io/projects/tocer
319
109
  source_code_uri: https://github.com/bkuhlmann/tocer
320
- post_install_message:
110
+ post_install_message:
321
111
  rdoc_options: []
322
112
  require_paths:
323
113
  - lib
@@ -332,8 +122,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
332
122
  - !ruby/object:Gem::Version
333
123
  version: '0'
334
124
  requirements: []
335
- rubygems_version: 3.1.3
336
- signing_key:
125
+ rubygems_version: 3.2.0
126
+ signing_key:
337
127
  specification_version: 4
338
128
  summary: A command line interface for generating table of contents for Markdown files.
339
129
  test_files: []
metadata.gz.sig CHANGED
Binary file