rbbt-util 5.26.117 → 5.26.118

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rbbt/resource.rb +5 -0
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e59ee0bcb0a764c4bc10206585d0a26c7a59f881cca10dcaf3fbf693b0ed9208
4
- data.tar.gz: 929459e6de52b9ba2f13b7fa55c2aac38a78ff13c6990f63143c68e2b35a6af8
3
+ metadata.gz: 2aabf946c6d6e07457499829d5e06da9203a99badceacc94cdfd5ce4abc42efe
4
+ data.tar.gz: ba68e01869832af6235425f3dd142dd6c6a938545fa60cc2122295ae3137c059
5
5
  SHA512:
6
- metadata.gz: c3d7ed4da1ec8ac8b63e1a91bccbb87b60a1d6c60fe3807f4c9f85f8c1dc82a1fd206382175184278dac40bce536a732e3da38383c0828e446b10cfcf647ac3d
7
- data.tar.gz: fbed1b9e52b78a3f56eda4e5a0c0b39c9f21f8ff8faa66725ebaf2c11d27e3c71d4d630ce5acd7616dd86697d82114859fd46e5b45a256cad6364e800c045934
6
+ metadata.gz: f37a3fc2abf5ed86406174aeb9c5d6417856527e87af73ac9eabbd086d292d0a49f75c8af97ab88c38bd32f849fe65c076486ae86e60d03c2f934ad261831779
7
+ data.tar.gz: 800269f00b740c8cec30952e1e3958cf66e547fb8742f643f8a40ea13e8126153a6ece33e64bd44ca2f4e1ab23e5a1534363023dfe413753722ba0e136430ef8
@@ -93,6 +93,11 @@ module Resource
93
93
  timeout = 60 * 10
94
94
  Net::HTTP.start(uri.host, uri.port, :timeout => timeout, :read_timeout => timeout, :open_timeout => timeout) do |http|
95
95
  http.request request do |response|
96
+ filename = response["Content-Disposition"].split(";").select{|f| f.include? "filename"}.collect{|f| f.split("=").last.gsub('"','')}.first
97
+ if filename && filename =~ /\.b?gz$/ && final_path !~ /\.b?gz$/
98
+ extension = filename.split(".").last
99
+ final_path += '.' + extension
100
+ end
96
101
  case response
97
102
  when Net::HTTPSuccess, Net::HTTPOK
98
103
  Misc.sensiblewrite(final_path) do |file|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbbt-util
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.26.117
4
+ version: 5.26.118
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez