twb 0.1.1 → 0.3.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.
File without changes
@@ -0,0 +1,66 @@
1
+ # Copyright (C) 2014, 2015 Chris Gerrard
2
+ #
3
+ # This program is free software: you can redistribute it and/or modify
4
+ # it under the terms of the GNU General Public License as published by
5
+ # the Free Software Foundation, either version 3 of the License, or
6
+ # (at your option) any later version.
7
+ #
8
+ # This program is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
+ # GNU General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU General Public License
14
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
15
+
16
+ require 'twb'
17
+ require "test/unit"
18
+
19
+ system "cls"
20
+
21
+ class TestDocDashImageVert < Test::Unit::TestCase
22
+
23
+ def test_create
24
+ vDash = Twb::DocDashboardImageVert.new
25
+ assert(!vDash.nil?, "Doc Dashboard creation should not be null")
26
+ assert_equal('columnar Image', vDash.type)
27
+ assert(!vDash.dashnode.nil?, "Doc Dashboard dashboard node should not be null")
28
+ assert(!vDash.winnode.nil?, "Doc Dashboard window node should not be null")
29
+ assert(!vDash.dashnode.at_xpath('.//zone[@type="bitmap"]').nil?, " <dashboard Web zone must not be null")
30
+ assert(!vDash.winnode.at_xpath('.//zone[@type="bitmap"]').nil?, " <window Web zone must not be null")
31
+ end
32
+
33
+ def test_assignname
34
+ vDash = Twb::DocDashboardImageVert.new
35
+ vDash.title=('test title name')
36
+ assert_equal('test title name', vDash.title)
37
+ assert(!vDash.dashnode.attribute('name').nil?)
38
+ puts " -- dash node #{vDash.dashnode.class} :: "
39
+ puts " -- wind node #{vDash.winnode.class} :: "
40
+ assert(!vDash.winnode.attribute('name').nil?)
41
+ assert_equal('test title name', vDash.dashnode.attribute('name').value)
42
+ assert_equal('test title name', vDash.winnode.attribute('name').value)
43
+ end
44
+
45
+ def test_assigImage
46
+ vDash = Twb::DocDashboardImageVert.new
47
+ vDash.image=('test Image')
48
+ assert_equal('test Image', vDash.image)
49
+ end
50
+
51
+ def test_inject
52
+ vDash = Twb::DocDashboardImageVert.new
53
+ vDash.title=('Injected Documentation Dashboard')
54
+ vDash.image=('C:\\tech\\Tableau\\TWBs\\Tableau Sample Workbooks\\World Indicators.twb.png')
55
+ do_injection(vDash, 'No Content.twb')
56
+ do_injection(vDash, 'No Dashboards.twb')
57
+ end
58
+
59
+ def do_injection(dash, twbName)
60
+ twb = Twb::Workbook.new(twbName)
61
+ assert(!twb.nil?)
62
+ twb.addDocDashboard dash
63
+ twb.writeAppend('injectedImage')
64
+ end
65
+
66
+ end
@@ -0,0 +1,67 @@
1
+ # Copyright (C) 2014, 2015 Chris Gerrard
2
+ #
3
+ # This program is free software: you can redistribute it and/or modify
4
+ # it under the terms of the GNU General Public License as published by
5
+ # the Free Software Foundation, either version 3 of the License, or
6
+ # (at your option) any later version.
7
+ #
8
+ # This program is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
+ # GNU General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU General Public License
14
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
15
+
16
+ require 'twb'
17
+ require "test/unit"
18
+
19
+ system "cls"
20
+
21
+ class TestDocDash < Test::Unit::TestCase
22
+
23
+ def test_createWebVert
24
+ vDash = Twb::DocDashboardWebVert.new
25
+ assert(!vDash.nil?, "Doc Dashboard creation should not be null")
26
+ assert_equal('columnar Web Page', vDash.type)
27
+ assert(!vDash.dashnode.nil?, "Doc Dashboard dashboard node should not be null")
28
+ assert(!vDash.winnode.nil?, "Doc Dashboard window node should not be null")
29
+ assert(!vDash.dashnode.at_xpath('.//zone[@type="web"]').nil?, " <dashboard Web zone must not be null")
30
+ assert(!vDash.winnode.at_xpath('.//zone[@type="web"]').nil?, " <window Web zone must not be null")
31
+ end
32
+
33
+ def test_assignname
34
+ vDash = Twb::DocDashboardWebVert.new
35
+ vDash.title=('test title name')
36
+ assert_equal('test title name', vDash.title)
37
+ assert(!vDash.dashnode.attribute('name').nil?)
38
+ assert(!vDash.winnode.attribute('name').nil?)
39
+ assert_equal('test title name', vDash.dashnode.attribute('name').value)
40
+ assert_equal('test title name', vDash.winnode.attribute('name').value)
41
+ end
42
+
43
+ def test_assigurl
44
+ vDash = Twb::DocDashboardWebVert.new
45
+ vDash.url=('test URL')
46
+ assert_equal('test URL', vDash.url)
47
+ end
48
+
49
+ def test_inject
50
+ vDash = Twb::DocDashboardWebVert.new
51
+ vDash.title=('Injected Documentation Dashboard')
52
+ vDash.url=('http://en.wikipedia.org')
53
+ do_injection(vDash, 'No Content.twb')
54
+ vDash.title=('Collapsible List of Workook Contents')
55
+ vDash.url=('file:///C:/tech/misc/expandable_tree_view/TableauDocInlineCSS.html')
56
+ do_injection(vDash, 'No Dashboards.twb')
57
+ do_injection(vDash, 'Web Page Dashboards.twb')
58
+ end
59
+
60
+ def do_injection(dash, twbName)
61
+ twb = Twb::Workbook.new(twbName)
62
+ assert(!twb.nil?)
63
+ twb.addDocDashboard dash
64
+ twb.writeAppend('injected')
65
+ end
66
+
67
+ end
@@ -0,0 +1,55 @@
1
+ # Copyright (C) 2014, 2015 Chris Gerrard
2
+ #
3
+ # This program is free software: you can redistribute it and/or modify
4
+ # it under the terms of the GNU General Public License as published by
5
+ # the Free Software Foundation, either version 3 of the License, or
6
+ # (at your option) any later version.
7
+ #
8
+ # This program is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
+ # GNU General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU General Public License
14
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
15
+
16
+ require 'C:\tech\Tableau\tools\Ruby\gems\twb\lib\twb.rb'
17
+ require "test/unit"
18
+
19
+ system "cls"
20
+
21
+ class TestDotFileRenderer < Test::Unit::TestCase
22
+
23
+ @@testDotFile = 'TwoSheetDash.twb.dot'
24
+
25
+ def test_createClass
26
+ renderer = Twb::Util::DotFileRenderer.new
27
+ assert(!renderer.nil?)
28
+ end
29
+
30
+ def test_render
31
+ renderer = Twb::Util::DotFileRenderer.new
32
+ renderedFiles = renderer.renderAll(@@testDotFile)
33
+ assert_equal(renderedFiles.length, 3)
34
+ assert(renderedFiles.include?('TwoSheetDash.twb.dot' + '.pdf'), 'Expected Rendered file name not found' )
35
+ assert(renderedFiles.include?('TwoSheetDash.twb.dot' + '.png'), 'Expected Rendered file name not found' )
36
+ assert(renderedFiles.include?('TwoSheetDash.twb.dot' + '.svg'), 'Expected Rendered file name not found' )
37
+ end
38
+
39
+ def test_SpecifyType
40
+ renderer = Twb::Util::DotFileRenderer.new
41
+ renderedFile = renderer.render(@@testDotFile,'pdf')
42
+ assert(!renderedFile.nil?)
43
+ renderedFile = renderer.render(@@testDotFile,'png')
44
+ assert(!renderedFile.nil?)
45
+ renderedFile = renderer.render(@@testDotFile,'PnG') # should convert to 'png'
46
+ assert(!renderedFile.nil?)
47
+ renderedFile = renderer.render(@@testDotFile,'PNG') # should convert to 'png'
48
+ assert(!renderedFile.nil?)
49
+ renderedFile = renderer.render(@@testDotFile,'svg')
50
+ assert(!renderedFile.nil?)
51
+ renderedFile = renderer.render(@@testDotFile,'xyz') # should fail
52
+ assert(renderedFile.nil?)
53
+ end
54
+
55
+ end
@@ -0,0 +1,44 @@
1
+ # Copyright (C) 2014, 2015 Chris Gerrard
2
+ #
3
+ # This program is free software: you can redistribute it and/or modify
4
+ # it under the terms of the GNU General Public License as published by
5
+ # the Free Software Foundation, either version 3 of the License, or
6
+ # (at your option) any later version.
7
+ #
8
+ # This program is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
+ # GNU General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU General Public License
14
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
15
+
16
+ require 'C:\tech\Tableau\tools\Ruby\gems\twb\lib\twb.rb'
17
+ require "test/unit"
18
+
19
+ system "cls"
20
+
21
+ class TestTwbDashSheetDataDotBuilder < Test::Unit::TestCase
22
+
23
+ def test_createFromClass
24
+ #puts "\n\n\n == TwoSheetDash.twb"
25
+ twb = Twb::Workbook.new('TwoSheetDash.twb')
26
+ dotBuilder = Twb::Util::TwbDashSheetDataDotBuilder.new(twb)
27
+ assert_equal(dotBuilder.workbook.name, 'TwoSheetDash.twb')
28
+ assert(dotBuilder.instance_of?(Twb::Util::TwbDashSheetDataDotBuilder))
29
+ end
30
+
31
+ def test_createFromFileName
32
+ #puts "\n\n\n == TwoSheetDash.twb"
33
+ db = Twb::Util::TwbDashSheetDataDotBuilder.new('TwoSheetDash.twb')
34
+ assert_equal(db.workbook.name, 'TwoSheetDash.twb')
35
+ assert(db.instance_of?(Twb::Util::TwbDashSheetDataDotBuilder))
36
+ assert_equal(db.dotFileName, 'TwoSheetDash.twb.dot')
37
+ assert_equal(db.dashCount, 1 )
38
+ assert_equal(db.sheetCount, 2 )
39
+ assert_equal(db.dataSourceCount, 2 )
40
+ assert(!File.open('TwoSheetDash.twb.dot').nil?) # DOT file exists
41
+ end
42
+
43
+
44
+ end
data/twb-0.1.1.gem ADDED
Binary file
data/twb-0.2.0.gem ADDED
Binary file
data/twb-0.2.1.gem ADDED
Binary file
data/twb-0.2.2.gem ADDED
Binary file
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.1.1
4
+ version: 0.3.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -25,6 +25,8 @@ files:
25
25
  - lib/twb/dashboard.txt
