tocer 12.1.0 → 13.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "optparse"
4
-
5
- module Tocer
6
- module CLI
7
- module Parsers
8
- CLIENT = OptionParser.new nil, 40, " "
9
- end
10
- end
11
- end
@@ -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