zenweb 3.10.8 → 3.11.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 448821783e1068f92a0284e93d3072d8501cf21cc0ab94da3f6fc63d251de7d0
4
- data.tar.gz: 314bda2c7bc1882f01e5c7b5ff37da023dc46bfd7e0b73de67e605f7260e20f0
3
+ metadata.gz: f8864678bb1d4420008d2289a77fcc9f14389c54c293ad1bebef6690e23d5b2e
4
+ data.tar.gz: 5ddaa8d510daccc1b189258c409c68f5418ec59424015c8373ee9ac4237eb5bf
5
5
  SHA512:
6
- metadata.gz: d4753d177c0ab4b46a58e929f57e1d1c26fcda263c24aa7cc2d0b7875b2b13a2103903664af997a2c15b8903ce7d2d74dc9a13838947338c7ef4d5e45f4602de
7
- data.tar.gz: 0d59fdbee4361cce03ef42aac407a39dd25ee2a4a025964de78ab50b5b68ef070d2a54c1b8ef95d0b03d0c07785606978f19367cbd8beeba3c046c17990c3c84
6
+ metadata.gz: 8a59ab5a91b985b16346bdf03d8f058ce6910aae7e6986c4cbaccdecbd4f23482a3f4628692f0d1ed0cda08d09306197ec98bc1afdfc3626ebfccf1cb82dc25b
7
+ data.tar.gz: 20ec7695d083ffe7f069349bc1f512e86d6a655e120935a90596b6a49ea84e289e069970b812c8b9c729c212c865d8742bf5a34c65cfa470179aa03d9640554c
checksums.yaml.gz.sig CHANGED
Binary file
data/History.rdoc CHANGED
@@ -1,3 +1,18 @@
1
+ === 3.11.1 / 2024-08-22
2
+
3
+ * 4 bug fixes:
4
+
5
+ * Deleted long dead (~2.0) code.
6
+ * Fixed 2.7 (only?!) frozen string literal bug.
7
+ * Modified 'rake run' task to regenerate more consistently.
8
+ * Removed ancient Enumerable#chunk implementation.
9
+
10
+ === 3.11.0 / 2023-09-28
11
+
12
+ * 1 minor enhancement:
13
+
14
+ * Added Page#link_head helper method to clean up <link...> tags
15
+
1
16
  === 3.10.8 / 2023-08-30
2
17
 
3
18
  * 1 bug fix:
@@ -22,8 +22,8 @@ rss_length: 15
22
22
  <email>{{ email }}</email>
23
23
  </author>
24
24
 
25
- <link href="{{ feed_url }}" rel="self"/>
26
- <link href="{{ domain }}/"/>
25
+ {{ link_head href:feed_url, rel:"self" }}
26
+ {{ link_head href:domain }}
27
27
 
28
28
  <rights> © {{ author }} - {{ email }} </rights>
29
29
 
@@ -33,7 +33,7 @@ rss_length: 15
33
33
  <title>{{ h post.title }}</title>
34
34
  <updated>{{ post.date.iso8601 }}</updated>
35
35
 
36
- <link rel="alternate" href="{{ domain }}{{ post.url }}"/>
36
+ {{ link_head rel:"alternate", href:"{{ domain }}{{ post.url }}" }}
37
37
 
38
38
  <published>{{ post.date.iso8601 }}</published>
39
39
  <content type="html">{{ h post.subrender }}</content>
data/lib/zenweb/config.rb CHANGED
@@ -55,8 +55,7 @@ module Zenweb
55
55
  h.key?(k.to_s) or parent.key?(k)
56
56
  end
57
57
 
58
- UTF_BOM = "\xEF\xBB\xBF"
59
- UTF_BOM.force_encoding "binary" if File::RUBY19
58
+ UTF_BOM = "\xEF\xBB\xBF".b
60
59
 
61
60
  ##
62
61
  # Splits a file and returns the yaml header and body, as applicable.
@@ -75,7 +74,7 @@ module Zenweb
75
74
 
76
75
  yaml_file = File.extname(path) == ".yml"
77
76
 
78
- body.force_encoding "utf-8" if File::RUBY19
77
+ body.force_encoding Encoding::UTF_8
79
78
  else
80
79
  body = path.content
81
80
  end
@@ -10,24 +10,6 @@ def File.each_parent dir, file
10
10
  end
11
11
 
12
12
  module Enumerable
13
- def chunk
14
- bin, result, prev = [], [], Object.new
15
-
16
- each do |o|
17
- curr = yield o
18
-
19
- if prev != curr then
20
- bin = []
21
- result << [curr, bin]
22
- prev = curr
23
- end
24
-
25
- bin << o
26
- end
27
-
28
- result
29
- end unless [].respond_to? :chunk
30
-
31
13
  def multi_group_by
32
14
  r = Hash.new { |h,k| h[k] = [] }
33
15
  each do |o|
@@ -54,20 +36,6 @@ class Array # :nodoc:
54
36
  end
55
37
  end
56
38
 
57
- class File # :nodoc:
58
- RUBY19 = "<3".respond_to? :encoding # :nodoc:
59
-
60
- class << self
61
- alias :binread :read unless RUBY19
62
- end
63
- end
64
-
65
- class String # :nodoc:
66
- def valid_encoding? # :nodoc:
67
- true
68
- end unless File::RUBY19
69
- end
70
-
71
39
  class Time # :nodoc:
72
40
  ##
73
41
  # Format as YYYY-MM-DD
data/lib/zenweb/page.rb CHANGED
@@ -311,8 +311,7 @@ module Zenweb
311
311
  end
312
312
  @layout
313
313
  rescue => e
314
- e.message.concat " for page #{path.inspect}"
315
- raise e
314
+ raise e.exception "%s for page %p" % [e.message, path]
316
315
  end
317
316
 
318
317
  ##
