bookbindery 3.1.0 → 3.1.2
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
- data/install_bin/bookbinder +1 -1
- data/lib/bookbinder/cf_command_runner.rb +1 -1
- data/lib/bookbinder/cli.rb +5 -5
- data/lib/bookbinder/code_example_reader.rb +57 -19
- data/lib/bookbinder/colorizer.rb +5 -2
- data/lib/bookbinder/commands/bind.rb +32 -42
- data/lib/bookbinder/commands/bind/bind_options.rb +6 -4
- data/lib/bookbinder/commands/bind/directory_preparer.rb +8 -13
- data/lib/bookbinder/{repositories/command_repository.rb → commands/collection.rb} +19 -37
- data/lib/bookbinder/config/archive_menu_configuration.rb +38 -0
- data/lib/bookbinder/config/checkers/archive_menu_checker.rb +35 -0
- data/lib/bookbinder/config/checkers/dita_section_checker.rb +24 -0
- data/lib/bookbinder/config/checkers/duplicate_section_name_checker.rb +29 -0
- data/lib/bookbinder/config/checkers/repository_name_presence_checker.rb +37 -0
- data/lib/bookbinder/config/checkers/required_keys_checker.rb +47 -0
- data/lib/bookbinder/config/configuration.rb +99 -0
- data/lib/bookbinder/config/fetcher.rb +61 -0
- data/lib/bookbinder/config/remote_yaml_credential_provider.rb +22 -0
- data/lib/bookbinder/config/validator.rb +30 -0
- data/lib/bookbinder/config/yaml_loader.rb +34 -0
- data/lib/bookbinder/ingest/git_cloner.rb +0 -1
- data/lib/bookbinder/ingest/local_filesystem_cloner.rb +22 -17
- data/lib/bookbinder/ingest/missing_working_copy.rb +21 -0
- data/lib/bookbinder/{repositories → ingest}/section_repository.rb +3 -4
- data/lib/bookbinder/{repositories → ingest}/section_repository_factory.rb +1 -1
- data/lib/bookbinder/ingest/working_copy.rb +12 -16
- data/lib/bookbinder/preprocessing/copy_to_site_gen_dir.rb +2 -3
- data/lib/bookbinder/preprocessing/dita_preprocessor.rb +5 -5
- data/lib/bookbinder/preprocessing/preprocessor.rb +1 -1
- data/lib/bookbinder/sheller.rb +3 -0
- data/lib/bookbinder/streams/colorized_stream.rb +1 -1
- data/lib/bookbinder/values/cf_routes.rb +17 -6
- data/lib/bookbinder/values/output_locations.rb +1 -12
- data/lib/bookbinder/values/section.rb +2 -7
- data/master_middleman/bookbinder_helpers.rb +23 -18
- data/master_middleman/quicklinks_renderer.rb +1 -0
- data/template_app/lib/rack_static.rb +2 -0
- data/template_app/lib/vienna_application.rb +2 -0
- metadata +51 -52
- data/lib/bookbinder.rb +0 -44
- data/lib/bookbinder/archive_menu_configuration.rb +0 -34
- data/lib/bookbinder/configuration.rb +0 -97
- data/lib/bookbinder/configuration_fetcher.rb +0 -59
- data/lib/bookbinder/configuration_validator.rb +0 -28
- data/lib/bookbinder/remote_yaml_credential_provider.rb +0 -20
- data/lib/bookbinder/shell_out.rb +0 -20
- data/lib/bookbinder/validation_checkers/archive_menu_checker.rb +0 -31
- data/lib/bookbinder/validation_checkers/dita_section_checker.rb +0 -20
- data/lib/bookbinder/validation_checkers/duplicate_section_name_checker.rb +0 -25
- data/lib/bookbinder/validation_checkers/repository_name_presence_checker.rb +0 -33
- data/lib/bookbinder/validation_checkers/required_keys_checker.rb +0 -43
- data/lib/bookbinder/yaml_loader.rb +0 -33
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: db0253fb2ff70df7454081ccad6222b3cd61ac6e
|
4
|
+
data.tar.gz: 12281076319eae008bad526b376bba7348007722
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 137791f967ff0fc2df6728d215ce6cd072f9a617e2461a05cc4e55c17affb2fbe932b147b40cd901cf89f891f8b7aa41b2de4ab005f60efa4d3d7de69b0eeb4a
|
7
|
+
data.tar.gz: 53af686a48cfc52f35b87a825aea6870f1cbe5da92e4e9a7e7b31624e5156e09193b83722fce212c48005a6986c190227371c919db394da92e99fe8d617649d8
|
data/install_bin/bookbinder
CHANGED
@@ -45,7 +45,7 @@ module Bookbinder
|
|
45
45
|
# Currently --no-routes is used to blow away all existing routes from a newly deployed app.
|
46
46
|
# The routes will then be recreated from the creds repo.
|
47
47
|
status = sheller.run_command(environment_variables,
|
48
|
-
"#{cf_binary_path} push #{deploy_target_app} --no-route -m 256M -i 3",
|
48
|
+
"#{cf_binary_path} push #{deploy_target_app} -s cflinuxfs2 --no-route -m 256M -i 3",
|
49
49
|
out: $stdout,
|
50
50
|
err: $stderr)
|
51
51
|
raise "Could not deploy app to #{deploy_target_app}" unless status.success?
|
data/lib/bookbinder/cli.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
require_relative '
|
2
|
-
require_relative 'command_validator'
|
1
|
+
require_relative 'colorizer'
|
3
2
|
require_relative 'command_runner'
|
3
|
+
require_relative 'command_validator'
|
4
|
+
require_relative 'commands/collection'
|
4
5
|
require_relative 'config/cf_credentials'
|
5
|
-
require_relative 'configuration'
|
6
|
-
require_relative 'colorizer'
|
6
|
+
require_relative 'config/configuration'
|
7
7
|
require_relative 'terminal'
|
8
8
|
|
9
9
|
module Bookbinder
|
@@ -16,7 +16,7 @@ module Bookbinder
|
|
16
16
|
command_name, *command_arguments = args
|
17
17
|
|
18
18
|
logger = DeprecatedLogger.new
|
19
|
-
commands =
|
19
|
+
commands = Commands::Collection.new(logger, version_control_system)
|
20
20
|
|
21
21
|
command_validator = CommandValidator.new(commands, commands.help.usage_message)
|
22
22
|
command_runner = CommandRunner.new(logger, commands)
|
@@ -12,29 +12,67 @@ module Bookbinder
|
|
12
12
|
@logger = logger
|
13
13
|
end
|
14
14
|
|
15
|
-
def get_snippet_and_language_at(marker,
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
15
|
+
def get_snippet_and_language_at(marker, working_copy)
|
16
|
+
snippet = Snippet.new(marker, working_copy)
|
17
|
+
if snippet.available? && !snippet.valid?
|
18
|
+
raise InvalidSnippet.new(working_copy.full_name, marker)
|
19
|
+
elsif snippet.available?
|
20
|
+
[snippet.content, snippet.language]
|
21
|
+
else
|
22
|
+
logger.log ' skipping (not found) '.magenta + working_copy.full_name
|
23
|
+
''
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
class Snippet
|
28
|
+
def initialize(marker, working_copy)
|
29
|
+
@marker = marker
|
30
|
+
@working_copy = working_copy
|
31
|
+
end
|
32
|
+
|
33
|
+
def available?
|
34
|
+
working_copy.available?
|
35
|
+
end
|
36
|
+
|
37
|
+
def valid?
|
38
|
+
! get_snippet(marker, working_copy).empty?
|
39
|
+
end
|
40
|
+
|
41
|
+
def language
|
42
|
+
lines = get_snippet(marker, working_copy).split("\n")
|
43
|
+
language_match = lines[0].match(/code_snippet #{Regexp.escape(marker)} start (\w+)/)
|
44
|
+
Array(language_match)[1]
|
45
|
+
end
|
46
|
+
|
47
|
+
def content
|
48
|
+
lines = get_snippet(marker, working_copy).split("\n")
|
49
|
+
lines[1..-2].join("\n")
|
50
|
+
end
|
51
|
+
|
52
|
+
private
|
53
|
+
|
54
|
+
attr_reader :marker, :working_copy
|
55
|
+
|
56
|
+
def get_snippet(marker, working_copy)
|
57
|
+
@snippet ||=
|
58
|
+
begin
|
59
|
+
snippet = ''
|
60
|
+
FileUtils.cd(working_copy.path) {
|
61
|
+
locale = 'LC_CTYPE=C LANG=C' # Quiets 'sed: RE error: illegal byte sequence'
|
62
|
+
result = `#{locale} find . -exec sed -ne '/code_snippet #{marker} start/,/code_snippet #{marker} end/ p' {} \\; 2> /dev/null`
|
63
|
+
snippet = if result.lines.last && result.lines.last.match(/code_snippet #{marker} end/)
|
64
|
+
result
|
65
|
+
else
|
66
|
+
""
|
67
|
+
end
|
68
|
+
}
|
69
|
+
snippet
|
70
|
+
end
|
71
|
+
end
|
33
72
|
end
|
34
73
|
|
35
74
|
private
|
36
75
|
|
37
76
|
attr_reader :logger
|
38
|
-
|
39
77
|
end
|
40
78
|
end
|
data/lib/bookbinder/colorizer.rb
CHANGED
@@ -3,8 +3,11 @@ require 'ostruct'
|
|
3
3
|
|
4
4
|
module Bookbinder
|
5
5
|
class Colorizer
|
6
|
-
Colors = OpenStruct.new(
|
7
|
-
|
6
|
+
Colors = OpenStruct.new(
|
7
|
+
green: ->(msg) { ANSI.green {msg} },
|
8
|
+
red: ->(msg) { ANSI.red {msg} },
|
9
|
+
yellow: ->(msg) { ANSI.yellow {msg} },
|
10
|
+
)
|
8
11
|
|
9
12
|
def colorize(string, color)
|
10
13
|
color.call string.to_s
|
@@ -1,9 +1,7 @@
|
|
1
1
|
require 'middleman-syntax'
|
2
2
|
|
3
|
-
require_relative '../archive_menu_configuration'
|
3
|
+
require_relative '../config/archive_menu_configuration'
|
4
4
|
require_relative '../errors/cli_error'
|
5
|
-
require_relative '../values/output_locations'
|
6
|
-
require_relative '../values/section'
|
7
5
|
require_relative 'bind/bind_options'
|
8
6
|
require_relative 'naming'
|
9
7
|
|
@@ -12,28 +10,24 @@ module Bookbinder
|
|
12
10
|
class Bind
|
13
11
|
include Commands::Naming
|
14
12
|
|
15
|
-
def initialize(
|
13
|
+
def initialize(base_streams,
|
14
|
+
output_locations,
|
16
15
|
config_factory,
|
17
16
|
archive_menu_config,
|
18
|
-
version_control_system,
|
19
17
|
file_system_accessor,
|
20
18
|
static_site_generator,
|
21
19
|
sitemap_writer,
|
22
|
-
final_app_directory,
|
23
|
-
context_dir,
|
24
20
|
preprocessor,
|
25
21
|
cloner_factory,
|
26
22
|
section_repository_factory,
|
27
23
|
directory_preparer)
|
28
|
-
@
|
24
|
+
@base_streams = base_streams
|
25
|
+
@output_locations = output_locations
|
29
26
|
@config_factory = config_factory
|
30
27
|
@archive_menu_config = archive_menu_config
|
31
|
-
@version_control_system = version_control_system
|
32
28
|
@file_system_accessor = file_system_accessor
|
33
29
|
@static_site_generator = static_site_generator
|
34
30
|
@sitemap_writer = sitemap_writer
|
35
|
-
@final_app_directory = final_app_directory
|
36
|
-
@context_dir = context_dir
|
37
31
|
@preprocessor = preprocessor
|
38
32
|
@cloner_factory = cloner_factory
|
39
33
|
@section_repository_factory = section_repository_factory
|
@@ -54,25 +48,21 @@ module Bookbinder
|
|
54
48
|
end
|
55
49
|
|
56
50
|
def run(cli_arguments)
|
57
|
-
bind_options = BindComponents::BindOptions.new(cli_arguments)
|
51
|
+
bind_options = BindComponents::BindOptions.new(cli_arguments, base_streams)
|
58
52
|
bind_options.validate!
|
59
53
|
|
60
54
|
bind_source, *options = cli_arguments
|
61
55
|
bind_config = config_factory.produce(bind_source)
|
62
56
|
|
63
|
-
|
64
|
-
|
65
|
-
final_app_dir: final_app_directory,
|
66
|
-
layout_repo_dir: layout_repo_path(bind_config, generate_local_repo_dir(context_dir, bind_source)),
|
67
|
-
local_repo_dir: generate_local_repo_dir(context_dir, bind_source)
|
68
|
-
)
|
69
|
-
cloner = cloner_factory.produce(output_locations.local_repo_dir)
|
57
|
+
local_repo_dir = generate_local_repo_dir(context_dir, bind_source)
|
58
|
+
cloner = cloner_factory.produce(local_repo_dir)
|
70
59
|
section_repository = section_repository_factory.produce(cloner)
|
71
60
|
|
72
61
|
directory_preparer.prepare_directories(
|
73
62
|
bind_config,
|
74
63
|
File.expand_path('../../../../', __FILE__),
|
75
|
-
output_locations
|
64
|
+
output_locations,
|
65
|
+
layout_repo_path(bind_config, cloner)
|
76
66
|
)
|
77
67
|
|
78
68
|
sections = section_repository.fetch(
|
@@ -87,8 +77,9 @@ module Bookbinder
|
|
87
77
|
output_streams: bind_options.streams)
|
88
78
|
|
89
79
|
success = publish(
|
90
|
-
sections.map(&:subnav).reduce(
|
80
|
+
sections.map(&:subnav).reduce({}, :merge),
|
91
81
|
{verbose: options.include?('--verbose')},
|
82
|
+
bind_options.streams,
|
92
83
|
output_locations,
|
93
84
|
archive_menu_config.generate(bind_config, sections),
|
94
85
|
cloner
|
@@ -99,21 +90,23 @@ module Bookbinder
|
|
99
90
|
|
100
91
|
private
|
101
92
|
|
102
|
-
attr_reader
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
93
|
+
attr_reader(
|
94
|
+
:archive_menu_config,
|
95
|
+
:base_streams,
|
96
|
+
:cloner_factory,
|
97
|
+
:config_factory,
|
98
|
+
:context_dir,
|
99
|
+
:directory_preparer,
|
100
|
+
:file_system_accessor,
|
101
|
+
:final_app_directory,
|
102
|
+
:output_locations,
|
103
|
+
:preprocessor,
|
104
|
+
:section_repository_factory,
|
105
|
+
:sitemap_writer,
|
106
|
+
:static_site_generator,
|
107
|
+
)
|
108
|
+
|
109
|
+
def publish(subnavs, cli_options, streams, output_locations, publish_config, cloner)
|
117
110
|
FileUtils.cp 'redirects.rb', output_locations.final_app_dir if File.exists?('redirects.rb')
|
118
111
|
|
119
112
|
host_for_sitemap = publish_config.public_host
|
@@ -128,7 +121,7 @@ module Bookbinder
|
|
128
121
|
|
129
122
|
result = generate_sitemap(host_for_sitemap)
|
130
123
|
|
131
|
-
|
124
|
+
streams[:success].puts "Bookbinder bound your book into #{output_locations.final_app_dir}"
|
132
125
|
|
133
126
|
!result.has_broken_links?
|
134
127
|
end
|
@@ -142,11 +135,8 @@ module Bookbinder
|
|
142
135
|
File.expand_path('..', context_dir) if bind_source == 'local'
|
143
136
|
end
|
144
137
|
|
145
|
-
def layout_repo_path(config,
|
146
|
-
if
|
147
|
-
File.join(local_repo_dir, config.layout_repo.split('/').last)
|
148
|
-
elsif config.has_option?('layout_repo')
|
149
|
-
cloner = cloner_factory.produce(nil)
|
138
|
+
def layout_repo_path(config, cloner)
|
139
|
+
if config.has_option?('layout_repo')
|
150
140
|
working_copy = cloner.call(source_repo_name: config.layout_repo,
|
151
141
|
destination_parent_dir: Dir.mktmpdir)
|
152
142
|
working_copy.path
|
@@ -5,8 +5,9 @@ module Bookbinder
|
|
5
5
|
module Commands
|
6
6
|
module BindComponents
|
7
7
|
class BindOptions
|
8
|
-
def initialize(opts)
|
8
|
+
def initialize(opts, base_streams)
|
9
9
|
@opts = opts
|
10
|
+
@base_streams = base_streams
|
10
11
|
end
|
11
12
|
|
12
13
|
def validate!
|
@@ -19,14 +20,15 @@ module Bookbinder
|
|
19
20
|
|
20
21
|
def streams
|
21
22
|
{
|
22
|
-
out: opts.include?('--verbose') ?
|
23
|
-
|
23
|
+
out: opts.include?('--verbose') ? base_streams[:out] : Sheller::DevNull.new,
|
24
|
+
success: Streams::ColorizedStream.new(Colorizer::Colors.green, base_streams[:out]),
|
25
|
+
err: Streams::ColorizedStream.new(Colorizer::Colors.red, base_streams[:err]),
|
24
26
|
}
|
25
27
|
end
|
26
28
|
|
27
29
|
private
|
28
30
|
|
29
|
-
attr_accessor :opts
|
31
|
+
attr_accessor :base_streams, :opts
|
30
32
|
|
31
33
|
def arguments_are_valid?
|
32
34
|
valid_options = %w(--verbose --ignore-section-refs --dita-flags).to_set
|
@@ -13,17 +13,16 @@ module Bookbinder
|
|
13
13
|
@version_control_system = version_control_system
|
14
14
|
end
|
15
15
|
|
16
|
-
def prepare_directories(config, gem_root,
|
17
|
-
|
18
|
-
file_system_accessor.remove_directory(
|
19
|
-
file_system_accessor.remove_directory(locations.preprocessing_home_dir)
|
16
|
+
def prepare_directories(config, gem_root, output_locations, layout_repo_dir)
|
17
|
+
file_system_accessor.remove_directory(output_locations.output_dir)
|
18
|
+
file_system_accessor.remove_directory(output_locations.final_app_dir)
|
20
19
|
|
21
|
-
copy_directory_from_gem(gem_root, 'template_app',
|
22
|
-
copy_directory_from_gem(gem_root, 'master_middleman',
|
23
|
-
file_system_accessor.
|
20
|
+
copy_directory_from_gem(gem_root, 'template_app', output_locations.final_app_dir)
|
21
|
+
copy_directory_from_gem(gem_root, 'master_middleman', output_locations.site_generator_home)
|
22
|
+
file_system_accessor.copy_contents(layout_repo_dir, output_locations.site_generator_home)
|
24
23
|
|
25
24
|
config.versions.each do |version|
|
26
|
-
copy_index_file_from_version_to_master_middleman(version,
|
25
|
+
copy_index_file_from_version_to_master_middleman(version, output_locations.source_for_site_generator, config.book_repo_url)
|
27
26
|
end
|
28
27
|
end
|
29
28
|
|
@@ -48,12 +47,8 @@ module Bookbinder
|
|
48
47
|
end
|
49
48
|
end
|
50
49
|
|
51
|
-
def forget_sections(middleman_scratch)
|
52
|
-
file_system_accessor.remove_directory File.join middleman_scratch, '.'
|
53
|
-
end
|
54
|
-
|
55
50
|
def copy_directory_from_gem(gem_root, dir, output_dir)
|
56
|
-
file_system_accessor.
|
51
|
+
file_system_accessor.copy_contents(File.join(gem_root, dir), output_dir)
|
57
52
|
end
|
58
53
|
end
|
59
54
|
end
|
@@ -4,27 +4,28 @@ end
|
|
4
4
|
|
5
5
|
require_relative '../commands/bind/directory_preparer'
|
6
6
|
require_relative '../config/bind_config_factory'
|
7
|
-
require_relative '../
|
8
|
-
require_relative '../
|
7
|
+
require_relative '../config/fetcher'
|
8
|
+
require_relative '../config/remote_yaml_credential_provider'
|
9
|
+
require_relative '../config/validator'
|
10
|
+
require_relative '../config/yaml_loader'
|
9
11
|
require_relative '../dita_command_creator'
|
10
12
|
require_relative '../dita_html_to_middleman_formatter'
|
11
13
|
require_relative '../html_document_manipulator'
|
12
14
|
require_relative '../ingest/cloner_factory'
|
15
|
+
require_relative '../ingest/section_repository_factory'
|
13
16
|
require_relative '../local_file_system_accessor'
|
14
17
|
require_relative '../middleman_runner'
|
15
18
|
require_relative '../post_production/sitemap_writer'
|
16
19
|
require_relative '../preprocessing/copy_to_site_gen_dir'
|
17
20
|
require_relative '../preprocessing/dita_preprocessor'
|
18
21
|
require_relative '../preprocessing/preprocessor'
|
19
|
-
require_relative '../remote_yaml_credential_provider'
|
20
22
|
require_relative '../sheller'
|
21
23
|
require_relative '../subnav_formatter'
|
22
|
-
require_relative '../
|
23
|
-
require_relative 'section_repository_factory'
|
24
|
+
require_relative '../values/output_locations'
|
24
25
|
|
25
26
|
module Bookbinder
|
26
|
-
module
|
27
|
-
class
|
27
|
+
module Commands
|
28
|
+
class Collection
|
28
29
|
include Enumerable
|
29
30
|
|
30
31
|
def initialize(logger, version_control_system)
|
@@ -74,21 +75,16 @@ module Bookbinder
|
|
74
75
|
|
75
76
|
def bind
|
76
77
|
@bind ||= Commands::Bind.new(
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
config_filename: 'bookbinder.yml'
|
82
|
-
),
|
83
|
-
version_control_system,
|
78
|
+
{out: $stdout, err: $stderr},
|
79
|
+
OutputLocations.new(final_app_dir: final_app_directory, context_dir: File.absolute_path('.')),
|
80
|
+
Config::BindConfigFactory.new(version_control_system, configuration_fetcher),
|
81
|
+
Config::ArchiveMenuConfiguration.new(loader: config_loader, config_filename: 'bookbinder.yml'),
|
84
82
|
local_file_system_accessor,
|
85
|
-
|
83
|
+
MiddlemanRunner.new(logger, version_control_system),
|
86
84
|
PostProduction::SitemapWriter.build(logger, final_app_directory, sitemap_port),
|
87
|
-
final_app_directory,
|
88
|
-
File.absolute_path('.'),
|
89
85
|
Preprocessing::Preprocessor.new(
|
90
86
|
Preprocessing::DitaPreprocessor.new(
|
91
|
-
|
87
|
+
DitaHtmlToMiddlemanFormatter.new(local_file_system_accessor, subnav_formatter, html_document_manipulator),
|
92
88
|
local_file_system_accessor,
|
93
89
|
DitaCommandCreator.new(ENV['PATH_TO_DITA_OT_LIBRARY']),
|
94
90
|
Sheller.new
|
@@ -96,7 +92,7 @@ module Bookbinder
|
|
96
92
|
Preprocessing::CopyToSiteGenDir.new(local_file_system_accessor),
|
97
93
|
),
|
98
94
|
Ingest::ClonerFactory.new(logger, local_file_system_accessor, version_control_system),
|
99
|
-
|
95
|
+
Ingest::SectionRepositoryFactory.new(logger),
|
100
96
|
Commands::BindComponents::DirectoryPreparer.new(logger, local_file_system_accessor, version_control_system)
|
101
97
|
)
|
102
98
|
end
|
@@ -116,35 +112,25 @@ module Bookbinder
|
|
116
112
|
)
|
117
113
|
end
|
118
114
|
|
119
|
-
def middleman_runner
|
120
|
-
@middleman_runner ||= MiddlemanRunner.new(logger, version_control_system)
|
121
|
-
end
|
122
|
-
|
123
115
|
def configuration_fetcher
|
124
|
-
@configuration_fetcher ||=
|
116
|
+
@configuration_fetcher ||= Config::Fetcher.new(
|
125
117
|
logger,
|
126
|
-
|
118
|
+
Config::Validator.new(logger, local_file_system_accessor),
|
127
119
|
config_loader,
|
128
|
-
RemoteYamlCredentialProvider.new(logger, version_control_system)
|
120
|
+
Config::RemoteYamlCredentialProvider.new(logger, version_control_system)
|
129
121
|
).tap do |fetcher|
|
130
122
|
fetcher.set_config_file_path './config.yml'
|
131
123
|
end
|
132
124
|
end
|
133
125
|
|
134
126
|
def config_loader
|
135
|
-
@config_loader ||= YAMLLoader.new
|
127
|
+
@config_loader ||= Config::YAMLLoader.new
|
136
128
|
end
|
137
129
|
|
138
130
|
def final_app_directory
|
139
131
|
@final_app_directory ||= File.absolute_path('final_app')
|
140
132
|
end
|
141
133
|
|
142
|
-
def dita_html_to_middleman_formatter
|
143
|
-
@dita_html_to_middleman_formatter ||= DitaHtmlToMiddlemanFormatter.new(local_file_system_accessor,
|
144
|
-
subnav_formatter,
|
145
|
-
html_document_manipulator)
|
146
|
-
end
|
147
|
-
|
148
134
|
def subnav_formatter
|
149
135
|
@subnav_formatter ||= SubnavFormatter.new
|
150
136
|
end
|
@@ -157,10 +143,6 @@ module Bookbinder
|
|
157
143
|
@local_file_system_accessor ||= LocalFileSystemAccessor.new
|
158
144
|
end
|
159
145
|
|
160
|
-
def bind_config_factory
|
161
|
-
@bind_config_factory ||= Config::BindConfigFactory.new(version_control_system, configuration_fetcher)
|
162
|
-
end
|
163
|
-
|
164
146
|
def sitemap_port
|
165
147
|
41722
|
166
148
|
end
|