rwdgutenberg 0.03 → 0.04

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. data/Readme.txt +7 -0
  2. data/code/01rwdcore/01rwdcore.rb +15 -13
  3. data/code/01rwdcore/jumplinkcommand.rb +26 -0
  4. data/code/01rwdcore/openhelpwindow.rb +26 -26
  5. data/code/01rwdcore/returntomain.rb +8 -8
  6. data/code/01rwdcore/rundocuments.rb +10 -0
  7. data/code/01rwdcore/runeditconfiguration.rb +10 -0
  8. data/code/01rwdcore/runhelpabout.rb +10 -0
  9. data/code/01rwdcore/rwdtinkerversion.rb +12 -13
  10. data/code/01rwdcore/rwdwindowreturn.rb +3 -5
  11. data/code/01rwdcore/selectiontab.rb +9 -0
  12. data/code/01rwdcore/test_cases.rb +109 -0
  13. data/code/01rwdcore/test_harness.rb +13 -0
  14. data/code/01rwdcore/uploadreturns.rb +60 -60
  15. data/code/dd0viewphoto/dd0viewphoto.rb +3 -0
  16. data/code/superant.com.gutenberg/rungutenbergwindow.rb +2 -1
  17. data/code/superant.com.rwdtinkerbackwindow/controlclient.rb +89 -92
  18. data/code/superant.com.rwdtinkerbackwindow/diagnostictab.rb +15 -21
  19. data/code/superant.com.rwdtinkerbackwindow/installapplet.rb +19 -18
  20. data/code/superant.com.rwdtinkerbackwindow/installgemapplet.rb +20 -19
  21. data/code/superant.com.rwdtinkerbackwindow/installremotegem.rb +19 -18
  22. data/code/superant.com.rwdtinkerbackwindow/listgemdirs.rb +7 -7
  23. data/code/superant.com.rwdtinkerbackwindow/listgemzips.rb +48 -49
  24. data/code/superant.com.rwdtinkerbackwindow/listinstalledfiles.rb +8 -7
  25. data/code/superant.com.rwdtinkerbackwindow/listzips.rb +22 -26
  26. data/code/superant.com.rwdtinkerbackwindow/loadconfigurationrecord.rb +32 -31
  27. data/code/superant.com.rwdtinkerbackwindow/loadconfigurationvariables.rb +14 -13
  28. data/code/superant.com.rwdtinkerbackwindow/network.rb +82 -82
  29. data/code/superant.com.rwdtinkerbackwindow/openappletname.rb +18 -17
  30. data/code/superant.com.rwdtinkerbackwindow/openhelpwindowtinkerwin2.rb +37 -37
  31. data/code/superant.com.rwdtinkerbackwindow/remotegemlist.rb +20 -20
  32. data/code/superant.com.rwdtinkerbackwindow/removeapplet.rb +33 -32
  33. data/code/superant.com.rwdtinkerbackwindow/runremoteinstall.rb +11 -0
  34. data/code/superant.com.rwdtinkerbackwindow/runrwdtinkerbackwindow.rb +8 -9
  35. data/code/superant.com.rwdtinkerbackwindow/rwdtinkerwin2version.rb +10 -11
  36. data/code/superant.com.rwdtinkerbackwindow/saveconfigurationrecord.rb +19 -18
  37. data/code/superant.com.rwdtinkerbackwindow/viewappletcontents.rb +21 -20
  38. data/code/superant.com.rwdtinkerbackwindow/viewgemappletcontents.rb +23 -20
  39. data/configuration/language.dist +1 -1
  40. data/configuration/rwdapplicationidentity.dist +1 -1
  41. data/configuration/rwdgutenberg.dist +2 -2
  42. data/configuration/rwdtinker.dist +3 -3
  43. data/configuration/tinkerwin2variables.dist +1 -1
  44. data/gui/00coreguibegin/applicationguitop.rwd +1 -1
  45. data/gui/frontwindowselectionbegin/selectiontabbegin/selectiontabbegin.rwd +2 -7
  46. data/gui/frontwindowselections/superant.com.rwdtinkerwin2selectiontab/jumplinkcommands.rwd +15 -0
  47. data/gui/helpaboutinstalled/superant.com.tinkerhelpabout/3copyright.rwd +1 -1
  48. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/81jumplinkcommands.rwd +17 -0
  49. data/init.rb +231 -228
  50. data/rwd_files/HowTo_Gutenberg.txt +7 -0
  51. data/rwd_files/HowTo_Tinker.txt +19 -0
  52. data/rwdconfig.dist +8 -2
  53. data/tests/RubyGauge.rb +179 -0
  54. data/tests/makedist.rb +35 -6
  55. metadata +20 -13
  56. data/gui/frontwindowselections/superant.com.rwdtinkerwin2selectiontab/rwdwin2selectiontab.rwd +0 -12
  57. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/80tab1.rwd +0 -11
  58. data/rwdgutenberg-0.03.gem +0 -0
  59. data/tests/rwdtinkertestEN.rb +0 -163
  60. data/tests/test.result +0 -32
