zenweb 3.0.0.b1 → 3.0.0.b2
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +7 -0
- data/README.txt +3 -1
- data/lib/zenweb/page.rb +15 -0
- data/lib/zenweb/tasks.rake +14 -7
- data/lib/zenweb.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +5 -5
- metadata.gz.sig +0 -0
data/History.txt
CHANGED
data/README.txt
CHANGED
data/lib/zenweb/page.rb
CHANGED
@@ -160,6 +160,21 @@ module Zenweb
|
|
160
160
|
path[/\d\d\d\d-\d\d-\d\d/]
|
161
161
|
end
|
162
162
|
|
163
|
+
def change_frequency
|
164
|
+
days_old = (Time.now - self.date).to_i / 86400
|
165
|
+
|
166
|
+
case days_old
|
167
|
+
when 0...14 then
|
168
|
+
"daily"
|
169
|
+
when 14...56 then
|
170
|
+
"weekly"
|
171
|
+
when 56...365 then
|
172
|
+
"monthly"
|
173
|
+
else
|
174
|
+
"yearly"
|
175
|
+
end
|
176
|
+
end
|
177
|
+
|
163
178
|
##
|
164
179
|
# Returns true if this is an html page.
|
165
180
|
|
data/lib/zenweb/tasks.rake
CHANGED
@@ -51,18 +51,22 @@ task :realclean => :clean do
|
|
51
51
|
rm_rf ".site"
|
52
52
|
end
|
53
53
|
|
54
|
-
def new_file title,
|
54
|
+
def new_file title, dir, date = false
|
55
55
|
path = "#{title.strip.downcase.gsub(/\W+/, '-')}.html.md"
|
56
56
|
|
57
|
-
if
|
58
|
-
|
59
|
-
|
57
|
+
if date then
|
58
|
+
date = String === date ? Time.parse(date) : Time.now
|
59
|
+
|
60
|
+
path = "#{date.strftime '%Y-%m-%d'}-#{path}"
|
60
61
|
end
|
61
62
|
|
63
|
+
date ||= Time.now
|
64
|
+
path = File.join dir, path
|
65
|
+
|
62
66
|
open path, 'w' do |post|
|
63
67
|
post.puts "---"
|
64
68
|
post.puts "title: \"#{title}\""
|
65
|
-
post.puts "date: #{
|
69
|
+
post.puts "date: #{date.iso8601}"
|
66
70
|
post.puts "..."
|
67
71
|
post.puts
|
68
72
|
end
|
@@ -72,18 +76,21 @@ end
|
|
72
76
|
|
73
77
|
desc "Begin a new dated post: rake new_post['title']"
|
74
78
|
task :new_post, :title do |t, args|
|
79
|
+
dir = ENV["DIR"] || "."
|
75
80
|
title = args[:title] || "new-post"
|
81
|
+
date = ENV["DATE"] || :dated
|
76
82
|
|
77
|
-
path = new_file title,
|
83
|
+
path = new_file title, dir, date
|
78
84
|
|
79
85
|
warn "Created new post: #{path}"
|
80
86
|
end
|
81
87
|
|
82
88
|
desc "Begin a new dated post: rake new_page['title']"
|
83
89
|
task :new_page, :title do |t, args|
|
90
|
+
dir = ENV["DIR"] || "."
|
84
91
|
title = args[:title] || "new-post"
|
85
92
|
|
86
|
-
path = new_file title
|
93
|
+
path = new_file title, dir
|
87
94
|
|
88
95
|
warn "Created new file: #{path}"
|
89
96
|
end
|
data/lib/zenweb.rb
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zenweb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: -
|
4
|
+
hash: -4064281384
|
5
5
|
prerelease: 6
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 0
|
9
9
|
- 0
|
10
10
|
- b
|
11
|
-
-
|
12
|
-
version: 3.0.0.
|
11
|
+
- 2
|
12
|
+
version: 3.0.0.b2
|
13
13
|
platform: ruby
|
14
14
|
authors:
|
15
15
|
- Ryan Davis
|
@@ -38,7 +38,7 @@ cert_chain:
|
|
38
38
|
FBHgymkyj/AOSqKRIpXPhjC6
|
39
39
|
-----END CERTIFICATE-----
|
40
40
|
|
41
|
-
date: 2012-
|
41
|
+
date: 2012-06-11 00:00:00 Z
|
42
42
|
dependencies:
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: less
|
@@ -257,7 +257,7 @@ files:
|
|
257
257
|
- test/test_zenweb_plugins_markdown.rb
|
258
258
|
- test/test_zenweb_site.rb
|
259
259
|
- .gemtest
|
260
|
-
homepage: https://github.com/seattlerb/zenweb
|
260
|
+
homepage: https://github.com/seattlerb/zenweb
|
261
261
|
licenses: []
|
262
262
|
|
263
263
|
post_install_message:
|
metadata.gz.sig
CHANGED
Binary file
|