26
26
  - lib/twb/datasource.rb
27
27
  - lib/twb/docdashboard.rb
28
+ - lib/twb/docdashboardimagevert.rb
29
+ - lib/twb/docdashboardwebvert.rb
28
30
  - lib/twb/field.rb
29
31
  - lib/twb/fieldcalculation.rb
30
32
  - lib/twb/hashtohtml.rb
@@ -34,8 +36,11 @@ files:
34
36
  - lib/twb/storyboard.rb
35
37
  - lib/twb/there.rb
36
38
  - lib/twb/TwbTest.rb
39
+ - lib/twb/util/dotFileRenderer.rb
37
40
  - lib/twb/util/hashtohtml.rb
38
41
  - lib/twb/util/htmllistcollapsible.rb
42
+ - lib/twb/util/twbDashSheetDataDotBuilder.rb
43
+ - lib/twb/util/twbDashSheetDataDotRenderer.rb
39
44
  - lib/twb/util/UpLeftArrowsNav.png
40
45
  - lib/twb/util/xraydashboards.rb
41
46
  - lib/twb/window.rb
@@ -45,16 +50,34 @@ files:
45
50
  - LICENSE.txt
46
51
  - README.md
47
52
  - test/Calculated Fields Test Workbook.twb
53
+ - test/dotRender.cmd
54
+ - test/No Content.injected.twb
55
+ - test/No Content.injectedImage.twb
48
56
  - test/No Content.twb
