anaconda 1.0.10 → 1.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.markdown +4 -1
- data/lib/anaconda/anaconda_for.rb +5 -1
- data/lib/anaconda/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d26bc908c337bafa06a9bb5cea0a047aea6f937e
|
4
|
+
data.tar.gz: ced6b894ed0763d15cd32120df4a5da01fef10d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c144bca62db52b765c134433d8b184047b7870947987bd6fab77d08c05e774f64f83f51f2969d457c898d5a4e2c589a3a2baf4a9f0a6320ae41302ed79d79634
|
7
|
+
data.tar.gz: 376a296c42df3a99ad1b84e6e76c8b93716e1f496cb058a372a297306d6ec367e03d39e5fe2e44699444e3ccc0528bac295f3977758daeb43a377489ce996735
|
data/README.markdown
CHANGED
@@ -173,7 +173,7 @@ We highly recommend the `figaro` gem [https://github.com/laserlemon/figaro](http
|
|
173
173
|
|
174
174
|
`asset_url` will return a signed S3 URL if the file is stored with an ACL of `private` and will return a non-signed URL if the file is stored with public access. This accepts a single optional hash argument with possible parameters `protocol` and `expires`.
|
175
175
|
|
176
|
-
`asset_download_url` will return a signed S3 URL with content-disposition set to attachment so the file will be downloaded instead of opened in the browser. This accepts a single optional hash argument. The
|
176
|
+
`asset_download_url` will return a signed S3 URL with content-disposition set to attachment so the file will be downloaded instead of opened in the browser. This accepts a single optional hash argument. The currently supported parameters in this hash are `expires` and `filename`. `filename` is the name the file will be downloaded as.
|
177
177
|
|
178
178
|
`protocol`, if specified here, will override the default value set in the model.
|
179
179
|
`expires` is a DateTime object when a signed URL will be valid until. On a file stored publically, this has no effect.
|
@@ -219,6 +219,9 @@ If you return false to the following events it will prevent the default behavior
|
|
219
219
|
From version 1.0.0 on we have used [Semantic Versioning](http://semver.org/).
|
220
220
|
|
221
221
|
## Changelog
|
222
|
+
* 1.0.11
|
223
|
+
* Add ability to pass `filename` to the `asset_download_url` method.
|
224
|
+
|
222
225
|
* 1.0.10
|
223
226
|
* Add 610ms delay after final file is uploaded before submitting the form. Some browsers stop all CSS transitions when the form is submitted and this was preventing the progress bar from reaching 100%. This allows it to reach 100% before submitting the form, so users don't get the impression that the file failed to fully upload.
|
224
227
|
|
@@ -134,8 +134,12 @@ module Anaconda
|
|
134
134
|
options = args.extract_options!
|
135
135
|
logger.debug "Extracted Options:"
|
136
136
|
logger.debug(options)
|
137
|
+
filename = nil
|
138
|
+
if options[:filename].present?
|
139
|
+
filename = "filename=#{options[:filename]}"
|
140
|
+
end
|
137
141
|
|
138
|
-
aws_options = {query: {"response-content-disposition" => "attachment
|
142
|
+
aws_options = {query: {"response-content-disposition" => "attachment;#{filename}"}}
|
139
143
|
aws = Fog::Storage.new({:provider => 'AWS', :aws_access_key_id => Anaconda.aws[:aws_access_key], :aws_secret_access_key => Anaconda.aws[:aws_secret_key], :path_style => Anaconda.aws[:path_style]})
|
140
144
|
aws.get_object_https_url(Anaconda.aws[:aws_bucket], send("#{column_name}_file_path"), anaconda_expiry_length(column_name, options[:expires]), aws_options)
|
141
145
|
|
data/lib/anaconda/version.rb
CHANGED