fog-google 1.27.0 → 1.28.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 324898488d484b7d2bf5e875ebe152c545607044090f4786941f8106754b4433
4
- data.tar.gz: ae49e89d5e42127efde49e52340e751e1c075f100fe19b03e5bc3c88399a2e99
3
+ metadata.gz: 95b0e848747f0ed4dd7665ba1523d660f267c7ede2810bfbe30190b53114c3ad
4
+ data.tar.gz: 90dfb38e1c8aea6c4b1de0d1aa51d1c99d1f6e815fdf09dd5a1b038ff03285aa
5
5
  SHA512:
6
- metadata.gz: 56f151cbc7b3b170b90537b26410517f29c769ca6168fbc16bdd9937e89bfc44c315da223cf7dfae916775626c985b67db07c9e15aacfcb8e6a69d8f082a23b3
7
- data.tar.gz: 3a44a91f409c99d4caa368bc6d8f30e131f6cb566e66926b9bec27a9a25aa4b453b2bb27a5526f1420553a06caa569520712962fd8011d842f82bc2ab1926201
6
+ metadata.gz: 70382c3cace88299b0680f2af237772be7f52b2635ef2393af6bff26efe2c1bf5fe70d9b47a1e090e497982115908acf8de83ff517ced7e008993f305461dbb9
7
+ data.tar.gz: cdb4dfda4e275c2b693a5b370cdb2b4d1171ee0217c90832e243111a56106ff7300856eee404aba46c2047c278600e2a3cc5f6c5b2f80f0a4f0fce5ae5960de6
@@ -36,7 +36,7 @@ jobs:
36
36
  runs-on: fog-arc-runner
37
37
  strategy:
38
38
  matrix:
39
- ruby-version: [ '3.0', '3.1', '3.2', '3.3', '3.4' ]
39
+ ruby-version: [ '3.1', '3.2', '3.3', '3.4', '4.0' ]
40
40
  # Integration tests from the same task cannot run in parallel yet due to cleanup
41
41
  # TODO(fog-google#626): remove this once cleanup is fixed
42
42
  max-parallel: 1
@@ -37,7 +37,7 @@ jobs:
37
37
  runs-on: fog-arc-runner
38
38
  strategy:
39
39
  matrix:
40
- ruby-version: [ '3.0', '3.1', '3.2', '3.3', '3.4' ]
40
+ ruby-version: [ '3.1', '3.2', '3.3', '3.4', '4.0' ]
41
41
  # Integration tests from the same task cannot run in parallel yet due to cleanup
42
42
  max-parallel: 1
43
43
 
@@ -37,7 +37,7 @@ jobs:
37
37
  runs-on: fog-arc-runner
38
38
  strategy:
39
39
  matrix:
40
- ruby-version: [ '3.0', '3.1', '3.2', '3.3', '3.4' ]
40
+ ruby-version: [ '3.1', '3.2', '3.3', '3.4', '4.0' ]
41
41
  # Integration tests from the same task cannot run in parallel yet due to cleanup
42
42
  max-parallel: 1
43
43
 
@@ -36,7 +36,7 @@ jobs:
36
36
  runs-on: fog-arc-runner
37
37
  strategy:
38
38
  matrix:
39
- ruby-version: [ '3.0', '3.1', '3.2', '3.3', '3.4' ]
39
+ ruby-version: [ '3.1', '3.2', '3.3', '3.4', '4.0' ]
40
40
  # Integration tests from the same task cannot run in parallel yet due to cleanup
41
41
  max-parallel: 1
42
42
 
@@ -37,7 +37,7 @@ jobs:
37
37
  runs-on: fog-arc-runner
38
38
  strategy:
39
39
  matrix:
40
- ruby-version: [ '3.0', '3.1', '3.2', '3.3', '3.4' ]
40
+ ruby-version: [ '3.1', '3.2', '3.3', '3.4', '4.0' ]
41
41
  # Integration tests from the same task cannot run in parallel yet due to cleanup
