nanoc 3.7.1 → 3.7.2
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 +4 -4
- data/Gemfile.lock +1 -1
- data/NEWS.md +15 -2
- data/bin/nanoc +1 -0
- data/lib/nanoc/base/compilation/rules_collection.rb +4 -4
- data/lib/nanoc/data_sources/filesystem.rb +4 -2
- data/lib/nanoc/data_sources/filesystem_unified.rb +1 -1
- data/lib/nanoc/extra/auto_compiler.rb +1 -1
- data/lib/nanoc/extra/chick.rb +4 -4
- data/lib/nanoc/filters/kramdown.rb +1 -1
- data/lib/nanoc/filters/markaby.rb +1 -1
- data/lib/nanoc/filters/maruku.rb +1 -1
- data/lib/nanoc/filters/rdoc.rb +1 -1
- data/lib/nanoc/version.rb +1 -1
- data/test/data_sources/test_filesystem.rb +7 -7
- data/test/data_sources/test_filesystem_unified.rb +5 -7
- data/test/data_sources/test_filesystem_verbose.rb +3 -3
- data/test/helpers/test_rendering.rb +4 -4
- 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: 1ca3c26aee827d7103ec7df8af591543ac1e6146
|
4
|
+
data.tar.gz: 1d2b4b6f1cc0082fffef58966079ee19cc6a73ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72d40fe2758cdb63e649596200573aae2ab7cffdc2a96bc5e13b1c4f429b5e4ca630e5884ef493f9614aefaf267f67ed74913ef9bd4e371bb7e433487be50bce
|
7
|
+
data.tar.gz: ffbffec0e7507c4e78be36a9484b0cd010d46d63244d414856574a297e78eff65af7671e07895492195b1927719becc3a81da01ebbd49ce6f00d06c47a4863b4
|
data/Gemfile.lock
CHANGED
data/NEWS.md
CHANGED
@@ -1,5 +1,18 @@
|
|
1
1
|
# nanoc news
|
2
2
|
|
3
|
+
## 3.7.2 (2014-08-17)
|
4
|
+
|
5
|
+
Fixes:
|
6
|
+
|
7
|
+
* Fixed broken links to the now defunct RubyForge (#454, #467)
|
8
|
+
* Fixed crash when Gemfile is missing but Bundler is installed (#464)
|
9
|
+
* Made filesystem data source strip only leading newlines, not all whitespace (#463) [Gregory Pakosz]
|
10
|
+
|
11
|
+
Enhancements:
|
12
|
+
|
13
|
+
* Fixed issue which could cause items to be unnecessarily marked as outdated (#461) [Gregory Pakosz]
|
14
|
+
* Prevented binary layouts from being generated (#468) [Gregory Pakosz]
|
15
|
+
|
3
16
|
## 3.7.1 (2014-06-16)
|
4
17
|
|
5
18
|
Fixes:
|
@@ -459,7 +472,7 @@ New:
|
|
459
472
|
* A new “+” wildcard in rule patterns that matches one or more characters
|
460
473
|
* A `view` command that starts a web server in the output directory
|
461
474
|
* A `debug` command that shows information about the items, reps and layouts
|
462
|
-
* A `kramdown` filter ([kramdown site](http://kramdown.
|
475
|
+
* A `kramdown` filter ([kramdown site](http://kramdown.gettalong.org/))
|
463
476
|
* A diff between the previously compiled content and the last compiled content is now written to `output.diff` if the `enable_output_diff` site configuration attribute is true
|
464
477
|
* Assigns, such as `@items`, `@layouts`, `@item`, … are accessible without `@`
|
465
478
|
* Support for binary items
|
@@ -647,7 +660,7 @@ updated manual will be useful.
|
|
647
660
|
New:
|
648
661
|
|
649
662
|
* New `rdiscount` filter ([RDiscount site](http://github.com/rtomayko/rdiscount))
|
650
|
-
* New `maruku` filter ([Maruku site](
|
663
|
+
* New `maruku` filter ([Maruku site](https://github.com/bhollis/maruku/))
|
651
664
|
* New `erubis` filter ([Erubis site](http://www.kuwata-lab.com/erubis/))
|
652
665
|
* A better commandline frontend
|
653
666
|
* A new filesystem data source named `filesystem_combined`
|
data/bin/nanoc
CHANGED
@@ -198,9 +198,9 @@ module Nanoc
|
|
198
198
|
end
|
199
199
|
memoize :new_rule_memory_for_rep
|
200
200
|
|
201
|
-
# Makes the given rule memory serializable by calling
|
202
|
-
# filter arguments, so that objects such as
|
203
|
-
# serialized.
|
201
|
+
# Makes the given rule memory serializable by calling
|
202
|
+
# `Nanoc::Checksummer#calc` on the filter arguments, so that objects such as
|
203
|
+
# classes and filenames can be serialized.
|
204
204
|
#
|
205
205
|
# @param [Array] rs The rule memory for a certain item rep
|
206
206
|
#
|
@@ -208,7 +208,7 @@ module Nanoc
|
|
208
208
|
def make_rule_memory_serializable(rs)
|
209
209
|
rs.map do |r|
|
210
210
|
if r[0] == :filter
|
211
|
-
[ r[0], r[1], r[2].to_a.map { |a| a
|
211
|
+
[ r[0], r[1], r[2].to_a.map { |a| Nanoc::Checksummer.calc(a) } ]
|
212
212
|
else
|
213
213
|
r
|
214
214
|
end
|
@@ -93,6 +93,8 @@ module Nanoc::DataSources
|
|
93
93
|
if is_binary && klass == Nanoc::Item
|
94
94
|
meta = (meta_filename && YAML.load_file(meta_filename)) || {}
|
95
95
|
content_or_filename = content_filename
|
96
|
+
elsif is_binary && klass == Nanoc::Layout
|
97
|
+
raise "The layout file '#{content_filename}' is a binary file, but layouts can only be textual"
|
96
98
|
else
|
97
99
|
meta, content_or_filename = parse(content_filename, meta_filename, kind)
|
98
100
|
end
|
@@ -255,7 +257,7 @@ module Nanoc::DataSources
|
|
255
257
|
end
|
256
258
|
|
257
259
|
# Split data
|
258
|
-
pieces = data.split(/^(-{5}|-{3})\
|
260
|
+
pieces = data.split(/^(-{5}|-{3})[ \t]*\n/)
|
259
261
|
if pieces.size < 4
|
260
262
|
raise RuntimeError.new(
|
261
263
|
"The file '#{content_filename}' appears to start with a metadata section (three or five dashes at the top) but it does not seem to be in the correct format."
|
@@ -268,7 +270,7 @@ module Nanoc::DataSources
|
|
268
270
|
rescue Exception => e
|
269
271
|
raise "Could not parse YAML for #{content_filename}: #{e.message}"
|
270
272
|
end
|
271
|
-
content = pieces[4..-1].join
|
273
|
+
content = pieces[4..-1].join
|
272
274
|
|
273
275
|
# Done
|
274
276
|
[ meta, content ]
|
@@ -25,7 +25,7 @@ module Nanoc::Extra
|
|
25
25
|
end
|
26
26
|
|
27
27
|
# Calls the autocompiler. The behaviour of this method is defined by the
|
28
|
-
# [Rack specification](http://
|
28
|
+
# [Rack specification](http://rubydoc.info/github/rack/rack/master/file/SPEC).
|
29
29
|
#
|
30
30
|
# @param [Hash] env The environment, as defined by the Rack specification
|
31
31
|
#
|
data/lib/nanoc/extra/chick.rb
CHANGED
@@ -8,12 +8,12 @@ module Nanoc::Extra
|
|
8
8
|
|
9
9
|
# @deprecated Use a HTTP library such as
|
10
10
|
# [Net::HTTP](http://ruby-doc.org/stdlib/libdoc/net/http/rdoc/) or
|
11
|
-
# [Curb](
|
11
|
+
# [Curb](https://github.com/taf2/curb) instead.
|
12
12
|
module CHiCk
|
13
13
|
|
14
14
|
# @deprecated Use a HTTP library such as
|
15
15
|
# [Net::HTTP](http://ruby-doc.org/stdlib/libdoc/net/http/rdoc/) or
|
16
|
-
# [Curb](
|
16
|
+
# [Curb](https://github.com/taf2/curb) instead.
|
17
17
|
class Client
|
18
18
|
|
19
19
|
DEFAULT_OPTIONS = {
|
@@ -62,7 +62,7 @@ module Nanoc::Extra
|
|
62
62
|
|
63
63
|
# @deprecated Use a HTTP library such as
|
64
64
|
# [Net::HTTP](http://ruby-doc.org/stdlib/libdoc/net/http/rdoc/) or
|
65
|
-
# [Curb](
|
65
|
+
# [Curb](https://github.com/taf2/curb) instead.
|
66
66
|
class CacheController
|
67
67
|
|
68
68
|
def initialize(app, options = {})
|
@@ -82,7 +82,7 @@ module Nanoc::Extra
|
|
82
82
|
|
83
83
|
# @deprecated Use a HTTP library such as
|
84
84
|
# [Net::HTTP](http://ruby-doc.org/stdlib/libdoc/net/http/rdoc/) or
|
85
|
-
# [Curb](
|
85
|
+
# [Curb](https://github.com/taf2/curb) instead.
|
86
86
|
class RackClient
|
87
87
|
|
88
88
|
METHOD_TO_CLASS_MAPPING = {
|
@@ -5,7 +5,7 @@ module Nanoc::Filters
|
|
5
5
|
|
6
6
|
requires 'kramdown'
|
7
7
|
|
8
|
-
# Runs the content through [Kramdown](http://kramdown.
|
8
|
+
# Runs the content through [Kramdown](http://kramdown.gettalong.org/).
|
9
9
|
# Parameters passed to this filter will be passed on to Kramdown.
|
10
10
|
#
|
11
11
|
# @param [String] content The content to filter
|
@@ -5,7 +5,7 @@ module Nanoc::Filters
|
|
5
5
|
|
6
6
|
requires 'markaby'
|
7
7
|
|
8
|
-
# Runs the content through [Markaby](http://markaby.
|
8
|
+
# Runs the content through [Markaby](http://markaby.github.io/).
|
9
9
|
# This method takes no options.
|
10
10
|
#
|
11
11
|
# @param [String] content The content to filter
|
data/lib/nanoc/filters/maruku.rb
CHANGED
@@ -5,7 +5,7 @@ module Nanoc::Filters
|
|
5
5
|
|
6
6
|
requires 'maruku'
|
7
7
|
|
8
|
-
# Runs the content through [Maruku](
|
8
|
+
# Runs the content through [Maruku](https://github.com/bhollis/maruku/).
|
9
9
|
# Parameters passed to this filter will be passed on to Maruku.
|
10
10
|
#
|
11
11
|
# @param [String] content The content to filter
|
data/lib/nanoc/filters/rdoc.rb
CHANGED
@@ -10,7 +10,7 @@ module Nanoc::Filters
|
|
10
10
|
super
|
11
11
|
end
|
12
12
|
|
13
|
-
# Runs the content through [RDoc::Markup](http://
|
13
|
+
# Runs the content through [RDoc::Markup](http://docs.seattlerb.org/rdoc/RDoc/Markup.html).
|
14
14
|
# This method takes no options.
|
15
15
|
#
|
16
16
|
# @param [String] content The content to filter
|
data/lib/nanoc/version.rb
CHANGED
@@ -316,7 +316,7 @@ class Nanoc::DataSources::FilesystemTest < Nanoc::TestCase
|
|
316
316
|
io.write "-----\n"
|
317
317
|
io.write "foo: bar\n"
|
318
318
|
io.write "-----\n"
|
319
|
-
io.write "blah blah\n"
|
319
|
+
io.write " \t\n blah blah\n"
|
320
320
|
end
|
321
321
|
|
322
322
|
# Create data source
|
@@ -325,7 +325,7 @@ class Nanoc::DataSources::FilesystemTest < Nanoc::TestCase
|
|
325
325
|
# Parse it
|
326
326
|
result = data_source.instance_eval { parse('test.html', nil, 'foobar') }
|
327
327
|
assert_equal({ 'foo' => 'bar' }, result[0])
|
328
|
-
assert_equal(
|
328
|
+
assert_equal(" \t\n blah blah\n", result[1])
|
329
329
|
end
|
330
330
|
|
331
331
|
def test_parse_embedded_with_extra_spaces
|
@@ -334,7 +334,7 @@ class Nanoc::DataSources::FilesystemTest < Nanoc::TestCase
|
|
334
334
|
io.write "----- \n"
|
335
335
|
io.write "foo: bar\n"
|
336
336
|
io.write "-----\t\t\t\t\t\n"
|
337
|
-
io.write "blah blah\n"
|
337
|
+
io.write " blah blah\n"
|
338
338
|
end
|
339
339
|
|
340
340
|
# Create data source
|
@@ -343,7 +343,7 @@ class Nanoc::DataSources::FilesystemTest < Nanoc::TestCase
|
|
343
343
|
# Parse it
|
344
344
|
result = data_source.instance_eval { parse('test.html', nil, 'foobar') }
|
345
345
|
assert_equal({ 'foo' => 'bar' }, result[0])
|
346
|
-
assert_equal(
|
346
|
+
assert_equal(" blah blah\n", result[1])
|
347
347
|
end
|
348
348
|
|
349
349
|
def test_parse_embedded_empty_meta
|
@@ -351,7 +351,7 @@ class Nanoc::DataSources::FilesystemTest < Nanoc::TestCase
|
|
351
351
|
File.open('test.html', 'w') do |io|
|
352
352
|
io.write "-----\n"
|
353
353
|
io.write "-----\n"
|
354
|
-
io.write "
|
354
|
+
io.write "\nblah blah\n"
|
355
355
|
end
|
356
356
|
|
357
357
|
# Create data source
|
@@ -360,7 +360,7 @@ class Nanoc::DataSources::FilesystemTest < Nanoc::TestCase
|
|
360
360
|
# Parse it
|
361
361
|
result = data_source.instance_eval { parse('test.html', nil, 'foobar') }
|
362
362
|
assert_equal({}, result[0])
|
363
|
-
assert_equal(
|
363
|
+
assert_equal("\nblah blah\n", result[1])
|
364
364
|
end
|
365
365
|
|
366
366
|
def test_parse_utf8_bom
|
@@ -376,7 +376,7 @@ class Nanoc::DataSources::FilesystemTest < Nanoc::TestCase
|
|
376
376
|
|
377
377
|
result = data_source.instance_eval { parse('test.html', nil, 'foobar') }
|
378
378
|
assert_equal({ 'utf8bomawareness' => 'high' }, result[0])
|
379
|
-
assert_equal(
|
379
|
+
assert_equal("content goes here\n", result[1])
|
380
380
|
end
|
381
381
|
|
382
382
|
def test_parse_embedded_no_meta
|
@@ -25,7 +25,7 @@ class Nanoc::DataSources::FilesystemUnifiedTest < Nanoc::TestCase
|
|
25
25
|
assert File.file?('foobar/asdf.html')
|
26
26
|
|
27
27
|
# Check file content
|
28
|
-
expected = /^--- ?\nfoo: bar\n---\
|
28
|
+
expected = /^--- ?\nfoo: bar\n---\ncontent here$/
|
29
29
|
assert_match expected, File.read('foobar/asdf.html')
|
30
30
|
end
|
31
31
|
|
@@ -41,7 +41,7 @@ class Nanoc::DataSources::FilesystemUnifiedTest < Nanoc::TestCase
|
|
41
41
|
assert File.file?('foobar/index.html')
|
42
42
|
|
43
43
|
# Check file content
|
44
|
-
expected = /^--- ?\nfoo: bar\n---\
|
44
|
+
expected = /^--- ?\nfoo: bar\n---\ncontent here$/
|
45
45
|
assert_match expected, File.read('foobar/index.html')
|
46
46
|
end
|
47
47
|
|
@@ -135,11 +135,9 @@ class Nanoc::DataSources::FilesystemUnifiedTest < Nanoc::TestCase
|
|
135
135
|
File.open('foo/stuff.dat', 'w') { |io| io.write("random binary data") }
|
136
136
|
|
137
137
|
# Load
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
assert_equal 1, items.size
|
142
|
-
assert_equal 'random binary data', items[0].raw_content
|
138
|
+
assert_raises(RuntimeError) do
|
139
|
+
data_source.send(:load_objects, 'foo', 'item', Nanoc::Layout)
|
140
|
+
end
|
143
141
|
end
|
144
142
|
|
145
143
|
def test_identifier_for_filename_allowing_periods_in_identifiers
|
@@ -138,7 +138,7 @@ class Nanoc::DataSources::FilesystemVerboseTest < Nanoc::TestCase
|
|
138
138
|
io.write("---\n")
|
139
139
|
io.write("filter: erb\n")
|
140
140
|
end
|
141
|
-
File.open('layouts/foo/foo.
|
141
|
+
File.open('layouts/foo/foo.html', 'w') do |io|
|
142
142
|
io.write('Lorem ipsum dolor sit amet...')
|
143
143
|
end
|
144
144
|
|
@@ -148,8 +148,8 @@ class Nanoc::DataSources::FilesystemVerboseTest < Nanoc::TestCase
|
|
148
148
|
# Check layouts
|
149
149
|
assert_equal(1, layouts.size)
|
150
150
|
assert_equal('erb', layouts[0][:filter])
|
151
|
-
assert_equal('
|
152
|
-
assert_equal('layouts/foo/foo.
|
151
|
+
assert_equal('html', layouts[0][:extension])
|
152
|
+
assert_equal('layouts/foo/foo.html', layouts[0][:content_filename])
|
153
153
|
assert_equal('layouts/foo/foo.yaml', layouts[0][:meta_filename])
|
154
154
|
end
|
155
155
|
|
@@ -12,7 +12,7 @@ class Nanoc::Helpers::RenderingTest < Nanoc::TestCase
|
|
12
12
|
io.write("layout '/foo/', :erb\n")
|
13
13
|
end
|
14
14
|
|
15
|
-
File.open('layouts/foo.
|
15
|
+
File.open('layouts/foo.erb', 'w') do |io|
|
16
16
|
io.write 'This is the <%= @layout.identifier %> layout.'
|
17
17
|
end
|
18
18
|
|
@@ -38,7 +38,7 @@ class Nanoc::Helpers::RenderingTest < Nanoc::TestCase
|
|
38
38
|
io.write("layout '/foo/', nil\n")
|
39
39
|
end
|
40
40
|
|
41
|
-
File.open('layouts/foo.
|
41
|
+
File.open('layouts/foo.erb', 'w').close()
|
42
42
|
|
43
43
|
assert_raises(Nanoc::Errors::CannotDetermineFilter) do
|
44
44
|
render '/foo/'
|
@@ -54,7 +54,7 @@ class Nanoc::Helpers::RenderingTest < Nanoc::TestCase
|
|
54
54
|
io.write("layout '/foo/', :asdf\n")
|
55
55
|
end
|
56
56
|
|
57
|
-
File.open('layouts/foo.
|
57
|
+
File.open('layouts/foo.erb', 'w').close()
|
58
58
|
|
59
59
|
assert_raises(Nanoc::Errors::UnknownFilter) do
|
60
60
|
render '/foo/'
|
@@ -70,7 +70,7 @@ class Nanoc::Helpers::RenderingTest < Nanoc::TestCase
|
|
70
70
|
io.write("layout '/foo/', :erb\n")
|
71
71
|
end
|
72
72
|
|
73
|
-
File.open('layouts/foo.
|
73
|
+
File.open('layouts/foo.erb', 'w') do |io|
|
74
74
|
io.write '[partial-before]<%= yield %>[partial-after]'
|
75
75
|
end
|
76
76
|
|
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: 3.7.
|
4
|
+
version: 3.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Denis Defreyne
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-08-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cri
|