dimples 8.0.0 → 9.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dimples/site.rb +4 -4
- 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: ca018b45bc347dc68c099d77fe18cba848f878c9c79dd4cd094b7a84db01cb37
|
4
|
+
data.tar.gz: 10e92c94c701b63a2d2d1c4c66087605b29b82f37d6f6bf99f5a5cf8f0b7ccf5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29f96b52b84bcbc10cf7d46779573d87fb7ea6918d4767c0686e1eb98e079cfee9bae15859b793421375eb898e36eaadbc081814a82c87c9f948c1e5b0ab6cb8
|
7
|
+
data.tar.gz: 730b91d62a8b121b0a43ba5d3e1183600381335195dc49934414dc06f3df75ffe1be458e960cc9e756259160f6a39dc34b3ca34a62e84983365769c4b1e0ed6e
|
data/lib/dimples/site.rb
CHANGED
@@ -8,7 +8,7 @@ require "date"
|
|
8
8
|
|
9
9
|
module Dimples
|
10
10
|
class Site
|
11
|
-
DEFAULT_CONFIG = { overwrite_directory: false }
|
11
|
+
DEFAULT_CONFIG = { generation: { overwrite_directory: false }, paths: { posts: "posts" } }
|
12
12
|
|
13
13
|
def self.generate(source_path, output_path, config)
|
14
14
|
new(source_path, output_path, config).generate
|
@@ -36,8 +36,8 @@ module Dimples
|
|
36
36
|
|
37
37
|
def generate
|
38
38
|
if Dir.exist?(@paths[:destination])
|
39
|
-
unless @config
|
40
|
-
raise GenerationError.new("The
|
39
|
+
unless @config.dig(:generation, :overwrite_directory)
|
40
|
+
raise GenerationError.new("The site directory (#{@paths[:destination]}) already exists.")
|
41
41
|
end
|
42
42
|
|
43
43
|
FileUtils.rm_rf(@paths[:destination])
|
@@ -114,7 +114,7 @@ module Dimples
|
|
114
114
|
end
|
115
115
|
|
116
116
|
def generate_posts
|
117
|
-
directory_path = File.join(@paths[:destination], @config.dig(:paths, :posts)
|
117
|
+
directory_path = File.join(@paths[:destination], @config.dig(:paths, :posts))
|
118
118
|
Dir.mkdir(directory_path)
|
119
119
|
|
120
120
|
@posts.each do |post|
|
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:
|
4
|
+
version: 9.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Bogan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-09-
|
11
|
+
date: 2023-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: erubi
|