rwdshell 0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/Readme.txt +57 -0
- data/bin/rwdshell +19 -0
- data/code/ag1core/aa0begin.rb +18 -0
- data/code/ag1core/rwdtinkerversion.rb +15 -0
- data/code/al5languagefiles/alanguagehashbegin.rb +4 -0
- data/code/al5languagefiles/languagehash.rb +4 -0
- data/code/al5languagefiles/templangfile.rb +6 -0
- data/code/al5languagefiles/zlanguagehashend.rb +6 -0
- data/code/cb7rubyeval/cb7rubyeval.rb +23 -0
- data/code/dd0shelleval/dd0shelleval.rb +20 -0
- data/code/ek0shellscripts/ek0playscript.rb +22 -0
- data/code/ek0shellscripts/em0listscripts.rb +12 -0
- data/code/ek0shellscripts/em1viewscript.rb +18 -0
- data/code/ek0shellscripts/en0createnewscript.rb +18 -0
- data/code/gh9calendar/gh9calendar.rb +16 -0
- data/code/ii3calculator/ca2multiply.rb +5 -0
- data/code/ii3calculator/ca4add.rb +5 -0
- data/code/lm1installapplets/ll5listzips.rb +14 -0
- data/code/lm1installapplets/lm1installapplet.rb +20 -0
- data/code/ssdiagnostictab/diagnostictab.rb +20 -0
- data/code/xa5rwdtinkercallable/callable.rb +13 -0
- data/code/xb1rwdtinkerbackwindow/05listinstalledfiles.rb +11 -0
- data/code/xb1rwdtinkerbackwindow/diagnostictab.rb +20 -0
- data/code/xb1rwdtinkerbackwindow/ll1openname.rb +18 -0
- data/code/xb1rwdtinkerbackwindow/ll5listzips.rb +14 -0
- data/code/xb1rwdtinkerbackwindow/lm1installapplet.rb +20 -0
- data/code/xb1rwdtinkerbackwindow/mm1removeapplet.rb +28 -0
- data/code/xb1rwdtinkerbackwindow/rwdtinkerwin2version.rb +14 -0
- data/code/zz0applicationend/zz0end.rb +4 -0
- data/configuration/aa0rwdframework.cnf +11 -0
- data/configuration/ab1tinkerwin2.cnf +3 -0
- data/configuration/ek0playscripts.cnf +2 -0
- data/configuration/gh1rwdcalendar.cnf +26 -0
- data/ev/browser.rb +109 -0
- data/ev/ftools.rb +170 -0
- data/ev/net.rb +750 -0
- data/ev/ruby.rb +819 -0
- data/ev/rwd.rb +1848 -0
- data/ev/sgml.rb +236 -0
- data/ev/thread.rb +63 -0
- data/ev/tree.rb +343 -0
- data/ev/xml.rb +4 -0
- data/extras/cal.rb +166 -0
- data/gui/en/aa2core/aa0rwdtop.rwd +3 -0
- data/gui/en/cb7rubyeval/cb7rwdrubyeval.rwd +18 -0
- data/gui/en/dd0rwdshelleval/dd0rwdshelleval.rwd +16 -0
- data/gui/en/ek0shellscripts/ek0playscript.rwd +15 -0
- data/gui/en/ek0shellscripts/el0listscripts.rwd +25 -0
- data/gui/en/ek0shellscripts/en0createscripts.rwd +24 -0
- data/gui/en/hl9calendar/hl9calendar.rwd +18 -0
- data/gui/en/ii3calculator/ca0rwdcalc.rwd +17 -0
- data/gui/en/ll1selectiontabbegin/selectiontabbegin.rwd +15 -0
- data/gui/en/ll5rwdtinkerwin2selectiontab/rwdwin2selectiontab.rwd +11 -0
- data/gui/en/lz1selectiontabend/endselectiontab.rwd +1 -0
- data/gui/en/tt0documentsbegin/tt0documentbegin.rwd +5 -0
- data/gui/en/ub7rubyeval/rubyeval.rwd +3 -0
- data/gui/en/uk5scriptrunnerdocuments/documents.rwd +3 -0
- data/gui/en/uu5rwddocuments/uu5documents.rwd +13 -0
- data/gui/en/uu6rwdtinkerwin2documents/uu5documents.rwd +4 -0
- data/gui/en/vv1docshellxp/vvdocshellxp.rwd +4 -0
- data/gui/en/ww0documentsend/ww0documentend.rwd +6 -0
- data/gui/en/wz6finaltabs/xx0rwdfirsttab.rwd +4 -0
- data/gui/en/xa1versionwindow/1appname.rwd +17 -0
- data/gui/en/xa5rwdtinkercallablewindow/1appname.rwd +15 -0
- data/gui/en/xa5rwdtinkercallablewindow/9end.rwd +4 -0
- data/gui/en/xb1rwdtinkerbackwindow/1appname.rwd +3 -0
- data/gui/en/xb1rwdtinkerbackwindow/2tab1.rwd +9 -0
- data/gui/en/xb1rwdtinkerbackwindow/3arwddiagnostics.rwd +31 -0
- data/gui/en/xb1rwdtinkerbackwindow/4arwdlistapplets.rwd +42 -0
- data/gui/en/xb1rwdtinkerbackwindow/4arwdlistzips.rwd +33 -0
- data/gui/en/xb1rwdtinkerbackwindow/9backend.rwd +5 -0
- data/gui/en/ya1helpaboutbegin/ya0helpscreenstart.rwd +1 -0
- data/gui/en/yg5rwdhelpabout/1appname.rwd +2 -0
- data/gui/en/yg5rwdhelpabout/3copyright.rwd +1 -0
- data/gui/en/yg5rwdhelpabout/5version.rwd +9 -0
- data/gui/en/yg6rwdwin2helpabout/1appname.rwd +2 -0
- data/gui/en/yg6rwdwin2helpabout/3copyright.rwd +1 -0
- data/gui/en/yg6rwdwin2helpabout/5version.rwd +9 -0
- data/gui/en/za1applicationend/yy9rwdend.rwd +2 -0
- data/gui/es/aa2core/aa0rwdtop.rwd +3 -0
- data/gui/es/cb7rubyeval/cb7rwdrubyeval.rwd +18 -0
- data/gui/es/dd0rwdshelleval/dd0rwdshelleval.rwd +16 -0
- data/gui/es/ek0shellscripts/ek0playscript.rwd +15 -0
- data/gui/es/ek0shellscripts/el0listscripts.rwd +25 -0
- data/gui/es/ek0shellscripts/en0createscripts.rwd +24 -0
- data/gui/es/hl9calendar/hl9calendar.rwd +18 -0
- data/gui/es/ii3calculator/ca0rwdcalc.rwd +17 -0
- data/gui/es/ll1selectiontabbegin/selectiontabbegin.rwd +15 -0
- data/gui/es/ll5rwdtinkerwin2selectiontab/rwdwin2selectiontab.rwd +11 -0
- data/gui/es/lz1selectiontabend/endselectiontab.rwd +1 -0
- data/gui/es/tt0documentsbegin/tt0documentbegin.rwd +5 -0
- data/gui/es/ub7rubyeval/rubyeval.rwd +3 -0
- data/gui/es/uk5scriptrunnerdocuments/documents.rwd +3 -0
- data/gui/es/uu5rwddocuments/uu5documents.rwd +13 -0
- data/gui/es/uu6rwdtinkerwin2documents/uu5documents.rwd +4 -0
- data/gui/es/vv1docshellxp/vvdocshellxp.rwd +4 -0
- data/gui/es/ww0documentsend/ww0documentend.rwd +6 -0
- data/gui/es/wz6finaltabs/xx0rwdfirsttab.rwd +4 -0
- data/gui/es/xa1versionwindow/1appname.rwd +17 -0
- data/gui/es/xa5rwdtinkercallablewindow/1appname.rwd +15 -0
- data/gui/es/xa5rwdtinkercallablewindow/9end.rwd +4 -0
- data/gui/es/xb1rwdtinkerbackwindow/1appname.rwd +3 -0
- data/gui/es/xb1rwdtinkerbackwindow/2tab1.rwd +9 -0
- data/gui/es/xb1rwdtinkerbackwindow/3arwddiagnostics.rwd +31 -0
- data/gui/es/xb1rwdtinkerbackwindow/4arwdlistapplets.rwd +42 -0
- data/gui/es/xb1rwdtinkerbackwindow/4arwdlistzips.rwd +33 -0
- data/gui/es/xb1rwdtinkerbackwindow/9backend.rwd +5 -0
- data/gui/es/ya1helpaboutbegin/ya0helpscreenstart.rwd +1 -0
- data/gui/es/yg5rwdhelpabout/1appname.rwd +2 -0
- data/gui/es/yg5rwdhelpabout/3copyright.rwd +1 -0
- data/gui/es/yg5rwdhelpabout/5version.rwd +9 -0
- data/gui/es/yg6rwdwin2helpabout/1appname.rwd +2 -0
- data/gui/es/yg6rwdwin2helpabout/3copyright.rwd +1 -0
- data/gui/es/yg6rwdwin2helpabout/5version.rwd +9 -0
- data/gui/es/za1applicationend/yy9rwdend.rwd +2 -0
- data/gui/nl/aa2core/aa0rwdtop.rwd +3 -0
- data/gui/nl/cb7rubyeval/cb7rwdrubyeval.rwd +18 -0
- data/gui/nl/dd0rwdshelleval/dd0rwdshelleval.rwd +16 -0
- data/gui/nl/ek0shellscripts/ek0playscript.rwd +15 -0
- data/gui/nl/ek0shellscripts/el0listscripts.rwd +25 -0
- data/gui/nl/ek0shellscripts/en0createscripts.rwd +24 -0
- data/gui/nl/hl9calendar/hl9calendar.rwd +18 -0
- data/gui/nl/ii3calculator/ca0rwdcalc.rwd +17 -0
- data/gui/nl/ll1selectiontabbegin/selectiontabbegin.rwd +15 -0
- data/gui/nl/ll5rwdtinkerwin2selectiontab/rwdwin2selectiontab.rwd +11 -0
- data/gui/nl/lz1selectiontabend/endselectiontab.rwd +1 -0
- data/gui/nl/tt0documentsbegin/tt0documentbegin.rwd +5 -0
- data/gui/nl/ub7rubyeval/rubyeval.rwd +3 -0
- data/gui/nl/uk5scriptrunnerdocuments/documents.rwd +3 -0
- data/gui/nl/uu5rwddocuments/uu5documents.rwd +13 -0
- data/gui/nl/uu6rwdtinkerwin2documents/uu5documents.rwd +4 -0
- data/gui/nl/vv1docshellxp/vvdocshellxp.rwd +4 -0
- data/gui/nl/ww0documentsend/ww0documentend.rwd +6 -0
- data/gui/nl/wz6finaltabs/xx0rwdfirsttab.rwd +4 -0
- data/gui/nl/xa1versionwindow/1appname.rwd +17 -0
- data/gui/nl/xa5rwdtinkercallablewindow/1appname.rwd +15 -0
- data/gui/nl/xa5rwdtinkercallablewindow/9end.rwd +4 -0
- data/gui/nl/xb1rwdtinkerbackwindow/1appname.rwd +3 -0
- data/gui/nl/xb1rwdtinkerbackwindow/2tab1.rwd +9 -0
- data/gui/nl/xb1rwdtinkerbackwindow/3arwddiagnostics.rwd +31 -0
- data/gui/nl/xb1rwdtinkerbackwindow/4arwdlistapplets.rwd +42 -0
- data/gui/nl/xb1rwdtinkerbackwindow/4arwdlistzips.rwd +33 -0
- data/gui/nl/xb1rwdtinkerbackwindow/9backend.rwd +5 -0
- data/gui/nl/ya1helpaboutbegin/ya0helpscreenstart.rwd +1 -0
- data/gui/nl/yg5rwdhelpabout/1appname.rwd +2 -0
- data/gui/nl/yg5rwdhelpabout/3copyright.rwd +1 -0
- data/gui/nl/yg5rwdhelpabout/5version.rwd +9 -0
- data/gui/nl/yg6rwdwin2helpabout/1appname.rwd +2 -0
- data/gui/nl/yg6rwdwin2helpabout/3copyright.rwd +1 -0
- data/gui/nl/yg6rwdwin2helpabout/5version.rwd +9 -0
- data/gui/nl/za1applicationend/yy9rwdend.rwd +2 -0
- data/init.rb +164 -0
- data/installed/rwdcalendar-0.4.inf +6 -0
- data/installed/rwdrubyeval-0.3.inf +5 -0
- data/installed/rwdscriptrunner-0.3.inf +9 -0
- data/installed/rwdshellxp-0.4.inf +5 -0
- data/installed/rwdtinkerwin2-0.5.inf +16 -0
- data/lang/en/rwdcore/languagefile.rb +6 -0
- data/lang/es/rwdcore/languagefile.rb +4 -0
- data/lang/nl/rwdcore/languagefile.rb +4 -0
- data/lib/temp.rb +1 -0
- data/rwd_files/HowTo_RubyEval.html +80 -0
- data/rwd_files/HowTo_Scriptrunner.txt +171 -0
- data/rwd_files/HowTo_Shell.txt +94 -0
- data/rwd_files/HowTo_Tinker.html +370 -0
- data/rwd_files/HowTo_Tinker.txt +244 -0
- data/rwd_files/HowTo_TinkerWin2.txt +202 -0
- data/rwd_files/Readme.txt +57 -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/rwdindex.html +6 -0
- data/scripts/date.sh +2 -0
- data/scripts/lister.sh +2 -0
- data/scripts/uname.sh +2 -0
- data/tests/rwdtinkertestEN.rb +87 -0
- data/tests/temptest.out +18 -0
- data/tests/totranslate.lang +93 -0
- data/zips/rwdaviewphoto-0.3.zip +0 -0
- data/zips/rwdhelloworld-0.2.zip +0 -0
- data/zips/rwdrefreshacpi-0.1.zip +0 -0
- data/zips/rwdscriptrunner-0.3.zip +0 -0
- data/zips/rwdwtinkerwin2-0.5.zip +0 -0
- metadata +227 -0
data/Readme.txt
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
rwdapplications are web brower applications
|
2
|
+
|
3
|
+
The GUI interface used is RubyWebDialogs
|
4
|
+
|
5
|
+
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/
|
6
|
+
|
7
|
+
|
8
|
+
Start the program by:
|
9
|
+
changing to the directory and
|
10
|
+
ruby init.rb
|
11
|
+
|
12
|
+
Then point your web browser to:
|
13
|
+
http://localhost:7701/
|
14
|
+
|
15
|
+
Or to the port that shows on the console or in the config.cnf file
|
16
|
+
|
17
|
+
Requirements:
|
18
|
+
RubyWebDialogs - I am using 0.0.11 2004-3-9
|
19
|
+
This package you downloaded should have a runtime version of
|
20
|
+
the needed rubywebdialog files
|
21
|
+
|
22
|
+
Ruby I am using version 1.8.2
|
23
|
+
|
24
|
+
I have tested this under Linux-Debian kernel 2.6.9
|
25
|
+
|
26
|
+
Operation:
|
27
|
+
The code files reside in the code directory and are combined before
|
28
|
+
the main Class is loaded
|
29
|
+
|
30
|
+
The rwd files in gui are combined before the gui is activated
|
31
|
+
|
32
|
+
Trouble shooting:
|
33
|
+
|
34
|
+
untar the file
|
35
|
+
tar zxvf rwdapplication-x.y.tar.gz
|
36
|
+
then cd to the directory
|
37
|
+
cd rwdapplication-x.y
|
38
|
+
then start the init.rb program file
|
39
|
+
ruby init.rb
|
40
|
+
|
41
|
+
|
42
|
+
If the program is not working, try looking at the ev subdirectory. That is where
|
43
|
+
the runtime of rubywebdialogs are.
|
44
|
+
|
45
|
+
for long term installation, I would suggest putting most files in a lib directory
|
46
|
+
like /usr/lib/rwdshell
|
47
|
+
then make a writable directory the local directory for command files to be written
|
48
|
+
like ~/rwdshell
|
49
|
+
|
50
|
+
|
51
|
+
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.
|
52
|
+
|
53
|
+
Don't use the back-button of the browser! Strange and unpredictable things may and will happen!
|
54
|
+
|
55
|
+
Steven Gibson
|
56
|
+
stevengibson@superant.com
|
57
|
+
http://rwdapplications.rubyforge.org/
|
data/bin/rwdshell
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#--
|
3
|
+
# Copyright 2004 Steven Gibson <steven@superant.com>
|
4
|
+
# RwdTinker application
|
5
|
+
#
|
6
|
+
# This program is free software. It may be redistributed and/or modified under
|
7
|
+
# the terms of the GPL version 2 (or later), or the
|
8
|
+
# Ruby licence.
|
9
|
+
#
|
10
|
+
#++
|
11
|
+
|
12
|
+
|
13
|
+
$progdir = File::expand_path( File.dirname(__FILE__))
|
14
|
+
|
15
|
+
Dir.chdir($progdir)
|
16
|
+
|
17
|
+
Dir.chdir("..")
|
18
|
+
|
19
|
+
`ruby init.rb`
|
@@ -0,0 +1,18 @@
|
|
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
|
+
# This class is the top class for the RwdTinker application
|
6
|
+
|
7
|
+
class RwdTinker < RWDialog
|
8
|
+
|
9
|
+
def main
|
10
|
+
@rwd_window = "main"
|
11
|
+
@result = "idle"
|
12
|
+
@display= "idle"
|
13
|
+
end
|
14
|
+
|
15
|
+
def inspect
|
16
|
+
"Rwdtinker Application "
|
17
|
+
end
|
18
|
+
|
@@ -0,0 +1,15 @@
|
|
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
|
+
# return the version constant defined in the config file
|
7
|
+
def runrwdtinkerversion
|
8
|
+
@rwd_window = "applicationversion"
|
9
|
+
@versionappnamedisplay = "RwdTinker"
|
10
|
+
@versioncopyrightdisplay = "(c) 2004 Steven Gibson "
|
11
|
+
@versionnumberdisplay = "Version " + RwdTinkerVersion
|
12
|
+
|
13
|
+
end
|
14
|
+
|
15
|
+
|
@@ -0,0 +1,23 @@
|
|
1
|
+
$buffer = ''
|
2
|
+
def $buffer.write(str) # create a variable to use in rubyeval
|
3
|
+
self << str
|
4
|
+
end
|
5
|
+
def rubyeval
|
6
|
+
commandtextruby = "%s " % [@a_rubyeval]
|
7
|
+
$tmpout = $stdout # save the original STDOUT
|
8
|
+
$stdout = $buffer
|
9
|
+
begin # begin rescue monitored block
|
10
|
+
eval( commandtextruby )
|
11
|
+
|
12
|
+
@rubydisplay = $stdout
|
13
|
+
|
14
|
+
$stdout = $tmpout # restore STDOUT to normal
|
15
|
+
|
16
|
+
rescue # process exeption
|
17
|
+
$stdout = $tmpout # restore STDOUT to normal
|
18
|
+
@rubydisplay = "\n" + "error in eval"
|
19
|
+
end # end of rescue process # of rescure monitored block
|
20
|
+
|
21
|
+
|
22
|
+
end
|
23
|
+
|
@@ -0,0 +1,20 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
def shelleval
|
4
|
+
|
5
|
+
commandtext = "%s " % [@a_shelleval]
|
6
|
+
|
7
|
+
begin # exception trapped block
|
8
|
+
system(commandtext+' > temp.output')
|
9
|
+
|
10
|
+
|
11
|
+
@result =`#{commandtext}`
|
12
|
+
|
13
|
+
rescue SystemCallError, StandardError
|
14
|
+
$stderr.print "system call error: " + $!
|
15
|
+
end # exception rescue
|
16
|
+
|
17
|
+
end
|
18
|
+
|
19
|
+
|
20
|
+
|
@@ -0,0 +1,22 @@
|
|
1
|
+
def playscript
|
2
|
+
|
3
|
+
|
4
|
+
nametext = "%s" % [@a_scriptcmd]
|
5
|
+
|
6
|
+
begin # exception trapped block
|
7
|
+
fileName = "scripts/" + nametext + ".sh"
|
8
|
+
|
9
|
+
fd = File.open(fileName,"r")
|
10
|
+
|
11
|
+
|
12
|
+
commandtext = fd.read
|
13
|
+
fd.close
|
14
|
+
|
15
|
+
|
16
|
+
@playscript_display = `#{commandtext}`
|
17
|
+
|
18
|
+
|
19
|
+
rescue SystemCallError, StandardError
|
20
|
+
$stderr.print "system call error: " + $!
|
21
|
+
end # exception rescue
|
22
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# this code is to list the scripts
|
2
|
+
def listscripts
|
3
|
+
fileList = Dir.new($shellscript_directory).entries.sort.reverse.delete_if { |x| ! (x =~ /sh$/) }
|
4
|
+
@listscriptresult = fileList.rwd_method("fillscriptname")
|
5
|
+
end
|
6
|
+
|
7
|
+
def fillscriptname(inffile)
|
8
|
+
applet = inffile.gsub(/\.sh$/, "")
|
9
|
+
@a_scriptlist = applet
|
10
|
+
@a_scriptcmd = applet
|
11
|
+
end
|
12
|
+
|
@@ -0,0 +1,18 @@
|
|
1
|
+
def viewscript
|
2
|
+
require 'fileutils'
|
3
|
+
nametext = "%s" % [@a_scriptlist]
|
4
|
+
|
5
|
+
begin # exception trapped block
|
6
|
+
fileName = "scripts/" + nametext + ".sh"
|
7
|
+
|
8
|
+
fd = File.open(fileName,"r")
|
9
|
+
@displayscripttext = " "
|
10
|
+
while ! fd.eof?
|
11
|
+
@displayscripttext = fd.read
|
12
|
+
end
|
13
|
+
fd.close
|
14
|
+
rescue
|
15
|
+
@displayscripttext = "\n" + "error"
|
16
|
+
end # exception rescue
|
17
|
+
|
18
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
|
2
|
+
def createnew # this method adds a new script file
|
3
|
+
require 'fileutils'
|
4
|
+
|
5
|
+
newname = "%s" % [@a_filename] # grab the new filename to create
|
6
|
+
newdata =@a_firstline.to_s + "\n #" + @a_commentline.to_s + "\n"
|
7
|
+
fullnewname = newname + ".sh"
|
8
|
+
begin # exception trapped block
|
9
|
+
fileName = File.join( $shellscript_directory, fullnewname )
|
10
|
+
fd = File.open(fileName,"w")
|
11
|
+
fd.print(newdata) # save the record info to the file
|
12
|
+
fd.close
|
13
|
+
@newdisplay=newdata # show the record info in the browser
|
14
|
+
rescue
|
15
|
+
@newdisplay = "\n" + "system error in createnew method"
|
16
|
+
end # exception rescue
|
17
|
+
|
18
|
+
end # end of createnew
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
|
3
|
+
def showmonth
|
4
|
+
|
5
|
+
begin # begin rescue monitored block
|
6
|
+
|
7
|
+
command_file_path = File.join( $extras_directory, 'cal.rb' )
|
8
|
+
|
9
|
+
@showmonthresult = `ruby #{command_file_path} -c #{$lang} #{@a_month.to_i} #{@a_year.to_i} `
|
10
|
+
|
11
|
+
rescue # process exeption
|
12
|
+
@showmonthresult = "\n" + "error in eval"
|
13
|
+
end # end of rescue process # of rescure monitored block
|
14
|
+
|
15
|
+
end
|
16
|
+
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# this code is to list the zipped applets that can be installed
|
2
|
+
def listzipfilestoinstall
|
3
|
+
fileList = Dir.new("zips").entries.sort.reverse.delete_if { |x| ! (x =~ /zip$/) }
|
4
|
+
@zipslistresult = fileList.rwd_method("fillziptoinstallname")
|
5
|
+
end
|
6
|
+
|
7
|
+
def fillziptoinstallname(inffile)
|
8
|
+
applet = inffile.gsub(/\.zip$/, "")
|
9
|
+
@a_installapplet = applet
|
10
|
+
|
11
|
+
end
|
12
|
+
|
13
|
+
|
14
|
+
|
@@ -0,0 +1,20 @@
|
|
1
|
+
def installapplet
|
2
|
+
require 'fileutils'
|
3
|
+
nametext = "%s" % [@a_installapplet]
|
4
|
+
|
5
|
+
begin # exception trapped block
|
6
|
+
fileName = "zips/" + nametext + ".zip"
|
7
|
+
|
8
|
+
commandline = "unzip -o " + fileName
|
9
|
+
system( commandline+' > temp.output' )
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
system(commandline)
|
14
|
+
@installapplettext = Message[:applet_installed]
|
15
|
+
|
16
|
+
rescue
|
17
|
+
@installapplettext = "Done! - Check applet list - restart rwd to activate the new applet"
|
18
|
+
end # exception rescue
|
19
|
+
|
20
|
+
end
|
@@ -0,0 +1,20 @@
|
|
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
|
+
# return the Ruby constant
|
7
|
+
def runrubyversion
|
8
|
+
@rubyversion = "Version " + VERSION
|
9
|
+
end
|
10
|
+
|
11
|
+
# return the platform constan
|
12
|
+
def runviewplatform
|
13
|
+
@platformdisplay = "Platform is " + RUBY_PLATFORM
|
14
|
+
end
|
15
|
+
|
16
|
+
# return Rwdtinker version to diagnostic tab
|
17
|
+
def rwdtinkerversiondiagnostic
|
18
|
+
@rwdtinkerversionreturn = "rwdtinker version " + RwdTinkerVersion
|
19
|
+
end
|
20
|
+
|
@@ -0,0 +1,13 @@
|
|
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
|
+
# call the rwdtinker helpwindow
|
7
|
+
def runrwdtinkerhelpwindow
|
8
|
+
@rwd_window = "rwdtinkerhelpwindow"
|
9
|
+
end
|
10
|
+
def runrwdtinkerbackwindow
|
11
|
+
@rwd_window = "tinkerbackwindow"
|
12
|
+
end
|
13
|
+
|
@@ -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,20 @@
|
|
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
|
+
# return the Ruby constant
|
7
|
+
def runrubyversion
|
8
|
+
@rubyversion = "Version " + VERSION
|
9
|
+
end
|
10
|
+
|
11
|
+
# return the platform constan
|
12
|
+
def runviewplatform
|
13
|
+
@platformdisplay = "Platform is " + RUBY_PLATFORM
|
14
|
+
end
|
15
|
+
|
16
|
+
# return Rwdtinker version to diagnostic tab
|
17
|
+
def rwdtinkerversiondiagnostic
|
18
|
+
@rwdtinkerversionreturn = "rwdtinker version " + RwdTinkerVersion
|
19
|
+
end
|
20
|
+
|
@@ -0,0 +1,18 @@
|
|
1
|
+
def openname
|
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
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# this code is to list the zipped applets that can be installed
|
2
|
+
def listzipfilestoinstall
|
3
|
+
fileList = Dir.new("zips").entries.sort.reverse.delete_if { |x| ! (x =~ /zip$/) }
|
4
|
+
@zipslistresult = fileList.rwd_method("fillziptoinstallname")
|
5
|
+
end
|
6
|
+
|
7
|
+
def fillziptoinstallname(inffile)
|
8
|
+
applet = inffile.gsub(/\.zip$/, "")
|
9
|
+
@a_installapplet = applet
|
10
|
+
|
11
|
+
end
|
12
|
+
|
13
|
+
|
14
|
+
|
@@ -0,0 +1,20 @@
|
|
1
|
+
def installapplet
|
2
|
+
require 'fileutils'
|
3
|
+
nametext = "%s" % [@a_installapplet]
|
4
|
+
|
5
|
+
begin # exception trapped block
|
6
|
+
fileName = "zips/" + nametext + ".zip"
|
7
|
+
|
8
|
+
commandline = "unzip -o " + fileName
|
9
|
+
system( commandline+' > temp.output' )
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
system(commandline)
|
14
|
+
@installapplettext = Message[:applet_installed]
|
15
|
+
|
16
|
+
rescue
|
17
|
+
@installapplettext = "Done! - Check applet list - restart rwd to activate the new applet"
|
18
|
+
end # exception rescue
|
19
|
+
|
20
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
def removeapplet
|
2
|
+
require 'fileutils'
|
3
|
+
nametext = "%s" % [@a_removeapplet]
|
4
|
+
|
5
|
+
begin # exception trapped block
|
6
|
+
fileName = "installed/" + nametext + ".inf"
|
7
|
+
count = 0
|
8
|
+
fd = File.open(fileName,"r")
|
9
|
+
|
10
|
+
|
11
|
+
fd.each { |oneline|
|
12
|
+
if count == 1
|
13
|
+
commandline = "rm -r " + oneline
|
14
|
+
system( commandline+' > temp.output' )
|
15
|
+
end
|
16
|
+
count = 1
|
17
|
+
}
|
18
|
+
fd.close
|
19
|
+
commandline = "rm " + fileName
|
20
|
+
|
21
|
+
system(commandline)
|
22
|
+
@removeapplettext = "applet files removed! - restart rwd to finish uninstalling"
|
23
|
+
|
24
|
+
rescue
|
25
|
+
@removeapplettext = "\n" + "error"
|
26
|
+
end # exception rescue
|
27
|
+
|
28
|
+
end
|
@@ -0,0 +1,14 @@
|
|
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
|
+
# return the version constant defined in the config file
|
7
|
+
def runrwdtinkerwin2version
|
8
|
+
@rwd_window = "applicationversion"
|
9
|
+
@versionappnamedisplay = "RwdTinkerWin2"
|
10
|
+
@versioncopyrightdisplay = "(c) 2004 Steven Gibson "
|
11
|
+
@versionnumberdisplay = "Version " + RwdTinkerWin2Version
|
12
|
+
|
13
|
+
end
|
14
|
+
|
@@ -0,0 +1,11 @@
|
|
1
|
+
RwdTinkerVersion = "1.23"
|
2
|
+
CodeName = "rwdtinker"
|
3
|
+
CodeNameFile = CodeName + ".rb"
|
4
|
+
RWDFile = "rwdtinker.rwd"
|
5
|
+
$lang = "en"
|
6
|
+
@@codedir = "code"
|
7
|
+
@@guidir = "gui" + "/" + $lang
|
8
|
+
@@langdir = "lang"
|
9
|
+
|
10
|
+
TempLangHashFile = @@codedir + "/" + "al5languagefiles" + "/" + "templangfile.rb"
|
11
|
+
$port = 7705
|
@@ -0,0 +1,26 @@
|
|
1
|
+
|
2
|
+
$extras_directory = "extras"
|
3
|
+
|
4
|
+
class LanguageTextrwdcalendar
|
5
|
+
|
6
|
+
def locale(languagecode,wordtotranslate)
|
7
|
+
|
8
|
+
case languagecode
|
9
|
+
|
10
|
+
when "en"
|
11
|
+
case wordtotranslate
|
12
|
+
when "year"
|
13
|
+
return "year"
|
14
|
+
when "month"
|
15
|
+
return "month"
|
16
|
+
end
|
17
|
+
when "nl"
|
18
|
+
case wordtotranslate
|
19
|
+
when "year"
|
20
|
+
return "jaar"
|
21
|
+
when "month"
|
22
|
+
return "maand"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/ev/browser.rb
ADDED
@@ -0,0 +1,109 @@
|
|
1
|
+
require "ev/ruby"
|
2
|
+
require "ev/net"
|
3
|
+
|
4
|
+
begin
|
5
|
+
require "win32ole"
|
6
|
+
require "win32/registry"
|
7
|
+
rescue LoadError
|
8
|
+
$".push "win32ole.so"
|
9
|
+
$".push "win32/registry.rb"
|
10
|
+
end
|
11
|
+
|
12
|
+
def windowsbrowser
|
13
|
+
$stderr.puts "Looking for default browser..."
|
14
|
+
|
15
|
+
filetype = "htmlfile"
|
16
|
+
application = nil
|
17
|
+
|
18
|
+
begin
|
19
|
+
Win32::Registry::HKEY_CLASSES_ROOT.open('.html') do |reg|
|
20
|
+
filetype = reg[""]
|
21
|
+
end
|
22
|
+
|
23
|
+
Win32::Registry::HKEY_CLASSES_ROOT.open(filetype + '\shell\open\command') do |reg|
|
24
|
+
application = reg[""]
|
25
|
+
end
|
26
|
+
rescue NameError
|
27
|
+
$stderr.puts "Only available for Windows."
|
28
|
+
end
|
29
|
+
|
30
|
+
application
|
31
|
+
end
|
32
|
+
|
33
|
+
def linuxbrowser
|
34
|
+
application = ""
|
35
|
+
|
36
|
+
application = `which galeon 2> /dev/null`.chomp if application.empty?
|
37
|
+
application = `which mozilla 2> /dev/null`.chomp if application.empty?
|
38
|
+
application = `which firefox 2> /dev/null`.chomp if application.empty?
|
39
|
+
application = `which opera 2> /dev/null`.chomp if application.empty?
|
40
|
+
application = `which konqueror 2> /dev/null`.chomp if application.empty?
|
41
|
+
application = `which htmlview 2> /dev/null`.chomp if application.empty?
|
42
|
+
application = nil if application.empty?
|
43
|
+
|
44
|
+
application
|
45
|
+
end
|
46
|
+
|
47
|
+
def defaultbrowser
|
48
|
+
res = nil
|
49
|
+
res = windowsbrowser if windows?
|
50
|
+
res = linuxbrowser if linux?
|
51
|
+
res
|
52
|
+
end
|
53
|
+
|
54
|
+
def showinbrowser(html, browser=defaultbrowser)
|
55
|
+
port, io = TCPServer.freeport(7701, 7709)
|
56
|
+
|
57
|
+
unless browser.nil?
|
58
|
+
Thread.new do
|
59
|
+
begin
|
60
|
+
#command = "1234 \"http://localhost:#{port}\"" if linux?
|
61
|
+
#command = "L:/prog/MozillaFirefox/firefox.exe \"http://localhost:#{port}\"" if cygwin?
|
62
|
+
#command = Win32::Registry::HKEY_CLASSES_ROOT.open('htmlfile\shell\open\command')[0] + " \"http://localhost:#{port}/\"" if windows?
|
63
|
+
|
64
|
+
command = "#{browser} \"http://localhost:#{port}\""
|
65
|
+
|
66
|
+
Thread.pass
|
67
|
+
|
68
|
+
system(command)
|
69
|
+
rescue
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
HTTPServer.serve([port, io]) do |req, resp|
|
75
|
+
resp << html
|
76
|
+
|
77
|
+
resp.stop
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
def tab2html(tab)
|
82
|
+
res = ""
|
83
|
+
|
84
|
+
tab = tab.to_html(false)
|
85
|
+
|
86
|
+
res << "<html>\n"
|
87
|
+
res << "<body>\n"
|
88
|
+
res << "<table align='center' border='1' cellspacing='0' cellpadding='3'>\n"
|
89
|
+
res << "<tbody>\n"
|
90
|
+
|
91
|
+
tab.split(/\r*\n/).each do |line|
|
92
|
+
res << "<tr>\n"
|
93
|
+
|
94
|
+
line.split(/\t/, -1).each do |veld|
|
95
|
+
veld = " " if veld.compress.empty?
|
96
|
+
|
97
|
+
res << "<td>%s</td>\n" % veld
|
98
|
+
end
|
99
|
+
|
100
|
+
res << "</tr>\n"
|
101
|
+
end
|
102
|
+
|
103
|
+
res << "</tbody>\n"
|
104
|
+
res << "</table>\n"
|
105
|
+
res << "</body>\n"
|
106
|
+
res << "</html>\n"
|
107
|
+
|
108
|
+
res
|
109
|
+
end
|