tocer 12.2.0 → 13.0.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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/LICENSE.adoc +207 -155
- data/README.adoc +13 -10
- data/lib/tocer/builder.rb +5 -2
- data/lib/tocer/cli/actions/config.rb +31 -0
- data/lib/tocer/cli/actions/insert.rb +20 -0
- data/lib/tocer/cli/parser.rb +31 -0
- data/lib/tocer/cli/parsers/core.rb +21 -11
- data/lib/tocer/cli/parsers/flag.rb +51 -0
- data/lib/tocer/cli/shell.rb +16 -20
- data/lib/tocer/configuration/content.rb +22 -0
- data/lib/tocer/{cli/configuration → configuration}/defaults.yml +1 -0
- data/lib/tocer/configuration/loader.rb +33 -0
- data/lib/tocer/elements/comment_block.rb +4 -0
- data/lib/tocer/identity.rb +1 -1
- data/lib/tocer/rake/tasks.rb +2 -2
- data/lib/tocer/runner.rb +8 -9
- data/lib/tocer/transformers/finder.rb +3 -2
- data/lib/tocer/writer.rb +12 -4
- data/lib/tocer.rb +11 -18
- data.tar.gz.sig +0 -0
- metadata +30 -17
- metadata.gz.sig +0 -0
- data/lib/tocer/cli/configuration/content.rb +0 -10
- data/lib/tocer/cli/configuration/loader.rb +0 -33
- data/lib/tocer/cli/parsers/assembler.rb +0 -34
- data/lib/tocer/cli/parsers/build.rb +0 -52
- data/lib/tocer/cli/parsers.rb +0 -11
- data/lib/tocer/cli/processors/build.rb +0 -24
- data/lib/tocer/cli/processors/config.rb +0 -31
@@ -1,24 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Tocer
|
4
|
-
module CLI
|
5
|
-
module Processors
|
6
|
-
# Handles the Command Line Interface (CLI) for building of table of contents.
|
7
|
-
class Build
|
8
|
-
def initialize runner: Runner.new
|
9
|
-
@runner = runner
|
10
|
-
end
|
11
|
-
|
12
|
-
def call root_dir = ".", configuration = {}
|
13
|
-
runner.call(root_dir: root_dir, **configuration.slice(:label, :includes)) do |path|
|
14
|
-
puts " #{path}"
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
private
|
19
|
-
|
20
|
-
attr_reader :runner
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
@@ -1,31 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Tocer
|
4
|
-
module CLI
|
5
|
-
module Processors
|
6
|
-
# Handles the Command Line Interface (CLI) configuration processing.
|
7
|
-
class Config
|
8
|
-
def initialize configuration: CLI::Configuration::Loader::CLIENT, kernel: Kernel
|
9
|
-
@configuration = configuration
|
10
|
-
@kernel = kernel
|
11
|
-
end
|
12
|
-
|
13
|
-
def call action
|
14
|
-
case action
|
15
|
-
when :edit then edit
|
16
|
-
when :view then view
|
17
|
-
else fail StandardError, "Invalid configuration action: #{action}."
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
private
|
22
|
-
|
23
|
-
attr_reader :configuration, :kernel
|
24
|
-
|
25
|
-
def edit = kernel.system("$EDITOR #{configuration.current}")
|
26
|
-
|
27
|
-
def view = kernel.system("cat #{configuration.current}")
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|