rwddemo 0.90 → 0.91

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. data/Readme.txt +25 -6
  2. data/code/{rwdcalc → superant.com.rwdcalc}/ca2multiply.rb +0 -0
  3. data/code/{rwdcalc → superant.com.rwdcalc}/changescriptname.rb +0 -0
  4. data/code/superant.com.rwdcalc/clearrubyscriptscreendisplay.rb +9 -0
  5. data/code/{rwdcalc → superant.com.rwdcalc}/clearscriptscreendisplay.rb +0 -0
  6. data/code/{rwdcalc → superant.com.rwdcalc}/deletescriptrecord.rb +0 -0
  7. data/code/{rwdcalc → superant.com.rwdcalc}/fadd.rb +0 -0
  8. data/code/{rwdcalc → superant.com.rwdcalc}/frwdcleartape.rb +0 -0
  9. data/code/{rwdcalc → superant.com.rwdcalc}/frwddivide.rb +0 -0
  10. data/code/{rwdcalc → superant.com.rwdcalc}/frwdmultiply.rb +0 -0
  11. data/code/{rwdcalc → superant.com.rwdcalc}/frwdsubtract.rb +0 -0
  12. data/code/{rwdcalc → superant.com.rwdcalc}/helptexthashrwdcalc.rb +0 -0
  13. data/code/{rwdcalc → superant.com.rwdcalc}/listscripts.rb +0 -0
  14. data/code/superant.com.rwdcalc/loadrubyrecord.rb +20 -0
  15. data/code/{rwdcalc → superant.com.rwdcalc}/loadscriptrecord.rb +0 -0
  16. data/code/{rwdcalc → superant.com.rwdcalc}/mathcommands.rb +0 -0
  17. data/code/{rwdcalc → superant.com.rwdcalc}/openhelpwindowrwdcalc.rb +0 -0
  18. data/code/{rwdcalc → superant.com.rwdcalc}/playscript.rb +1 -1
  19. data/code/{rwdcalc → superant.com.rwdcalc}/renamecalcrecord.rb +0 -0
  20. data/code/{rwdcalc → superant.com.rwdcalc}/runrwdcalcwindow.rb +0 -0
  21. data/code/{rwdcalc → superant.com.rwdcalc}/rwdadd.rb +0 -0
  22. data/code/{rwdcalc → superant.com.rwdcalc}/rwdcleartape.rb +0 -0
  23. data/code/{rwdcalc → superant.com.rwdcalc}/rwddivision.rb +0 -0
  24. data/code/{rwdcalc → superant.com.rwdcalc}/rwdsubtraction.rb +0 -0
  25. data/code/{rwdcalc → superant.com.rwdcalc}/savechangedscript.rb +0 -0
  26. data/code/superant.com.rwdcalc/saverubyscript.rb +20 -0
  27. data/code/{rwdcalc → superant.com.rwdcalc}/viewscript.rb +0 -0
  28. data/code/superant.com.rwdshell/helptexthashshell.rb +24 -0
  29. data/code/superant.com.rwdshell/loadconfigurationrecord.rb +2 -2
  30. data/code/superant.com.rwdshell/openhelpwindowshell.rb +27 -0
  31. data/code/superant.com.rwdshell/playrubyscript.rb +2 -1
  32. data/code/superant.com.rwdshell/playscript.rb +2 -1
  33. data/code/superant.com.rwdshell/shelleval.rb +1 -1
  34. data/code/superant.com.rwdtinkerbackwindow/helptexthashtinkerwin2.rb +4 -1
  35. data/code/superant.com.rwdtinkerbackwindow/installapplet.rb +5 -3
  36. data/code/superant.com.rwdtinkerbackwindow/removeapplet.rb +10 -6
  37. data/configuration/language.cnf +3 -1
  38. data/configuration/language.dist +7 -0
  39. data/configuration/rwdapplicationidentity.cnf +2 -2
  40. data/configuration/rwdapplicationidentity.dist +3 -0
  41. data/configuration/rwdcalc.cnf +5 -2
  42. data/configuration/rwdcalc.dist +7 -0
  43. data/configuration/rwdcalendar.cnf +7 -1
  44. data/configuration/rwdcalendar.dist +10 -0
  45. data/configuration/rwdshell.cnf +3 -0
  46. data/configuration/rwdshell.dist +3 -0
  47. data/configuration/rwdtinker.cnf +3 -4
  48. data/configuration/rwdtinker.dist +15 -0
  49. data/configuration/tinkerwin2variables.cnf +6 -1
  50. data/configuration/tinkerwin2variables.dist +17 -0
  51. data/extras/cmdline_parse +47 -0
  52. data/extras/config_file +69 -0
  53. data/extras/errorMsg +19 -0
  54. data/extras/icalendar.rb +18 -0
  55. data/extras/makePlaylist +34 -0
  56. data/extras/mp3controld +289 -0
  57. data/extras/playlist +186 -0
  58. data/extras/rconftool.rb +380 -0
  59. data/extras/showHelp +18 -0
  60. data/gui/00coreguibegin/applicationguitop.rwd +1 -1
  61. data/gui/frontwindow0/{superant.com.tinkercalendar → superant.com.rwdcalendar}/hl9calendar.rwd +0 -0
  62. data/gui/frontwindow0/superant.com.shellscripts/1listplayscripts.rwd +1 -1
  63. data/gui/frontwindow0/superant.com.shellscripts/2listscripts.rwd +2 -2
  64. data/gui/frontwindow0/superant.com.shellscripts/6rwdshelleval.rwd +3 -4
  65. data/gui/frontwindowtdocuments/superant.com.shelldocument/vvdocshellxp.rwd +1 -0
  66. data/gui/tinkerbackwindows/superant.com.rwdshellbackwindow/46editscriptrecord.rwd +5 -5
  67. data/init.rb +42 -37
  68. data/rwd_files/HowTo_RwdCalc.txt +110 -0
  69. data/rwd_files/HowTo_Shell.txt +14 -1
  70. data/rwd_files/HowTo_Tinker.txt +16 -0
  71. data/rwdconfig.cnf +6 -0
  72. data/rwdconfig.dist +6 -0
  73. data/scripts/test02.rb +1 -1
  74. data/tests/checkdepends.sh +4 -0
  75. data/tests/cleancnf.sh +5 -0
  76. data/tests/makedist.rb +29 -0
  77. data/tests/rdep.rb +354 -0
  78. metadata +62 -48
  79. data/code/superant.com.rwdshell/helptexthashrubyslippers.rb +0 -81
  80. data/code/superant.com.rwdshell/openhelpwindowrubyslippers.rb +0 -50
  81. data/configuration/playscripts.cnf +0 -2
  82. data/configuration/rwdcalcversion.cnf +0 -2
  83. data/configuration/rwdcalendarversion.cnf +0 -4
  84. data/configuration/rwdshellversion.cnf +0 -2
  85. data/configuration/rwdtinkerversion.cnf +0 -2
  86. data/configuration/tinkerwin2version.cnf +0 -3
  87. data/installed/rwdtinkerwin2-0.5.inf +0 -8
  88. data/lang/alanguagehashbegin.rb +0 -4
  89. data/lang/languagehash.rb +0 -4
  90. data/lang/templangfile.rb +0 -22
  91. data/lang/vlanguagehashend.rb +0 -6
  92. data/lang/wlocallangstart.rb +0 -5
  93. data/lang/xlocallangfile.rb +0 -22
  94. data/lang/zlocallangend.rb +0 -2
  95. data/rwddemo-0.90.gem +0 -0
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/ruby
2
+
3
+ # --- showHelp ----
4
+ #
5
+ # Author: Magnus Engstr�m
6
+ # Email: magnus@gisab.se
7
+ # File: showHelp
8
+ #
9
+ # Description
10
+ # -----------
11
+ # This function
12
+ # print the help
13
+ # message on STDOUT
14
+ # -----------------
15
+
16
+ def showHelp()
17
+ STDOUT.puts("MaGnuX Mp3 Management server - Ruby Edition v0.2a\n-------------------------------------------------\n\n--help\t\t\tShow this message\n--debug on\t\tShow some debug data\n--configfile file\tSelect configuration file\n--daemon, -D (yes*|no)\tGo to background on startup\n\n")
18
+ end
@@ -1,4 +1,4 @@
1
1
  $rwdguivar=
2
2
  "<application>
3
- <window name=\"main\" title=\"rwddemo for Tinker - RubyWebDialogs\">
3
+ <window name=\"main\" title=\"Tinker - RubyWebDialogs\">
4
4
  <tabs>"
@@ -10,7 +10,7 @@ $rwdguivar=
10
10
 
11
11
  <horizontal>
12
12
  <button caption=\"Execute\" action=\"playscript\"/>
13
- <button caption=\"Cancel\" action=\"main\"/>
13
+ <button caption=\"Help\" action=\"runhelpwindowrwdshell\"/>
14
14
 
15
15
  </horizontal>
16
16
  <p>%playscript_display%</p>"
@@ -7,7 +7,7 @@ $rwdguivar=
7
7
 
8
8
  <horizontal>
9
9
  <button caption=\"ViewScript\" action=\"viewscript\"/>
10
- <button caption=\"Cancel\" action=\"main\"/>
10
+
11
11
 
12
12
  </horizontal>
13
13
  <p>%displayscripttext%</p>
@@ -15,7 +15,7 @@ $rwdguivar=
15
15
  <horizontal>
16
16
 
17
17
  <button caption=\"ListFiles\" action=\"listscripts\"/>
18
- <button caption=\"Cancel\" action=\"main\"/>
18
+
19
19
 