@@ -1,24 +1,24 @@
1
1
  # This tinker method is to retrieve the list of rwdzip applets available to install from the remote repository
2
-
3
2
  def superantcomremotegemlist
4
- gemcommandoption = "search --remote "
5
- gemfilename = "rwdzip"
6
- commandtext = "gem search --remote rwdzip"
7
- commandtemp = $xpcommand + commandtext
8
- begin # exception trapped block
9
-
10
- tempremotegemappletsresult = `#{commandtemp} 2>&1`
11
- @superantcomremotegemappletsfullresult = tempremotegemappletsresult
12
- fileList = tempremotegemappletsresult.split(/\n/).delete_if { |x| ! (x =~ /\Arwdzip/) }
13
-
14
- @superantcomremotegemappletsresult = fileList.rwd_method("superantcomremotegemappletdirsname")
15
- rescue SystemCallError, StandardError
16
- @superantcomremotegemappletsresult = "system call error: " + $!
17
- end # exception rescue
3
+ gemcommandoption = "search --remote "
4
+ gemfilename = "rwdzip"
5
+ commandtext = "gem search --remote rwdzip"
6
+ commandtemp = $xpcommand + commandtext
7
+ begin # exception trapped block
8
+
9
+ tempremotegemappletsresult = `#{commandtemp} 2>&1`
10
+ @superantcomremotegemappletsfullresult = tempremotegemappletsresult
11
+ fileList = tempremotegemappletsresult.split(/\n/).delete_if { |x| ! (x =~ /\Arwdzip/) }
12
+
13
+ @superantcomremotegemappletsresult = fileList.rwd_method("superantcomremotegemappletdirsname")
14
+ rescue SystemCallError, StandardError
15
+ @superantcomremotegemappletsresult = "system call error: " + $!
16
+ end # exception rescue
18
17
  end
19
-
18
+
20
19
  def superantcomremotegemappletdirsname(inffile)
21
- applet = inffile
22
- @superantcominstallremoteappletinput = applet
23
-
24
- end
20
+ applet = inffile
21
+ @superantcominstallremoteappletinput = applet
22
+
23
+ end
24
+
@@ -1,32 +1,33 @@
1
- def removeapplet
2
- require 'fileutils'
3
- nametext = "%s" % [@a_removeapplet]
4
-
5
- begin # exception trapped block
6
- fileName = "installed/" + nametext + ".inf"
7
- count = 0
8
- fd = File.open(fileName,"r")
9
-
10
-
11
- fd.each { |oneline|
12
- if count == 1
13
- if File.exist?(oneline.chop)
14
- FileUtils.rm_rf( oneline.chop)
15
- end
16
-
17
- end
18
- count = 1
19
- }
20
- fd.close
21
-
22
- FileUtils.rm_rf( fileName)
23
-
24
-
25
- @removeapplettext = "applet files removed! - restart rwd to finish uninstalling"
26
-
27
- rescue
28
- @removeapplettext = "\n" + "error"
29
-
30
- end # exception rescue
31
-
32
- end
1
+ # method to remove a tinker applet
2
+ def removeapplet
3
+ require 'fileutils'
4
+ nametext = "%s" % [@a_removeapplet]
5
+
6
+ begin # exception trapped block
7
+ fileName = "installed/" + nametext + ".inf"
8
+ count = 0
9
+ fd = File.open(fileName,"r")
10
+
11
+
12
+ fd.each { |oneline|
13
+ if count == 1
14
+ if File.exist?(oneline.chop)
15
+ FileUtils.rm_rf( oneline.chop)
16
+ end
17
+
18
+ end
19
+ count = 1
20
+ }
21
+ fd.close
22
+
23
+ FileUtils.rm_rf( fileName)
24
+
25
+
26
+ @removeapplettext = "applet files removed! - restart rwd to finish uninstalling"
27
+
28
+ rescue
29
+ @removeapplettext = "\n" + "error"
30
+
31
+ end # exception rescue
32
+
33
+ end
@@ -0,0 +1,11 @@
1
+ # Application RwdTinker orginally (c) 2004 Steven Gibson under GPL.
2
+ # This application is a framework for writing programs from RubyWebDialogs
3
+ # For information see http://www.rubyforge.net/projects/rwdapplications
4
+
5
+ # call the rwdtinker helpwindow
6
+
7
+ def runremotezipsinstall
8
+ @rwd_window = "tinkerbackwindow"
9
+ @rwd_tab = "superantcomremotezipsinstall"
10
+ end
11
+
@@ -1,12 +1,11 @@
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
- # call the rwdtinker helpwindow
3
+ # For information see http://www.rubyforge.net/projects/rwdapplications
4
+
5
+ # call the rwdtinker helpwindow
6
+
7
+ def runrwdtinkerbackwindow
8
+ @rwd_window = "tinkerbackwindow"
9
+ @rwd_tab = "rwdzipslister"
10
+ end
7
11
 
