spree_sitemap_generator 3.0.2 → 3.0.3
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/LICENSE +11 -8
- data/README.md +42 -10
- data/lib/generators/templates/config/sitemap.rb +2 -0
- data/lib/spree_sitemap_generator.rb +1 -35
- data/lib/spree_sitemap_generator/engine.rb +40 -0
- data/lib/spree_sitemap_generator/spree_defaults.rb +2 -2
- metadata +43 -75
- data/lib/spree_sitemap_generator_hooks.rb +0 -3
data/LICENSE
CHANGED
@@ -1,14 +1,17 @@
|
|
1
|
-
|
1
|
+
Copyright (c) 2011 Joshua Nussbaum
|
2
|
+
All rights reserved.
|
3
|
+
|
4
|
+
Redistribution and use in source and binary forms, with or without modification,
|
2
5
|
are permitted provided that the following conditions are met:
|
3
6
|
|
4
|
-
* Redistributions of source code must retain the above copyright notice,
|
7
|
+
* Redistributions of source code must retain the above copyright notice,
|
5
8
|
this list of conditions and the following disclaimer.
|
6
|
-
* Redistributions in binary form must reproduce the above copyright notice,
|
7
|
-
this list of conditions and the following disclaimer in the documentation
|
9
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
10
|
+
this list of conditions and the following disclaimer in the documentation
|
8
11
|
and/or other materials provided with the distribution.
|
9
|
-
* Neither the name
|
10
|
-
|
11
|
-
|
12
|
+
* Neither the name Spree nor the names of its contributors may be used to
|
13
|
+
endorse or promote products derived from this software without specific
|
14
|
+
prior written permission.
|
12
15
|
|
13
16
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
14
17
|
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
@@ -20,4 +23,4 @@ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
20
23
|
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
21
24
|
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
22
25
|
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
23
|
-
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
26
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
data/README.md
CHANGED
@@ -6,25 +6,57 @@ Spree sitemap generator is a sitemap generator based on the sitemap_generator ge
|
|
6
6
|
Installation
|
7
7
|
=======
|
8
8
|
|
9
|
-
|
9
|
+
1) add the gem to your `Gemfile`:
|
10
10
|
|
11
|
-
|
11
|
+
`gem 'spree_sitemap_generator'`
|
12
12
|
|
13
|
-
|
14
|
-
======
|
13
|
+
2) run bundler:
|
15
14
|
|
16
|
-
|
15
|
+
`bundle install`
|
16
|
+
|
17
|
+
3) run the installer, it will create a `config/sitemap.rb` file with some sane defaults
|
18
|
+
|
19
|
+
`rails generate spree_sitemap_generator:install`
|
20
|
+
|
21
|
+
4) add sitemap to your `.gitignore`
|
22
|
+
|
23
|
+
`echo "public/sitemap*" >> .gitignore`
|
24
|
+
|
25
|
+
5) setup a daily cron job to regenrate your sitemap via the `rake sitemap:refresh` task. If you use the Whenever gem, add this to your `config/schedule.rb`
|
26
|
+
|
27
|
+
```
|
28
|
+
every 1.day, :at => '5:00 am' do
|
29
|
+
rake "-s sitemap:refresh"
|
30
|
+
end
|
31
|
+
```
|
32
|
+
|
33
|
+
6) make sure crawlers can find the sitemap, by adding the following line to your `public/robots.txt` with your correct domain name
|
34
|
+
|
35
|
+
`echo "Sitemap: http://www.example.com/sitemap_index.xml.gz" >> public/robots.txt`
|
36
|
+
|
37
|
+
|
38
|
+
7) BOOM you're done!
|
39
|
+
|
40
|
+
More Configuration Options
|
41
|
+
==========================
|
42
|
+
|
43
|
+
Check out the README for the sitemap_generator gem at:
|
44
|
+
http://github.com/kjvarga/sitemap_generator
|
17
45
|
|
18
46
|
Features
|
19
47
|
=====
|
20
48
|
- Notifies search engine of new sitemaps (Google, Yahoo, Ask, Bing)
|
49
|
+
- Supports large huge product catalogs
|
50
|
+
- Adheres to 0.9 Sitemap protocol specification
|
21
51
|
- Compresses sitemaps with gzip
|
22
|
-
- Provides basic sitemap of a Spree site
|
23
|
-
-
|
24
|
-
|
52
|
+
- Provides basic sitemap of a Spree site (products, taxons, login page, signup page)
|
53
|
+
- Easily add additional sitemaps for pages you add to your spree site
|
54
|
+
- Supports Amazon S3 and other hosting services
|
55
|
+
- Thin wrapper over battle tested sitemap generator
|
25
56
|
|
26
57
|
Special Thanks
|
27
58
|
=====
|
59
|
+
- The creators of the sitemap_generator gem
|
60
|
+
- jackkinsella
|
28
61
|
|
29
|
-
|
30
|
-
Copyright (c) 2010 [name of extension creator], released under the New BSD License
|
62
|
+
Copyright (c) 2011 Joshua Nussbaum, released under the New BSD License
|
@@ -1,37 +1,3 @@
|
|
1
1
|
require 'spree_core'
|
2
|
-
require 'spree_sitemap_generator_hooks'
|
3
2
|
require 'sitemap_generator'
|
4
|
-
|
5
|
-
module SpreeSitemapGenerator
|
6
|
-
class Engine < Rails::Engine
|
7
|
-
|
8
|
-
config.autoload_paths += %W(#{config.root}/lib)
|
9
|
-
|
10
|
-
def self.activate
|
11
|
-
|
12
|
-
ActiveRecord::Relation.class_eval do
|
13
|
-
def last_updated
|
14
|
-
last_update = order('updated_at DESC').first
|
15
|
-
last_update.try(:updated_at)
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
ActiveRecord::Base.class_eval do
|
20
|
-
def self.last_updated
|
21
|
-
scoped.last_updated
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
SitemapGenerator::Sitemap.default_host = "http://#{Spree::Config[:site_url]}"
|
26
|
-
|
27
|
-
require 'spree_sitemap_generator/spree_defaults'
|
28
|
-
SitemapGenerator::LinkSet.send :include, SpreeSitemapGenerator::SpreeDefaults
|
29
|
-
|
30
|
-
Dir.glob(File.join(File.dirname(__FILE__), "../app/**/*_decorator*.rb")) do |c|
|
31
|
-
Rails.env.production? ? require(c) : load(c)
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
config.to_prepare &method(:activate).to_proc
|
36
|
-
end
|
37
|
-
end
|
3
|
+
require 'spree_sitemap_generator/engine'
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module SpreeSitemapGenerator
|
2
|
+
class Engine < Rails::Engine
|
3
|
+
engine_name 'spree_sitemap_generator'
|
4
|
+
|
5
|
+
config.autoload_paths += %W(#{config.root}/lib)
|
6
|
+
|
7
|
+
# use rspec for tests
|
8
|
+
config.generators do |g|
|
9
|
+
g.test_framework :rspec
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.activate
|
13
|
+
ActiveRecord::Relation.class_eval do
|
14
|
+
def last_updated
|
15
|
+
last_update = order('updated_at DESC').first
|
16
|
+
last_update.try(:updated_at)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
ActiveRecord::Base.class_eval do
|
21
|
+
def self.last_updated
|
22
|
+
scoped.last_updated
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
require 'spree_sitemap_generator/spree_defaults'
|
27
|
+
SitemapGenerator::Interpreter.send :include, SpreeSitemapGenerator::SpreeDefaults
|
28
|
+
|
29
|
+
Dir.glob(File.join(File.dirname(__FILE__), "../../app/**/*_decorator*.rb")) do |c|
|
30
|
+
Rails.application.config.cache_classes ? require(c) : load(c)
|
31
|
+
end
|
32
|
+
|
33
|
+
Dir.glob(File.join(File.dirname(__FILE__), "../../app/overrides/*.rb")) do |c|
|
34
|
+
Rails.application.config.cache_classes ? require(c) : load(c)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
config.to_prepare &method(:activate).to_proc
|
39
|
+
end
|
40
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module SpreeSitemapGenerator::SpreeDefaults
|
2
2
|
def default_url_options
|
3
|
-
{:host =>
|
3
|
+
{:host => SitemapGenerator::Sitemap.default_host}
|
4
4
|
end
|
5
5
|
include ::Rails.application.routes.url_helpers
|
6
6
|
|
@@ -17,7 +17,7 @@ module SpreeSitemapGenerator::SpreeDefaults
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def add_password_reset(options={})
|
20
|
-
add(
|
20
|
+
add(new_user_password_path, options)
|
21
21
|
end
|
22
22
|
|
23
23
|
def add_products(options={})
|
metadata
CHANGED
@@ -1,107 +1,75 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_sitemap_generator
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 3
|
8
|
-
- 0
|
9
|
-
- 2
|
10
|
-
version: 3.0.2
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 3.0.3
|
5
|
+
prerelease:
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
13
|
-
|
7
|
+
authors:
|
8
|
+
- Joshua Nussbaum
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
dependencies:
|
21
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2011-10-24 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
22
15
|
name: spree_core
|
23
|
-
|
24
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: &84319750 !ruby/object:Gem::Requirement
|
25
17
|
none: false
|
26
|
-
requirements:
|
27
|
-
- -
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
|
30
|
-
segments:
|
31
|
-
- 0
|
32
|
-
- 30
|
33
|
-
- 1
|
34
|
-
version: 0.30.1
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 0.70.0
|
35
22
|
type: :runtime
|
36
|
-
version_requirements: *id001
|
37
|
-
- !ruby/object:Gem::Dependency
|
38
|
-
name: sitemap_generator
|
39
23
|
prerelease: false
|
40
|
-
|
24
|
+
version_requirements: *84319750
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: sitemap_generator
|
27
|
+
requirement: &84319300 !ruby/object:Gem::Requirement
|
41
28
|
none: false
|
42
|
-
requirements:
|
43
|
-
- -
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
|
46
|
-
segments:
|
47
|
-
- 1
|
48
|
-
- 3
|
49
|
-
- 4
|
50
|
-
version: 1.3.4
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 2.0.1
|
51
33
|
type: :runtime
|
52
|
-
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *84319300
|
53
36
|
description:
|
54
|
-
email:
|
37
|
+
email: joshnuss@gmail.com
|
55
38
|
executables: []
|
56
|
-
|
57
39
|
extensions: []
|
58
|
-
|
59
40
|
extra_rdoc_files: []
|
60
|
-
|
61
|
-
files:
|
41
|
+
files:
|
62
42
|
- README.md
|
63
43
|
- LICENSE
|
64
|
-
- lib/spree_sitemap_generator.rb
|
65
44
|
- lib/tasks/spree_sitemap_generator.rake
|
66
|
-
- lib/spree_sitemap_generator/spree_defaults.rb
|
67
|
-
- lib/spree_sitemap_generator_hooks.rb
|
68
|
-
- lib/generators/templates/config/sitemap.rb
|
69
45
|
- lib/generators/spree_sitemap_generator/install_generator.rb
|
70
|
-
|
46
|
+
- lib/generators/templates/config/sitemap.rb
|
47
|
+
- lib/spree_sitemap_generator.rb
|
48
|
+
- lib/spree_sitemap_generator/engine.rb
|
49
|
+
- lib/spree_sitemap_generator/spree_defaults.rb
|
71
50
|
homepage:
|
72
51
|
licenses: []
|
73
|
-
|
74
52
|
post_install_message:
|
75
53
|
rdoc_options: []
|
76
|
-
|
77
|
-
require_paths:
|
54
|
+
require_paths:
|
78
55
|
- lib
|
79
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
56
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
80
57
|
none: false
|
81
|
-
requirements:
|
82
|
-
- -
|
83
|
-
- !ruby/object:Gem::Version
|
84
|
-
hash: 57
|
85
|
-
segments:
|
86
|
-
- 1
|
87
|
-
- 8
|
88
|
-
- 7
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
89
61
|
version: 1.8.7
|
90
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
62
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
91
63
|
none: false
|
92
|
-
requirements:
|
93
|
-
- -
|
94
|
-
- !ruby/object:Gem::Version
|
95
|
-
|
96
|
-
|
97
|
-
- 0
|
98
|
-
version: "0"
|
99
|
-
requirements:
|
64
|
+
requirements:
|
65
|
+
- - ! '>='
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0'
|
68
|
+
requirements:
|
100
69
|
- none
|
101
70
|
rubyforge_project:
|
102
|
-
rubygems_version: 1.
|
71
|
+
rubygems_version: 1.8.6
|
103
72
|
signing_key:
|
104
73
|
specification_version: 3
|
105
|
-
summary:
|
74
|
+
summary: Provides a sitemap file for Spree
|
106
75
|
test_files: []
|
107
|
-
|