rwdtinker 1.53 → 1.54

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,28 +1,22 @@
1
- #
1
+ # Bind message passing socket to rwdtinker application
2
2
 
3
3
  def runcontrolcommand
4
4
  require 'socket'
5
5
 
6
6
  # Change this line...
7
- ip = '127.0.0.1'
7
+ ip = '127.0.0.1'
8
8
  # And this one...
9
- port = $rwdcontrolport1
10
- if @a_remoteportinput
11
- port = @a_remoteportinput.to_i
12
- end
13
- # Done!
9
+ port = $rwdcontrolport1
10
+ if @a_remoteportinput
11
+ port = @a_remoteportinput.to_i
12
+ end
14
13
 
15
-
16
14
  commandtext = @a_remotecommandinput.to_s
17
-
18
- remotehostnotfound = true
19
-
20
- client = UDPSocket::new()
21
- client.send(commandtext, 0, ip, port)
22
-
23
-
24
- if (commandtext == "stop")
25
- begin
15
+ remotehostnotfound = true
16
+ if (commandtext == "stop")
17
+ begin
18
+ client = UDPSocket::new()
19
+ client.send(commandtext, 0, ip, port)
26
20
  @socket = UDPSocket::new()
27
21
  @socket.bind(ip, port)
28
22
  # Rescue the "Address in use" error
@@ -51,17 +45,20 @@ begin
51
45
  @remotecommandresult = "Remote Host not running"
52
46
  end
53
47
  @socket.close
54
- end
48
+ # Close the socket after use
49
+ client.close()
50
+ end
55
51
 
56
- remotehostnotfound = true
57
- if (commandtext == "query")
58
- begin
52
+ remotehostnotfound = true
53
+ if (commandtext == "query")
54
+ begin
55
+ client = UDPSocket::new()
56
+ client.send(commandtext, 0, ip, port)
59
57
  @socket = UDPSocket::new()
60
58
  @socket.bind(ip, port)
61
59
  # Rescue the "Address in use" error
62
60
  rescue Errno::EADDRINUSE
63
61
 
64
-
65
62
  databack, info = client.recv(128)
66
63
  @remotecommandresult = databack
67
64
  @lastremotecommand = "rwdtinker remote: Port #{port} on host #{ip} "
@@ -82,15 +79,17 @@ begin
82
79
  # Rescue all other errors
83
80
  end
84
81
  @socket.close
85
- end
86
- if remotehostnotfound
87
- @remotecommandresult = "Remote Host not running"
88
- end
82
+
89
83
  # Close the socket after use
90
84
  client.close()
85
+ end
91
86
 
87
+ if remotehostnotfound
88
+ @remotecommandresult = "Remote Host not running"
89
+ end
92
90
  end
93
91
 
92
+ # list the remote control options on the screen
94
93
  def showremoteportoptions
95
94
 
96
95
  @remoteportoptions = $rwdcontrolports.rwd_options
@@ -1,4 +1,4 @@
1
-
1
+ # help text files used by context sensitive help
2
2
 
