zenweb 3.1.1 → 3.2.0

Sign up to get free protection for your applications and to get access to all the features.
data.tar.gz.sig CHANGED
Binary file
data/History.txt CHANGED
@@ -1,3 +1,11 @@
1
+ === 3.2.0 / 2013-08-19
2
+
3
+ * 3 minor enhancements:
4
+
5
+ * Added Page#stale?
6
+ * Added Site#stale? and Site#stale_pages.
7
+ * Added stale rake task
8
+
1
9
  === 3.1.1 / 2013-04-18
2
10
 
3
11
  * 1 bug fix:
data/lib/zenweb.rb CHANGED
@@ -6,7 +6,7 @@ require "time"
6
6
 
7
7
  module Zenweb
8
8
  # duh
9
- VERSION = "3.1.1"
9
+ VERSION = "3.2.0"
10
10
  end
11
11
 
12
12
  require "zenweb/site"
data/lib/zenweb/page.rb CHANGED
@@ -330,6 +330,10 @@ module Zenweb
330
330
  content
331
331
  end
332
332
 
333
+ def stale?
334
+ file(url_path).needed?
335
+ end
336
+
333
337
  ##
334
338
  # Render a Page instance based on its filetypes. For example,
335
339
  # index.html.md.erb will essentially call:
data/lib/zenweb/site.rb CHANGED
@@ -197,6 +197,14 @@ module Zenweb
197
197
  @text_files ||= %w[txt html css js]
198
198
  end
199
199
 
200
+ def stale_pages
201
+ pages.values.find_all(&:stale?)
202
+ end
203
+
204
+ def stale?
205
+ not stale_pages.empty?
206
+ end
207
+
200
208
  def fix_subpages # :nodoc:
201
209
  parents = {}
202
210
  @pages.values.select(&:index?).each do |p|
@@ -52,6 +52,11 @@ task :realclean => :clean do
52
52
  rm_rf ".site"
53
53
  end
54
54
 
55
+ task :stale do
56
+ stale = website.stale_pages
57
+ puts stale unless stale.empty?
58
+ end
59
+
55
60
  def new_file title, dir = ".", date = false
56
61
  path = "#{title.strip.downcase.gsub(/\W+/, '-')}.html.md"
57
62
 
data/test/helper.rb CHANGED
@@ -1,4 +1,4 @@
1
- class MiniTest::Unit::TestCase
1
+ class Minitest::Test
2
2
  def self.ChdirTest path
3
3
  Module.new do
4
4
  define_method :setup do
@@ -9,7 +9,7 @@ require "minitest/autorun"
9
9
  require "zenweb/site"
10
10
  require "test/helper"
11
11
 
12
- class TestZenwebConfig < MiniTest::Unit::TestCase
12
+ class TestZenwebConfig < Minitest::Test
13
13
  include ChdirTest("example-site")
14
14
 
15
15
  attr_accessor :site, :config
@@ -4,7 +4,7 @@ require "rubygems"
4
4
  require "minitest/autorun"
5
5
  require "zenweb/extensions"
6
6
 
7
- class TestArray < MiniTest::Unit::TestCase
7
+ class TestArray < Minitest::Test
8
8
  def test_deep_each
9
9
  act = []
10
10
  [1, 2, [3, [4], 5], 6].deep_each do |n, o|
@@ -36,7 +36,7 @@ class TestArray < MiniTest::Unit::TestCase
36
36
  end
37
37
  end
38
38
 
39
- class TestFile < MiniTest::Unit::TestCase
39
+ class TestFile < Minitest::Test
40
40
  def test_class_each_parent
41
41
  a = []
42
42
 
@@ -50,7 +50,7 @@ class TestFile < MiniTest::Unit::TestCase
50
50
  end
51
51
  end
52
52
 
53
- class TestTime < MiniTest::Unit::TestCase
53
+ class TestTime < Minitest::Test
54
54
  def test_date
55
55
  assert_equal "1969-12-31", Time.local(1969,12,31,16,0).date
56
56
  end
@@ -6,7 +6,7 @@ require "minitest/autorun"
6
6
  require "zenweb/site"
7
7
  require "test/helper"
8
8
 
9
- class TestZenwebPage < MiniTest::Unit::TestCase
9
+ class TestZenwebPage < Minitest::Test
10
10
  include ChdirTest("example-site")
11
11
 
12
12
  attr_accessor :site, :page
@@ -6,7 +6,7 @@ require "minitest/autorun"
6
6
  require "zenweb/site"
7
7
  require "test/helper"
8
8
 
9
- class TestZenwebPageDisqus < MiniTest::Unit::TestCase
9
+ class TestZenwebPageDisqus < Minitest::Test
10
10
  attr_accessor :site, :page
11
11
 
12
12
  def setup
@@ -6,7 +6,7 @@ require "minitest/autorun"
6
6
  require "zenweb/site"
7
7
  require "test/helper"
8
8
 
9
- class TestZenwebPageErb < MiniTest::Unit::TestCase
9
+ class TestZenwebPageErb < Minitest::Test
10
10
  include ChdirTest("example-site")
11
11
 
12
12
  attr_accessor :site, :page
@@ -6,7 +6,7 @@ require "minitest/autorun"
6
6
  require "zenweb/site"
7
7
  require "test/helper"
8
8
 
9
- class TestZenwebPageGoogle < MiniTest::Unit::TestCase
9
+ class TestZenwebPageGoogle < Minitest::Test
10
10
  include ChdirTest("example-site")
11
11
 
12
12
  attr_accessor :site, :page
@@ -6,7 +6,7 @@ require "minitest/autorun"
6
6
  require "zenweb/site"
7
7
  require "test/helper"
8
8
 
9
- class TestZenwebPageLess < MiniTest::Unit::TestCase
9
+ class TestZenwebPageLess < Minitest::Test
10
10
  include ChdirTest("example-site")
11
11
 
12
12
  attr_accessor :site, :page
@@ -6,7 +6,7 @@ require "minitest/autorun"
6
6
  require "zenweb/site"
7
7
  require "test/helper"
8
8
 
9
- class TestZenwebPageMarkdown < MiniTest::Unit::TestCase
9
+ class TestZenwebPageMarkdown < Minitest::Test
10
10
  include ChdirTest("example-site")
11
11
 
12
12
  attr_accessor :site, :page
@@ -10,7 +10,7 @@ class Zenweb::Site
10
10
  attr_writer :layouts
11
11
  end
12
12
 
13
- class TestZenwebSite < MiniTest::Unit::TestCase
13
+ class TestZenwebSite < Minitest::Test
14
14
  include ChdirTest("example-site")
15
15
 
16
16
  attr_accessor :site
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zenweb
3
3
  version: !ruby/object:Gem::Version
4
- hash: 1
4
+ hash: 15
5
5
  prerelease:
6
6
  segments:
7
7
  - 3
8
- - 1
9
- - 1
10
- version: 3.1.1
8
+ - 2
9
+ - 0
10
+ version: 3.2.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ryan Davis
@@ -36,7 +36,7 @@ cert_chain:
36
36
  FBHgymkyj/AOSqKRIpXPhjC6
37
37
  -----END CERTIFICATE-----
38
38
 
39
- date: 2013-04-18 00:00:00 Z
39
+ date: 2013-08-19 00:00:00 Z
40
40
  dependencies:
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
@@ -127,11 +127,11 @@ dependencies:
127
127
  requirements:
128
128
  - - ~>
129
129
  - !ruby/object:Gem::Version
130
- hash: 21
130
+ hash: 31
131
131
  segments:
132
- - 4
133
- - 7
134
- version: "4.7"
132
+ - 5
133
+ - 0
134
+ version: "5.0"
135
135
  type: :development
136
136
  version_requirements: *id006
137
137
  - !ruby/object:Gem::Dependency
@@ -157,11 +157,11 @@ dependencies:
157
157
  requirements:
158
158
  - - ~>
159
159
  - !ruby/object:Gem::Version
160
- hash: 11
160
+ hash: 9
161
161
  segments:
162
162
  - 3
163
- - 6
164
- version: "3.6"
163
+ - 7
164
+ version: "3.7"
165
165
  type: :development
166
166
  version_requirements: *id008
167
167
  description: |-
@@ -252,8 +252,8 @@ files:
252
252
  - test/test_zenweb_site.rb
253
253
  - .gemtest
254
254
  homepage: https://github.com/seattlerb/zenweb
255
- licenses: []
256
-
255
+ licenses:
256
+ - MIT
257
257
  post_install_message:
258
258
  rdoc_options:
259
259
  - --main
metadata.gz.sig CHANGED
@@ -1 +1,2 @@
1
- ��GH�~��w�&B:Nn.�I����Uq�b�glV��Z�ܫ'�{���bVȘ�ӟ�҆�c�ky��+�#����a�������j���ܵ �Cs��p4i��0�k^�U��E]�!�.Ya( P45��4E�" �ҹ�p�� �P��<��U�R��QL�ܗ�,C+���.�hl:�Y��%moƨ�,�DЫލM�A��=��X�����^���m�{�g�܆��|�e���b&t((�~D�p��am�}c!N
1
+ ��i�Lß�Rv<#�[�ᆝq7[�F��b��2W<�^?�
2
+ e��uo��/G!<�s