20
20
  </horizontal>
21
21
  <p>%%listscriptresult%%</p>
@@ -4,13 +4,12 @@ $rwdguivar=
4
4
 
5
5
  <table>
6
6
  <row> <p align=\"right\">Shell Command:</p> <text name=\"a_shelleval\"/> </row>
7
-
8
- </table>
9
- <p>%result%</p>
10
7
  <horizontal>
11
8
  <button caption=\"Execute\" action=\"shelleval\"/>
12
- <button caption=\"Cancel\" action=\"main\"/>
13
9
 
14
10
  </horizontal>
15
11
 
12
+ </table>
13
+ <p>%result%</p>
14
+
16
15
  </tab>"
@@ -1,3 +1,4 @@
1
+
1
2
  $rwdguivar=
2
3
  "
3
4
  <row> <p align=\"left\">
@@ -1,9 +1,9 @@
1
1
  $rwdguivar=
2
2
  "
3
- <tab name=\"editeventrecordfile\" caption=\"Edit Script\">
3
+ <tab name=\"editrubyrecordfile\" caption=\"Edit Script\">
4
4
  <table>
5
5
  <row> <p> </row>
6
- <row> <p align=\"right\">NOT YET WORKING:You will be able to create a new record here or edit one</row>
6
+ <row> <p align=\"right\">:You can create a new record here or edit one</row>
7
7
  <row> <p> </row>
8
8
  <horizontal>
9
9
  <button caption=\"Fill Record\" action=\"loadrubyscriptrecord\"/>
@@ -13,16 +13,16 @@ $rwdguivar=
13
13
  </horizontal>
14
14
  <horizontal>
15
15
  <row> <p align=\"right\">FileName:</p>
16
- <text name=\"a_calcscriptfilename\"/>
16
+ <text name=\"a_rubyscriptfilename\"/>
17
17
  </horizontal>
18
18
  <table>
19
- <textarea name=\"a_calcscriptrecord\"/> </row>
19
+ <textarea name=\"a_rubyscriptrecord\"/> </row>
20
20
 
21
21
 
