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.
- checksums.yaml +4 -4
- data/lib/rbbt/resource.rb +5 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2aabf946c6d6e07457499829d5e06da9203a99badceacc94cdfd5ce4abc42efe
|
4
|
+
data.tar.gz: ba68e01869832af6235425f3dd142dd6c6a938545fa60cc2122295ae3137c059
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f37a3fc2abf5ed86406174aeb9c5d6417856527e87af73ac9eabbd086d292d0a49f75c8af97ab88c38bd32f849fe65c076486ae86e60d03c2f934ad261831779
|
7
|
+
data.tar.gz: 800269f00b740c8cec30952e1e3958cf66e547fb8742f643f8a40ea13e8126153a6ece33e64bd44ca2f4e1ab23e5a1534363023dfe413753722ba0e136430ef8
|
data/lib/rbbt/resource.rb
CHANGED
@@ -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|
|