sitemap_generator 6.2.1 → 6.3.0
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.
- checksums.yaml +4 -4
- data/CHANGES.md +7 -0
- data/README.md +9 -9
- data/VERSION +1 -1
- data/lib/sitemap_generator/adapters/aws_sdk_adapter.rb +10 -6
- data/lib/sitemap_generator/adapters/google_storage_adapter.rb +4 -2
- data/lib/sitemap_generator/link_set.rb +1 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd65e97e0a574eb1d124988e20c38312968548bf8ef8d381e648c54d6766d049
|
4
|
+
data.tar.gz: b9cbf014555cbdfb293c6e780a3e9ab4349db02f8fddbcddc28ab8c743f24657
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ec50b44415503a1d3bce5859cf6b397592212c19827f6dc45019df221f3c08131a04f7e89db98d21172982d6ca212c901638c30882c9b4b08adc107fff67d95
|
7
|
+
data.tar.gz: 3afc709b82309f5c052fb00e8c467554c44cc974d7dc122ae45938d9b80c574236639c74b85058a1251c7fc5a2fd2fe827d8478619612f8c6ee0a5ef514d780f
|
data/CHANGES.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
### 6.3.0
|
2
|
+
|
3
|
+
* Remove Bing's deprecated sitemap submission [#400](https://github.com/kjvarga/sitemap_generator/pull/400).
|
4
|
+
* `SitemapGenerator::AwsSdkAdapter`: Support configuring ACL and caching on the uploaded files [#409](https://github.com/kjvarga/sitemap_generator/pull/409).
|
5
|
+
* `SitemapGenerator::GoogleStorageAdapter`: Support configuring ACL on the uploaded files [#410](https://github.com/kjvarga/sitemap_generator/pull/410).
|
6
|
+
* Fix CircleCI specs for Ruby 3 [#407](https://github.com/kjvarga/sitemap_generator/pull/407).
|
7
|
+
|
1
8
|
### 6.2.1
|
2
9
|
|
3
10
|
* Bugfix: Improve handling of deprecated options in `AwsSdkAdapter`. Fixes bug where `:region` was being set to `nil`. [#390](https://github.com/kjvarga/sitemap_generator/pull/390).
|
data/README.md
CHANGED
@@ -15,7 +15,7 @@ Sitemaps adhere to the [Sitemap 0.9 protocol][sitemap_protocol] specification.
|
|
15
15
|
* Adheres to the [Sitemap 0.9 protocol][sitemap_protocol]
|
16
16
|
* Handles millions of links
|
17
17
|
* Customizable sitemap compression
|
18
|
-
* Notifies search engines (Google
|
18
|
+
* Notifies search engines (Google) of new sitemaps
|
19
19
|
* Ensures your old sitemaps stay in place if the new sitemap fails to generate
|
20
20
|
* Gives you complete control over your sitemap contents and naming scheme
|
21
21
|
* Intelligent sitemap indexing
|
@@ -58,7 +58,6 @@ In /Users/karl/projects/sitemap_generator-test/public/
|
|
58
58
|
Sitemap stats: 3 links / 1 sitemaps / 0m00s
|
59
59
|
|
60
60
|
Successful ping of Google
|
61
|
-
Successful ping of Bing
|
62
61
|
```
|
63
62
|
|
64
63
|
## Contents
|
@@ -205,7 +204,7 @@ SitemapGenerator.verbose = false
|
|
205
204
|
|
206
205
|
### Pinging Search Engines
|
207
206
|
|
208
|
-
Using `rake sitemap:refresh` will notify Google
|
207
|
+
Using `rake sitemap:refresh` will notify Google to let them know that a new sitemap
|
209
208
|
is available. To generate new sitemaps without notifying search engines, use `rake sitemap:refresh:no_ping`.
|
210
209
|
|
211
210
|
If you want to customize the hash of search engines you can access it at:
|
@@ -387,6 +386,8 @@ name but capitalized, e.g. `FOG_PATH_STYLE`.
|
|
387
386
|
|
388
387
|
```ruby
|
389
388
|
SitemapGenerator::Sitemap.adapter = SitemapGenerator::AwsSdkAdapter.new('s3_bucket',
|
389
|
+
acl: 'public-read', # Optional. This is the default.
|
390
|
+
cache_control: 'private, max-age=0, no-cache', # Optional. This is the default.
|
390
391
|
access_key_id: 'AKIAI3SW5CRAZBL4WSTA',
|
391
392
|
secret_access_key: 'asdfadsfdsafsadf',
|
392
393
|
region: 'us-east-1',
|
@@ -394,11 +395,9 @@ name but capitalized, e.g. `FOG_PATH_STYLE`.
|
|
394
395
|
)
|
395
396
|
```
|
396
397
|
|
397
|
-
Where the first argument is the S3 bucket name, and the rest are keyword argument options
|
398
|
-
are passed directly to the AWS client.
|
398
|
+
Where the first argument is the S3 bucket name, and the rest are keyword argument options. Options `:acl` and `:cache_control` configure access and caching of the uploaded files; all other options are passed directly to the AWS client.
|
399
399
|
|
400
|
-
See https://docs.aws.amazon.com/sdk-for-ruby/v2/api/Aws/S3/Client.html#initialize-instance_method
|
401
|
-
for a full list of supported options.
|
400
|
+
See [the `SitemapGenerator::AwsSdkAdapter` docs](https://github.com/kjvarga/sitemap_generator/blob/master/lib/sitemap_generator/adapters/aws_sdk_adapter.rb), and [https://docs.aws.amazon.com/sdk-for-ruby/v2/api/Aws/S3/Client.html#initialize-instance_method](https://docs.aws.amazon.com/sdk-for-ruby/v2/api/Aws/S3/Client.html#initialize-instance_method) for the full list of supported options.
|
402
401
|
|
403
402
|
##### `SitemapGenerator::WaveAdapter`
|
404
403
|
|
@@ -420,9 +419,10 @@ name but capitalized, e.g. `FOG_PATH_STYLE`.
|
|
420
419
|
|
421
420
|
```ruby
|
422
421
|
SitemapGenerator::Sitemap.adapter = SitemapGenerator::GoogleStorageAdapter.new(
|
422
|
+
acl: 'public', # Optional. This is the default value.
|
423
|
+
bucket: 'name_of_bucket'
|
423
424
|
credentials: 'path/to/keyfile.json',
|
424
425
|
project_id: 'google_account_project_id',
|
425
|
-
bucket: 'name_of_bucket'
|
426
426
|
)
|
427
427
|
```
|
428
428
|
Also, inline with Google Authentication options, it can also pick credentials from environment variables. All [supported environment variables][google_cloud_storage_authentication] can be used, for example: `GOOGLE_CLOUD_PROJECT` and `GOOGLE_CLOUD_CREDENTIALS`. An example of using this adapter with the environment variables is:
|
@@ -433,7 +433,7 @@ name but capitalized, e.g. `FOG_PATH_STYLE`.
|
|
433
433
|
)
|
434
434
|
```
|
435
435
|
|
436
|
-
All options other than the `:bucket`
|
436
|
+
All options other than the `:bucket` and `:acl` options are passed to the `Google::Cloud::Storage.new` initializer giving you maximum configurability. See the [Google Cloud Storage initializer][google_cloud_storage_initializer] for supported options.
|
437
437
|
|
438
438
|
#### An Example of Using an Adapter
|
439
439
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
6.
|
1
|
+
6.3.0
|
@@ -18,15 +18,19 @@ module SitemapGenerator
|
|
18
18
|
# Options:
|
19
19
|
# **Deprecated, use :endpoint instead** :aws_endpoint [String] The object storage endpoint,
|
20
20
|
# if not AWS, e.g. 'https://sfo2.digitaloceanspaces.com'
|
21
|
-
# **Deprecated, use :access_key_id instead** :
|
21
|
+
# **Deprecated, use :access_key_id instead** :aws_access_key_id [String] Your AWS access key id
|
22
22
|
# **Deprecated, use :secret_access_key instead** :aws_secret_access_key [String] Your AWS secret access key
|
23
23
|
# **Deprecated, use :region instead** :aws_region [String] Your AWS region
|
24
|
+
# :acl [String] The ACL to apply to the uploaded files. Defaults to 'public-read'.
|
25
|
+
# :cache_control [String] The cache control headder to apply to the uploaded files. Defaults to 'private, max-age=0, no-cache'.
|
24
26
|
#
|
25
27
|
# All other options you provide are passed directly to the AWS client.
|
26
28
|
# See https://docs.aws.amazon.com/sdk-for-ruby/v2/api/Aws/S3/Client.html#initialize-instance_method
|
27
29
|
# for a full list of supported options.
|
28
|
-
def initialize(bucket, aws_access_key_id: nil, aws_secret_access_key: nil, aws_region: nil, aws_endpoint: nil, **options)
|
30
|
+
def initialize(bucket, aws_access_key_id: nil, aws_secret_access_key: nil, aws_region: nil, aws_endpoint: nil, acl: 'public-read', cache_control: 'private, max-age=0, no-cache', **options)
|
29
31
|
@bucket = bucket
|
32
|
+
@acl = acl
|
33
|
+
@cache_control = cache_control
|
30
34
|
@options = options
|
31
35
|
set_option_unless_set(:access_key_id, aws_access_key_id)
|
32
36
|
set_option_unless_set(:secret_access_key, aws_secret_access_key)
|
@@ -39,11 +43,11 @@ module SitemapGenerator
|
|
39
43
|
def write(location, raw_data)
|
40
44
|
SitemapGenerator::FileAdapter.new.write(location, raw_data)
|
41
45
|
s3_object = s3_resource.bucket(@bucket).object(location.path_in_public)
|
42
|
-
s3_object.upload_file(location.path,
|
43
|
-
acl:
|
44
|
-
cache_control:
|
46
|
+
s3_object.upload_file(location.path, {
|
47
|
+
acl: @acl,
|
48
|
+
cache_control: @cache_control,
|
45
49
|
content_type: location[:compress] ? 'application/x-gzip' : 'application/xml'
|
46
|
-
)
|
50
|
+
}.compact)
|
47
51
|
end
|
48
52
|
|
49
53
|
private
|
@@ -10,8 +10,9 @@ module SitemapGenerator
|
|
10
10
|
#
|
11
11
|
# @param [Hash] opts Google::Cloud::Storage configuration options.
|
12
12
|
# @option :bucket [String] Required. Name of Google Storage Bucket where the file is to be uploaded.
|
13
|
+
# @option :acl [String] Optional. Access control which is applied to the uploaded file(s). Default value is 'public'.
|
13
14
|
#
|
14
|
-
# All options other than the `:bucket`
|
15
|
+
# All options other than the `:bucket` and `:acl` options are passed to the `Google::Cloud::Storage.new`
|
15
16
|
# initializer. See https://googleapis.dev/ruby/google-cloud-storage/latest/file.AUTHENTICATION.html
|
16
17
|
# for all the supported environment variables and https://github.com/googleapis/google-cloud-ruby/blob/master/google-cloud-storage/lib/google/cloud/storage.rb
|
17
18
|
# for supported options.
|
@@ -22,6 +23,7 @@ module SitemapGenerator
|
|
22
23
|
def initialize(opts = {})
|
23
24
|
opts = opts.clone
|
24
25
|
@bucket = opts.delete(:bucket)
|
26
|
+
@acl = opts.has_key?(:acl) ? opts.delete(:acl) : 'public'
|
25
27
|
@storage_options = opts
|
26
28
|
end
|
27
29
|
|
@@ -31,7 +33,7 @@ module SitemapGenerator
|
|
31
33
|
|
32
34
|
storage = Google::Cloud::Storage.new(**@storage_options)
|
33
35
|
bucket = storage.bucket(@bucket)
|
34
|
-
bucket.create_file(location.path, location.path_in_public, acl:
|
36
|
+
bucket.create_file(location.path, location.path_in_public, acl: @acl)
|
35
37
|
end
|
36
38
|
end
|
37
39
|
end
|
@@ -125,8 +125,7 @@ module SitemapGenerator
|
|
125
125
|
:include_index => false,
|
126
126
|
:filename => :sitemap,
|
127
127
|
:search_engines => {
|
128
|
-
:google => "http://www.google.com/webmasters/tools/ping?sitemap=%s"
|
129
|
-
:bing => "http://www.bing.com/webmaster/ping.aspx?sitemap=%s"
|
128
|
+
:google => "http://www.google.com/webmasters/tools/ping?sitemap=%s"
|
130
129
|
},
|
131
130
|
:create_index => :auto,
|
132
131
|
:compress => true,
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sitemap_generator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.
|
4
|
+
version: 6.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Karl Varga
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-08-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: builder
|