tocer 14.5.0 → 15.1.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: 5c7fa9bc279805f367d13fb7bdbb22c0daf73fd3f7051683a6f47f778c3e64b9
4
- data.tar.gz: 73147c1a339e981cbd9a1f1c682796d345c3ef2248aa1240b70055e80e940df3
3
+ metadata.gz: de1ff1beeccbc0c7aec3406d0ff33ebf20c26d0e0777be5fe33dc37c6ddc345e
4
+ data.tar.gz: 96066c0c0be259676da512cd3d6f204ac0e23441f10c10051297930f9919dffb
5
5
  SHA512:
6
- metadata.gz: 288e303a68315fe0a96b493eb0bee7e1bd3e24079e6a1c74b6427b565682daf32e02a5b40611910152e4895465a7ac1c6540ee7b934fa093282023312a063ee2
7
- data.tar.gz: c07cf2c9acaa5328f5203705f42326622d68b5e931635f26d757fcc909b574ac470c7c42cfb7b48ead50749da595c4bee9642a31ac7e63a68520c7748a9d7284
6
+ metadata.gz: 81ea0e85b0c3cdf5746c634b7490612aa94295268a4cc1248a507b7942e103615048daac79007c5e9b588ae664794f3382254e5610d4ea42efeda17f28a8256f
7
+ data.tar.gz: 7d21dc4e246edab4c8770031d90b2de847a042e27756933d499afdd42b5c383153d97aea20c9ae6c31475b16af07a38e23850698d995c10a16ee7fb52bccca7e
checksums.yaml.gz.sig CHANGED
Binary file
data/README.adoc CHANGED
@@ -123,19 +123,21 @@ You can add Rake support by adding the following to your `Rakefile`:
123
123
  [source,ruby]
124
124
  ----
125
125
  begin
126
- require "tocer/rake/setup"
126
+ require "tocer/rake/register"
127
127
  rescue LoadError => error
128
128
  puts error.message
129
129
  end
130
+
131
+ Tocer::Rake::Register.call
130
132
  ----
131
133
 
132
- Once configured, the following tasks will be available (i.e. `bundle exec rake -T`):
134
+ Once required and registered, the following tasks will be available (i.e. `bundle exec rake -T`):
133
135
 
134
136
  ....
135
- rake toc[label,includes] # Add/Update Table of Contents (README)
137
+ rake toc[label,includes] # Insert/Update Table of Contents
136
138
  ....
137
139
 
138
- …which can be called as follows (quotes are not necessary if spaces are not used):
140
+ You can invoke the task as follows (quotes are only necessary if spaces are used):
139
141
 
140
142
  [source,bash]
141
143
  ----
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "core"
3
4
  require "optparse"
4
5
 
5
6
  module Tocer
@@ -18,7 +19,7 @@ module Tocer
18
19
  @configuration_duplicate = configuration.dup
19
20
  end
20
21
 
21
- def call arguments = []
22
+ def call arguments = Core::EMPTY_ARRAY
22
23
  sections.each { |parser| parser.call configuration_duplicate, client: }
23
24
  client.parse arguments
24
25
  configuration_duplicate.freeze
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "core"
3
4
  require "refinements/structs"
4
5
 
5
6
  module Tocer
@@ -21,7 +22,7 @@ module Tocer
21
22
  @client = client
22
23
  end
23
24
 
24
- def call arguments = []
25
+ def call arguments = ::Core::EMPTY_ARRAY
25
26
  client.banner = specification.labeled_summary
26
27
  client.separator "\nUSAGE:\n"
27
28
  collate
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "core"
3
4
  require "refinements/structs"
4
5
 
5
6
  module Tocer
@@ -16,7 +17,7 @@ module Tocer
16
17
  @client = client
17
18
  end
18
19
 
19
- def call arguments = []
20
+ def call arguments = ::Core::EMPTY_ARRAY
20
21
  client.separator "\nOPTIONS:\n"
21
22
  private_methods.sort.grep(/add_/).each { |method| __send__ method }
22
23
  client.parse arguments
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "core"
4
+
3
5
  module Tocer
4
6
  module CLI
5
7
  # The main Command Line Interface (CLI) object.
@@ -11,7 +13,7 @@ module Tocer
11
13
  @parser = parser
12
14
  end
13
15
 
14
- def call arguments = []
16
+ def call arguments = Core::EMPTY_ARRAY
15
17
  perform parser.call(arguments)
16
18
  rescue OptionParser::ParseError => error
17
19
  puts error.message
@@ -1,27 +1,27 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "rake"
4
- require "tocer"
5
4
  require "refinements/structs"
5
+ require "tocer"
6
6
 
7
7
  module Tocer
8
8
  module Rake
9
- # Provides Rake tasks for convenience.
10
- class Tasks
9
+ # Registers Rake tasks for use.
10
+ class Register
11
11
  include ::Rake::DSL
12
12
  using Refinements::Structs
13
13
 
14
- def self.setup = new.install
14
+ def self.call = new.call
15
15
 
16
16
  def initialize configuration = Container[:configuration], runner: Runner.new
17
17
  @configuration = configuration
18
18
  @runner = runner
19
19
  end
20
20
 
21
- def install
22
- desc "Add/Update Table of Contents (README)"
21
+ def call
22
+ desc "Insert/Update Table of Contents"
23
23
  task :toc, %i[label includes] do |_task, arguments|
24
- runner.call configuration.merge(**arguments.to_h)
24
+ runner.call configuration.merge(arguments.to_h)
25
25
  end
26
26
  end
27
27
 
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "core"
3
4
  require "refinements/arrays"
4
5
 
5
6
  module Tocer
@@ -14,7 +15,7 @@ module Tocer
14
15
 
15
16
  def label = parser.content.gsub(embedded_link, embedded_link_label)
16
17
 
17
- def url = label.downcase.gsub(/\s/, "-").gsub(/[^\w\-]+/, "")
18
+ def url = label.downcase.gsub(/\s/, "-").gsub(/[^\w-]+/, "")
18
19
 
19
20
  def call(url_suffix: "") = "#{indented_bullet}[#{label}](##{computed_url url_suffix})"
20
21
 
@@ -22,7 +23,7 @@ module Tocer
22
23
 
23
24
  attr_reader :parser
24
25
 
25
- def computed_url(suffix = "") = [url, suffix.to_s].compress.join("-")
26
+ def computed_url(suffix = Core::EMPTY_STRING) = [url, suffix.to_s].compress.join("-")
26
27
 
27
28
  def embedded_link = "[#{embedded_link_label}](#{embedded_link_url})"
28
29
 
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "core"
3
4
  require "refinements/arrays"
4
5
 
5
6
  module Tocer
@@ -14,7 +15,7 @@ module Tocer
14
15
 
15
16
  def label = parser.content
16
17
 
17
- def url = label.downcase.gsub(/\s/, "-").gsub(/[^\w\-]+/, "")
18
+ def url = label.downcase.gsub(/\s/, "-").gsub(/[^\w-]+/, "")
18
19
 
19
20
  def call(url_suffix: "") = "#{indented_bullet}[#{label}](##{computed_url url_suffix})"
20
21
 
@@ -22,7 +23,7 @@ module Tocer
22
23
 
23
24
  attr_reader :parser
24
25
 
25
- def computed_url(suffix = "") = [url, suffix.to_s].compress.join("-")
26
+ def computed_url(suffix = Core::EMPTY_STRING) = [url, suffix.to_s].compress.join("-")
26
27
 
27
28
  def indented_bullet = prefix_to_spaces.gsub(/\s{2}$/, "- ")
28
29
 
data/tocer.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "tocer"
5
- spec.version = "14.5.0"
5
+ spec.version = "15.1.0"
6
6
  spec.authors = ["Brooke Kuhlmann"]
7
7
  spec.email = ["brooke@alchemists.io"]
8
8
  spec.homepage = "https://www.alchemists.io/projects/tocer"
@@ -22,13 +22,14 @@ Gem::Specification.new do |spec|
22
22
  spec.signing_key = Gem.default_key_path
23
23
  spec.cert_chain = [Gem.default_cert_path]
24
24
 
25
- spec.required_ruby_version = "~> 3.1"
26
- spec.add_dependency "cogger", "~> 0.4"
25
+ spec.required_ruby_version = "~> 3.2"
26
+ spec.add_dependency "cogger", "~> 0.5"
27
+ spec.add_dependency "core", "~> 0.1"
27
28
  spec.add_dependency "dry-container", "~> 0.11"
28
- spec.add_dependency "infusible", "~> 0.2"
29
- spec.add_dependency "refinements", "~> 9.7"
30
- spec.add_dependency "runcom", "~> 8.7"
31
- spec.add_dependency "spek", "~> 0.6"
29
+ spec.add_dependency "infusible", "~> 1.0"
30
+ spec.add_dependency "refinements", "~> 10.0"
31
+ spec.add_dependency "runcom", "~> 9.0"
32
+ spec.add_dependency "spek", "~> 1.0"
32
33
  spec.add_dependency "zeitwerk", "~> 2.6"
33
34
 
34
35
  spec.bindir = "exe"
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: 14.5.0
4
+ version: 15.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brooke Kuhlmann
@@ -28,7 +28,7 @@ cert_chain:
28
28
  CxDe2+VuChj4I1nvIHdu+E6XoEVlanUPKmSg6nddhkKn2gC45Kyzh6FZqnzH/CRp
29
29
  RFE=
30
30
  -----END CERTIFICATE-----
31
- date: 2022-10-22 00:00:00.000000000 Z
31
+ date: 2023-01-08 00:00:00.000000000 Z
32
32
  dependencies:
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: cogger
@@ -36,14 +36,28 @@ dependencies:
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: '0.4'
39
+ version: '0.5'
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: '0.4'
46
+ version: '0.5'
47
+ - !ruby/object:Gem::Dependency
48
+ name: core
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '0.1'
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: '0.1'
47
61
  - !ruby/object:Gem::Dependency
48
62
  name: dry-container
49
63
  requirement: !ruby/object:Gem::Requirement
@@ -64,56 +78,56 @@ dependencies:
64
78
  requirements:
65
79
  - - "~>"
66
80
  - !ruby/object:Gem::Version
67
- version: '0.2'
81
+ version: '1.0'
68
82
  type: :runtime
69
83
  prerelease: false
70
84
  version_requirements: !ruby/object:Gem::Requirement
71
85
  requirements:
72
86
  - - "~>"
73
87
  - !ruby/object:Gem::Version
74
- version: '0.2'
88
+ version: '1.0'
75
89
  - !ruby/object:Gem::Dependency
76
90
  name: refinements
77
91
  requirement: !ruby/object:Gem::Requirement
78
92
  requirements:
79
93
  - - "~>"
80
94
  - !ruby/object:Gem::Version
81
- version: '9.7'
95
+ version: '10.0'
82
96
  type: :runtime
83
97
  prerelease: false
84
98
  version_requirements: !ruby/object:Gem::Requirement
85
99
  requirements:
86
100
  - - "~>"
87
101
  - !ruby/object:Gem::Version
88
- version: '9.7'
102
+ version: '10.0'
89
103
  - !ruby/object:Gem::Dependency
90
104
  name: runcom
91
105
  requirement: !ruby/object:Gem::Requirement
92
106
  requirements:
93
107
  - - "~>"
94
108
  - !ruby/object:Gem::Version
95
- version: '8.7'
109
+ version: '9.0'
96
110
  type: :runtime
97
111
  prerelease: false
98
112
  version_requirements: !ruby/object:Gem::Requirement
99
113
  requirements:
100
114
  - - "~>"
101
115
  - !ruby/object:Gem::Version
102
- version: '8.7'
116
+ version: '9.0'
103
117
  - !ruby/object:Gem::Dependency
104
118
  name: spek
105
119
  requirement: !ruby/object:Gem::Requirement
106
120
  requirements:
107
121
  - - "~>"
108
122
  - !ruby/object:Gem::Version
109
- version: '0.6'
123
+ version: '1.0'
110
124
  type: :runtime
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: '0.6'
130
+ version: '1.0'
117
131
  - !ruby/object:Gem::Dependency
118
132
  name: zeitwerk
119
133
  requirement: !ruby/object:Gem::Requirement
@@ -158,8 +172,7 @@ files:
158
172
  - lib/tocer/elements/comment_block.rb
159
173
  - lib/tocer/import.rb
160
174
  - lib/tocer/parsers/header.rb
161
- - lib/tocer/rake/setup.rb
162
- - lib/tocer/rake/tasks.rb
175
+ - lib/tocer/rake/register.rb
163
176
  - lib/tocer/runner.rb
164
177
  - lib/tocer/transformers/finder.rb
165
178
  - lib/tocer/transformers/link.rb
@@ -185,14 +198,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
185
198
  requirements:
186
199
  - - "~>"
187
200
  - !ruby/object:Gem::Version
188
- version: '3.1'
201
+ version: '3.2'
189
202
  required_rubygems_version: !ruby/object:Gem::Requirement
190
203
  requirements:
191
204
  - - ">="
192
205
  - !ruby/object:Gem::Version
193
206
  version: '0'
194
207
  requirements: []
195
- rubygems_version: 3.3.24
208
+ rubygems_version: 3.4.2
196
209
  signing_key:
197
210
  specification_version: 4
198
211
  summary: A command line interface for generating table of contents for Markdown files.
metadata.gz.sig CHANGED
Binary file
@@ -1,4 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "tocer/rake/tasks"
4
- Tocer::Rake::Tasks.setup