57
+ - test/No Dashboards.injected.twb
58
+ - test/No Dashboards.injectedImage.twb
49
59
  - test/No Dashboards.twb
50
60
  - test/testDashboardXRay.rb
51
61
  - test/testDocDashboard.rb
52
62
  - test/testDocDashboardCreate.rb
63
+ - test/testDocDashboardImageVert.rb
64
+ - test/testDocDashboardWebVert.rb
65
+ - test/testDotFileRenderer.rb
53
66
  - test/testFieldCalculation.rb
54
67
  - test/testHTMLList.rb
68
+ - test/testTwbDashSheetDataDotBuilder.rb
55
69
  - test/testTwbGem.rb
56
70
  - test/testTwbWrite.rb
71
+ - test/TwoSheetDash.test.dot.pdf
72
+ - test/TwoSheetDash.test.dot.png
73
+ - test/TwoSheetDash.test.dot.svg
74
+ - test/TwoSheetDash.twb
75
+ - test/TwoSheetDash.twb.dot
76
+ - test/TwoSheetDash.twb.dot.pdf
77
+ - test/TwoSheetDash.twb.dot.png
78
+ - test/TwoSheetDash.twb.dot.svg
57
79
  - test/UpLeftArrowsNav.png
80
+ - test/Web Page Dashboards.injected.twb
58
81
  - test/Web Page Dashboards.twb
59
82
  - Twb Gem.komodoproject
60
83
  - twb-0.0.32.gem
@@ -65,6 +88,11 @@ files:
65
88
  - twb-0.0.37.gem
66
89
  - twb-0.0.38.gem
67
90
  - twb-0.1.0.gem
91
+ - twb-0.1.1.gem
92
+ - twb-0.2.0.gem
93
+ - twb-0.2.1.gem
94
+ - twb-0.2.2.gem
95
+ - twb-0.3.0.gem
68
96
  - twb.gemspec
69
97
  homepage: http://rubygems.org/gems/twb
70
98
  licenses: