awestruct 0.2.9 → 0.2.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -41,12 +41,29 @@ module Awestruct
41
41
  protected
42
42
  def set_sitemap_data( page )
43
43
  site = page.site
44
- page.date ||= Time.now
44
+ munge_date( page )
45
45
  page.priority ||= (site.priority or 0.1)
46
46
  page.change_frequency ||= (site.change_frequency or 'never')
47
47
  page
48
48
  end
49
49
 
50
+ def munge_date( page )
51
+ date = page.date
52
+ if date
53
+ begin
54
+ if date.kind_of? String
55
+ page.lastmod = Time.parse( page.date ).strftime( "%Y-%m-%d" )
56
+ else
57
+ page.lastmod = date.strftime( "%Y-%m-%d" )
58
+ end
59
+ rescue Exception => e
60
+ puts "[ERROR] Cannot parse date #{date.to_s}: #{e}"
61
+ end
62
+ else
63
+ page.lastmod = Time.now.strftime( "%Y-%m-%d" )
64
+ end
65
+ end
66
+
50
67
  def valid_sitemap_entry( page )
51
68
  page.output_filename != '.htaccess' &&
52
69
  page.output_filename != 'screen.css' &&
@@ -7,8 +7,8 @@
7
7
  - for entry in page.sitemap_entries
8
8
  %url
9
9
  %loc= "#{entry.site.base_url}#{entry.url}"
10
- - if entry.date
11
- %lastmod= entry.date
10
+ - if entry.lastmod
11
+ %lastmod= entry.lastmod
12
12
  - if entry.priority
13
13
  %priority= entry.priority
14
14
  - if entry.change_frequency
@@ -1,4 +1,4 @@
1
1
 
2
2
  module Awestruct
3
- VERSION='0.2.9'
3
+ VERSION='0.2.10'
4
4
  end
metadata CHANGED
@@ -1,189 +1,222 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: awestruct
3
3
  version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 0.2.9
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 2
8
+ - 10
9
+ version: 0.2.10
6
10
  platform: ruby
7
11
  authors:
8
- - Bob McWhirter
12
+ - Bob McWhirter
9
13
  autorequire:
10
14
  bindir: bin
11
15
  cert_chain: []
12
16
 
13
- date: 2011-11-17 00:00:00 Z
17
+ date: 2011-11-17 00:00:00 -05:00
18
+ default_executable:
14
19
  dependencies:
