rwdhypernote 0.06 → 0.07

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.
Files changed (58) hide show
  1. data/code/01rwdcore/01rwdcore.rb +15 -13
  2. data/code/01rwdcore/jumplinkcommand.rb +26 -0
  3. data/code/01rwdcore/openhelpwindow.rb +26 -26
  4. data/code/01rwdcore/returntomain.rb +8 -8
  5. data/code/01rwdcore/rundocuments.rb +10 -0
  6. data/code/01rwdcore/runeditconfiguration.rb +10 -0
  7. data/code/01rwdcore/runhelpabout.rb +10 -0
  8. data/code/01rwdcore/rwdtinkerversion.rb +12 -13
  9. data/code/01rwdcore/rwdwindowreturn.rb +3 -5
  10. data/code/01rwdcore/selectiontab.rb +9 -0
  11. data/code/01rwdcore/test_cases.rb +109 -0
  12. data/code/01rwdcore/test_harness.rb +13 -0
  13. data/code/01rwdcore/uploadreturns.rb +60 -60
  14. data/code/superant.com.rwdtinkerbackwindow/controlclient.rb +89 -92
  15. data/code/superant.com.rwdtinkerbackwindow/diagnostictab.rb +15 -21
  16. data/code/superant.com.rwdtinkerbackwindow/installapplet.rb +19 -18
  17. data/code/superant.com.rwdtinkerbackwindow/installgemapplet.rb +20 -19
  18. data/code/superant.com.rwdtinkerbackwindow/installremotegem.rb +19 -18
  19. data/code/superant.com.rwdtinkerbackwindow/listgemdirs.rb +7 -7
  20. data/code/superant.com.rwdtinkerbackwindow/listgemzips.rb +48 -49
  21. data/code/superant.com.rwdtinkerbackwindow/listinstalledfiles.rb +8 -7
  22. data/code/superant.com.rwdtinkerbackwindow/listzips.rb +22 -26
  23. data/code/superant.com.rwdtinkerbackwindow/loadconfigurationrecord.rb +32 -31
  24. data/code/superant.com.rwdtinkerbackwindow/loadconfigurationvariables.rb +14 -13
  25. data/code/superant.com.rwdtinkerbackwindow/network.rb +82 -82
  26. data/code/superant.com.rwdtinkerbackwindow/openappletname.rb +18 -17
  27. data/code/superant.com.rwdtinkerbackwindow/openhelpwindowtinkerwin2.rb +37 -37
  28. data/code/superant.com.rwdtinkerbackwindow/remotegemlist.rb +20 -20
  29. data/code/superant.com.rwdtinkerbackwindow/removeapplet.rb +33 -32
  30. data/code/superant.com.rwdtinkerbackwindow/runremoteinstall.rb +11 -0
  31. data/code/superant.com.rwdtinkerbackwindow/runrwdtinkerbackwindow.rb +8 -9
  32. data/code/superant.com.rwdtinkerbackwindow/rwdtinkerwin2version.rb +10 -11
  33. data/code/superant.com.rwdtinkerbackwindow/saveconfigurationrecord.rb +19 -18
  34. data/code/superant.com.rwdtinkerbackwindow/viewappletcontents.rb +21 -20
  35. data/code/superant.com.rwdtinkerbackwindow/viewgemappletcontents.rb +23 -20
  36. data/configuration/language.dist +1 -1
  37. data/configuration/rwdapplicationidentity.dist +2 -2
  38. data/configuration/rwdhypernote.dist +2 -2
  39. data/configuration/rwdtinker.dist +3 -3
  40. data/configuration/tinkerwin2variables.dist +1 -1
  41. data/gui/00coreguibegin/applicationguitop.rwd +1 -1
  42. data/gui/frontwindowselectionbegin/selectiontabbegin/selectiontabbegin.rwd +2 -7
  43. data/gui/frontwindowselections/superant.com.rwdtinkerwin2selectiontab/jumplinkcommands.rwd +15 -0
  44. data/gui/helpaboutinstalled/superant.com.tinkerhelpabout/3copyright.rwd +1 -1
  45. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/81jumplinkcommands.rwd +17 -0
  46. data/init.rb +231 -228
  47. data/rwd_files/HowTo_HyperNote.txt +6 -0
  48. data/rwd_files/HowTo_Tinker.txt +16 -0
  49. data/rwdconfig.dist +8 -2
  50. data/tests/makedist.rb +37 -8
  51. metadata +14 -12
  52. data/gui/frontwindowselections/superant.com.rwdtinkerwin2selectiontab/rwdwin2selectiontab.rwd +0 -12
  53. data/gui/helpaboutinstalled/superant.com.rwdwin2helpabout/1appname.rwd +0 -4
  54. data/gui/helpaboutinstalled/superant.com.rwdwin2helpabout/3copyright.rwd +0 -3
  55. data/gui/helpaboutinstalled/superant.com.rwdwin2helpabout/5version.rwd +0 -10
  56. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/80tab1.rwd +0 -11
  57. data/tests/rwdtinkertestEN.rb +0 -163
  58. data/tests/test.result +0 -32
