liquidoc 0.9.2 → 0.9.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/liquidoc/version.rb +1 -1
- data/lib/liquidoc.rb +22 -7
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a5ca3ecd0b1c24dfa6231479baec2d113e3c6a6255392416ab75d54918f51f3b
|
4
|
+
data.tar.gz: 3abde9ab8883e38c7484782afbb7c8a0bf683c45ca05e0ecc5ad62784fb3a52e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 07b617083d1467b3d485b341d0192026fce6db31632ac4fc123c8827b39202cfa9968a1e599ff07fa115c5f4878b7e105ed11586271d1d3ce1ebc88a5ee09647
|
7
|
+
data.tar.gz: b25ec34f7f2e843e0fabbf5a572f133399e0716c56fe2c2c9e5ddeff93c318645552b6adcd0a4335bd5ebd0693091050b862b0e502fd8bc34442b32a1dd61946
|
data/lib/liquidoc/version.rb
CHANGED
data/lib/liquidoc.rb
CHANGED
@@ -73,22 +73,24 @@ FileUtils::mkdir_p("#{@build_dir}/pre") unless File.exists?("#{@build_dir}/pre")
|
|
73
73
|
# Establish source, template, index, etc details for build jobs from a config file
|
74
74
|
def config_build config_file, config_vars={}, parse=false
|
75
75
|
@logger.debug "Using config file #{config_file}."
|
76
|
-
|
76
|
+
validate_file_input(config_file, "config")
|
77
|
+
if config_vars.length > 0 or parse or contains_liquid(config_file)
|
78
|
+
@logger.debug "Config_vars: #{config_vars.length}"
|
77
79
|
# If config variables are passed on the CLI, we want to parse the config file
|
78
80
|
# and use the parsed version for the rest fo this routine
|
79
81
|
config_out = "#{@build_dir}/pre/#{File.basename(config_file)}"
|
80
82
|
liquify(nil,config_file, config_out, config_vars)
|
81
83
|
config_file = config_out
|
82
84
|
@logger.debug "Config parsed! Using #{config_out} for build."
|
85
|
+
validate_file_input(config_file, "config")
|
83
86
|
end
|
84
|
-
validate_file_input(config_file, "config")
|
85
87
|
begin
|
86
88
|
config = YAML.load_file(config_file)
|
87
|
-
rescue
|
89
|
+
rescue Exception => ex
|
88
90
|
unless File.exists?(config_file)
|
89
91
|
@logger.error "Config file #{config_file} not found."
|
90
92
|
else
|
91
|
-
@logger.error "Problem loading config file #{config_file}. Exiting."
|
93
|
+
@logger.error "Problem loading config file #{config_file}. #{ex} Exiting."
|
92
94
|
end
|
93
95
|
raise "ConfigFileError"
|
94
96
|
end
|
@@ -176,6 +178,16 @@ def validate_config_structure config
|
|
176
178
|
# TODO More validation needed
|
177
179
|
end
|
178
180
|
|
181
|
+
def contains_liquid filename
|
182
|
+
File.open(filename, "r") do |file_proc|
|
183
|
+
file_proc.each_line do |row|
|
184
|
+
if row.match(/.*\{\%.*\%\}.*|.*\{\{.*\}\}.*/)
|
185
|
+
return true
|
186
|
+
end
|
187
|
+
end
|
188
|
+
end
|
189
|
+
end
|
190
|
+
|
179
191
|
def explainer_init out=nil
|
180
192
|
unless @explainer
|
181
193
|
if out == "STDOUT"
|
@@ -931,12 +943,15 @@ def generate_site doc, build
|
|
931
943
|
File.open("#{@build_dir}/pre/_attributes.yml", 'w') { |file| file.write(attrs_yaml) }
|
932
944
|
build.add_config_file("#{@build_dir}/pre/_attributes.yml")
|
933
945
|
config_list = build.prop_files_array.join(',') # flatten the Array back down for the CLI
|
934
|
-
opts_args = ""
|
935
946
|
quiet = "--quiet" if @quiet || @explicit
|
936
947
|
if build.props['arguments']
|
937
|
-
|
948
|
+
opts_args_file = "#{@build_dir}/pre/jekyll_opts_args.yml"
|
949
|
+
opts_args = build.props['arguments']
|
950
|
+
File.open(opts_args_file, 'w') { |file|
|
951
|
+
file.write(opts_args.to_yaml)}
|
952
|
+
config_list << ",#{opts_args_file}"
|
938
953
|
end
|
939
|
-
base_args = "--config #{config_list}
|
954
|
+
base_args = "--config #{config_list}"
|
940
955
|
command = "bundle exec jekyll build #{base_args} #{quiet}"
|
941
956
|
if @search_index
|
942
957
|
# TODO enable config-based admin api key ingest once config is dynamic
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: liquidoc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Dominick
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-09-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|