carrierwave-aws 1.4.0 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: df1b2dd13c2fe5d10191144d8a709b4669783478e51cd099d516b9df8fa70fa1
4
- data.tar.gz: 272ee0bea417ba78fae9ea98b4ec87a89483d8c7308630c6489cccf722442385
3
+ metadata.gz: b420ef988503bad151d75b1794b45ef1d3c2906077df034ddbdf067369f003aa
4
+ data.tar.gz: 167626ab412b4b49d26927c7044445974120a273c7fda2398faea3f3d549ff0c
5
5
  SHA512:
6
- metadata.gz: ed978e69ba5751cb793fa2c63afd075c6c8e4a608de7d36999a0b9c5a8b06e4aaf42391ec211d98d21186e402cb147bf39629de28e328bf51e64c156b88fffa9
7
- data.tar.gz: '09961c9485558f613c1ce426812375b2f30d87e91042675dc3021a8dfa98c5be2a24959fa234276c55ac1612c5b4515a2674b57717cb7314b96b8e54cea552c4'
6
+ metadata.gz: 0f1c69cf12347fa87723f671de01166a1b6373e3863b36acca438f6cc253d1e50cd76f6835c55d860078003d08d9d9692b596d40736f7eade764a458de5cb826
7
+ data.tar.gz: c153eaa6992b88e00c34d3eeca7e8666b6f5f9a665a137b365214f3dc2be9520ef8701cbd3a4b6451d854d160466b4a4e16b3469171a0eac2540553f28d3fc5f
@@ -86,7 +86,11 @@ module CarrierWave
86
86
  end
87
87
 
88
88
  def asset_host_public
89
- @asset_host_public || false
89
+ if instance_variable_defined?('@asset_host_public')
90
+ @asset_host_public
91
+ else
92
+ self.class.asset_host_public
93
+ end || false
90
94
  end
91
95
  end
92
96
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Carrierwave
4
4
  module AWS
5
- VERSION = '1.4.0'
5
+ VERSION = '1.5.0'
6
6
  end
7
7
  end
@@ -6,7 +6,7 @@ module CarrierWave
6
6
  def self.filename(url)
7
7
  path = url.split('?').first
8
8
 
9
- URI.decode(path).gsub(%r{.*/(.*?$)}, '\1')
9
+ CGI.unescape(path).gsub(%r{.*/(.*?$)}, '\1')
10
10
  end
11
11
  end
12
12
  end
@@ -138,4 +138,43 @@ describe CarrierWave::Uploader::Base do
138
138
  expect(uploader.aws_signer).to eql(signer_proc)
139
139
  end
140
140
  end
141
+
142
+ describe '#asset_host_public' do
143
+ it 'can be overridden on an instance level' do
144
+ instance = uploader.new
145
+
146
+ uploader.asset_host_public = true
147
+ instance.asset_host_public = false
148
+
149
+ expect(uploader.asset_host_public).to eq(true)
150
+ expect(instance.asset_host_public).to eq(false)
151
+ end
152
+
153
+ it 'can be looked up from superclass' do
154
+ uploader.asset_host_public = true
155
+ instance = derived_uploader.new
156
+
157
+ expect(derived_uploader.asset_host_public).to eq(true)
158
+ expect(instance.asset_host_public).to eq(true)
159
+ end
160
+
161
+ it 'can be overridden on a class level' do
162
+ uploader.asset_host_public = true
163
+ derived_uploader.asset_host_public = false
164
+
165
+ base = uploader.new
166
+ expect(base.asset_host_public).to eq(true)
167
+
168
+ instance = derived_uploader.new
169
+ expect(instance.asset_host_public).to eq(false)
170
+ end
171
+
172
+ it 'can be set with the configure block' do
173
+ uploader.configure do |config|
174
+ config.asset_host_public = true
175
+ end
176
+
177
+ expect(uploader.asset_host_public).to eq(true)
178
+ end
179
+ end
141
180
  end
metadata CHANGED
@@ -1,35 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carrierwave-aws
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Parker Selbert
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-04 00:00:00.000000000 Z
11
+ date: 2020-04-01 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
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '0.7'
20
- - - "<"
17
+ - - "~>"
21
18
  - !ruby/object:Gem::Version
22
- version: '2.1'
19
+ version: '2.0'
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- version: '0.7'
30
- - - "<"
24
+ - - "~>"
31
25
  - !ruby/object:Gem::Version
32
- version: '2.1'
26
+ version: '2.0'
33
27
  - !ruby/object:Gem::Dependency
34
28
  name: aws-sdk-s3
35
29
  requirement: !ruby/object:Gem::Requirement
@@ -114,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
114
108
  - !ruby/object:Gem::Version
115
109
  version: '0'
116
110
  requirements: []
117
- rubygems_version: 3.0.1
111
+ rubygems_version: 3.0.3
118
112
  signing_key:
119
113
  specification_version: 4
120
114
  summary: Native aws-sdk support for S3 in CarrierWave