sitemap_generator 1.3.5 → 1.3.6

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'http://rubygems.org'
2
+
3
+ gem 'sitemap_generator', :path => 'lib/'
data/Gemfile.lock ADDED
@@ -0,0 +1,14 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ sitemap_generator (1.3.5)
5
+
6
+ GEM
7
+ remote: http://rubygems.org/
8
+ specs:
9
+
10
+ PLATFORMS
11
+ ruby
12
+
13
+ DEPENDENCIES
14
+ sitemap_generator!
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.3.5
1
+ 1.3.6
@@ -15,6 +15,7 @@ module SitemapGenerator
15
15
  #
16
16
  class SitemapFile
17
17
  include ActionView::Helpers::NumberHelper
18
+ include ActionView::Helpers::TextHelper # Rails 2.2.2 fails with missing 'pluralize' otherwise
18
19
  attr_accessor :sitemap_path, :public_path, :filesize, :link_count, :hostname
19
20
 
20
21
  # <tt>public_path</tt> full path of the directory to write sitemaps in.
@@ -150,4 +151,4 @@ module SitemapGenerator
150
151
  end
151
152
  end
152
153
  end
153
- end
154
+ end
@@ -31,6 +31,8 @@ module SitemapGenerator
31
31
  # @return [Boolean]
32
32
  def self.rails3?
33
33
  Rails.version.to_f >= 3
34
+ rescue
35
+ false # Rails.version defined in 2.1.0
34
36
  end
35
37
  end
36
38
  end
@@ -1,8 +1,20 @@
1
+ # Require sitemap_generator at runtime. If we don't do this the ActionView helpers are included
2
+ # before the Rails environment can be loaded by other Rake tasks, which causes problems
3
+ # for those tasks when rendering using ActionView.
1
4
  namespace :sitemap do
2
- # Require sitemap_generator at runtime. If we don't do this the ActionView helpers are included
3
- # before the Rails environment can be loaded by other Rake tasks, which causes problems
4
- # for those tasks when rendering using ActionView.
5
+ # Require sitemap_generator only. When installed as a plugin, the require will fail, so in
6
+ # this case, we have to load the full environment first.
5
7
  task :require do
8
+ begin
9
+ require 'sitemap_generator'
10
+ rescue LoadError
11
+ Rake::Task['sitemap:require_environment'].invoke
12
+ end
13
+ end
14
+
15
+ # Require sitemap_generator after loading the Rails environment. We still need the require
16
+ # in case we are installed as a gem and are setup to not automatically be required.
17
+ task :require_environment => :environment do
6
18
  require 'sitemap_generator'
7
19
  end
8
20
 
@@ -24,9 +36,7 @@ namespace :sitemap do
24
36
  desc "Create Sitemap XML files (don't ping search engines)"
25
37
  task 'refresh:no_ping' => ['sitemap:create']
26
38
 
27
- # Require sitemap_generator to handle the case that we are installed as a gem and are set to not
28
- # automatically be required. If the library has already been required, this is harmless.
29
- task :create => [:environment, 'sitemap:require'] do
39
+ task :create => ['sitemap:require_environment'] do
30
40
  SitemapGenerator::Sitemap.verbose = verbose
31
41
  SitemapGenerator::Sitemap.create
32
42
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sitemap_generator
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 3
9
- - 5
10
- version: 1.3.5
9
+ - 6
10
+ version: 1.3.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Karl Varga
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-12-07 00:00:00 -08:00
19
+ date: 2010-12-12 00:00:00 -08:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -70,6 +70,8 @@ extensions: []
70
70
  extra_rdoc_files:
71
71
  - README.md
72
72
  files:
73
+ - Gemfile
74
+ - Gemfile.lock
73
75
  - MIT-LICENSE
74
76
  - README.md
75
77
  - Rakefile