tableau_server_client 0.0.16 → 0.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 002d3eb5a6e6a504c3eba7abf7910f161d5ae5ddbd1253978444a251117084bd
|
|
4
|
+
data.tar.gz: a50e3f36b5538a27d7c3026d8947ed55b032b89129919e55224f76e8d977ad4e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7d1a387be9b4e864c3eb01dde59d7b589240e2eccfab1debe1c50e2b1409126655a1e1cdac9df270cb9551a3fb07aec32466871d312af039093cbbc1b952098c
|
|
7
|
+
data.tar.gz: f163b5763430fc45882e26c0bca32f203a73b51525ce23a8575089f2ab8c06febfe5190993759ca8544b9da2f4b82fc425814c3c8680ac0e2a565ce5acad3da8
|
|
@@ -4,20 +4,22 @@ module TableauServerClient
|
|
|
4
4
|
module Downloadable
|
|
5
5
|
|
|
6
6
|
def download(file_path: nil)
|
|
7
|
+
return @content_body if @content_body and (file_path.nil? or @file_path == file_path)
|
|
8
|
+
@file_path = file_path
|
|
7
9
|
response = client.download(location(query_params: {"includeExtract": "False"}), file_path: file_path)
|
|
8
|
-
|
|
9
|
-
case
|
|
10
|
+
content_type = response.headers['content-type']
|
|
11
|
+
case content_type
|
|
10
12
|
when 'application/xml'
|
|
11
|
-
return Nokogiri::XML(response.body)
|
|
13
|
+
return @content_body = Nokogiri::XML(response.body)
|
|
12
14
|
when 'application/octet-stream'
|
|
13
15
|
Zip::InputStream.open(StringIO.new(response.body)) do |io|
|
|
14
16
|
while entry = io.get_next_entry
|
|
15
|
-
return Nokogiri::XML(io.read) if entry.name =~ /.*\.(tds|twb)/
|
|
17
|
+
return @content_body = Nokogiri::XML(io.read) if entry.name =~ /.*\.(tds|twb)/
|
|
16
18
|
end
|
|
17
19
|
raise "TDS or TWB file not found for: #{location.path}"
|
|
18
20
|
end
|
|
19
21
|
else
|
|
20
|
-
raise "Unknown content-type: #{
|
|
22
|
+
raise "Unknown content-type: #{content_type}"
|
|
21
23
|
end
|
|
22
24
|
end
|
|
23
25
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: tableau_server_client
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.17
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- shimpeko
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-
|
|
11
|
+
date: 2019-05-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|