dimples 1.8.1 → 1.9
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/lib/dimples/errors.rb +1 -1
- data/lib/dimples/page.rb +1 -1
- data/lib/dimples/post.rb +1 -2
- data/lib/dimples/site.rb +4 -4
- data/lib/dimples/version.rb +1 -1
- data/lib/dimples/writeable.rb +3 -5
- 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: 91622aefd39dfbf4c501d92c2490e0ce4700b272
|
4
|
+
data.tar.gz: 548798a3bb1ad1421ab7948f95825757ecc1b60b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f9c201f2e4528ded44632b3a974d893535c1608becdd1980c2ab46c47b1c20dcfb40c6d4da0c813ce4672b066397aa01821fd4caf7daf692b4b648e64115b048
|
7
|
+
data.tar.gz: 562ff2f2e402a00f63772220f6a180d255421ae5aa3818f11a4a389ef38fb39359ed32641706403981a3dbf031be0101fbec6b7c9493fa695fe1f525369ddb85
|
data/lib/dimples/errors.rb
CHANGED
data/lib/dimples/page.rb
CHANGED
data/lib/dimples/post.rb
CHANGED
@@ -47,8 +47,7 @@ module Dimples
|
|
47
47
|
@contents = read_with_yaml(path)
|
48
48
|
end
|
49
49
|
|
50
|
-
|
51
|
-
def output_file_path(parent_path)
|
50
|
+
def output_path(parent_path)
|
52
51
|
parent_path = @date.strftime(parent_path) if parent_path =~ /%/
|
53
52
|
File.join([parent_path, @slug, "#{@filename}.#{@extension}"])
|
54
53
|
end
|
data/lib/dimples/site.rb
CHANGED
@@ -161,7 +161,7 @@ module Dimples
|
|
161
161
|
end
|
162
162
|
|
163
163
|
def generate_post(post)
|
164
|
-
post.write(@output_paths[:posts])
|
164
|
+
post.write(post.output_path(@output_paths[:posts]))
|
165
165
|
end
|
166
166
|
|
167
167
|
def generate_pages
|
@@ -171,7 +171,7 @@ module Dimples
|
|
171
171
|
end
|
172
172
|
|
173
173
|
def generate_page(page)
|
174
|
-
page.write(@output_paths[:site])
|
174
|
+
page.write(page.output_path(@output_paths[:site]))
|
175
175
|
end
|
176
176
|
|
177
177
|
def generate_categories
|
@@ -221,7 +221,7 @@ module Dimples
|
|
221
221
|
feed.extension = 'atom'
|
222
222
|
feed.layout = 'feed'
|
223
223
|
|
224
|
-
feed.write(path, options)
|
224
|
+
feed.write(feed.output_path(path), options)
|
225
225
|
end
|
226
226
|
|
227
227
|
def generate_posts_feed
|
@@ -268,7 +268,7 @@ module Dimples
|
|
268
268
|
context[:posts] = posts.slice((index - 1) * per_page, per_page)
|
269
269
|
context[:pagination] = pagination
|
270
270
|
|
271
|
-
page.write(output_path, context)
|
271
|
+
page.write(page.output_path(output_path), context)
|
272
272
|
end
|
273
273
|
end
|
274
274
|
|
data/lib/dimples/version.rb
CHANGED
data/lib/dimples/writeable.rb
CHANGED
@@ -2,18 +2,16 @@ module Dimples
|
|
2
2
|
module Writeable
|
3
3
|
def write(path, context = {})
|
4
4
|
output = context ? render(context) : contents
|
5
|
-
|
6
|
-
publish_path = output_file_path(path)
|
7
|
-
parent_path = File.dirname(publish_path)
|
5
|
+
parent_path = File.dirname(path)
|
8
6
|
|
9
7
|
begin
|
10
8
|
FileUtils.mkdir_p(parent_path) unless Dir.exist?(parent_path)
|
11
9
|
|
12
|
-
File.open(
|
10
|
+
File.open(path, 'w+') do |file|
|
13
11
|
file.write(output)
|
14
12
|
end
|
15
13
|
rescue SystemCallError => e
|
16
|
-
raise Errors::PublishingError.new(
|
14
|
+
raise Errors::PublishingError.new(path, e.message)
|
17
15
|
end
|
18
16
|
end
|
19
17
|
end
|
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.9'
|
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-
|
11
|
+
date: 2016-11-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tilt
|