Class: Twb::Analysis::DataSourceOriginsAnalyzer

Inherits:
Object
  • Object
show all
Includes:
TabTool
Defined in:
lib/twb/analysis/datasources/datasourceoriginsanalyzer.rb

Constant Summary collapse

@@recNum =
0

Instance Attribute Summary collapse

Attributes included from TabTool

#alerts, #docDir, #docfiles, #funcdoc, #id, #licensed, #logfilename, #logger, #loglevel, #properties, #ttdocdir, #type, #uuid

Instance Method Summary collapse

Methods included from TabTool

#addDocFile, #alert, #closeDocFiles, #config, #docFile, #docFileMaxNameLen, #docfilesdoc, #docfilesdocto_s, #emit, #emitCSV, #finis, #hasConfig, #init, #initCSV, #initDocDir, #initLogger, #license=, #licensed?, #loadConfig

Constructor Details

#initialize(**args) ⇒ DataSourceOriginsAnalyzer

Returns a new instance of DataSourceOriginsAnalyzer.


30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/twb/analysis/datasources/datasourceoriginsanalyzer.rb', line 30

def initialize(**args)
  @args = args
  #-- TODO move @csvAdd * #csvMode resolution to TabTool
  @csvAdd  = args[:csvMode] == :add
  @csvMode = @csvAdd ? 'a' : 'w'
  # emit "@csvAdd : #{@csvAdd}" 
  # emit "@csvMode: #{@csvMode}" 
  #--
  init
  @funcdoc    = {:class=>self.class, :blurb=>'Analyze Data Source Origins, i.e. where the data comes from', :description=>nil,}
  #--
  docFileName = docFile('DataSourceOrigins.csv')
  @csvFile  = CSV.open(docFileName,'w')
  unless @csvAdd
    @csvFile  << ['Workbook', 'Workbook Version', 'Workbook Directory', 'Data Source', 'Data Source (tech)', 'Is Published?', "Rec #"]
  end
  addDocFile @csvFile, docFileName, "Workbooks, Data Sources, and the Data Sources' origins"
  #--
  @twbCnt     = 0
  @dsCnt      = 0
end

Instance Attribute Details

#localEmitObject

Returns the value of attribute localEmit


28
29
30
# File 'lib/twb/analysis/datasources/datasourceoriginsanalyzer.rb', line 28

def localEmit
  @localEmit
end

Instance Method Details

#metricsObject


52
53
54
55
56
57
# File 'lib/twb/analysis/datasources/datasourceoriginsanalyzer.rb', line 52

def metrics
  {
    # '# of Workbooks'    => @twbcount,
    '# of Data Sources' => @dsCnt,
  }
end

#processTWB(twb) ⇒ Object


59
60
61
62
63
64
65
66
# File 'lib/twb/analysis/datasources/datasourceoriginsanalyzer.rb', line 59

def processTWB twb
   @twb = twb
   emit "   -- twb:: #{@twb.name}"
   @twbCnt += 1
   @twbDomainsLoaded = false
   parseDataSources
   finis
end