22
22
  </table>
23
23
 
24
24
  <p>
25
- <p>%neweventresult%</p>
25
+ <p>%newrubyresult%</p>
26
26
 
27
27
 
28
28
 
data/init.rb CHANGED
@@ -23,6 +23,7 @@
23
23
 
24
24
  require "ev/rwd"
25
25
  require 'fileutils'
26
+ require 'extras/rconftool'
26
27
 
27
28
  $progdir = File::expand_path( File.dirname(__FILE__))
28
29
 
@@ -51,15 +52,33 @@ $progdir = File::expand_path( File.dirname(__FILE__))
51
52
  if(!test(?d,x))
52
53
  # only rwd files
53
54
  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
55
+
56
+ load x #opens the file thats in fileName and reads it
57
+ $tempdoc += $rwdguivar # adds the file into the doc string
56
58
  end
57
59
  end
58
60
  end
59
61
  end
60
62
 
63
+ # integrate the new configuration files
64
+ MAINconfignew = "rwdconfig.cnf"
65
+ MAINconfigdist = "rwdconfig.dist"
66
+ Rconftool::install(MAINconfigdist,MAINconfignew)
67
+
68
+ Dir.chdir("configuration") #changes the current working directory
69
+
70
+ fileList = Dir.new(".").entries.sort.reverse.delete_if { |x| ! (x =~ /dist$/) } #creates an Array separated with \n
71
+ @doc = ""
72
+ fileList.length.times{ #opening of a block
73
+ configdist =fileList.pop #pops the first item out of the Array
74
+ tempconfigfile = configdist.gsub(/\.dist$/, "")
75
+ confignew = tempconfigfile + ".cnf"
76
+ Rconftool::install(configdist,confignew) #integrates new file with old
77
+ } #closing block
78
+ # END of configuration integration
79
+ Dir.chdir($progdir)
80
+
61
81
  # Read in the configuration files
62
-
63
82
  Dir.chdir("configuration") #changes the current working directory
64
83
 
65
84
  fileList = Dir.new(".").entries.sort.reverse.delete_if { |x| ! (x =~ /cnf$/) } #creates an Array separated with \n
@@ -69,10 +88,12 @@ $progdir = File::expand_path( File.dirname(__FILE__))
69
88
  load fileName #loads the the config file thats in fileName
70
89
  } #closing block
71
90
  # END of configuration reading
72
-
91
+
73
92
  Dir.chdir($progdir) # change back to top program directory
74
93
 
75
94
  # build the English Language hash file from the parts