8
- def runrwdtinkerbackwindow
9
- @rwd_window = "tinkerbackwindow"
10
- @rwd_tab = "rwdzipslister"
11
- end
12
-
@@ -1,14 +1,13 @@
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 runrwdtinkerwin2version
8
- @rwd_window = "applicationversion"
9
- @versionappnamedisplay = "RwdTinkerWin2"
10
- @versioncopyrightdisplay = "(c) 2004 Steven Gibson "
11
- @versionnumberdisplay = "Version " + RwdTinkerWin2Version
3
+ # For information see http://www.rubyforge.net/projects/rwdapplications
4
+
5
+ # return the version constant defined in the config file
6
+ def runrwdtinkerwin2version
7
+ @rwd_window = "applicationversion"
8
+ @versionappnamedisplay = "RwdTinkerWin2"
9
+ @versioncopyrightdisplay = "(c) 2004 Steven Gibson "
10
+ @versionnumberdisplay = "Version " + RwdTinkerWin2Version
11
+
12
+ end
12
13
 
13
- end
14
-
@@ -1,18 +1,19 @@
1
- # this method saves the configuration record
2
- def saveconfigurationrecord
3
- require 'fileutils'
4
- if @a_configurationfilename
5
- newname = "%s" % [@a_configurationfilename] # grab the filename to create
6
- newdata =@a_configline1.to_s + "\n" + @a_configline2.to_s + "\n" + @a_configline3.to_s + "\n" + @a_configline4.to_s + "\n" + @a_configline5.to_s + "\n" + @a_configline6.to_s + "\n" + @a_configline7.to_s + "\n" + @a_configline8.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
- end
18
- end
1
+ # this method saves the configuration record
2
+ def saveconfigurationrecord
3
+ require 'fileutils'
4
+ if @a_configurationfilename
5
+ newname = "%s" % [@a_configurationfilename] # grab the filename to create
6
+ newdata =@a_configline1.to_s + "\n" + @a_configline2.to_s + "\n" + @a_configline3.to_s + "\n" + @a_configline4.to_s + "\n" + @a_configline5.to_s + "\n" + @a_configline6.to_s + "\n" + @a_configline7.to_s + "\n" + @a_configline8.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
+ end
18
+ end
19
+
@@ -1,21 +1,22 @@
1
- def viewappletcontents
2
- require 'fileutils'
3
- require 'extras/zip/zip'
4
- nametext = "%s" % [@a_installapplet]
5
-
6
- begin # exception trapped block
7
- fullname = nametext + ".zip"
8
- fileName = File.join($zipslocation,fullname)
9
- tempfilecontents = " "
10
- zf = Zip::ZipFile.new(fileName)
11
- zf.sort.each {
12
- |entry|
13
- tempfilecontents = tempfilecontents + entry.to_s + "\n"
14
- }
15
- @appletcontentstext = tempfilecontents
16
-
17
- rescue
18
- @installapplettext = "unzip error - error opening applet"
19
- end # exception rescue
1
+ #view contents of a tinker applet
2
+ def viewappletcontents
3
+ require 'fileutils'
4
+ require 'extras/zip/zip'
5
+ nametext = "%s" % [@a_installapplet]
20
6
 
