bizside 2.1.9 → 2.1.10
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/lib/bizside/carrierwave.rb +60 -0
- data/lib/bizside/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: db766ed6fdf059cdaa9fd7325c855f84294c988f94559c39597658a674dc6c40
|
4
|
+
data.tar.gz: e26eaddb5f279e4d840baae4346d416e6f4467b102dea75a90d301c95a458649
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5635c741923a924331b20dfa0b027e6adfc220a371306f2792f51569e48da21250c6fd0f4dc0d29d7116215edb36e6bcf73a417c1b55d5d19ff6c5317e176c0b
|
7
|
+
data.tar.gz: 63c3ba3993e0c9da71c236e9e197be92096330323aa10352f5848478722df2cd5e3ff7f5d716bbc3753fe19bdef56de02ea195591d89ebf73d95e1cd79d33e04
|
data/lib/bizside/carrierwave.rb
CHANGED
@@ -47,6 +47,66 @@ CarrierWave.configure do |config|
|
|
47
47
|
config.fog_directory = Bizside.config.storage.fog.container
|
48
48
|
config.fog_public = false
|
49
49
|
config.storage = :fog
|
50
|
+
|
51
|
+
# Patch to not set ACLs to 'private' if fog_public is false.
|
52
|
+
# Requests to set/update ACLs fail if ACL is disabled.
|
53
|
+
# Setting 'private' to ACLs also fails when the bucket is not in the same account as IAM user/role.
|
54
|
+
# 'private' is applied by default so there's no need to set 'private' explicitly.
|
55
|
+
module CarrierWave
|
56
|
+
module Storage
|
57
|
+
class Fog
|
58
|
+
class File
|
59
|
+
def acl_header
|
60
|
+
if fog_provider == 'AWS'
|
61
|
+
@uploader.fog_public ? { 'x-amz-acl' => 'public-read' } : {}
|
62
|
+
elsif fog_provider == "Google"
|
63
|
+
@uploader.fog_public ? { destination_predefined_acl: "publicRead" } : {}
|
64
|
+
else
|
65
|
+
{}
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
require 'fog/aws/models/storage/directory'
|
74
|
+
|
75
|
+
module Fog
|
76
|
+
module AWS
|
77
|
+
class Storage
|
78
|
+
class Directory < Fog::Model
|
79
|
+
def public=(new_public)
|
80
|
+
if new_public
|
81
|
+
@acl = 'public-read'
|
82
|
+
else
|
83
|
+
@acl = nil
|
84
|
+
end
|
85
|
+
new_public
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
require 'fog/aws/models/storage/file'
|
93
|
+
|
94
|
+
module Fog
|
95
|
+
module AWS
|
96
|
+
class Storage
|
97
|
+
class File < Fog::Model
|
98
|
+
def public=(new_public)
|
99
|
+
if new_public
|
100
|
+
@acl = 'public-read'
|
101
|
+
else
|
102
|
+
@acl = nil
|
103
|
+
end
|
104
|
+
new_public
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|
50
110
|
end
|
51
111
|
|
52
112
|
end
|
data/lib/bizside/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bizside
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- bizside-developers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|