tocer 12.0.1 → 12.0.2

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: fbb0b5122d22bc49315768eaa8da1ad803be7a116dbbc628d0cf21fc0e7f3e5e
4
- data.tar.gz: e271feacaaa9643cc05d656f32ac00dfba47a7f7a63cfa4c330e4f33188d4ca0
3
+ metadata.gz: e87cdc42651955652ee2d24f27b95c6722561c4b284a0ff5fb6b3341425f9eb8
4
+ data.tar.gz: 6170cd85486b4e8c5a9168b265ba1d3d6127fab7e662ea26f8095a028f7e9699
5
5
  SHA512:
6
- metadata.gz: fbfd2fcf7ae70d445c41fef7d1f190f43b23f8af12985e2ad0c75996e7a38795423b620f0865e48171637d545914c95fc8020244413ef299a3af112215562448
7
- data.tar.gz: f24e6608ed56a388c0ec4e5acf2d906138c86c55002b8d17fcfc85a7048f490a0eaf631bb38972eb60b634ed69a4b180b22740840f12d88c7bcea586b6119d61
6
+ metadata.gz: 012aca333c7cd34bc26bba320e1ddce5fb25f138f93378efdf551d6c65873eba8745960ccdccc296616569359681f4f6e68342f9c52d0ce10d6eba30b2d1f080
7
+ data.tar.gz: 3f9a398064fbb8521952cf6ac5e9749eaa2373ff6ca48c865ea23b6eb814d1e11f046e0656e6230264a3e55d35c39838f867817baf44e0124f98e32ae9457dbc
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -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
@@ -5,7 +5,7 @@ module Tocer
5
5
  module Identity
6
6
  NAME = "tocer"
7
7
  LABEL = "Tocer"
8
- VERSION = "12.0.1"
8
+ VERSION = "12.0.2"
9
9
  VERSION_LABEL = "#{LABEL} #{VERSION}"
10
10
  SUMMARY = "A command line interface for generating table of contents for Markdown files."
11
11
  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
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.0.2
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-05-20 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.17
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