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 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
@@ -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.
@@ -1,5 +1,5 @@
1
1
  module Sitemap
2
2
 
3
- VERSION = "0.3"
3
+ VERSION = "0.3.1"
4
4
 
5
5
  end
@@ -7,10 +7,10 @@ namespace :sitemap do
7
7
  desc "Generates a new sitemap."
8
8
  task :generate => :environment do
9
9
  setup
10
- path = File.join(Rails.public_path, "sitemap.xml")
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: '0.3'
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-02 00:00:00.000000000Z
12
+ date: 2012-05-03 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: sqlite3
16
- requirement: &20303660 !ruby/object:Gem::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: *20303660
24
+ version_requirements: *20942860
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: nokogiri
27
- requirement: &20303240 !ruby/object:Gem::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: *20303240
35
+ version_requirements: *20942440
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: minitest
38
- requirement: &20302820 !ruby/object:Gem::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: *20302820
46
+ version_requirements: *20942020
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rails
49
- requirement: &20302320 !ruby/object:Gem::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: *20302320
57
+ version_requirements: *20941500
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: nokogiri
60
- requirement: &20301900 !ruby/object:Gem::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: *20301900
68
+ version_requirements: *20941080
69
69
  description: A simple ruby on rails sitemap generator
70
70
  email: daniel@viseztrance.com
71
71
  executables: []