@@ -330,6 +329,13 @@ module Zenweb
330
329
  %(<meta #{label}="#{name}" content="#{val}">) if val
331
330
  end
332
331
 
332
+ ##
333
+ # Stupid helper method to make declaring header link lines cleaner
334
+
335
+ def link_head **kws
336
+ %(<link #{kws.map { |k,v| "#{k}=#{v.inspect}" }.join " "} />)
337
+ end
338
+
333
339
  ##
334
340
  # Access a config variable and only warn if it isn't accessible.
335
341
  # If +msg+ starts with render, go ahead and pass that up to the
@@ -373,7 +379,7 @@ module Zenweb
373
379
  # Stupid helper method to make declaring stylesheets cleaner
374
380
 
375
381
  def stylesheet name
376
- %(<link rel="stylesheet" type="text/css" href="/css/#{name}.css">)
382
+ link_head rel:"stylesheet", type:"text/css", href:"/css/#{name}.css"
377
383
  end
378
384
 
379
385
  ##
@@ -3,7 +3,7 @@ require 'zenweb'
3
3
  task :default => :generate
4
4
 
5
5
  def website
6
- return $website if defined?($website)
6
+ return $website if defined?($website) && $website
7
7
  $website = Zenweb::Site.new
8
8
  $website.scan
9
9
  $website.wire
@@ -153,19 +153,17 @@ task :run do
153
153
 
154
154
  warn "NOTE: No file found for #{url}" unless task
155
155
 
156
- newer = task && task.needed?
156
+ if task then
157
+ if task.needed? then
158
+ unless system "#{Gem.ruby} -S rake -q clean generate" then
159
+ warn "WARNING: couldn't run 'rake clean generate' properly, exited: %p" % [$?]
160
+ end
161
+ end
157
162
 
158
- if newer then
159
- system "rake clean generate"
160
- end
161
-
162
- if task && newer then
163
- @@site = nil
163
+ @@site = $website = nil
164
164
  Rake.application = Rake::Application.new # reset
165
165
  end
166
166
 
167
- task.clear_timestamp if task && target_path =~ /(html|css|js)$/
168
-
169
167
  super
170
168
  end
171
169
  end
data/lib/zenweb.rb CHANGED
@@ -6,7 +6,7 @@ require "time"
6
6
 
7
7
  module Zenweb
8
8
  # duh
9
- VERSION = "3.10.8"
9
+ VERSION = "3.11.1"
10
10
  end
11
11
 
12
12
  require "zenweb/site"
@@ -366,8 +366,8 @@ class TestZenwebPage < Minitest::Test
366
366
  e = assert_raises NoMethodError do
367
367
  assert_nil page.render_wtf
368
368
  end
369
- err = "undefined method `render_wtf' for Page"
370
- assert_includes e.message, err
369
+
370
+ assert_match(/undefined method `render_wtf' for.*?Zenweb::Page/, e.message)
371
371
  end
372
372
 
373
373
  def test_layout_nil_string
@@ -441,7 +441,7 @@ class TestZenwebPage < Minitest::Test
441
441
  end
442
442
 
443
443
  def test_stylesheet
444
- exp = %(<link rel="stylesheet" type="text/css" href="/css/woot.css">)
444
+ exp = %(<link rel="stylesheet" type="text/css" href="/css/woot.css" />)
445
445
  assert_equal exp, page.stylesheet("woot")
446
446
  end
447
447
 
data.tar.gz.sig CHANGED
Binary file
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.10.8
4
+ version: 3.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Davis
@@ -10,9 +10,9 @@ bindir: bin
10
10
  cert_chain:
11
11
  - |
12
12
  -----BEGIN CERTIFICATE-----
13
- MIIDPjCCAiagAwIBAgIBBzANBgkqhkiG9w0BAQsFADBFMRMwEQYDVQQDDApyeWFu
13
+ MIIDPjCCAiagAwIBAgIBCDANBgkqhkiG9w0BAQsFADBFM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Tv6iBi4LwMReqnFrpNLMOWJw7xi8x+3eL2
26
+ XS09ZPNOt2zm70KmFouBMgOysnDY4k2dE8uF6B8JbZOO8QfalW+CoNBliefOTcn2
27
+ bg5IOP7UoGM5lC174/cbDJrJnRG9bzig5FAP0mvsgA8zgTRXQzIUAZEo92D5K7p4
28
+ B4/O998ho6BSOgYBI9Yk1ttdCtti6Y+8N9+fZESsjtWMykA+WXWeGUScHqiU+gH8
29
+ S7043fq9EbQdBr2AXdj92+CDwuTfHI6/Hj5FVBDULufrJaan4xUgL70Hvc6pTTeW
30
+ deKfBjgVAq7EYHu1AczzlUly
31
31
  -----END CERTIFICATE-----
32
- date: 2023-08-30 00:00:00.000000000 Z
32
+ date: 2024-08-22 00:00:00.000000000 Z
33
33
  dependencies:
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: rake
@@ -161,14 +161,14 @@ dependencies:
161
161
  requirements:
162
162
  - - "~>"
163
163
  - !ruby/object:Gem::Version
164
- version: '4.0'
164
+ version: '4.2'
165
165
  type: :development
166
166
  prerelease: false
167
167
  version_requirements: !ruby/object:Gem::Requirement
168
168
  requirements:
169
169
  - - "~>"
170
170
  - !ruby/object:Gem::Version
171
- version: '4.0'
171
+ version: '4.2'
172
172
  description: |-
173
173
  Zenweb is a set of classes/tools for organizing and formating a
174
174
  website. It is website oriented rather than webpage oriented, unlike
@@ -283,7 +283,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
283
283
  - !ruby/object:Gem::Version
284
284
  version: '0'
285
285
  requirements: []
286
- rubygems_version: 3.4.10
286
+ rubygems_version: 3.5.15
287
287
  signing_key:
288
288
  specification_version: 4
289
289
  summary: Zenweb is a set of classes/tools for organizing and formating a website
metadata.gz.sig CHANGED
Binary file