rwddemo 0.8 → 0.90

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 (144) hide show
  1. data/Readme.txt +46 -0
  2. data/code/{ag1core/aa0begin.rb → 01rwdcore/01rwdcore.rb} +2 -0
  3. data/code/01rwdcore/02helptexthashbegin.rb +4 -0
  4. data/code/01rwdcore/03helptexthash.rb +31 -0
  5. data/code/01rwdcore/04helptextend.rb +6 -0
  6. data/code/01rwdcore/openhelpwindow.rb +31 -0
  7. data/code/01rwdcore/returntomain.rb +10 -0
  8. data/code/{ag1core → 01rwdcore}/rwdtinkerversion.rb +0 -0
  9. data/code/01rwdcore/rwdwindowreturn.rb +11 -0
  10. data/code/{dd0shelleval → rwdcalc}/changescriptname.rb +0 -0
  11. data/code/rwdcalc/clearscriptscreendisplay.rb +9 -0
  12. data/code/rwdcalc/deletescriptrecord.rb +20 -0
  13. data/code/rwdcalc/helptexthashrwdcalc.rb +14 -0
  14. data/code/rwdcalc/listscripts.rb +13 -0
  15. data/code/rwdcalc/loadscriptrecord.rb +20 -0
  16. data/code/rwdcalc/mathcommands.rb +53 -0
  17. data/code/rwdcalc/openhelpwindowrwdcalc.rb +21 -0
  18. data/code/rwdcalc/playscript.rb +22 -0
  19. data/code/rwdcalc/renamecalcrecord.rb +14 -0
  20. data/code/rwdcalc/runrwdcalcwindow.rb +1 -0
  21. data/code/rwdcalc/savechangedscript.rb +19 -0
  22. data/code/rwdcalc/viewscript.rb +18 -0
  23. data/code/superant.com.rwdcalendar/gh9calendar.rb +40 -16
  24. data/code/superant.com.rwdshell/changescriptname.rb +16 -0
  25. data/code/{dd0shelleval → superant.com.rwdshell}/clearscriptscreendisplay.rb +0 -0
  26. data/code/{dd0shelleval → superant.com.rwdshell}/deletescriptrecord.rb +0 -0
  27. data/code/superant.com.rwdshell/helptexthashrubyslippers.rb +81 -0
  28. data/code/superant.com.rwdshell/listrubyscripts.rb +13 -0
  29. data/code/{dd0shelleval → superant.com.rwdshell}/listscripts.rb +0 -0
  30. data/code/superant.com.rwdshell/loadconfigurationrecord.rb +33 -0
  31. data/code/superant.com.rwdshell/loadconfigurationvariables.rb +13 -0
  32. data/code/{dd0shelleval → superant.com.rwdshell}/loadscriptrecord.rb +0 -0
  33. data/code/superant.com.rwdshell/openhelpwindowrubyslippers.rb +50 -0
  34. data/code/superant.com.rwdshell/playrubyscript.rb +22 -0
  35. data/code/{dd0shelleval → superant.com.rwdshell}/playscript.rb +0 -0
  36. data/code/superant.com.rwdshell/returntomain.rb +10 -0
  37. data/code/{dd0shelleval → superant.com.rwdshell}/rubyeval.rb +0 -0
  38. data/code/superant.com.rwdshell/runrwdshellbackwindow.rb +10 -0
  39. data/code/superant.com.rwdshell/runrwdshellmenu1.rb +57 -0
  40. data/code/{dd0shelleval → superant.com.rwdshell}/runrwdshellwindow.rb +0 -0
  41. data/code/{dd0shelleval → superant.com.rwdshell}/rwdshellversion.rb +0 -0
  42. data/code/{dd0shelleval → superant.com.rwdshell}/savechangedscript.rb +0 -0
  43. data/code/superant.com.rwdshell/saveconfigurationrecord.rb +18 -0
  44. data/code/{dd0shelleval → superant.com.rwdshell}/shelleval.rb +0 -0
  45. data/code/superant.com.rwdshell/viewrubyscript.rb +18 -0
  46. data/code/{dd0shelleval → superant.com.rwdshell}/viewscript.rb +0 -0
  47. data/code/superant.com.rwdtinkerbackwindow/controlclient.rb +99 -0
  48. data/code/{xb1rwdtinkerbackwindow → superant.com.rwdtinkerbackwindow}/diagnostictab.rb +0 -0
  49. data/code/superant.com.rwdtinkerbackwindow/helptexthashtinkerwin2.rb +58 -0
  50. data/code/{xb1rwdtinkerbackwindow → superant.com.rwdtinkerbackwindow}/installapplet.rb +9 -8
  51. data/code/superant.com.rwdtinkerbackwindow/installgemapplet.rb +20 -0
  52. data/code/superant.com.rwdtinkerbackwindow/installremotegem.rb +19 -0
  53. data/code/superant.com.rwdtinkerbackwindow/listgemdirs.rb +12 -0
  54. data/code/superant.com.rwdtinkerbackwindow/listgemzips.rb +54 -0
  55. data/code/{xb1rwdtinkerbackwindow → superant.com.rwdtinkerbackwindow}/listinstalledfiles.rb +0 -0
  56. data/code/superant.com.rwdtinkerbackwindow/listzips.rb +31 -0
  57. data/code/{xb1rwdtinkerbackwindow → superant.com.rwdtinkerbackwindow}/loadconfigurationrecord.rb +1 -1
  58. data/code/{xb1rwdtinkerbackwindow → superant.com.rwdtinkerbackwindow}/loadconfigurationvariables.rb +1 -1
  59. data/code/superant.com.rwdtinkerbackwindow/network.rb +87 -0
  60. data/code/{xb1rwdtinkerbackwindow → superant.com.rwdtinkerbackwindow}/openappletname.rb +0 -0
  61. data/code/superant.com.rwdtinkerbackwindow/openhelpwindowtinkerwin2.rb +42 -0
  62. data/code/superant.com.rwdtinkerbackwindow/remotegemlist.rb +24 -0
  63. data/code/{xb1rwdtinkerbackwindow → superant.com.rwdtinkerbackwindow}/removeapplet.rb +0 -0
  64. data/code/{xa5rwdtinkercallable/callable.rb → superant.com.rwdtinkerbackwindow/runrwdtinkerbackwindow.rb} +2 -3
  65. data/code/{xb1rwdtinkerbackwindow → superant.com.rwdtinkerbackwindow}/rwdtinkerwin2version.rb +0 -0
  66. data/code/{xb1rwdtinkerbackwindow → superant.com.rwdtinkerbackwindow}/saveconfigurationrecord.rb +1 -1
  67. data/code/superant.com.rwdtinkerbackwindow/viewappletcontents.rb +21 -0
  68. data/code/superant.com.rwdtinkerbackwindow/viewgemappletcontents.rb +21 -0
  69. data/configuration/{rwdplayscripts.cnf → playscripts.cnf} +0 -2
  70. data/configuration/rwdapplicationidentity.cnf +3 -0
  71. data/configuration/rwdcalc.cnf +1 -0
  72. data/configuration/rwdcalendar.cnf +4 -27
  73. data/configuration/rwdcalendarversion.cnf +4 -0
  74. data/configuration/rwdshellversion.cnf +2 -0
  75. data/configuration/rwdtinker.cnf +6 -2
  76. data/configuration/rwdtinkerversion.cnf +1 -1
  77. data/configuration/tinkerwin2variables.cnf +7 -3
  78. data/configuration/tinkerwin2version.cnf +1 -1
  79. data/ev/rwd.rb +4 -3
  80. data/extras/cal.rb +158 -0
  81. data/gui/00coreguibegin/applicationguitop.rwd +1 -1
  82. data/gui/frontwindow0/superant.com.tinkercalendar/hl9calendar.rwd +27 -20
  83. data/gui/frontwindowselectionbegin/selectiontabbegin/selectiontabbegin.rwd +1 -1
  84. data/gui/frontwindowselections/superant.com.rwdshellselectiontab/rwdshellbackwindowselectiontab.rwd +12 -0
  85. data/gui/frontwindowtdocumentbegin/superant.com.documentsbegin/tt0documentbegin.rwd +1 -1
  86. data/gui/frontwindowtdocuments/{ub7rubyeval → superant.com.rubyeval}/rubyeval.rwd +0 -0
  87. data/gui/frontwindowtdocuments/{vv1docshellxp → superant.com.shelldocument}/vvdocshellxp.rwd +0 -0
  88. data/gui/frontwindowtdocuments/uu6rwdcalcdocument/uu5documents.rwd +6 -0
  89. data/gui/frontwindowtdocumentzend/superant.com.documentsend/ww0documentend.rwd +5 -0
  90. data/gui/helpaboutinstalled/{yl4rwdshellhelpabout → superant.com.shellhelpabout}/1appname.rwd +0 -0
  91. data/gui/helpaboutinstalled/{yl2rwddemohelpabout → superant.com.shellhelpabout}/3copyright.rwd +0 -0
  92. data/gui/helpaboutinstalled/{yl4rwdshellhelpabout → superant.com.shellhelpabout}/5version.rwd +0 -0
  93. data/gui/tinkerbackwindows/superant.com.rwdcalc/1appname.rwd +1 -1
  94. data/gui/tinkerbackwindows/superant.com.rwdcalc/{floatrwdcalc.rwd → 20floatrwdcalc.rwd} +0 -0
  95. data/gui/tinkerbackwindows/superant.com.rwdcalc/{intrwdcalc.rwd → 30intrwdcalc.rwd} +0 -0
  96. data/gui/tinkerbackwindows/superant.com.rwdcalc/35mathcommands.rwd +25 -0
  97. data/gui/tinkerbackwindows/superant.com.rwdcalc/44listplayscripts.rwd +19 -0
  98. data/gui/tinkerbackwindows/superant.com.rwdcalc/45listscripts.rwd +25 -0
  99. data/gui/tinkerbackwindows/superant.com.rwdcalc/46editscriptrecord.rwd +30 -0
  100. data/gui/tinkerbackwindows/superant.com.rwdcalc/4scriptutilities.rwd +25 -0
  101. data/gui/tinkerbackwindows/superant.com.rwdcalc/98returntab.rwd +11 -0
  102. data/gui/tinkerbackwindows/superant.com.rwdshellbackwindow/1appname.rwd +5 -0
  103. data/gui/tinkerbackwindows/superant.com.rwdshellbackwindow/44listplayscripts.rwd +19 -0
  104. data/gui/tinkerbackwindows/superant.com.rwdshellbackwindow/45listscripts.rwd +25 -0
  105. data/gui/tinkerbackwindows/superant.com.rwdshellbackwindow/46editscriptrecord.rwd +30 -0
  106. data/gui/tinkerbackwindows/superant.com.rwdshellbackwindow/92viewconfiguration.rwd +38 -0
  107. data/gui/tinkerbackwindows/{superant.com.tinkerbackwindow/3arwddiagnostics.rwd → superant.com.rwdshellbackwindow/94rwddiagnostics.rwd} +0 -0
  108. data/gui/tinkerbackwindows/superant.com.rwdshellbackwindow/v9returntab.rwd +11 -0
  109. data/gui/tinkerbackwindows/superant.com.rwdshellbackwindow/zbackend.rwd +6 -0
  110. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/40rwdlistzips.rwd +42 -0
  111. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/45installremotezip.rwd +44 -0
  112. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/50rwdlistapplets.rwd +1 -1
  113. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/60editconfiguration.rwd +38 -0
  114. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/70rwddiagnostics.rwd +33 -0
  115. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/75rwdcontrol.rwd +33 -0
  116. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/80tab1.rwd +1 -1
  117. data/gui/tinkerbackwindows/superant.com.tinkerhelpwindow/1appname.rwd +31 -0
  118. data/gui/tinkerbackwindows/{superant.com.tinercallablewindow → superant.com.tinkerhelpwindow}/9end.rwd +0 -0
  119. data/init.rb +38 -2
  120. data/lang/en/rwdcalendar/calendar-en.rb +6 -0
  121. data/lang/es/rwdcalendar/calendar-nl.rb +6 -0
  122. data/lang/nl/rwdcalendar/calendar-nl.rb +6 -0
  123. data/lang/templangfile.rb +7 -1
  124. data/lang/xlocallangfile.rb +7 -1
  125. data/rwd_files/HowTo_RwdDemo.txt +20 -82
  126. data/rwd_files/HowTo_Shell.txt +15 -1
  127. data/rwd_files/HowTo_Tinker.txt +63 -6
  128. data/rwddemo-0.90.gem +0 -0
  129. data/scripts/test02.math +2 -0
  130. data/scripts/test02.rb +2 -0
  131. metadata +153 -89
  132. data/code/dd0shelleval/rwddemohelpabout.rb +0 -14
  133. data/code/xb1rwdtinkerbackwindow/listzips.rb +0 -16
  134. data/configuration/rwddemoversion.cnf +0 -2
  135. data/configuration/rwdplayscriptsversion.cnf +0 -2
  136. data/gui/frontwindowtdocuments/uk5rwddemodocuments/documents.rwd +0 -4
  137. data/gui/helpaboutinstalled/yl2rwddemohelpabout/1appname.rwd +0 -4
  138. data/gui/helpaboutinstalled/yl2rwddemohelpabout/5version.rwd +0 -9
  139. data/gui/helpaboutinstalled/yl4rwdshellhelpabout/3copyright.rwd +0 -3
  140. data/gui/tinkerbackwindows/superant.com.tinercallablewindow/1appname.rwd +0 -17
  141. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/40editconfiguration.rwd +0 -36
  142. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/50rwdlistzips.rwd +0 -35
  143. data/installed/rwdshell-0.92.inf +0 -14
  144. data/rwd_files/HowTo_RwdCalc.txt +0 -103
