static_sitemap_tasks 0.2 → 0.3

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -1,3 +1,6 @@
1
+ v0.3
2
+ * Filter git's iso times through ruby's Time to make it W3C DATETIME compliant
3
+
1
4
  v0.2
2
5
  * Namespace tasks with :sitemap
3
6
  * Add ping task from http://github.com/adamsalter/sitemap_generator
@@ -79,8 +79,10 @@ module SitemapGenerator
79
79
  def find_date(file)
80
80
  case @date_mode
81
81
  when 'git'
82
- date = %x[git log -n 1 --date=iso --format="%ad" #{file}]
83
- date.strip()
82
+ raw_date = %x[git log -n 1 --date=iso --format="%ad" #{file}]
83
+ raw_date.strip!()
84
+ # we need ISO with no spaces
85
+ Time.new(raw_date).iso8601 rescue nil
84
86
  when 'mtime'
85
87
  mtime = File.mtime(file) rescue nil
86
88
  mtime.iso8601 if mtime
@@ -105,7 +107,9 @@ module SitemapGenerator
105
107
  xml = Builder::XmlMarkup.new( :indent => 2 )
106
108
  xml.instruct!
107
109
  xml.comment! "Generated on: " + Time.now.to_s
108
- xml.urlset("xmlns" => "http://www.sitemaps.org/schemas/sitemap/0.9") {
110
+ xml.urlset("xmlns:xsi" => "http://www.w3.org/2001/XMLSchema-instance",
111
+ "xsi:schemaLocation" => "http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd",
112
+ "xmlns" => "http://www.sitemaps.org/schemas/sitemap/0.9") {
109
113
  # loop through array of pages, and build sitemap.xml
110
114
  @pages.sort.each {|link|
111
115
  xml.url {
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "static_sitemap_tasks"
6
- s.version = "0.2"
6
+ s.version = "0.3"
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.summary = 'Rake tasks to manage sitemap.xml generation for static sites'
9
9
  s.description = 'Rake tasks to manage sitemap.xml generation for static sites'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: static_sitemap_tasks
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.2'
4
+ version: '0.3'
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -15,7 +15,7 @@ date: 2011-10-14 00:00:00.000000000Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rake
18
- requirement: &70099743651700 !ruby/object:Gem::Requirement
18
+ requirement: &70333596258700 !ruby/object:Gem::Requirement
19
19
  none: false
20
20
  requirements:
21
21
  - - ! '>='
@@ -23,10 +23,10 @@ dependencies:
23
23
  version: 0.8.7
24
24
  type: :development
25
25
  prerelease: false
26
- version_requirements: *70099743651700
26
+ version_requirements: *70333596258700
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
- requirement: &70099743644920 !ruby/object:Gem::Requirement
29
+ requirement: &70333596257780 !ruby/object:Gem::Requirement
30
30
  none: false
31
31
  requirements:
32
32
  - - ! '>='
@@ -34,7 +34,7 @@ dependencies:
34
34
  version: '1.0'
35
35
  type: :development
36
36
  prerelease: false
37
- version_requirements: *70099743644920
37
+ version_requirements: *70333596257780
38
38
  description: Rake tasks to manage sitemap.xml generation for static sites
39
39
  email:
40
40
  - mleinartas@gmail.com