twb 0.0.21 → 0.0.22

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.
data/lib/twb/workbook.rb CHANGED
@@ -31,10 +31,17 @@ module Twb
31
31
  @ndoc = Nokogiri::XML(open(twbWithDir))
32
32
  end
33
33
 
34
- def dataSources
34
+ def dataSourceNodes
35
35
  @ndoc.xpath('//workbook/datasources/datasource').to_a
36
36
  end
37
37
 
38
+ def dataSources
39
+ sources = []
40
+ dataSourceNodes.each do |dsn|
41
+ sources.push Twb::DataSource.new(dsn)
42
+ end
43
+ end
44
+
38
45
  end
39
46
 
40
47
  end
data/testTwbGem.rb ADDED
@@ -0,0 +1,37 @@
1
+ # testTwbGem.rb - this Ruby script Copyright 2013, 2014 Christopher Gerrard
2
+
3
+ require 'nokogiri'
4
+ require 'open-uri'
5
+ require 'twb'
6
+
7
+
8
+ def processTWB twbWithDir
9
+ puts "in processTWB"
10
+ twb = Twb::Workbook.new twbWithDir
11
+ puts "Found #{twb.name}"
12
+ doc = twb.ndoc
13
+ puts " Data Sources"
14
+ twb.dataSources.each do |ds|
15
+ puts " - #{ds.attr('name')} :: c-#{ds.attr('caption')} :: uin-#{ds.attr('uiname')} :: ch-#{ds.attr('connHash')} "
16
+ end
17
+ end
18
+
19
+ def getConnectionHash dataSource
20
+ dsAttributes = dataSource.xpath('./connection/@*')
21
+ dsConnStr = ''
22
+ dsAttributes.each do |attr|
23
+ dsConnStr += attr.text
24
+ # Note: only collects non-'' attribute values
25
+ end
26
+ dsConnStr.hash
27
+ end
28
+
29
+ def getName techName
30
+ techName.gsub(/^\[/,'').gsub(/\]$/,'')
31
+ end
32
+
33
+ puts "START"
34
+
35
+ Dir.glob("**/*.twb") {|twb| processTWB twb }
36
+
37
+ $f.close unless $f.nil?
data/twb-0.0.21.gem ADDED
Binary file
data/twb.gemspec CHANGED
@@ -2,7 +2,7 @@ Gem::Specification.new do |s|
2
2
  s.name = 'twb'
3
3
  s.summary = "Classes for accessing Tableau Workbooks and their contents - summary."
4
4
  s.description = "Classes for accessing Tableau Workbooks and their contents - description"
5
- s.version = '0.0.21'
5
+ s.version = '0.0.22'
6
6
  s.date = "2015-03-14"
7
7
  s.author = "Chris Gerrard"
8
8
  s.email = "Chris@Gerrard.net"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.21
4
+ version: 0.0.22
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -25,8 +25,10 @@ files:
25
25
  - lib/twb/workbook.rb
26
26
  - lib/twb.rb
27
27
  - LICENSE.txt
28
+ - testTwbGem.rb
28
29
  - twb-0.0.1.gem
29
30
  - twb-0.0.2.gem
31
+ - twb-0.0.21.gem
30
32
  - twb.gemspec
31
33
  homepage: http://rubygems.org/gems/twb
32
34
  licenses: