activestorage-openstack 0.4.1 → 0.5.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 02fce9a3d10d94819312729de194056aa869f0e444b46b795961653c8d94e79c
|
4
|
+
data.tar.gz: c9bb4f57f92cb8566ce975810bbe18780e5aa357e1bd99647dd9cd5fe34f257f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d092fc6ec2f872a2d2c134821b85866c897c294c4083402b0e7aba113472e49dccd7d290aa4460660bbb8771409474d28e67338b324e875048e9b8bfd6b14b6e
|
7
|
+
data.tar.gz: 76a30316abea049e86df2ca3b7f471a4fd1afb23961cb1a10bc9c7b28fe9ea00b5edf1a4147c7ced6f3875f0c9f33c8893cf58bcaf5b86b88700caf883b0908e
|
@@ -7,7 +7,7 @@ module ActiveStorage
|
|
7
7
|
def initialize(container:, credentials:, connection_options: {})
|
8
8
|
settings = credentials.reverse_merge(connection_options: connection_options)
|
9
9
|
|
10
|
-
@client = Fog::Storage
|
10
|
+
@client = Fog::OpenStack::Storage.new(settings)
|
11
11
|
@container = Fog::OpenStack.escape(container)
|
12
12
|
end
|
13
13
|
|
@@ -50,9 +50,11 @@ module ActiveStorage
|
|
50
50
|
|
51
51
|
def delete(key)
|
52
52
|
instrument :delete, key: key do
|
53
|
-
|
54
|
-
|
55
|
-
|
53
|
+
begin
|
54
|
+
client.delete_object(container, key)
|
55
|
+
rescue Fog::OpenStack::Storage::NotFound
|
56
|
+
false
|
57
|
+
end
|
56
58
|
end
|
57
59
|
end
|
58
60
|
|
@@ -68,10 +70,12 @@ module ActiveStorage
|
|
68
70
|
|
69
71
|
def exist?(key)
|
70
72
|
instrument :exist, key: key do |payload|
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
73
|
+
begin
|
74
|
+
answer = object_for(key)
|
75
|
+
payload[:exist] = answer.present?
|
76
|
+
rescue Fog::OpenStack::Storage::NotFound
|
77
|
+
payload[:exist] = false
|
78
|
+
end
|
75
79
|
end
|
76
80
|
end
|
77
81
|
|
@@ -118,7 +122,7 @@ module ActiveStorage
|
|
118
122
|
key,
|
119
123
|
'Content-Type' => content_type)
|
120
124
|
true
|
121
|
-
rescue Fog::Storage::
|
125
|
+
rescue Fog::OpenStack::Storage::NotFound
|
122
126
|
false
|
123
127
|
end
|
124
128
|
|
@@ -131,7 +135,7 @@ module ActiveStorage
|
|
131
135
|
# ActiveStorage sends a `Digest::MD5.base64digest` checksum
|
132
136
|
# OpenStack expects a `Digest::MD5.hexdigest` ETag
|
133
137
|
def convert_base64digest_to_hexdigest(base64digest)
|
134
|
-
base64digest
|
138
|
+
base64digest.unpack('m0').first.unpack('H*').first
|
135
139
|
end
|
136
140
|
|
137
141
|
def unix_timestamp_expires_at(seconds_from_now)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activestorage-openstack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chedli Bourguiba
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-09-
|
11
|
+
date: 2018-09-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fog-openstack
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: '0.3'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: '0.3'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: marcel
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -135,12 +135,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
135
135
|
requirements:
|
136
136
|
- - ">="
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version:
|
138
|
+
version: 2.2.2
|
139
139
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
140
140
|
requirements:
|
141
141
|
- - ">="
|
142
142
|
- !ruby/object:Gem::Version
|
143
|
-
version:
|
143
|
+
version: 1.8.11
|
144
144
|
requirements: []
|
145
145
|
rubyforge_project:
|
146
146
|
rubygems_version: 2.7.6
|