dimples 6.5.1 → 6.5.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/bin/dimples +10 -11
- data/lib/dimples/renderer.rb +7 -1
- data/lib/dimples/version.rb +1 -1
- 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: 9a6f8617d58941c5af9745c1bd0ceaf12ecaaafc7bd4e79e2b1b2f40f5b0bd0c
|
|
4
|
+
data.tar.gz: db3408502d32f1404de50d050a2cec1d055b505ad2f4195fb00ef60500cd4f75
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3a48b54049b77629a6996ac98d850a02d6a780e13ef2b6a93a380f712dbb423153a0cad78b05a9c4abc3da2fa2ad6dae1f384dd40b36670c97d9e0eace8a16cb
|
|
7
|
+
data.tar.gz: 1f197dc175792163a2bda5ecfcf4b359fbf28412dacfe53fa1f3c0f73174867744fc9b65137656a0ba62e19769b63e055cc8aed8bf6baf2707485f08346390cb
|
data/bin/dimples
CHANGED
|
@@ -29,7 +29,6 @@ Options:
|
|
|
29
29
|
opt :config, 'Config file path', type: :string
|
|
30
30
|
opt :source, 'Source directory', type: :string
|
|
31
31
|
opt :destination, 'Destination directory', type: :string
|
|
32
|
-
opt :verbose, 'Verbose mode', default: false
|
|
33
32
|
end
|
|
34
33
|
|
|
35
34
|
Optimist.educate if ARGV.empty?
|
|
@@ -47,19 +46,19 @@ source_path = if options[:source]
|
|
|
47
46
|
|
|
48
47
|
config_path = options[:config] || File.join(source_path, 'config.json')
|
|
49
48
|
|
|
50
|
-
|
|
51
|
-
begin
|
|
52
|
-
file_contents = File.read(config_path)
|
|
53
|
-
Optimist.die "Config file is empty (#{config_path})" if file_contents.empty?
|
|
54
|
-
|
|
55
|
-
config = JSON.parse(file_contents, symbolize_names: true)
|
|
56
|
-
rescue JSON::ParserError
|
|
57
|
-
Optimist.die "Invalid or malformed config file (#{config_path})"
|
|
58
|
-
end
|
|
59
|
-
else
|
|
49
|
+
unless File.exist?(config_path)
|
|
60
50
|
Optimist.die "Unable to find config file (#{config_path})"
|
|
61
51
|
end
|
|
62
52
|
|
|
53
|
+
begin
|
|
54
|
+
file_contents = File.read(config_path)
|
|
55
|
+
Optimist.die "Config file is empty (#{config_path})" if file_contents.empty?
|
|
56
|
+
|
|
57
|
+
config = JSON.parse(file_contents, symbolize_names: true)
|
|
58
|
+
rescue JSON::ParserError
|
|
59
|
+
Optimist.die "Invalid or malformed config file (#{config_path})"
|
|
60
|
+
end
|
|
61
|
+
|
|
63
62
|
config[:source] = source_path
|
|
64
63
|
|
|
65
64
|
if options[:destination]
|
data/lib/dimples/renderer.rb
CHANGED
|
@@ -12,7 +12,13 @@ module Dimples
|
|
|
12
12
|
context[:site] ||= @site
|
|
13
13
|
context[:pagination] ||= nil
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
begin
|
|
16
|
+
output = engine.render(scope, context) { body }.strip
|
|
17
|
+
rescue StandardError => e
|
|
18
|
+
raise RenderingError,
|
|
19
|
+
"Unable to render #{@source.path || 'dynamic file'} (#{e})"
|
|
20
|
+
end
|
|
21
|
+
|
|
16
22
|
@source.metadata[:rendered_contents] = output
|
|
17
23
|
|
|
18
24
|
if @source.metadata[:layout]
|
data/lib/dimples/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dimples
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 6.5.
|
|
4
|
+
version: 6.5.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Daniel Bogan
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-
|
|
11
|
+
date: 2019-09-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: hashie
|