Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Tableau Tool documenting Workbooks' Dashboards and their Worksheets
# analyzeDashboardSheets.rb Copyright (C) 2018 Chris Gerrard
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
system 'cls'
require 'set'
require 'twb'
def argto_a arg
argarray = SortedSet.new
arg.split(',').each { |a| argarray << a}
return argarray.to_a
end
$twbCount = 0
$analyzer = Twb::Analysis::DashSheetsAnalyzer.new
def processTwb twbName
twb = Twb::Workbook.new twbName
puts "\t - #{twbName}"
# --
$analyzer.processTWB twb
# --
$twbCount += 1
end
puts "\n "
puts " #{$analyzer.funcdoc[:blurb]}"
puts "\n "
path = if ARGV.empty? then ['*.twb','*.twbx'] else argto_a(ARGV[0]) end
puts " Processing Workbooks matching: '#{path}'\n "
Dir.glob(path) { |twb| processTwb twb }
puts "\n "
puts " Analysis complete, found: #{$twbCount} Workbooks"
puts "\n"
$analyzer.docfilesdoc(' ').each do |l|
puts l
end
puts "\n\n That's all, folks.\n "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.