jekyll-conrefifier 0.2.0 → 0.2.1

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: a3be384c388b690824874267ef348482dda86d27
4
- data.tar.gz: 157ee1105193aac294cbbd2b9c84e6113951de4c
3
+ metadata.gz: 065d8f8c53f11bc9a9e5a8657fba8844228da1d1
4
+ data.tar.gz: 5cd34e692c71e470491b88c5ed4629fff3ad0e6a
5
5
  SHA512:
6
- metadata.gz: 262e12f3d372e557388b9a0d156392c7d2f9a856daaef6984cb8ddd144ace9bcd8dd585d67ae9bf527240fbd7c44bd9485e9f8c5130ba820ba63514033acb0a2
7
- data.tar.gz: 51ab2c709f54d4915a8e6c9b69da097c57b3ee06c9a035312ae0c96fdab38b32ebcf29c432a7ac9d419d1977ecd3099f667a2c7ee7c7e432f7ced32867f70593
6
+ metadata.gz: b67b2493701b2b63cd47bf639837dfe6435df9707b12062fd56ad39c9a9ec24b3c38e668520e070fc71742821e4d4429722cbe012f96080f3994d5dd1c74f221
7
+ data.tar.gz: ef625b18abef60fae8b637c7c9b492dc813faba80c3b2bdf0d0413758b14a80e17b3636c3ed94b51bb0333d2670878b037f56cca5aefd968b0e49e1d838ad9c4
@@ -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
- filename = File.basename(path)
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, filename, matches, data_file_variables)
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']) =~ filename }
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
@@ -1,3 +1,3 @@
1
1
  module JekyllConrefifier
2
- VERSION = '0.2.0'
2
+ VERSION = '0.2.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-conrefifier
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garen J. Torikian