rwdgutenberg 0.03

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/Books/8sam810.txt +8522 -0
  2. data/Books/Sam2.gut +2 -0
  3. data/Readme.txt +94 -0
  4. data/bin/rwdgutenberg +19 -0
  5. data/code/01rwdcore/01rwdcore.rb +20 -0
  6. data/code/01rwdcore/02helptexthashbegin.rb +4 -0
  7. data/code/01rwdcore/03helptexthash.rb +31 -0
  8. data/code/01rwdcore/04helptextend.rb +6 -0
  9. data/code/01rwdcore/openhelpwindow.rb +31 -0
  10. data/code/01rwdcore/returntomain.rb +10 -0
  11. data/code/01rwdcore/rwdtinkerversion.rb +15 -0
  12. data/code/01rwdcore/rwdwindowreturn.rb +11 -0
  13. data/code/01rwdcore/uploadreturns.rb +62 -0
  14. data/code/superant.com.gutenberg/changegutenbergname.rb +16 -0
  15. data/code/superant.com.gutenberg/clearbookscreendisplay.rb +8 -0
  16. data/code/superant.com.gutenberg/copyfilename.rb +24 -0
  17. data/code/superant.com.gutenberg/createnewnote.rb +23 -0
  18. data/code/superant.com.gutenberg/deletegutenbergrecord.rb +21 -0
  19. data/code/superant.com.gutenberg/gutenbergcreatefile.rb +9 -0
  20. data/code/superant.com.gutenberg/helptexthashrwdgutenberg.rb +41 -0
  21. data/code/superant.com.gutenberg/listnamerecord.rb +15 -0
  22. data/code/superant.com.gutenberg/listtextfilesgutenberg.rb +58 -0
  23. data/code/superant.com.gutenberg/loadbookrecord.rb +21 -0
  24. data/code/superant.com.gutenberg/loadconfigurationrecord.rb +36 -0
  25. data/code/superant.com.gutenberg/loadconfigurationvariables.rb +13 -0
  26. data/code/superant.com.gutenberg/openhelpwindowgutenberg.rb +29 -0
  27. data/code/superant.com.gutenberg/returntomain.rb +10 -0
  28. data/code/superant.com.gutenberg/rungutenbergwindow.rb +42 -0
  29. data/code/superant.com.gutenberg/rwdgutenbergbackward.rb +27 -0
  30. data/code/superant.com.gutenberg/rwdhypernotehelpabout.rb +14 -0
  31. data/code/superant.com.gutenberg/saveconfigurationrecord.rb +18 -0
  32. data/code/superant.com.gutenberg/savegutenbergrecord.rb +20 -0
  33. data/code/superant.com.gutenberg/savelinkrecord.rb +23 -0
  34. data/code/superant.com.rwdtinkerbackwindow/controlclient.rb +99 -0
  35. data/code/superant.com.rwdtinkerbackwindow/diagnostictab.rb +25 -0
  36. data/code/superant.com.rwdtinkerbackwindow/helptexthashtinkerwin2.rb +61 -0
  37. data/code/superant.com.rwdtinkerbackwindow/installapplet.rb +24 -0
  38. data/code/superant.com.rwdtinkerbackwindow/installgemapplet.rb +20 -0
  39. data/code/superant.com.rwdtinkerbackwindow/installremotegem.rb +19 -0
  40. data/code/superant.com.rwdtinkerbackwindow/listgemdirs.rb +12 -0
  41. data/code/superant.com.rwdtinkerbackwindow/listgemzips.rb +54 -0
  42. data/code/superant.com.rwdtinkerbackwindow/listinstalledfiles.rb +11 -0
  43. data/code/superant.com.rwdtinkerbackwindow/listzips.rb +31 -0
  44. data/code/superant.com.rwdtinkerbackwindow/loadconfigurationrecord.rb +32 -0
  45. data/code/superant.com.rwdtinkerbackwindow/loadconfigurationvariables.rb +13 -0
  46. data/code/superant.com.rwdtinkerbackwindow/network.rb +87 -0
  47. data/code/superant.com.rwdtinkerbackwindow/openappletname.rb +18 -0
  48. data/code/superant.com.rwdtinkerbackwindow/openhelpwindowtinkerwin2.rb +42 -0
  49. data/code/superant.com.rwdtinkerbackwindow/remotegemlist.rb +24 -0
  50. data/code/superant.com.rwdtinkerbackwindow/removeapplet.rb +32 -0
  51. data/code/superant.com.rwdtinkerbackwindow/runrwdtinkerbackwindow.rb +12 -0
  52. data/code/superant.com.rwdtinkerbackwindow/rwdtinkerwin2version.rb +14 -0
  53. data/code/superant.com.rwdtinkerbackwindow/saveconfigurationrecord.rb +18 -0
  54. data/code/superant.com.rwdtinkerbackwindow/viewappletcontents.rb +21 -0
  55. data/code/superant.com.rwdtinkerbackwindow/viewgemappletcontents.rb +21 -0
  56. data/code/zz0applicationend/zz0end.rb +4 -0
  57. data/configuration/language.dist +7 -0
  58. data/configuration/rwdapplicationidentity.dist +3 -0
  59. data/configuration/rwdgutenberg.dist +12 -0
  60. data/configuration/rwdtinker.dist +15 -0
  61. data/configuration/tinkerwin2variables.dist +17 -0
  62. data/ev/browser.rb +109 -0
  63. data/ev/ftools.rb +170 -0
  64. data/ev/net.rb +750 -0
  65. data/ev/ruby.rb +819 -0
  66. data/ev/rwd.rb +1849 -0
  67. data/ev/sgml.rb +236 -0
  68. data/ev/thread.rb +63 -0
  69. data/ev/tree.rb +343 -0
  70. data/ev/xml.rb +4 -0
  71. data/extras/rconftool.rb +380 -0
  72. data/extras/zip/ioextras.rb +114 -0
  73. data/extras/zip/stdrubyext.rb +111 -0
  74. data/extras/zip/tempfile_bugfixed.rb +195 -0
  75. data/extras/zip/zip.rb +1377 -0
  76. data/extras/zip/zipfilesystem.rb +558 -0
  77. data/extras/zip/ziprequire.rb +61 -0
  78. data/gui/00coreguibegin/applicationguitop.rwd +4 -0
  79. data/gui/frontwindow0/superant.com.gutenberg/10viewnote.rwd +32 -0
  80. data/gui/frontwindow0/superant.com.gutenberg/20listfiles.rwd +35 -0
  81. data/gui/frontwindow0/superant.com.gutenberg/30booklistutilities.rwd +28 -0
  82. data/gui/frontwindow0/superant.com.gutenberg/35displaytab.rwd +10 -0
  83. data/gui/frontwindow0/superant.com.gutenberg/40rwdgutenberg.rwd +16 -0
  84. data/gui/frontwindow0/superant.com.gutenberg/67viewconfiguration.rwd +40 -0
  85. data/gui/frontwindowselectionbegin/selectiontabbegin/selectiontabbegin.rwd +16 -0
  86. data/gui/frontwindowselections/superant.com.rwdtinkerwin2selectiontab/rwdwin2selectiontab.rwd +12 -0
  87. data/gui/frontwindowselectionzend/viewselectionzend/viewselectionend.rwd +3 -0
  88. data/gui/frontwindowtdocumentbegin/superant.com.documentsbegin/tt0documentbegin.rwd +6 -0
  89. data/gui/frontwindowtdocuments/superant.com,rwdgutenbergdocument/rwdgutenbergdocument.rwd +5 -0
  90. data/gui/frontwindowtdocuments/superant.com.documents/uu5documents.rwd +15 -0
  91. data/gui/frontwindowtdocuments/superant.com.tinkerwin2documents/uu5documents.rwd +6 -0
  92. data/gui/frontwindowtdocumentzend/superant.com.documentsend/ww0documentend.rwd +12 -0
  93. data/gui/frontwindowz1end/frontwindowend/xx0rwdfirsttab.rwd +6 -0
  94. data/gui/helpaboutbegin/superant.com.helpaboutbegin/ya0helpscreenstart.rwd +3 -0
  95. data/gui/helpaboutinstalled/superant.com.rwdgutenberghelpabout/1versionname.rwd +6 -0
  96. data/gui/helpaboutinstalled/superant.com.rwdgutenberghelpabout/5version.rwd +9 -0
  97. data/gui/helpaboutinstalled/superant.com.rwdwin2helpabout/1appname.rwd +4 -0
  98. data/gui/helpaboutinstalled/superant.com.rwdwin2helpabout/3copyright.rwd +3 -0
  99. data/gui/helpaboutinstalled/superant.com.rwdwin2helpabout/5version.rwd +10 -0
  100. data/gui/helpaboutinstalled/superant.com.tinkerhelpabout/1appname.rwd +4 -0
  101. data/gui/helpaboutinstalled/superant.com.tinkerhelpabout/3copyright.rwd +3 -0
  102. data/gui/helpaboutinstalled/superant.com.tinkerhelpabout/5version.rwd +10 -0
  103. data/gui/helpaboutzend/superant.com.helpaboutend/helpscreenend.rwd +3 -0
  104. data/gui/tinkerbackwindows/superant.com.gutendisplay/gutendisplaywindow.rwd +9 -0
  105. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/1appname.rwd +5 -0
  106. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/40rwdlistzips.rwd +42 -0
  107. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/45installremotezip.rwd +44 -0
  108. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/50rwdlistapplets.rwd +44 -0
  109. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/60editconfiguration.rwd +38 -0
  110. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/70rwddiagnostics.rwd +29 -0
  111. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/75rwdcontrol.rwd +33 -0
  112. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/80tab1.rwd +11 -0
  113. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/9backend.rwd +6 -0
  114. data/gui/tinkerbackwindows/superant.com.tinkerhelpwindow/1appname.rwd +31 -0
  115. data/gui/tinkerbackwindows/superant.com.tinkerhelpwindow/9end.rwd +4 -0
  116. data/gui/tinkerbackwindows/superant.com.versionwindow/1appname.rwd +19 -0
  117. data/gui/zzcoreguiend/tinkerapplicationguiend/yy9rwdend.rwd +4 -0
  118. data/init.rb +274 -0
  119. data/installed/rwdviewlogo-0.4.inf +4 -0
  120. data/lang/en/rwdcore/languagefile.rb +16 -0
  121. data/lang/es/rwdcore/languagefile-es.rb +14 -0
  122. data/lang/jp/rwdcore/languagefile.rb +9 -0
  123. data/lang/nl/rwdcore/languagefile.rb +19 -0
  124. data/lib/temp.rb +1 -0
  125. data/rwd_files/HowTo_Gutenberg.txt +94 -0
  126. data/rwd_files/HowTo_Tinker.txt +400 -0
  127. data/rwd_files/HowTo_TinkerWin2.txt +202 -0
  128. data/rwd_files/Readme.txt +57 -0
  129. data/rwd_files/favicon.ico +0 -0
  130. data/rwd_files/rdoc-style.css +175 -0
  131. data/rwd_files/rwdapplications.html +54 -0
  132. data/rwd_files/rwdindex.html +6 -0
  133. data/rwd_files/tinker.png +0 -0
  134. data/rwdconfig.dist +6 -0
  135. data/rwdgutenberg-0.03.gem +0 -0
  136. data/tests/checkdepends.sh +4 -0
  137. data/tests/cleancnf.sh +5 -0
  138. data/tests/makedist.rb +29 -0
  139. data/tests/rdep.rb +354 -0
  140. data/tests/rwdtinkertestEN.rb +163 -0
  141. data/tests/test.result +32 -0
  142. data/tests/totranslate.lang +93 -0
  143. data/zips/rwdahelloworld-0.5.zip +0 -0
  144. metadata +198 -0
