rwdfoldeditor 0.01
Sign up to get free protection for your applications and to get access to all the features.
- data/Readme.txt +462 -0
- data/bin/rwdfoldeditor +19 -0
- data/code/01rwdcore/01rwdcore.rb +29 -0
- data/code/01rwdcore/02helptexthashbegin.rb +4 -0
- data/code/01rwdcore/03helptexthash.rb +23 -0
- data/code/01rwdcore/04helptextend.rb +6 -0
- data/code/01rwdcore/jumplinkcommand.rb +26 -0
- data/code/01rwdcore/openhelpwindow.rb +31 -0
- data/code/01rwdcore/returntomain.rb +10 -0
- data/code/01rwdcore/rundocuments.rb +10 -0
- data/code/01rwdcore/runeditconfiguration.rb +10 -0
- data/code/01rwdcore/runhelpabout.rb +10 -0
- data/code/01rwdcore/runopentinkerdocument.rb +7 -0
- data/code/01rwdcore/rwdtinkerversion.rb +22 -0
- data/code/01rwdcore/rwdwindowreturn.rb +9 -0
- data/code/01rwdcore/selectiontab.rb +9 -0
- data/code/01rwdcore/setuphelpaboutoptions.rb +13 -0
- data/code/01rwdcore/setuptinkerdocuments.rb +6 -0
- data/code/01rwdcore/test_cases.rb +109 -0
- data/code/01rwdcore/test_harness.rb +13 -0
- data/code/01rwdcore/uploadreturns.rb +62 -0
- data/code/dd0viewphoto/dd0viewphoto.rb +3 -0
- data/code/superant.com.foldeditor/0uninstallapplet.rb +10 -0
- data/code/superant.com.foldeditor/changehypernotename.rb +21 -0
- data/code/superant.com.foldeditor/chooselinkfile.rb +6 -0
- data/code/superant.com.foldeditor/choosenotefile.rb +6 -0
- data/code/superant.com.foldeditor/createnewnotehtml.rb +31 -0
- data/code/superant.com.foldeditor/helptexthashrwdhypernote.rb +38 -0
- data/code/superant.com.foldeditor/hyperlinkcreatelinkfile.rb +19 -0
- data/code/superant.com.foldeditor/listfoldeditorfiles.rb +7 -0
- data/code/superant.com.foldeditor/loadfolddocument.rb +21 -0
- data/code/superant.com.foldeditor/loadrwdfoldeditlinkfile.rb +19 -0
- data/code/superant.com.foldeditor/openhelpwindowrwdhyernote.rb +30 -0
- data/code/superant.com.foldeditor/runrwdapplet.rb +10 -0
- data/code/superant.com.foldeditor/rwddisplayfoldlinks.rb +33 -0
- data/code/superant.com.foldeditor/rwdtinkerversion.rb +10 -0
- data/code/superant.com.foldeditor/savefoldlinkfile.rb +20 -0
- data/code/superant.com.foldeditor/savehtmlhypernoterecord.rb +20 -0
- data/code/superant.com.rwdtinkerbackwindow/diagnostictab.rb +19 -0
- data/code/superant.com.rwdtinkerbackwindow/helptexthashtinkerwin2.rb +61 -0
- data/code/superant.com.rwdtinkerbackwindow/initiateapplets.rb +240 -0
- data/code/superant.com.rwdtinkerbackwindow/installgemapplet.rb +34 -0
- data/code/superant.com.rwdtinkerbackwindow/installremotegem.rb +20 -0
- data/code/superant.com.rwdtinkerbackwindow/listgemdirs.rb +12 -0
- data/code/superant.com.rwdtinkerbackwindow/listgemzips.rb +53 -0
- data/code/superant.com.rwdtinkerbackwindow/listinstalledfiles.rb +12 -0
- data/code/superant.com.rwdtinkerbackwindow/listzips.rb +27 -0
- data/code/superant.com.rwdtinkerbackwindow/loadconfigurationrecord.rb +22 -0
- data/code/superant.com.rwdtinkerbackwindow/loadconfigurationvariables.rb +14 -0
- data/code/superant.com.rwdtinkerbackwindow/network.rb +87 -0
- data/code/superant.com.rwdtinkerbackwindow/openappletname.rb +19 -0
- data/code/superant.com.rwdtinkerbackwindow/openhelpwindowtinkerwin2.rb +38 -0
- data/code/superant.com.rwdtinkerbackwindow/remotegemlist.rb +24 -0
- data/code/superant.com.rwdtinkerbackwindow/removeapplet.rb +46 -0
- data/code/superant.com.rwdtinkerbackwindow/removeappletvariables.rb +52 -0
- data/code/superant.com.rwdtinkerbackwindow/runremoteinstall.rb +11 -0
- data/code/superant.com.rwdtinkerbackwindow/runrwdtinkerbackwindow.rb +15 -0
- data/code/superant.com.rwdtinkerbackwindow/rwdtinkerwin2version.rb +13 -0
- data/code/superant.com.rwdtinkerbackwindow/saveconfigurationrecord.rb +19 -0
- data/code/superant.com.rwdtinkerbackwindow/viewappletcontents.rb +22 -0
- data/code/superant.com.rwdtinkerbackwindow/viewgemappletcontents.rb +24 -0
- data/code/zz0applicationend/zz0end.rb +4 -0
- data/configuration/language.dist +8 -0
- data/configuration/rwdapplicationidentity.dist +3 -0
- data/configuration/rwdtinker.dist +18 -0
- data/configuration/rwdwfoldeditor-0.01.dist +12 -0
- data/configuration/tinkerwin2variables.dist +17 -0
- data/gui/00coreguibegin/applicationguitop.rwd +4 -0
- data/gui/frontwindow0/cc0openphoto.rwd +22 -0
- data/gui/frontwindowselections/00selectiontabbegin.rwd +11 -0
- data/gui/frontwindowselections/jumplinkcommands.rwd +15 -0
- data/gui/frontwindowselections/wwselectionend.rwd +3 -0
- data/gui/frontwindowtdocuments/00documentbegin.rwd +6 -0
- data/gui/frontwindowtdocuments/tinkerdocuments.rwd +14 -0
- data/gui/frontwindowtdocuments/zzdocumentend.rwd +8 -0
- data/gui/helpaboutbegin/zzzrwdlasttab.rwd +6 -0
- data/gui/helpaboutbegin/zzzzhelpscreenstart.rwd +3 -0
- data/gui/helpaboutbegin/zzzzzzhelpabouttab.rwd +15 -0
- data/gui/helpaboutzend/helpscreenend.rwd +3 -0
- data/gui/helpaboutzend/zhelpscreenstart2.rwd +3 -0
- data/gui/helpaboutzend/zzzzhelpabout2.rwd +15 -0
- data/gui/helpaboutzend/zzzzhelpscreen2end.rwd +3 -0
- data/gui/tinkerbackwindows/superant.com.foldeditor/10appletbegin.rwd +4 -0
- data/gui/tinkerbackwindows/superant.com.foldeditor/10aviewnote.rwd +42 -0
- data/gui/tinkerbackwindows/superant.com.foldeditor/15htmlview.rwd +46 -0
- data/gui/tinkerbackwindows/superant.com.foldeditor/56viewfold.rwd +43 -0
- data/gui/tinkerbackwindows/superant.com.foldeditor/81jumplinkcommands.rwd +17 -0
- data/gui/tinkerbackwindows/superant.com.foldeditor/9end.rwd +6 -0
- data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/1appname.rwd +5 -0
- data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/40rwdlistzips.rwd +41 -0
- data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/45installremotezip.rwd +44 -0
- data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/50rwdlistapplets.rwd +44 -0
- data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/60editconfiguration.rwd +30 -0
- data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/70rwddiagnostics.rwd +29 -0
- data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/81jumplinkcommands.rwd +17 -0
- data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/9backend.rwd +6 -0
- data/gui/tinkerbackwindows/superant.com.tinkerhelpwindow/1appname.rwd +31 -0
- data/gui/tinkerbackwindows/superant.com.tinkerhelpwindow/9end.rwd +4 -0
- data/gui/tinkerbackwindows/superant.com.versionwindow/1appname.rwd +19 -0
- data/gui/tinkerbackwindows/superant.com.versionwindow/helpaboutwindow.rwd +17 -0
- data/gui/zzcoreguiend/yy9rwdend.rwd +4 -0
- data/init.rb +277 -0
- data/installed/rwdwfoldeditor-0.01.inf +13 -0
- data/installed/temp.rb +1 -0
- data/lang/en/rwdcore/languagefile.rb +58 -0
- data/lang/es/rwdcore/languagefile-es.rb +62 -0
- data/lang/fr/rwdcore/languagefile.rb +64 -0
- data/lang/jp/rwdcore/languagefile.rb +72 -0
- data/lang/nl/rwdcore/languagefile.rb +75 -0
- data/lib/rconftool.rb +380 -0
- data/lib/rwd/browser.rb +123 -0
- data/lib/rwd/ftools.rb +174 -0
- data/lib/rwd/mime.rb +328 -0
- data/lib/rwd/net.rb +866 -0
- data/lib/rwd/ruby.rb +889 -0
- data/lib/rwd/rwd.rb +1942 -0
- data/lib/rwd/sgml.rb +236 -0
- data/lib/rwd/thread.rb +63 -0
- data/lib/rwd/tree.rb +371 -0
- data/lib/rwd/xml.rb +101 -0
- data/lib/zip/ioextras.rb +114 -0
- data/lib/zip/stdrubyext.rb +111 -0
- data/lib/zip/tempfile_bugfixed.rb +195 -0
- data/lib/zip/zip.rb +1378 -0
- data/lib/zip/zipfilesystem.rb +558 -0
- data/lib/zip/ziprequire.rb +61 -0
- data/rwd_files/HowTo_FoldEditor.txt +105 -0
- data/rwd_files/HowTo_Tinker.txt +471 -0
- data/rwd_files/HowTo_TinkerWin2.txt +202 -0
- data/rwd_files/Readme.txt +57 -0
- data/rwd_files/RubyWebDialogs.html +6 -0
- data/rwd_files/default.fld +9 -0
- data/rwd_files/favicon.ico +0 -0
- data/rwd_files/rdoc-style.css +175 -0
- data/rwd_files/rwdapplications.html +54 -0
- data/rwd_files/rwdhypernote-0.13.fld +202 -0
- data/rwd_files/tinker.png +0 -0
- data/rwdconfig.dist +21 -0
- data/rwdfoldeditor.rb +1 -0
- data/tests/RubyGauge.rb +179 -0
- data/tests/checkdepends.sh +4 -0
- data/tests/cleancnf.sh +6 -0
- data/tests/makedist-rwdwfoldeditor.rb +56 -0
- data/tests/makedist.rb +66 -0
- data/tests/rdep.rb +354 -0
- data/tests/totranslate.lang +93 -0
- data/zips/rwdwaddresses-1.05.zip +0 -0
- data/zips/rwdwcalc-0.61.zip +0 -0
- data/zips/rwdwfoldeditor-0.01.zip +0 -0
- data/zips/rwdwgutenberg-0.09.zip +0 -0
- data/zips/rwdwschedule-1.04.zip +0 -0
- data/zips/rwdwshell-1.04.zip +0 -0
- data/zips/temp.rb +1 -0
- data/zips/wrubyslippers-1.06.zip +0 -0
- metadata +212 -0
@@ -0,0 +1,240 @@
|
|
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 "smalllinux@gmail.com".
|
22
|
+
#***********************************************************************/
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
# integrate the new configuration files
|
27
|
+
def initiateapplet(nametextlocal)
|
28
|
+
|
29
|
+
debuginitiate = 0
|
30
|
+
|
31
|
+
if $DEBUG
|
32
|
+
$stderr.puts "starting config load with: #{nametextlocal}"
|
33
|
+
end
|
34
|
+
|
35
|
+
|
36
|
+
Dir.chdir($progdir ) #changes the current working directory
|
37
|
+
|
38
|
+
@confignew = "configuration/" + "#{nametextlocal}.cnf"
|
39
|
+
@configdist = "configuration/" + "#{nametextlocal}.dist"
|
40
|
+
Rconftool::install(@configdist,@confignew)
|
41
|
+
|
42
|
+
begin
|
43
|
+
|
44
|
+
configfileload = File.open(@configdist){|f| f.read}
|
45
|
+
|
46
|
+
eval configfileload #load config file
|
47
|
+
|
48
|
+
|
49
|
+
|
50
|
+
rescue
|
51
|
+
|
52
|
+
if $DEBUG
|
53
|
+
$stderr.puts "error in initiateapplets - config load"
|
54
|
+
end
|
55
|
+
debuginitiate += 1
|
56
|
+
end
|
57
|
+
$tempdoc = " "
|
58
|
+
|
59
|
+
Dir.chdir($progdir) # change back to top program directory
|
60
|
+
|
61
|
+
# build the English Language hash file from the parts
|
62
|
+
languagehashvariable = 'Message.update('
|
63
|
+
startlangdir = File.join(LangDir,"en")
|
64
|
+
#get a list of the files and subdirectories on the starting directory only
|
65
|
+
alanghash = Array.new(Dir[startlangdir].entries.sort)
|
66
|
+
#loop through the list, ignore the files and add all new directories found
|
67
|
+
alanghash.each do |x|
|
68
|
+
#if a directory...
|
69
|
+
if(test(?d,x))
|
70
|
+
# add to the original list of directories
|
71
|
+
@@tmproot = x + "/**"
|
72
|
+
#adds the new ones to the array
|
73
|
+
blanghash = Dir[@@tmproot].entries.sort
|
74
|
+
blanghash.each do |x|
|
75
|
+
if(test(?d,x))
|
76
|
+
alanghash.push(x) #appends to the end of the array...
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
alanghash.each do |x|
|
82
|
+
#if it is a file...
|
83
|
+
if(!test(?d,x))
|
84
|
+
alanghash.delete(x)
|
85
|
+
else #it is a directory...
|
86
|
+
findfiles(x + "/**")
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
|
91
|
+
#writes the contents of doc into the languagehashvariable
|
92
|
+
|
93
|
+
|
94
|
+
languagehashvariable = languagehashvariable + $tempdoc + ' :rwdtinker => "Rwdtinker" ) ;'
|
95
|
+
|
96
|
+
# END of en Lang building
|
97
|
+
$tempdoc = " "
|
98
|
+
Dir.chdir($progdir) # change back to top program directory
|
99
|
+
|
100
|
+
# build the local Language hash file from the parts
|
101
|
+
startlangdir = File.join(LangDir,$lang)
|
102
|
+
#get a list of the files and subdirectories on the starting directory only
|
103
|
+
alanghash = Array.new(Dir[startlangdir].entries.sort)
|
104
|
+
#loop through the list, ignore the files and add all new directories found
|
105
|
+
alanghash.each do |x|
|
106
|
+
#if a directory...
|
107
|
+
if(test(?d,x))
|
108
|
+
# add to the original list of directories
|
109
|
+
@@tmproot = x + "/**"
|
110
|
+
#adds the new ones to the array
|
111
|
+
blanghash = Dir[@@tmproot].entries.sort
|
112
|
+
blanghash.each do |x|
|
113
|
+
if(test(?d,x))
|
114
|
+
alanghash.push(x) #appends to the end of the array...
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|
119
|
+
alanghash.each do |x|
|
120
|
+
#if it is a file...
|
121
|
+
if(!test(?d,x))
|
122
|
+
alanghash.delete(x)
|
123
|
+
else #it is a directory...
|
124
|
+
findfiles(x + "/**")
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
|
129
|
+
#writes the contents of doc into the variable
|
130
|
+
|
131
|
+
languagehashvariable = languagehashvariable + " Message.update(" + $tempdoc + ' :rwdtinker => "Rwdtinker" ) '
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
$tempdoc = " "
|
136
|
+
|
137
|
+
Dir.chdir($progdir) # change back to top program directory
|
138
|
+
|
139
|
+
temp = eval( languagehashvariable )
|
140
|
+
|
141
|
+
|
142
|
+
tempguistorage = $rwd_gui_tinker # if gui load fails restore old
|
143
|
+
begin # error trap
|
144
|
+
|
145
|
+
# build the actual GUI from the gui parts
|
146
|
+
$tempdoc = " "
|
147
|
+
#get a list of the files and subdirectories on the starting directory only
|
148
|
+
a = Array.new(Dir[GuiDir].entries.sort)
|
149
|
+
#loop through the list, ignore the files and add all new directories found
|
150
|
+
a.each do |x|
|
151
|
+
#if a directory...
|
152
|
+
if(test(?d,x))
|
153
|
+
#use this new dir find to add to the original list of directories
|
154
|
+
@@root = x + "/**"
|
155
|
+
#adds the new ones to the array
|
156
|
+
b = Dir[@@root].entries.sort
|
157
|
+
b.each do |x|
|
158
|
+
if(test(?d,x))
|
159
|
+
a.push(x) #appends to the end of the array...
|
160
|
+
end
|
161
|
+
end
|
162
|
+
end
|
163
|
+
end
|
164
|
+
a.each do |x|
|
165
|
+
#if it is a file...
|
166
|
+
if(!test(?d,x))
|
167
|
+
a.delete(x)
|
168
|
+
|
169
|
+
else #it is a directory...
|
170
|
+
loadguifile(x + "/**")
|
171
|
+
|
172
|
+
|
173
|
+
end
|
174
|
+
end
|
175
|
+
|
176
|
+
$rwd_gui_tinker = $tempdoc
|
177
|
+
|
178
|
+
|
179
|
+
rescue
|
180
|
+
$rwd_gui_tinker = tempguistorage # restore old gui
|
181
|
+
if $DEBUG
|
182
|
+
$stderr.puts "error in initiateapplets - gui building"
|
183
|
+
end
|
184
|
+
|
185
|
+
debuginitiate += 1
|
186
|
+
end
|
187
|
+
|
188
|
+
begin # error trap
|
189
|
+
# now load in the code files
|
190
|
+
|
191
|
+
$tempdoc = ""
|
192
|
+
tempcodeinstallline = ""
|
193
|
+
|
194
|
+
@fileName = "installed/" + nametextlocal + ".inf"
|
195
|
+
|
196
|
+
tmpfilearray = File.readlines(@fileName)
|
197
|
+
|
198
|
+
tmpfilearray.each do |line|
|
199
|
+
|
200
|
+
tempcodeinstallline = line.chomp
|
201
|
+
if tempcodeinstallline.include?('code/')
|
202
|
+
findfiles(tempcodeinstallline + "/**")
|
203
|
+
tempcoderesult = eval( $tempdoc ) # read the program code and evaluate
|
204
|
+
end
|
205
|
+
end
|
206
|
+
|
207
|
+
|
208
|
+
rescue
|
209
|
+
if $DEBUG
|
210
|
+
$stderr.puts "error in initiateapplets - code building"
|
211
|
+
end
|
212
|
+
debuginitiate += 1
|
213
|
+
|
214
|
+
|
215
|
+
end
|
216
|
+
|
217
|
+
setuphelpaboutoptions # update the help about list
|
218
|
+
setuptinkerdocuments # update the document pull down list
|
219
|
+
runhelpwindow # update the help menu
|
220
|
+
showjumplinkoptions # update the application link menu
|
221
|
+
runrwdtinkerbackwindow # back to applet window
|
222
|
+
|
223
|
+
# resultend = tempcodeinstallline .index("\n",resultstart)
|
224
|
+
tempresult = @fileName
|
225
|
+
|
226
|
+
return " applet loading successful " + tempresult
|
227
|
+
|
228
|
+
|
229
|
+
|
230
|
+
if debuginitiate > 0
|
231
|
+
return " initiateapplet .."
|
232
|
+
else
|
233
|
+
return " initiateapplet success"
|
234
|
+
end
|
235
|
+
|
236
|
+
end
|
237
|
+
|
238
|
+
|
239
|
+
|
240
|
+
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# install rwdtinker applet from a long directory location
|
2
|
+
def installgemapplet
|
3
|
+
require 'fileutils'
|
4
|
+
require 'lib/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
|
+
|
16
|
+
rescue
|
17
|
+
|
18
|
+
if $DEBUG
|
19
|
+
$stderr.puts "unzip error - applet may not be installed correctly"
|
20
|
+
end
|
21
|
+
@installapplettext = " .. "
|
22
|
+
|
23
|
+
end # exception rescue
|
24
|
+
|
25
|
+
@nametextbase = File.basename(nametext)
|
26
|
+
@returninitateresults = initiateapplet(@nametextbase)
|
27
|
+
@installapplettext = Message[:applet_installed] + " " + @returninitateresults
|
28
|
+
|
29
|
+
|
30
|
+
RWDWindow.new($rwd_gui_tinker, @rwd_window).render("DEFAULT")
|
31
|
+
|
32
|
+
|
33
|
+
end
|
34
|
+
|
@@ -0,0 +1,20 @@
|
|
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
|
20
|
+
|
@@ -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,53 @@
|
|
1
|
+
# this code is to list the zips
|
2
|
+
def fillzipappletname(inffile)
|
3
|
+
applet = inffile.gsub(/\.zip$/, "")
|
4
|
+
@a_installapplet = applet
|
5
|
+
|
6
|
+
end
|
7
|
+
|
8
|
+
def findzipfiles(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 zip files
|
15
|
+
if x =~ /\.zip/
|
16
|
+
#opens the file thats in fileName as read only
|
17
|
+
$zipsarray = $zipsarray | ["#{x}"]
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def listgemzips
|
24
|
+
startlangdir = $geminstalled_directory
|
25
|
+
#get a list of the files and subdirectories on the starting directory only
|
26
|
+
alanghash = Array.new(Dir[startlangdir].entries.sort)
|
27
|
+
p alanghash
|
28
|
+
#loop through the list, ignore the files and add all new directories found
|
29
|
+
alanghash.each do |x|
|
30
|
+
#if a directory...
|
31
|
+
if(test(?d,x))
|
32
|
+
# add to the original list of directories
|
33
|
+
@@tmproot = x + "/**"
|
34
|
+
#adds the new ones to the array
|
35
|
+
blanghash = Dir[@@tmproot].entries.sort
|
36
|
+
blanghash.each do |x|
|
37
|
+
if(test(?d,x))
|
38
|
+
alanghash.push(x) #appends to the end of the array...
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
alanghash.each do |x|
|
44
|
+
#if it is a file...
|
45
|
+
if(!test(?d,x))
|
46
|
+
alanghash.delete(x)
|
47
|
+
else #it is a directory...
|
48
|
+
findzipfiles(x + "/**")
|
49
|
+
end
|
50
|
+
end
|
51
|
+
@zipslistresult = $zipsarray.rwd_method("fillzipappletname")
|
52
|
+
end
|
53
|
+
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# this code is to list the applets that are installed
|
2
|
+
def listinstalledfiles
|
3
|
+
fileList = Dir.new("installed").entries.sort.reverse.delete_if { |x| ! (x =~ /inf$/) }
|
4
|
+
@filesresult = fileList.rwd_method("fillappletname")
|
5
|
+
end
|
6
|
+
|
7
|
+
def fillappletname(inffile)
|
8
|
+
applet = inffile.gsub(/\.inf$/, "")
|
9
|
+
@a_installlist = applet
|
10
|
+
@a_removeapplet = applet
|
11
|
+
end
|
12
|
+
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# this code is to list the zipped applets that can be installed
|
2
|
+
def fillziptoinstallname(inffile)
|
3
|
+
applet = inffile.gsub(/\.zip$/, "")
|
4
|
+
@a_installapplet = applet
|
5
|
+
|
6
|
+
end
|
7
|
+
|
8
|
+
def listzipfilestoinstall
|
9
|
+
startlangdir = File.join($progdir, $zipslocation )
|
10
|
+
#get a list of the files and subdirectories on the starting directory only
|
11
|
+
|
12
|
+
|
13
|
+
a = Array.new(Dir["#{startlangdir}/*"].entries.sort)
|
14
|
+
|
15
|
+
#loop through and get the files names
|
16
|
+
a.each do |x|
|
17
|
+
# only zip files
|
18
|
+
if x =~ /\.zip/
|
19
|
+
#adds the file to the array to display on the screen
|
20
|
+
$zipsarraylocal = $zipsarraylocal | ["#{x}"]
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
|
25
|
+
@zipslistresult = $zipsarraylocal.rwd_method("fillziptoinstallname")
|
26
|
+
end
|
27
|
+
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# this method puts the configuration rexord on the screen
|
2
|
+
def loadconfigurationrecord
|
3
|
+
|
4
|
+
require 'fileutils'
|
5
|
+
if TinkerWin2ConfigurationFileName
|
6
|
+
@a_configurationfilename = TinkerWin2ConfigurationFileName
|
7
|
+
end
|
8
|
+
|
9
|
+
begin # exception trapped block
|
10
|
+
|
11
|
+
Dir.chdir($progdir)
|
12
|
+
fileName = File.join(ConfigurationDir, TinkerWin2ConfigurationFileName)
|
13
|
+
|
14
|
+
fd = File.open(fileName,"r")
|
15
|
+
@a_configurationfile = fd.read
|
16
|
+
fd.close
|
17
|
+
rescue SystemCallError, StandardError
|
18
|
+
$stderr.print "system call error: " + $!
|
19
|
+
end # exception rescue
|
20
|
+
|
21
|
+
end
|
22
|
+
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# this method loads the on screen variables into the running class
|
2
|
+
def loadconfigurationvariables
|
3
|
+
|
4
|
+
configfiletoload = File.join(ConfigurationDir,TinkerWin2ConfigurationFileName)
|
5
|
+
begin
|
6
|
+
load configfiletoload
|
7
|
+
@extraconfigdatadisplay = ""
|
8
|
+
@newconfigurationresult = "Config Variables loaded"
|
9
|
+
rescue
|
10
|
+
@extraconfigdatadisplay = ""
|
11
|
+
@newconfigurationresult = "loading error"
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
@@ -0,0 +1,87 @@
|
|
1
|
+
#network
|
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
|
+
|
@@ -0,0 +1,19 @@
|
|
1
|
+
def openappletname
|
2
|
+
require 'fileutils'
|
3
|
+
nametext = "%s" % [@a_installlist]
|
4
|
+
|
5
|
+
begin # exception trapped block
|
6
|
+
fileName = "installed/" + nametext + ".inf"
|
7
|
+
|
8
|
+
fd = File.open(fileName,"r")
|
9
|
+
@displaytext = " "
|
10
|
+
while ! fd.eof?
|
11
|
+
@displaytext = fd.read
|
12
|
+
end
|
13
|
+
fd.close
|
14
|
+
rescue
|
15
|
+
@displaytext = "\n" + "error"
|
16
|
+
end # exception rescue
|
17
|
+
|
18
|
+
end
|
19
|
+
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# this code is to call the help window
|
2
|
+
def runhelpwindowtinkerwin2
|
3
|
+
|
4
|
+
# $helptopicsarray = $helptopicsarray | [""]
|
5
|
+
|
6
|
+
$help_topic = "tinkerwin2_help"
|
7
|
+
if @rwd_tab == "rwdzipslister"
|
8
|
+
$help_topic = "tinkerwin2_help"
|
9
|
+
end
|
10
|
+
|
11
|
+
if @rwd_tab == "filelister"
|
12
|
+
$help_topic = "applet_viewing"
|
13
|
+
|
14
|
+
end
|
15
|
+
if @rwd_tab == "zipslister"
|
16
|
+
$help_topic = "applet_installation"
|
17
|
+
|
18
|
+
end
|
19
|
+
if @rwd_tab == "editconfigurationfile"
|
20
|
+
$help_topic = "applet_tinkerbackeditconfiguration"
|
21
|
+
|
22
|
+
end
|
23
|
+
if @rwd_tab == "superantcomremotezipsinstall"
|
24
|
+
$help_topic = "remotegemapplet_install"
|
25
|
+
end
|
26
|
+
|
27
|
+
|
28
|
+
if @rwd_window != "rwdtinkerhelpwindow"
|
29
|
+
$previouswindow = @rwd_window
|
30
|
+
$previoustab = @rwd_tab
|
31
|
+
else
|
32
|
+
$previouswindow = @rwd_window
|
33
|
+
$previoustab = @rwd_tab
|
34
|
+
end
|
35
|
+
runhelpwindow
|
36
|
+
end
|
37
|
+
|
38
|
+
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# This tinker method is to retrieve the list of rwdzip applets available to install from the remote repository
|
2
|
+
def superantcomremotegemlist
|
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
|
17
|
+
end
|
18
|
+
|
19
|
+
def superantcomremotegemappletdirsname(inffile)
|
20
|
+
applet = inffile
|
21
|
+
@superantcominstallremoteappletinput = applet
|
22
|
+
|
23
|
+
end
|
24
|
+
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# method to remove a tinker applet
|
2
|
+
def removeapplet
|
3
|
+
require 'fileutils'
|
4
|
+
nametext = "%s" % [@a_removeapplet]
|
5
|
+
|
6
|
+
fileName = "installed/" + nametext + ".inf"
|
7
|
+
@appletremoveresult = removeappletvariables(nametext)
|
8
|
+
|
9
|
+
setuphelpaboutoptions # update the help about list
|
10
|
+
setuptinkerdocuments # update the document pull down list
|
11
|
+
runhelpwindow # update the help menu
|
12
|
+
showjumplinkoptions # update the application link menu
|
13
|
+
runrwdtinkerbackwindow # back to applet window
|
14
|
+
|
15
|
+
begin # exception trapped block
|
16
|
+
|
17
|
+
count = 0
|
18
|
+
fd = File.open(fileName,"r")
|
19
|
+
|
20
|
+
|
21
|
+
fd.each { |oneline|
|
22
|
+
if count == 1
|
23
|
+
if File.exist?(oneline.chop)
|
24
|
+
FileUtils.rm_rf( oneline.chop)
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
count = 1
|
29
|
+
}
|
30
|
+
fd.close
|
31
|
+
|
32
|
+
|
33
|
+
|
34
|
+
FileUtils.rm_rf( fileName)
|
35
|
+
|
36
|
+
|
37
|
+
@removeapplettext = "applet files removed!" + " " + @appletremoveresult
|
38
|
+
|
39
|
+
runbackwindowappletremove
|
40
|
+
|
41
|
+
rescue
|
42
|
+
@removeapplettext = " removeapplet" + " .."
|
43
|
+
|
44
|
+
end # exception rescue
|
45
|
+
|
46
|
+
end
|