tocer 12.0.0 → 12.0.4

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: '096af23217cee6fd1f0fc3193a733eae8fff2cc586bce9058fde6d67c409aca3'
4
- data.tar.gz: e491575b96fe2dfdad444015d228cd5150d2e8a2aebd85f98977fed6b598e268
3
+ metadata.gz: c0b8826e87d4f51dcdeaf4e5bdc9f72ddc2a8901c0855563c78cd4173bdd7c94
4
+ data.tar.gz: a276102905aa8ee4497b1be3c7d0cbfe0fd34c44858ae26e7c6fc8fdb1474c36
5
5
  SHA512:
6
- metadata.gz: 51f72f12821e8101fac9ce9f062879756493916725d4bc5c25129e9a4b13338f5b524a51ce66a4f9387404499ea8baa3d7eb1db764ef58315af9f1c9bc9ee37e
7
- data.tar.gz: 5ea05ed97e8a350c3a32470f7627e47e60d2be56368da9e738ea5e9a302a5998dae9ea93706f9e7f9c19609b0f7d98dd324a621ea0eb3a2b6fc36fb410e8c766
6
+ metadata.gz: d3aed43fe58b3b50ef6fb72127c37597db268dfc848d615e213609e1f0102b07bdec048c30933bd2850a4b8dd93a7de2698398c225714fb73569dea5d79ff456
7
+ data.tar.gz: a4f5b1470536c9711212e65efdbb9aeb7474d3897aa8666e5d57afe74ef0cde922676f0b7167c9561613313c090268c40b613c9747c4e5e85283f8ce0cd0cefa
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
 
@@ -1,14 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "runcom"
4
-
5
3
  module Tocer
6
4
  module CLI
7
5
  module Parsers
8
- SECTIONS = [Core, Build].freeze # Order is important.
9
-
10
6
  # Assembles and parses all Command Line Interface (CLI) options.
11
7
  class Assembler
8
+ SECTIONS = [Core, Build].freeze # Order is important.
9
+
12
10
  def initialize configuration: CLI::Configuration::Loader.call,
13
11
  sections: SECTIONS,
14
12
  client: CLIENT
@@ -29,7 +27,7 @@ module Tocer
29
27
 
30
28
  private
31
29
 
32
- attr_reader :options, :client, :sections
30
+ attr_reader :options, :sections, :client
33
31
  end
34
32
  end
35
33
  end
@@ -25,9 +25,7 @@ module Tocer
25
25
 
26
26
  attr_reader :options, :client
27
27
 
28
- def collate
29
- private_methods.sort.grep(/add_/).each { |method| __send__ method }
30
- end
28
+ def collate = private_methods.sort.grep(/add_/).each { |method| __send__ method }
31
29
 
32
30
  def add_config
33
31
  client.on(
@@ -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.0"
9
- VERSION_LABEL = "#{LABEL} #{VERSION}"
8
+ VERSION = "12.0.4"
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
@@ -21,7 +21,7 @@ module Tocer
21
21
  def install
22
22
  desc "Add/Update Table of Contents (README)"
23
23
  task :toc, %i[label includes] do |_task, arguments|
24
- runner.call(**configuration.merge(**arguments.to_h).to_h).call
24
+ runner.call(**configuration.merge(**arguments.to_h).to_h)
25
25
  end
26
26
  end
27
27
 
@@ -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.0
4
+ version: 12.0.4
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-17 00:00:00.000000000 Z
31
+ date: 2021-09-06 00:00:00.000000000 Z
32
32
  dependencies:
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: refinements
@@ -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.27
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
@@ -1 +1 @@
1
- q�6�5/r q�}'�+�K�J��*.�?R؇b,�f>��]�-€�s!^).ۇ\�
1
+ ����t���Q�<�)�6��L"zʊ=�z-Q*a��gal���K�&�)Nj�ΐ��E���fΉ]��p���5���Ә�y��M���� )�L͇p_#�����|��o4�+s e��u�\�Ąw�C=� �,~���[&ۥsW��H84�דM.�AL��Oމ�5u��>dwԞ�l?�o�\$ɤZ��C��U���}Aj7+��$�5�J���7�h�\Hǂ��$j5ْS�f��^��}�B�F�e)��Ɲ