carrierwave-qiniu 1.1.7 → 1.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/Gemfile.lock +1 -1
- data/_config.yml +1 -1
- data/lib/carrierwave-qiniu/version.rb +1 -1
- data/lib/carrierwave/storage/qiniu.rb +7 -1
- data/spec/upload_spec.rb +4 -4
- 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: 26e9ac6a7fc4b16de529b49ceda0a7e397e6cbffb5dee7dd5e22b8781a9e93e6
|
4
|
+
data.tar.gz: 445d456bfed1453e6daa4f0aae75bd540c67ccab359e7968c876c22fea74197a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a9df16d1a6b680815907f80b38f75b5fe199bcc72e0ce536bd58f91bf9d1429fdcc44146ce1ee53bd11ca3489f6f4156d60e0d365183b631609728dd042be63
|
7
|
+
data.tar.gz: 37c437d0f628abd9178ac1fb701a215ee7e4038a983be6e9990215aad010fa650c3dce9013e9ca482fccb990dc5c22aa3a8f429ca25acffd946430141321bf57
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/_config.yml
CHANGED
@@ -1 +1 @@
|
|
1
|
-
theme: jekyll-theme-
|
1
|
+
theme: jekyll-theme-architect
|
@@ -89,7 +89,7 @@ module CarrierWave
|
|
89
89
|
end
|
90
90
|
|
91
91
|
def download_url(path)
|
92
|
-
encode_path =
|
92
|
+
encode_path = path_escape(path)
|
93
93
|
primitive_url = "#{@qiniu_protocol}://#{@qiniu_bucket_domain}/#{encode_path}"
|
94
94
|
@qiniu_bucket_private ? \
|
95
95
|
::Qiniu::Auth.authorize_download_url(primitive_url, :expires_in => @qiniu_private_url_expires_in) \
|
@@ -119,6 +119,12 @@ module CarrierWave
|
|
119
119
|
|
120
120
|
end
|
121
121
|
|
122
|
+
#fix chinese file name, same as encodeURIComponent in js but preserve slash '/'
|
123
|
+
def path_escape(value)
|
124
|
+
#CGI.escape(value)#.gsub("%2F", "/")
|
125
|
+
::URI::DEFAULT_PARSER.escape value
|
126
|
+
end
|
127
|
+
|
122
128
|
end
|
123
129
|
|
124
130
|
class File
|
data/spec/upload_spec.rb
CHANGED
@@ -102,13 +102,13 @@ describe "CarrierWave Qiniu" do
|
|
102
102
|
puts 'The image was uploaded to:'
|
103
103
|
puts photo.image.url
|
104
104
|
|
105
|
-
open(photo.image.url).should_not be_nil
|
105
|
+
URI.open(photo.image.url).should_not be_nil
|
106
106
|
|
107
107
|
|
108
108
|
puts "The thumb image:"
|
109
109
|
puts photo.image.url(:thumb)
|
110
110
|
|
111
|
-
open(photo.image.thumb.url).should_not be_nil
|
111
|
+
URI.open(photo.image.thumb.url).should_not be_nil
|
112
112
|
|
113
113
|
end
|
114
114
|
|
@@ -129,7 +129,7 @@ describe "CarrierWave Qiniu" do
|
|
129
129
|
|
130
130
|
expect(photo2.image.url).not_to eq(photo.image.url)
|
131
131
|
|
132
|
-
open(photo2.image.url).should_not be_nil
|
132
|
+
URI.open(photo2.image.url).should_not be_nil
|
133
133
|
end
|
134
134
|
|
135
135
|
describe 'after remove' do
|
@@ -148,7 +148,7 @@ describe "CarrierWave Qiniu" do
|
|
148
148
|
expect(@photo.image.file).to be_nil
|
149
149
|
end
|
150
150
|
|
151
|
-
it 'url will be
|
151
|
+
it 'url will be nil' do
|
152
152
|
expect(@photo.image.url).to be_nil
|
153
153
|
end
|
154
154
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: carrierwave-qiniu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marble Wu
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-12-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: carrierwave
|