nanoc-conref-fs 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -0
- data/lib/nanoc-conref-fs/conref-fs.rb +1 -1
- data/lib/nanoc-conref-fs/datafiles.rb +6 -1
- data/nanoc-conref-fs.gemspec +1 -1
- data/test/fixtures/nanoc.yaml +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: efc00c8750bea1d8d022e9cc8213c23509a7f646
|
4
|
+
data.tar.gz: 81375784222ae8ff49971ffdfebba7b033b692d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 :
|
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
|
-
|
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)
|
data/nanoc-conref-fs.gemspec
CHANGED
@@ -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.
|
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.'
|
data/test/fixtures/nanoc.yaml
CHANGED
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.
|
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-
|
11
|
+
date: 2015-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nanoc
|