carrierwave-aliyun 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Changelogs.md +5 -1
- data/lib/carrierwave/aliyun/version.rb +1 -1
- data/lib/carrierwave/storage/aliyun.rb +28 -3
- metadata +13 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b7c6794e4b53be8b1781733433933bb0fcec534
|
4
|
+
data.tar.gz: cbec6afebb360c4085155ce1f93d96657306c075
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a51ac3e32565f55992a3ca2ff282c958c30da2be5739a27faf5aafe5e735cef28e54aa1384f9417dc40f8dfdfbf79e826d1a166d70a502c7838a224e9c0e49f3
|
7
|
+
data.tar.gz: 189874b6216fb7345d8799cb33284f9104d8a64d5444bae4ebee61d57e52c792daf9bbaece22a0fe5b218e7f776cabf73641c62d6435ceef21417c17dbf49457
|
data/Changelogs.md
CHANGED
@@ -52,10 +52,26 @@ module CarrierWave
|
|
52
52
|
"Host" => @aliyun_upload_host,
|
53
53
|
"Expect" => "100-Continue"
|
54
54
|
}
|
55
|
-
RestClient.put(URI.encode(url), file, headers)
|
55
|
+
RestClient.put(URI.encode(url).gsub("+", "%2B"), file, headers)
|
56
56
|
return path_to_url(path, :get => true)
|
57
57
|
end
|
58
58
|
|
59
|
+
|
60
|
+
=begin rdoc
|
61
|
+
读取文件
|
62
|
+
|
63
|
+
== 参数:
|
64
|
+
- path - remote 存储路径
|
65
|
+
|
66
|
+
== 返回值:
|
67
|
+
图片文件
|
68
|
+
=end
|
69
|
+
def get(path)
|
70
|
+
path = format_path(path)
|
71
|
+
url = path_to_url(path)
|
72
|
+
RestClient.get(URI.encode(url))
|
73
|
+
end
|
74
|
+
|
59
75
|
=begin rdoc
|
60
76
|
删除 Remote 的文件
|
61
77
|
|
@@ -75,7 +91,7 @@ module CarrierWave
|
|
75
91
|
"Authorization" => sign("DELETE", bucket_path, "", "" ,date)
|
76
92
|
}
|
77
93
|
url = path_to_url(path)
|
78
|
-
RestClient.delete(URI.encode(url), headers)
|
94
|
+
RestClient.delete(URI.encode(url).gsub("+", "%2B"), headers)
|
79
95
|
return path_to_url(path, :get => true)
|
80
96
|
end
|
81
97
|
|
@@ -145,7 +161,8 @@ module CarrierWave
|
|
145
161
|
#
|
146
162
|
def read
|
147
163
|
object = oss_connection.get(@path)
|
148
|
-
object.
|
164
|
+
@headers = object.headers
|
165
|
+
object.body
|
149
166
|
end
|
150
167
|
|
151
168
|
##
|
@@ -166,6 +183,14 @@ module CarrierWave
|
|
166
183
|
oss_connection.path_to_url(@path, :get => true)
|
167
184
|
end
|
168
185
|
|
186
|
+
def content_type
|
187
|
+
headers[:content_type]
|
188
|
+
end
|
189
|
+
|
190
|
+
def content_type=(new_content_type)
|
191
|
+
headers[:content_type] = new_content_type
|
192
|
+
end
|
193
|
+
|
169
194
|
def store(file, opts = {})
|
170
195
|
oss_connection.put(@path, file, opts)
|
171
196
|
end
|
metadata
CHANGED
@@ -1,41 +1,41 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: carrierwave-aliyun
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Lee
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-08-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: carrierwave
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 0.5.7
|
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
26
|
version: 0.5.7
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rest-client
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 1.6.7
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 1.6.7
|
41
41
|
description: Aliyun OSS support for Carrierwave
|
@@ -45,9 +45,9 @@ executables: []
|
|
45
45
|
extensions: []
|
46
46
|
extra_rdoc_files: []
|
47
47
|
files:
|
48
|
-
- .gitignore
|
49
|
-
- .rspec
|
50
|
-
- .travis.yml
|
48
|
+
- ".gitignore"
|
49
|
+
- ".rspec"
|
50
|
+
- ".travis.yml"
|
51
51
|
- Changelogs.md
|
52
52
|
- Gemfile
|
53
53
|
- README.md
|
@@ -72,17 +72,17 @@ require_paths:
|
|
72
72
|
- lib
|
73
73
|
required_ruby_version: !ruby/object:Gem::Requirement
|
74
74
|
requirements:
|
75
|
-
- -
|
75
|
+
- - ">="
|
76
76
|
- !ruby/object:Gem::Version
|
77
77
|
version: '0'
|
78
78
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
requirements: []
|
84
84
|
rubyforge_project:
|
85
|
-
rubygems_version: 2.
|
85
|
+
rubygems_version: 2.2.2
|
86
86
|
signing_key:
|
87
87
|
specification_version: 4
|
88
88
|
summary: Aliyun OSS support for Carrierwave
|
@@ -93,3 +93,4 @@ test_files:
|
|
93
93
|
- spec/foo.zip
|
94
94
|
- spec/spec_helper.rb
|
95
95
|
- spec/upload_spec.rb
|
96
|
+
has_rdoc:
|