42
42
  max-parallel: 1
43
43
 
@@ -37,7 +37,7 @@ jobs:
37
37
  runs-on: fog-arc-runner
38
38
  strategy:
39
39
  matrix:
40
- ruby-version: [ '3.0', '3.1', '3.2', '3.3', '3.4' ]
40
+ ruby-version: [ '3.1', '3.2', '3.3', '3.4', '4.0' ]
41
41
  # Integration tests from the same task cannot run in parallel yet due to cleanup
42
42
  max-parallel: 1
43
43
 
@@ -37,7 +37,7 @@ jobs:
37
37
  runs-on: fog-arc-runner
38
38
  strategy:
39
39
  matrix:
40
- ruby-version: [ '3.0', '3.1', '3.2', '3.3', '3.4' ]
40
+ ruby-version: [ '3.1', '3.2', '3.3', '3.4', '4.0' ]
41
41
  # Integration tests from the same task cannot run in parallel yet due to cleanup
42
42
  max-parallel: 1
43
43
 
@@ -38,7 +38,7 @@ jobs:
38
38
  runs-on: fog-arc-runner
39
39
  strategy:
40
40
  matrix:
41
- ruby-version: [ '3.0', '3.1', '3.2', '3.3', '3.4' ]
41
+ ruby-version: [ '3.1', '3.2', '3.3', '3.4', '4.0' ]
42
42
  # Integration tests from the same task cannot run in parallel yet due to cleanup
43
43
  max-parallel: 1
44
44
 
@@ -16,7 +16,7 @@ jobs:
16
16
  runs-on: ubuntu-latest
17
17
  strategy:
18
18
  matrix:
19
- ruby-version: [ '3.0', '3.1', '3.2', '3.3', '3.4', 'head', 'truffleruby-head']
19
+ ruby-version: [ '3.1', '3.2', '3.3', '3.4', '4.0', 'head', 'truffleruby-head']
20
20
 
21
21
  steps:
22
22
  - uses: actions/checkout@v6
data/CHANGELOG.md CHANGED
@@ -8,6 +8,16 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html
8
8
 
9
9
  ### User-facing
10
10
 
11
+ - #650 add support for custom storage endpoints
12
+
13
+ ### Fixed
14
+
15
+ ### Development changes
16
+
17
+ ## 1.27.0
18
+
19
+ ### User-facing
20
+
11
21
  ### Fixed
12
22
 
13
23
  - #648 raise exception if disk quota exceeded [rchekaluk]
data/fog-google.gemspec CHANGED
@@ -44,6 +44,7 @@ Gem::Specification.new do |spec|
44
44
  spec.add_development_dependency "retriable"
45
45
  spec.add_development_dependency "rake"
46
46
  spec.add_development_dependency "minitest"
47
+ spec.add_development_dependency "minitest-mock"
47
48
  spec.add_development_dependency "minitest-reporters"
48
49
  spec.add_development_dependency "shindo"
49
50
  spec.add_development_dependency "vcr"
@@ -9,6 +9,7 @@ module Fog
9
9
 
10
10
  def initialize(options = {})
11
11
  shared_initialize(options[:google_project], GOOGLE_STORAGE_JSON_API_VERSION, GOOGLE_STORAGE_JSON_BASE_URL)
12
+ @options = options.dup
12
13
  @client = MockClient.new('test')
13
14
  @storage_json = MockClient.new('test')
14
15
  @iam_service = MockClient.new('test')
@@ -18,6 +19,14 @@ module Fog
18
19
  "foo"
19
20
  end
20
21
 
22
+ def bucket_base_url
23
+ if @options[:google_json_root_url]
24
+ @options[:google_json_root_url]
25
+ else
26
+ GOOGLE_STORAGE_BUCKET_BASE_URL
27
+ end
28
+ end
29
+
21
30
  def google_access_id
22
31
  "my-account@project.iam.gserviceaccount"
23
32
  end
@@ -47,7 +47,7 @@ module Fog
47
47
 
48
48
  def public_url
49
49
  requires :key
50
- "#{GOOGLE_STORAGE_BUCKET_BASE_URL}#{key}"
50
+ "#{service.bucket_base_url}#{key}"
51
51
  end
52
52
 
53
53
  def save
@@ -97,7 +97,7 @@ module Fog
97
97
 
98
98
  def public_url
99
99
  requires :directory, :key
100
- "https://storage.googleapis.com/#{directory.key}/#{key}"
100
+ "#{service.bucket_base_url}#{directory.key}/#{key}"
101
101
  end
102
102
 
103
103
  FILE_INSERTABLE_FIELDS = %i(
@@ -11,15 +11,16 @@ module Fog
11
11
  attr_reader :storage_json
12
12
 
13
13
  def initialize(options = {})
14
- shared_initialize(options[:google_project], GOOGLE_STORAGE_JSON_API_VERSION, GOOGLE_STORAGE_JSON_BASE_URL)
14
+ base_url = options[:google_json_root_url] || GOOGLE_STORAGE_JSON_BASE_URL
15
+ shared_initialize(options[:google_project], GOOGLE_STORAGE_JSON_API_VERSION, base_url)
15
16
  @options = options.dup
16
17
  options[:google_api_scope_url] = GOOGLE_STORAGE_JSON_API_SCOPE_URLS.join(" ")
17
- @host = options[:host] || "storage.googleapis.com"
18
18
 
19
19
  # TODO(temikus): Do we even need this client?
20
20
  @client = initialize_google_client(options)
21
21
 
22
22
  @storage_json = ::Google::Apis::StorageV1::StorageService.new
23
+ @storage_json.root_url = base_url if options[:google_json_root_url]
23
24
  apply_client_options(@storage_json, options)
24
25
 
25
26
  @storage_json.client_options.open_timeout_sec = options[:open_timeout_sec] if options[:open_timeout_sec]
@@ -27,6 +28,14 @@ module Fog
27
28
  @storage_json.client_options.send_timeout_sec = options[:send_timeout_sec] if options[:send_timeout_sec]
28
29
  end
29
30
 
31
+ def bucket_base_url
32
+ if @options[:google_json_root_url]
33
+ @options[:google_json_root_url]
34
+ else
35
+ GOOGLE_STORAGE_BUCKET_BASE_URL
36
+ end
37
+ end
38
+
30
39
  def signature(params)
31
40
  string_to_sign = <<-DATA
32
41
  #{params[:method]}
@@ -17,6 +17,7 @@ module Fog
17
17
  :google_key_string,
18
18
  :google_json_key_location,
19
19
  :google_json_key_string,
20
+ :google_json_root_url,
20
21
  :open_timeout_sec,
21
22
  :read_timeout_sec,
22
23
  :send_timeout_sec
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module Google
3
- VERSION = "1.27.0".freeze
3
+ VERSION = "1.28.0".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fog-google
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.27.0
4
+ version: 1.28.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nat Welch
@@ -246,6 +246,20 @@ dependencies:
246
246
  - - ">="
247
247
  - !ruby/object:Gem::Version
248
248
  version: '0'
249
+ - !ruby/object:Gem::Dependency
250
+ name: minitest-mock
251
+ requirement: !ruby/object:Gem::Requirement
252
+ requirements:
253
+ - - ">="
254
+ - !ruby/object:Gem::Version
255
+ version: '0'
256
+ type: :development
257
+ prerelease: false
258
+ version_requirements: !ruby/object:Gem::Requirement
259
+ requirements:
260
+ - - ">="
261
+ - !ruby/object:Gem::Version
262
+ version: '0'
249
263
  - !ruby/object:Gem::Dependency
250
264
  name: minitest-reporters
251
265
  requirement: !ruby/object:Gem::Requirement