sitemap 0.3 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +8 -0
- data/lib/sitemap/generator.rb +2 -0
- data/lib/sitemap/version.rb +1 -1
- data/lib/tasks/sitemap.rake +2 -2
- metadata +12 -12
data/README.md
CHANGED
@@ -43,6 +43,14 @@ Building the sitemap:
|
|
43
43
|
rake sitemap:generate
|
44
44
|
```
|
45
45
|
|
46
|
+
By default the sitemap gets saved in the current application root path. You can change the save path by passing a LOCATION environment variable or using a configuration option:
|
47
|
+
|
48
|
+
```ruby
|
49
|
+
Sitemap.configure do |config|
|
50
|
+
config.save_path = "/home/user/apps/my-app/shared"
|
51
|
+
end
|
52
|
+
```
|
53
|
+
|
46
54
|
Ping search engines:
|
47
55
|
|
48
56
|
```ruby
|
data/lib/sitemap/generator.rb
CHANGED
@@ -151,11 +151,13 @@ module Sitemap
|
|
151
151
|
fragments.each_with_index do |fragment, i|
|
152
152
|
file_pattern = File.join(root, "sitemap-fragment-#{i + 1}.xml")
|
153
153
|
FileUtils.mv(fragment.path, file_pattern)
|
154
|
+
File.chmod(0755, file_pattern)
|
154
155
|
end
|
155
156
|
file = File.new(location, "w")
|
156
157
|
file.write(render "index")
|
157
158
|
file.close
|
158
159
|
end
|
160
|
+
File.chmod(0755, location)
|
159
161
|
end
|
160
162
|
|
161
163
|
# URL to the sitemap file.
|
data/lib/sitemap/version.rb
CHANGED
data/lib/tasks/sitemap.rake
CHANGED
@@ -7,10 +7,10 @@ namespace :sitemap do
|
|
7
7
|
desc "Generates a new sitemap."
|
8
8
|
task :generate => :environment do
|
9
9
|
setup
|
10
|
-
|
10
|
+
root = Sitemap.configuration.save_path || ENV["LOCATION"] || Rails.public_path
|
11
|
+
path = File.join(root, "sitemap.xml")
|
11
12
|
Sitemap::Generator.instance.build!
|
12
13
|
Sitemap::Generator.instance.save path
|
13
|
-
File.chmod(0755,path)
|
14
14
|
end
|
15
15
|
|
16
16
|
desc "Ping engines."
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sitemap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.3.1
|
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: 2012-05-
|
12
|
+
date: 2012-05-03 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sqlite3
|
16
|
-
requirement: &
|
16
|
+
requirement: &20942860 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *20942860
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: nokogiri
|
27
|
-
requirement: &
|
27
|
+
requirement: &20942440 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *20942440
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: minitest
|
38
|
-
requirement: &
|
38
|
+
requirement: &20942020 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *20942020
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rails
|
49
|
-
requirement: &
|
49
|
+
requirement: &20941500 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: 3.0.0
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *20941500
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: nokogiri
|
60
|
-
requirement: &
|
60
|
+
requirement: &20941080 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,7 +65,7 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *20941080
|
69
69
|
description: A simple ruby on rails sitemap generator
|
70
70
|
email: daniel@viseztrance.com
|
71
71
|
executables: []
|