zenweb 3.8.0 → 3.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/History.txt +11 -0
- data/lib/zenweb.rb +1 -1
- data/lib/zenweb/page.rb +17 -2
- data/test/test_zenweb_page.rb +27 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f182dd306078007adbb5ab6c1e53ad6a6d9ad389
|
4
|
+
data.tar.gz: 546e36b5723788433e99824c100e4344a9c3c4f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a55442c3989e15e3cf236754bf4c609863be2e40da7c582b7f55ce4fb5202cbf2b5711e4e68abb03ac028bd68ebc36872364f77745cf18a879301438f8807d5
|
7
|
+
data.tar.gz: aaab074cb12006a26c8e5a9378c482b50815a3731b31738faafb4e692b54f32558baf709247b654cf864f3a7742463b67cf2538f06bd6e20bda01849f535f5af
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/History.txt
CHANGED
@@ -1,3 +1,14 @@
|
|
1
|
+
=== 3.9.0 / 2015-12-21
|
2
|
+
|
3
|
+
* 1 minor enhancement:
|
4
|
+
|
5
|
+
* Added Page#binary w/ Page#binary? alias.
|
6
|
+
|
7
|
+
* 2 bug fixes:
|
8
|
+
|
9
|
+
* Only puts on output if not binary.
|
10
|
+
* Only strip body content if not binary.
|
11
|
+
|
1
12
|
=== 3.8.0 / 2015-12-15
|
2
13
|
|
3
14
|
* 1 minor enhancement:
|
data/lib/zenweb.rb
CHANGED
data/lib/zenweb/page.rb
CHANGED
@@ -31,6 +31,12 @@ module Zenweb
|
|
31
31
|
|
32
32
|
attr_accessor :parent
|
33
33
|
|
34
|
+
##
|
35
|
+
# Is this file a binary file? Defaults to true if config passed to Page.new.
|
36
|
+
|
37
|
+
attr_accessor :binary
|
38
|
+
alias binary? binary
|
39
|
+
|
34
40
|
##
|
35
41
|
# Returns a regexp that will match file extensions for all known
|
36
42
|
# renderer types.
|
@@ -49,6 +55,7 @@ module Zenweb
|
|
49
55
|
# TODO: make sure that creating page /a.html strips leading / from path
|
50
56
|
@site, @path = site, path
|
51
57
|
@config = config if config
|
58
|
+
@binary = config
|
52
59
|
|
53
60
|
self.filetypes.each do |type|
|
54
61
|
send "extend_#{type}" if self.respond_to? "extend_#{type}"
|
@@ -90,7 +97,11 @@ module Zenweb
|
|
90
97
|
@body ||= begin
|
91
98
|
thing = File.file?(path) ? path : self
|
92
99
|
_, body = Zenweb::Config.split thing
|
93
|
-
|
100
|
+
if self.binary? then
|
101
|
+
body
|
102
|
+
else
|
103
|
+
body.strip
|
104
|
+
end
|
94
105
|
end
|
95
106
|
end
|
96
107
|
|
@@ -259,7 +270,11 @@ module Zenweb
|
|
259
270
|
content = self.render
|
260
271
|
|
261
272
|
open url_path, "w" do |f|
|
262
|
-
|
273
|
+
if binary? then
|
274
|
+
f.print content
|
275
|
+
else
|
276
|
+
f.puts content
|
277
|
+
end
|
263
278
|
end
|
264
279
|
end
|
265
280
|
|
data/test/test_zenweb_page.rb
CHANGED
@@ -163,6 +163,14 @@ class TestZenwebPage < Minitest::Test
|
|
163
163
|
assert_equal exp, top.sitemap(:title_dated)
|
164
164
|
end
|
165
165
|
|
166
|
+
def test_binary
|
167
|
+
page = Zenweb::Page.new site, "blah"
|
168
|
+
refute_predicate page, :binary?
|
169
|
+
|
170
|
+
page = Zenweb::Page.new site, "blah", site.config
|
171
|
+
assert_predicate page, :binary?
|
172
|
+
end
|
173
|
+
|
166
174
|
def test_body
|
167
175
|
assert_equal "Not really much here to see.", page.body
|
168
176
|
end
|
@@ -263,6 +271,25 @@ class TestZenwebPage < Minitest::Test
|
|
263
271
|
end
|
264
272
|
end
|
265
273
|
|
274
|
+
def test_generate_binary
|
275
|
+
page = Zenweb::Page.new site, "blah", site.config
|
276
|
+
|
277
|
+
def page.render
|
278
|
+
"woot"
|
279
|
+
end
|
280
|
+
|
281
|
+
def page.open path, mode
|
282
|
+
yield $stdout
|
283
|
+
end
|
284
|
+
|
285
|
+
out = "woot"
|
286
|
+
err = "Rendering .site/blah\n"
|
287
|
+
|
288
|
+
assert_output out, err do
|
289
|
+
page.generate
|
290
|
+
end
|
291
|
+
end
|
292
|
+
|
266
293
|
def test_generate_via_invoke
|
267
294
|
Rake.application = Rake::Application.new
|
268
295
|
site.scan
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zenweb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Davis
|
@@ -29,7 +29,7 @@ cert_chain:
|
|
29
29
|
qx3h45R1CAsObX0SQDIT+rRbQrtKz1GHIZTOFYvEJjUY1XmRTZupD3CJ8Q7sDqSy
|
30
30
|
NLq5jm1fq6Y9Uolu3RJbmycf
|
31
31
|
-----END CERTIFICATE-----
|
32
|
-
date: 2015-12-
|
32
|
+
date: 2015-12-21 00:00:00.000000000 Z
|
33
33
|
dependencies:
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: rake
|
metadata.gz.sig
CHANGED
Binary file
|