tocer 12.0.1 → 12.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fbb0b5122d22bc49315768eaa8da1ad803be7a116dbbc628d0cf21fc0e7f3e5e
4
- data.tar.gz: e271feacaaa9643cc05d656f32ac00dfba47a7f7a63cfa4c330e4f33188d4ca0
3
+ metadata.gz: f9047d6ec4c8256b01c9748e734bceda1dc9b36dd29146348c7f619fcc3ec4b4
4
+ data.tar.gz: 33900c7a8f413ab1f6f496f70e96d6d304d57ea17e0ad3639ca0451b571c3329
5
5
  SHA512:
6
- metadata.gz: fbfd2fcf7ae70d445c41fef7d1f190f43b23f8af12985e2ad0c75996e7a38795423b620f0865e48171637d545914c95fc8020244413ef299a3af112215562448
7
- data.tar.gz: f24e6608ed56a388c0ec4e5acf2d906138c86c55002b8d17fcfc85a7048f490a0eaf631bb38972eb60b634ed69a4b180b22740840f12d88c7bcea586b6119d61
6
+ metadata.gz: 5e09e1f8042254303d9a6e8577d3e93d9828cbc8098bd8895ef5145795a05603dda22318159d091ba72bfea5520cb605a29fc0beaf64df803b9eb52504f20592
7
+ data.tar.gz: 929052df6c6cb51dc9f540345bae6ca665e994e7642a8a5e9bac018fd1afdf3fce7e5b481640d6f8681b82c3be46722e5897322ad3e2f367b9461d735b194030
checksums.yaml.gz.sig CHANGED
Binary file
data/README.adoc CHANGED
@@ -12,7 +12,8 @@ image::https://img.shields.io/badge/code_style-alchemists-brightgreen.svg[Alchem
12
12
  image::https://circleci.com/gh/bkuhlmann/tocer.svg?style=svg[Circle CI Status]
13
13
 
14
14
  Tocer (a.k.a. Table of Contenter) is a command line interface for generating table of contents for
15
- Markdown files.
15
+ Markdown files. Use this tool to automatically manage and update your documentation with minimal
16
+ effort. Works on single files or multiple files within nested directory structures.
16
17
 
17
18
  toc::[]
18
19
 
@@ -4,10 +4,7 @@ module Tocer
4
4
  module CLI
5
5
  # The main Command Line Interface (CLI) object.
6
6
  class Shell
7
- PROCESSORS = {
8
- config: Processors::Config.new,
9
- build: Processors::Build.new
10
- }.freeze
7
+ PROCESSORS = {config: Processors::Config.new, build: Processors::Build.new}.freeze
11
8
 
12
9
  def initialize parser: Parsers::Assembler.new, processors: PROCESSORS
13
10
  @parser = parser
@@ -21,7 +18,6 @@ module Tocer
21
18
  in config: action then process_config action
22
19
  in build: path then process_build path
23
20
  in version: then puts version
24
- in help: then usage
25
21
  else usage
26
22
  end
27
23
  end
@@ -5,8 +5,8 @@ module Tocer
5
5
  module Identity
6
6
  NAME = "tocer"
7
7
  LABEL = "Tocer"
8
- VERSION = "12.0.1"
9
- VERSION_LABEL = "#{LABEL} #{VERSION}"
8
+ VERSION = "12.1.0"
9
+ VERSION_LABEL = "#{LABEL} #{VERSION}".freeze
10
10
  SUMMARY = "A command line interface for generating table of contents for Markdown files."
11
11
  end
12
12
  end
@@ -4,10 +4,7 @@ module Tocer
4
4
  module Transformers
5
5
  # Finds appropriate header transformer for matching pattern.
6
6
  class Finder
7
- TRANSFORMERS = {
8
- /\[.+\]\(.+\)/ => Transformers::Link,
9
- /.*/ => Transformers::Text
10
- }.freeze
7
+ TRANSFORMERS = {/\[.+\]\(.+\)/ => Transformers::Link, /.*/ => Transformers::Text}.freeze
11
8
 
12
9
  def initialize transformers: TRANSFORMERS
13
10
  @transformers = transformers
data/lib/tocer/writer.rb CHANGED
@@ -1,11 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "refinements/arrays"
3
4
  require "refinements/pathnames"
4
5
 
5
6
  module Tocer
6
7
  # Writes table of contents to a Markdown document.
7
8
  # :reek:DataClump
8
9
  class Writer
10
+ using Refinements::Arrays
9
11
  using Refinements::Pathnames
10
12
 
11
13
  def self.add start_index:, old_lines:, new_lines:
@@ -45,7 +47,7 @@ module Tocer
45
47
  ).join
46
48
  end
47
49
 
48
- def prepend(lines, label) = content(lines, label) + "\n" + lines.join
50
+ def prepend(lines, label) = [content(lines, label), lines.join].compress.join("\n")
49
51
 
50
52
  def content(lines, label) = builder.call(lines, label: label)
51
53
  end
data.tar.gz.sig CHANGED
Binary file
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: 12.0.1
4
+ version: 12.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brooke Kuhlmann
@@ -28,7 +28,7 @@ cert_chain:
28
28
  lkHilIrX69jq8wMPpBhlaw2mRmeSL50Wv5u6xVBvOHhXFSP1crXM95vfLhLyRYod
29
29
  W2A=
30
30
  -----END CERTIFICATE-----
31
- date: 2021-04-18 00:00:00.000000000 Z
31
+ date: 2021-10-03 00:00:00.000000000 Z
32
32
  dependencies:
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: refinements
@@ -36,14 +36,14 @@ dependencies:
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: '8.0'
39
+ version: '8.4'
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: '8.0'
46
+ version: '8.4'
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: runcom
49
49
  requirement: !ruby/object:Gem::Requirement
@@ -116,7 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0'
118
118
  requirements: []
119
- rubygems_version: 3.2.16
119
+ rubygems_version: 3.2.28
120
120
  signing_key:
121
121
  specification_version: 4
122
122
  summary: A command line interface for generating table of contents for Markdown files.
metadata.gz.sig CHANGED
Binary file