paperclip-backblaze 0.2.5 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/paperclip/storage/backblaze.rb +6 -2
- data/paperclip-backblaze.gemspec +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: 861d89314c8715f439e5d3f0e4abd7417c39ad27b2e0c6c29059ec3d4676684b
|
4
|
+
data.tar.gz: 2a17a326fef75b150e827726559de91b9bc4ac34b69afe0217ac082faed80251
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c039e1398819bda333c1a1ad5ff0075e26df3dbfefa3b5ed74553d5c75a468eed3a28f0e24cdb95e57a31f335abecf54ff4cd1b767649e3e837b2045d4061377
|
7
|
+
data.tar.gz: 6db3b9d7a77d07b4b99737ceb776565272dcadac8a2f5f95260e24b63cb5c2d4c24e6c0b6dcb23761ea05389171fe3367ff88c663ec1958018e357a3e8b1afbb
|
@@ -42,7 +42,6 @@ module Paperclip
|
|
42
42
|
def self.extended(base)
|
43
43
|
base.instance_eval do
|
44
44
|
@b2_buckets = {}
|
45
|
-
login
|
46
45
|
unless @options[:url] =~ /\Ab2.*url\z/
|
47
46
|
@options[:url] = ':b2_path_url'.freeze
|
48
47
|
end
|
@@ -50,11 +49,15 @@ module Paperclip
|
|
50
49
|
|
51
50
|
unless Paperclip::Interpolations.respond_to? :b2_path_url
|
52
51
|
Paperclip.interpolates(:b2_path_url) do |attachment, style|
|
53
|
-
"#{::Backblaze::B2.download_url}/file/#{attachment.b2_bucket_name}/#{attachment.path(style).sub(%r{\A/}, '')}"
|
52
|
+
"#{attachment.cdn || ::Backblaze::B2.download_url}/file/#{attachment.b2_bucket_name}/#{attachment.path(style).sub(%r{\A/}, '')}"
|
54
53
|
end
|
55
54
|
end
|
56
55
|
end
|
57
56
|
|
57
|
+
def cdn
|
58
|
+
@options[:cdn]
|
59
|
+
end
|
60
|
+
|
58
61
|
# Reads b2_credentials from the config file
|
59
62
|
# must be a hash
|
60
63
|
# {
|
@@ -86,6 +89,7 @@ module Paperclip
|
|
86
89
|
|
87
90
|
# Return the specified bucket name as a String.
|
88
91
|
def b2_bucket_name
|
92
|
+
login
|
89
93
|
@bucket_name ||= @options[:bucket] || b2_credentials.fetch(:bucket)
|
90
94
|
end
|
91
95
|
|
data/paperclip-backblaze.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: paperclip-backblaze
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Tsui
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2022-
|
12
|
+
date: 2022-12-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|