sitemap_generator 0.3.3 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,22 +1,20 @@
1
1
  SitemapGenerator
2
2
  ================
3
3
 
4
- A Rails 3-compatible gem/plugin to generate ['enterprise-class'][enterprise_class] Sitemaps using a familiar Rails Routes-like DSL. Sitemaps are readable by all search engines and adhere to the ['Sitemap protocol specification'][sitemap_protocol]. Automatically pings search engines to notify them of new sitemaps (including Google, Yahoo and Bing). Provides rake tasks to easily manage your sitemaps. Supports image sitemaps and handles millions of links.
4
+ SitemapGenerator is a Rails gem that makes it easy to generate ['enterprise-class'][enterprise_class] Sitemaps readable by all search engines. Generated Sitemaps adhere to the ['Sitemap protocol specification'][sitemap_protocol]. When you generate new Sitemaps, SitemapGenerator can automatically ping the major search engines (including Google, Yahoo and Bing) to notify them. SitemapGenerator includes rake tasks to easily manage your sitemaps.
5
5
 
6
6
  Features
7
7
  -------
8
8
 
9
- - v0.2.6: **Support ['image sitemaps'][sitemap_images]**!
10
- - v0.2.5: **Support Rails 3**!
9
+ - v0.2.6: ['Google Image Sitemap'][sitemap_images] support
10
+ - v0.2.5: Rails 3 support (beta)
11
11
 
12
12
  - Adheres to the ['Sitemap protocol specification'][sitemap_protocol]
13
13
  - Handles millions of links
14
14
  - Automatic Gzip of Sitemap files
15
15
  - Automatic ping of search engines to notify them of new sitemaps: Google, Yahoo, Bing, Ask, SitemapWriter
16
- - Won't clobber your old sitemaps if the new one fails to generate
17
- - Set the priority of links, change frequency etc
18
- - You control which links are included
19
- - You set the host name, so it doesn't matter if your application is in a subdirectory
16
+ - Leaves your old sitemaps in place if a new one fails to generate
17
+ - Allows you to set the hostname for the links in your Sitemap
20
18
 
21
19
  Foreword
22
20
  -------
@@ -163,7 +161,7 @@ Tested and working on:
163
161
 
164
162
  - **Rails** 3.0.0, sitemap_generator version >= 0.2.5
165
163
  - **Rails** 1.x - 2.3.5
166
- - **Ruby** 1.8.7, 1.9.1
164
+ - **Ruby** 1.8.6, 1.8.7, 1.9.1
167
165
 
168
166
  Notes
169
167
  =======