21
- end
7
+ begin # exception trapped block
8
+ fullname = nametext + ".zip"
9
+ fileName = File.join($zipslocation,fullname)
10
+ tempfilecontents = " "
11
+ zf = Zip::ZipFile.new(fileName)
12
+ zf.sort.each {
13
+ |entry|
14
+ tempfilecontents = tempfilecontents + entry.to_s + "\n"
15
+ }
16
+ @appletcontentstext = tempfilecontents
17
+
18
+ rescue
19
+ @installapplettext = "unzip error - error opening applet"
20
+ end # exception rescue
21
+
22
+ end
@@ -1,21 +1,24 @@
1
- def viewgemappletcontents
2
- require 'fileutils'
3
- require 'extras/zip/zip'
4
- nametext = "%s" % [@a_installapplet]
5
-
6
- begin # exception trapped block
7
- fullname = nametext + ".zip"
8
-
9
- tempfilecontents = " "
10
- zf = Zip::ZipFile.new(fullname)
11
- zf.sort.each {
12
- |entry|
13
- tempfilecontents = tempfilecontents + entry.to_s + "\n"
14
- }
15
- @appletcontentstext = tempfilecontents
16
-
17
- rescue
18
- @installapplettext = "unzip error - error opening applet"
19
- end # exception rescue
1
+ #view gem info
2
+ def viewgemappletcontents
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
+ tempfilecontents = " "
11
+ zf = Zip::ZipFile.new(fullname)
12
+ zf.sort.each {
13
+ |entry|
14
+ tempfilecontents = tempfilecontents + entry.to_s + "\n"
15
+ }
16
+ @appletcontentstext = tempfilecontents
17
+
18
+ rescue
19
+ @installapplettext = "unzip error - error opening applet"
20
+ end # exception rescue
21
+
22
+ end
23
+
20
24
 
21
- end
@@ -1,4 +1,4 @@
1
- ##VERSION:1.57
1
+ ##VERSION:1.62
2
2
  #language selection file
3
3
  ##NAME:$lang:0
4
4
  #$lang = "jp"
@@ -1,3 +1,3 @@
1
- ##VERSION:1.57
1
+ ##VERSION:1.63
2
2
  $rwdapplicationidentity = "rwdtinker main application"
3
3
 
@@ -1,4 +1,4 @@
1
- ##VERSION:0.03
1
+ ##VERSION:0.04
2
2
  ##NAME:$rwdgutenberg_directory:0
3
3
  $rwdgutenberg_directory = "Books"
4
4
  ##NAME:$gutenbergcommand:0
@@ -9,4 +9,4 @@ $booklocation = 0
9
9
  $booksteps = 14
10
10
  ##NAME:BookViewDisplay:0
11
11
  BookViewDisplay = 15
12
- RwdGutenbergVersion = "0.03"
12
+ RwdGutenbergVersion = "0.04"
@@ -1,4 +1,4 @@
1
- ##VERSION:1.60
1
+ ##VERSION:1.64
2
2
  ConfigurationDir = "configuration" # for use in program - init.rb has this value without using this constant
3
3
  CodeName = "rwdtinker"
4
4
  CodeNameFile = CodeName + ".rb"
@@ -11,5 +11,5 @@ LangDir = "lang"
11
11
  $prevouswindow ="main"
12
12
  $rwdcontrolports =["13713","13714","13715","13716","13717","13718"]
13
13
  $port = 7705
14
-
15
- RwdTinkerVersion = "1.60"
14
+ $rwdjumplink = ["helpscreen","tinkerbackwindow","returntomain","opendocuments","editconfiguration"]
15
+ RwdTinkerVersion = "1.64"
@@ -1,4 +1,4 @@
1
- ##VERSION:1.57
1
+ ##VERSION:1.63
2
2
  TinkerWin2ConfigurationFileName = "tinkerwin2variables.cnf" # this file name - do not change
3
3
  ##NAME:$zipslocation:0
4
4
  $zipslocation = "zips" # location of applets to add
@@ -1,4 +1,4 @@
1
1
  $rwdguivar=
2
2
  "<application>
3
- <window name=\"main\" title=\"RwdGutenberg - Tinker & RubyWebDialogs\">
3
+ <window name=\"main\" title=\"Tinker - RubyWebDialogs\">
4
4
  <tabs>"
@@ -3,14 +3,9 @@ $rwdguivar=
3
3
  <tab name=\"selectiontab\" caption=#{Message[:selection_panel]}>
4
4
 
5
5
  <table>
6
- <row> <p align=\"right\">Open a new window with callable applets you have loaded</row>
6
+ <row> <p align=\"right\">Open a new location </row>
7
7
 
8
8
  </table>
9
- <horizontal>
10
-
11
- <button caption=#{Message[:rwdtinker_help_window]} action=\"runhelpwindow\"/>
12
-
13
-
14
- </horizontal>"
9
+ "
15
10
 
16
11
 
@@ -0,0 +1,15 @@
1
+ $rwdguivar=
2
+ "
3
+ <horizontal>
4
+ <button caption=\"Show Jump Links\" action=\"showjumplinkoptions\"/>
5
+
6
+ </horizontal>
7
+ <table>
8
+ <select name=\"a_jumplinkinput\"> %%jumplinkoptions%% </select>
9
+
10
+ </table>
11
+
12
+ <horizontal>
13
+ <button caption=\"Jump to Application Location\" action=\"runjumplinkcommand\"/>
14
+ </horizontal>
15
+ "
@@ -1,3 +1,3 @@
1
1
  $rwdguivar=
