paperclip-aws 1.6.7 → 1.6.8
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 +7 -0
- data/Gemfile.lock +68 -37
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/lib/paperclip-aws.rb +8 -6
- data/paperclip-aws.gemspec +4 -6
- data/test/aws_storage_test.rb +9 -0
- metadata +17 -32
- data/test/fixtures/5k.png +0 -0
- data/test/fixtures/spaced file.png +0 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 9db8f66fe54a281f313100597d638d9efcfdde48
|
|
4
|
+
data.tar.gz: bc538a624cecaf537bd110e0a829c0a5c1c597f9
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: dc9137685e4e3a5711d29f49633e890d7ba49641bafd2f0685e8b97848389eb7cc8c77d7a37727be8369cf52662837120ff418d98719eb5da0ef55101e7e4034
|
|
7
|
+
data.tar.gz: 6bb08c519c95c3671e1f616d98617805bae2876d581fd31a2c1fd1c4e2ced2d991f2aaa93e6b7017b621c90eae99f6fd8f8767e6672a5f8395d2b61d82908cbd
|
data/Gemfile.lock
CHANGED
|
@@ -1,52 +1,83 @@
|
|
|
1
1
|
GEM
|
|
2
2
|
remote: http://rubygems.org/
|
|
3
3
|
specs:
|
|
4
|
-
activemodel (
|
|
5
|
-
activesupport (=
|
|
6
|
-
builder (~> 3.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
aws-sdk (1.3.4)
|
|
17
|
-
httparty (~> 0.7)
|
|
4
|
+
activemodel (4.0.2)
|
|
5
|
+
activesupport (= 4.0.2)
|
|
6
|
+
builder (~> 3.1.0)
|
|
7
|
+
activesupport (4.0.2)
|
|
8
|
+
i18n (~> 0.6, >= 0.6.4)
|
|
9
|
+
minitest (~> 4.2)
|
|
10
|
+
multi_json (~> 1.3)
|
|
11
|
+
thread_safe (~> 0.1)
|
|
12
|
+
tzinfo (~> 0.3.37)
|
|
13
|
+
addressable (2.3.5)
|
|
14
|
+
atomic (1.1.14)
|
|
15
|
+
aws-sdk (1.31.3)
|
|
18
16
|
json (~> 1.4)
|
|
19
17
|
nokogiri (>= 1.4.4)
|
|
20
18
|
uuidtools (~> 2.1)
|
|
21
|
-
builder (3.
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
19
|
+
builder (3.1.4)
|
|
20
|
+
climate_control (0.0.3)
|
|
21
|
+
activesupport (>= 3.0)
|
|
22
|
+
cocaine (0.5.3)
|
|
23
|
+
climate_control (>= 0.0.3, < 1.0)
|
|
24
|
+
faraday (0.8.8)
|
|
25
|
+
multipart-post (~> 1.2.0)
|
|
26
|
+
git (1.2.6)
|
|
27
|
+
github_api (0.10.1)
|
|
28
|
+
addressable
|
|
29
|
+
faraday (~> 0.8.1)
|
|
30
|
+
hashie (>= 1.2)
|
|
31
|
+
multi_json (~> 1.4)
|
|
32
|
+
nokogiri (~> 1.5.2)
|
|
33
|
+
oauth2
|
|
34
|
+
hashie (2.0.5)
|
|
35
|
+
highline (1.6.20)
|
|
36
|
+
httpauth (0.2.0)
|
|
37
|
+
i18n (0.6.9)
|
|
38
|
+
jeweler (1.8.8)
|
|
39
|
+
builder
|
|
29
40
|
bundler (~> 1.0)
|
|
30
41
|
git (>= 1.2.5)
|
|
42
|
+
github_api (= 0.10.1)
|
|
43
|
+
highline (>= 1.6.15)
|
|
44
|
+
nokogiri (= 1.5.10)
|
|
31
45
|
rake
|
|
32
|
-
|
|
46
|
+
rdoc
|
|
47
|
+
json (1.8.1)
|
|
48
|
+
jwt (0.1.8)
|
|
49
|
+
multi_json (>= 1.5)
|
|
33
50
|
metaclass (0.0.1)
|
|
34
|
-
mime-types (
|
|
35
|
-
|
|
51
|
+
mime-types (2.0)
|
|
52
|
+
minitest (4.7.5)
|
|
53
|
+
mocha (0.14.0)
|
|
36
54
|
metaclass (~> 0.0.1)
|
|
37
|
-
multi_json (1.
|
|
38
|
-
multi_xml (0.
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
55
|
+
multi_json (1.8.2)
|
|
56
|
+
multi_xml (0.5.5)
|
|
57
|
+
multipart-post (1.2.0)
|
|
58
|
+
nokogiri (1.5.10)
|
|
59
|
+
oauth2 (0.9.2)
|
|
60
|
+
faraday (~> 0.8)
|
|
61
|
+
httpauth (~> 0.2)
|
|
62
|
+
jwt (~> 0.1.4)
|
|
63
|
+
multi_json (~> 1.0)
|
|
64
|
+
multi_xml (~> 0.5)
|
|
65
|
+
rack (~> 1.2)
|
|
66
|
+
paperclip (3.5.2)
|
|
67
|
+
activemodel (>= 3.0.0)
|
|
68
|
+
activesupport (>= 3.0.0)
|
|
69
|
+
cocaine (~> 0.5.3)
|
|
44
70
|
mime-types
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
71
|
+
rack (1.5.2)
|
|
72
|
+
rake (10.1.1)
|
|
73
|
+
rdoc (4.0.1)
|
|
74
|
+
json (~> 1.4)
|
|
75
|
+
shoulda-context (1.1.6)
|
|
76
|
+
sqlite3 (1.3.8)
|
|
77
|
+
thread_safe (0.1.3)
|
|
78
|
+
atomic
|
|
79
|
+
tzinfo (0.3.38)
|
|
80
|
+
uuidtools (2.1.4)
|
|
50
81
|
|
|
51
82
|
PLATFORMS
|
|
52
83
|
ruby
|
data/Rakefile
CHANGED
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.6.
|
|
1
|
+
1.6.8
|
data/lib/paperclip-aws.rb
CHANGED
|
@@ -47,13 +47,13 @@ module Paperclip
|
|
|
47
47
|
:expires => 60*60,
|
|
48
48
|
:action => :read
|
|
49
49
|
})
|
|
50
|
-
secure = ( self.choose_protocol(style, options) == 'https' )
|
|
50
|
+
secure = ( self.choose_protocol(style, options) == 'https:' )
|
|
51
51
|
return self.s3.buckets[@s3_bucket].objects[path(style).gsub(%r{^/}, "")].url_for(options[:action], { :secure => secure, :expires => options[:expires] }).to_s
|
|
52
52
|
else
|
|
53
53
|
if @s3_host_alias.present?
|
|
54
|
-
url = "#{choose_protocol(style, options)}
|
|
54
|
+
url = "#{choose_protocol(style, options)}//#{@s3_host_alias}/#{path(style).gsub(%r{^/}, "")}"
|
|
55
55
|
else
|
|
56
|
-
url = "#{choose_protocol(style, options)}
|
|
56
|
+
url = "#{choose_protocol(style, options)}//#{@s3_endpoint}/#{@s3_bucket}/#{path(style).gsub(%r{^/}, "")}"
|
|
57
57
|
end
|
|
58
58
|
return URI.escape(url)
|
|
59
59
|
end
|
|
@@ -92,11 +92,13 @@ module Paperclip
|
|
|
92
92
|
end
|
|
93
93
|
|
|
94
94
|
def choose_protocol(style, options={})
|
|
95
|
-
if options[:protocol].present?
|
|
96
|
-
|
|
95
|
+
protocol = if options[:protocol].present?
|
|
96
|
+
options[:protocol].to_s
|
|
97
97
|
else
|
|
98
|
-
|
|
98
|
+
@s3_protocol.is_a?(Proc) ? @s3_protocol.call(style, self) : @s3_protocol
|
|
99
99
|
end
|
|
100
|
+
|
|
101
|
+
"#{protocol}:" if protocol.present?
|
|
100
102
|
end
|
|
101
103
|
|
|
102
104
|
# Returns representation of the data of the file assigned to the given
|
data/paperclip-aws.gemspec
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
|
|
6
6
|
Gem::Specification.new do |s|
|
|
7
7
|
s.name = "paperclip-aws"
|
|
8
|
-
s.version = "1.6.
|
|
8
|
+
s.version = "1.6.8"
|
|
9
9
|
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
11
11
|
s.authors = ["Igor Alexandrov"]
|
|
12
|
-
s.date = "2013-
|
|
12
|
+
s.date = "2013-12-22"
|
|
13
13
|
s.description = "'paperclip-aws' is a full featured storage module that supports all S3 locations (US, European and Tokio) without any additional hacking."
|
|
14
14
|
s.email = "igor.alexandrov@gmail.com"
|
|
15
15
|
s.extra_rdoc_files = [
|
|
@@ -28,18 +28,16 @@ Gem::Specification.new do |s|
|
|
|
28
28
|
"paperclip-aws.gemspec",
|
|
29
29
|
"test/aws_storage_test.rb",
|
|
30
30
|
"test/database.yml",
|
|
31
|
-
"test/fixtures/5k.png",
|
|
32
|
-
"test/fixtures/spaced file.png",
|
|
33
31
|
"test/helper.rb"
|
|
34
32
|
]
|
|
35
33
|
s.homepage = "http://github.com/igor-alexandrov/paperclip-aws"
|
|
36
34
|
s.licenses = ["MIT"]
|
|
37
35
|
s.require_paths = ["lib"]
|
|
38
|
-
s.rubygems_version = "
|
|
36
|
+
s.rubygems_version = "2.0.3"
|
|
39
37
|
s.summary = "Storage module to official 'aws-sdk' gem for Amazon S3"
|
|
40
38
|
|
|
41
39
|
if s.respond_to? :specification_version then
|
|
42
|
-
s.specification_version =
|
|
40
|
+
s.specification_version = 4
|
|
43
41
|
|
|
44
42
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
|
45
43
|
s.add_runtime_dependency(%q<paperclip>, [">= 2.5.0"])
|
data/test/aws_storage_test.rb
CHANGED
|
@@ -105,6 +105,15 @@ class AwsStorageTest < Test::Unit::TestCase
|
|
|
105
105
|
assert_match /\Ahttps:\/\/.+/, @dummy.avatar.url
|
|
106
106
|
end
|
|
107
107
|
|
|
108
|
+
should "return a scheme-less url with empty protocol predefined" do
|
|
109
|
+
rebuild_model default_model_options(:s3_protocol => '')
|
|
110
|
+
|
|
111
|
+
@dummy = Dummy.new
|
|
112
|
+
@dummy.avatar = StringIO.new(".")
|
|
113
|
+
|
|
114
|
+
assert_match /\A\/\/.+/, @dummy.avatar.url
|
|
115
|
+
end
|
|
116
|
+
|
|
108
117
|
should "return a correct protocol protocol based on s3_permissions" do
|
|
109
118
|
rebuild_model default_model_options(:s3_permissions => :public_read)
|
|
110
119
|
@dummy = Dummy.new
|
metadata
CHANGED
|
@@ -1,82 +1,73 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: paperclip-aws
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.6.
|
|
5
|
-
prerelease:
|
|
4
|
+
version: 1.6.8
|
|
6
5
|
platform: ruby
|
|
7
6
|
authors:
|
|
8
7
|
- Igor Alexandrov
|
|
9
8
|
autorequire:
|
|
10
9
|
bindir: bin
|
|
11
10
|
cert_chain: []
|
|
12
|
-
date: 2013-
|
|
11
|
+
date: 2013-12-22 00:00:00.000000000 Z
|
|
13
12
|
dependencies:
|
|
14
13
|
- !ruby/object:Gem::Dependency
|
|
15
14
|
name: paperclip
|
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
|
17
|
-
none: false
|
|
18
16
|
requirements:
|
|
19
|
-
- -
|
|
17
|
+
- - '>='
|
|
20
18
|
- !ruby/object:Gem::Version
|
|
21
19
|
version: 2.5.0
|
|
22
20
|
type: :runtime
|
|
23
21
|
prerelease: false
|
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
25
|
-
none: false
|
|
26
23
|
requirements:
|
|
27
|
-
- -
|
|
24
|
+
- - '>='
|
|
28
25
|
- !ruby/object:Gem::Version
|
|
29
26
|
version: 2.5.0
|
|
30
27
|
- !ruby/object:Gem::Dependency
|
|
31
28
|
name: aws-sdk
|
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
|
33
|
-
none: false
|
|
34
30
|
requirements:
|
|
35
|
-
- -
|
|
31
|
+
- - '>='
|
|
36
32
|
- !ruby/object:Gem::Version
|
|
37
33
|
version: 1.2.0
|
|
38
34
|
type: :runtime
|
|
39
35
|
prerelease: false
|
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
|
41
|
-
none: false
|
|
42
37
|
requirements:
|
|
43
|
-
- -
|
|
38
|
+
- - '>='
|
|
44
39
|
- !ruby/object:Gem::Version
|
|
45
40
|
version: 1.2.0
|
|
46
41
|
- !ruby/object:Gem::Dependency
|
|
47
42
|
name: bundler
|
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
|
49
|
-
none: false
|
|
50
44
|
requirements:
|
|
51
|
-
- -
|
|
45
|
+
- - '>='
|
|
52
46
|
- !ruby/object:Gem::Version
|
|
53
47
|
version: '0'
|
|
54
48
|
type: :development
|
|
55
49
|
prerelease: false
|
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
57
|
-
none: false
|
|
58
51
|
requirements:
|
|
59
|
-
- -
|
|
52
|
+
- - '>='
|
|
60
53
|
- !ruby/object:Gem::Version
|
|
61
54
|
version: '0'
|
|
62
55
|
- !ruby/object:Gem::Dependency
|
|
63
56
|
name: jeweler
|
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
|
65
|
-
none: false
|
|
66
58
|
requirements:
|
|
67
|
-
- -
|
|
59
|
+
- - '>='
|
|
68
60
|
- !ruby/object:Gem::Version
|
|
69
61
|
version: '0'
|
|
70
62
|
type: :development
|
|
71
63
|
prerelease: false
|
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
|
73
|
-
none: false
|
|
74
65
|
requirements:
|
|
75
|
-
- -
|
|
66
|
+
- - '>='
|
|
76
67
|
- !ruby/object:Gem::Version
|
|
77
68
|
version: '0'
|
|
78
|
-
description:
|
|
79
|
-
|
|
69
|
+
description: '''paperclip-aws'' is a full featured storage module that supports all
|
|
70
|
+
S3 locations (US, European and Tokio) without any additional hacking.'
|
|
80
71
|
email: igor.alexandrov@gmail.com
|
|
81
72
|
executables: []
|
|
82
73
|
extensions: []
|
|
@@ -95,35 +86,29 @@ files:
|
|
|
95
86
|
- paperclip-aws.gemspec
|
|
96
87
|
- test/aws_storage_test.rb
|
|
97
88
|
- test/database.yml
|
|
98
|
-
- test/fixtures/5k.png
|
|
99
|
-
- test/fixtures/spaced file.png
|
|
100
89
|
- test/helper.rb
|
|
101
90
|
homepage: http://github.com/igor-alexandrov/paperclip-aws
|
|
102
91
|
licenses:
|
|
103
92
|
- MIT
|
|
93
|
+
metadata: {}
|
|
104
94
|
post_install_message:
|
|
105
95
|
rdoc_options: []
|
|
106
96
|
require_paths:
|
|
107
97
|
- lib
|
|
108
98
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
109
|
-
none: false
|
|
110
99
|
requirements:
|
|
111
|
-
- -
|
|
100
|
+
- - '>='
|
|
112
101
|
- !ruby/object:Gem::Version
|
|
113
102
|
version: '0'
|
|
114
|
-
segments:
|
|
115
|
-
- 0
|
|
116
|
-
hash: -990809500387272058
|
|
117
103
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
118
|
-
none: false
|
|
119
104
|
requirements:
|
|
120
|
-
- -
|
|
105
|
+
- - '>='
|
|
121
106
|
- !ruby/object:Gem::Version
|
|
122
107
|
version: '0'
|
|
123
108
|
requirements: []
|
|
124
109
|
rubyforge_project:
|
|
125
|
-
rubygems_version:
|
|
110
|
+
rubygems_version: 2.0.3
|
|
126
111
|
signing_key:
|
|
127
|
-
specification_version:
|
|
112
|
+
specification_version: 4
|
|
128
113
|
summary: Storage module to official 'aws-sdk' gem for Amazon S3
|
|
129
114
|
test_files: []
|
data/test/fixtures/5k.png
DELETED
|
Binary file
|
|
Binary file
|