@@ -3,18 +3,20 @@
3
3
  # http://www.erikveen.dds.nl/rubywebdialogs/index.html
4
4
  # For more information about RwdTinker see http://www.rubyforge.net/projects/rwdapplications
5
5
  # This class is the top class for the RwdTinker application
6
-
6
+
7
7
  class RwdTinker < RWDialog
8
-
9
- def main
10
- @rwd_window = "main"
11
- @result = "idle"
12
- @display= "idle"
13
8
 
14
-
15
- end
16
-
17
- def inspect
18
- "Rwdtinker Application "
19
- end
20
-
9
+ def main
10
+ @rwd_window = "main"
11
+ @result = "idle"
12
+ @display= "idle"
13
+ if TestNow
14
+
15
+ rwdtest_harness
16
+ end
17
+ end
18
+
19
+ def inspect
20
+ "#{$rwdapplicationidentity}"
21
+ end
22
+
@@ -0,0 +1,26 @@
1
+ # Bind message passing socket to rwdtinker application
2
+ JumpLink = Hash.new { |hh, kk| hh[kk] = "ERROR: link not found: #{kk.inspect}."; hh[kk] }
3
+ locationlink = {
4
+ :helpscreen=> "runhelpwindow",
5
+ :tinkerbackwindow=>"runrwdtinkerbackwindow",
6
+ :returntomain=>"returntomain",
7
+ :opendocuments=>"runtinkerdocuments",
8
+ :editconfiguration=>"runeditconfiguration"
9
+ }
10
+ locationlink.each { |kk, vv| JumpLink[kk] = vv }
11
+
12
+ def runjumplinkcommand
13
+
14
+ runjumplocation = "#{JumpLink[:"#{@a_jumplinkinput}"]}"
15
+
16
+ self.send(runjumplocation)
17
+
18
+ end
19
+
20
+
21
+ # list the remote control options on the screen
22
+ def showjumplinkoptions
23
+
24
+ @jumplinkoptions = $rwdjumplink.rwd_options
25
+
26
+ end
@@ -1,31 +1,31 @@
1
1
  # this code is to call the help window
2
2
  def runhelpwindow
3
- $helptopicsarray = $helptopicsarray | ["applet_installation","applet_viewing","applet_tinkerbackeditconfiguration","remote_control"]
4
-
5
- if @rwd_window == "main"
6
- if @rwd_tab == "documentsrwdtinkerone"
7
- $help_topic = "documents_rwdtinker"
8
- end
9
-
10
- end
11
-
12
- if @rwd_window == "rwdtinkerhelpwindow"
13
- puts "in help window processing"
14
- else
15
- $previouswindow = @rwd_window
16
- $previoustab = @rwd_tab
17
- end
18
-
19
-
20
- @rwdhelptopic = $help_topic
21
- @rwdhelpdataoutput = "#{Helptext[:"#{$help_topic}"]}"
22
- @rwdhelpsubchoicesoutput = $helptopicsarray.rwd_method("choosenewhelptopic")
23
- @rwd_window = "rwdtinkerhelpwindow"
3
+ $helptopicsarray = $helptopicsarray | ["applet_installation","applet_viewing","applet_tinkerbackeditconfiguration","remote_control"]
4
+
5
+ if @rwd_window == "main"
6
+ if @rwd_tab == "documentsrwdtinkerone"
7
+ $help_topic = "documents_rwdtinker"
8
+ end
9
+
10
+ end
11
+
12
+ if @rwd_window == "rwdtinkerhelpwindow"
13
+ puts "in help window processing"
14
+ else
15
+ $previouswindow = @rwd_window
16
+ $previoustab = @rwd_tab
17
+ end
18
+
19
+
20
+ @rwdhelptopic = $help_topic
21
+ @rwdhelpdataoutput = "#{Helptext[:"#{$help_topic}"]}"
22
+ @rwdhelpsubchoicesoutput = $helptopicsarray.rwd_method("choosenewhelptopic")
23
+ @rwd_window = "rwdtinkerhelpwindow"
24
24
  end
25
-
26
- def choosenewhelptopic(inffile)
27
- $help_topic = inffile
28
- runhelpwindow
29
- end
25
+
26
+ def choosenewhelptopic(inffile)
27
+ $help_topic = inffile
28
+ runhelpwindow
29
+ end
30
30
 
31
31
 
@@ -1,10 +1,10 @@
1
1
  # Application RwdAddresses orginally (c) 2004 Steven Gibson under GPL.
2
2
  #
3
- # For more information about see http://www.rubyforge.net/projects/rwdapplications
4
-
5
- # call the window
6
- def returntomain
7
- @rwd_window = "main"
8
- @rwd_tab = "selectiontab"
9
- end
10
-
3
+ # For information see http://www.rubyforge.net/projects/rwdapplications
4
+
5
+ # call the window
6
+ def returntomain
7
+ @rwd_window = "main"
8
+ @rwd_tab = "selectiontab"
9
+ end
10
+
@@ -0,0 +1,10 @@
1
+ # Application menu orginally (c) 2004 Steven Gibson under GPL.
2
+ #
3
+ # For more information about see http://www.rubyforge.net/projects/rwdapplications
4
+
5
+ # call the window
6
+ def runtinkerdocuments
7
+ @rwd_window = "main"
8
+ @rwd_tab = "documentsrwdtinkerone"
9
+ end
10
+
@@ -0,0 +1,10 @@
1
+ # Application menu orginally (c) 2004 Steven Gibson under GPL.
2
+ #
3
+ # For more information about see http://www.rubyforge.net/projects/rwdapplications
4
+
5
+ # call the window
6
+ def runeditconfiguration
7
+ @rwd_window = "tinkerbackwindow"
8
+ @rwd_tab = "editconfigurationfile"
9
+ end
10
+
@@ -0,0 +1,10 @@
1
+ # Application menu orginally (c) 2004 Steven Gibson under GPL.
2
+ #
3
+ # For more information about see http://www.rubyforge.net/projects/rwdapplications
4
+
5
+ # call the window
6
+ def runtinkerhelpabout
7
+ @rwd_window = "rwdtinkerhelpwindow"
8
+
9
+ end
10
+
@@ -1,15 +1,14 @@
1
1
  # Application RwdTinker orginally (c) 2004 Steven Gibson under GPL.
2
2
  # This application is a framework for writing programs from RubyWebDialogs
3
- # http://www.erikveen.dds.nl/rubywebdialogs/index.html
4
- # For more information about RwdTinker see http://www.rubyforge.net/projects/rwdapplications
5
-
6
- # return the version constant defined in the config file
7
- def runrwdtinkerversion
8
- @rwd_window = "applicationversion"
9
- @versionappnamedisplay = "RwdTinker"
10
- @versioncopyrightdisplay = "(c) 2004 Steven Gibson "
11
- @versionnumberdisplay = "Version " + RwdTinkerVersion
12
-
13
- end
14
-
15
-
3
+ # For information see http://www.rubyforge.net/projects/rwdapplications
4
+
5
+ # return the version constant defined in the config file
6
+ def runrwdtinkerversion
7
+ @rwd_window = "applicationversion"
8
+ @versionappnamedisplay = "RwdTinker"
9
+ @versioncopyrightdisplay = "(c) 2004 Steven Gibson "
10
+ @versionnumberdisplay = "Version " + RwdTinkerVersion
11
+
12
+ end
13
+
14
+
@@ -1,11 +1,9 @@
1
1
  # this code is to return to the window back from the help window
