rwdtorrent 0.01

Sign up to get free protection for your applications and to get access to all the features.
Files changed (146) hide show
  1. data/Readme.txt +146 -0
  2. data/bin/rwdtorrent +19 -0
  3. data/code/01rwdcore/01rwdcore.rb +22 -0
  4. data/code/01rwdcore/02helptexthashbegin.rb +4 -0
  5. data/code/01rwdcore/03helptexthash.rb +31 -0
  6. data/code/01rwdcore/04helptextend.rb +6 -0
  7. data/code/01rwdcore/openhelpwindow.rb +31 -0
  8. data/code/01rwdcore/returntomain.rb +10 -0
  9. data/code/01rwdcore/rwdtinkerversion.rb +15 -0
  10. data/code/01rwdcore/rwdwindowreturn.rb +11 -0
  11. data/code/01rwdcore/test_cases.rb +126 -0
  12. data/code/01rwdcore/test_harness.rb +15 -0
  13. data/code/01rwdcore/uploadreturns.rb +62 -0
  14. data/code/superant.com.rwdtinkerbackwindow/controlclient.rb +99 -0
  15. data/code/superant.com.rwdtinkerbackwindow/diagnostictab.rb +25 -0
  16. data/code/superant.com.rwdtinkerbackwindow/helptexthashtinkerwin2.rb +61 -0
  17. data/code/superant.com.rwdtinkerbackwindow/installapplet.rb +24 -0
  18. data/code/superant.com.rwdtinkerbackwindow/installgemapplet.rb +20 -0
  19. data/code/superant.com.rwdtinkerbackwindow/installremotegem.rb +19 -0
  20. data/code/superant.com.rwdtinkerbackwindow/listgemdirs.rb +12 -0
  21. data/code/superant.com.rwdtinkerbackwindow/listgemzips.rb +54 -0
  22. data/code/superant.com.rwdtinkerbackwindow/listinstalledfiles.rb +11 -0
  23. data/code/superant.com.rwdtinkerbackwindow/listzips.rb +31 -0
  24. data/code/superant.com.rwdtinkerbackwindow/loadconfigurationrecord.rb +32 -0
  25. data/code/superant.com.rwdtinkerbackwindow/loadconfigurationvariables.rb +13 -0
  26. data/code/superant.com.rwdtinkerbackwindow/network.rb +87 -0
  27. data/code/superant.com.rwdtinkerbackwindow/openappletname.rb +18 -0
  28. data/code/superant.com.rwdtinkerbackwindow/openhelpwindowtinkerwin2.rb +42 -0
  29. data/code/superant.com.rwdtinkerbackwindow/remotegemlist.rb +24 -0
  30. data/code/superant.com.rwdtinkerbackwindow/removeapplet.rb +32 -0
  31. data/code/superant.com.rwdtinkerbackwindow/runrwdtinkerbackwindow.rb +12 -0
  32. data/code/superant.com.rwdtinkerbackwindow/rwdtinkerwin2version.rb +14 -0
  33. data/code/superant.com.rwdtinkerbackwindow/saveconfigurationrecord.rb +18 -0
  34. data/code/superant.com.rwdtinkerbackwindow/viewappletcontents.rb +21 -0
  35. data/code/superant.com.rwdtinkerbackwindow/viewgemappletcontents.rb +21 -0
  36. data/code/superant.com.rwdtorrent/helptesthashrwdtorrent.rb +55 -0
  37. data/code/superant.com.rwdtorrent/listnamerecord.rb +15 -0
  38. data/code/superant.com.rwdtorrent/loadconfigurationrecord.rb +36 -0
  39. data/code/superant.com.rwdtorrent/loadconfigurationvariables.rb +13 -0
  40. data/code/superant.com.rwdtorrent/openhelpwindowtorrent.rb +32 -0
  41. data/code/superant.com.rwdtorrent/returntomain.rb +10 -0
  42. data/code/superant.com.rwdtorrent/runtorrentwindow.rb +57 -0
  43. data/code/superant.com.rwdtorrent/rwdtorrenthelpabout.rb +14 -0
  44. data/code/superant.com.rwdtorrent/saveconfigurationrecord.rb +18 -0
  45. data/code/superant.com.rwdtorrent/stoptorrentdownload.rb +12 -0
  46. data/code/superant.com.rwdtorrent/viewtorrentlist.rb +20 -0
  47. data/code/superant.com.rwdtorrent/viewtorrentmetafile.rb +36 -0
  48. data/code/zz0applicationend/zz0end.rb +4 -0
  49. data/configuration/language.dist +7 -0
  50. data/configuration/rwdapplicationidentity.dist +3 -0
  51. data/configuration/rwdtinker.dist +15 -0
  52. data/configuration/rwdtorrent.dist +11 -0
  53. data/configuration/tinkerwin2variables.dist +17 -0
  54. data/downloads/nodownloads.txt +1 -0
  55. data/ev/browser.rb +109 -0
  56. data/ev/ftools.rb +170 -0
  57. data/ev/net.rb +750 -0
  58. data/ev/ruby.rb +819 -0
  59. data/ev/rwd.rb +1849 -0
  60. data/ev/sgml.rb +236 -0
  61. data/ev/thread.rb +63 -0
  62. data/ev/tree.rb +343 -0
  63. data/ev/xml.rb +4 -0
  64. data/extras/aversa.rb +261 -0
  65. data/extras/rconftool.rb +380 -0
  66. data/extras/rubytorrent.rb +94 -0
  67. data/extras/rubytorrent/bencoding.rb +174 -0
  68. data/extras/rubytorrent/controller.rb +610 -0
  69. data/extras/rubytorrent/message.rb +128 -0
  70. data/extras/rubytorrent/metainfo.rb +214 -0
  71. data/extras/rubytorrent/package.rb +600 -0
  72. data/extras/rubytorrent/peer.rb +536 -0
  73. data/extras/rubytorrent/server.rb +166 -0
  74. data/extras/rubytorrent/tracker.rb +225 -0
  75. data/extras/rubytorrent/typedstruct.rb +132 -0
  76. data/extras/rubytorrent/util.rb +186 -0
  77. data/extras/zip/ioextras.rb +114 -0
  78. data/extras/zip/stdrubyext.rb +111 -0
  79. data/extras/zip/tempfile_bugfixed.rb +195 -0
  80. data/extras/zip/zip.rb +1377 -0
  81. data/extras/zip/zipfilesystem.rb +558 -0
  82. data/extras/zip/ziprequire.rb +61 -0
  83. data/gui/00coreguibegin/applicationguitop.rwd +4 -0
  84. data/gui/frontwindow0/10viewnote.rwd +32 -0
  85. data/gui/frontwindow0/30viewtorrent.rwd +13 -0
  86. data/gui/frontwindow0/40rwdtorrentrefresh.rwd +28 -0
  87. data/gui/frontwindow0/67viewconfiguration.rwd +38 -0
  88. data/gui/frontwindowselectionbegin/selectiontabbegin/selectiontabbegin.rwd +16 -0
  89. data/gui/frontwindowselections/superant.com.rwdtinkerwin2selectiontab/rwdwin2selectiontab.rwd +12 -0
  90. data/gui/frontwindowselectionzend/viewselectionzend/viewselectionend.rwd +3 -0
  91. data/gui/frontwindowtdocumentbegin/superant.com.documentsbegin/tt0documentbegin.rwd +6 -0
  92. data/gui/frontwindowtdocuments/superant.com.documents/uu5documents.rwd +15 -0
  93. data/gui/frontwindowtdocuments/superant.com.tinkerwin2documents/uu5documents.rwd +6 -0
  94. data/gui/frontwindowtdocuments/superant.com.torrentdocument/doctorrent.rwd +6 -0
  95. data/gui/frontwindowtdocumentzend/superant.com.documentsend/ww0documentend.rwd +12 -0
  96. data/gui/frontwindowz1end/frontwindowend/xx0rwdfirsttab.rwd +6 -0
  97. data/gui/helpaboutbegin/superant.com.helpaboutbegin/ya0helpscreenstart.rwd +3 -0
  98. data/gui/helpaboutinstalled/superant.com.tinkerhelpabout/1appname.rwd +4 -0
  99. data/gui/helpaboutinstalled/superant.com.tinkerhelpabout/3copyright.rwd +3 -0
  100. data/gui/helpaboutinstalled/superant.com.tinkerhelpabout/5version.rwd +10 -0
  101. data/gui/helpaboutinstalled/superant.com.torrenthelpabout/1appname.rwd +4 -0
  102. data/gui/helpaboutinstalled/superant.com.torrenthelpabout/3copyright.rwd +3 -0
  103. data/gui/helpaboutinstalled/superant.com.torrenthelpabout/5version.rwd +9 -0
  104. data/gui/helpaboutzend/superant.com.helpaboutend/helpscreenend.rwd +3 -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.torrentdisplay/torrentdisplaywindow.rwd +31 -0
  117. data/gui/tinkerbackwindows/superant.com.versionwindow/1appname.rwd +19 -0
  118. data/gui/zzcoreguiend/tinkerapplicationguiend/yy9rwdend.rwd +4 -0
  119. data/init.rb +277 -0
  120. data/installed/rwdviewlogo-0.4.inf +4 -0
  121. data/lang/en/rwdcore/languagefile.rb +16 -0
  122. data/lang/es/rwdcore/languagefile-es.rb +14 -0
  123. data/lang/jp/rwdcore/languagefile.rb +9 -0
  124. data/lang/nl/rwdcore/languagefile.rb +19 -0
  125. data/lib/temp.rb +1 -0
  126. data/rwd_files/HowTo_Tinker.txt +405 -0
  127. data/rwd_files/HowTo_TinkerWin2.txt +202 -0
  128. data/rwd_files/HowTo_Torrent.txt +146 -0
  129. data/rwd_files/Readme.txt +57 -0
  130. data/rwd_files/favicon.ico +0 -0
  131. data/rwd_files/rdoc-style.css +175 -0
  132. data/rwd_files/rwdapplications.html +54 -0
  133. data/rwd_files/rwdindex.html +6 -0
  134. data/rwd_files/tinker.png +0 -0
  135. data/rwdconfig.dist +10 -0
  136. data/tests/checkdepends.sh +4 -0
  137. data/tests/cleancnf.sh +5 -0
  138. data/tests/makedist.rb +44 -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/torrentfiles/freeculture-audiobook.zip.torrent +0 -0
  144. data/torrentfiles/freeculture.zip.torrent +0 -0
  145. data/zips/rwdahelloworld-0.5.zip +0 -0
  146. metadata +199 -0
@@ -0,0 +1,62 @@
1
+ def uploadreturnsfile
2
+ require 'net/ftp'
3
+ BasicSocket.do_not_reverse_lookup = true
4
+ @returnsftpdisplays = ""
5
+ randomnumber = rand(9999) + 1000
6
+ puts randomnumber.to_i
7
+
8
+
9
+ returns_ftpsite = "ftp.superant.com"
10
+ returns_ftplogin = "anonymous@superant.com"
11
+ returns_ftppassword = "anonymous@superant.com"
12
+ returns_ftpdirectory = "/incoming/returns/"
13
+
14
+ begin
15
+ platformdisplay = "Platform is " + RUBY_PLATFORM + "\n"
16
+ platformdisplay = platformdisplay + "Ruby Version " + VERSION + "\n"
17
+ platformdisplay = platformdisplay + "rwdtinker version " + RwdTinkerVersion + "\n"
18
+ platformdisplay = platformdisplay + "application name " + $rwdapplicationidentity + "\n"
19
+ platformdisplay = platformdisplay + "program directory " + $progdir + "\n"
20
+ platformdisplay = platformdisplay + "hostname " + Resolv.getname(Resolv.getaddress("localhost")) + "\n"
21
+ platformdisplay = platformdisplay + "Date " + Date.today().to_s + "\n"
22
+ if ! @a_emailupload.empty?
23
+ platformdisplay = platformdisplay + @a_emailupload + "\n"
24
+ end
25
+ if ! @a_emailupload.empty?
26
+ platformdisplay = platformdisplay + @a_commentupload + "\n"
27
+ end
28
+ updatefile = Date.today().to_s + Resolv.getname(Resolv.getaddress("localhost")) + randomnumber.to_s
29
+
30
+ tmpdir = ENV['TMP']
31
+ if tmpdir.to_s.empty?
32
+ tmpdir = "/tmp"
33
+ end
34
+ fileName = File.join( tmpdir, updatefile)
35
+ fd = File.open(fileName,"w")
36
+ fd.print(platformdisplay) # save the record info to the file
37
+ fd.close
38
+ ftp = Net::FTP::new(returns_ftpsite)
39
+ @returnsftpdisplay = "data uploaded" + "\n"
40
+
41
+ filedirname = File.join(tmpdir,updatefile)
42
+
43
+ ftp.debug_mode = false
44
+ ftp.login(returns_ftplogin, returns_ftppassword)
45
+ ftp.chdir(returns_ftpdirectory)
46
+ print "I'm in the directory ", ftp.pwd(), "\n"
47
+
48
+ puts filedirname
49
+ ftp.puttextfile(filedirname , updatefile)
50
+ @returnsftpdisplay = @returnsftpdisplay + platformdisplay
51
+
52
+
53
+ ftp.close
54
+
55
+ rescue
56
+ @returnsftpdisplay = "upload error"
57
+ if ftp
58
+ ftp.close
59
+ end
60
+ print "ftp error"
61
+ end
62
+ end
@@ -0,0 +1,99 @@
1
+ # Bind message passing socket to rwdtinker application
2
+
3
+ def runcontrolcommand
4
+ require 'socket'
5
+
6
+ # Change this line...
7
+ ip = '127.0.0.1'
8
+ # And this one...
9
+ port = $rwdcontrolport1
10
+ if @a_remoteportinput
11
+ port = @a_remoteportinput.to_i
12
+ end
13
+
14
+ commandtext = @a_remotecommandinput.to_s
15
+ remotehostnotfound = true
16
+ if (commandtext == "stop")
17
+ begin
18
+ client = UDPSocket::new()
19
+ client.send(commandtext, 0, ip, port)
20
+ @socket = UDPSocket::new()
21
+ @socket.bind(ip, port)
22
+ # Rescue the "Address in use" error
23
+ rescue Errno::EADDRINUSE
24
+
25
+ databack, info = client.recv(128)
26
+ @remotecommandresult = databack
27
+ @lastremotecommand = "rwdtinker remote:: Port #{port} on host #{ip} ."
28
+ remotehostnotfound = false
29
+
30
+ # Rescue the "Address not available" error
31
+ rescue Errno::EADDRNOTAVAIL
32
+ puts "Network plugin: Address #{host} is not available to bind."
33
+
34
+ # Rescue "permission denied errors
35
+ rescue Errno::EACCES
36
+ puts "Network plugin: Access denied when binding interface addresses. Did you try to bind a port under 1024 as a regular user?"
37
+
38
+ # Rescue all other errors
39
+ rescue
40
+ puts "Network plugin: An error occured."
41
+
42
+ # Rescue all other errors
43
+ end
44
+ if remotehostnotfound
45
+ @remotecommandresult = "Remote Host not running"
46
+ end
47
+ @socket.close
48
+ # Close the socket after use
49
+ client.close()
50
+ end
51
+
52
+ remotehostnotfound = true
53
+ if (commandtext == "query")
54
+ begin
55
+ client = UDPSocket::new()
56
+ client.send(commandtext, 0, ip, port)
57
+ @socket = UDPSocket::new()
58
+ @socket.bind(ip, port)
59
+ # Rescue the "Address in use" error
60
+ rescue Errno::EADDRINUSE
61
+
62
+ databack, info = client.recv(128)
63
+ @remotecommandresult = databack
64
+ @lastremotecommand = "rwdtinker remote: Port #{port} on host #{ip} "
65
+ remotehostnotfound = false
66
+
67
+ # Rescue the "Address not available' error
68
+ rescue Errno::EADDRNOTAVAIL
69
+ puts "Network plugin: Address #{host} is not available to bind."
70
+
71
+ # Rescue "permission denied errors
72
+ rescue Errno::EACCES
73
+ puts "Network plugin: Access denied when binding interface addresses. Did you try to bind a port under 1024 as a regular user?"
74
+
75
+ # Rescue all other errors
76
+ rescue
77
+ puts "Network plugin: An error occured."
78
+
79
+ # Rescue all other errors
80
+ end
81
+ @socket.close
82
+
83
+ # Close the socket after use
84
+ client.close()
85
+ end
86
+
87
+ if remotehostnotfound
88
+ @remotecommandresult = "Remote Host not running"
89
+ end
90
+ end
91
+
92
+ # list the remote control options on the screen
93
+ def showremoteportoptions
94
+
95
+ @remoteportoptions = $rwdcontrolports.rwd_options
96
+ @remotecommandoptions = ["query","stop"].rwd_options
97
+ end
98
+
99
+
@@ -0,0 +1,25 @@
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
+
7
+
8
+
9
+ require 'resolv'
10
+ require 'date'
11
+
12
+ # return the platform information
13
+ def runviewplatform
14
+ @platformdisplay = "Platform is " + RUBY_PLATFORM + "\n"
15
+ @platformdisplay = @platformdisplay + "Ruby Version " + VERSION + "\n"
16
+ @platformdisplay = @platformdisplay + "rwdtinker version " + RwdTinkerVersion + "\n"
17
+ @platformdisplay = @platformdisplay + "program directory " + $progdir + "\n"
18
+ @platformdisplay = @platformdisplay + "hostname " + Resolv.getname(Resolv.getaddress("localhost")) + "\n"
19
+ @platformdisplay = @platformdisplay + "application name " + $rwdapplicationidentity + "\n"
20
+ @platformdisplay = @platformdisplay + "Date " + Date.today().to_s
21
+
22
+ end
23
+
24
+
25
+
@@ -0,0 +1,61 @@
1
+ # help text files used by context sensitive help
2
+
3
+ Helptext.update( :tinkerwin2_help => " You can view the list of applets you can install
4
+ by clicking on the list files button
5
+
6
+ You can download an applet created by someone else
7
+
8
+ put the file in the zips directory
9
+
10
+ rwdtinker applets packaged as RubyGems can be used if you have RubyGems installed.
11
+ You can download rwdtinker gems at the 'Install Remote Applets' tab
12
+ to install applets you need the ruby zlib library installed
13
+ ",
14
+ :applet_viewing => "You can get a list of all installed applets by clicking the 'listfiles button'
15
+ To see the text of a install file
16
+ Type in the name of the file you want.
17
+
18
+ type it without the inf ending
19
+ rwdapplet-0.1
20
+
21
+ Then click the 'View Installed File' button
22
+
23
+ If it finds the file it will open it. It displays the text the search box.
24
+
25
+ You can uninstall applets on this screen",
26
+
27
+ :applet_installation => " You can download an applet created by someone else\n
28
+ put the file in the zips directory\n
29
+
30
+ click on the 'list zips' tab\n
31
+ click on 'list applets available for installing'\n
32
+
33
+ chose the applet you want\n
34
+ click on 'install applet'\n
35
+ If all goes well the applet should be installed.\n
36
+ You will need to restart rwdtinker to see the new screens
37
+ to install applets you need the ruby zlib library installed",
38
+
39
+ :applet_tinkerbackeditconfiguration => " You can edit the configuration
40
+
41
+ Remember to reload the configuration variables if you want your
42
+ changes used.",
43
+ :remotegemapplet_install => " To download and install use the 'Install Remote Applets'
44
+
45
+ First click on 'List applets in the Remote GEM Repository available for downloading'
46
+ then go to the very bottom to click on the applet you want
47
+ then on the top click 'install remote Gem applet package'
48
+
49
+ This installs the package in the Gem system
50
+ You still need to install it into rwdtinker - do that in the 'List Zips' tab
51
+
52
+ For this feature to work, you need
53
+ RubyGems installed
54
+ Variables set correctly in the tinerwin2.cnf file
55
+ $xpcommand, $gemdirectory_withgemfiles and $geminstalled_directory
56
+ the defaults as shipped will normally be for a Debian Linux system
57
+ On Debian Linux, you would usually need to be running rwdtinker as root in order to install RubyGems
58
+
59
+ You can view the list of rwdtinker applets you have installed already by clicking 'view already installed GEM applets'
60
+ "
61
+ )
@@ -0,0 +1,24 @@
1
+ # code in install rwdtinker applets - now uses ruby.zip module
2
+ def installapplet
3
+
4
+ nametext = "%s" % [@a_installapplet]
5
+
6
+ begin # exception trapped block
7
+
8
+
9
+ require 'extras/zip/zip'
10
+ fullname = nametext + ".zip"
11
+ fileName = File.join($zipslocation,fullname)
12
+
13
+ zf = Zip::ZipFile.new(fileName)
14
+ zf.sort.each {
15
+ |entry|
16
+ zf.extract(entry.to_s, entry.to_s)
17
+ }
18
+ @installapplettext = Message[:applet_installed]
19
+
20
+ rescue
21
+ @installapplettext = "unzip error - applet may not be installed correctly"
22
+ end # exception rescue
23
+
24
+ end
@@ -0,0 +1,20 @@
1
+ # install rwdtinker applet from a long directory location
2
+ def installgemapplet
3
+ require 'fileutils'
4
+ require 'extras/zip/zip'
5
+ nametext = "%s" % [@a_installapplet]
6
+
7
+ begin # exception trapped block
8
+ fullname = nametext + ".zip"
9
+
10
+ zf = Zip::ZipFile.new(fullname)
11
+ zf.sort.each {
12
+ |entry|
13
+ zf.extract(entry.to_s, entry.to_s)
14
+ }
15
+ @installapplettext = Message[:applet_installed]
16
+
17
+ rescue
18
+ @installapplettext = "unzip error - applet may not be installed correctly"
19
+ end # exception rescue
20
+ end
@@ -0,0 +1,19 @@
1
+ # download gem of rwdtinker applet
2
+ def superantcominstallremotegemapplet
3
+ require 'fileutils'
4
+
5
+ tempnametext = "%s" % [@superantcominstallremoteappletinput]
6
+ temparray = tempnametext.split(/ /)
7
+ nametext = temparray[0]
8
+ begin # exception trapped block
9
+
10
+
11
+ commandline = $xpcommand + "gem install " + nametext
12
+
13
+ @superantcominstallremotegemappletresult = `#{commandline}`
14
+
15
+ rescue
16
+ @superantcominstallremotegemappletresult = "error during gem install!"
17
+ end # exception rescue
18
+
19
+ end
@@ -0,0 +1,12 @@
1
+ # this code is to list the gem directories that are installed
2
+ def superantcomshowgemfiledirs
3
+
4
+ fileList = Dir.new($gemdirectory_withgemfiles).entries.sort.delete_if { |x| ! (x =~ /\Arwdzip/) }
5
+ @superantcomshowgemappletdirsresult = fileList.rwd_method("superantcomshowgemappletdirsname")
6
+ end
7
+
8
+ def superantcomshowgemappletdirsname(inffile)
9
+ applet = inffile
10
+ @a_gemfiledirsinput = applet
11
+
12
+ end
@@ -0,0 +1,54 @@
1
+ # this code is to list the zips
2
+
3
+
4
+ def fillzipappletname(inffile)
5
+ applet = inffile.gsub(/\.zip$/, "")
6
+ @a_installapplet = applet
7
+
8
+ end
9
+
10
+ def findzipfiles(d)
11
+ a = Array.new(Dir[d].entries.sort)
12
+ #loop through and get the files names
13
+ a.each do |x|
14
+ #adjust the filters to the files you want to see...
15
+ if(!test(?d,x))
16
+ # only zip files
17
+ if x =~ /\.zip/
18
+ puts "#{x}" #opens the file thats in fileName as read only
19
+ $zipsarray = $zipsarray | ["#{x}"]
20
+ end
21
+ end
22
+ end
23
+ end
24
+
25
+ def listgemzips
26
+ startlangdir = $geminstalled_directory
27
+ #get a list of the files and subdirectories on the starting directory only
28
+ alanghash = Array.new(Dir[startlangdir].entries.sort)
29
+ p alanghash
30
+ #loop through the list, ignore the files and add all new directories found
31
+ alanghash.each do |x|
32
+ #if a directory...
33
+ if(test(?d,x))
34
+ # add to the original list of directories
35
+ @@tmproot = x + "/**"
36
+ #adds the new ones to the array
37
+ blanghash = Dir[@@tmproot].entries.sort
38
+ blanghash.each do |x|
39
+ if(test(?d,x))
40
+ alanghash.push(x) #appends to the end of the array...
41
+ end
42
+ end
43
+ end
44
+ end
45
+ alanghash.each do |x|
46
+ #if it is a file...
47
+ if(!test(?d,x))
48
+ alanghash.delete(x)
49
+ else #it is a directory...
50
+ findzipfiles(x + "/**")
51
+ end
52
+ end
53
+ @zipslistresult = $zipsarray.rwd_method("fillzipappletname")
54
+ end
@@ -0,0 +1,11 @@
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
@@ -0,0 +1,31 @@
1
+ # this code is to list the zipped applets that can be installed
2
+
3
+
4
+ def fillziptoinstallname(inffile)
5
+ applet = inffile.gsub(/\.zip$/, "")
6
+ @a_installapplet = applet
7
+
8
+ end
9
+
10
+
11
+
12
+
13
+ def listzipfilestoinstall
14
+ startlangdir = File.join($progdir, $zipslocation )
15
+ #get a list of the files and subdirectories on the starting directory only
16
+
17
+
18
+ a = Array.new(Dir["#{startlangdir}/*"].entries.sort)
19
+
20
+ #loop through and get the files names
21
+ a.each do |x|
22
+ # only zip files
23
+ if x =~ /\.zip/
24
+ # puts "#{x}" #adds the file to the array to display on the screen
25
+ $zipsarraylocal = $zipsarraylocal | ["#{x}"]
26
+ end
27
+
28
+ end
29
+
30
+ @zipslistresult = $zipsarraylocal.rwd_method("fillziptoinstallname")
31
+ end
@@ -0,0 +1,32 @@
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_configline1= fd.readline.chomp
16
+ @a_configline2 = fd.readline.chomp
17
+ @a_configline3 = fd.readline.chomp
18
+ @a_configline4 = fd.readline.chomp
19
+ @a_configline5 = fd.readline.chomp
20
+ @a_configline6 = fd.readline.chomp
21
+ @a_configline7 =fd.readline.chomp
22
+ @a_configline8 = fd.readline.chomp
23
+
24
+ while ! fd.eof?
25
+ @extraconfigdatadisplay = fd.readline
26
+ end
27
+ fd.close
28
+ rescue SystemCallError, StandardError
29
+ $stderr.print "system call error: " + $!
30
+ end # exception rescue
31
+
32
+ end