jekyll-conrefifier 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jekyll-conrefifier.rb +3 -4
- data/lib/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 065d8f8c53f11bc9a9e5a8657fba8844228da1d1
|
4
|
+
data.tar.gz: 5cd34e692c71e470491b88c5ed4629fff3ad0e6a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b67b2493701b2b63cd47bf639837dfe6435df9707b12062fd56ad39c9a9ec24b3c38e668520e070fc71742821e4d4429722cbe012f96080f3994d5dd1c74f221
|
7
|
+
data.tar.gz: ef625b18abef60fae8b637c7c9b492dc813faba80c3b2bdf0d0413758b14a80e17b3636c3ed94b51bb0333d2670878b037f56cca5aefd968b0e49e1d838ad9c4
|
data/lib/jekyll-conrefifier.rb
CHANGED
@@ -63,8 +63,7 @@ module Jekyll
|
|
63
63
|
contents = File.read(path)
|
64
64
|
if (matches = contents.scan /(\{% (?:if|unless).+? %\}.*?\{% end(?:if|unless) %\})/m)
|
65
65
|
unless matches.empty?
|
66
|
-
|
67
|
-
contents = apply_vars_to_datafile(contents, filename, matches, config['data_file_variables'])
|
66
|
+
contents = apply_vars_to_datafile(contents, path, matches, config['data_file_variables'])
|
68
67
|
end
|
69
68
|
end
|
70
69
|
data[key] = SafeYAML.load(contents)
|
@@ -73,10 +72,10 @@ module Jekyll
|
|
73
72
|
end
|
74
73
|
end
|
75
74
|
|
76
|
-
def apply_vars_to_datafile(contents,
|
75
|
+
def apply_vars_to_datafile(contents, path, matches, data_file_variables)
|
77
76
|
return contents if data_file_variables.nil?
|
78
77
|
data_vars = {}
|
79
|
-
scopes = data_file_variables.select { |v| v['scope']['path'].empty? || Regexp.new(v['scope']['path']) =~
|
78
|
+
scopes = data_file_variables.select { |v| v['scope']['path'].empty? || Regexp.new(v['scope']['path']) =~ path }
|
80
79
|
scopes.each do |scope|
|
81
80
|
data_vars = data_vars.merge(scope['values'])
|
82
81
|
end
|
data/lib/version.rb
CHANGED