fog-google 1.11.0 → 1.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/dependabot.yml +10 -0
- data/.github/workflows/ruby.yml +34 -0
- data/.github/workflows/stale.yml +23 -0
- data/CHANGELOG.md +88 -1
- data/README.md +19 -10
- data/ci/docker-image/Dockerfile +3 -3
- data/fog-google.gemspec +2 -2
- data/lib/fog/compute/google/models/address.rb +1 -1
- data/lib/fog/compute/google/models/addresses.rb +6 -6
- data/lib/fog/compute/google/models/backend_service.rb +1 -1
- data/lib/fog/compute/google/models/disk.rb +3 -3
- data/lib/fog/compute/google/models/disk_types.rb +2 -2
- data/lib/fog/compute/google/models/disks.rb +2 -2
- data/lib/fog/compute/google/models/firewall.rb +2 -2
- data/lib/fog/compute/google/models/firewalls.rb +1 -1
- data/lib/fog/compute/google/models/forwarding_rules.rb +2 -2
- data/lib/fog/compute/google/models/global_addresses.rb +1 -1
- data/lib/fog/compute/google/models/global_forwarding_rules.rb +1 -1
- data/lib/fog/compute/google/models/http_health_check.rb +2 -2
- data/lib/fog/compute/google/models/instance_group_managers.rb +2 -2
- data/lib/fog/compute/google/models/machine_types.rb +2 -2
- data/lib/fog/compute/google/models/operations.rb +3 -3
- data/lib/fog/compute/google/models/servers.rb +3 -3
- data/lib/fog/compute/google/models/subnetworks.rb +2 -2
- data/lib/fog/compute/google/models/target_instances.rb +2 -2
- data/lib/fog/compute/google/models/target_pools.rb +2 -2
- data/lib/fog/compute/google/models/url_maps.rb +1 -1
- data/lib/fog/compute/google/requests/abandon_instances.rb +1 -1
- data/lib/fog/compute/google/requests/add_instance_group_instances.rb +3 -3
- data/lib/fog/compute/google/requests/add_server_access_config.rb +3 -3
- data/lib/fog/compute/google/requests/add_target_pool_health_checks.rb +2 -2
- data/lib/fog/compute/google/requests/add_target_pool_instances.rb +2 -2
- data/lib/fog/compute/google/requests/attach_disk.rb +1 -1
- data/lib/fog/compute/google/requests/create_disk_snapshot.rb +1 -1
- data/lib/fog/compute/google/requests/expand_subnetwork_ip_cidr_range.rb +1 -1
- data/lib/fog/compute/google/requests/get_backend_service_health.rb +1 -1
- data/lib/fog/compute/google/requests/get_server_serial_port_output.rb +2 -2
- data/lib/fog/compute/google/requests/get_target_pool_health.rb +1 -1
- data/lib/fog/compute/google/requests/insert_address.rb +2 -2
- data/lib/fog/compute/google/requests/insert_backend_service.rb +1 -1
- data/lib/fog/compute/google/requests/insert_disk.rb +1 -1
- data/lib/fog/compute/google/requests/insert_firewall.rb +1 -1
- data/lib/fog/compute/google/requests/insert_forwarding_rule.rb +1 -1
- data/lib/fog/compute/google/requests/insert_global_address.rb +1 -1
- data/lib/fog/compute/google/requests/insert_global_forwarding_rule.rb +1 -1
- data/lib/fog/compute/google/requests/insert_http_health_check.rb +1 -1
- data/lib/fog/compute/google/requests/insert_image.rb +1 -1
- data/lib/fog/compute/google/requests/insert_instance_group.rb +3 -3
- data/lib/fog/compute/google/requests/insert_instance_group_manager.rb +7 -7
- data/lib/fog/compute/google/requests/insert_instance_template.rb +3 -3
- data/lib/fog/compute/google/requests/insert_network.rb +1 -1
- data/lib/fog/compute/google/requests/insert_route.rb +10 -10
- data/lib/fog/compute/google/requests/insert_server.rb +12 -8
- data/lib/fog/compute/google/requests/insert_ssl_certificate.rb +4 -4
- data/lib/fog/compute/google/requests/insert_subnetwork.rb +1 -1
- data/lib/fog/compute/google/requests/insert_target_http_proxy.rb +3 -3
- data/lib/fog/compute/google/requests/insert_target_https_proxy.rb +4 -4
- data/lib/fog/compute/google/requests/insert_target_instance.rb +1 -1
- data/lib/fog/compute/google/requests/insert_target_pool.rb +1 -1
- data/lib/fog/compute/google/requests/insert_url_map.rb +1 -1
- data/lib/fog/compute/google/requests/invalidate_url_map_cache.rb +1 -1
- data/lib/fog/compute/google/requests/list_addresses.rb +4 -4
- data/lib/fog/compute/google/requests/list_aggregated_addresses.rb +1 -1
- data/lib/fog/compute/google/requests/list_aggregated_disk_types.rb +2 -2
- data/lib/fog/compute/google/requests/list_aggregated_disks.rb +2 -2
- data/lib/fog/compute/google/requests/list_aggregated_forwarding_rules.rb +2 -2
- data/lib/fog/compute/google/requests/list_aggregated_instance_group_managers.rb +4 -4
- data/lib/fog/compute/google/requests/list_aggregated_instance_groups.rb +1 -1
- data/lib/fog/compute/google/requests/list_aggregated_machine_types.rb +2 -2
- data/lib/fog/compute/google/requests/list_aggregated_servers.rb +2 -2
- data/lib/fog/compute/google/requests/list_aggregated_subnetworks.rb +4 -4
- data/lib/fog/compute/google/requests/list_aggregated_target_instances.rb +4 -4
- data/lib/fog/compute/google/requests/list_aggregated_target_pools.rb +4 -4
- data/lib/fog/compute/google/requests/list_disk_types.rb +2 -2
- data/lib/fog/compute/google/requests/list_disks.rb +2 -2
- data/lib/fog/compute/google/requests/list_firewalls.rb +4 -4
- data/lib/fog/compute/google/requests/list_forwarding_rules.rb +2 -2
- data/lib/fog/compute/google/requests/list_global_addresses.rb +5 -5
- data/lib/fog/compute/google/requests/list_global_forwarding_rules.rb +2 -2
- data/lib/fog/compute/google/requests/list_global_operations.rb +4 -4
- data/lib/fog/compute/google/requests/list_http_health_checks.rb +2 -2
- data/lib/fog/compute/google/requests/list_images.rb +2 -2
- data/lib/fog/compute/google/requests/list_instance_group_managers.rb +2 -2
- data/lib/fog/compute/google/requests/list_instance_templates.rb +4 -4
- data/lib/fog/compute/google/requests/list_machine_types.rb +4 -4
- data/lib/fog/compute/google/requests/list_networks.rb +4 -4
- data/lib/fog/compute/google/requests/list_subnetworks.rb +4 -4
- data/lib/fog/compute/google/requests/list_target_pools.rb +4 -4
- data/lib/fog/compute/google/requests/list_url_maps.rb +2 -2
- data/lib/fog/compute/google/requests/patch_firewall.rb +1 -1
- data/lib/fog/compute/google/requests/remove_instance_group_instances.rb +3 -3
- data/lib/fog/compute/google/requests/remove_target_pool_health_checks.rb +2 -2
- data/lib/fog/compute/google/requests/remove_target_pool_instance.rb +2 -2
- data/lib/fog/compute/google/requests/remove_target_pool_instances.rb +2 -2
- data/lib/fog/compute/google/requests/set_common_instance_metadata.rb +2 -2
- data/lib/fog/compute/google/requests/set_forwarding_rule_target.rb +1 -1
- data/lib/fog/compute/google/requests/set_global_forwarding_rule_target.rb +1 -1
- data/lib/fog/compute/google/requests/set_server_metadata.rb +2 -2
- data/lib/fog/compute/google/requests/set_server_tags.rb +2 -2
- data/lib/fog/compute/google/requests/set_snapshot_labels.rb +2 -2
- data/lib/fog/compute/google/requests/set_subnetwork_private_ip_google_access.rb +1 -1
- data/lib/fog/compute/google/requests/set_target_http_proxy_url_map.rb +1 -1
- data/lib/fog/compute/google/requests/set_target_https_proxy_ssl_certificates.rb +1 -1
- data/lib/fog/compute/google/requests/set_target_https_proxy_url_map.rb +1 -1
- data/lib/fog/compute/google/requests/set_target_pool_backup.rb +2 -2
- data/lib/fog/compute/google/requests/update_firewall.rb +1 -1
- data/lib/fog/compute/google/requests/update_http_health_check.rb +1 -1
- data/lib/fog/compute/google/requests/update_url_map.rb +1 -1
- data/lib/fog/compute/google/requests/validate_url_map.rb +1 -1
- data/lib/fog/dns/google/requests/create_change.rb +2 -2
- data/lib/fog/google/models/sql/instance.rb +2 -2
- data/lib/fog/google/requests/monitoring/create_metric_descriptor.rb +8 -8
- data/lib/fog/google/requests/monitoring/create_timeseries.rb +1 -1
- data/lib/fog/google/requests/monitoring/list_timeseries.rb +1 -1
- data/lib/fog/google/requests/pubsub/acknowledge_subscription.rb +1 -1
- data/lib/fog/google/requests/pubsub/create_subscription.rb +3 -3
- data/lib/fog/google/requests/sql/clone_instance.rb +4 -4
- data/lib/fog/google/requests/sql/delete_user.rb +1 -1
- data/lib/fog/google/requests/sql/export_instance.rb +3 -3
- data/lib/fog/google/requests/sql/import_instance.rb +2 -2
- data/lib/fog/google/requests/sql/insert_backup_run.rb +1 -1
- data/lib/fog/google/requests/sql/insert_instance.rb +2 -2
- data/lib/fog/google/requests/sql/insert_ssl_cert.rb +1 -1
- data/lib/fog/google/requests/sql/insert_user.rb +1 -1
- data/lib/fog/google/requests/sql/restore_instance_backup.rb +4 -4
- data/lib/fog/google/requests/sql/update_instance.rb +2 -2
- data/lib/fog/google/shared.rb +3 -3
- data/lib/fog/google/version.rb +1 -1
- data/lib/fog/storage/google_json/models/directories.rb +1 -1
- data/lib/fog/storage/google_json/models/directory.rb +1 -1
- data/lib/fog/storage/google_json/models/file.rb +1 -1
- data/lib/fog/storage/google_json/models/files.rb +1 -1
- data/lib/fog/storage/google_json/requests/copy_object.rb +12 -1
- data/lib/fog/storage/google_json/requests/get_object.rb +6 -3
- data/lib/fog/storage/google_json/requests/list_buckets.rb +4 -4
- data/lib/fog/storage/google_json/requests/list_objects.rb +1 -1
- data/lib/fog/storage/google_json/requests/put_bucket.rb +1 -1
- data/lib/fog/storage/google_json/requests/put_bucket_acl.rb +1 -1
- data/lib/fog/storage/google_json/requests/put_object.rb +1 -1
- data/lib/fog/storage/google_json/requests/put_object_acl.rb +1 -1
- data/lib/fog/storage/google_json/utils.rb +5 -1
- data/lib/fog/storage/google_xml/models/file.rb +2 -2
- data/tasks/changelog.rake +5 -3
- data/test/integration/monitoring/test_metric_descriptors.rb +1 -1
- data/test/integration/storage/storage_shared.rb +7 -2
- data/test/integration/storage/test_objects.rb +39 -1
- data/test/unit/storage/test_common_xml_collections.rb +11 -0
- data/test/unit/storage/test_json_requests.rb +8 -0
- metadata +14 -13
- data/.travis.yml +0 -16
@@ -18,9 +18,9 @@ module Fog
|
|
18
18
|
# @see https://cloud.google.com/pubsub/reference/rest/v1/projects.subscriptions/create
|
19
19
|
def create_subscription(subscription_name, topic, push_config = {}, ack_deadline_seconds = nil)
|
20
20
|
subscription = ::Google::Apis::PubsubV1::Subscription.new(
|
21
|
-
:
|
22
|
-
:
|
23
|
-
:
|
21
|
+
topic: topic,
|
22
|
+
ack_deadline_seconds: ack_deadline_seconds,
|
23
|
+
push_config: push_config
|
24
24
|
)
|
25
25
|
|
26
26
|
@pubsub.create_subscription(subscription_name, subscription)
|
@@ -15,14 +15,14 @@ module Fog
|
|
15
15
|
|
16
16
|
unless log_filename.nil? || log_position.nil?
|
17
17
|
context[:bin_log_coordinates] = ::Google::Apis::SqladminV1beta4::BinLogCoordinates.new(
|
18
|
-
:
|
19
|
-
:
|
20
|
-
:
|
18
|
+
kind: "sql#binLogCoordinates",
|
19
|
+
log_filename: log_filename,
|
20
|
+
log_position: log_position
|
21
21
|
)
|
22
22
|
end
|
23
23
|
|
24
24
|
clone_request = ::Google::Apis::SqladminV1beta4::CloneInstancesRequest.new(
|
25
|
-
:
|
25
|
+
clone_context: ::Google::Apis::SqladminV1beta4::CloneContext.new(**context)
|
26
26
|
)
|
27
27
|
|
28
28
|
@sql.clone_instance(@project, instance_id, clone_request)
|
@@ -24,12 +24,12 @@ module Fog
|
|
24
24
|
|
25
25
|
unless csv_export_options.empty?
|
26
26
|
data[:csv_export_options] =
|
27
|
-
::Google::Apis::SqladminV1beta4::ExportContext::CsvExportOptions.new(csv_export_options)
|
27
|
+
::Google::Apis::SqladminV1beta4::ExportContext::CsvExportOptions.new(**csv_export_options)
|
28
28
|
end
|
29
29
|
|
30
30
|
unless sql_export_options.nil?
|
31
31
|
data[:sql_export_options] =
|
32
|
-
::Google::Apis::SqladminV1beta4::ExportContext::SqlExportOptions.new(sql_export_options)
|
32
|
+
::Google::Apis::SqladminV1beta4::ExportContext::SqlExportOptions.new(**sql_export_options)
|
33
33
|
end
|
34
34
|
|
35
35
|
export_context = ::Google::Apis::SqladminV1beta4::ExportContext.new(export_context)
|
@@ -37,7 +37,7 @@ module Fog
|
|
37
37
|
@project,
|
38
38
|
instance_id,
|
39
39
|
::Google::Apis::SqladminV1beta4::ExportInstancesRequest.new(
|
40
|
-
:
|
40
|
+
export_context: export_context
|
41
41
|
)
|
42
42
|
)
|
43
43
|
end
|
@@ -19,14 +19,14 @@ module Fog
|
|
19
19
|
data[:import_user] = import_user unless import_user.nil?
|
20
20
|
unless csv_import_options.nil?
|
21
21
|
data[:csv_import_options] =
|
22
|
-
::Google::Apis::SqladminV1beta4::ImportContext::CsvImportOptions.new(csv_import_options)
|
22
|
+
::Google::Apis::SqladminV1beta4::ImportContext::CsvImportOptions.new(**csv_import_options)
|
23
23
|
end
|
24
24
|
|
25
25
|
@sql.import_instance(
|
26
26
|
@project,
|
27
27
|
instance_id,
|
28
28
|
::Google::Apis::SqladminV1beta4::ImportInstancesRequest.new(
|
29
|
-
:
|
29
|
+
import_context: ::Google::Apis::SqladminV1beta4::ImportContext.new(**data)
|
30
30
|
)
|
31
31
|
)
|
32
32
|
end
|
@@ -8,9 +8,9 @@ module Fog
|
|
8
8
|
|
9
9
|
class Real
|
10
10
|
def insert_instance(name, tier, options = {})
|
11
|
-
instance = ::Google::Apis::SqladminV1beta4::DatabaseInstance.new(options)
|
11
|
+
instance = ::Google::Apis::SqladminV1beta4::DatabaseInstance.new(**options)
|
12
12
|
instance.name = name
|
13
|
-
instance.settings = ::Google::Apis::SqladminV1beta4::Settings.new(instance.settings || {})
|
13
|
+
instance.settings = ::Google::Apis::SqladminV1beta4::Settings.new(**instance.settings || {})
|
14
14
|
instance.settings.tier = tier
|
15
15
|
@sql.insert_instance(@project, instance)
|
16
16
|
end
|
@@ -9,10 +9,10 @@ module Fog
|
|
9
9
|
class Real
|
10
10
|
def restore_instance_backup(instance_id, backup_run_id)
|
11
11
|
request = ::Google::Apis::SqladminV1beta4::RestoreInstancesBackupRequest.new(
|
12
|
-
:
|
13
|
-
:
|
14
|
-
:
|
15
|
-
:
|
12
|
+
restore_backup_context: ::Google::Apis::SqladminV1beta4::RestoreBackupContext.new(
|
13
|
+
backup_run_id: backup_run_id,
|
14
|
+
instance_id: instance_id,
|
15
|
+
kind: "sql#restoreBackupContext"
|
16
16
|
)
|
17
17
|
)
|
18
18
|
@sql.restore_instance_backup(@project, instance_id, request)
|
@@ -7,14 +7,14 @@ module Fog
|
|
7
7
|
# @see https://cloud.google.com/sql/docs/mysql/admin-api/v1beta4/instances/update
|
8
8
|
class Real
|
9
9
|
def update_instance(instance_id, settings_version, tier, settings = {})
|
10
|
-
settings = ::Google::Apis::SqladminV1beta4::Settings.new(settings)
|
10
|
+
settings = ::Google::Apis::SqladminV1beta4::Settings.new(**settings)
|
11
11
|
settings.tier = tier
|
12
12
|
settings.settings_version = settings_version
|
13
13
|
|
14
14
|
@sql.update_instance(
|
15
15
|
@project,
|
16
16
|
instance_id,
|
17
|
-
::Google::Apis::SqladminV1beta4::DatabaseInstance.new(:
|
17
|
+
::Google::Apis::SqladminV1beta4::DatabaseInstance.new(settings: settings)
|
18
18
|
)
|
19
19
|
end
|
20
20
|
end
|
data/lib/fog/google/shared.rb
CHANGED
@@ -87,10 +87,10 @@ module Fog
|
|
87
87
|
# Applies given options to the client instance
|
88
88
|
#
|
89
89
|
# @param [Google::Apis::Core::BaseService] service API service client instance
|
90
|
-
# @param [Hash]
|
91
|
-
# @param [Hash] _ignored Rest of the options (for convenience, ignored)
|
90
|
+
# @param [Hash] options (all ignored a.t.m., except :google_client_options)
|
92
91
|
# @return [void]
|
93
|
-
def apply_client_options(service,
|
92
|
+
def apply_client_options(service, options = {})
|
93
|
+
google_client_options = options[:google_client_options]
|
94
94
|
return if google_client_options.nil? || google_client_options.empty?
|
95
95
|
(service.client_options.members & google_client_options.keys).each do |option|
|
96
96
|
service.client_options[option] = google_client_options[option]
|
data/lib/fog/google/version.rb
CHANGED
@@ -105,7 +105,7 @@ module Fog
|
|
105
105
|
|
106
106
|
options[:predefined_acl] ||= @predefined_acl
|
107
107
|
|
108
|
-
service.put_object(directory.key, key, body, options)
|
108
|
+
service.put_object(directory.key, key, body, **options)
|
109
109
|
self.content_length = Fog::Storage.get_body_size(body)
|
110
110
|
self.content_type ||= Fog::Storage.get_content_type(body)
|
111
111
|
true
|
@@ -33,7 +33,7 @@ module Fog
|
|
33
33
|
|
34
34
|
def get(key, options = {}, &block)
|
35
35
|
requires :directory
|
36
|
-
data = service.get_object(directory.key, key, options, &block).to_h
|
36
|
+
data = service.get_object(directory.key, key, **options, &block).to_h
|
37
37
|
new(data)
|
38
38
|
rescue ::Google::Apis::ClientError => e
|
39
39
|
raise e unless e.status_code == 404
|
@@ -14,9 +14,20 @@ module Fog
|
|
14
14
|
def copy_object(source_bucket, source_object,
|
15
15
|
target_bucket, target_object, options = {})
|
16
16
|
request_options = ::Google::Apis::RequestOptions.default.merge(options)
|
17
|
+
|
18
|
+
object = ::Google::Apis::StorageV1::Object.new(**options)
|
19
|
+
|
17
20
|
@storage_json.copy_object(source_bucket, source_object,
|
18
21
|
target_bucket, target_object,
|
19
|
-
request_options)
|
22
|
+
object, options: request_options, **filter_keyword_args(options))
|
23
|
+
end
|
24
|
+
|
25
|
+
private
|
26
|
+
|
27
|
+
def filter_keyword_args(options)
|
28
|
+
method = @storage_json.method(:copy_object)
|
29
|
+
allowed = method.parameters.filter { |param| %i(key keyreq).include?(param[0]) }.map { |param| param[1] }.compact
|
30
|
+
options.filter { |key, _| allowed.include?(key) }
|
20
31
|
end
|
21
32
|
end
|
22
33
|
|
@@ -39,6 +39,8 @@ module Fog
|
|
39
39
|
raise ArgumentError.new("object_name is required") unless object_name
|
40
40
|
|
41
41
|
buf = Tempfile.new("fog-google-storage-temp")
|
42
|
+
buf.binmode
|
43
|
+
buf.unlink
|
42
44
|
|
43
45
|
# Two requests are necessary, first for metadata, then for content.
|
44
46
|
# google-api-ruby-client doesn't allow fetching both metadata and content
|
@@ -53,18 +55,19 @@ module Fog
|
|
53
55
|
:options => request_options
|
54
56
|
}
|
55
57
|
|
56
|
-
object = @storage_json.get_object(bucket_name, object_name, all_opts).to_h
|
58
|
+
object = @storage_json.get_object(bucket_name, object_name, **all_opts).to_h
|
57
59
|
@storage_json.get_object(
|
58
60
|
bucket_name,
|
59
61
|
object_name,
|
60
|
-
all_opts.merge(:download_dest => buf
|
62
|
+
**all_opts.merge(:download_dest => buf)
|
61
63
|
)
|
62
64
|
|
65
|
+
buf.seek(0)
|
66
|
+
|
63
67
|
if block_given?
|
64
68
|
yield buf.read, nil, nil
|
65
69
|
else
|
66
70
|
object[:body] = buf.read
|
67
|
-
buf.unlink
|
68
71
|
end
|
69
72
|
|
70
73
|
object
|
@@ -11,10 +11,10 @@ module Fog
|
|
11
11
|
prefix: nil, projection: nil)
|
12
12
|
@storage_json.list_buckets(
|
13
13
|
@project,
|
14
|
-
:
|
15
|
-
:
|
16
|
-
:
|
17
|
-
:
|
14
|
+
max_results: max_results,
|
15
|
+
page_token: page_token,
|
16
|
+
prefix: prefix,
|
17
|
+
projection: projection
|
18
18
|
)
|
19
19
|
end
|
20
20
|
end
|
@@ -12,7 +12,7 @@ module Fog
|
|
12
12
|
raise ArgumentError.new("bucket_name is required") unless bucket_name
|
13
13
|
raise ArgumentError.new("acl is required") unless acl
|
14
14
|
|
15
|
-
acl_update = ::Google::Apis::StorageV1::BucketAccessControl.new(acl)
|
15
|
+
acl_update = ::Google::Apis::StorageV1::BucketAccessControl.new(**acl)
|
16
16
|
@storage_json.insert_bucket_access_control(bucket_name, acl_update)
|
17
17
|
end
|
18
18
|
end
|
@@ -15,7 +15,7 @@ module Fog
|
|
15
15
|
raise ArgumentError.new("object_name is required") unless object_name
|
16
16
|
raise ArgumentError.new("acl is required") unless acl
|
17
17
|
|
18
|
-
acl_object = ::Google::Apis::StorageV1::ObjectAccessControl.new(acl)
|
18
|
+
acl_object = ::Google::Apis::StorageV1::ObjectAccessControl.new(**acl)
|
19
19
|
|
20
20
|
@storage_json.insert_object_access_control(
|
21
21
|
bucket_name, object_name, acl_object
|
@@ -19,7 +19,11 @@ module Fog
|
|
19
19
|
|
20
20
|
def host_path_query(params, expires)
|
21
21
|
params[:headers]["Date"] = expires.to_i
|
22
|
-
|
22
|
+
# implementation from CGI.escape, but without ' ' to '+' conversion
|
23
|
+
params[:path] = params[:path].b.gsub(/([^a-zA-Z0-9_.\-~]+)/) { |m|
|
24
|
+
'%' + m.unpack('H2' * m.bytesize).join('%').upcase
|
25
|
+
}.gsub("%2F", "/")
|
26
|
+
|
23
27
|
query = []
|
24
28
|
|
25
29
|
if params[:query]
|
@@ -51,7 +51,7 @@ module Fog
|
|
51
51
|
|
52
52
|
remove_method :metadata
|
53
53
|
def metadata
|
54
|
-
attributes.
|
54
|
+
attributes.select { |key, _value| key.to_s =~ /^x-goog-meta-/ }
|
55
55
|
end
|
56
56
|
|
57
57
|
remove_method :metadata=
|
@@ -109,7 +109,7 @@ module Fog
|
|
109
109
|
options["Expires"] = expires if expires
|
110
110
|
options.merge!(metadata)
|
111
111
|
|
112
|
-
data = service.put_object(directory.key, key, body, options)
|
112
|
+
data = service.put_object(directory.key, key, body, **options)
|
113
113
|
merge_attributes(data.headers.reject { |key, _value| ["Content-Length", "Content-Type"].include?(key) })
|
114
114
|
self.content_length = Fog::Storage.get_body_size(body)
|
115
115
|
self.content_type ||= Fog::Storage.get_content_type(body)
|
data/tasks/changelog.rake
CHANGED
@@ -25,13 +25,15 @@ end
|
|
25
25
|
|
26
26
|
# Extracts all github users contributed since last tag
|
27
27
|
def users_since_last_tag
|
28
|
-
`git --no-pager log $(git describe --tags --abbrev=0)..HEAD --grep="Merge" --pretty=format:"%s" | cut -d' ' -f 6 | cut -d/ -f1 | uniq`
|
28
|
+
`git --no-pager log $(git describe --tags --abbrev=0)..HEAD --grep="Merge" --pretty=format:"%s" | cut -d' ' -f 6 | cut -d/ -f1 | sort | uniq`
|
29
29
|
end
|
30
30
|
|
31
31
|
namespace :changelog do
|
32
32
|
task :generate do
|
33
33
|
insert_after_line("CHANGELOG.md", changes_since_last_tag, /^## Next/)
|
34
|
-
|
35
|
-
printf(
|
34
|
+
contributors = users_since_last_tag.split("\n").map { |name| "@" + name }
|
35
|
+
printf("Huge thanks to all our contributors 🎆\n")
|
36
|
+
printf("Special thanks to: " + contributors.join(" ") + "\n")
|
37
|
+
printf("\nI'll merge this and release the gem once all tests pass.\n")
|
36
38
|
end
|
37
39
|
end
|
@@ -68,7 +68,7 @@ class TestMetricDescriptors < FogIntegrationTest
|
|
68
68
|
:labels => [label]
|
69
69
|
}
|
70
70
|
|
71
|
-
created = @client.create_metric_descriptor(options)
|
71
|
+
created = @client.create_metric_descriptor(**options)
|
72
72
|
|
73
73
|
# Check created metric descriptor
|
74
74
|
assert_equal(_full_name(metric_type), created.name)
|
@@ -86,9 +86,14 @@ class StorageShared < FogIntegrationTest
|
|
86
86
|
"hello world"
|
87
87
|
end
|
88
88
|
|
89
|
-
def
|
89
|
+
def binary_file_content
|
90
|
+
"PK\x03\x04\x14\x00\x00\x00\b\x00\x18\x89\x8AM\xE7!\xB7\x1C\x1C\x15j\x00\xB4\xB9".force_encoding(Encoding::ASCII_8BIT)
|
91
|
+
end
|
92
|
+
|
93
|
+
def some_temp_file(content = temp_file_content)
|
90
94
|
@some_temp_file ||= Tempfile.new("fog-google-storage").tap do |t|
|
91
|
-
t.
|
95
|
+
t.binmode
|
96
|
+
t.write(content)
|
92
97
|
t.close
|
93
98
|
end
|
94
99
|
File.open(@some_temp_file.path, "r")
|