rwdschedule 0.93 → 0.94

Sign up to get free protection for your applications and to get access to all the features.
Files changed (126) hide show
  1. data/Readme.txt +6 -0
  2. data/code/01rwdcore/01rwdcore.rb +20 -20
  3. data/code/01rwdcore/02helptexthashbegin.rb +4 -4
  4. data/code/01rwdcore/03helptexthash.rb +30 -47
  5. data/code/01rwdcore/04helptextend.rb +6 -6
  6. data/code/01rwdcore/openhelpwindow.rb +10 -24
  7. data/code/01rwdcore/returntomain.rb +10 -0
  8. data/code/01rwdcore/rwdtinkerversion.rb +15 -15
  9. data/code/01rwdcore/rwdwindowreturn.rb +9 -9
  10. data/code/superant.com.rwdtinkerbackwindow/controlclient.rb +100 -0
  11. data/code/superant.com.rwdtinkerbackwindow/diagnostictab.rb +21 -21
  12. data/code/superant.com.rwdtinkerbackwindow/helptexthashtinkerwin2.rb +37 -0
  13. data/code/superant.com.rwdtinkerbackwindow/installapplet.rb +21 -21
  14. data/code/superant.com.rwdtinkerbackwindow/listinstalledfiles.rb +1 -1
  15. data/code/superant.com.rwdtinkerbackwindow/listzips.rb +6 -6
  16. data/code/superant.com.rwdtinkerbackwindow/loadconfigurationrecord.rb +31 -31
  17. data/code/superant.com.rwdtinkerbackwindow/loadconfigurationvariables.rb +13 -13
  18. data/code/superant.com.rwdtinkerbackwindow/network.rb +87 -0
  19. data/code/superant.com.rwdtinkerbackwindow/openappletname.rb +18 -18
  20. data/code/superant.com.rwdtinkerbackwindow/openhelpwindowtinkerwin2.rb +39 -0
  21. data/code/superant.com.rwdtinkerbackwindow/removeapplet.rb +28 -28
  22. data/code/superant.com.rwdtinkerbackwindow/runrwdtinkerbackwindow.rb +11 -11
  23. data/code/superant.com.rwdtinkerbackwindow/rwdtinkerwin2version.rb +14 -14
  24. data/code/superant.com.rwdtinkerbackwindow/saveconfigurationrecord.rb +18 -18
  25. data/code/superant.com.rwdtinkerbackwindow/viewappletcontents.rb +21 -0
  26. data/code/superant.com.schedule/helptexthashrwdschedule.rb +19 -3
  27. data/code/superant.com.schedule/{openhelpwindowrubyslippers.rb → openhelpwindowrwdschedule.rb} +11 -2
  28. data/code/superant.com.schedule/returntomain.rb +10 -0
  29. data/code/superant.com.schedule/runrwdschedulemenu1.rb +34 -0
  30. data/code/zz0applicationend/zz0end.rb +4 -4
  31. data/configuration/language.cnf +5 -5
  32. data/configuration/rwdapplicationidentity.cnf +3 -0
  33. data/configuration/rwdscheduleversion.cnf +1 -1
  34. data/configuration/rwdtinker.cnf +1 -0
  35. data/configuration/rwdtinkerversion.cnf +2 -2
  36. data/configuration/tinkerwin2variables.cnf +8 -8
  37. data/configuration/tinkerwin2version.cnf +3 -3
  38. data/ev/browser.rb +109 -109
  39. data/ev/ftools.rb +170 -170
  40. data/ev/net.rb +750 -750
  41. data/ev/ruby.rb +819 -819
  42. data/ev/rwd.rb +1849 -1848
  43. data/ev/sgml.rb +236 -236
  44. data/ev/thread.rb +63 -63
  45. data/ev/tree.rb +343 -343
  46. data/ev/xml.rb +4 -4
  47. data/gui/00coreguibegin/applicationguitop.rwd +4 -4
  48. data/gui/frontwindow0/superant.com.rwdschedules/gg0viewevent.rwd +1 -1
  49. data/gui/frontwindow0/superant.com.rwdschedules/gl6editrecord.rwd +10 -10
  50. data/gui/frontwindow0/superant.com.rwdschedules/gl8contactutilities.rwd +1 -0
  51. data/gui/frontwindow0/superant.com.zmenus/m01menubegin.rwd +10 -0
  52. data/gui/frontwindow0/superant.com.zmenus/m02menu.rwd +36 -0
  53. data/gui/frontwindow0/superant.com.zmenus/m03menu.rwd +12 -0
  54. data/gui/frontwindow0/superant.com.zmenus/m85menu.rwd +21 -0
  55. data/gui/frontwindow0/superant.com.zmenus/m88menu.rwd +12 -0
  56. data/gui/frontwindow0/superant.com.zmenus/m99menuend.rwd +3 -0
  57. data/gui/frontwindowselectionbegin/selectiontabbegin/selectiontabbegin.rwd +16 -16
  58. data/gui/frontwindowselections/superant.com.rwdtinkerwin2selectiontab/rwdwin2selectiontab.rwd +12 -12
  59. data/gui/frontwindowselectionzend/viewselectionzend/viewselectionend.rwd +3 -3
  60. data/gui/frontwindowtdocumentbegin/superant.com.documentsbegin/tt0documentbegin.rwd +6 -6
  61. data/gui/frontwindowtdocuments/superant.com.documents/uu5documents.rwd +15 -15
  62. data/gui/frontwindowtdocuments/superant.com.tinkerwin2documents/uu5documents.rwd +6 -6
  63. data/gui/frontwindowtdocumentzend/superant.com.documentsend/ww0documentend.rwd +12 -12
  64. data/gui/frontwindowz1end/frontwindowend/xx0rwdfirsttab.rwd +6 -6
  65. data/gui/helpaboutbegin/superant.com.helpaboutbegin/ya0helpscreenstart.rwd +3 -3
  66. data/gui/helpaboutinstalled/superant.com.rwdwin2helpabout/1appname.rwd +4 -4
  67. data/gui/helpaboutinstalled/superant.com.rwdwin2helpabout/3copyright.rwd +3 -3
  68. data/gui/helpaboutinstalled/superant.com.rwdwin2helpabout/5version.rwd +10 -10
  69. data/gui/helpaboutinstalled/superant.com.tinkerhelpabout/1appname.rwd +4 -4
  70. data/gui/helpaboutinstalled/superant.com.tinkerhelpabout/3copyright.rwd +3 -3
  71. data/gui/helpaboutinstalled/superant.com.tinkerhelpabout/5version.rwd +10 -10
  72. data/gui/helpaboutzend/superant.com.helpaboutend/helpscreenend.rwd +2 -2
  73. data/gui/tinkerbackwindows/superant.com.rwdschedulebackwindow/67viewconfiguration.rwd +38 -0
  74. data/gui/tinkerbackwindows/superant.com.rwdschedulebackwindow/m01menubegin.rwd +10 -0
  75. data/gui/tinkerbackwindows/superant.com.rwdschedulebackwindow/m02menu.rwd +36 -0
  76. data/gui/tinkerbackwindows/superant.com.rwdschedulebackwindow/m03menu.rwd +12 -0
  77. data/gui/tinkerbackwindows/superant.com.rwdschedulebackwindow/m85menu.rwd +21 -0
  78. data/gui/tinkerbackwindows/superant.com.rwdschedulebackwindow/m88menu.rwd +12 -0
  79. data/gui/tinkerbackwindows/superant.com.rwdschedulebackwindow/m99menuend.rwd +3 -0
  80. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/1appname.rwd +5 -5
  81. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/{50rwdlistzips.rwd → 40rwdlistzips.rwd} +42 -35
  82. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/50rwdlistapplets.rwd +44 -44
  83. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/60editconfiguration.rwd +38 -37
  84. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/70rwddiagnostics.rwd +33 -33
  85. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/75rwdcontrol.rwd +33 -0
  86. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/80tab1.rwd +11 -11
  87. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/9backend.rwd +6 -6
  88. data/gui/tinkerbackwindows/superant.com.tinkerhelpwindow/1appname.rwd +30 -31
  89. data/gui/tinkerbackwindows/superant.com.tinkerhelpwindow/9end.rwd +4 -4
  90. data/gui/tinkerbackwindows/superant.com.versionwindow/1appname.rwd +19 -19
  91. data/gui/zzcoreguiend/tinkerapplicationguiend/yy9rwdend.rwd +4 -4
  92. data/init.rb +269 -233
  93. data/installed/rwdtinkerwin2-0.5.inf +8 -8
  94. data/lang/alanguagehashbegin.rb +4 -4
  95. data/lang/en/rwdcore/languagefile.rb +15 -15
  96. data/lang/es/rwdcore/languagefile-es.rb +14 -14
  97. data/lang/jp/rwdcore/languagefile.rb +9 -9
  98. data/lang/languagehash.rb +4 -4
  99. data/lang/nl/rwdcore/languagefile.rb +19 -19
  100. data/lang/vlanguagehashend.rb +6 -6
  101. data/lang/wlocallangstart.rb +5 -5
  102. data/lang/zlocallangend.rb +2 -2
  103. data/lib/temp.rb +1 -1
  104. data/rwd_files/HowTo_Schedule.txt +6 -0
  105. data/rwd_files/HowTo_Tinker.txt +361 -348
  106. data/rwd_files/HowTo_TinkerWin2.txt +202 -202
  107. data/rwd_files/Readme.txt +57 -57
  108. data/rwd_files/rdoc-style.css +174 -174
  109. data/rwd_files/rwdapplications.html +54 -54
  110. data/tests/totranslate.lang +93 -0
  111. data/zips/rwdahelloworld-0.5.zip +0 -0
  112. data/zips/rwdwcalc-0.50.zip +0 -0
  113. metadata +33 -17
  114. data/configuration/rwdplayscriptsversion.cnf +0 -2
  115. data/gui/frontwindow0/superant.com.rwdschedules/zviewconfiguration.rwd +0 -38
  116. data/gui/tinkerbackwindows/superant.com.rwdschedulebackwindow/66viewconfiguration.rwd +0 -16
  117. data/gui/tinkerbackwindows/superant.com.rwdschedulebackwindow/80returntab.rwd +0 -11
  118. data/installed/rwdviewlogo-0.4.inf +0 -4
  119. data/rwd_files/tinker.png +0 -0
  120. data/updates/200502Februay01 Lynn back.sch +0 -8
  121. data/updates/200502Februay21 PCU Diner.sch +0 -8
  122. data/updates/200502february16a.sch +0 -8
  123. data/updates/200505may02a.sch +0 -8
  124. data/updates/200506june20a.sch +0 -8
  125. data/updates/200506june29a.sch +0 -8
  126. data/updates/200510october26a.sch +0 -8
@@ -1,11 +1,11 @@
1
- $rwdguivar=
2
- "
3
- <tab name=\"backone\" caption=\"Back Tab\">
4
-
5
- <row> You can return to the previous window</row>
6
- <row><p> </row>
7
- <row><p> </row>
8
- <button caption=\"Return to top menu\" action=\"main\"/>
9
-
10
- </tab>"
11
-
1
+ $rwdguivar=
2
+ "
3
+ <tab name=\"backone\" caption=\"Back Tab\">
4
+
5
+ <row> You can return to the previous window</row>
6
+ <row><p> </row>
7
+ <row><p> </row>
8
+ <button caption=\"Return to top menu\" action=\"returntomain\"/>
9
+
10
+ </tab>"
11
+
@@ -1,6 +1,6 @@
1
- $rwdguivar=
2
- "
3
- </tabs>
4
- </window>"
5
-
6
-
1
+ $rwdguivar=
2
+ "
3
+ </tabs>
4
+ </window>"
5
+
6
+
@@ -1,32 +1,31 @@
1
- $rwdguivar=
2
- "
3
- <window name = \"rwdtinkerhelpwindow\" title=#{Message[:rwdtinker_help]}>
4
- <horizontal>
5
- %rwdhelptopic%
6
- </horizontal>
7
-
8
- <table>
9
- <row> <p></row>
10
-
11
- </table>
12
- <horizontal>
13
- %rwdhelpdataoutput%
14
- </horizontal>
15
- <row> <p></row>
16
- <table>
17
-
18
-
19
- <row> <p></row>
20
- </table>
21
- <horizontal>
22
-
23
- <button caption=\"Return\" action=\"rwdwindowreturn\"/>
24
- </horizontal>
25
- <table>
26
- <row> <p></row>
27
-
28
- </table>
29
- <horizontal>
30
- %%rwdhelpsubchoicesoutput%%
31
- </horizontal>
1
+ $rwdguivar=
2
+ "
3
+ <window name = \"rwdtinkerhelpwindow\" title=#{Message[:rwdtinker_help]}>
4
+ <horizontal>
5
+ %rwdhelptopic%
6
+ </horizontal>
7
+
8
+ <table>
9
+ <row> <p></row>
10
+
11
+ </table>
12
+ <horizontal>
13
+ %rwdhelpdataoutput%
14
+ </horizontal>
15
+ <row> <p></row>
16
+ <table>
17
+
18
+
19
+ <row> <p></row>
20
+ </table>
21
+ <horizontal>
22
+
23
+ <button caption=\"Return\" action=\"rwdwindowreturn\"/>
24
+ </horizontal>
25
+ <table>
26
+ <row> <p></row>
27
+
28
+ </table>
29
+
30
+ %%rwdhelpsubchoicesoutput%%
32
31
  "