15
- - !ruby/object:Gem::Dependency
16
- name: hpricot
17
- prerelease: false
18
- requirement: &id001 !ruby/object:Gem::Requirement
19
- none: false
20
- requirements:
21
- - - ">="
22
- - !ruby/object:Gem::Version
23
- version: "0"
24
- type: :runtime
25
- version_requirements: *id001
26
- - !ruby/object:Gem::Dependency
27
- name: haml
28
- prerelease: false
29
- requirement: &id002 !ruby/object:Gem::Requirement
30
- none: false
31
- requirements:
32
- - - <=
33
- - !ruby/object:Gem::Version
34
- version: 3.1.0
35
- type: :runtime
36
- version_requirements: *id002
37
- - !ruby/object:Gem::Dependency
38
- name: sass
39
- prerelease: false
40
- requirement: &id003 !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - <=
44
- - !ruby/object:Gem::Version
45
- version: 3.1.0
46
- type: :runtime
47
- version_requirements: *id003
48
- - !ruby/object:Gem::Dependency
49
- name: hashery
50
- prerelease: false
51
- requirement: &id004 !ruby/object:Gem::Requirement
52
- none: false
53
- requirements:
54
- - - "="
55
- - !ruby/object:Gem::Version
56
- version: 1.4.0
57
- type: :runtime
58
- version_requirements: *id004
59
- - !ruby/object:Gem::Dependency
60
- name: rdiscount
61
- prerelease: false
62
- requirement: &id005 !ruby/object:Gem::Requirement
63
- none: false
64
- requirements:
65
- - - "="
66
- - !ruby/object:Gem::Version
67
- version: 1.6.8
68
- type: :runtime
69
- version_requirements: *id005
70
- - !ruby/object:Gem::Dependency
71
- name: RedCloth
72
- prerelease: false
73
- requirement: &id006 !ruby/object:Gem::Requirement
74
- none: false
75
- requirements:
76
- - - <=
77
- - !ruby/object:Gem::Version
78
- version: 4.2.5
79
- type: :runtime
80
- version_requirements: *id006
81
- - !ruby/object:Gem::Dependency
82
- name: compass
83
- prerelease: false
84
- requirement: &id007 !ruby/object:Gem::Requirement
85
- none: false
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: 0.11.5
90
- type: :runtime
91
- version_requirements: *id007
92
- - !ruby/object:Gem::Dependency
93
- name: compass-960-plugin
94
- prerelease: false
95
- requirement: &id008 !ruby/object:Gem::Requirement
96
- none: false
97
- requirements:
98
- - - <=
99
- - !ruby/object:Gem::Version
100
- version: 0.10.4
101
- type: :runtime
102
- version_requirements: *id008
103
- - !ruby/object:Gem::Dependency
104
- name: org-ruby
105
- prerelease: false
106
- requirement: &id009 !ruby/object:Gem::Requirement
107
- none: false
108
- requirements:
109
- - - "="
110
- - !ruby/object:Gem::Version
111
- version: 0.5.3
112
- type: :runtime
113
- version_requirements: *id009
114
- - !ruby/object:Gem::Dependency
115
- name: fssm
116
- prerelease: false
117
- requirement: &id010 !ruby/object:Gem::Requirement
118
- none: false
119
- requirements:
120
- - - "="
121
- - !ruby/object:Gem::Version
122
- version: 0.2.7
123
- type: :runtime
124
- version_requirements: *id010
20
+ - !ruby/object:Gem::Dependency
21
+ name: hpricot
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ segments:
28
+ - 0
29
+ version: "0"
30
+ type: :runtime
31
+ version_requirements: *id001
32
+ - !ruby/object:Gem::Dependency
33
+ name: haml
34
+ prerelease: false
35
+ requirement: &id002 !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - <=
38
+ - !ruby/object:Gem::Version
39
+ segments:
40
+ - 3
41
+ - 1
42
+ - 0
43
+ version: 3.1.0
44
+ type: :runtime
45
+ version_requirements: *id002
46
+ - !ruby/object:Gem::Dependency
47
+ name: sass
48
+ prerelease: false
49
+ requirement: &id003 !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - <=
52
+ - !ruby/object:Gem::Version
53
+ segments:
54
+ - 3
55
+ - 1
56
+ - 0
57
+ version: 3.1.0
58
+ type: :runtime
59
+ version_requirements: *id003
60
+ - !ruby/object:Gem::Dependency
61
+ name: hashery
62
+ prerelease: false
63
+ requirement: &id004 !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - "="
66
+ - !ruby/object:Gem::Version
67
+ segments:
68
+ - 1
69
+ - 4
70
+ - 0
71
+ version: 1.4.0
72
+ type: :runtime
73
+ version_requirements: *id004
74
+ - !ruby/object:Gem::Dependency
75
+ name: rdiscount
76
+ prerelease: false
77
+ requirement: &id005 !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "="
80
+ - !ruby/object:Gem::Version
81
+ segments:
82
+ - 1
83
+ - 6
84
+ - 8
85
+ version: 1.6.8
86
+ type: :runtime
87
+ version_requirements: *id005
88
+ - !ruby/object:Gem::Dependency
89
+ name: RedCloth
90
+ prerelease: false
91
+ requirement: &id006 !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - <=
94
+ - !ruby/object:Gem::Version
95
+ segments:
96
+ - 4
97
+ - 2
98
+ - 5
99
+ version: 4.2.5
100
+ type: :runtime
101
+ version_requirements: *id006
102
+ - !ruby/object:Gem::Dependency
103
+ name: compass
104
+ prerelease: false
105
+ requirement: &id007 !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ segments:
110
+ - 0
111
+ - 11
112
+ - 5
113
+ version: 0.11.5
114
+ type: :runtime
115
+ version_requirements: *id007
116
+ - !ruby/object:Gem::Dependency
117
+ name: compass-960-plugin
118
+ prerelease: false
119
+ requirement: &id008 !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - <=
122
+ - !ruby/object:Gem::Version
123
+ segments:
124
+ - 0
125
+ - 10
126
+ - 4
127
+ version: 0.10.4
128
+ type: :runtime
129
+ version_requirements: *id008
130
+ - !ruby/object:Gem::Dependency
131
+ name: org-ruby
132
+ prerelease: false
133
+ requirement: &id009 !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - "="
136
+ - !ruby/object:Gem::Version
137
+ segments:
138
+ - 0
139
+ - 5
140
+ - 3
141
+ version: 0.5.3
142
+ type: :runtime
143
+ version_requirements: *id009
144
+ - !ruby/object:Gem::Dependency
145
+ name: fssm
146
+ prerelease: false
147
+ requirement: &id010 !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - "="
150
+ - !ruby/object:Gem::Version
151
+ segments:
152
+ - 0
153
+ - 2
154
+ - 7
155
+ version: 0.2.7
156
+ type: :runtime
157
+ version_requirements: *id010
125
158
  description:
126
159
  email: bob@mcwhirter.org
127
160
  executables:
128
- - awestruct
161
+ - awestruct
129
162
  extensions: []
130
163
 
131
164
  extra_rdoc_files: []
132
165
 
133
166
  files:
134
- - lib/awestruct.rb
135
- - lib/awestruct/config.rb
136
- - lib/awestruct/context_helper.rb
137
- - lib/awestruct/engine.rb
138
- - lib/awestruct/erb_file.rb
139
- - lib/awestruct/erbable.rb
140
- - lib/awestruct/front_matter_file.rb
141
- - lib/awestruct/haml_file.rb
142
- - lib/awestruct/hamlable.rb
143
- - lib/awestruct/markdown_file.rb
144
- - lib/awestruct/markdownable.rb
145
- - lib/awestruct/org_mode_file.rb
146
- - lib/awestruct/org_modeable.rb
147
- - lib/awestruct/renderable.rb
148
- - lib/awestruct/renderable_file.rb
149
- - lib/awestruct/sass_file.rb
150
- - lib/awestruct/sassable.rb
151
- - lib/awestruct/scss_file.rb
152
- - lib/awestruct/site.rb
153
- - lib/awestruct/textilable.rb
154
- - lib/awestruct/textile_file.rb
155
- - lib/awestruct/verbatim_file.rb
156
- - lib/awestruct/version.rb
157
- - lib/awestruct/commands/deploy.rb
158
- - lib/awestruct/commands/generate.rb
159
- - lib/awestruct/commands/init.rb
160
- - lib/awestruct/commands/manifest.rb
161
- - lib/awestruct/commands/server.rb
162
- - lib/awestruct/commands/frameworks/base_pipeline.rb
163
- - lib/awestruct/extensions/atomizer.rb
164
- - lib/awestruct/extensions/data_dir.rb
165
- - lib/awestruct/extensions/disqus.rb
166
- - lib/awestruct/extensions/flattr.rb
167
- - lib/awestruct/extensions/google_analytics.rb
168
- - lib/awestruct/extensions/gsub.rb
169
- - lib/awestruct/extensions/indexifier.rb
170
- - lib/awestruct/extensions/intense_debate.rb
171
- - lib/awestruct/extensions/paginator.rb
172
- - lib/awestruct/extensions/partial.rb
173
- - lib/awestruct/extensions/pipeline.rb
174
- - lib/awestruct/extensions/posts.rb
175
- - lib/awestruct/extensions/sitemap.rb
176
- - lib/awestruct/extensions/tag_cloud.rb
177
- - lib/awestruct/extensions/tagger.rb
178
- - lib/awestruct/util/default_inflections.rb
179
- - lib/awestruct/util/inflector.rb
180
- - lib/awestruct/commands/frameworks/base_index.html.haml
181
- - lib/awestruct/commands/frameworks/960/base_layout.html.haml
182
- - lib/awestruct/commands/frameworks/blueprint/base_layout.html.haml
183
- - lib/awestruct/extensions/sitemap.xml.haml
184
- - lib/awestruct/extensions/tag_cloud.html.haml
185
- - lib/awestruct/extensions/template.atom.haml
186
- - bin/awestruct
167
+ - lib/awestruct/commands/deploy.rb
168
+ - lib/awestruct/commands/frameworks/base_pipeline.rb
169
+ - lib/awestruct/commands/generate.rb
170
+ - lib/awestruct/commands/init.rb
171
+ - lib/awestruct/commands/manifest.rb
172
+ - lib/awestruct/commands/server.rb
173
+ - lib/awestruct/config.rb
174
+ - lib/awestruct/context_helper.rb
175
+ - lib/awestruct/engine.rb
176
+ - lib/awestruct/erb_file.rb
177
+ - lib/awestruct/erbable.rb
178
+ - lib/awestruct/extensions/atomizer.rb
179
+ - lib/awestruct/extensions/data_dir.rb
180
+ - lib/awestruct/extensions/disqus.rb
181
+ - lib/awestruct/extensions/flattr.rb
182
+ - lib/awestruct/extensions/google_analytics.rb
183
+ - lib/awestruct/extensions/gsub.rb
184
+ - lib/awestruct/extensions/indexifier.rb
185
+ - lib/awestruct/extensions/intense_debate.rb
186
+ - lib/awestruct/extensions/paginator.rb
187
+ - lib/awestruct/extensions/partial.rb
188
+ - lib/awestruct/extensions/pipeline.rb
189
+ - lib/awestruct/extensions/posts.rb
190
+ - lib/awestruct/extensions/sitemap.rb
191
+ - lib/awestruct/extensions/tag_cloud.rb
192
+ - lib/awestruct/extensions/tagger.rb
193
+ - lib/awestruct/front_matter_file.rb
194
+ - lib/awestruct/haml_file.rb
195
+ - lib/awestruct/hamlable.rb
196
+ - lib/awestruct/markdown_file.rb
197
+ - lib/awestruct/markdownable.rb
198
+ - lib/awestruct/org_mode_file.rb
199
+ - lib/awestruct/org_modeable.rb
200
+ - lib/awestruct/renderable.rb
201
+ - lib/awestruct/renderable_file.rb
202
+ - lib/awestruct/sass_file.rb
203
+ - lib/awestruct/sassable.rb
204
+ - lib/awestruct/scss_file.rb
205
+ - lib/awestruct/site.rb
206
+ - lib/awestruct/textilable.rb
207
+ - lib/awestruct/textile_file.rb
208
+ - lib/awestruct/util/default_inflections.rb
209
+ - lib/awestruct/util/inflector.rb
210
+ - lib/awestruct/verbatim_file.rb
211
+ - lib/awestruct/version.rb
212
+ - lib/awestruct.rb
213
+ - lib/awestruct/commands/frameworks/960/base_layout.html.haml
214
+ - lib/awestruct/commands/frameworks/base_index.html.haml
215
+ - lib/awestruct/commands/frameworks/blueprint/base_layout.html.haml
216
+ - lib/awestruct/extensions/sitemap.xml.haml
217
+ - lib/awestruct/extensions/tag_cloud.html.haml
218
+ - lib/awestruct/extensions/template.atom.haml
219
+ has_rdoc: true
187
220
  homepage:
188
221
  licenses: []
189
222
 
@@ -191,23 +224,25 @@ post_install_message:
191
224
  rdoc_options: []
192
225
 
193
226
  require_paths:
194
- - lib
227
+ - lib
195
228
  required_ruby_version: !ruby/object:Gem::Requirement
196
- none: false
197
229
  requirements:
198
- - - ">="
199
- - !ruby/object:Gem::Version
200
- version: "0"
230
+ - - ">="
231
+ - !ruby/object:Gem::Version
232
+ segments:
233
+ - 0
234
+ version: "0"
201
235
  required_rubygems_version: !ruby/object:Gem::Requirement
202
- none: false
203
236
  requirements:
204
- - - ">="
205
- - !ruby/object:Gem::Version
206
- version: "0"
237
+ - - ">="
238
+ - !ruby/object:Gem::Version
239
+ segments:
240
+ - 0
241
+ version: "0"
207
242
  requirements: []
208
243
 
209
244
  rubyforge_project:
210
- rubygems_version: 1.8.9
245
+ rubygems_version: 1.3.6
211
246
  signing_key:
212
247
  specification_version: 3
213
248
  summary: Static site-baking utility