paperclip-gcs 0.3.1 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9401a2869fe785ab10d07de65a786849eb8f7954a799a14519e4177bea89a17b
4
- data.tar.gz: 2afb841d3f6238b775273349e4f949c0647d9657c4b6eeaf9c9bc975bd398172
3
+ metadata.gz: ee33bf47ab8e2d8d716a81763a80d29869ef387b96669620e65c4cafeec54f52
4
+ data.tar.gz: 8ede8d389042c86981fc9aea320595b05fbc294dd12f4b3ea48961f105214ab2
5
5
  SHA512:
6
- metadata.gz: 72c6e8472cabdc9ed99418bb63de24d1e55f2905eb90f3d71ef87e8aad51c6826b6f39141a08aa3068d2dd5a3c1cf0dce785301e9aadcb1819818469a11834f1
7
- data.tar.gz: 445cde3dcfef1ba45bc60ac13483b85276eeea01d136dd0f1339cd8f51cf6cb0708b538f68f2ac64e13c09409e8b4c08ea7640257ea11316f13a07dc23ef0182
6
+ metadata.gz: 2fe0e36d4b6735eeae579cde6deca1462f9477618d90599d174d6127871479fc573ebb4c5094f1225084877b03fc800fbddd71a3722f643dd492e142f732b8e2
7
+ data.tar.gz: d402cd94d689bc740e3b958777cfb9471e875500d09f7ec758c5d992114485b19076d2e8461e489b8f6a8aaf11021ddde150d46530ba6b171808df4c2a54da6b
@@ -1,5 +1,5 @@
1
1
  module Paperclip
2
2
  module Gcs
3
- VERSION = "0.3.1"
3
+ VERSION = "0.3.3"
4
4
  end
5
5
  end
@@ -1,3 +1,5 @@
1
+ require "google/cloud/storage"
2
+
1
3
  module Paperclip
2
4
  module Storage
3
5
  module Gcs
@@ -11,10 +13,11 @@ module Paperclip
11
13
  end
12
14
 
13
15
  def find(config)
14
- clients[config] ||= Google::Cloud.storage(
15
- config[:project],
16
- config[:keyfile],
17
- config.slice(:scope, :retries, :timeout)
16
+ clients[config] ||= Google::Cloud::Storage.new(
17
+ project_id: config[:project],
18
+ credentials: config[:keyfile],
19
+ endpoint: config[:gcs_host_name],
20
+ **config.slice(:scope, :retries, :timeout)
18
21
  )
19
22
  end
20
23
 
@@ -80,7 +80,7 @@ module Paperclip
80
80
  storage_class: gcs_storage_class(style),
81
81
  metadata: gcs_metadata(style),
82
82
  }
83
- gcs_bucket.upload_file(file.path, path(style), opts)
83
+ gcs_bucket.upload_file(file.path, path(style), **opts)
84
84
  end
85
85
  after_flush_writes
86
86
  @queued_for_write = {}
@@ -170,7 +170,9 @@ module Paperclip
170
170
 
171
171
  def gcs_client
172
172
  @_gcs_client ||= ClientRepository.find(gcs_credentials.slice(:project, :keyfile).merge(
173
- @gcs_options.slice(:scope, :retries, :timeout)))
173
+ @gcs_options.slice(:scope, :retries, :timeout)).merge(
174
+ @options.slice(:gcs_host_name)
175
+ ))
174
176
  end
175
177
 
176
178
  def gcs_bucket
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paperclip-gcs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daichi HIRATA
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-09-21 00:00:00.000000000 Z
11
+ date: 2024-11-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: kt-paperclip
@@ -78,7 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
78
78
  - !ruby/object:Gem::Version
79
79
  version: '0'
80
80
  requirements: []
81
- rubygems_version: 3.3.7
81
+ rubygems_version: 3.5.16
82
82
  signing_key:
83
83
  specification_version: 4
84
84
  summary: Extends Paperclip with Google Cloud Storage