nanoc-conref-fs 0.5.0 → 0.6.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.
@@ -8,7 +8,7 @@
8
8
 
9
9
  <body>
10
10
 
11
- <%= VariableMixin.variables['site']['data']['variables']['product']['product_name']['2.0'] %>
11
+ <%= NanocConrefFS::Variables.variables[@rep.name]['site']['data']['variables']['product']['product_name']['2.0'] %>
12
12
  <%= yield %>
13
13
 
14
14
  </body>
@@ -5,6 +5,13 @@ data_variables:
5
5
  path: ""
6
6
  values:
7
7
  version: "dotcom"
8
+ -
9
+ scope:
10
+ path: ""
11
+ reps:
12
+ - :X
13
+ values:
14
+ version: "X"
8
15
 
9
16
  page_variables:
10
17
  -
@@ -63,6 +70,9 @@ data_sources:
63
70
  encoding: utf-8
64
71
 
65
72
  identifier_type: full
73
+ reps:
74
+ - :default
75
+ - :X
66
76
 
67
77
  checks:
68
78
  internal_links:
data/test/test_helper.rb CHANGED
@@ -6,6 +6,12 @@ require 'minitest/pride'
6
6
  require 'active_support'
7
7
 
8
8
  FIXTURES_DIR = File.join(Dir.pwd, 'test', 'fixtures')
9
+ CONFIG = YAML.load_file(File.join(FIXTURES_DIR, 'nanoc.yaml')).deep_symbolize_keys
10
+
11
+ class Minitest::Test
12
+ FileUtils.rm_rf File.join(FIXTURES_DIR, 'output')
13
+ FileUtils.rm_rf File.join(FIXTURES_DIR, 'tmp')
14
+ end
9
15
 
10
16
  def read_output_file(dir, name)
11
17
  File.read(File.join('output', dir, name, 'index.html')).gsub(/^\s*$/, '')
@@ -1,6 +1,6 @@
1
1
  require 'test_helper'
2
2
 
3
- class VariableMixinTest < MiniTest::Test
3
+ class VariablesTest < MiniTest::Test
4
4
 
5
5
  def test_it_fetches_variables
6
6
  with_site(name: FIXTURES_DIR) do |site|
@@ -8,13 +8,15 @@ class VariableMixinTest < MiniTest::Test
8
8
  site = Nanoc::Int::SiteLoader.new.new_from_cwd
9
9
  site.compile
10
10
 
11
- assert_equal VariableMixin.variables.keys, ['site']
12
- assert_equal VariableMixin.variables['site']['data'].keys, %w(categories reusables variables)
11
+ assert_equal NanocConrefFS::Variables.variables[:default].keys, ['site']
12
+ assert_equal NanocConrefFS::Variables.variables[:default]['site']['data'].keys, %w(categories reusables variables)
13
13
  end
14
14
  end
15
15
 
16
16
  def test_it_fetches_datafiles
17
- file = VariableMixin.fetch_data_file('reusables.intro')
18
- assert_equal file['frontmatter_intro'], 'Here I am, in the front.'
17
+ with_site(name: FIXTURES_DIR) do |site|
18
+ file = NanocConrefFS::Variables.fetch_data_file('reusables.intro', :default)
19
+ assert_equal file['frontmatter_intro'], 'Here I am, in the front.'
20
+ end
19
21
  end
20
22
  end
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.5.0
4
+ version: 0.6.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-11-28 00:00:00.000000000 Z
11
+ date: 2015-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nanoc
@@ -108,11 +108,15 @@ files:
108
108
  - README.md
109
109
  - Rakefile
110
110
  - lib/nanoc-conref-fs.rb
111
+ - lib/nanoc-conref-fs/ancestry.rb
112
+ - lib/nanoc-conref-fs/conref-filter.rb
111
113
  - lib/nanoc-conref-fs/conref-fs.rb
112
114
  - lib/nanoc-conref-fs/conrefifier.rb
113
115
  - lib/nanoc-conref-fs/datafiles.rb
116
+ - lib/nanoc-conref-fs/variables.rb
114
117
  - nanoc-conref-fs.gemspec
115
118
  - script/bootstrap
119
+ - test/ancestry_test.rb
116
120
  - test/conref_fs_test.rb
117
121
  - test/datafiles_test.rb
118
122
  - test/fixtures/Rules
@@ -144,6 +148,9 @@ files:
144
148
  - test/fixtures/content/maliciousness/asterisk_single.md
145
149
  - test/fixtures/content/maliciousness/unknown.html
146
150
  - test/fixtures/content/maliciousness/unknown.md
151
+ - test/fixtures/content/multiple/single_var.html
152
+ - test/fixtures/content/multiple/single_var.md
153
+ - test/fixtures/content/multiple/single_var_x.html
147
154
  - test/fixtures/content/obfuscation/admonitions.html
148
155
  - test/fixtures/content/obfuscation/admonitions.md
149
156
  - test/fixtures/content/obfuscation/octicon.html
@@ -195,6 +202,7 @@ signing_key:
195
202
  specification_version: 4
196
203
  summary: A Nanoc filesystem to permit using conrefs/reusables in your content.
197
204
  test_files:
205
+ - test/ancestry_test.rb
198
206
  - test/conref_fs_test.rb
199
207
  - test/datafiles_test.rb
200
208
  - test/fixtures/Rules
@@ -226,6 +234,9 @@ test_files:
226
234
  - test/fixtures/content/maliciousness/asterisk_single.md
227
235
  - test/fixtures/content/maliciousness/unknown.html
228
236
  - test/fixtures/content/maliciousness/unknown.md
237
+ - test/fixtures/content/multiple/single_var.html
238
+ - test/fixtures/content/multiple/single_var.md
239
+ - test/fixtures/content/multiple/single_var_x.html
229
240
  - test/fixtures/content/obfuscation/admonitions.html
230
241
  - test/fixtures/content/obfuscation/admonitions.md
231
242
  - test/fixtures/content/obfuscation/octicon.html