twb 4.5.9 → 4.6.0

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: 655831689d83bd142aeb3a061dc86a367497a6dc1d61031c7e229976ed8bc5b6
4
- data.tar.gz: fab0357f3648dd5dd24176407e6a5cf248f49a278a600d11c1202f4377869f9d
3
+ metadata.gz: e049f4ada5ac7d92e8c34a843e3593a632b2c009854fa09f3c085567e7904289
4
+ data.tar.gz: 423d1b5cd090535b6a60409e468df0ffd7fd28583660a5ff86c9ce9101dcfb1a
5
5
  SHA512:
6
- metadata.gz: b873fb151462b1bd1c3e3154bdc03f688fe1221dbf0c5bebea043edacc05ae170b42f94145aeb38d770524395308223cfbb80765d67222a05db1c789ea94b162
7
- data.tar.gz: 3fde1e8458f46089af96b516810ebb306ce56af8743bb7c40973da3ebf928186b7241df42f3536b61810c3f4c28d657dff8672b7ec6308c67c671cc2f4563d92
6
+ metadata.gz: a814663aa667f6af9e62bff76c3bedf7497eb248e8883e1cbfa09a2631f8cf51a3714929c98f852f5c328f66d9a022c8f0df28c767e39e90ce860cd311cb99a3
7
+ data.tar.gz: 6bcd9e6d20bab6ca85dfc6d954c99d711dc4475784068c8d7598a4f718a2fc446d90d277c03924b122a402fddd06b594efb93ec827668694bdfd3aeb865d9c84
data/lib/twb.rb CHANGED
@@ -71,5 +71,5 @@ require_relative 'twb/analysis/sheets/dashsheetsanalyzer'
71
71
  # Represents Tableau Workbooks, their contents, and classes that analyze and manipulate them.
72
72
  #
73
73
  module Twb
74
- VERSION = '4.5.9'
74
+ VERSION = '4.6.0'
75
75
  end
@@ -37,7 +37,7 @@ module Analysis
37
37
  docFileName = docFile('WorkbookSummary.csv')
38
38
  @csvFile = CSV.open(docFileName,@csvMode)
39
39
  unless @csvAdd
40
- csvHeader = ['Rec #', 'Workbook','Type','Version','Build','Modified','# Data Sources','# Dashboards','# Worksheets']
40
+ csvHeader = ['Rec #', 'Workbook','Type','Version','Build','Platform','Modified','# Data Sources','# Dashboards','# Worksheets']
41
41
  if @recordDir
42
42
  csvHeader.push('Workbook Directory')
43
43
  end
@@ -67,7 +67,9 @@ module Analysis
67
67
  recordCSV [ @twb.name,
68
68
  @twb.type,
69
69
  @twb.version,
70
- @twb.build,
70
+ @twb.build,
71
+ @twb.platform,
72
+ # @twb.base,
71
73
  @twb.modtime,
72
74
  @twb.datasources.length,
73
75
  @twb.dashboards.length,
@@ -0,0 +1,31 @@
1
+ require 'nokogiri'
2
+ require 'csv'
3
+
4
+ $twbCount = 0
5
+ def processTwb twbName
6
+ puts "\t - #{twbName}"
7
+ twb = Twb::Workbook.new twbName
8
+ nokodoc = twb.node #Nokogiri::XML(open('dataSources.xml'))
9
+ # $nodePaths = SortedSet.new
10
+
11
+ $csvFile = CSV.open('xmlNodesAndAttributes.csv','w')
12
+ $csvFile << ['Workbook', 'Workbook Directory', 'Node Name', 'Node Path', 'Attr Name', 'Attr Value']
13
+ nodes = nokodoc.xpath('//.')
14
+ nodes.each do |n|
15
+ nodeName = n.name
16
+ nodePath = n.path.gsub(/\[[0-9]+\]/,'')
17
+ attrs = n.attributes
18
+ attrs.each do |attrName,attrValue|
19
+ $csvFile << [twbName, twbDir, nodeName, nodePath, attrName, attrValue]
20
+ end
21
+ if attrs.empty?
22
+ $csvFile << [ twbName, twbDir, nodeName, nodePath, nil, nil ]
23
+ end
24
+ # $nodePaths << n.path.gsub(/\[[0-9]+\]/,'').gsub('/content/workbook/','')
25
+ end
26
+ $twbCount += 1
27
+ end
28
+
29
+ path = if ARGV.empty? then ['**/*.twb','**/*.twbx'] else argto_a(ARGV[0]) end
30
+ puts "\n Processing Workbooks matching: '#{path}'\n "
31
+ Dir.glob(path) { |twb| processTwb twb }
@@ -24,9 +24,9 @@ module Twb
24
24
  #
25
25
  class Workbook < TabClass
26
26
 
27
- attr_reader :workbooknode, :node
28
- attr_reader :name, :dir, :type
29
- attr_reader :modtime, :version, :build
27
+ attr_reader :workbooknode, :node, :ndoc
28
+ attr_reader :name, :dir, :type, :modtime
29
+ attr_reader :version, :build, :platform, :base
30
30
  #--
31
31
  attr_reader :datasources, :datasource
32
32
  attr_reader :datasourceNames, :datasourceUINames, :dataSourceNamesMap
@@ -34,7 +34,7 @@ module Twb
34
34
  #--
35
35
  attr_reader :dashboards, :storyboards, :worksheets
36
36
  attr_reader :parameters, :actions
37
- attr_reader :valid, :ndoc
37
+ attr_reader :valid
38
38
 
39
39
  ##
40
40
  # Creates a Workbook from its file name.
@@ -183,6 +183,8 @@ module Twb
183
183
  @node = @ndoc.at_xpath('//workbook')
184
184
  @workbooknode = @node
185
185
  @version = @node.nil? ? nil : @node["version"]
186
+ @platform = @node.nil? ? nil : @node["source-platform"].nil? ? nil : @node["source-platform"].capitalize
187
+ @base = @node.nil? ? nil : @node["base"]
186
188
  loaddatasources
187
189
  loadWorksheets
188
190
  loadDashboards
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: 4.5.9
4
+ version: 4.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Gerrard
@@ -102,6 +102,7 @@ files:
102
102
  - lib/twb/hashtohtml.rb
103
103
  - lib/twb/htmllistcollapsible.rb
104
104
  - lib/twb/identifyfields.rb
105
+ - lib/twb/listXMLNodePathsAndAttributes.rb
105
106
  - lib/twb/localfield.rb
106
107
  - lib/twb/mappedfield.rb
107
108
  - lib/twb/metadatafield.rb