@@ -213,6 +211,7 @@ Thanks (in no particular order)
213
211
  - [Richie Vos](http://github.com/jerryvos)
214
212
  - [Adrian Mugnolo](http://github.com/xymbol)
215
213
  - [Jason Weathered](http://github.com/jasoncodes)
214
+ - [Andy Stewart](http://github.com/airblade)
216
215
 
217
216
  Copyright (c) 2009 Karl Varga released under the MIT license
218
217
 
data/Rakefile CHANGED
@@ -10,10 +10,10 @@ begin
10
10
  Jeweler::Tasks.new do |gem|
11
11
  gem.name = "sitemap_generator"
12
12
  gem.summary = %Q{Easily generate enterprise class Sitemaps for your Rails site using a familiar Rails Routes-like DSL}
13
- gem.description = %Q{A Rails 3-compatible gem/plugin to generate enterprise-class Sitemaps using a familiar Rails Routes-like DSL. Sitemaps are readable by all search engines and adhere to the Sitemap protocol specification. Automatically pings search engines to notify them of new sitemaps (including Google, Yahoo and Bing). Provides rake tasks to easily manage your sitemaps. Supports image sitemaps and handles millions of links.}
13
+ gem.description = %Q{SitemapGenerator is a Rails gem that makes it easy to generate enterprise-class Sitemaps readable by all search engines. Generated Sitemaps adhere to the Sitemap protocol specification. When you generate new Sitemaps, SitemapGenerator can automatically ping the major search engines (including Google, Yahoo and Bing) to notify them. SitemapGenerator includes rake tasks to easily manage your sitemaps.}
14
14
  gem.email = "kjvarga@gmail.com"
15
15
  gem.homepage = "http://github.com/kjvarga/sitemap_generator"
16
- gem.authors = ["Adam Salter", "Karl Varga"]
16
+ gem.authors = ["Karl Varga", "Adam Salter"]
17
17
  gem.files = FileList["[A-Z]*", "{bin,lib,rails,templates,tasks}/**/*"]
18
18
  gem.test_files = []
19
19
  gem.add_development_dependency "rspec"
@@ -81,14 +81,6 @@ namespace :test do
81
81
  end
82
82
  end
83
83
 
84
- desc "Release a new patch version"
85
- task :release_new_version do
86
- Rake::Task['version:bump:patch'].invoke
87
- Rake::Task['github:release'].invoke
88
- Rake::Task['git:release'].invoke
89
- Rake::Task['gemcutter:release'].invoke
90
- end
91
-
92
84
  desc "Run tests as a gem install"
93
85
  task :test => ['test:gem']
94
86
 
@@ -111,4 +103,20 @@ Rake::RDocTask.new(:rdoc) do |rdoc|
111
103
  rdoc.options << '--line-numbers' << '--inline-source'
112
104
  rdoc.rdoc_files.include('README.md')
113
105
  rdoc.rdoc_files.include('lib/**/*.rb')
106
+ end
107
+
108
+ namespace :release do
109
+
110
+ desc "Release a new patch version"
111
+ task :patch do
112
+ Rake::Task['version:bump:patch'].invoke
113
+ Rake::Task['release:current'].invoke
114
+ end
115
+
116
+ desc "Release the current version (e.g. after a version bump). This rebuilds the gemspec, pushes the updated code, tags it and releases to RubyGems"
117
+ task :current do
118
+ Rake::Task['github:release'].invoke
119
+ Rake::Task['git:release'].invoke
120
+ Rake::Task['gemcutter:release'].invoke
121
+ end
114
122
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.3
1
+ 1.0.0
@@ -36,7 +36,7 @@ module SitemapGenerator
36
36
  HTML
37
37
  @xml_wrapper_start.gsub!(/\s+/, ' ').gsub!(/ *> */, '>').strip!
38
38
  @xml_wrapper_end = %q[</urlset>]
39
- self.filesize = @xml_wrapper_start.bytesize + @xml_wrapper_end.bytesize
39
+ self.filesize = bytesize(@xml_wrapper_start) + bytesize(@xml_wrapper_end)
40
40
  end
41
41
 
42
42
  def lastmod
@@ -67,13 +67,13 @@ module SitemapGenerator
67
67
  # If a link cannot be added, the file is too large or the link limit has been reached.
68
68
  def add_link(link)
69
69
  xml = build_xml(::Builder::XmlMarkup.new, link)
70
- unless file_can_fit?(xml.bytesize)
70
+ unless file_can_fit?(bytesize(xml))
71
71
  self.finalize!
72
72
  return false
73
73
  end
74
74
 
75
75
  @xml_content << xml
76
- self.filesize += xml.bytesize
76
+ self.filesize += bytesize(xml)
77
77
  self.link_count += 1
78
78
  true
79
79
  end
@@ -119,6 +119,11 @@ module SitemapGenerator
119
119
  @xml_content = @xml_wrapper_start = @xml_wrapper_end = ''
120
120
  self.freeze
121
121
  end
122
+
123
+ # Return the bytesize length of the string
124
+ def bytesize(string)
125
+ string.respond_to?(:bytesize) ? string.bytesize : string.length
126
+ end
122
127
  end
123
128
  end
124
129
  end
@@ -17,7 +17,7 @@ module SitemapGenerator
17
17
  HTML
18
18
  @xml_wrapper_start.gsub!(/\s+/, ' ').gsub!(/ *> */, '>').strip!
19
19
  @xml_wrapper_end = %q[</sitemapindex>]
20
- self.filesize = @xml_wrapper_start.bytesize + @xml_wrapper_end.bytesize
20
+ self.filesize = bytesize(@xml_wrapper_start) + bytesize(@xml_wrapper_end)
21
21
  end
22
22
 
23
23
  # Return XML as a String
@@ -26,29 +26,11 @@ module SitemapGenerator
26
26
  FileUtils.rm(Dir[File.join(RAILS_ROOT, 'public/sitemap*.xml.gz')])
27
27
  end
28
28
 
29
- # Returns whether this environment is using ActionPack
30
- # version 3.0.0 or greater.
29
+ # Returns a boolean indicating whether this environment is Rails 3
31
30
  #
32
31
  # @return [Boolean]
33
32
  def self.rails3?
34
- # The ActionPack module is always loaded automatically in Rails >= 3
35
- return false unless defined?(ActionPack) && defined?(ActionPack::VERSION)
36
-
37
- version =
38
- if defined?(ActionPack::VERSION::MAJOR)
39
- ActionPack::VERSION::MAJOR
40
- else
41
- # Rails 1.2
42
- ActionPack::VERSION::Major
43
- end
44
-
45
- # 3.0.0.beta1 acts more like ActionPack 2
46
- # for purposes of this method
47
- # (checking whether block helpers require = or -).
48
- # This extra check can be removed when beta2 is out.
49
- version >= 3 &&
50
- !(defined?(ActionPack::VERSION::TINY) &&
51
- ActionPack::VERSION::TINY == "0.beta")
33
+ Rails.version.to_f >= 3
52
34
  end
53
35
  end
54
36
  end
metadata CHANGED
@@ -3,19 +3,19 @@ name: sitemap_generator
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
+ - 1
6
7
  - 0
7
- - 3
8
- - 3
9
- version: 0.3.3
8
+ - 0
9
+ version: 1.0.0
10
10
  platform: ruby
11
11
  authors:
12
- - Adam Salter
13
12
  - Karl Varga
13
+ - Adam Salter
14
14
  autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-05-28 00:00:00 -07:00
18
+ date: 2010-07-20 00:00:00 -07:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -42,7 +42,7 @@ dependencies:
42
42
  version: "0"
43
43
  type: :development
44
44
  version_requirements: *id002
45
- description: A Rails 3-compatible gem/plugin to generate enterprise-class Sitemaps using a familiar Rails Routes-like DSL. Sitemaps are readable by all search engines and adhere to the Sitemap protocol specification. Automatically pings search engines to notify them of new sitemaps (including Google, Yahoo and Bing). Provides rake tasks to easily manage your sitemaps. Supports image sitemaps and handles millions of links.
45
+ description: SitemapGenerator is a Rails gem that makes it easy to generate enterprise-class Sitemaps readable by all search engines. Generated Sitemaps adhere to the Sitemap protocol specification. When you generate new Sitemaps, SitemapGenerator can automatically ping the major search engines (including Google, Yahoo and Bing) to notify them. SitemapGenerator includes rake tasks to easily manage your sitemaps.
46
46
  email: kjvarga@gmail.com
47
47
  executables: []
48
48