@@ -0,0 +1,15 @@
1
+ # this code is to list the file data
2
+ def listgutrecordfiles
3
+ if File.exist?($rwdgutenberg_directory)
4
+ fileList = Dir.new($rwdgutenberg_directory).entries.sort.delete_if { |x| ! (x =~ /gut$/) }
5
+
6
+ @gutenbergrecordsresult = fileList.rwd_method("fillgutenbergrecordname")
7
+ end
8
+ end
9
+
10
+ # this method is to help fill in list of names
11
+ def fillgutenbergrecordname(inffile)
12
+ applet = inffile.gsub(/\.gut$/, "")
13
+ @a_viewgutenberg = applet
14
+ end
15
+
@@ -0,0 +1,58 @@
1
+ # this code is to list the links
2
+
3
+ def fillhypergutenbergname(inffile)
4
+
5
+ @a_newfilegutenberg = inffile
6
+ end
7
+
8
+ def findgutenbergfiles(d)
9
+ a = Array.new(Dir[d].entries.sort)
10
+ #loop through and get the files names
11
+ a.each do |x|
12
+ #adjust the filters to the files you want to see...
13
+ if(!test(?d,x))
14
+ # only lnk files
15
+ if x =~ /rb|txt|lst/
16
+ puts "#{x}" #opens the file thats in fileName as read only
17
+ $gutenbergarray = $gutenbergarray | ["#{x}"]
18
+ end
19
+ end
20
+ end
21
+ end
22
+
23
+ def rwdgutenbergfiles
24
+ $gutenbergarray = [""]
25
+ startlangdir = @a_searchdirectorygutenberg
26
+ puts startlangdir
27
+ #get a list of the files and subdirectories on the starting directory only
28
+ agutenbergarray = Array.new(Dir[startlangdir].entries.sort)
29
+ p agutenbergarray
30
+ #loop through the list, ignore the files and add all new directories found
31
+ agutenbergarray.each do |x|
32
+ #if a directory...
33
+ if(test(?d,x))
34
+ # add to the original list of directories
35
+ @@tmproot = x + "/**"
36
+ puts @@tmproot
37
+ #adds the new ones to the array
38
+ bgutenbergarray = Dir[@@tmproot].entries.sort
39
+ p bgutenbergarray
40
+ bgutenbergarray.each do |x|
41
+ p x
42
+ if(test(?d,x))
43
+ agutenbergarray.push(x) #appends to the end of the array...
44
+ p agutenbergarray
45
+ end
46
+ end
47
+ end
48
+ end
49
+ agutenbergarray.each do |x|
50
+ #if it is a file...
51
+ if(!test(?d,x))
52
+ agutenbergarray.delete(x)
53
+ else #it is a directory...
54
+ findgutenbergfiles(x + "/**")
55
+ end
56
+ end
57
+ @textsfilesrecordsresult = $gutenbergarray.rwd_method("fillhypergutenbergname")
58
+ end
@@ -0,0 +1,21 @@
1
+ # this method views an existing record
2
+ def rwdgutenloadbookrecord
3
+
4
+ require 'fileutils'
5
+
6
+
7
+ begin # exception trapped block
8
+
9
+
10
+ tmpfileName = @a_viewgutenberg + ".gut"
11
+ fileName = File.join($rwdgutenberg_directory,tmpfileName)
12
+ fd = File.open(fileName,"r")
13
+ @a_gutenbergdata = fd.read
14
+
15
+
16
+ fd.close
17
+ rescue SystemCallError, StandardError
18
+ $stderr.print "system call error: " + $!
19
+ end # exception rescue
20
+
21
+ end
@@ -0,0 +1,36 @@
1
+ # this method puts the configuration rexord on the screen
2
+ def loadrwdgutenbergconfiguration
3
+
4
+ require 'fileutils'
5
+
6
+ @a_gutenconfigurationfilename = "rwdgutenberg.cnf"
7
+
8
+
9
+ begin # exception trapped block
10
+
11
+ Dir.chdir($progdir)
12
+ fileName = File.join(ConfigurationDir, "rwdgutenberg.cnf")
13
+
14
+
15
+ fd = File.open(fileName,"r")
16
+ @a_gutenconfigline1= fd.readline.chomp
17
+ @a_gutenconfigline2 = fd.readline.chomp
18
+ @a_gutenconfigline3 = fd.readline.chomp
19
+ @a_gutenconfigline4 = fd.readline.chomp
20
+ @a_gutenconfigline5 = fd.readline.chomp
21
+ @a_gutenconfigline6 = fd.readline.chomp
22
+ @a_gutenconfigline7 =fd.readline.chomp
23
+ @a_gutenconfigline8 = fd.readline.chomp
24
+ @a_gutenconfigline9 = fd.readline.chomp
25
+ @a_gutenconfigline10 = fd.readline.chomp
26
+ @a_gutenconfigline11 = fd.readline.chomp
27
+
28
+ while ! fd.eof?
29
+ @extragutenconfigdatadisplay = fd.readline
30
+ end
31
+ fd.close
32
+ rescue SystemCallError, StandardError
33
+ $stderr.print "system call error: " + $!
34
+ end # exception rescue
35
+
36
+ end
@@ -0,0 +1,13 @@
1
+ # this method loads the on screen variables into the running class
2
+ def loadrwdgutenbergconfigurationvariables
3
+
4
+ configfiletoload = File.join(ConfigurationDir,"rwdgutenberg.cnf")
5
+ begin
6
+ load configfiletoload
7
+ @extragutenconfigdatadisplay = ""
8
+ @newgutenconfigurationresult = "Config Variables loaded"
9
+ rescue
10
+ @extragutenconfigdatadisplay = ""
11
+ @newgutenconfigurationresult = "loading error"
12
+ end
13
+ end
@@ -0,0 +1,29 @@
1
+ # this code is to call the help window
2
+ def runhelpwindowrwdgutenberg
3
+
4
+ $help_topic = "rwdgutenberg_generalhelp"
5
+
6
+ if @rwd_tab == "utilitiesrwdgutenberg"
7
+ $help_topic = "gutenbergutility_help"
8
+ end
9
+
10
+ if @rwd_tab == "superantcomgutenbergfile"
11
+ $help_topic = "gutenbergedit_help"
12
+ end
13
 
