zenweb 3.11.1 → 3.12.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.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/History.rdoc +12 -0
- data/lib/zenweb/page.rb +33 -14
- data/lib/zenweb/plugins/disqus.rb +2 -2
- data/lib/zenweb/site.rb +1 -1
- data/lib/zenweb.rb +1 -1
- data/test/test_zenweb_page.rb +16 -20
- data/test/test_zenweb_plugins_disqus.rb +1 -1
- data/test/test_zenweb_plugins_erb.rb +5 -1
- data/test/test_zenweb_site.rb +3 -3
- data.tar.gz.sig +0 -0
- metadata +21 -21
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d5d65b2aa52df8d273f1d9495c817afaec7e29c5628106c28feced37ea7cf988
|
|
4
|
+
data.tar.gz: c8f3ce1cd5a8528ee6d8302a0173c2b3673870378458c0a0dba4b26ad5eb280b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6170ff66ec3020cd0ec7f268f05a220e799601b8ba1899b0ab15ce769eab9b3ce98ff9ca89ad400109324908444d93e31eb47b116cae01f815f6fdb5d58b8acc
|
|
7
|
+
data.tar.gz: a4dd4c2f449052627667eb862fce8f34f7a74f5d3b2b537cacdfd8b03b0d90d086133bab7d5cd1205c01a460da50636a0878ee0413399eb1a55a24ee011d13c9
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data/History.rdoc
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
=== 3.12.0 / 2026-01-29
|
|
2
|
+
|
|
3
|
+
* 2 minor enhancements:
|
|
4
|
+
|
|
5
|
+
* Added Binary subclass of Page: copies file and preserves dates.
|
|
6
|
+
* Disabled Page#binary and friends.
|
|
7
|
+
|
|
8
|
+
* 2 bug fixes:
|
|
9
|
+
|
|
10
|
+
* Added ability to specify change_frequency in config to force a page's value.
|
|
11
|
+
* Fixed disqus urls to use https.
|
|
12
|
+
|
|
1
13
|
=== 3.11.1 / 2024-08-22
|
|
2
14
|
|
|
3
15
|
* 4 bug fixes:
|
data/lib/zenweb/page.rb
CHANGED
|
@@ -31,11 +31,13 @@ module Zenweb
|
|
|
31
31
|
|
|
32
32
|
attr_accessor :parent
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
# :stopdoc:
|
|
35
|
+
def binary = warn "Page#binary is deprecated. Use Zenweb::Binary instead."
|
|
36
|
+
def binary= o
|
|
37
|
+
warn "Page#binary= is deprecated. Use Zenweb::Binary instead."
|
|
38
|
+
end
|
|
38
39
|
alias binary? binary
|
|
40
|
+
# :startdoc:
|
|
39
41
|
|
|
40
42
|
##
|
|
41
43
|
# Returns a regexp that will match file extensions for all known
|
|
@@ -98,11 +100,7 @@ module Zenweb
|
|
|
98
100
|
@body ||= begin
|
|
99
101
|
thing = File.file?(path) ? path : self
|
|
100
102
|
_, body = Zenweb::Config.split thing
|
|
101
|
-
|
|
102
|
-
body
|
|
103
|
-
else
|
|
104
|
-
body.strip
|
|
105
|
-
end
|
|
103
|
+
body.strip
|
|
106
104
|
end
|
|
107
105
|
end
|
|
108
106
|
|
|
@@ -193,6 +191,8 @@ module Zenweb
|
|
|
193
191
|
end
|
|
194
192
|
|
|
195
193
|
def change_frequency
|
|
194
|
+
return config["change_frequency"] if config["change_frequency"]
|
|
195
|
+
|
|
196
196
|
days_old = (Time.now - self.date).to_i / 86400
|
|
197
197
|
|
|
198
198
|
case days_old
|
|
@@ -271,11 +271,7 @@ module Zenweb
|
|
|
271
271
|
content = self.render
|
|
272
272
|
|
|
273
273
|
open url_path, "w" do |f|
|
|
274
|
-
|
|
275
|
-
f.print content
|
|
276
|
-
else
|
|
277
|
-
f.puts content
|
|
278
|
-
end
|
|
274
|
+
f.puts content
|
|
279
275
|
end
|
|
280
276
|
end
|
|
281
277
|
|
|
@@ -504,6 +500,29 @@ module Zenweb
|
|
|
504
500
|
attr_accessor :date
|
|
505
501
|
end
|
|
506
502
|
|
|
503
|
+
##
|
|
504
|
+
# A file representing a binary. This file is not rendered in any
|
|
505
|
+
# way, and doesn't have the usual dependencies because its content
|
|
506
|
+
# would not be modified to changes in config or the like.
|
|
507
|
+
|
|
508
|
+
class Binary < Page
|
|
509
|
+
def generate
|
|
510
|
+
warn "Copying #{url_path}"
|
|
511
|
+
cp path, url_path, preserve:true, verbose: Rake.application.options.trace
|
|
512
|
+
# touch url_path, mtime: date, verbose: Rake.application.options.trace
|
|
513
|
+
end
|
|
514
|
+
|
|
515
|
+
def wire
|
|
516
|
+
file self.path
|
|
517
|
+
directory url_dir
|
|
518
|
+
file url_path => url_dir
|
|
519
|
+
file url_path => path do
|
|
520
|
+
self.generate
|
|
521
|
+
end
|
|
522
|
+
task :site => url_path
|
|
523
|
+
end
|
|
524
|
+
end
|
|
525
|
+
|
|
507
526
|
##
|
|
508
527
|
# Generates a virtual page with an index of all tags on the given pages.
|
|
509
528
|
# You must subclass and provide a content method.
|
|
@@ -5,7 +5,7 @@ class Zenweb::Page
|
|
|
5
5
|
|
|
6
6
|
def disqus shortname
|
|
7
7
|
'<div id="disqus_thread"></div>' +
|
|
8
|
-
run_js_script("
|
|
8
|
+
run_js_script("https://#{shortname}.disqus.com/embed.js")
|
|
9
9
|
end
|
|
10
10
|
|
|
11
11
|
##
|
|
@@ -13,6 +13,6 @@ class Zenweb::Page
|
|
|
13
13
|
# disqus comment counts.
|
|
14
14
|
|
|
15
15
|
def disqus_counts shortname
|
|
16
|
-
run_js_script "
|
|
16
|
+
run_js_script "https://#{shortname}.disqus.com/count.js"
|
|
17
17
|
end
|
|
18
18
|
end
|
data/lib/zenweb/site.rb
CHANGED
|
@@ -197,7 +197,7 @@ module Zenweb
|
|
|
197
197
|
when /\.yml$/ then
|
|
198
198
|
@configs[path] = Config.new self, path
|
|
199
199
|
when /\.(?:#{self.class.binary_files.join("|")})$/ then
|
|
200
|
-
@pages[path] =
|
|
200
|
+
@pages[path] = Binary.new self, path, self.config
|
|
201
201
|
when /\.(?:#{self.class.text_files.join("|")})$/, renderers_re then
|
|
202
202
|
@pages[path] = Page.new self, path
|
|
203
203
|
else
|
data/lib/zenweb.rb
CHANGED
data/test/test_zenweb_page.rb
CHANGED
|
@@ -147,16 +147,18 @@ class TestZenwebPage < Minitest::Test
|
|
|
147
147
|
assert_equal exp, top.sitemap(:title_dated)
|
|
148
148
|
end
|
|
149
149
|
|
|
150
|
-
def
|
|
151
|
-
|
|
152
|
-
|
|
150
|
+
def test_body
|
|
151
|
+
assert_equal "Not really much here to see.", page.body
|
|
152
|
+
end
|
|
153
153
|
|
|
154
|
-
|
|
155
|
-
|
|
154
|
+
def test_change_frequency
|
|
155
|
+
assert_equal "yearly", page.change_frequency
|
|
156
156
|
end
|
|
157
157
|
|
|
158
|
-
def
|
|
159
|
-
|
|
158
|
+
def test_change_frequency__config
|
|
159
|
+
page.config.h["change_frequency"] = "daily"
|
|
160
|
+
|
|
161
|
+
assert_equal "daily", page.change_frequency
|
|
160
162
|
end
|
|
161
163
|
|
|
162
164
|
def test_breadcrumbs
|
|
@@ -256,18 +258,12 @@ class TestZenwebPage < Minitest::Test
|
|
|
256
258
|
end
|
|
257
259
|
|
|
258
260
|
def test_generate_binary
|
|
259
|
-
page = Zenweb::
|
|
260
|
-
|
|
261
|
-
def page.
|
|
262
|
-
"woot"
|
|
263
|
-
end
|
|
264
|
-
|
|
265
|
-
def page.open path, mode
|
|
266
|
-
yield $stdout
|
|
267
|
-
end
|
|
261
|
+
page = Zenweb::Binary.new site, "blah", site.config
|
|
262
|
+
def page.cp(...) = puts "copy!" # just shows it got called
|
|
263
|
+
def page.date = Time.now
|
|
268
264
|
|
|
269
|
-
out = "
|
|
270
|
-
err = "
|
|
265
|
+
out = "copy!\n"
|
|
266
|
+
err = "Copying .site/blah\n"
|
|
271
267
|
|
|
272
268
|
assert_output out, err do
|
|
273
269
|
page.generate
|
|
@@ -359,7 +355,7 @@ class TestZenwebPage < Minitest::Test
|
|
|
359
355
|
assert_nil page.method_missing("wtf")
|
|
360
356
|
end
|
|
361
357
|
|
|
362
|
-
|
|
358
|
+
assert_match(/undefined method .wtf'/, e.message)
|
|
363
359
|
end
|
|
364
360
|
|
|
365
361
|
def test_method_missing_render
|
|
@@ -367,7 +363,7 @@ class TestZenwebPage < Minitest::Test
|
|
|
367
363
|
assert_nil page.render_wtf
|
|
368
364
|
end
|
|
369
365
|
|
|
370
|
-
assert_match(/undefined method
|
|
366
|
+
assert_match(/undefined method .render_wtf' for.*?Zenweb::Page/, e.message)
|
|
371
367
|
end
|
|
372
368
|
|
|
373
369
|
def test_layout_nil_string
|
|
@@ -23,7 +23,7 @@ class TestZenwebPageDisqus < Minitest::Test
|
|
|
23
23
|
var s = document.createElement('script');
|
|
24
24
|
s.type = 'text/javascript';
|
|
25
25
|
s.async = true;
|
|
26
|
-
s.src = '
|
|
26
|
+
s.src = 'https://myshortname.disqus.com/#{name}.js';
|
|
27
27
|
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(s);
|
|
28
28
|
})();
|
|
29
29
|
</script>
|
|
@@ -49,13 +49,17 @@ class TestZenwebPageErb < Minitest::Test
|
|
|
49
49
|
assert e.backtrace.grep('Page["blog/2012-01-02-page1.html.md"]:1')
|
|
50
50
|
end
|
|
51
51
|
|
|
52
|
+
def prism? # yuck! but prism is injecting ansi codes everywhere!
|
|
53
|
+
RubyVM::InstructionSequence.compile("").to_a[4][:parser] == :prism
|
|
54
|
+
end
|
|
55
|
+
|
|
52
56
|
def test_erb_syntax_error
|
|
53
57
|
e = assert_raises SyntaxError do
|
|
54
58
|
page.erb "this is {{ 1 + }} content", page
|
|
55
59
|
end
|
|
56
60
|
|
|
57
61
|
# in 2.5 this changes from concat to <<, but the syntax error stays
|
|
58
|
-
assert_includes e.message, "(( 1 + ).to_s)"
|
|
62
|
+
assert_includes e.message, "(( 1 + ).to_s)" unless prism?
|
|
59
63
|
assert e.backtrace.grep('Page["blog/2012-01-02-page1.html.md"]:1')
|
|
60
64
|
end
|
|
61
65
|
end
|
data/test/test_zenweb_site.rb
CHANGED
|
@@ -166,9 +166,9 @@ class TestZenwebSite < Minitest::Test
|
|
|
166
166
|
|
|
167
167
|
assert_equal exp, site.pages.keys.sort
|
|
168
168
|
|
|
169
|
-
exp = [Zenweb::Page]
|
|
169
|
+
exp = [Zenweb::Binary, Zenweb::Page]
|
|
170
170
|
|
|
171
|
-
assert_equal exp, site.pages.values.map(&:class).uniq
|
|
171
|
+
assert_equal exp, site.pages.values.map(&:class).uniq.sort_by(&:name)
|
|
172
172
|
end
|
|
173
173
|
|
|
174
174
|
def test_pages_by_date
|
|
@@ -278,7 +278,7 @@ class TestZenwebSite < Minitest::Test
|
|
|
278
278
|
assert_task "css/colors.css.less", %w[_config.yml]
|
|
279
279
|
assert_task "css/styles.css", %w[_config.yml]
|
|
280
280
|
assert_task "css/syntax.css", %w[_config.yml]
|
|
281
|
-
assert_task "img/bg.png"
|
|
281
|
+
assert_task "img/bg.png"
|
|
282
282
|
assert_task "js/jquery.js", %w[_config.yml]
|
|
283
283
|
assert_task "js/site.js", %w[_config.yml]
|
|
284
284
|
assert_task "sitemap.xml.erb", %w[_config.yml]
|
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: zenweb
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.
|
|
4
|
+
version: 3.12.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ryan Davis
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain:
|
|
11
10
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kr0bHGf9/MRZJWcw51urueNycBXu1Xh+pEN8qBmYsFRR4SIODLClybAO
|
|
28
|
+
6cbm2PyPQgKNiqE4H+IQrDVHd9bJs1XgLElk3qoaJBWXc/5fy0J1imYb25UqmiHG
|
|
29
|
+
snGe1hrppvBRdcyEzvhfIPjI
|
|
31
30
|
-----END CERTIFICATE-----
|
|
32
|
-
date:
|
|
31
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
33
32
|
dependencies:
|
|
34
33
|
- !ruby/object:Gem::Dependency
|
|
35
34
|
name: rake
|
|
@@ -141,35 +140,35 @@ dependencies:
|
|
|
141
140
|
requirements:
|
|
142
141
|
- - ">="
|
|
143
142
|
- !ruby/object:Gem::Version
|
|
144
|
-
version: '
|
|
143
|
+
version: '6.0'
|
|
145
144
|
- - "<"
|
|
146
145
|
- !ruby/object:Gem::Version
|
|
147
|
-
version: '
|
|
146
|
+
version: '8'
|
|
148
147
|
type: :development
|
|
149
148
|
prerelease: false
|
|
150
149
|
version_requirements: !ruby/object:Gem::Requirement
|
|
151
150
|
requirements:
|
|
152
151
|
- - ">="
|
|
153
152
|
- !ruby/object:Gem::Version
|
|
154
|
-
version: '
|
|
153
|
+
version: '6.0'
|
|
155
154
|
- - "<"
|
|
156
155
|
- !ruby/object:Gem::Version
|
|
157
|
-
version: '
|
|
156
|
+
version: '8'
|
|
158
157
|
- !ruby/object:Gem::Dependency
|
|
159
158
|
name: hoe
|
|
160
159
|
requirement: !ruby/object:Gem::Requirement
|
|
161
160
|
requirements:
|
|
162
161
|
- - "~>"
|
|
163
162
|
- !ruby/object:Gem::Version
|
|
164
|
-
version: '4.
|
|
163
|
+
version: '4.6'
|
|
165
164
|
type: :development
|
|
166
165
|
prerelease: false
|
|
167
166
|
version_requirements: !ruby/object:Gem::Requirement
|
|
168
167
|
requirements:
|
|
169
168
|
- - "~>"
|
|
170
169
|
- !ruby/object:Gem::Version
|
|
171
|
-
version: '4.
|
|
172
|
-
description:
|
|
170
|
+
version: '4.6'
|
|
171
|
+
description: |
|
|
173
172
|
Zenweb is a set of classes/tools for organizing and formating a
|
|
174
173
|
website. It is website oriented rather than webpage oriented, unlike
|
|
175
174
|
most rendering tools. It is content oriented, rather than style
|
|
@@ -183,6 +182,8 @@ description: |-
|
|
|
183
182
|
Zenweb uses rake to handle dependencies. As a result, scanning a
|
|
184
183
|
website and regenerating incrementally is not just possible, it is
|
|
185
184
|
blazingly fast.
|
|
185
|
+
|
|
186
|
+
==== To Install:
|
|
186
187
|
email:
|
|
187
188
|
- ryand-ruby@zenspider.com
|
|
188
189
|
executables: []
|
|
@@ -266,7 +267,7 @@ licenses:
|
|
|
266
267
|
metadata:
|
|
267
268
|
homepage_uri: https://github.com/seattlerb/zenweb
|
|
268
269
|
bug_tracker_uri: https://github.com/seattlerb/zenweb/issues
|
|
269
|
-
|
|
270
|
+
documentation_uri: http://docs.seattlerb.org/zenweb
|
|
270
271
|
rdoc_options:
|
|
271
272
|
- "--main"
|
|
272
273
|
- README.rdoc
|
|
@@ -283,8 +284,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
283
284
|
- !ruby/object:Gem::Version
|
|
284
285
|
version: '0'
|
|
285
286
|
requirements: []
|
|
286
|
-
rubygems_version: 3.
|
|
287
|
-
signing_key:
|
|
287
|
+
rubygems_version: 3.7.2
|
|
288
288
|
specification_version: 4
|
|
289
289
|
summary: Zenweb is a set of classes/tools for organizing and formating a website
|
|
290
290
|
test_files: []
|
metadata.gz.sig
CHANGED
|
Binary file
|