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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ff527afec83a07a6c7a0cf60e1e85c52da03c977
4
- data.tar.gz: ae40553868620bafb2476aa8fcdff3b3fbba4502
3
+ metadata.gz: 91622aefd39dfbf4c501d92c2490e0ce4700b272
4
+ data.tar.gz: 548798a3bb1ad1421ab7948f95825757ecc1b60b
5
5
  SHA512:
6
- metadata.gz: a70b96fb34b3b819677ef000673344ad723e6b87876a8b1a44b053662d57a1587fb04c0204343bc119d3a4d9d22c88c0a404bf7be420297d79c9fd6bc0711eaf
7
- data.tar.gz: cda42a1a828f241ba69d14dc139d78aad9fb38692f23cab66e3a481a3216f82a4946c77737629901256b1f3111ec17ff19ab671eef7c8ff7a7839c8c9da01532
6
+ metadata.gz: f9c201f2e4528ded44632b3a974d893535c1608becdd1980c2ab46c47b1c20dcfb40c6d4da0c813ce4672b066397aa01821fd4caf7daf692b4b648e64115b048
7
+ data.tar.gz: 562ff2f2e402a00f63772220f6a180d255421ae5aa3818f11a4a389ef38fb39359ed32641706403981a3dbf031be0101fbec6b7c9493fa695fe1f525369ddb85
@@ -1,6 +1,6 @@
1
1
  module Dimples
2
2
  module Errors
3
- class Error < RuntimeError
3
+ class Error < StandardError
4
4
  attr_reader :file
5
5
 
6
6
  def initialize(file, message)
data/lib/dimples/page.rb CHANGED
@@ -27,7 +27,7 @@ module Dimples
27
27
  end
28
28
  end
29
29
 
30
- def output_file_path(parent_path)
30
+ def output_path(parent_path)
31
31
  parts = [parent_path]
32
32
 
33
33
  unless @path.nil?
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
 
@@ -1,3 +1,3 @@
1
1
  module Dimples
2
- VERSION = '1.8.1'.freeze
2
+ VERSION = '1.9'.freeze
3
3
  end
@@ -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(publish_path, 'w+') do |file|
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(publish_path, e.message)
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.8.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-07-04 00:00:00.000000000 Z
11
+ date: 2016-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tilt