bookbindery 3.1.0 → 3.1.2
Sign up to get free protection for your applications and to get access to all the features.
- 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
@@ -1,33 +0,0 @@
|
|
1
|
-
require 'yaml'
|
2
|
-
|
3
|
-
module Bookbinder
|
4
|
-
FileNotFoundError = Class.new(RuntimeError)
|
5
|
-
InvalidSyntaxError = Class.new(RuntimeError)
|
6
|
-
|
7
|
-
class YAMLLoader
|
8
|
-
def load(path)
|
9
|
-
if File.exist?(path)
|
10
|
-
config(path)
|
11
|
-
else
|
12
|
-
raise FileNotFoundError.new, "YAML"
|
13
|
-
end
|
14
|
-
rescue Psych::SyntaxError => e
|
15
|
-
raise InvalidSyntaxError.new e
|
16
|
-
end
|
17
|
-
|
18
|
-
def load_key(path, key)
|
19
|
-
if File.exist?(path)
|
20
|
-
config(path)[key]
|
21
|
-
end
|
22
|
-
rescue Psych::SyntaxError => e
|
23
|
-
raise InvalidSyntaxError.new e
|
24
|
-
end
|
25
|
-
|
26
|
-
private
|
27
|
-
|
28
|
-
def config(path)
|
29
|
-
YAML.load_file(path) || {}
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|