nanoc 4.8.2 → 4.8.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/NEWS.md +13 -1
- data/lib/nanoc/base/entities/document.rb +6 -1
- data/lib/nanoc/base/entities/identifier.rb +10 -3
- data/lib/nanoc/cli/command_runner.rb +27 -4
- data/lib/nanoc/cli/commands/view.rb +6 -2
- data/lib/nanoc/spec.rb +10 -0
- data/lib/nanoc/version.rb +1 -1
- data/spec/nanoc/base/entities/document_spec.rb +30 -0
- data/spec/nanoc/base/entities/identifier_spec.rb +13 -3
- data/spec/nanoc/base/item_rep_writer_spec.rb +1 -1
- data/spec/nanoc/base/services/executor_spec.rb +1 -1
- data/spec/nanoc/base/views/document_view_spec.rb +13 -13
- data/spec/nanoc/base/views/item_rep_view_spec.rb +15 -15
- data/spec/nanoc/base/views/item_view_spec.rb +21 -12
- data/spec/nanoc/base/views/layout_view_spec.rb +2 -2
- data/spec/nanoc/base/views/mutable_document_view_spec.rb +3 -3
- data/spec/nanoc/base/views/mutable_identifiable_collection_view_spec.rb +4 -4
- data/spec/nanoc/base/views/mutable_item_collection_view_spec.rb +5 -5
- data/spec/nanoc/base/views/mutable_item_view_spec.rb +3 -3
- data/spec/nanoc/base/views/mutable_layout_collection_view_spec.rb +5 -5
- data/spec/nanoc/base/views/mutable_layout_view_spec.rb +2 -2
- data/spec/nanoc/base/views/post_compile_item_rep_view_spec.rb +1 -1
- data/spec/nanoc/cli/command_runner_spec.rb +90 -0
- data/spec/nanoc/cli/commands/show_rules_spec.rb +1 -0
- data/spec/nanoc/cli/commands/view_spec.rb +13 -0
- data/spec/nanoc/cli_spec.rb +1 -1
- data/spec/nanoc/data_sources/filesystem_spec.rb +1 -1
- data/spec/nanoc/helpers/blogging_spec.rb +18 -18
- data/spec/nanoc/helpers/link_to_spec.rb +8 -8
- data/spec/spec_helper.rb +7 -8
- data/test/base/test_data_source.rb +8 -8
- data/test/base/test_item_array.rb +11 -11
- data/test/cli/commands/test_compile.rb +2 -2
- data/test/filters/test_handlebars.rb +3 -3
- data/test/filters/test_mustache.rb +2 -2
- data/test/filters/test_relativize_paths.rb +29 -29
- data/test/filters/test_sass.rb +1 -1
- data/test/filters/test_xsl.rb +6 -6
- data/test/helpers/test_capturing.rb +1 -1
- data/test/helpers/test_xml_sitemap.rb +15 -15
- metadata +4 -3
data/test/filters/test_sass.rb
CHANGED
data/test/filters/test_xsl.rb
CHANGED
@@ -113,9 +113,9 @@ EOS
|
|
113
113
|
def test_filter_as_layout
|
114
114
|
if_have 'nokogiri' do
|
115
115
|
# Create our data objects
|
116
|
-
item = Nanoc::Int::Item.new(SAMPLE_XML_IN, {}, '/content
|
116
|
+
item = Nanoc::Int::Item.new(SAMPLE_XML_IN, {}, '/content')
|
117
117
|
item = Nanoc::ItemWithRepsView.new(item, new_view_context)
|
118
|
-
layout = Nanoc::Int::Layout.new(SAMPLE_XSL, {}, '/layout
|
118
|
+
layout = Nanoc::Int::Layout.new(SAMPLE_XSL, {}, '/layout')
|
119
119
|
layout = Nanoc::LayoutView.new(layout, new_view_context)
|
120
120
|
|
121
121
|
# Create an instance of the filter
|
@@ -139,9 +139,9 @@ EOS
|
|
139
139
|
def test_filter_with_params
|
140
140
|
if_have 'nokogiri' do
|
141
141
|
# Create our data objects
|
142
|
-
item = Nanoc::Int::Item.new(SAMPLE_XML_IN_WITH_PARAMS, {}, '/content
|
142
|
+
item = Nanoc::Int::Item.new(SAMPLE_XML_IN_WITH_PARAMS, {}, '/content')
|
143
143
|
item = Nanoc::ItemWithRepsView.new(item, new_view_context)
|
144
|
-
layout = Nanoc::Int::Layout.new(SAMPLE_XSL_WITH_PARAMS, {}, '/layout
|
144
|
+
layout = Nanoc::Int::Layout.new(SAMPLE_XSL_WITH_PARAMS, {}, '/layout')
|
145
145
|
layout = Nanoc::LayoutView.new(layout, new_view_context)
|
146
146
|
|
147
147
|
# Create an instance of the filter
|
@@ -165,9 +165,9 @@ EOS
|
|
165
165
|
def test_filter_with_omit_xml_decl
|
166
166
|
if_have 'nokogiri' do
|
167
167
|
# Create our data objects
|
168
|
-
item = Nanoc::Int::Item.new(SAMPLE_XML_IN_WITH_OMIT_XML_DECL, {}, '/content
|
168
|
+
item = Nanoc::Int::Item.new(SAMPLE_XML_IN_WITH_OMIT_XML_DECL, {}, '/content')
|
169
169
|
item = Nanoc::ItemWithRepsView.new(item, new_view_context)
|
170
|
-
layout = Nanoc::Int::Layout.new(SAMPLE_XSL_WITH_OMIT_XML_DECL, {}, '/layout
|
170
|
+
layout = Nanoc::Int::Layout.new(SAMPLE_XSL_WITH_OMIT_XML_DECL, {}, '/layout')
|
171
171
|
layout = Nanoc::LayoutView.new(layout, new_view_context)
|
172
172
|
|
173
173
|
# Create an instance of the filter
|
@@ -80,7 +80,7 @@ class Nanoc::Helpers::CapturingTest < Nanoc::TestCase
|
|
80
80
|
foot
|
81
81
|
EOS
|
82
82
|
|
83
|
-
item = Nanoc::Int::Item.new('content', {}, '/')
|
83
|
+
item = Nanoc::Int::Item.new('content', {}, '/asdf')
|
84
84
|
view_context = view_context_for(item)
|
85
85
|
@item = Nanoc::ItemWithRepsView.new(item, view_context_for(item))
|
86
86
|
@config = Nanoc::ConfigView.new(Nanoc::Int::Configuration.new, view_context)
|
@@ -35,24 +35,24 @@ class Nanoc::Helpers::XMLSitemapTest < Nanoc::TestCase
|
|
35
35
|
items = []
|
36
36
|
|
37
37
|
# Create item 1
|
38
|
-
item = Nanoc::ItemWithRepsView.new(Nanoc::Int::Item.new('some content 1', {}, '/item-one
|
38
|
+
item = Nanoc::ItemWithRepsView.new(Nanoc::Int::Item.new('some content 1', {}, '/item-one'), @view_context)
|
39
39
|
items << item
|
40
40
|
create_item_rep(item.unwrap, :one_a, '/item-one/a/')
|
41
41
|
create_item_rep(item.unwrap, :one_b, '/item-one/b/')
|
42
42
|
|
43
43
|
# Create item 2
|
44
|
-
item = Nanoc::ItemWithRepsView.new(Nanoc::Int::Item.new('some content 2', { is_hidden: true }, '/item-two
|
44
|
+
item = Nanoc::ItemWithRepsView.new(Nanoc::Int::Item.new('some content 2', { is_hidden: true }, '/item-two'), @view_context)
|
45
45
|
items << item
|
46
46
|
|
47
47
|
# Create item 3
|
48
48
|
attrs = { mtime: Time.parse('2004-07-12 00:00:00 +02:00'), changefreq: 'daily', priority: 0.5 }
|
49
|
-
item = Nanoc::ItemWithRepsView.new(Nanoc::Int::Item.new('some content 3', attrs, '/item-three
|
49
|
+
item = Nanoc::ItemWithRepsView.new(Nanoc::Int::Item.new('some content 3', attrs, '/item-three'), @view_context)
|
50
50
|
items << item
|
51
51
|
create_item_rep(item.unwrap, :three_a, '/item-three/a/')
|
52
52
|
create_item_rep(item.unwrap, :three_b, '/item-three/b/')
|
53
53
|
|
54
54
|
# Create item 4
|
55
|
-
item = Nanoc::ItemWithRepsView.new(Nanoc::Int::Item.new('some content 4', {}, '/item-four
|
55
|
+
item = Nanoc::ItemWithRepsView.new(Nanoc::Int::Item.new('some content 4', {}, '/item-four'), @view_context)
|
56
56
|
items << item
|
57
57
|
create_item_rep(item.unwrap, :four_a, nil)
|
58
58
|
|
@@ -60,7 +60,7 @@ class Nanoc::Helpers::XMLSitemapTest < Nanoc::TestCase
|
|
60
60
|
@items = Nanoc::Int::ItemCollection.new({}, items)
|
61
61
|
|
62
62
|
# Create sitemap item
|
63
|
-
@item = Nanoc::ItemWithRepsView.new(Nanoc::Int::Item.new('sitemap content', {}, '/sitemap
|
63
|
+
@item = Nanoc::ItemWithRepsView.new(Nanoc::Int::Item.new('sitemap content', {}, '/sitemap'), @view_context)
|
64
64
|
|
65
65
|
# Create site
|
66
66
|
config = Nanoc::Int::Configuration.new(hash: { base_url: 'http://example.com' })
|
@@ -99,7 +99,7 @@ class Nanoc::Helpers::XMLSitemapTest < Nanoc::TestCase
|
|
99
99
|
# Create items
|
100
100
|
items = []
|
101
101
|
items << nil
|
102
|
-
item = Nanoc::ItemWithRepsView.new(Nanoc::Int::Item.new('some content 1', {}, '/item-one
|
102
|
+
item = Nanoc::ItemWithRepsView.new(Nanoc::Int::Item.new('some content 1', {}, '/item-one'), @view_context)
|
103
103
|
items << item
|
104
104
|
create_item_rep(item.unwrap, :one_a, '/item-one/a/')
|
105
105
|
create_item_rep(item.unwrap, :one_b, '/item-one/b/')
|
@@ -107,7 +107,7 @@ class Nanoc::Helpers::XMLSitemapTest < Nanoc::TestCase
|
|
107
107
|
@items = Nanoc::Int::ItemCollection.new({})
|
108
108
|
|
109
109
|
# Create sitemap item
|
110
|
-
@item = Nanoc::Int::Item.new('sitemap content', {}, '/sitemap
|
110
|
+
@item = Nanoc::Int::Item.new('sitemap content', {}, '/sitemap')
|
111
111
|
|
112
112
|
# Create site
|
113
113
|
config = Nanoc::Int::Configuration.new(hash: { base_url: 'http://example.com' })
|
@@ -136,13 +136,13 @@ class Nanoc::Helpers::XMLSitemapTest < Nanoc::TestCase
|
|
136
136
|
def test_filter
|
137
137
|
if_have 'builder', 'nokogiri' do
|
138
138
|
# Create items
|
139
|
-
item = Nanoc::ItemWithRepsView.new(Nanoc::Int::Item.new('some content 1', {}, '/item-one
|
139
|
+
item = Nanoc::ItemWithRepsView.new(Nanoc::Int::Item.new('some content 1', {}, '/item-one'), @view_context)
|
140
140
|
@items = Nanoc::Int::ItemCollection.new({}, [item])
|
141
141
|
create_item_rep(item.unwrap, :one_a, '/item-one/a/')
|
142
142
|
create_item_rep(item.unwrap, :one_b, '/item-one/b/')
|
143
143
|
|
144
144
|
# Create sitemap item
|
145
|
-
@item = Nanoc::ItemWithRepsView.new(Nanoc::Int::Item.new('sitemap content', {}, '/sitemap
|
145
|
+
@item = Nanoc::ItemWithRepsView.new(Nanoc::Int::Item.new('sitemap content', {}, '/sitemap'), @view_context)
|
146
146
|
|
147
147
|
# Create site
|
148
148
|
config = Nanoc::Int::Configuration.new(hash: { base_url: 'http://example.com' })
|
@@ -168,22 +168,22 @@ class Nanoc::Helpers::XMLSitemapTest < Nanoc::TestCase
|
|
168
168
|
if_have 'builder', 'nokogiri' do
|
169
169
|
# Create items
|
170
170
|
items = []
|
171
|
-
item = Nanoc::ItemWithRepsView.new(Nanoc::Int::Item.new('some content 1', {}, '/george
|
171
|
+
item = Nanoc::ItemWithRepsView.new(Nanoc::Int::Item.new('some content 1', {}, '/george'), @view_context)
|
172
172
|
items << item
|
173
173
|
create_item_rep(item.unwrap, :a_alice, '/george/alice/')
|
174
174
|
create_item_rep(item.unwrap, :b_zoey, '/george/zoey/')
|
175
|
-
item = Nanoc::ItemWithRepsView.new(Nanoc::Int::Item.new('some content 1', {}, '/walton
|
175
|
+
item = Nanoc::ItemWithRepsView.new(Nanoc::Int::Item.new('some content 1', {}, '/walton'), @view_context)
|
176
176
|
items << item
|
177
177
|
create_item_rep(item.unwrap, :a_eve, '/walton/eve/')
|
178
178
|
create_item_rep(item.unwrap, :b_bob, '/walton/bob/')
|
179
|
-
item = Nanoc::ItemWithRepsView.new(Nanoc::Int::Item.new('some content 1', {}, '/lucas
|
179
|
+
item = Nanoc::ItemWithRepsView.new(Nanoc::Int::Item.new('some content 1', {}, '/lucas'), @view_context)
|
180
180
|
items << item
|
181
181
|
create_item_rep(item.unwrap, :a_trudy, '/lucas/trudy/')
|
182
182
|
create_item_rep(item.unwrap, :b_mallory, '/lucas/mallory/')
|
183
183
|
@items = Nanoc::Int::ItemCollection.new({}, items)
|
184
184
|
|
185
185
|
# Create sitemap item
|
186
|
-
@item = Nanoc::ItemWithRepsView.new(Nanoc::Int::Item.new('sitemap content', {}, '/sitemap
|
186
|
+
@item = Nanoc::ItemWithRepsView.new(Nanoc::Int::Item.new('sitemap content', {}, '/sitemap'), @view_context)
|
187
187
|
|
188
188
|
# Create site
|
189
189
|
config = Nanoc::Int::Configuration.new(hash: { base_url: 'http://example.com' })
|
@@ -210,12 +210,12 @@ class Nanoc::Helpers::XMLSitemapTest < Nanoc::TestCase
|
|
210
210
|
def test_url_escape
|
211
211
|
if_have 'builder', 'nokogiri' do
|
212
212
|
# Create items
|
213
|
-
item = Nanoc::ItemWithRepsView.new(Nanoc::Int::Item.new('some content 1', {}, '/george
|
213
|
+
item = Nanoc::ItemWithRepsView.new(Nanoc::Int::Item.new('some content 1', {}, '/george'), @view_context)
|
214
214
|
@items = Nanoc::Int::ItemCollection.new({}, [item])
|
215
215
|
create_item_rep(item.unwrap, :default, '/cool projects/проверка')
|
216
216
|
|
217
217
|
# Create sitemap item
|
218
|
-
@item = Nanoc::ItemWithRepsView.new(Nanoc::Int::Item.new('sitemap content', {}, '/sitemap
|
218
|
+
@item = Nanoc::ItemWithRepsView.new(Nanoc::Int::Item.new('sitemap content', {}, '/sitemap'), @view_context)
|
219
219
|
|
220
220
|
# Create site
|
221
221
|
config = Nanoc::Int::Configuration.new(hash: { base_url: 'http://example.com' })
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nanoc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.8.
|
4
|
+
version: 4.8.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Denis Defreyne
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-08-
|
11
|
+
date: 2017-08-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cri
|
@@ -453,6 +453,7 @@ files:
|
|
453
453
|
- spec/nanoc/base/views/post_compile_item_rep_collection_view_spec.rb
|
454
454
|
- spec/nanoc/base/views/post_compile_item_rep_view_spec.rb
|
455
455
|
- spec/nanoc/base/views/post_compile_item_view_spec.rb
|
456
|
+
- spec/nanoc/cli/command_runner_spec.rb
|
456
457
|
- spec/nanoc/cli/commands/compile/diff_generator_spec.rb
|
457
458
|
- spec/nanoc/cli/commands/compile/file_action_printer_spec.rb
|
458
459
|
- spec/nanoc/cli/commands/compile/timing_recorder_spec.rb
|
@@ -662,7 +663,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
662
663
|
version: '0'
|
663
664
|
requirements: []
|
664
665
|
rubyforge_project:
|
665
|
-
rubygems_version: 2.6.
|
666
|
+
rubygems_version: 2.6.13
|
666
667
|
signing_key:
|
667
668
|
specification_version: 4
|
668
669
|
summary: A static-site generator with a focus on flexibility.
|