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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 664e741ce46d130747d11cdc28b284723e859f3c
4
- data.tar.gz: 09938abc476aed536493940f7899e0b27bdbb96d
3
+ metadata.gz: d26bc908c337bafa06a9bb5cea0a047aea6f937e
4
+ data.tar.gz: ced6b894ed0763d15cd32120df4a5da01fef10d5
5
5
  SHA512:
6
- metadata.gz: 52dbc995b807336bd8970ac7f8810f0456326b07c9ca1a13b77fdc80bafbd18cda387f5637f935508ab466a069431d7d221ad5ac0460f53e24fc0685ef37b3b3
7
- data.tar.gz: a2cae0fd83cee2c5970973df13a3e9aeae1d9f90254f24a6fbeb3ac402884eb7e2e210cac9835e00c036269dd97f9acb9ac054de2b6693f74de527a84df2aff8
6
+ metadata.gz: c144bca62db52b765c134433d8b184047b7870947987bd6fab77d08c05e774f64f83f51f2969d457c898d5a4e2c589a3a2baf4a9f0a6320ae41302ed79d79634
7
+ data.tar.gz: 376a296c42df3a99ad1b84e6e76c8b93716e1f496cb058a372a297306d6ec367e03d39e5fe2e44699444e3ccc0528bac295f3977758daeb43a377489ce996735
@@ -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 only supported parameter in this hash is `expires`.
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
 
@@ -1,5 +1,5 @@
1
1
  module Anaconda
2
2
  module Rails
3
- VERSION = "1.0.10"
3
+ VERSION = "1.0.11"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anaconda
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.10
4
+ version: 1.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben McFadden