3
3
  Helptext.update( :tinkerwin2_help => " You can view the list of applets you can install
4
4
  by clicking on the list files button
@@ -1,3 +1,4 @@
1
+ # code in install rwdtinker applets - now uses ruby.zip module
1
2
  def installapplet
2
3
  require 'fileutils'
3
4
  require 'extras/zip/zip'
@@ -1,3 +1,4 @@
1
+ # install rwdtinker applet from a long directory location
1
2
  def installgemapplet
2
3
  require 'fileutils'
3
4
  require 'extras/zip/zip'
@@ -6,16 +7,14 @@
6
7
  begin # exception trapped block
7
8
  fullname = nametext + ".zip"
8
9
 
9
-
10
- zf = Zip::ZipFile.new(fullname)
11
- zf.sort.each {
12
- |entry|
13
- zf.extract(entry.to_s, entry.to_s)
10
+ zf = Zip::ZipFile.new(fullname)
11
+ zf.sort.each {
12
+ |entry|
13
+ zf.extract(entry.to_s, entry.to_s)
14
14
  }
15
- @installapplettext = Message[:applet_installed]
15
+ @installapplettext = Message[:applet_installed]
16
16
 
17
17
  rescue
18
18
  @installapplettext = "unzip error - applet may not be installed correctly"
19
19
  end # exception rescue
20
-
21
20
  end
@@ -1,3 +1,4 @@
1
+ # download gem of rwdtinker applet
1
2
  def superantcominstallremotegemapplet
2
3
  require 'fileutils'
3
4
 
@@ -1,16 +1,31 @@
1
1
  # this code is to list the zipped applets that can be installed
2
- def listzipfilestoinstall
3
- if File.exist?($zipslocation)
4
- fileList = Dir.new($zipslocation).entries.sort.delete_if { |x| ! (x =~ /zip$/) }
5
- @zipslistresult = fileList.rwd_method("fillziptoinstallname")
6
- end
7
- end
2
+
8
3
 
9
4
  def fillziptoinstallname(inffile)
10
5
  applet = inffile.gsub(/\.zip$/, "")
11
6
  @a_installapplet = applet
12
7
 
13
8
  end
9
+
14
10
 
15
11
 
16
-
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
@@ -1,4 +1,4 @@
1
- # this method adds a new address record
1
+ # this method saves the configuration record
2
2
  def saveconfigurationrecord
3
3
  require 'fileutils'
4
4
  if @a_configurationfilename
@@ -1,2 +1,2 @@
1
1
 
2
- RwdTinkerVersion = "1.53"
2
+ RwdTinkerVersion = "1.54"
@@ -1,7 +1,7 @@
1
1
 
2
2
  TinkerWin2ConfigurationFileName = "tinkerwin2variables.cnf" # this file name - do not change
3
3
  $zipslocation = "zips" # location of applets to add
4
- $zipsarray = [""]
4
+ $zipsarray = [""] ; $zipsarraylocal = [""]
5
5
  $xpcommand = " " # Linux machines
6
6
  # $xpcommand = "cmd /C " # XP machines with cmd shell
7
7
  $gemdirectory_withgemfiles = "/usr/lib/ruby/gems/1.8/gems"
@@ -6,30 +6,29 @@ $rwdguivar=
6
6
  <row> <p align=\"right\">File Name:</p> <text size=70 name=\"a_installapplet\"/> </row>
7
7
 
8
8
  </table>
9
- <horizontal>
10
- <button caption=\"view applet contents\" action=\"viewappletcontents\"/>
11
- <button caption=\"view (GEM Directory) applet contents\" action=\"viewgemappletcontents\"/>
12
- </horizontal>
13
- <p>%appletcontentstext%</p>
9
+
14
10
 
15
11
  <horizontal>
16
12
 
17
-
18
- <button caption=\"install applet\" action=\"installapplet\"/>
19
- <button caption=\"install (Gem Directory) applet\" action=\"installgemapplet\"/>
13
+
14
+ <button caption=\"install (rwdtinker) applet\" action=\"installgemapplet\"/>
20
15
  <button caption=\"Help\" action=\"runhelpwindowtinkerwin2\"/>
21
16
 
22
17
  </horizontal>
23
18
  <p>%installapplettext%</p>
24
19
 
25
-
20
+ <horizontal>
21
+
22
+ <button caption=\"view (rwdtinker) applet contents\" action=\"viewgemappletcontents\"/>
23
+ </horizontal>
24
+ <p>%appletcontentstext%</p>
26
25
  <table>
27
26
  <row> <p align=\"right\">Click below to view the list of zip files </row>
28
27
 
29
28
  </table>
30
29
 
31
30
  <horizontal>
32
- <button caption=\"List applets available for installing\" action=\"listzipfilestoinstall\"/>
31
+ <button caption=\"List (zip directory) applets available for installing\" action=\"listzipfilestoinstall\"/>
33
32
 
34
33
  <button caption=\"List applets (in the GEM Directory) available for installing\" action=\"listgemzips\"/>
35
34
 
@@ -227,6 +227,10 @@ http://www.erikveen.dds.nl/rubywebdialogs/index.html
227
227
  Thanks, Steven Gibson
228
228
 
229
229
  == Changelog
230
+ version 1.54
231
+ refactored rwdtinker applet installation tab - remote gem and local installs share menu buttons
232
+ corrected some program logic errors in remote control code including close socket
233
+
230
234
  version 1.53
231
235
  added search of Gems repository for rwdtinker gems
232
236
  download and install of Gems
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.4
3
3
  specification_version: 1
4
4
  name: rwdtinker
5
5
  version: !ruby/object:Gem::Version
6
- version: "1.53"
7
- date: 2005-02-12
6
+ version: "1.54"
7
+ date: 2005-02-13
8
8
  summary: rwdtinker application is a framework to program for RubyWebDialogs.
9
9
  require_paths:
10
10
  - "."
@@ -145,8 +145,6 @@ files:
145
145
  - rwd_files/rwdindex.html
146
146
  - rwd_files/tinker.png
147
147
  - zips/rwdahelloworld-0.5.zip
148
- - zips/rwdwcalc-0.50.zip
149
- - zips/rwdmovies-0.90.zip
150
148
  - tests/rwdtinkertestEN.rb
151
149
  - tests/test.result
152
150
  - tests/totranslate.lang
Binary file
Binary file