vizbuilder 1.0.5 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/vizbuilder.rb +13 -19
- 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: d6197eeb10fd826f8e6947e1c6ba0b6df754e6274caca5985456c76e234989a8
|
4
|
+
data.tar.gz: fa6b2b0014b2486b7dbd7d9e04d2ad255d9762fc3a6115a83843844351b7e8d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cbb4912215b85cdd543ddbf64ab75c0c4628d429635077dc692c820b979e84f220dc24f319316eb0ba4726aef09c895eeaadedf9294dc3aa18f901b7a7146e2d
|
7
|
+
data.tar.gz: 1ae34bc33bcf5547d8feab61b50fc6016fcb6740526347fad5026d618d34d9f8da5d1aab93295b1d39674835c1d289bd277a4bf200fbc9b7f316413adb59c6b4
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.6
|
data/lib/vizbuilder.rb
CHANGED
@@ -411,34 +411,28 @@ class VizBuilder
|
|
411
411
|
out_fname = File.join(BUILD_DIR, path)
|
412
412
|
puts "Rendering #{out_fname}..." unless silent
|
413
413
|
|
414
|
-
# Check if we have a layout defined, use it
|
415
|
-
layout = ctx.page['layout'] || config['layout'] || nil
|
416
|
-
|
417
414
|
# Check page data for info on how to build this path
|
418
415
|
if ctx.page['template'].present?
|
416
|
+
# Check if we have a layout defined, use it
|
417
|
+
layout = ctx.page.key?('layout') ? ctx.page['layout'] : config['layout']
|
418
|
+
|
419
419
|
# Make sure to render the template inside the layout render so code in the
|
420
420
|
# erb layout and template are executed in a sensible order.
|
421
|
-
content =
|
421
|
+
content =
|
422
422
|
if layout.present?
|
423
423
|
ctx.render(layout) { ctx.render(ctx.page['template']) }
|
424
424
|
else
|
425
425
|
ctx.render(ctx.page['template'])
|
426
426
|
end
|
427
|
+
elsif ctx.page['json'].present?
|
428
|
+
content = ctx.page['json'].to_json
|
429
|
+
elsif ctx.page['file'].present?
|
430
|
+
content = File.read(ctx.page['file'])
|
427
431
|
else
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
elsif ctx.page['file'].present?
|
433
|
-
content = File.read(ctx.page['file'])
|
434
|
-
else
|
435
|
-
raise(
|
436
|
-
ArgumentError,
|
437
|
-
"Page '#{path}' missing one of required attributes: 'template', 'json', 'file'."
|
438
|
-
)
|
439
|
-
end
|
440
|
-
|
441
|
-
content = ctx.render(layout) { content } if layout.present?
|
432
|
+
raise(
|
433
|
+
ArgumentError,
|
434
|
+
"Page '#{path}' missing one of required attributes: 'template', 'json', 'file'."
|
435
|
+
)
|
442
436
|
end
|
443
437
|
|
444
438
|
# If page data includes a digest flag, add sha1 digest to output filename
|
@@ -466,7 +460,7 @@ class VizBuilder
|
|
466
460
|
Dir.glob("#{DATA_DIR}/*#{ext}") do |fname|
|
467
461
|
key = File.basename(fname, ext).to_sym
|
468
462
|
puts "Loading data[:#{key}] from #{fname}..."
|
469
|
-
data[key] =
|
463
|
+
data[key] =
|
470
464
|
if ext == '.json'
|
471
465
|
JSON.parse(File.read(fname))
|
472
466
|
else
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vizbuilder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Mark
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-06-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|