2
2
  "
3
- <row> <p align=\"center\">copyright s. gibson 2004</p></row>"
3
+ <row> <p align=\"center\">copyright s. gibson 2004,2005</p></row>"
@@ -0,0 +1,17 @@
1
+ $rwdguivar=
2
+ "
3
+ <tab name=selectiontab caption=\"Selection Tab\">
4
+ <horizontal>
5
+ <button caption=\"Show Jump Links\" action=\"showjumplinkoptions\"/>
6
+
7
+ </horizontal>
8
+ <table>
9
+ <select name=\"a_jumplinkinput\"> %%jumplinkoptions%% </select>
10
+
11
+ </table>
12
+
13
+ <horizontal>
14
+ <button caption=\"Jump to Application Location\" action=\"runjumplinkcommand\"/>
15
+ </horizontal>
16
+ </tab>
17
+ "
data/init.rb CHANGED
@@ -24,251 +24,254 @@
24
24
  require "ev/rwd"
25
25
  require 'fileutils'
26
26
  require 'extras/rconftool'
27
-
27
+
28
28
  $progdir = File::expand_path( File.dirname(__FILE__))
29
29
 
30
- $tempdoc = " "
31
-
32
- def findfiles(d)
33
- a = Array.new(Dir[d].entries.sort)
34
- #loop through and get the files names
35
- a.each do |x|
36
- #adjust the filters to the files you want to see...
37
- if(!test(?d,x))
38
- # only rwd files
39
- if x =~ /rb|rwd|txt/
40
- fileA=File.open("#{x}","r") #opens the file thats in fileName as read only
41
- $tempdoc+=fileA.read #reads the file into the doc string
42
- fileA.close
43
- end
44
- end
45
- end
46
- end
47
- def loadguifile(d)
48
- a = Array.new(Dir[d].entries.sort)
49
- #loop through and get the files names
50
- a.each do |x|
51
- #adjust the filters to the files you want to see...
52
- if(!test(?d,x))
53
- # only rwd files
54
- if x =~ /rb|rwd|txt/
55
-
56
- load x #opens the file thats in fileName and reads it
57
- $tempdoc += $rwdguivar # adds the file into the doc string
58
- end
59
- end
60
- end
61
- end
62
-
30
+ $tempdoc = " "
31
+
32
+ def findfiles(d)
33
+ a = Array.new(Dir[d].entries.sort)
34
+ #loop through and get the files names
35
+ a.each do |x|
36
+ #adjust the filters to the files you want to see...
37
+ if(!test(?d,x))
38
+ # only rwd files
39
+ if x =~ /rb|rwd|txt/
40
+ fileA=File.open("#{x}","r") #opens the file thats in fileName as read only
41
+ $tempdoc+=fileA.read #reads the file into the doc string
42
+ fileA.close
43
+ end
44
+ end
45
+ end
46
+ end
47
+ def loadguifile(d)
48
+ a = Array.new(Dir[d].entries.sort)
49
+ #loop through and get the files names
50
+ a.each do |x|
51
+ #adjust the filters to the files you want to see...
52
+ if(!test(?d,x))
53
+ # only rwd files
54
+ if x =~ /rb|rwd|txt/
55
+
56
+ load x #opens the file thats in fileName and reads it
57
+ $tempdoc += $rwdguivar # adds the file into the doc string
58
+ end
59
+ end
60
+ end
61
+ end
62
+
63
63
  # integrate the new configuration files
64
64
  MAINconfignew = "rwdconfig.cnf"
65
65
  MAINconfigdist = "rwdconfig.dist"
66
66
  Rconftool::install(MAINconfigdist,MAINconfignew)
67
67
 
