dimples 1.2 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d4908e2152e8b62a29f3fdc22f75a3e5d6bc5f19
4
- data.tar.gz: 0561a17cd5b12638bd61ae94af722cbc2b198706
3
+ metadata.gz: 6744f1532ff98a72c8223b34b3a8854fcae1eaf3
4
+ data.tar.gz: 599b462adcd549c6b9f6a1e8b6c8d9d7232c4345
5
5
  SHA512:
6
- metadata.gz: fb93e7a063f1ece6224877251b9b132e5ef349221b81a42bceae3642b2c9ac612301976979aa88ebeb00416d54d80191fada37df313cf70b4dfa383ceb08adec
7
- data.tar.gz: f385a6d339a48e1ef2d63598111d39ce3ae737a7bbd87f5a00c371422326ccc60775cb89ec7f60d372cc986eafcca1e0a089598b922ebeee6840c035dfdfc692
6
+ metadata.gz: 04342d92fbe4f2afc843eec7ed660d1c396ad546afe51e33811b645a540fd07a0661531a02eec2fcdaeebf75b19e0ae38a4401a01676d3ff675b0843444ef3f6
7
+ data.tar.gz: 81c07fd8de2e2eda0b66fd953eb8bd0d1129872a3b9ecbf9c507d13a2e197ffa9da89fb4ff79146c32eae22d6771fe67614be90dce178ed292c0ef2db958b7ba
@@ -16,10 +16,8 @@ module Dimples
16
16
 
17
17
  if metadata
18
18
  metadata.each_pair do |key, value|
19
- unless instance_variable_get("@#{key}")
20
- self.class.send(:attr_accessor, key.to_sym)
21
- instance_variable_set("@#{key}", value)
22
- end
19
+ self.class.send(:attr_accessor, key.to_sym) unless instance_variable_get("@#{key}")
20
+ instance_variable_set("@#{key}", value)
23
21
  end
24
22
  end
25
23
 
data/lib/dimples/page.rb CHANGED
@@ -15,16 +15,15 @@ module Dimples
15
15
 
16
16
  def initialize(site, path = nil)
17
17
  @site = site
18
-
18
+ @extension = @site.config['file_extensions']['pages']
19
+
19
20
  if path
20
21
  @path = path
21
- @contents = read_with_yaml(path)
22
22
  @filename = File.basename(path, File.extname(path))
23
+ @contents = read_with_yaml(path)
23
24
  else
24
25
  @filename = 'index'
25
26
  end
26
-
27
- @extension = @site.config['file_extensions']['pages']
28
27
  end
29
28
 
30
29
  def contents
data/lib/dimples/post.rb CHANGED
@@ -21,9 +21,7 @@ module Dimples
21
21
 
22
22
  def initialize(site, path)
23
23
  @site = site
24
-
25
24
  @path = path
26
- @contents = read_with_yaml(path)
27
25
 
28
26
  @filename = 'index'
29
27
  @extension = @site.config['file_extensions']['posts']
@@ -33,12 +31,14 @@ module Dimples
33
31
  @slug = parts[4]
34
32
  @date = Time.mktime(parts[1], parts[2], parts[3])
35
33
 
36
- @layout ||= @site.config['layouts']['post']
37
- @categories ||= []
34
+ @layout = @site.config['layouts']['post']
35
+ @categories = []
38
36
 
39
37
  @year = @date.strftime('%Y')
40
38
  @month = @date.strftime('%m')
41
39
  @day = @date.strftime('%d')
40
+
41
+ @contents = read_with_yaml(path)
42
42
  end
43
43
 
44
44
  def contents
@@ -1,7 +1,7 @@
1
1
  module Dimples
2
2
  module Publishable
3
3
  def write(path, context = {})
4
- output = render(context)
4
+ output = context ? render(context) : contents()
5
5
 
6
6
  publish_path = output_file_path(path)
7
7
  parent_path = File.dirname(publish_path)
@@ -1,3 +1,3 @@
1
1
  module Dimples
2
- VERSION = "1.2"
2
+ VERSION = "1.2.1"
3
3
  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.2'
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Bogan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-08 00:00:00.000000000 Z
11
+ date: 2015-03-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tilt