2
2
  def rwdwindowreturn
3
-
4
3
 
5
- @rwd_window = "#{$previouswindow}"
6
- @rwd_tab = "#{$previoustab}"
7
- end
8
-
4
+ @rwd_window = "#{$previouswindow}"
5
+ @rwd_tab = "#{$previoustab}"
6
+ end
9
7
 
10
8
 
11
9
 
@@ -0,0 +1,9 @@
1
+ # this code is to return to the window back from the help window
2
+ def runselectiontab
3
+
4
+
5
+ @rwd_tab = "selectiontab"
6
+ end
7
+
8
+
9
+
@@ -0,0 +1,109 @@
1
+ # test harness
2
+
3
+
4
+ require 'test/unit/testcase'
5
+ require 'test/unit/assertions'
6
+ include Test::Unit::Assertions
7
+ include Test::Unit
8
+ def rwdtinker_all_tests
9
+ print "in rwdtinker all tests\n"
10
+ $testrwdtinkertestcase = TestSuite.new
11
+ test_runrwdtinkerbackwindow
12
+ end
13
+
14
+ def test_runrwdtinkerbackwindow
15
+
16
+
17
+ begin
18
+ testasserts = 0
19
+ print "Starting rwdtinker tests!\n"
20
+ runrwdtinkerbackwindow
21
+
22
+ assert_equal("tinkerbackwindow",@rwd_window) ; testasserts += 1
23
+ runselectiontab
24
+ assert_equal("selectiontab",@rwd_tab) ; testasserts += 1
25
+ showjumplinkoptions
26
+ @a_jumplinkinput = "returntomain"
27
+ runjumplinkcommand
28
+ assert_equal("main",@rwd_window) ; testasserts += 1
29
+ @a_jumplinkinput = "helpscreen"
30
+ runjumplinkcommand
31
+
32
+ assert_equal("rwdtinkerhelpwindow",@rwd_window) ; testasserts += 1
33
+ returntomain
34
+ assert_equal("main",@rwd_window) ; testasserts += 1
35
+ runtinkerdocuments
36
+ assert_equal("documentsrwdtinkerone",@rwd_tab) ; testasserts += 1
37
+ runrwdtinkerbackwindow
38
+
39
+ assert_equal("tinkerbackwindow",@rwd_window) ; testasserts += 1
40
+ @a_installapplet="/usr/src/rwdapplets/rwdtinker/zips/rwdahelloworld-0.5"
41
+ viewgemappletcontents
42
+ assert_not_nil(@appletcontentstext) ; testasserts += 1
43
+ runrwdtinkerwin2version
44
+ assert_equal("applicationversion",@rwd_window) ; testasserts += 1
45
+ returntomain
46
+ assert_equal("main",@rwd_window) ; testasserts += 1
47
+ runrwdtinkerbackwindow
48
+
49
+ assert_equal("tinkerbackwindow",@rwd_window) ; testasserts += 1
50
+ runremotezipsinstall
51
+ assert_equal("superantcomremotezipsinstall",@rwd_tab) ; testasserts += 1
52
+ runeditconfiguration
53
+ assert_equal("editconfigurationfile",@rwd_tab) ; testasserts += 1
54
+
55
+
56
+ $stderr.print "tests completed succesfully!\n"
57
+ $stderr.print testasserts, " asserts performed\n"
58
+
59
+ rescue NotImplementedError, Exception
60
+ $stderr.print $!
61
+
62
+ end
63
+
64
+ end
65
+
66
+
67
+
68
+ def teststobedown
69
+ runtinkerhelpabout
70
+ assert_equal("rwdtinkerhelpwindow",@rwd_tab) ; testasserts += 1
71
+ raise NotImplementedError, 'Need to write test_choosenewhelptopic'
72
+ raise NotImplementedError, 'Need to write test_listinstalledfiles'
73
+ raise NotImplementedError, 'Need to write test_listzipfilestoinstall'
74
+ raise NotImplementedError, 'Need to write test_loadconfigurationrecord'
75
+ raise NotImplementedError, 'Need to write test_loadconfigurationvariables'
76
+
77
+ raise NotImplementedError, 'Need to write test_main'
78
+
79
+ raise NotImplementedError, 'Need to write test_network_demon'
80
+
81
+ raise NotImplementedError, 'Need to write test_network_start'
82
+
83
+ raise NotImplementedError, 'Need to write test_openappletname'
84
+
85
+ raise NotImplementedError, 'Need to write test_removeapplet'
86
+
87
+ raise NotImplementedError, 'Need to write test_returntomain'
88
+
89
+ raise NotImplementedError, 'Need to write test_runcontrolcommand'
90
+
91
+ raise NotImplementedError, 'Need to write test_runhelpwindow'
92
+
93
+ raise NotImplementedError, 'Need to write test_runrwdtinkerversion'
94
+
95
+ raise NotImplementedError, 'Need to write test_runrwdtinkerwin2version'
96
+
97
+ raise NotImplementedError, 'Need to write test_runviewplatform'
98
+
99
+ raise NotImplementedError, 'Need to write test_rwdtinkerversiondiagnostic'
100
+
101
+ raise NotImplementedError, 'Need to write test_rwdwindowreturn'
102
+ raise NotImplementedError, 'Need to write test_saveconfigurationrecord'
103
+
104
+ raise NotImplementedError, 'Need to write test_viewappletcontents'
105
+ end
106
+
107
+
108
+
109
+
@@ -0,0 +1,13 @@
1
+ # this to start the test harness
2
+ def rwdtest_harness
3
+
4
+ print "in test harness\n"
5
+
6
+ $testharnessarray.each { |x|
7
+ print "calling #{x}\n"
8
+ eval("#{x}")
9
+
10
+ }
11
+
12
+ end
13
+
@@ -1,62 +1,62 @@
1
1
  def uploadreturnsfile