14
+
15
+
16
+ if @rwd_tab == "viewrwdgutenbergconfiguration"
17
+ $help_topic = "rwdgutenberg_configuration"
18
+ end
19
+ $helptopicsarray = $helptopicsarray | ["gutenbergedit_help","rwdgutenberg_generalhelp","rwdgutenberg_configuration"]
20
+
21
+
22
+
23
+ if @rwd_window != "rwdtinkerhelpwindow"
24
+ $previouswindow = @rwd_window
25
+ $previoustab = @rwd_tab
26
+ end
27
+ runhelpwindow
28
+ end
29
+
30
+
@@ -0,0 +1,10 @@
1
+ # Application rwdtinker 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 returntomainx
7
+ @rwd_window = "main"
8
+ @rwd_tab = "rwdscheduleselectiontab"
9
+ end
10
+
@@ -0,0 +1,42 @@
1
+ def rungutenbergwindow
2
+
3
+ rwdgutenbergwindowtwo
4
+ end
5
+
6
+ $tempnumber = 0
7
+
8
+ def rwdgutenbergwindowtwo
9
+ tempdoc = ""
10
+ @gutendisplayvariable = ""
11
+
12
+ tempcount = 0
13
+ if @rwd_tab== "rwdgutenberg"
14
+ @rwd_window = "gutendisplaywindowtwo"
15
+ end
16
+ if $gutenbergcommand == "openbook"
17
+
18
+ tmpfileName = @a_viewgutenberg + ".gut"
19
+ fileName = File.join($rwdgutenberg_directory,tmpfileName)
20
+ fd = File.open(fileName,"r")
21
+ booktitle = fd.readline.chomp
22
+
23
+
24
+ $bookfile=File.new(booktitle,"r") #opens the file thats in fileName as read only
25
+ $gutenbergcommand = "continue"
26
+ end
27
+ while tempcount < $booklocation + $booksteps
28
+ $bookfile.gets
29
+ if tempcount > $booklocation -1
30
+ tempdoc += $bookfile.gets #reads the file into the doc string
31
+ end
32
+
33
+ tempcount += 1
34
+ end
35
+
36
+ $booklocation = $booklocation + $booksteps
37
+ if $gutenbergcommand == "closebook"
38
+ $bookfile.close
39
+ end
40
+ @gutendisplayvariable = tempdoc
41
+
42
+ end
@@ -0,0 +1,27 @@
1
+
2
+
3
+ def rwdgutenbergbackward
4
+ tempdoc = ""
5
+ @gutendisplayvariable = ""
6
+
7
+ tempcount = 0
8
+ if @rwd_tab== "rwdgutenberg"
9
+ @rwd_window = "gutendisplaywindowtwo"
10
+ end
11
+ $booklocation = $booklocation - ($booksteps + $booksteps)
12
+ while tempcount < $booklocation + $booksteps
13
+ $bookfile.gets
14
+ if tempcount > $booklocation -1
15
+ tempdoc += $bookfile.gets #reads the file into the doc string
16
+ end
17
+
18
+ tempcount += 1
19
+ end
20
+
21
+ $booklocation = $booklocation + $booksteps
22
+ if $gutenbergcommand == "closebook"
23
+ $bookfile.close
24
+ end
25
+ @gutendisplayvariable = tempdoc
26
+
27
+ end
@@ -0,0 +1,14 @@
1
+ # Application RwdTinker orginally (c) 2004 Steven Gibson under GPL.
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 runrwdgutenbergversion
8
+ @rwd_window = "applicationversion"
9
+ @versionappnamedisplay = "RwdGutenberg"
10
+ @versioncopyrightdisplay = "(c) 2005 Steven Gibson "
11
+ @versionnumberdisplay = "Version " + RwdGutenbergVersion
12
+
13
+ end
14
+
@@ -0,0 +1,18 @@
1
+ # this method adds a new address record
2
+ def saverwdgutenbergconfiguration
3
+ require 'fileutils'
4
+
5
+ newname = "rwdgutenberg.cnf" # grab the filename to create
6
+ newdata =@a_gutenconfigline1.to_s + "\n" + @a_gutenconfigline2.to_s + "\n" + @a_gutenconfigline3.to_s + "\n" + @a_gutenconfigline4.to_s + "\n" + @a_gutenconfigline5.to_s + "\n" + @a_gutenconfigline6.to_s + "\n" + @a_gutenconfigline7.to_s + "\n" + @a_gutenconfigline8.to_s + "\n" + @a_gutenconfigline9.to_s + "\n"+ @a_gutenconfigline10.to_s + "\n"+ @a_gutenconfigline11.to_s + "\n"+ @a_gutenconfigline9.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,20 @@
1
+ # this method adds a new record
2
+ def savegutenbergrecord
3
+ require 'fileutils'
4
+ if ! @a_gutenbergdata.empty?
5
+ if ! @a_viewgutenberg.empty?
6
+ fileName = $rwdgutenberg_directory + "/" + @a_viewgutenberg.to_s + ".gut" # grab the new filename to create
7
+
8
+
9
+ begin # exception trapped block
10
+
11
+ fd = File.open(fileName,"w")
12
+ fd.print( @a_gutenbergdata) # save the record info to the file
13
+ fd.close
14
+
15
+ rescue SystemCallError, StandardError
16
+ $stderr.print "system call error: " + $!
17
+ end # exception rescue
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,23 @@
1
+ # this method adds a new record
2
+ def hypernotesavelinkrecord
3
+ require 'fileutils'
4
+ if ! @a_notelinksdata.empty?
5
+ if ! @a_viewlinksnote.empty?
6
+ fileName = "%s" % [@a_viewlinksnote] # grab the new filename to create
7
+
8
+
9
+ begin # exception trapped block
10
+
11
+ fd = File.open(fileName,"w")
12
+ fd.print( @a_notelinksdata) # save the record info to the file
13
+ fd.close
14
+
15
+ p fileName
16
+ p @a_notelinksdata
17
+
18
+ rescue SystemCallError, StandardError
19
+ $stderr.print "system call error: " + $!
20
+ end # exception rescue
21
+ end
22
+ end
23
+ 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
+