rubyslippers 1.01 → 1.02

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. data/Readme.txt +6 -0
  2. data/code/01rwdcore/01rwdcore.rb +16 -16
  3. data/code/01rwdcore/jumplinkcommand.rb +30 -0
  4. data/code/01rwdcore/openhelpwindow.rb +26 -26
  5. data/code/01rwdcore/returntomain.rb +8 -8
  6. data/code/01rwdcore/rwdtinkerversion.rb +12 -13
  7. data/code/01rwdcore/rwdwindowreturn.rb +3 -5
  8. data/code/01rwdcore/test_cases.rb +79 -90
  9. data/code/01rwdcore/test_harness.rb +7 -10
  10. data/code/01rwdcore/uploadreturns.rb +60 -60
  11. data/code/superant.com.rubyslippers/jumplinkupdate.rb +23 -0
  12. data/code/superant.com.rubyslippers/listgemremote.rb +3 -6
  13. data/code/superant.com.rwdtinkerbackwindow/controlclient.rb +89 -92
  14. data/code/superant.com.rwdtinkerbackwindow/diagnostictab.rb +15 -21
  15. data/code/superant.com.rwdtinkerbackwindow/installapplet.rb +19 -18
  16. data/code/superant.com.rwdtinkerbackwindow/installgemapplet.rb +20 -19
  17. data/code/superant.com.rwdtinkerbackwindow/installremotegem.rb +19 -18
  18. data/code/superant.com.rwdtinkerbackwindow/listgemdirs.rb +7 -7
  19. data/code/superant.com.rwdtinkerbackwindow/listgemzips.rb +48 -49
  20. data/code/superant.com.rwdtinkerbackwindow/listinstalledfiles.rb +8 -7
  21. data/code/superant.com.rwdtinkerbackwindow/listzips.rb +22 -26
  22. data/code/superant.com.rwdtinkerbackwindow/loadconfigurationrecord.rb +32 -31
  23. data/code/superant.com.rwdtinkerbackwindow/loadconfigurationvariables.rb +14 -13
  24. data/code/superant.com.rwdtinkerbackwindow/network.rb +82 -82
  25. data/code/superant.com.rwdtinkerbackwindow/openappletname.rb +18 -17
  26. data/code/superant.com.rwdtinkerbackwindow/openhelpwindowtinkerwin2.rb +37 -37
  27. data/code/superant.com.rwdtinkerbackwindow/remotegemlist.rb +20 -20
  28. data/code/superant.com.rwdtinkerbackwindow/removeapplet.rb +33 -32
  29. data/code/superant.com.rwdtinkerbackwindow/runrwdtinkerbackwindow.rb +8 -9
  30. data/code/superant.com.rwdtinkerbackwindow/rwdtinkerwin2version.rb +10 -11
  31. data/code/superant.com.rwdtinkerbackwindow/saveconfigurationrecord.rb +19 -18
  32. data/code/superant.com.rwdtinkerbackwindow/viewappletcontents.rb +21 -20
  33. data/code/superant.com.rwdtinkerbackwindow/viewgemappletcontents.rb +23 -20
  34. data/configuration/language.dist +1 -1
  35. data/configuration/rubyslippers.dist +2 -2
  36. data/configuration/rwdapplicationidentity.dist +2 -2
  37. data/configuration/rwdtinker.dist +3 -3
  38. data/configuration/tinkerwin2variables.dist +1 -1
  39. data/gui/frontwindowselectionbegin/selectiontabbegin/selectiontabbegin.rwd +2 -7
  40. data/gui/frontwindowselections/superant.com.rwdtinkerwin2selectiontab/jumplinkcommands.rwd +15 -0
  41. data/gui/tinkerbackwindows/superant.com.rubyslippersbackwindow/94rwddiagnostics.rwd +0 -18
  42. data/gui/tinkerbackwindows/superant.com.rubyslippersbackwindow/m90selectiontab.rwd +11 -0
  43. data/gui/tinkerbackwindows/superant.com.rubyslippersbackwindow/m95jumplinkcommands.rwd +15 -0
  44. data/gui/{frontwindow0/superant.com.rubyslippers/m99menuend.rwd → tinkerbackwindows/superant.com.rubyslippersbackwindow/m99selection.rwd} +0 -0
  45. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/81jumplinkcommands.rwd +17 -0
  46. data/init.rb +228 -228
  47. data/installed/rwdviewlogo-0.4.inf +4 -0
  48. data/rwd_files/HowTo_RubySlippers.txt +6 -0
  49. data/rwd_files/HowTo_Tinker.txt +6 -0
  50. data/rwd_files/remotegemlist.txt +58 -24
  51. data/rwdconfig.dist +1 -1
  52. data/tests/makedist.rb +36 -7
  53. data/tests/rubyslippers-1.01.gemspec +16 -0
  54. metadata +11 -19
  55. data/gui/frontwindow0/superant.com.rubyslippers/m01menubegin.rwd +0 -10
  56. data/gui/frontwindow0/superant.com.rubyslippers/m02menu.rwd +0 -60
  57. data/gui/frontwindow0/superant.com.rubyslippers/m03menu.rwd +0 -12
  58. data/gui/frontwindow0/superant.com.rubyslippers/m85menu.rwd +0 -21
  59. data/gui/frontwindow0/superant.com.rubyslippers/m88menu.rwd +0 -12
  60. data/gui/frontwindowselections/superant.com.rubyslippersselectiontab/rubyslippersselectiontab.rwd +0 -12
  61. data/gui/frontwindowselections/superant.com.rwdtinkerwin2selectiontab/rwdwin2selectiontab.rwd +0 -12
  62. data/gui/tinkerbackwindows/superant.com.rubyslippersbackwindow/m01menubegin.rwd +0 -10
  63. data/gui/tinkerbackwindows/superant.com.rubyslippersbackwindow/m02menu.rwd +0 -60
  64. data/gui/tinkerbackwindows/superant.com.rubyslippersbackwindow/m03menu.rwd +0 -12
  65. data/gui/tinkerbackwindows/superant.com.rubyslippersbackwindow/m85menu.rwd +0 -21
  66. data/gui/tinkerbackwindows/superant.com.rubyslippersbackwindow/m88menu.rwd +0 -12
  67. data/gui/tinkerbackwindows/superant.com.rubyslippersbackwindow/m99menuend.rwd +0 -3
  68. data/gui/tinkerbackwindows/superant.com.rubyslippersbackwindow/v9returntab.rwd +0 -11
  69. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/80tab1.rwd +0 -11
