dimples 1.7.2 → 1.8
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 +9 -20
- data/lib/dimples/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 896e53a1c3f71e3adc14108af56ee5f74032b120
|
4
|
+
data.tar.gz: e452c4803536be878aacb411964a21f4fed2aa42
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bbf5cfed0406718d7a15e17d6c5682662f50b6644433ff57358ad4e6b1c787ed32830ed387bbf8db88937f08435d5a76f601a13c32183d38af69fb1ac2f859f7
|
7
|
+
data.tar.gz: ee1fd0b316f3052e6705aad14846db9a7fa335582db7a259da2b2d5e6025b3456480d0f4f0862b38f4635d435ebd65dbcd8d86a9f575ae723554202664a9fb40
|
data/lib/dimples/site.rb
CHANGED
@@ -28,7 +28,6 @@ module Dimples
|
|
28
28
|
@post_class = Dimples::Post
|
29
29
|
|
30
30
|
@config = Dimples::Configuration.new(config)
|
31
|
-
@generation_options = default_generation_options
|
32
31
|
|
33
32
|
@source_paths[:root] = File.expand_path(@config['source_path'])
|
34
33
|
@output_paths[:site] = File.expand_path(@config['destination_path'])
|
@@ -43,20 +42,18 @@ module Dimples
|
|
43
42
|
end
|
44
43
|
end
|
45
44
|
|
46
|
-
def generate
|
47
|
-
@generation_options.merge!(options)
|
45
|
+
def generate
|
48
46
|
|
49
47
|
prepare_site
|
50
48
|
scan_files
|
51
49
|
generate_files
|
52
50
|
copy_assets
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
# puts "Error: #{e.backtrace}"
|
51
|
+
rescue Errors::RenderingError => e
|
52
|
+
puts "Error: Failed to render #{e.file}: #{e.message}"
|
53
|
+
rescue Errors::PublishingError => e
|
54
|
+
puts "Error: Failed to publish #{e.file}: #{e.message}"
|
55
|
+
rescue => e
|
56
|
+
puts "Error: #{e.backtrace}"
|
60
57
|
end
|
61
58
|
|
62
59
|
def prepare_site
|
@@ -94,10 +91,10 @@ module Dimples
|
|
94
91
|
def scan_posts
|
95
92
|
Dir.glob(File.join(@source_paths[:posts], '*.*')).reverse_each do |path|
|
96
93
|
post = @post_class.new(self, path)
|
97
|
-
next if !@generation_options[:include_drafts] && post.draft
|
98
|
-
|
99
94
|
prepare_post(post)
|
100
95
|
|
96
|
+
next if post.draft
|
97
|
+
|
101
98
|
post.categories.each do |slug|
|
102
99
|
(@categories[slug] ||= []) << post
|
103
100
|
end
|
@@ -310,13 +307,5 @@ module Dimples
|
|
310
307
|
|
311
308
|
pagination
|
312
309
|
end
|
313
|
-
|
314
|
-
private
|
315
|
-
|
316
|
-
def default_generation_options
|
317
|
-
{
|
318
|
-
include_drafts: false
|
319
|
-
}
|
320
|
-
end
|
321
310
|
end
|
322
311
|
end
|
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: 1.
|
4
|
+
version: '1.8'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Bogan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tilt
|