@@ -0,0 +1,50 @@
1
+ # this code is to call the help window
2
+ def runhelpwindowrubyslippers
3
+
4
+ $help_topic = "GemCommands_help"
5
+ if @rwd_tab == "Viewgemdata"
6
+ $help_topic = "rubyslippers_generalhelp"
7
+ end
8
+ if @rwd_tab == "geminstall"
9
+ $help_topic = "Install_Gem"
10
+ end
11
+ if @rwd_tab == "gemcommands"
12
+ $help_topic = "GemCommands_help"
13
+ end
14
+ if @rwd_tab == "gemfilesinstalled"
15
+ $help_topic = "gemfiles_help"
16
+ end
17
+ if @rwd_tab == "gemservescan"
18
+ $help_topic = "gemdocs_help"
19
+ end
20
+ if @rwd_tab == "viewrubyslippersconfiguration"
21
+ $help_topic = "gemconfiguration_help"
22
+ end
23
+
24
+ if @rwd_tab == "Viewgemspecdata"
25
+ $help_topic = "gemspecdata_help"
26
+ end
27
+
28
+ if @rwd_tab == "editgemspecrecordfile"
29
+ $help_topic = "editgemspec_help"
30
+ end
31
+ if @rwd_tab == "gemutilitiesrubyslippers"
32
+ $help_topic = "buildgem_help"
33
+ end
34
+ if @rwd_tab == "viewgemdir"
35
+ $help_topic = "viewgemdir_help"
36
+ end
37
+
38
+ $helptopicsarray = $helptopicsarray | ["rubyslippers_generalhelp", "Install_Gem","GemCommands_help", "gemfilesinstalled","gemdocs_help","gemconfiguration_help","gemspecdata_help","editgemspec_help","buildgem_help","viewgemdir_help"]
39
+ $previouswindow = @rwd_window
40
+ $previoustab = @rwd_tab
41
+
42
+
43
+ if @rwd_window != "rwdtinkerhelpwindow"
44
+ $previouswindow = @rwd_window
45
+ $previoustab = @rwd_tab
46
+ end
47
+ runhelpwindow
48
+ end
49
+
50
+
@@ -0,0 +1,22 @@
1
+ def playrubyscript
2
+
3
+
4
+ nametext = "%s" % [@a_rubyscriptcmd]
5
+
6
+ begin # exception trapped block
7
+ fileName = "scripts/" + nametext + ".rb"
8
+
9
+
10
+ rubyfile_contents = File.read( fileName)
11
+ temp = eval( rubyfile_contents)
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+ rescue SystemCallError, StandardError
20
+ $stderr.print "system call error: " + $!
21
+ end # exception rescue
22
+ end
@@ -0,0 +1,10 @@
1
+ # Application RwdAddresses 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 returntomain
7
+ @rwd_window = "main"
8
+ @rwd_tab = "selectiontab"
9
+ end
10
+
@@ -0,0 +1,10 @@
1
+ # Application RwdAddresses 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 runrwdshellbackwindow
7
+ @rwd_window = "rwdshellbackwindow"
8
+ @rwd_tab = "viewrwdshellconfiguration"
9
+ end
10
+
@@ -0,0 +1,57 @@
1
+ # Application RwdAddresses 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 runrubyslippersmenu1
7
+ @rwd_window = "main"
8
+ @rwd_tab = "gemcommands"
9
+ end
10
+ def runrubyslippersmenu2
11
+ @rwd_window = "main"
12
+ @rwd_tab = "Viewgemdata"
13
+ end
14
+
15
+
16
+ def runrubyslippersmenu3
17
+ @rwd_window = "main"
18
+ @rwd_tab = "geminstall"
19
+ end
20
+
21
+ def runrubyslippersmenu4
22
+ @rwd_window = "main"
23
+ @rwd_tab = "gemfilesinstalled"
24
+ end
25
+ def runrubyslippersmenu5
26
+ @rwd_window = "main"
27
+ @rwd_tab = "gemservescan"
28
+ end
29
+
30
+ def runrubyslippersmenu6
31
+ @rwd_window = "rubyslippersbackwindow"
32
+ @rwd_tab = "Viewgemspecdata"
33
+ end
34
+
35
+ def runrubyslippersmenu7
36
+ @rwd_window = "rubyslippersbackwindow"
37
+ @rwd_tab = "editgemspecrecordfile"
38
+ end
39
+
40
+ def runrubyslippersmenu8
41
+ @rwd_window = "rubyslippersbackwindow"
42
+ @rwd_tab = "gemutilitiesrubyslippers"
43
+ end
44
+ def runrubyslippersmenu9
45
+ @rwd_window = "rubyslippersbackwindow"
46
+ @rwd_tab = "viewgemdir"
47
+ end
48
+
49
+ def runrubyslippersmenu10
50
+ @rwd_window = "rubyslippersbackwindow"
51
+ @rwd_tab = "viewrubyslippersconfiguration"
52
+ end
53
+ def runrubyslippersmenu11
54
+ @rwd_window = "main"
55
+ @rwd_tab = "documentsrwdtinkerone"
56
+ end
57
+
@@ -0,0 +1,18 @@
1
+ # this method adds a new address record
2
+ def saverubyslippersconfiguration
3
+ require 'fileutils'
4
+
5
+ newname = "rubyslippers.cnf" # grab the filename to create
6
+ newdata =@a_rsconfigline1.to_s + "\n" + @a_rsconfigline2.to_s + "\n" + @a_rsconfigline3.to_s + "\n" + @a_rsconfigline4.to_s + "\n" + @a_rsconfigline5.to_s + "\n" + @a_rsconfigline6.to_s + "\n" + @a_rsconfigline7.to_s + "\n" + @a_rsconfigline8.to_s + "\n" + @a_rsconfigline9.to_s + "\n"
7
+
8
+ begin # exception trapped block
9
+ fileName = File.join( ConfigurationDir, newname )
10
+ fd = File.open(fileName,"w")
11
+ fd.print(newdata) # save the record info to the file
12
+ fd.close
13
+ @newconfigurationresult=newdata # show the record info in the browser
14
+ rescue SystemCallError, StandardError
15
+ $stderr.print "system call error: " + $!
16
+ end # exception rescue
17
+
18
+ end
@@ -0,0 +1,18 @@
1
+ def viewrubyscript
2
+ require 'fileutils'
3
+ $currentscriptname = "%s" % [@a_rubyscriptfilename]
4
+
5
+ begin # exception trapped block
6
+ fileName = $shellscript_directory+ "/" + $currentrubyscriptname + ".rb"
7
+
8
+ fd = File.open(fileName,"r")
9
+ @displayrubyscripttext = " "
10
+ while ! fd.eof?
11
+ @displayrubyscripttext = fd.read
12
+ end
13
+ fd.close
14
+ rescue
15
+ @displayrubyscripttext = "\n" + "error"
16
+ end # exception rescue
17
+
18
+ end
@@ -0,0 +1,99 @@
1
+ # Bind message passing socket to rwdtinker application
2
+
3
+ def runcontrolcommand
4
+ require 'socket'
5
+
6
+ # Change this line...
7
+ ip = '127.0.0.1'
8
+ # And this one...
9
+ port = $rwdcontrolport1
10
+ if @a_remoteportinput
11
+ port = @a_remoteportinput.to_i
12
+ end
13
+
14
+ commandtext = @a_remotecommandinput.to_s
15
+ remotehostnotfound = true
16
+ if (commandtext == "stop")
17
+ begin
18
+ client = UDPSocket::new()
19
+ client.send(commandtext, 0, ip, port)
20
+ @socket = UDPSocket::new()
21
+ @socket.bind(ip, port)
22
+ # Rescue the "Address in use" error
23
+ rescue Errno::EADDRINUSE
24
+
25
+ databack, info = client.recv(128)
26
+ @remotecommandresult = databack
27
+ @lastremotecommand = "rwdtinker remote:: Port #{port} on host #{ip} ."
28
+ remotehostnotfound = false
29
+
30
+ # Rescue the "Address not available" error
31
+ rescue Errno::EADDRNOTAVAIL
32
+ puts "Network plugin: Address #{host} is not available to bind."
33
+
34
+ # Rescue "permission denied errors
35
+ rescue Errno::EACCES
36
+ puts "Network plugin: Access denied when binding interface addresses. Did you try to bind a port under 1024 as a regular user?"
37
+
38
+ # Rescue all other errors
39
+ rescue
40
+ puts "Network plugin: An error occured."
41
+
42
+ # Rescue all other errors
43
+ end
44
+ if remotehostnotfound
45
+ @remotecommandresult = "Remote Host not running"
46
+ end
47
+ @socket.close
48
+ # Close the socket after use
49
+ client.close()
50
+ end
51
+
52
+ remotehostnotfound = true
53
+ if (commandtext == "query")
54
+ begin
55
+ client = UDPSocket::new()
56
+ client.send(commandtext, 0, ip, port)
57
+ @socket = UDPSocket::new()
58
+ @socket.bind(ip, port)
59
+ # Rescue the "Address in use" error
60
+ rescue Errno::EADDRINUSE
61
+
62
+ databack, info = client.recv(128)
63
+ @remotecommandresult = databack
64
+ @lastremotecommand = "rwdtinker remote: Port #{port} on host #{ip} "
65
+ remotehostnotfound = false
66
+
67
+ # Rescue the "Address not available' error
68
+ rescue Errno::EADDRNOTAVAIL
69
+ puts "Network plugin: Address #{host} is not available to bind."
70
+
71
+ # Rescue "permission denied errors
72
+ rescue Errno::EACCES
73
+ puts "Network plugin: Access denied when binding interface addresses. Did you try to bind a port under 1024 as a regular user?"
74
+
75
+ # Rescue all other errors
76
+ rescue
77
+ puts "Network plugin: An error occured."
78
+
79
+ # Rescue all other errors
80
+ end
81
+ @socket.close
82
+
83
+ # Close the socket after use
84
+ client.close()
85
+ end
86
+
87
+ if remotehostnotfound
88
+ @remotecommandresult = "Remote Host not running"
89
+ end
90
+ end
91
+
92
+ # list the remote control options on the screen
93
+ def showremoteportoptions
94
+
95
+ @remoteportoptions = $rwdcontrolports.rwd_options
96
+ @remotecommandoptions = ["query","stop"].rwd_options
97
+ end
98
+
99
+
@@ -0,0 +1,58 @@
1
+ # help text files used by context sensitive help
2
+
3
+ Helptext.update( :tinkerwin2_help => " You can view the list of applets you can install
4
+ by clicking on the list files button
5
+
6
+ You can download an applet created by someone else
7
+
8
+ put the file in the zips directory
9
+
10
+ rwdtinker applets packaged as RubyGems can be used if you have RubyGems installed.
11
+ You can download rwdtinker gems at the 'Install Remote Applets' tab
12
+ ",
13
+ :applet_viewing => "You can get a list of all installed applets by clicking the 'listfiles button'
14
+ To see the text of a install file
15
+ Type in the name of the file you want.
16
+
17
+ type it without the inf ending
18
+ rwdapplet-0.1
19
+
20
+ Then click the 'View Installed File' button
21
+
22
+ If it finds the file it will open it. It displays the text the search box.
23
+
24
+ You can uninstall applets on this screen",
25
+
26
+ :applet_installation => " You can download an applet created by someone else\n
27
+ put the file in the zips directory\n
28
+
29
+ click on the 'list zips' tab\n
30
+ click on 'list applets available for installing'\n
31
+
32
+ chose the applet you want\n
33
+ click on 'install applet'\n
34
+ If all goes well the applet should be installed.\n
35
+ You will need to restart rwdtinker to see the new screens",
36
+ :applet_tinkerbackeditconfiguration => " You can edit the configuration
37
+
38
+ Remember to reload the configuration variables if you want your
39
+ changes used.",
40
+ :remotegemapplet_install => " To download and install use the 'Install Remote Applets'
41
+
42
+ First click on 'List applets in the Remote GEM Repository available for downloading'
43
+ then go to the very bottom to click on the applet you want
44
+ then on the top click 'install remote Gem applet package'
45
+
46
+ This installs the package in the Gem system
47
+ You still need to install it into rwdtinker - do that in the 'List Zips' tab
48
+
49
+ For this feature to work, you need
50
+ RubyGems installed
51
+ Variables set correctly in the tinerwin2.cnf file
52
+ $xpcommand, $gemdirectory_withgemfiles and $geminstalled_directory
53
+ the defaults as shipped will normally be for a Debian Linux system
54
+ On Debian Linux, you would usually need to be running rwdtinker as root in order to install RubyGems
55
+
56
+ You can view the list of rwdtinker applets you have installed already by clicking 'view already installed GEM applets'
57
+ "
58
+ )
@@ -1,21 +1,22 @@
1
+ # code in install rwdtinker applets - now uses ruby.zip module
1
2
  def installapplet