@@ -1,11 +1,12 @@
1
1
  # this code is to list the applets that are installed
2
2
  def listinstalledfiles
3
- fileList = Dir.new("installed").entries.sort.reverse.delete_if { |x| ! (x =~ /inf$/) }
4
- @filesresult = fileList.rwd_method("fillappletname")
3
+ fileList = Dir.new("installed").entries.sort.reverse.delete_if { |x| ! (x =~ /inf$/) }
4
+ @filesresult = fileList.rwd_method("fillappletname")
5
5
  end
6
-
6
+
7
7
  def fillappletname(inffile)
8
- applet = inffile.gsub(/\.inf$/, "")
9
- @a_installlist = applet
10
- @a_removeapplet = applet
11
- end
8
+ applet = inffile.gsub(/\.inf$/, "")
9
+ @a_installlist = applet
10
+ @a_removeapplet = applet
11
+ end
12
+
@@ -1,31 +1,27 @@
1
1
  # this code is to list the zipped applets that can be installed
2
-
3
-
4
2
  def fillziptoinstallname(inffile)
5
- applet = inffile.gsub(/\.zip$/, "")
6
- @a_installapplet = applet
7
-
3
+ applet = inffile.gsub(/\.zip$/, "")
4
+ @a_installapplet = applet
5
+
8
6
  end
9
-
10
7
 
11
-
12
-
13
8
  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
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
+ # puts "#{x}" #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
+
@@ -1,32 +1,33 @@
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
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
31
33
 
32
- end
@@ -1,13 +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
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
+
@@ -1,87 +1,87 @@
1
- #!ruby
1
+ #network
2
2
  require 'socket' # Network stuff
3
3
  require 'timeout' # Timeout functions
4
4
 
5
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()
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
87
 
@@ -1,18 +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
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
17
19
 
18
- end
@@ -1,42 +1,42 @@
1
1
  # this code is to call the help window
2
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 == "rwdremotecontrol"
24
- $help_topic = "remote_control"
25
-
26
- end
27
- if @rwd_tab == "superantcomremotezipsinstall"
28
- $help_topic = "remotegemapplet_install"
29
- end
30
-
31
-
32
- if @rwd_window != "rwdtinkerhelpwindow"
33
- $previouswindow = @rwd_window
34
- $previoustab = @rwd_tab
35
- else
36
- $previouswindow = @rwd_window
37
- $previoustab = @rwd_tab
38
- end
39
- runhelpwindow
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 == "rwdremotecontrol"
24
+ $help_topic = "remote_control"
25
+
26
+ end
27
+ if @rwd_tab == "superantcomremotezipsinstall"
28
+ $help_topic = "remotegemapplet_install"
29
+ end
30
+
31
+
32
+ if @rwd_window != "rwdtinkerhelpwindow"
33
+ $previouswindow = @rwd_window
34
+ $previoustab = @rwd_tab
35
+ else
36
+ $previouswindow = @rwd_window
37
+ $previoustab = @rwd_tab
38
+ end
39
+ runhelpwindow
40
40
  end
41
41
 
42
42