2
- require 'net/ftp'
3
- BasicSocket.do_not_reverse_lookup = true
4
- @returnsftpdisplays = ""
5
- randomnumber = rand(9999) + 1000
6
- puts randomnumber.to_i
7
-
8
-
9
- returns_ftpsite = "ftp.superant.com"
10
- returns_ftplogin = "anonymous@superant.com"
11
- returns_ftppassword = "anonymous@superant.com"
12
- returns_ftpdirectory = "/incoming/returns/"
13
-
14
- begin
15
- platformdisplay = "Platform is " + RUBY_PLATFORM + "\n"
16
- platformdisplay = platformdisplay + "Ruby Version " + VERSION + "\n"
17
- platformdisplay = platformdisplay + "rwdtinker version " + RwdTinkerVersion + "\n"
18
- platformdisplay = platformdisplay + "application name " + $rwdapplicationidentity + "\n"
19
- platformdisplay = platformdisplay + "program directory " + $progdir + "\n"
20
- platformdisplay = platformdisplay + "hostname " + Resolv.getname(Resolv.getaddress("localhost")) + "\n"
21
- platformdisplay = platformdisplay + "Date " + Date.today().to_s + "\n"
22
- if ! @a_emailupload.empty?
23
- platformdisplay = platformdisplay + @a_emailupload + "\n"
24
- end
25
- if ! @a_emailupload.empty?
26
- platformdisplay = platformdisplay + @a_commentupload + "\n"
27
- end
28
- updatefile = Date.today().to_s + Resolv.getname(Resolv.getaddress("localhost")) + randomnumber.to_s
29
-
30
- tmpdir = ENV['TMP']
31
- if tmpdir.to_s.empty?
32
- tmpdir = "/tmp"
33
- end
34
- fileName = File.join( tmpdir, updatefile)
35
- fd = File.open(fileName,"w")
36
- fd.print(platformdisplay) # save the record info to the file
37
- fd.close
38
- ftp = Net::FTP::new(returns_ftpsite)
39
- @returnsftpdisplay = "data uploaded" + "\n"
40
-
41
- filedirname = File.join(tmpdir,updatefile)
42
-
43
- ftp.debug_mode = false
44
- ftp.login(returns_ftplogin, returns_ftppassword)
45
- ftp.chdir(returns_ftpdirectory)
46
- print "I'm in the directory ", ftp.pwd(), "\n"
47
-
48
- puts filedirname
49
- ftp.puttextfile(filedirname , updatefile)
50
- @returnsftpdisplay = @returnsftpdisplay + platformdisplay
51
-
52
-
53
- ftp.close
54
-
55
- rescue
56
- @returnsftpdisplay = "upload error"
57
- if ftp
58
- ftp.close
59
- end
60
- print "ftp error"
61
- end
2
+ require 'net/ftp'
3
+ BasicSocket.do_not_reverse_lookup = true
4
+ @returnsftpdisplays = ""
5
+ randomnumber = rand(9999) + 1000
6
+ puts randomnumber.to_i
7
+
8
+
9
+ returns_ftpsite = "ftp.superant.com"
10
+ returns_ftplogin = "anonymous@superant.com"
11
+ returns_ftppassword = "anonymous@superant.com"
12
+ returns_ftpdirectory = "/incoming/returns/"
13
+
14
+ begin
15
+ platformdisplay = "Platform is " + RUBY_PLATFORM + "\n"
16
+ platformdisplay = platformdisplay + "Ruby Version " + VERSION + "\n"
17
+ platformdisplay = platformdisplay + "rwdtinker version " + RwdTinkerVersion + "\n"
18
+ platformdisplay = platformdisplay + "application name " + $rwdapplicationidentity + "\n"
19
+ platformdisplay = platformdisplay + "program directory " + $progdir + "\n"
20
+ platformdisplay = platformdisplay + "hostname " + Resolv.getname(Resolv.getaddress("localhost")) + "\n"
21
+ platformdisplay = platformdisplay + "Date " + Date.today().to_s + "\n"
22
+ if ! @a_emailupload.empty?
23
+ platformdisplay = platformdisplay + @a_emailupload + "\n"
24
+ end
25
+ if ! @a_emailupload.empty?
26
+ platformdisplay = platformdisplay + @a_commentupload + "\n"
27
+ end
28
+ updatefile = Date.today().to_s + Resolv.getname(Resolv.getaddress("localhost")) + randomnumber.to_s
29
+
30
+ tmpdir = ENV['TMP']
31
+ if tmpdir.to_s.empty?
32
+ tmpdir = "/tmp"
33
+ end
34
+ fileName = File.join( tmpdir, updatefile)
35
+ fd = File.open(fileName,"w")
36
+ fd.print(platformdisplay) # save the record info to the file
37
+ fd.close
38
+ ftp = Net::FTP::new(returns_ftpsite)
39
+ @returnsftpdisplay = "data uploaded" + "\n"
40
+
41
+ filedirname = File.join(tmpdir,updatefile)
42
+
43
+ ftp.debug_mode = false
44
+ ftp.login(returns_ftplogin, returns_ftppassword)
45
+ ftp.chdir(returns_ftpdirectory)
46
+ print "I'm in the directory ", ftp.pwd(), "\n"
47
+
48
+ puts filedirname
49
+ ftp.puttextfile(filedirname , updatefile)
50
+ @returnsftpdisplay = @returnsftpdisplay + platformdisplay
51
+
52
+
53
+ ftp.close
54
+
55
+ rescue
56
+ @returnsftpdisplay = "upload error"
57
+ if ftp
58
+ ftp.close
59
+ end
60
+ print "ftp error"
61
+ end
62
62
  end