carrierwave-qiniu 1.1.6 → 1.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +0 -1
- data/Gemfile +3 -3
- data/Gemfile.lock +194 -0
- data/README.md +4 -5
- data/_config.yml +1 -1
- data/carrierwave-qiniu.gemspec +1 -1
- data/lib/carrierwave-qiniu/version.rb +1 -1
- data/spec/upload_spec.rb +18 -18
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c28afe90d4591dd7736101b5786c4116f4fd5c6f6ead62d5158b08fcf2383fd1
|
4
|
+
data.tar.gz: f5d85a46d048ebaa638f1dce6b41712cebf9de22bbe6a2d254dcfac009940a90
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a09bf317e8d01b3ab5eb203b659243154fbcf39fc75acc6ba4c9b1d9628ff1f6eaf67cd491af096e0b90e917c5f2c8922a3e089e6631f6f46fee97c330a841a9
|
7
|
+
data.tar.gz: cdb4a8714098091c8863e5571cdfdce5f1f8789af27cc34a1f4826abe36455a8ef761a8d74ad2e99ba303e41f08ff0d52998789b57bdaeb0d95e9e26f68a068a
|
data/.gitignore
CHANGED
data/Gemfile
CHANGED
@@ -5,11 +5,11 @@ source 'https://gems.ruby-china.com'
|
|
5
5
|
gemspec
|
6
6
|
|
7
7
|
group :test do
|
8
|
-
gem 'rails'
|
8
|
+
gem 'rails', '~> 6.0.0'
|
9
9
|
gem 'sqlite3'
|
10
|
-
gem 'carrierwave'
|
10
|
+
gem 'carrierwave', '~> 1.3', '>= 1.3.1'
|
11
11
|
gem 'mini_magick'
|
12
|
-
gem 'qiniu'
|
12
|
+
gem 'qiniu', '~> 6.9'
|
13
13
|
gem 'rspec'
|
14
14
|
gem 'mocha'
|
15
15
|
gem 'dotenv'
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,194 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
carrierwave-qiniu (1.1.7)
|
5
|
+
carrierwave (~> 1.0)
|
6
|
+
qiniu (~> 6.9, >= 6.9.0)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://gems.ruby-china.com/
|
10
|
+
specs:
|
11
|
+
actioncable (6.0.0)
|
12
|
+
actionpack (= 6.0.0)
|
13
|
+
nio4r (~> 2.0)
|
14
|
+
websocket-driver (>= 0.6.1)
|
15
|
+
actionmailbox (6.0.0)
|
16
|
+
actionpack (= 6.0.0)
|
17
|
+
activejob (= 6.0.0)
|
18
|
+
activerecord (= 6.0.0)
|
19
|
+
activestorage (= 6.0.0)
|
20
|
+
activesupport (= 6.0.0)
|
21
|
+
mail (>= 2.7.1)
|
22
|
+
actionmailer (6.0.0)
|
23
|
+
actionpack (= 6.0.0)
|
24
|
+
actionview (= 6.0.0)
|
25
|
+
activejob (= 6.0.0)
|
26
|
+
mail (~> 2.5, >= 2.5.4)
|
27
|
+
rails-dom-testing (~> 2.0)
|
28
|
+
actionpack (6.0.0)
|
29
|
+
actionview (= 6.0.0)
|
30
|
+
activesupport (= 6.0.0)
|
31
|
+
rack (~> 2.0)
|
32
|
+
rack-test (>= 0.6.3)
|
33
|
+
rails-dom-testing (~> 2.0)
|
34
|
+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
35
|
+
actiontext (6.0.0)
|
36
|
+
actionpack (= 6.0.0)
|
37
|
+
activerecord (= 6.0.0)
|
38
|
+
activestorage (= 6.0.0)
|
39
|
+
activesupport (= 6.0.0)
|
40
|
+
nokogiri (>= 1.8.5)
|
41
|
+
actionview (6.0.0)
|
42
|
+
activesupport (= 6.0.0)
|
43
|
+
builder (~> 3.1)
|
44
|
+
erubi (~> 1.4)
|
45
|
+
rails-dom-testing (~> 2.0)
|
46
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
47
|
+
activejob (6.0.0)
|
48
|
+
activesupport (= 6.0.0)
|
49
|
+
globalid (>= 0.3.6)
|
50
|
+
activemodel (6.0.0)
|
51
|
+
activesupport (= 6.0.0)
|
52
|
+
activerecord (6.0.0)
|
53
|
+
activemodel (= 6.0.0)
|
54
|
+
activesupport (= 6.0.0)
|
55
|
+
activestorage (6.0.0)
|
56
|
+
actionpack (= 6.0.0)
|
57
|
+
activejob (= 6.0.0)
|
58
|
+
activerecord (= 6.0.0)
|
59
|
+
marcel (~> 0.3.1)
|
60
|
+
activesupport (6.0.0)
|
61
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
62
|
+
i18n (>= 0.7, < 2)
|
63
|
+
minitest (~> 5.1)
|
64
|
+
tzinfo (~> 1.1)
|
65
|
+
zeitwerk (~> 2.1, >= 2.1.8)
|
66
|
+
builder (3.2.3)
|
67
|
+
carrierwave (1.3.1)
|
68
|
+
activemodel (>= 4.0.0)
|
69
|
+
activesupport (>= 4.0.0)
|
70
|
+
mime-types (>= 1.16)
|
71
|
+
concurrent-ruby (1.1.5)
|
72
|
+
crass (1.0.4)
|
73
|
+
diff-lcs (1.3)
|
74
|
+
domain_name (0.5.20190701)
|
75
|
+
unf (>= 0.0.5, < 1.0.0)
|
76
|
+
dotenv (2.7.5)
|
77
|
+
erubi (1.8.0)
|
78
|
+
globalid (0.4.2)
|
79
|
+
activesupport (>= 4.2.0)
|
80
|
+
http-accept (1.7.0)
|
81
|
+
http-cookie (1.0.3)
|
82
|
+
domain_name (~> 0.5)
|
83
|
+
i18n (1.6.0)
|
84
|
+
concurrent-ruby (~> 1.0)
|
85
|
+
loofah (2.2.3)
|
86
|
+
crass (~> 1.0.2)
|
87
|
+
nokogiri (>= 1.5.9)
|
88
|
+
mail (2.7.1)
|
89
|
+
mini_mime (>= 0.1.1)
|
90
|
+
marcel (0.3.3)
|
91
|
+
mimemagic (~> 0.3.2)
|
92
|
+
metaclass (0.0.4)
|
93
|
+
method_source (0.9.2)
|
94
|
+
mime-types (3.3)
|
95
|
+
mime-types-data (~> 3.2015)
|
96
|
+
mime-types-data (3.2019.0904)
|
97
|
+
mimemagic (0.3.3)
|
98
|
+
mini_magick (4.9.5)
|
99
|
+
mini_mime (1.0.2)
|
100
|
+
mini_portile2 (2.4.0)
|
101
|
+
minitest (5.11.3)
|
102
|
+
mocha (1.9.0)
|
103
|
+
metaclass (~> 0.0.1)
|
104
|
+
netrc (0.11.0)
|
105
|
+
nio4r (2.5.1)
|
106
|
+
nokogiri (1.10.4)
|
107
|
+
mini_portile2 (~> 2.4.0)
|
108
|
+
qiniu (6.9.0)
|
109
|
+
mime-types (~> 3.1)
|
110
|
+
rest-client (~> 2.0)
|
111
|
+
rack (2.0.7)
|
112
|
+
rack-test (1.1.0)
|
113
|
+
rack (>= 1.0, < 3)
|
114
|
+
rails (6.0.0)
|
115
|
+
actioncable (= 6.0.0)
|
116
|
+
actionmailbox (= 6.0.0)
|
117
|
+
actionmailer (= 6.0.0)
|
118
|
+
actionpack (= 6.0.0)
|
119
|
+
actiontext (= 6.0.0)
|
120
|
+
actionview (= 6.0.0)
|
121
|
+
activejob (= 6.0.0)
|
122
|
+
activemodel (= 6.0.0)
|
123
|
+
activerecord (= 6.0.0)
|
124
|
+
activestorage (= 6.0.0)
|
125
|
+
activesupport (= 6.0.0)
|
126
|
+
bundler (>= 1.3.0)
|
127
|
+
railties (= 6.0.0)
|
128
|
+
sprockets-rails (>= 2.0.0)
|
129
|
+
rails-dom-testing (2.0.3)
|
130
|
+
activesupport (>= 4.2.0)
|
131
|
+
nokogiri (>= 1.6)
|
132
|
+
rails-html-sanitizer (1.2.0)
|
133
|
+
loofah (~> 2.2, >= 2.2.2)
|
134
|
+
railties (6.0.0)
|
135
|
+
actionpack (= 6.0.0)
|
136
|
+
activesupport (= 6.0.0)
|
137
|
+
method_source
|
138
|
+
rake (>= 0.8.7)
|
139
|
+
thor (>= 0.20.3, < 2.0)
|
140
|
+
rake (12.3.3)
|
141
|
+
rest-client (2.1.0)
|
142
|
+
http-accept (>= 1.7.0, < 2.0)
|
143
|
+
http-cookie (>= 1.0.2, < 2.0)
|
144
|
+
mime-types (>= 1.16, < 4.0)
|
145
|
+
netrc (~> 0.8)
|
146
|
+
rspec (3.8.0)
|
147
|
+
rspec-core (~> 3.8.0)
|
148
|
+
rspec-expectations (~> 3.8.0)
|
149
|
+
rspec-mocks (~> 3.8.0)
|
150
|
+
rspec-core (3.8.2)
|
151
|
+
rspec-support (~> 3.8.0)
|
152
|
+
rspec-expectations (3.8.4)
|
153
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
154
|
+
rspec-support (~> 3.8.0)
|
155
|
+
rspec-mocks (3.8.1)
|
156
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
157
|
+
rspec-support (~> 3.8.0)
|
158
|
+
rspec-support (3.8.2)
|
159
|
+
sprockets (3.7.2)
|
160
|
+
concurrent-ruby (~> 1.0)
|
161
|
+
rack (> 1, < 3)
|
162
|
+
sprockets-rails (3.2.1)
|
163
|
+
actionpack (>= 4.0)
|
164
|
+
activesupport (>= 4.0)
|
165
|
+
sprockets (>= 3.0.0)
|
166
|
+
sqlite3 (1.4.1)
|
167
|
+
thor (0.20.3)
|
168
|
+
thread_safe (0.3.6)
|
169
|
+
tzinfo (1.2.5)
|
170
|
+
thread_safe (~> 0.1)
|
171
|
+
unf (0.1.4)
|
172
|
+
unf_ext
|
173
|
+
unf_ext (0.0.7.6)
|
174
|
+
websocket-driver (0.7.1)
|
175
|
+
websocket-extensions (>= 0.1.0)
|
176
|
+
websocket-extensions (0.1.4)
|
177
|
+
zeitwerk (2.1.10)
|
178
|
+
|
179
|
+
PLATFORMS
|
180
|
+
ruby
|
181
|
+
|
182
|
+
DEPENDENCIES
|
183
|
+
carrierwave (~> 1.3, >= 1.3.1)
|
184
|
+
carrierwave-qiniu!
|
185
|
+
dotenv
|
186
|
+
mini_magick
|
187
|
+
mocha
|
188
|
+
qiniu (~> 6.9)
|
189
|
+
rails (~> 6.0.0)
|
190
|
+
rspec
|
191
|
+
sqlite3
|
192
|
+
|
193
|
+
BUNDLED WITH
|
194
|
+
1.17.3
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Carrierwave::Qiniu
|
2
2
|
|
3
|
-
[![Gem Version](https://badge.fury.io/rb/carrierwave-qiniu@2x.png?1.1.
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/carrierwave-qiniu@2x.png?1.1.7)](http://badge.fury.io/rb/carrierwave-qiniu)
|
4
4
|
|
5
5
|
This gem adds storage support for [Qiniu](http://qiniutek.com) to [Carrierwave](https://github.com/jnicklas/carrierwave)
|
6
6
|
|
@@ -10,9 +10,8 @@ example: https://github.com/huobazi/carrierwave-qiniu-example
|
|
10
10
|
|
11
11
|
Add the following to your application's Gemfile:
|
12
12
|
|
13
|
-
gem 'carrierwave-qiniu', '~> 1.1.
|
14
|
-
# If you need to use locales other than English
|
15
|
-
gem 'carrierwave-i18n'
|
13
|
+
gem 'carrierwave-qiniu', '~> 1.1.7'
|
14
|
+
gem 'carrierwave-i18n' # If you need to use locales other than English
|
16
15
|
|
17
16
|
And then execute:
|
18
17
|
|
@@ -20,7 +19,7 @@ And then execute:
|
|
20
19
|
|
21
20
|
Or install it yourself as:
|
22
21
|
|
23
|
-
$ gem install carrierwave-qiniu -v 1.1.
|
22
|
+
$ gem install carrierwave-qiniu -v 1.1.7
|
24
23
|
|
25
24
|
## Usage
|
26
25
|
|
data/_config.yml
CHANGED
@@ -1 +1 @@
|
|
1
|
-
theme: jekyll-theme-
|
1
|
+
theme: jekyll-theme-hacker
|
data/carrierwave-qiniu.gemspec
CHANGED
data/spec/upload_spec.rb
CHANGED
@@ -20,14 +20,14 @@ describe "CarrierWave Qiniu" do
|
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
|
-
require 'carrierwave/processing/mini_magick'
|
23
|
+
require 'carrierwave/processing/mini_magick'
|
24
24
|
class PhotoUploader < CarrierWave::Uploader::Base
|
25
25
|
include CarrierWave::MiniMagick
|
26
26
|
|
27
27
|
self.qiniu_can_overwrite = true
|
28
28
|
|
29
29
|
version :thumb do
|
30
|
-
|
30
|
+
process :resize_to_fill => [200, 200]
|
31
31
|
end
|
32
32
|
|
33
33
|
def store_dir
|
@@ -85,10 +85,6 @@ require 'carrierwave/processing/mini_magick'
|
|
85
85
|
|
86
86
|
f = load_file("mm.jpg")
|
87
87
|
photo = WrongPhoto.new(:image => f)
|
88
|
-
# FIXME: also raise error, see: CarrierWave::Qiniu#store L54
|
89
|
-
photo.save
|
90
|
-
expect(photo).to_not be_valid
|
91
|
-
|
92
88
|
expect {
|
93
89
|
photo.save!
|
94
90
|
}.to raise_error
|
@@ -136,21 +132,25 @@ require 'carrierwave/processing/mini_magick'
|
|
136
132
|
open(photo2.image.url).should_not be_nil
|
137
133
|
end
|
138
134
|
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
135
|
+
describe 'after remove' do
|
136
|
+
before(:each) do
|
137
|
+
f = load_file("mm.jpg")
|
138
|
+
@photo = Photo.new(image: f)
|
139
|
+
@photo.save
|
140
|
+
@photo.image.remove!
|
141
|
+
end
|
143
142
|
|
144
|
-
|
145
|
-
|
143
|
+
it 'will be not cached' do
|
144
|
+
expect(@photo.image).not_to be_cached
|
145
|
+
end
|
146
146
|
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
photo.save
|
151
|
-
photo.image.remove!
|
147
|
+
it 'file will be nil' do
|
148
|
+
expect(@photo.image.file).to be_nil
|
149
|
+
end
|
152
150
|
|
153
|
-
|
151
|
+
it 'url will be nill' do
|
152
|
+
expect(@photo.image.url).to be_nil
|
153
|
+
end
|
154
154
|
end
|
155
155
|
end
|
156
156
|
|
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.7
|
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-09-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: carrierwave
|
@@ -30,20 +30,20 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 6.
|
33
|
+
version: 6.9.0
|
34
34
|
- - "~>"
|
35
35
|
- !ruby/object:Gem::Version
|
36
|
-
version: '6.
|
36
|
+
version: '6.9'
|
37
37
|
type: :runtime
|
38
38
|
prerelease: false
|
39
39
|
version_requirements: !ruby/object:Gem::Requirement
|
40
40
|
requirements:
|
41
41
|
- - ">="
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
version: 6.
|
43
|
+
version: 6.9.0
|
44
44
|
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: '6.
|
46
|
+
version: '6.9'
|
47
47
|
description: Qiniu Storage support for CarrierWave
|
48
48
|
email:
|
49
49
|
- huobazi@gmail.com
|
@@ -55,6 +55,7 @@ files:
|
|
55
55
|
- ".rspec"
|
56
56
|
- CHANGELOG.md
|
57
57
|
- Gemfile
|
58
|
+
- Gemfile.lock
|
58
59
|
- LICENSE
|
59
60
|
- README.md
|
60
61
|
- Rakefile
|
@@ -91,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
91
92
|
- !ruby/object:Gem::Version
|
92
93
|
version: '0'
|
93
94
|
requirements: []
|
94
|
-
rubygems_version: 3.0.
|
95
|
+
rubygems_version: 3.0.3
|
95
96
|
signing_key:
|
96
97
|
specification_version: 4
|
97
98
|
summary: Qiniu Storage support for CarrierWave
|