@@ -1,4 +1,4 @@
1
- $rwdguivar=
2
- "</window>"
3
-
4
-
1
+ $rwdguivar=
2
+ "</window>"
3
+
4
+
@@ -1,19 +1,19 @@
1
- $rwdguivar=
2
- "
3
- <window name = \"applicationversion\" title=\"Application Version\">
4
-
5
- <row> <p></row>
6
- <p>%versionappnamedisplay%</p>
7
- <row> <p></row>
8
- <p>%versioncopyrightdisplay%</p>
9
-
10
- <row> <p></row>
11
- <p>%versionnumberdisplay%</p>
12
-
13
- <horizontal>
14
- <cancel/>
15
- </horizontal>
16
-
17
- </window>"
18
-
19
-
1
+ $rwdguivar=
2
+ "
3
+ <window name = \"applicationversion\" title=\"Application Version\">
4
+
5
+ <row> <p></row>
6
+ <p>%versionappnamedisplay%</p>
7
+ <row> <p></row>
8
+ <p>%versioncopyrightdisplay%</p>
9
+
10
+ <row> <p></row>
11
+ <p>%versionnumberdisplay%</p>
12
+
13
+ <horizontal>
14
+ <cancel/>
15
+ </horizontal>
16
+
17
+ </window>"
18
+
19
+
@@ -1,4 +1,4 @@
1
- $rwdguivar=
2
- "
3
- </application>"
4
-
1
+ $rwdguivar=
2
+ "
3
+ </application>"
4
+
data/init.rb CHANGED
@@ -1,233 +1,269 @@
1
-
2
- #***********************************************************************
3
- #* Rwd/Tinker -- A Ruby program for the RudyWebDialog.
4
- #* Copyright (c) 2004, 2005 by Steven Gibson. All Rights Reserved.
5
- #*
6
- #* This library is free software; you can redistribute it and/or
7
- #* modify it under the terms of the GNU General Public
8
- #* License as published by the Free Software Foundation; either
9
- #* .
10
- #*
11
- #* These files are distributed in the hope that they will be useful,
12
- #* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- #* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
- #* General Public License for more details.
15
- #*
16
- #* You should have received a copy of the GNU General Public
17
- #* License along with these files; if not, write to the Free Software
18
- #* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
- #*
20
- #* For further information please contact the author by e-mail
21
- #* at "steven@superant.com".
22
- #***********************************************************************/
23
-
24
- require "ev/rwd"
25
- require 'fileutils'
26
-
27
- $progdir = File::expand_path( File.dirname(__FILE__))
28
-
29
- $tempdoc = " "
30
-
31
- def findfiles(d)
32
- a = Array.new(Dir[d].entries.sort)
33
- #loop through and get the files names
34
- a.each do |x|
35
- #adjust the filters to the files you want to see...
36
- if(!test(?d,x))
37
- # only rwd files
38
- if x =~ /rb|rwd|txt/
39
- fileA=File.open("#{x}","r") #opens the file thats in fileName as read only
40
- $tempdoc+=fileA.read #reads the file into the doc string
41
- fileA.close
42
- end
43
- end
44
- end
45
- end
46
- def loadguifile(d)
47
- a = Array.new(Dir[d].entries.sort)
48
- #loop through and get the files names
49
- a.each do |x|
50
- #adjust the filters to the files you want to see...
51
- if(!test(?d,x))
52
- # only rwd files
53
- if x =~ /rb|rwd|txt/
54
- load x #opens the file thats in fileName and reads it
55
- $tempdoc += $rwdguivar # adds the file into the doc string
56
- end
57
- end
58
- end
59
- end
60
-
61
- # Read in the configuration files
62
-
63
- Dir.chdir("configuration") #changes the current working directory
64
-
65
- fileList = Dir.new(".").entries.sort.reverse.delete_if { |x| ! (x =~ /cnf$/) } #creates an Array separated with \n
66
- @doc = ""
67
- fileList.length.times{ #opening of a block
68
- fileName=fileList.pop #pops the first item out of the Array
69
- load fileName #loads the the config file thats in fileName
70
- } #closing block
71
- # END of configuration reading
72
-
73
- Dir.chdir($progdir) # change back to top program directory
74
-
75
- # build the English Language hash file from the parts
76
- startlangdir = File.join(LangDir,"en")
77
- #get a list of the files and subdirectories on the starting directory only
78
- alanghash = Array.new(Dir[startlangdir].entries.sort)
79
- #loop through the list, ignore the files and add all new directories found
80
- alanghash.each do |x|
81
- #if a directory...
82
- if(test(?d,x))
83
- # add to the original list of directories
84
- @@tmproot = x + "/**"
85
- #adds the new ones to the array
86
- blanghash = Dir[@@tmproot].entries.sort
87
- blanghash.each do |x|
88
- if(test(?d,x))
89
- alanghash.push(x) #appends to the end of the array...
90
- end
91
- end
92
- end
93
- end
94
- alanghash.each do |x|
95
- #if it is a file...
96
- if(!test(?d,x))
97
- alanghash.delete(x)
98
- else #it is a directory...
99
- findfiles(x + "/**")
100
- end
101
- end
102
-
103
- fileLangHash=File.open(TempLangHashFile,"w") #deletes and opens a the file in fileName
104
- fileLangHash.write($tempdoc) #writes the contents of doc into the file
105
- fileLangHash.close
106
- # END of Lang building
107
- $tempdoc = " "
108
- Dir.chdir($progdir) # change back to top program directory
109
-
110
- # build the local Language hash file from the parts
111
- startlangdir = File.join(LangDir,$lang)
112
- #get a list of the files and subdirectories on the starting directory only
113
- alanghash = Array.new(Dir[startlangdir].entries.sort)
114
- #loop through the list, ignore the files and add all new directories found
115
- alanghash.each do |x|
116
- #if a directory...
117
- if(test(?d,x))
118
- # add to the original list of directories
119
- @@tmproot = x + "/**"
120
- #adds the new ones to the array
121
- blanghash = Dir[@@tmproot].entries.sort
122
- blanghash.each do |x|
123
- if(test(?d,x))
124
- alanghash.push(x) #appends to the end of the array...
125
- end
126
- end
127
- end
128
- end
129
- alanghash.each do |x|
130
- #if it is a file...
131
- if(!test(?d,x))
132
- alanghash.delete(x)
133
- else #it is a directory...
134
- findfiles(x + "/**")
135
- end
136
- end
137
-
138
- filelocalLangHash=File.open(LocalLangHashFile,"w") #deletes and opens a the file in fileName
139
- filelocalLangHash.write($tempdoc) #writes the contents of doc into the file
140
- filelocalLangHash.close
141
-
142
- $tempdoc = " "
143
-
144
- Dir.chdir($progdir) # change back to top program directory
145
-
146
- # build the language hash constant object from the lang parts
147
- #get a list of the files in lang directory only
148
- alangfile = Dir.new(LangDir).entries.sort.reverse.delete_if { |x| ! (x =~ /rb$/) }
149
- alangfile.length.times{
150
- fileName = alangfile.pop
151
- Dir.chdir($progdir)
152
- Dir.chdir(LangDir)
153
- fileLangA=File.open("#{fileName}","r") #opens the file thats in fileName as read only
154
- $tempdoc += fileLangA.read #reads the file into the doc string
155
- fileLangA.close
156
- }
157
-
158
- Dir.chdir($progdir)
159
- fileLangB=File.open(LangNameFile,"w") #deletes and opens a the file in fileName
160
- fileLangB.write($tempdoc) #writes the contents of doc into the file
161
- fileLangB.close
162
- load LangNameFile # load the file
163
-
164
- $tempdoc = " "
165
-
166
- # build the actual program from the code parts
167
- #get a list of the files and subdirectories on the starting directory only
168
- a = Array.new(Dir[CodeDir].entries.sort)
169
- #loop through the list, ignore the files and add all new directories found
170
- a.each do |x|
171
- #if a directory...
172
- if(test(?d,x))
173
- # add to the original list of directories
174
- @@root = x + "/**"
175
- #adds the new ones to the array
176
- b = Dir[@@root].entries.sort
177
- b.each do |x|
178
- if(test(?d,x))
179
- a.push(x) #appends to the end of the array...
180
- end
181
- end
182
- end
183
- end
184
- a.each do |x|
185
- #if it is a file...
186
- if(!test(?d,x))
187
- a.delete(x)
188
- else #it is a directory...
189
- findfiles(x + "/**")
190
- end
191
- end
192
-
193
- fileB=File.open(CodeNameFile,"w") #deletes and opens a the file in fileName
194
- fileB.write($tempdoc) #writes the contents of doc into the file
195
- fileB.close
196
- require CodeName # load the program file
197
-
198
- # build the actual GUI from the gui parts
199
- $tempdoc = " "
200
- #get a list of the files and subdirectories on the starting directory only
201
- a = Array.new(Dir[GuiDir].entries.sort)
202
- #loop through the list, ignore the files and add all new directories found
203
- a.each do |x|
204
- #if a directory...
205
- if(test(?d,x))
206
- #use this new dir find to add to the original list of directories
207
- @@root = x + "/**"
208
- #adds the new ones to the array
209
- b = Dir[@@root].entries.sort
210
- b.each do |x|
211
- if(test(?d,x))
212
- a.push(x) #appends to the end of the array...
213
- end
214
- end
215
- end
216
- end
217
- a.each do |x|
218
- #if it is a file...
219
- if(!test(?d,x))
220
- a.delete(x)
221
-
222
- else #it is a directory...
223
- loadguifile(x + "/**")
224
- end
225
- end
226
-
227
- fileB=File.open(RWDFile,"w") #deletes and opens a the file in fileName
228
- fileB.write($tempdoc) #writes the contents of doc into the file
229
- fileB.close
230
-
231
-
232
-
233
- RwdTinker.file(RWDFile).serve($port) # start the main class and program
1
+
2
+ #***********************************************************************
3
+ #* Rwd/Tinker -- A Ruby program for the RudyWebDialog.
4
+ #* Copyright (c) 2004, 2005 by Steven Gibson. All Rights Reserved.
5
+ #*
6
+ #* This library is free software; you can redistribute it and/or
7
+ #* modify it under the terms of the GNU General Public
8
+ #* License as published by the Free Software Foundation; either
9
+ #* .
10
+ #*
11
+ #* These files are distributed in the hope that they will be useful,
12
+ #* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ #* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
+ #* General Public License for more details.
15
+ #*
16
+ #* You should have received a copy of the GNU General Public
17
+ #* License along with these files; if not, write to the Free Software
18
+ #* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
+ #*
20
+ #* For further information please contact the author by e-mail
21
+ #* at "steven@superant.com".
22
+ #***********************************************************************/
23
+
24
+ require "ev/rwd"
25
+ require 'fileutils'
26
+
27
+ $progdir = File::expand_path( File.dirname(__FILE__))
28
+
29
+ $tempdoc = " "
30
+
31
+ def findfiles(d)
32
+ a = Array.new(Dir[d].entries.sort)
33
+ #loop through and get the files names
34
+ a.each do |x|
35
+ #adjust the filters to the files you want to see...
36
+ if(!test(?d,x))
37
+ # only rwd files
38
+ if x =~ /rb|rwd|txt/
39
+ fileA=File.open("#{x}","r") #opens the file thats in fileName as read only
40
+ $tempdoc+=fileA.read #reads the file into the doc string
41
+ fileA.close
42
+ end
43
+ end
44
+ end
45
+ end
46
+ def loadguifile(d)
47
+ a = Array.new(Dir[d].entries.sort)
48
+ #loop through and get the files names
49
+ a.each do |x|
50
+ #adjust the filters to the files you want to see...
51
+ if(!test(?d,x))
52
+ # only rwd files
53
+ if x =~ /rb|rwd|txt/
54
+ load x #opens the file thats in fileName and reads it
55
+ $tempdoc += $rwdguivar # adds the file into the doc string
56
+ end
57
+ end
58
+ end
59
+ end
60
+
61
+ # Read in the configuration files
62
+
63
+ Dir.chdir("configuration") #changes the current working directory
64
+
65
+ fileList = Dir.new(".").entries.sort.reverse.delete_if { |x| ! (x =~ /cnf$/) } #creates an Array separated with \n
66
+ @doc = ""
67
+ fileList.length.times{ #opening of a block
68
+ fileName=fileList.pop #pops the first item out of the Array
69
+ load fileName #loads the the config file thats in fileName
70
+ } #closing block
71
+ # END of configuration reading
72
+
73
+ Dir.chdir($progdir) # change back to top program directory
74
+
75
+ # build the English Language hash file from the parts
76
+ startlangdir = File.join(LangDir,"en")
77
+ #get a list of the files and subdirectories on the starting directory only
78
+ alanghash = Array.new(Dir[startlangdir].entries.sort)
79
+ #loop through the list, ignore the files and add all new directories found
80
+ alanghash.each do |x|
81
+ #if a directory...
82
+ if(test(?d,x))
83
+ # add to the original list of directories
84
+ @@tmproot = x + "/**"
85
+ #adds the new ones to the array
86
+ blanghash = Dir[@@tmproot].entries.sort
87
+ blanghash.each do |x|
88
+ if(test(?d,x))
89
+ alanghash.push(x) #appends to the end of the array...
90
+ end
91
+ end
92
+ end
93
+ end
94
+ alanghash.each do |x|
95
+ #if it is a file...
96
+ if(!test(?d,x))
97
+ alanghash.delete(x)
98
+ else #it is a directory...
99
+ findfiles(x + "/**")
100
+ end
101
+ end
102
+
103
+ fileLangHash=File.open(TempLangHashFile,"w") #deletes and opens a the file in fileName
104
+ fileLangHash.write($tempdoc) #writes the contents of doc into the file
105
+ fileLangHash.close
106
+ # END of Lang building
107
+ $tempdoc = " "
108
+ Dir.chdir($progdir) # change back to top program directory
109
+
110
+ # build the local Language hash file from the parts
111
+ startlangdir = File.join(LangDir,$lang)
112
+ #get a list of the files and subdirectories on the starting directory only
113
+ alanghash = Array.new(Dir[startlangdir].entries.sort)
114
+ #loop through the list, ignore the files and add all new directories found
115
+ alanghash.each do |x|
116
+ #if a directory...
117
+ if(test(?d,x))
118
+ # add to the original list of directories
119
+ @@tmproot = x + "/**"
120
+ #adds the new ones to the array
121
+ blanghash = Dir[@@tmproot].entries.sort
122
+ blanghash.each do |x|
123
+ if(test(?d,x))
124
+ alanghash.push(x) #appends to the end of the array...
125
+ end
126
+ end
127
+ end
128
+ end
129
+ alanghash.each do |x|
130
+ #if it is a file...
131
+ if(!test(?d,x))
132
+ alanghash.delete(x)
133
+ else #it is a directory...
134
+ findfiles(x + "/**")
135
+ end
136
+ end
137
+
138
+ filelocalLangHash=File.open(LocalLangHashFile,"w") #deletes and opens a the file in fileName
139
+ filelocalLangHash.write($tempdoc) #writes the contents of doc into the file
140
+ filelocalLangHash.close
141
+
142
+ $tempdoc = " "
143
+
144
+ Dir.chdir($progdir) # change back to top program directory
145
+
146
+ # build the language hash constant object from the lang parts
147
+ #get a list of the files in lang directory only
148
+ alangfile = Dir.new(LangDir).entries.sort.reverse.delete_if { |x| ! (x =~ /rb$/) }
149
+ alangfile.length.times{
150
+ fileName = alangfile.pop
151
+ Dir.chdir($progdir)
152
+ Dir.chdir(LangDir)
153
+ fileLangA=File.open("#{fileName}","r") #opens the file thats in fileName as read only
154
+ $tempdoc += fileLangA.read #reads the file into the doc string
155
+ fileLangA.close
156
+ }
157
+
158
+ Dir.chdir($progdir)
159
+ fileLangB=File.open(LangNameFile,"w") #deletes and opens a the file in fileName
160
+ fileLangB.write($tempdoc) #writes the contents of doc into the file
161
+ fileLangB.close
162
+ load LangNameFile # load the file
163
+
164
+ $tempdoc = " "
165
+
166
+ # build the actual program from the code parts
167
+ #get a list of the files and subdirectories on the starting directory only
168
+ a = Array.new(Dir[CodeDir].entries.sort)
169
+ #loop through the list, ignore the files and add all new directories found
170
+ a.each do |x|
171
+ #if a directory...
172
+ if(test(?d,x))
173
+ # add to the original list of directories
174
+ @@root = x + "/**"
175
+ #adds the new ones to the array
176
+ b = Dir[@@root].entries.sort
177
+ b.each do |x|
178
+ if(test(?d,x))
179
+ a.push(x) #appends to the end of the array...
180
+ end
181
+ end
182
+ end
183
+ end
184
+ a.each do |x|
185
+ #if it is a file...
186
+ if(!test(?d,x))
187
+ a.delete(x)
188
+ else #it is a directory...
189
+ findfiles(x + "/**")
190
+ end
191
+ end
192
+
193
+ fileB=File.open(CodeNameFile,"w") #deletes and opens a the file in fileName
194
+ fileB.write($tempdoc) #writes the contents of doc into the file
195
+ fileB.close
196
+ require CodeName # load the program file
197
+
198
+ # build the actual GUI from the gui parts
199
+ $tempdoc = " "
200
+ #get a list of the files and subdirectories on the starting directory only
201
+ a = Array.new(Dir[GuiDir].entries.sort)
202
+ #loop through the list, ignore the files and add all new directories found
203
+ a.each do |x|
204
+ #if a directory...
205
+ if(test(?d,x))
206
+ #use this new dir find to add to the original list of directories
207
+ @@root = x + "/**"
208
+ #adds the new ones to the array
209
+ b = Dir[@@root].entries.sort
210
+ b.each do |x|
211
+ if(test(?d,x))
212
+ a.push(x) #appends to the end of the array...
213
+ end
214
+ end
215
+ end
216
+ end
217
+ a.each do |x|
218
+ #if it is a file...
219
+ if(!test(?d,x))
220
+ a.delete(x)
221
+
222
+ else #it is a directory...
223
+ loadguifile(x + "/**")
224
+ end
225
+ end
226
+
227
+ fileB=File.open(RWDFile,"w") #deletes and opens a the file in fileName
228
+ fileB.write($tempdoc) #writes the contents of doc into the file
229
+ fileB.close
230
+
231
+ require 'socket' # Network stuff
232
+ host = "127.0.0.1"
233
+ port = $port
234
+
235
+ # Create a socket to listen on and bind it to the host and port
236
+ freeportfound = false
237
+ until freeportfound
238
+ begin
239
+ @socket = UDPSocket::new()
240
+ @socket.bind(host, port)
241
+ freeportfound = true
242
+ $port = port
243
+ # Rescue the "Address in use" error
244
+ rescue Errno::EADDRINUSE
245
+ puts "RWD Startup: Port #{port} on host #{host} is already in use."
246
+ port=port +1
247
+ puts "trying port: #{port}"
248
+ # Rescue the "Address not available' error
249
+ rescue Errno::EADDRNOTAVAIL
250
+ puts "RWD Startup: Address #{host} is not available to bind."
251
+ port =port + 1
252
+ puts "trying port: #{port}"
253
+ # Rescue "permission denied errors
254
+ rescue Errno::EACCES
255
+ puts "RWD Startup: Access denied when binding interface addresses. ?"
256
+ port =port + 1
257
+ puts "trying port: #{port}"
258
+ # Rescue all other errors
259
+ rescue
260
+ puts "RWD Startup: An error occured."
261
+ port =port + 1
262
+ puts "trying port: #{port}"
263
+ # Rescue all other errors
264
+ end
265
+
266
+ end
267
+
268
+
269
+ RwdTinker.file(RWDFile).serve(port) # start the main class and program