95
+ languagehashvariable = 'Message = Hash.new { |hh, kk| hh[kk] = "ERROR: Message not found: #{kk.inspect}."; hh[kk] }
96
+ langmessage = {' + "\n"
76
97
  startlangdir = File.join(LangDir,"en")
77
98
  #get a list of the files and subdirectories on the starting directory only
78
99
  alanghash = Array.new(Dir[startlangdir].entries.sort)
@@ -100,10 +121,11 @@ $progdir = File::expand_path( File.dirname(__FILE__))
100
121
  end
101
122
  end
102
123
 
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
124
+
125
+ #writes the contents of doc into the languagehashvariable
126
+ languagehashvariable = languagehashvariable + $tempdoc + "} ; langmessage.each { |kk, vv| Message[kk] = vv }"
127
+
128
+ # END of en Lang building
107
129
  $tempdoc = " "
108
130
  Dir.chdir($progdir) # change back to top program directory
109
131
 
@@ -135,31 +157,16 @@ $progdir = File::expand_path( File.dirname(__FILE__))
135
157
  end
136
158
  end
137
159
 
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
160
+
161
+ #writes the contents of doc into the variable
162
+ languagehashvariable = languagehashvariable + " ; Message.update(" + $tempdoc + ' :rwdtinker => "Rwdtinker" ) '
163
+
141
164
 
142
165
  $tempdoc = " "
143
166
 
144
167
  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
168
+
169
+ temp = eval( languagehashvariable )
163
170
 
164
171
  $tempdoc = " "
165
172
 
@@ -190,10 +197,9 @@ Dir.chdir($progdir)
190
197
  end
191
198
  end
192
199
 
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
200
+
201
+ # load the program file
202
+ tempcoderesult = eval( $tempdoc )
197
203
 
198
204
  # build the actual GUI from the gui parts
199
205
  $tempdoc = " "
@@ -224,9 +230,8 @@ Dir.chdir($progdir)
224
230
  end
225
231
  end
226
232
 
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
233
+ # gui variable is done
234
+ guiRWD = $tempdoc
230
235
 
231
236
  require 'socket' # Network stuff
232
237
  host = "127.0.0.1"
@@ -266,4 +271,4 @@ $port = port
266
271
  end
267
272
 
268
273
 
269
- RwdTinker.file(RWDFile).serve(port) # start the main class and program
274
+ RwdTinker.new( guiRWD).serve(port) # start the main class and program
@@ -0,0 +1,110 @@
1
+ = HowTo use the RwdCalc Program
2
+
3
+
4
+ rwdcalc is a web brower interface to arithmetic commands
5
+
6
+
7
+ 3. use a calculator
8
+
9
+
10
+ The GUI interface used is RubyWebDialogs
11
+
12
+
13
+ Start the program by typing
14
+ ruby init.rb
15
+
16
+ Then point your web browser to:
17
+ http://localhost:7705/
18
+
19
+
20
+
21
+
22
+ == Calculator
23
+
24
+ add or multiply 2 numbers together
25
+
26
+ subtract or divide
27
+
28
+ see a running tape
29
+
30
+
31
+
32
+ == Documents
33
+
34
+ when you click on a document name, the document should pop up in a
35
+ browser window, or in another browser tab.
36
+
37
+ To exit, press the x inside the browser window.
38
+
39
+
40
+
41
+
42
+ Requirements:
43
+ RubyWebDialogs - I am using 0.0.11 2004-3-9
44
+ This package you downloaded rwddemo should have a runtime version of
45
+ the needed rubywebdialog files
46
+
47
+ Ruby I am using version 1.8.2
48
+
49
+ I have tested this under Linux-Debian kernel 2.6.9
50
+
51
+ Operation:
52
+ The code files reside in the code directory and are combined before
53
+ the main Class is loaded
54
+
55
+ The rwd files in gui are combined before the gui is activated
56
+
57
+ Installing:
58
+
59
+ untar the file
60
+ tar zxvf rwdshell-x.y.tar.gz
61
+ then cd to the directory
62
+ cd rwdshell-x.y
63
+ then start the init.rb program file
64
+ ruby init.rb
65
+ Trouble shooting:
66
+
67
+ If the program is not working, try looking at the ev subdirectory. That is where
68
+ the runtime of rubywebdialogs are.
69
+
70
+ for long term installation, I would suggest putting most files in a lib directory
71
+ like /usr/lib/rwdshell
72
+ then make a writable directory the local directory for command files to be written
73
+ like ~/rwdshell
74
+
75
+
76
+ Closing the browser doesn't terminate the application. You have to use the application's close-button And terminating the application doesn't terminate the application when running in network mode. You just log out.
77
+
78
+ Don't use the back-button of the browser! Strange and unpredictable things may and will happen!
79
+
80
+ RubyWebDialogs is a platform independent graphical user interface for Ruby applications. It generates HTML and serves it with an internal HTTP server, so you can use your favorite web browser as the front end for your Ruby application. All this means, that it can be used on almost every platform, like Ruby itself. http://www.erikveen.dds.nl/rubywebdialogs/
81
+
82
+
83
+ For more information see:
84
+ http://rwdapplications.rubyforge.org/wiki/wiki.pl
85
+
86
+
87
+ For more information about RubyWebDialogs see:
88
+ http://www.erikveen.dds.nl/rubywebdialogs/index.html
89
+
90
+ Thanks, Steven Gibson
91
+
92
+ == Changelog
93
+ Version 0.5
94
+ corrected selectiontab
95
+ added sample math demos
96
+ added script running tab
97
+ added script editing
98
+ added script rename, delete
99
+ updated for rwdtinker 1.51
100
+
101
+ Version 0.3
102
+ Changed directory structure to work with rwdtinker 1.4.
103
+ Added running tape
104
+ Added subtraction and division
105
+ moved to second window
106
+
107
+ Version 0.2
108
+ converted to rwdtinker applet
109
+
110
+
@@ -193,13 +193,26 @@ http://www.erikveen.dds.nl/rubywebdialogs/index.html
193
193
  Thanks, Steven Gibson
194
194
 
195
195
  == Changelog
196
+ version 0.97
197
+ correct bug in shell command eval
198
+ beginning to add context help
199
+ updated for rwdtinker version 1.58
200
+ added rconftool use to update configuration files
201
+ changed applets removal to not use external rm
202
+ removed version number from directory name
203
+
204
+ version 0.96
205
+ updated for rwdtinker 1.56
206
+ first debian version
207
+ correct execute shell script to work with changed scripts directory
208
+
196
209
  version 0.95
197
210
  added ruby script running
198
211
  add back window for more control tabs
199
212
  beginning of context sensitive help
200
213
  wider text boxes for configuration information
201
214
  updated for rwdtinker 1.51 - finds available port and remote control
202
- updated for rwdtinker 1.52 - cam install applets from Gems
215
+ updated for rwdtinker 1.52 - can install applets from Gems
203
216
 
204
217
  version 0.94
205
218
  updated for rwdtinker 1.44 - refactor gui directory structure
@@ -227,6 +227,22 @@ http://www.erikveen.dds.nl/rubywebdialogs/index.html
227
227
  Thanks, Steven Gibson
228
228
 
229
229
  == Changelog
230
+ version 1.58
231
+ check for zlib
232
+ check for files to delete
233
+
234
+ version 1.57
235
+ added rconftool use to update configuration files
236
+ changed applets remove to not used external rm
237
+
238
+ version 1.56
239
+ refactored gui files to load without intermediate files
240
+ refactored code files to load without intermediate files
241
+
242
+ version 1.55
243
+ refactored language files to load without intermediate files
244
+ refactored language files to load without intermediate files
245
+
230
246
  version 1.54
231
247
  refactored rwdtinker applet installation tab - remote gem and local installs share menu buttons
232
248
  corrected some program logic errors in remote control code including close socket
@@ -0,0 +1,6 @@
1
+ ##VERSION:1.57
2
+ # rwdtinker core configuration file
3
+ ##NAME: ConfigLocation:0
4
+ ConfigLocation=""
5
+ ##NAME: ZipsLocation:0
6
+ ZipsLocation=""
@@ -0,0 +1,6 @@
1
+ ##VERSION:1.57
2
+ # rwdtinker core configuration file
3
+ ##NAME: ConfigLocation:0
4
+ ConfigLocation=""
5
+ ##NAME: ZipsLocation:0
6
+ ZipsLocation=""
@@ -1,2 +1,2 @@
1
1
  # this is a test Math Script
2
- @playrubyscript_display = @a_rwdrubyx.to_i + @a_rwdrubyy.to_i
2
+ @playrubyscript_display = @a_rwdrubyx.to_i + @a_rwdrubyy.to_i
@@ -0,0 +1,4 @@
1
+ #!/bin/sh
2
+ ruby rdep.rb ../*.rb
3
+ echo "checking installapplet.rb"
4
+ ruby rdep.rb ../code/superant.com.rwdtinkerbackwindow/installapplet.rb
@@ -0,0 +1,5 @@
1
+ #!/bin/sh
2
+ rm *.cnf
3
+ rm *.bak
4
+ rm configuration/*.cnf
5
+ rm configuration/*.bak