xml-sitemap 1.2.2 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,5 @@
1
1
  rvm:
2
2
  - 1.8.7
3
3
  - 1.9.2
4
- - ree
4
+ - 1.9.3
5
+ - 2.0.0
data/Gemfile CHANGED
@@ -1,3 +1,2 @@
1
- source 'http://rubygems.org'
2
-
1
+ source 'https://rubygems.org'
3
2
  gemspec
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # XmlSitemap
1
+ # XmlSitemap [![Build Status](https://secure.travis-ci.org/sosedoff/xml-sitemap.png?branch=master)](http://travis-ci.org/sosedoff/xml-sitemap)
2
2
 
3
- XmlSitemap is a Ruby library that provides an easy way to generate XML sitemaps and indexes.
3
+ XmlSitemap is a ruby library that provides an easy way to generate XML sitemaps and indexes.
4
4
 
5
5
  It does not have any web-framework dependencies and could be used in any ruby-based application.
6
6
 
@@ -8,7 +8,15 @@ It does not have any web-framework dependencies and could be used in any ruby-ba
8
8
 
9
9
  Install via rubygems:
10
10
 
11
- $ gem install xml-sitemap
11
+ ```
12
+ gem install xml-sitemap
13
+ ```
14
+
15
+ Or using latest source code:
16
+
17
+ ```
18
+ rake install
19
+ ```
12
20
 
13
21
  ## Configuration
14
22
 
@@ -36,7 +44,11 @@ map = XmlSitemap::Map.new('domain.com') do |m|
36
44
  # Specify last modification date and update frequiency
37
45
  m.add 'page4', :updated => Date.today, :period => :never
38
46
  end
47
+ ```
39
48
 
49
+ Render map output:
50
+
51
+ ```ruby
40
52
  # Render the sitemap XML
41
53
  map.render
42
54
 
@@ -59,20 +71,22 @@ map = XmlSitemap.new('foobar.com')
59
71
  map = XmlSitemap.map('foobar.com')
60
72
  ```
61
73
 
62
- By default XmlSitemap creates a map with link to homepage of your domain. It's a priority 1.0. Default priority is 0.5.
74
+ By default XmlSitemap creates a map with link to homepage of your domain.
63
75
 
64
- List of periods:
76
+ Homepage priority is `1.0`. Default page priority is set to `0.5`
65
77
 
66
- - :none,
67
- - :always
68
- - :hourly
69
- - :daily
70
- - :weekly
71
- - :monthly
72
- - :yearly
73
- - :never
78
+ List of available update periods:
74
79
 
75
- ## XmlSitemap::Map
80
+ - `:none`
81
+ - `:always`
82
+ - `:hourly`
83
+ - `:daily`
84
+ - `:weekly`
85
+ - `:monthly`
86
+ - `:yearly`
87
+ - `:never`
88
+
89
+ ### Generating Maps
76
90
 
77
91
  When creating a new map object, you can specify a set of options.
78
92
 
@@ -82,13 +96,23 @@ map = XmlSitemap::Map.new('mydomain.com', options)
82
96
 
83
97
  Available options:
84
98
 
85
- - :secure - Will add all sitemap items with https prefix. *(default: false)*
86
- - :home - Disable homepage autocreation, but you still can do that manually. *(default: true)*
87
- - :root - Force all links to fall under the main domain. You can add full urls (not paths) if set to false. *(default: true)*
88
- - :time - Provide a creation time for the sitemap. (default: current time)
89
- - :group - Group name for sitemap index. *(default: sitemap)*
99
+ - `:secure` - Will add all sitemap items with https prefix. *(default: false)*
100
+ - `:home` - Disable homepage autocreation, but you still can do that manually. *(default: true)*
101
+ - `:root` - Force all links to fall under the main domain. You can add full urls (not paths) if set to false. *(default: true)*
102
+ - `:time` - Provide a creation time for the sitemap. (default: current time)
103
+ - `:group` - Group name for sitemap index. *(default: sitemap)*
104
+
105
+ ### Render Engines
106
+
107
+ XmlSitemap has a few different rendering engines. You can select one passing argument to `render` method.
108
+
109
+ Available engines:
90
110
 
91
- ## XmlSitemap::Index
111
+ - `:string` - Uses plain strings (for performance). Default.
112
+ - `:builder` - Uses Builder::XmlMarkup.
113
+ - `:nokogiri` - Uses Nokogiri library. Requires `nokogiri` gem.
114
+
115
+ ### Sitemap Indexes
92
116
 
93
117
  Regular sitemap does not support more than 50k records, so if you're generating a huge sitemap you need to use XmlSitemap::Index.
94
118
 
@@ -101,6 +125,7 @@ map = XmlSitemap::Map.new('domain.com')
101
125
  map.add 'page'
102
126
 
103
127
  index = XmlSitemap::Index.new
128
+
104
129
  # or via shortcut
105
130
  index = XmlSitemap.index
106
131
 
@@ -114,14 +139,9 @@ index.render
114
139
  index.render_to('/path/to/file.xml')
115
140
  ```
116
141
 
117
- ## Authors & Contributors
118
-
119
- - [Dan Sosedoff](https://github.com/sosedoff) (author)
120
- - [Dan Healy](https://github.com/danhealy)
121
-
122
142
  ## License
123
143
 
124
- Copyright © 2010-2011 Dan Sosedoff.
144
+ Copyright © 2010-2013 Dan Sosedoff.
125
145
 
126
146
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
127
147
 
data/Rakefile CHANGED
@@ -1,4 +1,5 @@
1
1
  require 'bundler'
2
+ require 'bundler/gem_tasks'
2
3
  require "rspec/core/rake_task"
3
4
 
4
5
  RSpec::Core::RakeTask.new(:test) do |t|
@@ -8,6 +8,7 @@ begin
8
8
  rescue LoadError
9
9
  end
10
10
 
11
+ require 'xml-sitemap/version'
11
12
  require 'xml-sitemap/options'
12
13
  require 'xml-sitemap/render_engine'
13
14
  require 'xml-sitemap/item'
@@ -5,15 +5,22 @@ module XmlSitemap
5
5
  # ISO8601 regex from here: http://www.pelagodesign.com/blog/2009/05/20/iso-8601-date-validation-that-doesnt-suck/
6
6
  ISO8601_REGEX = /^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24\:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/
7
7
 
8
- attr_reader :target, :updated, :priority, :changefreq, :validate_time
8
+ attr_reader :target, :updated, :priority, :changefreq, :validate_time, :image_location, :image_caption, :image_geolocation, :image_title, :image_license
9
9
 
10
10
  def initialize(target, opts={})
11
- @target = target.to_s.strip
12
- @updated = opts[:updated] || Time.now
13
- @priority = opts[:priority] || DEFAULT_PRIORITY
14
- @changefreq = opts[:period] || :weekly
15
- @validate_time = (opts[:validate_time] != false)
16
-
11
+ @target = target.to_s.strip
12
+ @updated = opts[:updated] || Time.now
13
+ @priority = opts[:priority] || DEFAULT_PRIORITY
14
+ @changefreq = opts[:period] || :weekly
15
+ @validate_time = (opts[:validate_time] != false)
16
+
17
+ # Refer to http://support.google.com/webmasters/bin/answer.py?hl=en&answer=178636 for requirement to support images in sitemap
18
+ @image_location = opts[:image_location]
19
+ @image_caption = opts[:image_caption]
20
+ @image_geolocation = opts[:image_geolocation]
21
+ @image_title = opts[:image_title]
22
+ @image_license = opts[:image_license]
23
+
17
24
  unless @updated.kind_of?(Time) || @updated.kind_of?(Date) || @updated.kind_of?(String)
18
25
  raise ArgumentError, "Time, Date, or ISO8601 String required for :updated!"
19
26
  end
@@ -9,13 +9,14 @@ module XmlSitemap
9
9
  :yearly,
10
10
  :never
11
11
  ].freeze
12
-
12
+
13
13
  MAP_SCHEMA_OPTIONS = {
14
14
  'xsi:schemaLocation' => "http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd",
15
15
  'xmlns:xsi' => "http://www.w3.org/2001/XMLSchema-instance",
16
+ 'xmlns:image' => "http://www.google.com/schemas/sitemap-image/1.1",
16
17
  'xmlns' => "http://www.sitemaps.org/schemas/sitemap/0.9"
17
18
  }.freeze
18
-
19
+
19
20
  INDEX_SCHEMA_OPTIONS = {
20
21
  'xsi:schemaLocation' => "http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/siteindex.xsd",
21
22
  'xmlns:xsi' => "http://www.w3.org/2001/XMLSchema-instance",
@@ -1,18 +1,30 @@
1
1
  module XmlSitemap
2
2
  module RenderEngine
3
3
  private
4
-
4
+
5
5
  # Render with Nokogiri gem
6
6
  #
7
7
  def render_nokogiri
8
8
  unless defined? Nokogiri
9
9
  raise ArgumentError, "Nokogiri not found!"
10
10
  end
11
+
11
12
  builder = Nokogiri::XML::Builder.new(:encoding => "UTF-8") do |xml|
12
13
  xml.urlset(XmlSitemap::MAP_SCHEMA_OPTIONS) { |s|
13
14
  @items.each do |item|
14
15
  s.url do |u|
15
16
  u.loc item.target
17
+
18
+ if item.image_location
19
+ u["image"].image do |a|
20
+ a["image"].loc item.image_location
21
+ a["image"].caption item.image_caption if item.image_caption
22
+ a["image"].title item.image_title if item.image_title
23
+ a["image"].license item.image_license if item.image_license
24
+ a["image"].geo_location item.image_geolocation if item.image_geolocation
25
+ end
26
+ end
27
+
16
28
  u.lastmod item.lastmod_value
17
29
  u.changefreq item.changefreq.to_s
18
30
  u.priority item.priority.to_s
@@ -22,16 +34,28 @@ module XmlSitemap
22
34
  end
23
35
  builder.to_xml
24
36
  end
25
-
37
+
26
38
  # Render with Builder gem
27
39
  #
28
- def render_bulder
40
+ def render_builder
29
41
  xml = Builder::XmlMarkup.new(:indent => 2)
30
42
  xml.instruct!(:xml, :version => '1.0', :encoding => 'UTF-8')
43
+
31
44
  xml.urlset(XmlSitemap::MAP_SCHEMA_OPTIONS) { |s|
32
45
  @items.each do |item|
33
46
  s.url do |u|
34
47
  u.loc item.target
48
+
49
+ if item.image_location
50
+ u.image :image do |a|
51
+ a.tag!("image:loc") { |b| b.text! item.image_location }
52
+ a.tag!("image:caption") { |b| b.text! item.image_caption } if item.image_caption
53
+ a.tag!("image:title") { |b| b.text! item.image_title } if item.image_title
54
+ a.tag!("image:license") { |b| b.text! item.image_license } if item.image_license
55
+ a.tag!("image:geo_location") { |b| b.text! item.image_geolocation } if item.image_geolocation
56
+ end
57
+ end
58
+
35
59
  u.lastmod item.lastmod_value
36
60
  u.changefreq item.changefreq.to_s
37
61
  u.priority item.priority.to_s
@@ -39,31 +63,45 @@ module XmlSitemap
39
63
  end
40
64
  }.to_s
41
65
  end
42
-
66
+
43
67
  # Render with plain strings
44
68
  #
45
69
  def render_string
46
70
  result = '<?xml version="1.0" encoding="UTF-8"?>' + "\n<urlset"
47
-
71
+
48
72
  XmlSitemap::MAP_SCHEMA_OPTIONS.each do |key, val|
49
- result += ' ' + key + '="' + val + '"'
73
+ result << ' ' + key + '="' + val + '"'
50
74
  end
51
-
52
- result += ">\n"
53
-
75
+
76
+ result << ">\n"
77
+
54
78
  item_results = []
55
79
  @items.each do |item|
56
80
  item_string = " <url>\n"
57
- item_string += " <loc>#{CGI::escapeHTML(item.target)}</loc>\n"
58
- item_string += " <lastmod>#{item.lastmod_value}</lastmod>\n"
59
- item_string += " <changefreq>#{item.changefreq}</changefreq>\n"
60
- item_string += " <priority>#{item.priority}</priority>\n"
61
- item_string += " </url>\n"
62
-
81
+ item_string << " <loc>#{CGI::escapeHTML(item.target)}</loc>\n"
82
+
83
+ # Format and image tag specifications found in http://support.google.com/webmasters/bin/answer.py?hl=en&answer=178636
84
+ if item.image_location
85
+ item_string << " <image:image>\n"
86
+ item_string << " <image:loc>#{CGI::escapeHTML(item.image_location)}</image:loc>\n"
87
+ item_string << " <image:caption>#{CGI::escapeHTML(item.image_caption)}</image:caption>\n" if item.image_caption
88
+ item_string << " <image:title>#{CGI::escapeHTML(item.image_title)}</image:title>\n" if item.image_title
89
+ item_string << " <image:license>#{CGI::escapeHTML(item.image_license)}</image:license>\n" if item.image_license
90
+ item_string << " <image:geo_location>#{CGI::escapeHTML(item.image_geolocation)}</image:geo_location>\n" if item.image_geolocation
91
+ item_string << " </image:image>\n"
92
+ end
93
+
94
+ item_string << " <lastmod>#{item.lastmod_value}</lastmod>\n"
95
+ item_string << " <changefreq>#{item.changefreq}</changefreq>\n"
96
+ item_string << " <priority>#{item.priority}</priority>\n"
97
+ item_string << " </url>\n"
98
+
63
99
  item_results << item_string
64
100
  end
101
+
102
+ result << item_results.join("")
103
+ result << "</urlset>\n"
65
104
 
66
- result = result + item_results.join("") + "</urlset>\n"
67
105
  result
68
106
  end
69
107
  end
@@ -1,3 +1,9 @@
1
1
  module XmlSitemap
2
- VERSION = '1.2.2'
2
+ unless defined?(::XmlSitemap::VERSION)
3
+ VERSION = '1.3.0'
4
+ end
5
+
6
+ def self.version
7
+ XmlSitemap::VERSION
8
+ end
3
9
  end
@@ -0,0 +1,71 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <urlset xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
3
+ <url>
4
+ <loc>http://foobar.com/</loc>
5
+ <lastmod>2011-06-01T00:00:01Z</lastmod>
6
+ <changefreq>weekly</changefreq>
7
+ <priority>1.0</priority>
8
+ </url>
9
+ <url>
10
+ <loc>http://foobar.com/path?a=b&amp;c=d&amp;e=image support string</loc>
11
+ <image:image>
12
+ <image:loc>http://foobar.com/foo.gif</image:loc>
13
+ </image:image>
14
+ <lastmod>2011-06-01T00:00:01Z</lastmod>
15
+ <changefreq>weekly</changefreq>
16
+ <priority>0.5</priority>
17
+ </url>
18
+ <url>
19
+ <loc>http://foobar.com/path?a=b&amp;c=d&amp;e=image support string</loc>
20
+ <image:image>
21
+ <image:loc>http://foobar.com/foo.gif</image:loc>
22
+ <image:title>Image Title</image:title>
23
+ </image:image>
24
+ <lastmod>2011-06-01T00:00:01Z</lastmod>
25
+ <changefreq>weekly</changefreq>
26
+ <priority>0.5</priority>
27
+ </url>
28
+ <url>
29
+ <loc>http://foobar.com/path?a=b&amp;c=d&amp;e=image support string</loc>
30
+ <image:image>
31
+ <image:loc>http://foobar.com/foo.gif</image:loc>
32
+ <image:caption>Image Caption</image:caption>
33
+ </image:image>
34
+ <lastmod>2011-06-01T00:00:01Z</lastmod>
35
+ <changefreq>weekly</changefreq>
36
+ <priority>0.5</priority>
37
+ </url>
38
+ <url>
39
+ <loc>http://foobar.com/path?a=b&amp;c=d&amp;e=image support string</loc>
40
+ <image:image>
41
+ <image:loc>http://foobar.com/foo.gif</image:loc>
42
+ <image:license>Image License</image:license>
43
+ </image:image>
44
+ <lastmod>2011-06-01T00:00:01Z</lastmod>
45
+ <changefreq>weekly</changefreq>
46
+ <priority>0.5</priority>
47
+ </url>
48
+ <url>
49
+ <loc>http://foobar.com/path?a=b&amp;c=d&amp;e=image support string</loc>
50
+ <image:image>
51
+ <image:loc>http://foobar.com/foo.gif</image:loc>
52
+ <image:geo_location>Image GeoLocation</image:geo_location>
53
+ </image:image>
54
+ <lastmod>2011-06-01T00:00:01Z</lastmod>
55
+ <changefreq>weekly</changefreq>
56
+ <priority>0.5</priority>
57
+ </url>
58
+ <url>
59
+ <loc>http://foobar.com/path?a=b&amp;c=d&amp;e=image support string</loc>
60
+ <image:image>
61
+ <image:loc>http://foobar.com/foo.gif</image:loc>
62
+ <image:caption>Image Caption</image:caption>
63
+ <image:title>Image Title</image:title>
64
+ <image:license>Image License</image:license>
65
+ <image:geo_location>Image GeoLocation</image:geo_location>
66
+ </image:image>
67
+ <lastmod>2011-06-01T00:00:01Z</lastmod>
68
+ <changefreq>weekly</changefreq>
69
+ <priority>0.5</priority>
70
+ </url>
71
+ </urlset>
@@ -1,70 +1,71 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe XmlSitemap::Index do
4
- before :all do
5
- @base_time = Time.gm(2011, 6, 1, 0, 0, 1)
6
- end
7
-
8
- it 'should be valid if no sitemaps were supplied' do
9
- index = XmlSitemap::Index.new
10
- index.render.should == fixture('empty_index.xml')
11
- end
12
-
13
- it 'should raise error if passing a wrong object' do
14
- index = XmlSitemap::Index.new
15
- proc { index.add(nil) }.should raise_error ArgumentError, 'XmlSitemap::Map object requred!'
16
- end
17
-
18
- it 'should raise error if passing an empty sitemap' do
19
- map = XmlSitemap::Map.new('foobar.com', :home => false)
20
- index = XmlSitemap::Index.new
21
- proc { index.add(map) }.should raise_error ArgumentError, 'Map is empty!'
22
- end
23
-
24
- it 'should render a proper index' do
25
- m1 = XmlSitemap::Map.new('foobar.com', :time => @base_time) { |m| m.add('about') }
26
- m2 = XmlSitemap::Map.new('foobar.com', :time => @base_time) { |m| m.add('about') }
27
-
28
- index = XmlSitemap::Index.new do |i|
29
- i.add(m1)
30
- i.add(m2)
4
+ let(:base_time) { Time.gm(2011, 6, 1, 0, 0, 1) }
5
+
6
+ describe '#new' do
7
+ it 'should be valid if no sitemaps were supplied' do
8
+ index = XmlSitemap::Index.new
9
+ index.render.split("\n")[2..-1].join("\n").should == fixture('empty_index.xml').split("\n")[2..-1].join("\n")
10
+ end
11
+
12
+ it 'should raise error if passing a wrong object' do
13
+ index = XmlSitemap::Index.new
14
+ expect { index.add(nil) }.to raise_error ArgumentError, 'XmlSitemap::Map object requred!'
15
+ end
16
+
17
+ it 'should raise error if passing an empty sitemap' do
18
+ map = XmlSitemap::Map.new('foobar.com', :home => false)
19
+ index = XmlSitemap::Index.new
20
+ expect { index.add(map) }.to raise_error ArgumentError, 'Map is empty!'
31
21
  end
32
-
33
- index.render.should == fixture('sample_index.xml')
34
22
  end
35
-
36
- it 'should save index contents to the filesystem' do
37
- m1 = XmlSitemap::Map.new('foobar.com', :time => @base_time) { |m| m.add('about') }
38
- m2 = XmlSitemap::Map.new('foobar.com', :time => @base_time) { |m| m.add('about') }
39
-
40
- index = XmlSitemap::Index.new do |i|
41
- i.add(m1)
42
- i.add(m2)
23
+
24
+ describe '#render' do
25
+ it 'renders a proper index' do
26
+ m1 = XmlSitemap::Map.new('foobar.com', :time => base_time) { |m| m.add('about') }
27
+ m2 = XmlSitemap::Map.new('foobar.com', :time => base_time) { |m| m.add('about') }
28
+
29
+ index = XmlSitemap::Index.new do |i|
30
+ i.add(m1)
31
+ i.add(m2)
32
+ end
33
+
34
+ index.render.split("\n")[2..-1].join("\n").should == fixture('sample_index.xml').split("\n")[2..-1].join("\n")
43
35
  end
44
-
45
- path = "/tmp/index_#{Time.now.to_i}.xml"
46
- index.render_to(path)
47
- File.read(path).should == fixture('sample_index.xml')
48
- File.delete(path) if File.exists?(path)
49
36
  end
50
-
51
- it 'should have separate running offsets for different map groups' do
52
- m1 = XmlSitemap::Map.new('foobar.com', :time => @base_time, :group => "first") { |m| m.add('about') }
53
- m2 = XmlSitemap::Map.new('foobar.com', :time => @base_time, :group => "second") { |m| m.add('about') }
54
- m3 = XmlSitemap::Map.new('foobar.com', :time => @base_time, :group => "second") { |m| m.add('about') }
55
- m4 = XmlSitemap::Map.new('foobar.com', :time => @base_time, :group => "third") { |m| m.add('about') }
56
-
57
- index = XmlSitemap::Index.new do |i|
58
- i.add(m1)
59
- i.add(m2)
60
- i.add(m3)
61
- i.add(m4)
37
+
38
+ describe '#render_to' do
39
+ let(:index_path) { "/tmp/xml_index.xml" }
40
+
41
+ after :all do
42
+ File.delete_if_exists(index_path)
43
+ end
44
+
45
+ it 'saves index contents to the filesystem' do
46
+ m1 = XmlSitemap::Map.new('foobar.com', :time => base_time) { |m| m.add('about') }
47
+ m2 = XmlSitemap::Map.new('foobar.com', :time => base_time) { |m| m.add('about') }
48
+
49
+ index = XmlSitemap::Index.new do |i|
50
+ i.add(m1)
51
+ i.add(m2)
52
+ end
53
+
54
+ index.render_to(index_path)
55
+ File.read(index_path).split("\n")[2..-1].join("\n").should eq(fixture('sample_index.xml').split("\n")[2..-1].join("\n"))
56
+ end
57
+
58
+ it 'should have separate running offsets for different map groups' do
59
+ maps = %w(first second second third).map do |name|
60
+ XmlSitemap::Map.new('foobar.com', :time => base_time, :group => name) { |m| m.add('about') }
61
+ end
62
+
63
+ index = XmlSitemap::Index.new do |i|
64
+ maps.each { |m| i.add(m) }
65
+ end
66
+
67
+ index.render_to(index_path)
68
+ File.read(index_path).split("\n")[2..-1].join("\n").should eq(fixture('group_index.xml').split("\n")[2..-1].join("\n"))
62
69
  end
63
-
64
- path = "/tmp/index_#{Time.now.to_i}.xml"
65
- index.render_to(path)
66
- File.read(path).should == fixture('group_index.xml')
67
- File.delete(path) if File.exists?(path)
68
70
  end
69
-
70
71
  end
@@ -1,8 +1,10 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe 'XmlSitemap::Item' do
4
- it 'should raise ArgumentError if invalid :period value was passed' do
5
- proc { XmlSitemap::Item.new('hello', :period => :foobar) }.
6
- should raise_error ArgumentError, "Invalid :period value 'foobar'"
4
+ describe '#new' do
5
+ it 'raises ArgumentError if invalid :period value was passed' do
6
+ proc { XmlSitemap::Item.new('hello', :period => :foobar) }.
7
+ should raise_error ArgumentError, "Invalid :period value 'foobar'"
8
+ end
7
9
  end
8
10
  end
@@ -2,172 +2,232 @@ require 'benchmark'
2
2
  require 'spec_helper'
3
3
 
4
4
  describe XmlSitemap::Map do
5
- before :all do
6
- @base_time = Time.gm(2011, 6, 1, 0, 0, 1)
7
- @extra_time = Time.gm(2011, 7, 1, 0, 0, 1)
8
- end
9
-
10
- it 'should not allow empty domains' do
11
- proc { XmlSitemap::Map.new(nil) }.should raise_error ArgumentError
12
- proc { XmlSitemap::Map.new('') }.should raise_error ArgumentError
13
- proc { XmlSitemap::Map.new(' ') }.should raise_error ArgumentError
14
- end
15
-
16
- it 'should not allow empty urls' do
17
- map = XmlSitemap::Map.new('foobar.com')
18
- proc { map.add(nil) }.should raise_error ArgumentError
19
- proc { map.add('') }.should raise_error ArgumentError
20
- proc { map.add(' ') }.should raise_error ArgumentError
21
- end
22
-
23
- it 'should have a home path by default' do
24
- map = XmlSitemap::Map.new('foobar.com')
25
- map.empty?.should == false
26
- map.items.first.target.should == 'http://foobar.com/'
27
- end
28
-
29
- it 'should not have a home path with option' do
30
- map = XmlSitemap::Map.new('foobar.com', :home => false)
31
- map.empty?.should == true
32
- end
33
-
34
- it 'should autocomplete path with no starting slash' do
35
- map = XmlSitemap::Map.new('foobar.com')
36
- map.add('about').target.should == 'http://foobar.com/about'
37
- end
38
-
39
- it 'should allow full urls in items' do
40
- map = XmlSitemap::Map.new('foobar.com', :root => false)
41
- map.add('https://foobar.com/path').target.should == 'https://foobar.com/path'
42
- map.add('path2').target.should == 'http://foobar.com/path2'
43
- end
44
-
45
- it 'should render urls in https mode' do
46
- map = XmlSitemap::Map.new('foobar.com', :secure => true)
47
- map.add('path').target.should == 'https://foobar.com/path'
48
- end
49
-
50
- it 'should properly set entry time' do
51
- map = XmlSitemap::Map.new('foobar.com', :time => @base_time)
52
- map.add('hello').updated.should == @base_time
53
- map.add('world', :updated => @extra_time).updated.should == Time.gm(2011, 7, 1, 0, 0, 1)
54
- end
55
-
56
- it 'should help me test performance' do
57
- pending "comment this line to run benchmarks, takes roughly 30 seconds"
58
- map = XmlSitemap::Map.new('foobar.com', :time => @base_time)
59
- 50000.times do |i|
60
- map.add("hello#{i}")
61
- end
62
-
63
- Benchmark.bm do |x|
64
- x.report("render(:builder)") { map.render(:builder) }
65
- x.report("render(:nokogiri)") { map.render(:nokogiri) }
66
- x.report("render(:string)") { map.render(:string) }
5
+ let(:base_time) { Time.gm(2011, 6, 1, 0, 0, 1) }
6
+ let(:extra_time) { Time.gm(2011, 7, 1, 0, 0, 1) }
7
+
8
+ describe '#new' do
9
+ it 'should not allow empty domains' do
10
+ expect { XmlSitemap::Map.new(nil) }.to raise_error ArgumentError
11
+ expect { XmlSitemap::Map.new('') }.to raise_error ArgumentError
12
+ expect { XmlSitemap::Map.new(' ') }.to raise_error ArgumentError
13
+ end
14
+
15
+ it 'should not allow empty urls' do
16
+ map = XmlSitemap::Map.new('foobar.com')
17
+
18
+ expect { map.add(nil) }.to raise_error ArgumentError
19
+ expect { map.add('') }.to raise_error ArgumentError
20
+ expect { map.add(' ') }.to raise_error ArgumentError
21
+ end
22
+
23
+ it 'should have a default home path' do
24
+ map = XmlSitemap::Map.new('foobar.com')
25
+ map.should_not be_empty
26
+ map.items.first.target.should eq('http://foobar.com/')
27
+ end
28
+
29
+ context 'with :home => false' do
30
+ it 'should have no home path' do
31
+ map = XmlSitemap::Map.new('foobar.com', :home => false)
32
+ map.should be_empty
33
+ end
67
34
  end
68
35
  end
69
-
70
- it 'should raise Argument error if no time or date were provided' do
71
- map = XmlSitemap::Map.new('foobar.com', :time => @base_time)
72
- proc { map.add('hello', :updated => 5) }.
73
- should raise_error ArgumentError, "Time, Date, or ISO8601 String required for :updated!"
74
- end
75
-
76
- it 'should not raise Argument error if a iso8601 string is provided' do
77
- map = XmlSitemap::Map.new('foobar.com', :time => @base_time)
78
- proc { map.add('hello', :updated => "2011-09-12T23:18:49Z") }.
79
- should_not raise_error
80
- map.add('world', :updated => @extra_time.utc.iso8601).updated.should == Time.gm(2011, 7, 1, 0, 0, 1).utc.iso8601
81
- end
82
-
83
- it 'should not raise Argument error if a string is provided with :validate_time => false' do
84
- map = XmlSitemap::Map.new('foobar.com', :time => @base_time)
85
- proc { map.add('hello', :validate_time => false, :updated => 'invalid data') }.
86
- should_not raise_error
87
- end
88
-
89
- it 'should raise Argument error if an invalid string is provided' do
90
- map = XmlSitemap::Map.new('foobar.com', :time => @base_time)
91
- proc { map.add('hello', :updated => 'invalid data') }.
92
- should raise_error ArgumentError, "String provided to :updated did not match ISO8601 standard!"
93
- end
94
-
95
- it 'should have properly encoded entities' do
96
- map = XmlSitemap::Map.new('foobar.com', :time => @base_time)
97
- map.add('/path?a=b&c=d&e=sample string')
98
- map.render.should == fixture('encoded_map.xml')
99
- end
100
-
101
- it 'should have properly encoded entities using nokogiri render' do
102
- map = XmlSitemap::Map.new('foobar.com', :time => @base_time)
103
- map.add('/path?a=b&c=d&e=sample string')
104
- s = map.render(:nokogiri)
105
- # ignore ordering of urlset attributes by dropping first two lines
106
- s.split("\n")[2..-1].join("\n").should == fixture('encoded_map.xml').split("\n")[2..-1].join("\n")
107
- end
108
-
109
- it 'should have properly encoded entities using string render' do
110
- map = XmlSitemap::Map.new('foobar.com', :time => @base_time)
111
- map.add('/path?a=b&c=d&e=sample string')
112
- s = map.render(:string)
113
- # ignore ordering of urlset attributes by dropping first two lines
114
- s.split("\n")[2..-1].join("\n").should == fixture('encoded_map.xml').split("\n")[2..-1].join("\n")
115
- end
116
-
117
- it 'should not allow more than 50k records' do
118
- map = XmlSitemap::Map.new('foobar.com')
119
- proc {
120
- 1.upto(50001) { |i| map.add("url#{i}") }
121
- }.should raise_error RuntimeError, 'Only up to 50k records allowed!'
122
- end
123
-
124
- it 'should not allow urls longer than 2048 characters' do
125
- long_string = (1..2049).to_a.map { |i| "a" }.join
126
-
127
- map = XmlSitemap::Map.new('foobar.com')
128
- proc {
129
- map.add(long_string)
130
- }.should raise_error ArgumentError, "Target can't be longer than 2,048 characters!"
36
+
37
+ describe '#add' do
38
+ it 'should autocomplete path with no starting slash' do
39
+ map = XmlSitemap::Map.new('foobar.com')
40
+ map.add('about').target.should eq('http://foobar.com/about')
41
+ end
42
+
43
+ it 'should allow full urls in items' do
44
+ map = XmlSitemap::Map.new('foobar.com', :root => false)
45
+ map.add('https://foobar.com/path').target.should eq('https://foobar.com/path')
46
+ map.add('path2').target.should eq('http://foobar.com/path2')
47
+ end
48
+
49
+ it 'should render urls in https mode' do
50
+ map = XmlSitemap::Map.new('foobar.com', :secure => true)
51
+ map.add('path').target.should eq('https://foobar.com/path')
52
+ end
53
+
54
+ it 'should set entry time' do
55
+ map = XmlSitemap::Map.new('foobar.com', :time => base_time)
56
+ map.add('hello').updated.should eq(base_time)
57
+ map.add('world', :updated => extra_time).updated.should eq(Time.gm(2011, 7, 1, 0, 0, 1))
58
+ end
59
+
60
+ it 'should raise Argument error if no time or date were provided' do
61
+ map = XmlSitemap::Map.new('foobar.com', :time => base_time)
62
+ expect { map.add('hello', :updated => 5) }.
63
+ to raise_error ArgumentError, "Time, Date, or ISO8601 String required for :updated!"
64
+ end
65
+
66
+ it 'should not raise Argument error if a iso8601 string is provided' do
67
+ map = XmlSitemap::Map.new('foobar.com', :time => base_time)
68
+ expect { map.add('hello', :updated => "2011-09-12T23:18:49Z") }.not_to raise_error
69
+ map.add('world', :updated => extra_time.utc.iso8601).updated.should eq(Time.gm(2011, 7, 1, 0, 0, 1).utc.iso8601)
70
+ end
71
+
72
+ it 'should not raise Argument error if a string is provided with :validate_time => false' do
73
+ map = XmlSitemap::Map.new('foobar.com', :time => base_time)
74
+ expect { map.add('hello', :validate_time => false, :updated => 'invalid data') }.not_to raise_error
75
+ end
76
+
77
+ it 'should raise Argument error if an invalid string is provided' do
78
+ map = XmlSitemap::Map.new('foobar.com', :time => base_time)
79
+ expect { map.add('hello', :updated => 'invalid data') }.
80
+ to raise_error ArgumentError, "String provided to :updated did not match ISO8601 standard!"
81
+ end
82
+
83
+ it 'should not allow more than 50k records' do
84
+ map = XmlSitemap::Map.new('foobar.com')
85
+ expect {
86
+ 1.upto(50001) { |i| map.add("url#{i}") }
87
+ }.to raise_error RuntimeError, 'Only up to 50k records allowed!'
88
+ end
89
+
90
+ it 'should not allow urls longer than 2048 characters' do
91
+ long_string = (1..2049).to_a.map { |i| "a" }.join
92
+
93
+ map = XmlSitemap::Map.new('foobar.com')
94
+ expect {
95
+ map.add(long_string)
96
+ }.to raise_error ArgumentError, "Target can't be longer than 2,048 characters!"
97
+ end
131
98
  end
132
-
133
- it 'should save contents to the filesystem' do
134
- map = XmlSitemap::Map.new('foobar.com', :time => @base_time) do |m|
135
- m.add('about')
136
- m.add('terms')
137
- m.add('privacy')
138
- end
139
- path = "/tmp/sitemap_#{Time.now.to_i}.xml"
140
- map.render_to(path)
141
- File.read(path).should == fixture('saved_map.xml')
142
- File.delete(path) if File.exists?(path)
99
+
100
+ describe '#render' do
101
+
102
+ before do
103
+ opts1 = { :image_location => "http://foobar.com/foo.gif"}
104
+ opts2 = { :image_location => "http://foobar.com/foo.gif", :image_title => "Image Title"}
105
+ opts3 = { :image_location => "http://foobar.com/foo.gif", :image_caption => "Image Caption"}
106
+ opts4 = { :image_location => "http://foobar.com/foo.gif", :image_license => "Image License"}
107
+ opts5 = { :image_location => "http://foobar.com/foo.gif", :image_geolocation => "Image GeoLocation"}
108
+ opts6 = { :image_location => "http://foobar.com/foo.gif",
109
+ :image_title => "Image Title",
110
+ :image_caption => "Image Caption",
111
+ :image_license => "Image License",
112
+ :image_geolocation => "Image GeoLocation"}
113
+
114
+ @map = XmlSitemap::Map.new('foobar.com', :time => base_time)
115
+ @map.add('/path?a=b&c=d&e=image support string', opts1)
116
+ @map.add('/path?a=b&c=d&e=image support string', opts2)
117
+ @map.add('/path?a=b&c=d&e=image support string', opts3)
118
+ @map.add('/path?a=b&c=d&e=image support string', opts4)
119
+ @map.add('/path?a=b&c=d&e=image support string', opts5)
120
+ @map.add('/path?a=b&c=d&e=image support string', opts6)
121
+ end
122
+
123
+ it 'should have properly encoded entities' do
124
+ map = XmlSitemap::Map.new('foobar.com', :time => base_time)
125
+ map.add('/path?a=b&c=d&e=sample string')
126
+ map.render.split("\n")[2..-1].join("\n").should == fixture('encoded_map.xml').split("\n")[2..-1].join("\n")
127
+ end
128
+
129
+ context 'with builder engine' do
130
+ it 'should have properly encoded entities' do
131
+ map = XmlSitemap::Map.new('foobar.com', :time => base_time)
132
+ map.add('/path?a=b&c=d&e=sample string')
133
+ s = map.render(:builder)
134
+ # ignore ordering of urlset attributes by dropping first two lines
135
+ s.split("\n")[2..-1].join("\n").should == fixture('encoded_map.xml').split("\n")[2..-1].join("\n")
136
+ end
137
+ end
138
+
139
+ context 'with nokogiri engine' do
140
+ it 'should have properly encoded entities' do
141
+ map = XmlSitemap::Map.new('foobar.com', :time => base_time)
142
+ map.add('/path?a=b&c=d&e=sample string')
143
+ s = map.render(:nokogiri)
144
+ # ignore ordering of urlset attributes by dropping first two lines
145
+ s.split("\n")[2..-1].join("\n").should == fixture('encoded_map.xml').split("\n")[2..-1].join("\n")
146
+ end
147
+
148
+ it 'should have properly encoded entities with image support' do
149
+ s = @map.render(:nokogiri)
150
+ s.split("\n")[2..-1].join("\n").should == fixture('encoded_image_map.xml').split("\n")[2..-1].join("\n")
151
+ end
152
+ end
153
+
154
+ context 'with string engine' do
155
+ it 'should have properly encoded entities' do
156
+ map = XmlSitemap::Map.new('foobar.com', :time => base_time)
157
+ map.add('/path?a=b&c=d&e=sample string')
158
+ s = map.render(:string)
159
+ # ignore ordering of urlset attributes by dropping first two lines
160
+ s.split("\n")[2..-1].join("\n").should == fixture('encoded_map.xml').split("\n")[2..-1].join("\n")
161
+ end
162
+
163
+ it 'should have properly encoded entities with image support' do
164
+ s = @map.render(:string)
165
+ s.split("\n")[2..-1].join("\n").should == fixture('encoded_image_map.xml').split("\n")[2..-1].join("\n")
166
+ end
167
+ end
143
168
  end
144
-
145
- it 'should save gzip contents to the filesystem' do
146
- map = XmlSitemap::Map.new('foobar.com', :time => @base_time)
147
-
148
- path = "/tmp/sitemap.xml"
149
- path_gzip = path + ".gz"
150
-
151
- map.render_to(path)
152
- map.render_to(path_gzip, :gzip => true)
153
-
154
- checksum(File.read(path)).should == checksum(gunzip(path_gzip))
155
-
156
- File.delete(path) if File.exists?(path)
157
- File.delete(path_gzip) if File.exists?(path_gzip)
169
+
170
+ describe '#render_to' do
171
+ it 'should save contents to the filesystem' do
172
+ path = "/tmp/sitemap_#{Time.now.to_i}.xml"
173
+ map = XmlSitemap::Map.new('foobar.com', :time => base_time) do |m|
174
+ m.add('about')
175
+ m.add('terms')
176
+ m.add('privacy')
177
+ end
178
+
179
+ map.render_to(path)
180
+
181
+ File.read(path).split("\n")[2..-1].join("\n").should eq(fixture('saved_map.xml').split("\n")[2..-1].join("\n"))
182
+ File.delete(path) if File.exists?(path)
183
+ end
184
+
185
+ context 'with :gzip => true' do
186
+ it 'should save gzip contents to the filesystem' do
187
+ map = XmlSitemap::Map.new('foobar.com', :time => base_time)
188
+
189
+ path = "/tmp/sitemap.xml"
190
+ path_gzip = path + ".gz"
191
+
192
+ map.render_to(path)
193
+ map.render_to(path_gzip, :gzip => true)
194
+
195
+ checksum(File.read(path)).should eq(checksum(gunzip(path_gzip)))
196
+
197
+ File.delete(path) if File.exists?(path)
198
+ File.delete(path_gzip) if File.exists?(path_gzip)
199
+ end
200
+
201
+ it 'should add .gz extension if comression is enabled' do
202
+ map = XmlSitemap::Map.new('foobar.com', :time => base_time)
203
+ path = '/tmp/sitemap.xml'
204
+ path_gzip = path + ".gz"
205
+
206
+ map.render_to(path)
207
+ map.render_to(path, :gzip => true)
208
+
209
+ checksum(File.read(path)).should eq(checksum(gunzip(path_gzip)))
210
+
211
+ File.delete(path) if File.exists?(path)
212
+ File.delete(path_gzip) if File.exists?(path_gzip)
213
+ end
214
+ end
158
215
  end
159
-
160
- it 'should add .gz extension if comression is enabled' do
161
- map = XmlSitemap::Map.new('foobar.com', :time => @base_time)
162
- path = '/tmp/sitemap.xml'
163
- path_gzip = path + ".gz"
164
-
165
- map.render_to(path)
166
- map.render_to(path, :gzip => true)
167
-
168
- checksum(File.read(path)).should == checksum(gunzip(path_gzip))
169
-
170
- File.delete(path) if File.exists?(path)
171
- File.delete(path_gzip) if File.exists?(path_gzip)
216
+
217
+ describe 'performance' do
218
+ it 'should test rendering time' do
219
+ pending "comment this line to run benchmarks, takes roughly 30 seconds"
220
+ map = XmlSitemap::Map.new('foobar.com', :time => base_time)
221
+
222
+ 50000.times do |i|
223
+ map.add("hello#{i}")
224
+ end
225
+
226
+ Benchmark.bm do |x|
227
+ x.report("render(:builder)") { map.render(:builder) }
228
+ x.report("render(:nokogiri)") { map.render(:nokogiri) }
229
+ x.report("render(:string)") { map.render(:string) }
230
+ end
231
+ end
172
232
  end
173
233
  end
@@ -29,3 +29,13 @@ def gunzip(path)
29
29
  end
30
30
  contents
31
31
  end
32
+
33
+ module FileHelper
34
+ def delete_if_exists(path)
35
+ File.delete(path) if File.exists?(path)
36
+ end
37
+ end
38
+
39
+ class File
40
+ extend FileHelper
41
+ end
@@ -1,12 +1,27 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe 'XmlSitemap' do
4
- it 'creates a Map via shortcut' do
5
- XmlSitemap.new('foo.com').should be_a XmlSitemap::Map
6
- XmlSitemap.map('foo.com').should be_a XmlSitemap::Map
4
+ describe '#new' do
5
+ it 'returns a new map instance' do
6
+ XmlSitemap.new('foo.com').should be_a XmlSitemap::Map
7
+ end
7
8
  end
8
-
9
- it 'creates an Index via shortcut' do
10
- XmlSitemap.index.should be_a XmlSitemap::Index
9
+
10
+ describe '#map' do
11
+ it 'returns a new map instance' do
12
+ XmlSitemap.map('foo.com').should be_a XmlSitemap::Map
13
+ end
14
+ end
15
+
16
+ describe '#index' do
17
+ it 'returns a new index instancet' do
18
+ XmlSitemap.index.should be_a XmlSitemap::Index
19
+ end
20
+ end
21
+
22
+ describe '#version' do
23
+ it 'returns current version string' do
24
+ XmlSitemap.version.should eq(XmlSitemap::VERSION)
25
+ end
11
26
  end
12
27
  end
@@ -2,7 +2,7 @@ require File.expand_path('../lib/xml-sitemap/version', __FILE__)
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "xml-sitemap"
5
- s.version = XmlSitemap::VERSION.dup
5
+ s.version = XmlSitemap::VERSION
6
6
  s.summary = "Simple XML sitemap generator for Ruby/Rails applications."
7
7
  s.description = "Provides a wrapper to generate XML sitemaps and sitemap indexes."
8
8
  s.homepage = "http://github.com/sosedoff/xml-sitemap"
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
12
12
  s.add_development_dependency 'rake', '~> 0.8'
13
13
  s.add_development_dependency 'rspec', '~> 2.6'
14
14
  s.add_development_dependency 'simplecov', '~> 0.4'
15
- s.add_development_dependency 'nokogiri', '~> 1.5.0'
15
+ s.add_development_dependency 'nokogiri', '~> 1.5'
16
16
 
17
17
  s.add_runtime_dependency 'builder', '>= 2.0'
18
18
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xml-sitemap
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.3.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-10-23 00:00:00.000000000Z
12
+ date: 2013-03-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
16
- requirement: &2166022840 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,15 @@ dependencies:
21
21
  version: '0.8'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *2166022840
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: '0.8'
25
30
  - !ruby/object:Gem::Dependency
26
31
  name: rspec
27
- requirement: &2166022080 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
28
33
  none: false
29
34
  requirements:
30
35
  - - ~>
@@ -32,10 +37,15 @@ dependencies:
32
37
  version: '2.6'
33
38
  type: :development
34
39
  prerelease: false
35
- version_requirements: *2166022080
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: '2.6'
36
46
  - !ruby/object:Gem::Dependency
37
47
  name: simplecov
38
- requirement: &2166021560 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
39
49
  none: false
40
50
  requirements:
41
51
  - - ~>
@@ -43,21 +53,31 @@ dependencies:
43
53
  version: '0.4'
44
54
  type: :development
45
55
  prerelease: false
46
- version_requirements: *2166021560
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: '0.4'
47
62
  - !ruby/object:Gem::Dependency
48
63
  name: nokogiri
49
- requirement: &2166021100 !ruby/object:Gem::Requirement
64
+ requirement: !ruby/object:Gem::Requirement
50
65
  none: false
51
66
  requirements:
52
67
  - - ~>
53
68
  - !ruby/object:Gem::Version
54
- version: 1.5.0
69
+ version: '1.5'
55
70
  type: :development
56
71
  prerelease: false
57
- version_requirements: *2166021100
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ~>
76
+ - !ruby/object:Gem::Version
77
+ version: '1.5'
58
78
  - !ruby/object:Gem::Dependency
59
79
  name: builder
60
- requirement: &2166020560 !ruby/object:Gem::Requirement
80
+ requirement: !ruby/object:Gem::Requirement
61
81
  none: false
62
82
  requirements:
63
83
  - - ! '>='
@@ -65,7 +85,12 @@ dependencies:
65
85
  version: '2.0'
66
86
  type: :runtime
67
87
  prerelease: false
68
- version_requirements: *2166020560
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '2.0'
69
94
  description: Provides a wrapper to generate XML sitemaps and sitemap indexes.
70
95
  email:
71
96
  - dan.sosedoff@gmail.com
@@ -87,6 +112,7 @@ files:
87
112
  - lib/xml-sitemap/render_engine.rb
88
113
  - lib/xml-sitemap/version.rb
89
114
  - spec/fixtures/empty_index.xml
115
+ - spec/fixtures/encoded_image_map.xml
90
116
  - spec/fixtures/encoded_map.xml
91
117
  - spec/fixtures/group_index.xml
92
118
  - spec/fixtures/sample_index.xml
@@ -110,20 +136,27 @@ required_ruby_version: !ruby/object:Gem::Requirement
110
136
  - - ! '>='
111
137
  - !ruby/object:Gem::Version
112
138
  version: '0'
139
+ segments:
140
+ - 0
141
+ hash: -987931989253574637
113
142
  required_rubygems_version: !ruby/object:Gem::Requirement
114
143
  none: false
115
144
  requirements:
116
145
  - - ! '>='
117
146
  - !ruby/object:Gem::Version
118
147
  version: '0'
148
+ segments:
149
+ - 0
150
+ hash: -987931989253574637
119
151
  requirements: []
120
152
  rubyforge_project:
121
- rubygems_version: 1.8.10
153
+ rubygems_version: 1.8.25
122
154
  signing_key:
123
155
  specification_version: 3
124
156
  summary: Simple XML sitemap generator for Ruby/Rails applications.
125
157
  test_files:
126
158
  - spec/fixtures/empty_index.xml
159
+ - spec/fixtures/encoded_image_map.xml
127
160
  - spec/fixtures/encoded_map.xml
128
161
  - spec/fixtures/group_index.xml
129
162
  - spec/fixtures/sample_index.xml