nanoc-conref-fs 0.3.1 → 0.4.0

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: 3b07a695903733da2e3cfe4002b57b013230b34c
4
- data.tar.gz: 23cb84fe8bb0bd5e83d3e1e3b590a1066691b842
3
+ metadata.gz: efc00c8750bea1d8d022e9cc8213c23509a7f646
4
+ data.tar.gz: 81375784222ae8ff49971ffdfebba7b033b692d0
5
5
  SHA512:
6
- metadata.gz: 43f5e209407425ce90419e4ead6d918652496b1f34add52be997e77b86b88af0d64ae865f0d7c6654723058def88a551f0a76edf8daad67357782bb199eebccf
7
- data.tar.gz: 77039bc41c38db0b76c60655837651fe4e141fda8354c47c6197515d278cb11d0d2d18e9fb13f4c1644fa51e98d18039edaa50952e8852df37c3075487123264
6
+ metadata.gz: e5589891dd82aa7715641a656ee3a115d9fb7b5f4968f25ca53ed6a5e7c16f7a22bfd5c29ce06194db64dbb0e6172debb3c0160b296be7adbe04edf10d388f5e
7
+ data.tar.gz: a6ee34ad1e1837c333dfb58228bdc850b9b9ce800c21fa33ecbc20d3a48db9464d53da042b587c7221867b7e0bd762224120a79149f692fc1772ff261650fef1
data/README.md CHANGED
@@ -6,6 +6,14 @@ The idea is that you have a set of YAML files in a data folder which act as your
6
6
 
7
7
  [![Build Status](https://travis-ci.org/gjtorikian/nanoc-conref-fs.svg)](https://travis-ci.org/gjtorikian/nanoc-conref-fs)
8
8
 
9
+ Set the data source in your *nanoc.yaml* file:
10
+
11
+ ``` yml
12
+ data_sources:
13
+ -
14
+ type: conref-fs
15
+ ```
16
+
9
17
  **NOTE:** If you use this library with nanoc's ERB filter, and want to use `render`, you'll need to monkey-patch an alias to avoid conflicts:
10
18
 
11
19
  ``` ruby
@@ -25,7 +25,7 @@ class ConrefFS < Nanoc::DataSource
25
25
  include Nanoc::DataSources::Filesystem
26
26
  include VariableMixin
27
27
 
28
- identifier :conref_fs
28
+ identifier :'conref-fs'
29
29
 
30
30
  # Before iterating over the file objects, this method loads the data folder
31
31
  # and applies to to an ivar for later usage.
@@ -17,7 +17,12 @@ module Datafiles
17
17
 
18
18
  doc = YAML.load(content)
19
19
  data_keys = "#{path}".gsub(%r{^data/}, '').gsub(%r{/}, '.').gsub(/\.yml/, '').split('.')
20
- create_nested_hash(data_keys, doc)
20
+ # we don't need to create a nested hash for root-level data files
21
+ if data_keys.length == 1
22
+ { data_keys.first => doc }
23
+ else
24
+ create_nested_hash(data_keys, doc)
25
+ end
21
26
  end
22
27
 
23
28
  def self.create_nested_hash(keys, final)
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
 
4
4
  Gem::Specification.new do |spec|
5
5
  spec.name = 'nanoc-conref-fs'
6
- spec.version = '0.3.1'
6
+ spec.version = '0.4.0'
7
7
  spec.authors = ['Garen Torikian']
8
8
  spec.email = ['gjtorikian@gmail.com']
9
9
  spec.summary = 'A Nanoc filesystem to permit using conrefs/reusables in your content.'
@@ -50,7 +50,7 @@ prune:
50
50
  data_sources:
51
51
  -
52
52
  # The type is the identifier of the data source.
53
- type: conref_fs
53
+ type: conref-fs
54
54
 
55
55
  items_root: /
56
56
  layouts_root: /
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nanoc-conref-fs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garen Torikian
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-24 00:00:00.000000000 Z
11
+ date: 2015-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nanoc