2
3
  require 'fileutils'
4
+ require 'extras/zip/zip'
3
5
  nametext = "%s" % [@a_installapplet]
4
6
 
5
7
  begin # exception trapped block
6
8
  fullname = nametext + ".zip"
7
9
  fileName = File.join($zipslocation,fullname)
8
-
9
- commandline = $unzipprogram + fileName
10
- system( commandline+' > temp.output' )
11
-
12
-
13
-
14
- system(commandline)
10
+
11
+ zf = Zip::ZipFile.new(fileName)
12
+ zf.sort.each {
13
+ |entry|
14
+ zf.extract(entry.to_s, entry.to_s)
15
+ }
15
16
  @installapplettext = Message[:applet_installed]
16
17
 
17
18
  rescue
18
- @installapplettext = "Done! - Check applet list - restart rwd to activate the new applet"
19
+ @installapplettext = "unzip error - applet may not be installed correctly"
19
20
  end # exception rescue
20
21
 
21
22
  end
@@ -0,0 +1,20 @@
1
+ # install rwdtinker applet from a long directory location
2
+ def installgemapplet
3
+ require 'fileutils'
4
+ require 'extras/zip/zip'
5
+ nametext = "%s" % [@a_installapplet]
6
+
7
+ begin # exception trapped block
8
+ fullname = nametext + ".zip"
9
+
10
+ zf = Zip::ZipFile.new(fullname)
11
+ zf.sort.each {
12
+ |entry|
13
+ zf.extract(entry.to_s, entry.to_s)
14
+ }
15
+ @installapplettext = Message[:applet_installed]
16
+
17
+ rescue
18
+ @installapplettext = "unzip error - applet may not be installed correctly"
19
+ end # exception rescue
20
+ end
@@ -0,0 +1,19 @@
1
+ # download gem of rwdtinker applet
2
+ def superantcominstallremotegemapplet
3
+ require 'fileutils'
4
+
5
+ tempnametext = "%s" % [@superantcominstallremoteappletinput]
6
+ temparray = tempnametext.split(/ /)
7
+ nametext = temparray[0]
8
+ begin # exception trapped block
9
+
10
+
11
+ commandline = $xpcommand + "gem install " + nametext
12
+
13
+ @superantcominstallremotegemappletresult = `#{commandline}`
14
+
15
+ rescue
16
+ @superantcominstallremotegemappletresult = "error during gem install!"
17
+ end # exception rescue
18
+
19
+ end
@@ -0,0 +1,12 @@
1
+ # this code is to list the gem directories that are installed
2
+ def superantcomshowgemfiledirs
3
+
4
+ fileList = Dir.new($gemdirectory_withgemfiles).entries.sort.delete_if { |x| ! (x =~ /\Arwdzip/) }
5
+ @superantcomshowgemappletdirsresult = fileList.rwd_method("superantcomshowgemappletdirsname")
6
+ end
7
+
8
+ def superantcomshowgemappletdirsname(inffile)
9
+ applet = inffile
10
+ @a_gemfiledirsinput = applet
11
+
12
+ end
@@ -0,0 +1,54 @@
1
+ # this code is to list the zips
2
+
3
+
4
+ def fillzipappletname(inffile)
5
+ applet = inffile.gsub(/\.zip$/, "")
6
+ @a_installapplet = applet
7
+
8
+ end
9
+
10
+ def findzipfiles(d)
11
+ a = Array.new(Dir[d].entries.sort)
12
+ #loop through and get the files names
13
+ a.each do |x|
14
+ #adjust the filters to the files you want to see...
15
+ if(!test(?d,x))
16
+ # only zip files
17
+ if x =~ /\.zip/
18
+ puts "#{x}" #opens the file thats in fileName as read only
19
+ $zipsarray = $zipsarray | ["#{x}"]
20
+ end
21
+ end
22
+ end
23
+ end
24
+
25
+ def listgemzips
26
+ startlangdir = $geminstalled_directory
27
+ #get a list of the files and subdirectories on the starting directory only
28
+ alanghash = Array.new(Dir[startlangdir].entries.sort)
29
+ p alanghash
30
+ #loop through the list, ignore the files and add all new directories found
31
+ alanghash.each do |x|
32
+ #if a directory...
33
+ if(test(?d,x))
34
+ # add to the original list of directories
35
+ @@tmproot = x + "/**"
36
+ #adds the new ones to the array
37
+ blanghash = Dir[@@tmproot].entries.sort
38
+ blanghash.each do |x|
39
+ if(test(?d,x))
40
+ alanghash.push(x) #appends to the end of the array...
41
+ end
42
+ end
43
+ end
44
+ end
45
+ alanghash.each do |x|
46
+ #if it is a file...
47
+ if(!test(?d,x))
48
+ alanghash.delete(x)
49
+ else #it is a directory...
50
+ findzipfiles(x + "/**")
51
+ end
52
+ end
53
+ @zipslistresult = $zipsarray.rwd_method("fillzipappletname")
54
+ end
@@ -0,0 +1,31 @@
1
+ # this code is to list the zipped applets that can be installed
2
+
3
+
4
+ def fillziptoinstallname(inffile)
5
+ applet = inffile.gsub(/\.zip$/, "")
6
+ @a_installapplet = applet
7
+
8
+ end
9
+
10
+
11
+
12
+
13
+ def listzipfilestoinstall
14
+ startlangdir = File.join($progdir, $zipslocation )
15
+ #get a list of the files and subdirectories on the starting directory only
16
+
17
+
18
+ a = Array.new(Dir["#{startlangdir}/*"].entries.sort)
19
+
20
+ #loop through and get the files names
21
+ a.each do |x|
22
+ # only zip files
23
+ if x =~ /\.zip/
24
+ # puts "#{x}" #adds the file to the array to display on the screen
25
+ $zipsarraylocal = $zipsarraylocal | ["#{x}"]
26
+ end
27
+
28
+ end
29
+
30
+ @zipslistresult = $zipsarraylocal.rwd_method("fillziptoinstallname")
31
+ end
@@ -1,4 +1,4 @@
1
- # this method views an existing address record
1
+ # this method puts the configuration rexord on the screen
2
2
  def loadconfigurationrecord
