tableau_server_client 0.0.16 → 0.0.17

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
  SHA256:
3
- metadata.gz: cfb4ff2c5708e21a86b2410eb590a0d3a69d3f4e40cd7f68d6f700da386dbb69
4
- data.tar.gz: 8fec89163d20b4b033f85d9818609a7b6034b5014f1a3b7580ed2774656e5a76
3
+ metadata.gz: 002d3eb5a6e6a504c3eba7abf7910f161d5ae5ddbd1253978444a251117084bd
4
+ data.tar.gz: a50e3f36b5538a27d7c3026d8947ed55b032b89129919e55224f76e8d977ad4e
5
5
  SHA512:
6
- metadata.gz: 4971c7c4419b28f0a9448eae1e021faad92d88975c790f1dac3fdd597bbc3f6b7eac422083d12e9c4cd52c32b2bab649d74c0d7982e950f7feb9bf5075560e8a
7
- data.tar.gz: 86b7338ee298548c2810cf4f7e7612a9b16e96ef4a243545515cd45f5f5737833591017fdfe78560def74a02a54ca5af038f534c226fac6eeb70ba93f5b77710
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
- type, disposition = response.headers.values_at('content-type', 'content-disposition')
9
- case type
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: #{type}"
22
+ raise "Unknown content-type: #{content_type}"
21
23
  end
22
24
  end
23
25
  end
@@ -1,3 +1,3 @@
1
1
  module TableauServerClient
2
- VERSION = "0.0.16"
2
+ VERSION = "0.0.17"
3
3
  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.16
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-04-19 00:00:00.000000000 Z
11
+ date: 2019-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler