google-cloud-storage 1.52.0 → 1.53.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/CHANGELOG.md +7 -0
- data/lib/google/cloud/storage/file.rb +44 -0
- data/lib/google/cloud/storage/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe3e1f688d9b54f38ed678c881b0ad6b53f80d9a3f8983b23f2ea42939bb8c1d
|
4
|
+
data.tar.gz: 937a4544aa1f3497c62ec42c6c040cdc54be7eec8f8eb0a6a48825fc5adcd5c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4fe5213423da8b342653278f41c9d00b45cfec9ed1e3d0bc451625390149e1f826ce7dff10e6d45bfddf80558f00a13814a0572193103c964d40b68217e44f2e
|
7
|
+
data.tar.gz: c7dcb018af799f2cbae6a3909377de03dca0127c642da171348c80be1f2870ee758c7d9f49d38035eded59b664713a7675aa775373793ea132bc220bdd47cbee
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
# Release History
|
2
2
|
|
3
|
+
### 1.53.0 (2024-12-04)
|
4
|
+
|
5
|
+
#### Features
|
6
|
+
|
7
|
+
* add integration test for universe domain ([#27384](https://github.com/googleapis/google-cloud-ruby/issues/27384))
|
8
|
+
* fetch file and bucket details from url ([#27322](https://github.com/googleapis/google-cloud-ruby/issues/27322))
|
9
|
+
|
3
10
|
### 1.52.0 (2024-05-31)
|
4
11
|
|
5
12
|
#### Features
|
@@ -2081,6 +2081,50 @@ module Google
|
|
2081
2081
|
Google::Apis::StorageV1::Object.new(**attr_params)
|
2082
2082
|
end
|
2083
2083
|
|
2084
|
+
##
|
2085
|
+
# from_gs_url is a method to fetch bucket details and file details from a gs url
|
2086
|
+
#
|
2087
|
+
# @return [Hash(String => String)]
|
2088
|
+
#
|
2089
|
+
# @example Fetch bucket_name and file_Path from gs url:
|
2090
|
+
# require "google/cloud/storage"
|
2091
|
+
# gs_url= "gs://my-todo-app/avatars/heidi.jpeg"
|
2092
|
+
# file=Google::Cloud::Storage::File
|
2093
|
+
# file.from_gs_url(gs_url)
|
2094
|
+
# =>
|
2095
|
+
# {"bucket_name"=>"my-todo-app", "file_path"=>"avatars/heidi.jpeg"}
|
2096
|
+
#
|
2097
|
+
# @example Fetch bucket_name , file_Path and other query params from gs url:
|
2098
|
+
# require "google/cloud/storage"
|
2099
|
+
# gs_url= "gs://my-todo-app/test_sub_folder/heidi.jpeg?params1=test1¶ms2=test2"
|
2100
|
+
# file=Google::Cloud::Storage::File
|
2101
|
+
# file.from_gs_url(gs_url)
|
2102
|
+
# =>{
|
2103
|
+
# "bucket_name"=>"my-todo-app",
|
2104
|
+
# "file_path"=>"test_sub_folder/heidi.jpeg",
|
2105
|
+
# "options" => {
|
2106
|
+
# "params1"=>"test1",
|
2107
|
+
# "params2"=>"test2"
|
2108
|
+
# }
|
2109
|
+
# }
|
2110
|
+
|
2111
|
+
def self.from_gs_url gs_url
|
2112
|
+
prefix = "gs://".freeze
|
2113
|
+
raise ArgumentError, "Invalid GCS URL" unless gs_url.start_with? prefix
|
2114
|
+
# seprating params from input url
|
2115
|
+
path, query = gs_url.sub(prefix, "").split("?", 2)
|
2116
|
+
# parsing the url
|
2117
|
+
bucket_name, file_path = path.split "/", 2
|
2118
|
+
query_params = URI.decode_www_form(query).to_h if query
|
2119
|
+
url_items = {
|
2120
|
+
"bucket_name" => bucket_name,
|
2121
|
+
"file_path" => file_path
|
2122
|
+
}
|
2123
|
+
# adding url params to output hash
|
2124
|
+
url_items.merge! "options" => query_params if query
|
2125
|
+
url_items
|
2126
|
+
end
|
2127
|
+
|
2084
2128
|
protected
|
2085
2129
|
|
2086
2130
|
##
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-storage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.53.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Moore
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-
|
12
|
+
date: 2024-12-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: google-cloud-core
|
@@ -340,7 +340,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
340
340
|
- !ruby/object:Gem::Version
|
341
341
|
version: '0'
|
342
342
|
requirements: []
|
343
|
-
rubygems_version: 3.5.
|
343
|
+
rubygems_version: 3.5.22
|
344
344
|
signing_key:
|
345
345
|
specification_version: 4
|
346
346
|
summary: API Client library for Google Cloud Storage
|