68
- Dir.chdir("configuration") #changes the current working directory
69
-
70
- fileList = Dir.new(".").entries.sort.reverse.delete_if { |x| ! (x =~ /dist$/) } #creates an Array separated with \n
71
- @doc = ""
72
- fileList.length.times{ #opening of a block
73
- configdist =fileList.pop #pops the first item out of the Array
68
+ #load main config file
69
+ load 'rwdconfig.cnf'
70
+
71
+ Dir.chdir("configuration") #changes the current working directory
72
+
73
+ fileList = Dir.new(".").entries.sort.reverse.delete_if { |x| ! (x =~ /dist$/) } #creates an Array separated with \n
74
+ @doc = ""
75
+ fileList.length.times{ #opening of a block
76
+ configdist =fileList.pop #pops the first item out of the Array
74
77
  tempconfigfile = configdist.gsub(/\.dist$/, "")
75
78
  confignew = tempconfigfile + ".cnf"
76
79
  Rconftool::install(configdist,confignew) #integrates new file with old
77
80
  } #closing block
78
- # END of configuration integration
79
- Dir.chdir($progdir)
80
-
81
- # Read in the configuration files
82
- Dir.chdir("configuration") #changes the current working directory
83
-
84
- fileList = Dir.new(".").entries.sort.reverse.delete_if { |x| ! (x =~ /cnf$/) } #creates an Array separated with \n
85
- @doc = ""
86
- fileList.length.times{ #opening of a block
87
- fileName=fileList.pop #pops the first item out of the Array
88
- load fileName #loads the the config file thats in fileName
81
+ # END of configuration integration
82
+ Dir.chdir($progdir)
83
+
84
+ # Read in the configuration files
85
+ Dir.chdir("configuration") #changes the current working directory
86
+
87
+ fileList = Dir.new(".").entries.sort.reverse.delete_if { |x| ! (x =~ /cnf$/) } #creates an Array separated with \n
88
+ @doc = ""
89
+ fileList.length.times{ #opening of a block
90
+ fileName=fileList.pop #pops the first item out of the Array
91
+ load fileName #loads the the config file thats in fileName
89
92
  } #closing block
90
- # END of configuration reading
91
-
92
- Dir.chdir($progdir) # change back to top program directory
93
-
94
- # build the English Language hash file from the parts
95
- languagehashvariable = 'Message = Hash.new { |hh, kk| hh[kk] = "ERROR: Message not found: #{kk.inspect}."; hh[kk] }
96
- langmessage = {' + "\n"
97
- startlangdir = File.join(LangDir,"en")
98
- #get a list of the files and subdirectories on the starting directory only
99
- alanghash = Array.new(Dir[startlangdir].entries.sort)
100
- #loop through the list, ignore the files and add all new directories found
101
- alanghash.each do |x|
102
- #if a directory...
103
- if(test(?d,x))
104
- # add to the original list of directories
105
- @@tmproot = x + "/**"
106
- #adds the new ones to the array
107
- blanghash = Dir[@@tmproot].entries.sort
108
- blanghash.each do |x|
109
- if(test(?d,x))
110
- alanghash.push(x) #appends to the end of the array...
111
- end
112
- end
113
- end
114
- end
115
- alanghash.each do |x|
116
- #if it is a file...
117
- if(!test(?d,x))
118
- alanghash.delete(x)
119
- else #it is a directory...
120
- findfiles(x + "/**")
121
- end
122
- end
123
-
124
-
125
- #writes the contents of doc into the languagehashvariable
93
+ # END of configuration reading
94
+
95
+ Dir.chdir($progdir) # change back to top program directory
96
+
97
+ # build the English Language hash file from the parts
98
+ languagehashvariable = 'Message = Hash.new { |hh, kk| hh[kk] = "ERROR: Message not found: #{kk.inspect}."; hh[kk] }
99
+ langmessage = {' + "\n"
100
+ startlangdir = File.join(LangDir,"en")
101
+ #get a list of the files and subdirectories on the starting directory only
102
+ alanghash = Array.new(Dir[startlangdir].entries.sort)
103
+ #loop through the list, ignore the files and add all new directories found
104
+ alanghash.each do |x|
105
+ #if a directory...
106
+ if(test(?d,x))
107
+ # add to the original list of directories
108
+ @@tmproot = x + "/**"
109
+ #adds the new ones to the array
110
+ blanghash = Dir[@@tmproot].entries.sort
111
+ blanghash.each do |x|
112
+ if(test(?d,x))
113
+ alanghash.push(x) #appends to the end of the array...
114
+ end
115
+ end
116
+ end
117
+ end
118
+ alanghash.each do |x|
119
+ #if it is a file...
120
+ if(!test(?d,x))
121
+ alanghash.delete(x)
122
+ else #it is a directory...
123
+ findfiles(x + "/**")
124
+ end
125
+ end
126
+
127
+
128
+ #writes the contents of doc into the languagehashvariable
126
129
  languagehashvariable = languagehashvariable + $tempdoc + "} ; langmessage.each { |kk, vv| Message[kk] = vv }"
127
-
128
- # END of en Lang building
130
+
131
+ # END of en Lang building
129
132
  $tempdoc = " "
130
133
  Dir.chdir($progdir) # change back to top program directory
131
-
132
- # build the local Language hash file from the parts
133
- startlangdir = File.join(LangDir,$lang)
134
- #get a list of the files and subdirectories on the starting directory only
135
- alanghash = Array.new(Dir[startlangdir].entries.sort)
136
- #loop through the list, ignore the files and add all new directories found
137
- alanghash.each do |x|
138
- #if a directory...
139
- if(test(?d,x))
140
- # add to the original list of directories
141
- @@tmproot = x + "/**"
142
- #adds the new ones to the array
143
- blanghash = Dir[@@tmproot].entries.sort
144
- blanghash.each do |x|
145
- if(test(?d,x))
146
- alanghash.push(x) #appends to the end of the array...
147
- end
148
- end
149
- end
150
- end
151
- alanghash.each do |x|
152
- #if it is a file...
153
- if(!test(?d,x))
154
- alanghash.delete(x)
155
- else #it is a directory...
156
- findfiles(x + "/**")
157
- end
158
- end
159
-
160
-
161
- #writes the contents of doc into the variable
134
+
135
+ # build the local Language hash file from the parts
136
+ startlangdir = File.join(LangDir,$lang)
137
+ #get a list of the files and subdirectories on the starting directory only
138
+ alanghash = Array.new(Dir[startlangdir].entries.sort)
139
+ #loop through the list, ignore the files and add all new directories found
140
+ alanghash.each do |x|
141
+ #if a directory...
142
+ if(test(?d,x))
143
+ # add to the original list of directories
144
+ @@tmproot = x + "/**"
145
+ #adds the new ones to the array
146
+ blanghash = Dir[@@tmproot].entries.sort
147
+ blanghash.each do |x|
148
+ if(test(?d,x))
149
+ alanghash.push(x) #appends to the end of the array...
150
+ end
151
+ end
152
+ end
153
+ end
154
+ alanghash.each do |x|
155
+ #if it is a file...
156
+ if(!test(?d,x))
157
+ alanghash.delete(x)
158
+ else #it is a directory...
159
+ findfiles(x + "/**")
160
+ end
161
+ end
162
+
163
+
164
+ #writes the contents of doc into the variable
162
165
  languagehashvariable = languagehashvariable + " ; Message.update(" + $tempdoc + ' :rwdtinker => "Rwdtinker" ) '
163
-
164
166
 
165
- $tempdoc = " "
166
-
167
- Dir.chdir($progdir) # change back to top program directory
168
-
169
- temp = eval( languagehashvariable )
170
-
171
- $tempdoc = " "
172
-
173
- # build the actual program from the code parts
174
- #get a list of the files and subdirectories on the starting directory only
175
- a = Array.new(Dir[CodeDir].entries.sort)
176
- #loop through the list, ignore the files and add all new directories found
177
- a.each do |x|
178
- #if a directory...
179
- if(test(?d,x))
180
- # add to the original list of directories
181
- @@root = x + "/**"
182
- #adds the new ones to the array
183
- b = Dir[@@root].entries.sort
184
- b.each do |x|
185
- if(test(?d,x))
186
- a.push(x) #appends to the end of the array...
187
- end
188
- end
189
- end
190
- end
191
- a.each do |x|
192
- #if it is a file...
193
- if(!test(?d,x))
194
- a.delete(x)
195
- else #it is a directory...
196
- findfiles(x + "/**")
197
- end
198
- end
199
-
200
-
201
- # load the program file
202
- tempcoderesult = eval( $tempdoc )
203
-
204
- # build the actual GUI from the gui parts
205
- $tempdoc = " "
206
- #get a list of the files and subdirectories on the starting directory only
207
- a = Array.new(Dir[GuiDir].entries.sort)
208
- #loop through the list, ignore the files and add all new directories found
209
- a.each do |x|
210
- #if a directory...
211
- if(test(?d,x))
212
- #use this new dir find to add to the original list of directories
213
- @@root = x + "/**"
214
- #adds the new ones to the array
215
- b = Dir[@@root].entries.sort
216
- b.each do |x|
217
- if(test(?d,x))
218
- a.push(x) #appends to the end of the array...
219
- end
220
- end
221
- end
222
- end
223
- a.each do |x|
224
- #if it is a file...
225
- if(!test(?d,x))
226
- a.delete(x)
227
-
228
- else #it is a directory...
229
- loadguifile(x + "/**")
230
- end
231
- end
232
-
233
- # gui variable is done
234
- guiRWD = $tempdoc
235
-
236
- require 'socket' # Network stuff
237
- host = "127.0.0.1"
238
- port = $port
239
-
240
- # Create a socket to listen on and bind it to the host and port
241
- freeportfound = false
242
- until freeportfound
243
- begin
244
- @socket = UDPSocket::new()
245
- @socket.bind(host, port)
246
- freeportfound = true
247
- $port = port
248
- # Rescue the "Address in use" error
249
- rescue Errno::EADDRINUSE
250
- puts "RWD Startup: Port #{port} on host #{host} is already in use."
251
- port=port +1
252
- puts "trying port: #{port}"
253
- # Rescue the "Address not available' error
254
- rescue Errno::EADDRNOTAVAIL
255
- puts "RWD Startup: Address #{host} is not available to bind."
256
- port =port + 1
257
- puts "trying port: #{port}"
258
- # Rescue "permission denied errors
259
- rescue Errno::EACCES
260
- puts "RWD Startup: Access denied when binding interface addresses. ?"
261
- port =port + 1
262
- puts "trying port: #{port}"
263
- # Rescue all other errors
264
- rescue
265
- puts "RWD Startup: An error occured."
266
- port =port + 1
267
- puts "trying port: #{port}"
268
- # Rescue all other errors
269
- end
270
167
 
271
- end
168
+ $tempdoc = " "
169
+
170
+ Dir.chdir($progdir) # change back to top program directory
171
+
172
+ temp = eval( languagehashvariable )
173
+
174
+ $tempdoc = " "
175
+
176
+ # build the actual program from the code parts
177
+ #get a list of the files and subdirectories on the starting directory only
178
+ a = Array.new(Dir[CodeDir].entries.sort)
179
+ #loop through the list, ignore the files and add all new directories found
180
+ a.each do |x|
181
+ #if a directory...
182
+ if(test(?d,x))
183
+ # add to the original list of directories
184
+ @@root = x + "/**"
185
+ #adds the new ones to the array
186
+ b = Dir[@@root].entries.sort
187
+ b.each do |x|
188
+ if(test(?d,x))
189
+ a.push(x) #appends to the end of the array...
190
+ end
191
+ end
192
+ end
193
+ end
194
+ a.each do |x|
195
+ #if it is a file...
196
+ if(!test(?d,x))
197
+ a.delete(x)
198
+ else #it is a directory...
199
+ findfiles(x + "/**")
200
+ end
201
+ end
202
+
203
+
204
+ # load the program file
205
+ tempcoderesult = eval( $tempdoc )
206
+
207
+ # build the actual GUI from the gui parts
208
+ $tempdoc = " "
209
+ #get a list of the files and subdirectories on the starting directory only
210
+ a = Array.new(Dir[GuiDir].entries.sort)
211
+ #loop through the list, ignore the files and add all new directories found
212
+ a.each do |x|
213
+ #if a directory...
214
+ if(test(?d,x))
215
+ #use this new dir find to add to the original list of directories
216
+ @@root = x + "/**"
217
+ #adds the new ones to the array
218
+ b = Dir[@@root].entries.sort
219
+ b.each do |x|
220
+ if(test(?d,x))
221
+ a.push(x) #appends to the end of the array...
222
+ end
223
+ end
224
+ end
225
+ end
226
+ a.each do |x|
227
+ #if it is a file...
228
+ if(!test(?d,x))
229
+ a.delete(x)
230
+
231
+ else #it is a directory...
232
+ loadguifile(x + "/**")
233
+ end
234
+ end
235
+
236
+ # gui variable is done
237
+ guiRWD = $tempdoc
238
+
239
+ require 'socket' # Network stuff
240
+ host = "127.0.0.1"
241
+ port = $port
242
+
243
+ # Create a socket to listen on and bind it to the host and port
244
+ freeportfound = false
245
+ until freeportfound
246
+ begin
247
+ @socket = UDPSocket::new()
248
+ @socket.bind(host, port)
249
+ freeportfound = true
250
+ $port = port
251
+ # Rescue the "Address in use" error
252
+ rescue Errno::EADDRINUSE
253
+ puts "RWD Startup: Port #{port} on host #{host} is already in use."
254
+ port=port +1
255
+ puts "trying port: #{port}"
256
+ # Rescue the "Address not available' error
257
+ rescue Errno::EADDRNOTAVAIL
258
+ puts "RWD Startup: Address #{host} is not available to bind."
259
+ port =port + 1
260
+ puts "trying port: #{port}"
261
+ # Rescue "permission denied errors
262
+ rescue Errno::EACCES
263
+ puts "RWD Startup: Access denied when binding interface addresses. ?"
264
+ port =port + 1
265
+ puts "trying port: #{port}"
266
+ # Rescue all other errors
267
+ rescue
268
+ puts "RWD Startup: An error occured."
269
+ port =port + 1
270
+ puts "trying port: #{port}"
271
+ # Rescue all other errors
272
+ end
273
+
274
+ end
272
275
 
273
276
 
274
- RwdTinker.new( guiRWD).serve(port) # start the main class and program
277
+ RwdTinker.new( guiRWD).serve(port) # start the main class and program