3
3
 
4
4
  require 'fileutils'
@@ -1,4 +1,4 @@
1
- # this method clears the on screen variables
1
+ # this method loads the on screen variables into the running class
2
2
  def loadconfigurationvariables
3
3
 
4
4
  configfiletoload = File.join(ConfigurationDir,TinkerWin2ConfigurationFileName)
@@ -0,0 +1,87 @@
1
+ #!ruby
2
+ require 'socket' # Network stuff
3
+ require 'timeout' # Timeout functions
4
+
5
+ def network_start
6
+ if RUBY_PLATFORM != "i386-mswin32"
7
+ processone = fork {
8
+ network_demon }
9
+ Process.detach(processone)
10
+
11
+ else
12
+ puts "fork not tried winXP?"
13
+ end
14
+ @viewremotecommandresult = "starting controller on next available port"
15
+ end
16
+
17
+ def network_demon
18
+ # Find configuration variables
19
+ host = "127.0.0.1"
20
+ port = $rwdcontrolports[0].to_i
21
+
22
+ openportfound = false
23
+ until openportfound
24
+
25
+ # Create a socket to listen on and bind it to the host and port
26
+ begin
27
+ @socket = UDPSocket::new()
28
+ @socket.bind(host, port)
29
+ # Rescue the "Address in use" error
30
+ openportfound = true
31
+
32
+ rescue Errno::EADDRINUSE
33
+ puts "controller startup: Port #{port} on host #{host} is already in use."
34
+ port=port+1
35
+ # Rescue the "Address not available' error
36
+ rescue Errno::EADDRNOTAVAIL
37
+ puts "Network plugin: Address #{host} is not available to bind."
38
+ port=port+1
39
+ # Rescue "permission denied errors
40
+ rescue Errno::EACCES
41
+ puts "controller startup: Access denied when binding interface addresses. Did you try to bind a port under 1024 as a regular user?"
42
+ port=port+1
43
+ # Rescue all other errors
44
+ rescue
45
+ puts "Network plugin: An error occured."
46
+ port = port+1
47
+ # Rescue all other errors
48
+ end
49
+
50
+ end
51
+
52
+
53
+ # Get all acceptable hosts
54
+ hosts = ["localhost","vaio-sag"]
55
+ # Do some nice errorchecking
56
+ if(hosts.type != Array)
57
+ puts "Network plugin: No hosts found in networkConfig/acceptHosts. Shutting down plugin."
58
+ return -1 # Return the errorcode for plugin failure
59
+ end
60
+
61
+ # Main loop
62
+ while(true)
63
+ # Get data and client data from the client
64
+ data, info = @socket.recvfrom(256)
65
+
66
+ # Is this an acceptable IP address?
67
+ if(hosts.include?(info[2]) || hosts.include?(info[3]))
68
+ command, parameter = data.split(';')
69
+
70
+ # Command actions
71
+ command.downcase!()
72
+ case command
73
+
74
+ when 'stop'
75
+ @socket.send("hello world",0,info[3],info[1].to_i)
76
+
77
+ when 'query'
78
+ @socket.send("#{$rwdapplicationidentity} on port #{$port}",0,info[3],info[1].to_i)
79
+
80
+
81
+ end # case command
82
+
83
+ end # Access control if
84
+ end # while(true)
85
+
86
+ end # Network::start()
87
+