xml-sitemap 1.0.3 → 1.0.4
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.
- data/lib/xml-sitemap.rb +4 -6
- metadata +4 -4
data/lib/xml-sitemap.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'time'
|
2
|
+
|
1
3
|
module XmlSitemap
|
2
4
|
PERIODS = [:none, :always, :hourly, :daily, :weekly, :monthly, :yearly, :never]
|
3
5
|
|
@@ -54,7 +56,7 @@ module XmlSitemap
|
|
54
56
|
@items.each do |item|
|
55
57
|
output << '<url>'
|
56
58
|
output << "<loc>http://#{@domain}#{item.path.to_s}</loc>"
|
57
|
-
output << "<lastmod>#{item.updated.utc.
|
59
|
+
output << "<lastmod>#{item.updated.utc.iso8601}</lastmod>"
|
58
60
|
output << "<changefreq>#{item.changefreq.to_s}</changefreq>"
|
59
61
|
output << "<priority>#{item.priority.to_s}</priority>"
|
60
62
|
output << '</url>'
|
@@ -75,7 +77,7 @@ module XmlSitemap
|
|
75
77
|
# Add XmlSitemap::Map item to sitemap index
|
76
78
|
def add(map)
|
77
79
|
raise 'XmlSitemap::Map object requred!' unless map.kind_of?(Map)
|
78
|
-
@maps << {:loc => "http://#{@domain}/#{map.index_path}", :lastmod => map.created_at.
|
80
|
+
@maps << {:loc => "http://#{@domain}/#{map.index_path}", :lastmod => map.created_at.utc.iso8601}
|
79
81
|
end
|
80
82
|
|
81
83
|
# Generate sitemap XML index
|
@@ -93,8 +95,4 @@ module XmlSitemap
|
|
93
95
|
return output.join("\n")
|
94
96
|
end
|
95
97
|
end
|
96
|
-
end
|
97
|
-
|
98
|
-
class Time
|
99
|
-
def for_sitemap ; self.utc.strftime("%Y-%m-%dT%H:%M:%S-0000") ; end
|
100
98
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xml-sitemap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 4
|
10
|
+
version: 1.0.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Dan Sosedoff
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-09-19 00:00:00 -05:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|