rwdeliza 0.03
Sign up to get free protection for your applications and to get access to all the features.
- data/ElizaData/database/db.1 +7015 -0
- data/ElizaData/database/db.10 +7001 -0
- data/ElizaData/database/db.11 +7001 -0
- data/ElizaData/database/db.12 +7003 -0
- data/ElizaData/database/db.13 +7003 -0
- data/ElizaData/database/db.14 +7008 -0
- data/ElizaData/database/db.15 +7001 -0
- data/ElizaData/database/db.16 +7001 -0
- data/ElizaData/database/db.17 +7001 -0
- data/ElizaData/database/db.18 +7001 -0
- data/ElizaData/database/db.19 +7001 -0
- data/ElizaData/database/db.2 +7001 -0
- data/ElizaData/database/db.20 +5467 -0
- data/ElizaData/database/db.3 +7001 -0
- data/ElizaData/database/db.4 +7001 -0
- data/ElizaData/database/db.5 +7001 -0
- data/ElizaData/database/db.6 +7001 -0
- data/ElizaData/database/db.7 +7001 -0
- data/ElizaData/database/db.8 +7001 -0
- data/ElizaData/database/db.9 +7001 -0
- data/ElizaData/responses/hello.res +1 -0
- data/ElizaData/responses/i_agree.res +1 -0
- data/ElizaData/responses/i_am_listening_to_you.res +1 -0
- data/ElizaData/responses/please_explain.res +1 -0
- data/ElizaData/responses/thank_you.res +1 -0
- data/ElizaData/tiny.dict +211 -0
- data/ElizaData/words/adjectives1.words +906 -0
- data/ElizaData/words/adjectives2w.words +1 -0
- data/ElizaData/words/noun0.words +15 -0
- data/ElizaData/words/noun1.words +1391 -0
- data/ElizaData/words/noun2.words +1924 -0
- data/ElizaData/words/noun4.words +330 -0
- data/ElizaData/words/pronoun1.words +6 -0
- data/ElizaData/words/verb4.words +350 -0
- data/ElizaData/words/verb42.words +391 -0
- data/ElizaData/words/verb42w.words +1 -0
- data/ElizaData/words/verb43.words +402 -0
- data/ElizaData/words/verb43w.words +1 -0
- data/ElizaData/words/verb45.words +452 -0
- data/ElizaData/words/verb4w.words +1 -0
- data/ElizaData/words/verb5.words +13 -0
- data/ElizaData/words/verb61.words +35 -0
- data/ElizaData/words/verb62.words +41 -0
- data/ElizaData/words/verb83.words +17 -0
- data/Readme.txt +462 -0
- data/bin/rwdeliza +19 -0
- data/code/01rwdcore/01rwdcore.rb +29 -0
- data/code/01rwdcore/02helptexthashbegin.rb +4 -0
- data/code/01rwdcore/03helptexthash.rb +23 -0
- data/code/01rwdcore/04helptextend.rb +6 -0
- data/code/01rwdcore/jumplinkcommand.rb +26 -0
- data/code/01rwdcore/openhelpwindow.rb +31 -0
- data/code/01rwdcore/returntomain.rb +10 -0
- data/code/01rwdcore/rundocuments.rb +10 -0
- data/code/01rwdcore/runeditconfiguration.rb +10 -0
- data/code/01rwdcore/runhelpabout.rb +10 -0
- data/code/01rwdcore/runopentinkerdocument.rb +7 -0
- data/code/01rwdcore/rwdtinkerversion.rb +22 -0
- data/code/01rwdcore/rwdwindowreturn.rb +9 -0
- data/code/01rwdcore/selectiontab.rb +9 -0
- data/code/01rwdcore/setuphelpaboutoptions.rb +13 -0
- data/code/01rwdcore/setuptinkerdocuments.rb +6 -0
- data/code/01rwdcore/test_cases.rb +109 -0
- data/code/01rwdcore/test_harness.rb +13 -0
- data/code/01rwdcore/uploadreturns.rb +62 -0
- data/code/dd0viewphoto/dd0viewphoto.rb +3 -0
- data/code/superant.com.rwdeliza/0uninstallapplet.rb +10 -0
- data/code/superant.com.rwdeliza/eliza01.rb +45 -0
- data/code/superant.com.rwdeliza/helptexthashrwdeliza.rb +39 -0
- data/code/superant.com.rwdeliza/openhelpwindowrwdeliza.rb +23 -0
- data/code/superant.com.rwdeliza/runrwdshellwindow.rb +12 -0
- data/code/superant.com.rwdeliza/rwdtinkerversion.rb +10 -0
- data/code/superant.com.rwdeliza/tagsentence.rb +39 -0
- data/code/superant.com.rwdtinkerbackwindow/diagnostictab.rb +19 -0
- data/code/superant.com.rwdtinkerbackwindow/helptexthashtinkerwin2.rb +61 -0
- data/code/superant.com.rwdtinkerbackwindow/initiateapplets.rb +240 -0
- data/code/superant.com.rwdtinkerbackwindow/installgemapplet.rb +34 -0
- data/code/superant.com.rwdtinkerbackwindow/installremotegem.rb +20 -0
- data/code/superant.com.rwdtinkerbackwindow/listgemdirs.rb +12 -0
- data/code/superant.com.rwdtinkerbackwindow/listgemzips.rb +53 -0
- data/code/superant.com.rwdtinkerbackwindow/listinstalledfiles.rb +12 -0
- data/code/superant.com.rwdtinkerbackwindow/listzips.rb +27 -0
- data/code/superant.com.rwdtinkerbackwindow/loadconfigurationrecord.rb +22 -0
- data/code/superant.com.rwdtinkerbackwindow/loadconfigurationvariables.rb +14 -0
- data/code/superant.com.rwdtinkerbackwindow/network.rb +87 -0
- data/code/superant.com.rwdtinkerbackwindow/openappletname.rb +19 -0
- data/code/superant.com.rwdtinkerbackwindow/openhelpwindowtinkerwin2.rb +38 -0
- data/code/superant.com.rwdtinkerbackwindow/remotegemlist.rb +24 -0
- data/code/superant.com.rwdtinkerbackwindow/removeapplet.rb +46 -0
- data/code/superant.com.rwdtinkerbackwindow/removeappletvariables.rb +52 -0
- data/code/superant.com.rwdtinkerbackwindow/runremoteinstall.rb +11 -0
- data/code/superant.com.rwdtinkerbackwindow/runrwdtinkerbackwindow.rb +15 -0
- data/code/superant.com.rwdtinkerbackwindow/rwdtinkerwin2version.rb +13 -0
- data/code/superant.com.rwdtinkerbackwindow/saveconfigurationrecord.rb +19 -0
- data/code/superant.com.rwdtinkerbackwindow/viewappletcontents.rb +22 -0
- data/code/superant.com.rwdtinkerbackwindow/viewgemappletcontents.rb +24 -0
- data/code/superant.com.words/dictlookup.rb +20 -0
- data/code/superant.com.words/runfortunewindow.rb +14 -0
- data/code/superant.com.words/runrwdwordsbackwindow.rb +10 -0
- data/code/superant.com.words/runrwdwordsversion.rb +14 -0
- data/code/superant.com.words/rwdtinkerversion.rb +10 -0
- data/code/zz0applicationend/zz0end.rb +4 -0
- data/configuration/language.dist +8 -0
- data/configuration/rwdapplicationidentity.dist +3 -0
- data/configuration/rwdtinker.dist +18 -0
- data/configuration/rwdweliza-0.03.dist +31 -0
- data/configuration/tinkerwin2variables.dist +17 -0
- data/gui/00coreguibegin/applicationguitop.rwd +4 -0
- data/gui/frontwindow0/cc0openphoto.rwd +22 -0
- data/gui/frontwindowselections/00selectiontabbegin.rwd +11 -0
- data/gui/frontwindowselections/jumplinkcommands.rwd +15 -0
- data/gui/frontwindowselections/wwselectionend.rwd +3 -0
- data/gui/frontwindowtdocuments/00documentbegin.rwd +6 -0
- data/gui/frontwindowtdocuments/tinkerdocuments.rwd +14 -0
- data/gui/frontwindowtdocuments/zzdocumentend.rwd +8 -0
- data/gui/helpaboutbegin/zzzrwdlasttab.rwd +6 -0
- data/gui/helpaboutbegin/zzzzhelpscreenstart.rwd +3 -0
- data/gui/helpaboutbegin/zzzzzzhelpabouttab.rwd +15 -0
- data/gui/helpaboutzend/helpscreenend.rwd +3 -0
- data/gui/helpaboutzend/zhelpscreenstart2.rwd +3 -0
- data/gui/helpaboutzend/zzzzhelpabout2.rwd +15 -0
- data/gui/helpaboutzend/zzzzhelpscreen2end.rwd +3 -0
- data/gui/tinkerbackwindows/superant.com.refreshwindow/fortunerefreshwindowtwo.rwd +9 -0
- data/gui/tinkerbackwindows/superant.com.rwdeliza/1appname.rwd +5 -0
- data/gui/tinkerbackwindows/superant.com.rwdeliza/1eliza.rwd +21 -0
- data/gui/tinkerbackwindows/superant.com.rwdeliza/4sentance.rwd +21 -0
- data/gui/tinkerbackwindows/superant.com.rwdeliza/98jumplinkcommands.rwd +17 -0
- data/gui/tinkerbackwindows/superant.com.rwdeliza/zbackend.rwd +6 -0
- data/gui/tinkerbackwindows/superant.com.rwdschedulebackwindow/1appname.rwd +5 -0
- data/gui/tinkerbackwindows/superant.com.rwdschedulebackwindow/20downloadftp.rwd +45 -0
- data/gui/tinkerbackwindows/superant.com.rwdschedulebackwindow/67viewconfiguration.rwd +29 -0
- data/gui/tinkerbackwindows/superant.com.rwdschedulebackwindow/70rwddiagnostics.rwd +16 -0
- data/gui/tinkerbackwindows/superant.com.rwdschedulebackwindow/m01menubegin.rwd +18 -0
- data/gui/tinkerbackwindows/superant.com.rwdschedulebackwindow/zvbackend.rwd +6 -0
- data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/1appname.rwd +5 -0
- data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/40rwdlistzips.rwd +41 -0
- data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/45installremotezip.rwd +44 -0
- data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/50rwdlistapplets.rwd +44 -0
- data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/60editconfiguration.rwd +30 -0
- data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/70rwddiagnostics.rwd +29 -0
- data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/81jumplinkcommands.rwd +17 -0
- data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/9backend.rwd +6 -0
- data/gui/tinkerbackwindows/superant.com.tinkerhelpwindow/1appname.rwd +31 -0
- data/gui/tinkerbackwindows/superant.com.tinkerhelpwindow/9end.rwd +4 -0
- data/gui/tinkerbackwindows/superant.com.versionwindow/1appname.rwd +19 -0
- data/gui/tinkerbackwindows/superant.com.versionwindow/helpaboutwindow.rwd +17 -0
- data/gui/tinkerbackwindows/superant.com.words/1appname.rwd +4 -0
- data/gui/tinkerbackwindows/superant.com.words/1dictionary.rwd +19 -0
- data/gui/tinkerbackwindows/superant.com.words/3rwdfortune.rwd +14 -0
- data/gui/tinkerbackwindows/superant.com.words/77jumplinkcommands.rwd +17 -0
- data/gui/tinkerbackwindows/superant.com.words/z9end.rwd +6 -0
- data/gui/zzcoreguiend/yy9rwdend.rwd +4 -0
- data/init.rb +277 -0
- data/installed/rwdweliza-0.03.inf +24 -0
- data/installed/temp.rb +1 -0
- data/lang/en/rwdcore/languagefile.rb +58 -0
- data/lang/es/rwdcore/languagefile-es.rb +62 -0
- data/lang/fr/rwdcore/languagefile.rb +64 -0
- data/lang/jp/rwdcore/languagefile.rb +72 -0
- data/lang/nl/rwdcore/languagefile.rb +75 -0
- data/lib/dict.rb +438 -0
- data/lib/druida.rb +499 -0
- data/lib/hashslice.rb +71 -0
- data/lib/linguistics.rb +360 -0
- data/lib/linguistics/en.rb +1601 -0
- data/lib/linguistics/en/infinitive.rb +1148 -0
- data/lib/linguistics/en/linkparser.rb +142 -0
- data/lib/linguistics/en/wordnet.rb +253 -0
- data/lib/linguistics/iso639.rb +456 -0
- data/lib/linkparser.rb +461 -0
- data/lib/linkparser/connection.rb +81 -0
- data/lib/linkparser/connector.rb +201 -0
- data/lib/linkparser/definition.rb +225 -0
- data/lib/linkparser/dictionary.rb +208 -0
- data/lib/linkparser/linkage.rb +185 -0
- data/lib/linkparser/log.rb +39 -0
- data/lib/linkparser/sentence.rb +79 -0
- data/lib/linkparser/utils.rb +540 -0
- data/lib/linkparser/word.rb +92 -0
- data/lib/rconftool.rb +380 -0
- data/lib/rwd/browser.rb +123 -0
- data/lib/rwd/ftools.rb +174 -0
- data/lib/rwd/mime.rb +328 -0
- data/lib/rwd/net.rb +866 -0
- data/lib/rwd/ruby.rb +889 -0
- data/lib/rwd/rwd.rb +1942 -0
- data/lib/rwd/sgml.rb +236 -0
- data/lib/rwd/thread.rb +63 -0
- data/lib/rwd/tree.rb +371 -0
- data/lib/rwd/xml.rb +101 -0
- data/lib/zip/ioextras.rb +114 -0
- data/lib/zip/stdrubyext.rb +111 -0
- data/lib/zip/tempfile_bugfixed.rb +195 -0
- data/lib/zip/zip.rb +1378 -0
- data/lib/zip/zipfilesystem.rb +558 -0
- data/lib/zip/ziprequire.rb +61 -0
- data/rwd_files/HowTo_Eliza.txt +195 -0
- data/rwd_files/HowTo_Tinker.txt +471 -0
- data/rwd_files/HowTo_TinkerWin2.txt +202 -0
- data/rwd_files/Readme.txt +57 -0
- data/rwd_files/RubyWebDialogs.html +6 -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/tinker.png +0 -0
- data/rwdconfig.dist +21 -0
- data/rwdeliza.rb +1 -0
- data/tests/RubyGauge.rb +179 -0
- data/tests/checkdepends.sh +4 -0
- data/tests/cleancnf.sh +6 -0
- data/tests/makedist-rwdweliza.rb +56 -0
- data/tests/makedist.rb +66 -0
- data/tests/rdep.rb +354 -0
- data/tests/totranslate.lang +93 -0
- data/zips/rwdwaddresses-1.05.zip +0 -0
- data/zips/rwdwcalc-0.61.zip +0 -0
- data/zips/rwdwgutenberg-0.09.zip +0 -0
- data/zips/rwdwschedule-1.04.zip +0 -0
- data/zips/rwdwshell-1.04.zip +0 -0
- data/zips/temp.rb +1 -0
- data/zips/wrubyslippers-1.06.zip +0 -0
- metadata +282 -0
@@ -0,0 +1,10 @@
|
|
1
|
+
|
2
|
+
def rwdweliza_0_03()
|
3
|
+
$tinkerdocumentsarray.delete_if {|x| x == "HowTo_Eliza.txt"}
|
4
|
+
$tinkerhelpaboutarray.delete_if {|x| x == "RwdEliza"}
|
5
|
+
Helptext.delete_if {|key, value| key == :rwdeliza_help }
|
6
|
+
Helptext.delete_if {|key, value| key == :rwdeliza_configuration }
|
7
|
+
$rwdjumplink.delete_if {|x| x == "RwdElizaWindow"}
|
8
|
+
$rwdjumplink.delete_if {|x| x == "RwdWordsMainWindow"}
|
9
|
+
|
10
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# process statements
|
2
|
+
|
3
|
+
BEGIN {
|
4
|
+
$LOAD_PATH.unshift File::dirname(File::dirname( __FILE__ )) + "/lib"
|
5
|
+
require 'linguistics'
|
6
|
+
require 'linkparser'
|
7
|
+
|
8
|
+
}
|
9
|
+
|
10
|
+
def process_eliza_sentence
|
11
|
+
Linguistics::use( :en )
|
12
|
+
|
13
|
+
# Just
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
# Test to see whether or not the link parser is loaded.
|
20
|
+
#Linguistics::EN.has_link_parser?
|
21
|
+
temp_sentence = "unknown"
|
22
|
+
if ! @a_sentence_in.to_s.empty?
|
23
|
+
temp_sentence = @a_sentence_in.to_s.downcase
|
24
|
+
end
|
25
|
+
|
26
|
+
@showelizaresult = "\n"
|
27
|
+
@showelizaresult += "Sentence = "
|
28
|
+
|
29
|
+
@showelizaresult += "#{temp_sentence}"
|
30
|
+
begin
|
31
|
+
|
32
|
+
temp_elizaresponse_directory = $rwdelizadata_directory + "/" + $rwdelizaresponse_directory
|
33
|
+
|
34
|
+
fileList = Dir.new(temp_elizaresponse_directory).entries.sort.delete_if { |x| ! (x =~ /res$/) }
|
35
|
+
|
36
|
+
temp_index_num = rand(4)
|
37
|
+
temp_resfile = fileList[temp_index_num]
|
38
|
+
fileName = File.join(temp_elizaresponse_directory,temp_resfile)
|
39
|
+
fd = File.open(fileName,"r")
|
40
|
+
temp_response = fd.readline.chomp
|
41
|
+
@showelizaresult = temp_response
|
42
|
+
@eventrecordsresult = "error opening response"
|
43
|
+
end # end of error function
|
44
|
+
|
45
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
Helptext.update( :rwdelizasentence_help => " Eliza is a toy program
|
4
|
+
to test sentence production by computer
|
5
|
+
|
6
|
+
This program is just starting to be developed
|
7
|
+
|
8
|
+
on the 'Sentence' tab you can enter a simple sentence
|
9
|
+
like
|
10
|
+
|
11
|
+
feed the dog
|
12
|
+
|
13
|
+
if it can parse the sentence It displays the subject, verb and object.
|
14
|
+
don't use puncuation.
|
15
|
+
The words that can be parsed are in
|
16
|
+
tiny.dict in the ElizaData directoy
|
17
|
+
and in the words directoy under that
|
18
|
+
|
19
|
+
|
20
|
+
",
|
21
|
+
|
22
|
+
|
23
|
+
:rwdeliza_generalhelp => " Eliza is a toy program
|
24
|
+
to test sentence production by computer
|
25
|
+
|
26
|
+
This program is just starting to be developed
|
27
|
+
|
28
|
+
at this version it is just responding randomly
|
29
|
+
|
30
|
+
The plan is to parse input sentences and general
|
31
|
+
responses that are learned over time
|
32
|
+
|
33
|
+
The 'Sentence' tab can do simple parsing of simple sentences.
|
34
|
+
|
35
|
+
like: feed the dog
|
36
|
+
"
|
37
|
+
|
38
|
+
|
39
|
+
)
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# this code is to call the help window
|
2
|
+
def runhelpwindowrwdeliza
|
3
|
+
|
4
|
+
$help_topic = "rwdeliza_generalhelp"
|
5
|
+
if @rwd_tab == "RwdEliza"
|
6
|
+
$help_topic = "rwdeliza_generalhelp"
|
7
|
+
end
|
8
|
+
if @rwd_tab == "SentenceStructure"
|
9
|
+
$help_topic = "rwdelizasentence_help"
|
10
|
+
end
|
11
|
+
|
12
|
+
$helptopicsarray = $helptopicsarray | ["rwdeliza_generalhelp","rwdelizasentence_help"]
|
13
|
+
|
14
|
+
|
15
|
+
|
16
|
+
if @rwd_window != "rwdtinkerhelpwindow"
|
17
|
+
$previouswindow = @rwd_window
|
18
|
+
$previoustab = @rwd_tab
|
19
|
+
end
|
20
|
+
runhelpwindow
|
21
|
+
end
|
22
|
+
|
23
|
+
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# Application Rwdtinker orginally (c) 2004 Steven Gibson under GPL.
|
2
|
+
# This application is a contact book
|
3
|
+
# For more information about see http://www.rubyforge.net/projects/rwdapplications
|
4
|
+
|
5
|
+
# call the window
|
6
|
+
def runrwdelizawindow
|
7
|
+
|
8
|
+
@rwd_window = "rwdelizawindow"
|
9
|
+
@rwd_tab="RwdEliza"
|
10
|
+
|
11
|
+
end
|
12
|
+
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# Application RwdTinker orginally (c) 2004 Steven Gibson under GPL.
|
2
|
+
# This application is a framework for writing programs from RubyWebDialogs
|
3
|
+
# For information see http://www.rubyforge.net/projects/rwdapplications
|
4
|
+
|
5
|
+
# return the version constant defined in the config file
|
6
|
+
def rwdelizahelpaboutsetup
|
7
|
+
return ["RwdEliza","(c) 2005 Steven Gibson ","Version #{RwdElizaVersion}"]
|
8
|
+
end
|
9
|
+
|
10
|
+
|
@@ -0,0 +1,39 @@
|
|
1
|
+
#!/usr/bin/ruby
|
2
|
+
|
3
|
+
BEGIN {
|
4
|
+
$LOAD_PATH.unshift File::dirname(File::dirname( __FILE__ )) + "/lib"
|
5
|
+
require 'linguistics'
|
6
|
+
require 'linkparser'
|
7
|
+
|
8
|
+
}
|
9
|
+
|
10
|
+
def tag_sentence_rwdeliza
|
11
|
+
Linguistics::use( :en )
|
12
|
+
|
13
|
+
# Just a fun little demo of the conjunction (junction, what's your) function.
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
# Test to see whether or not the link parser is loaded.
|
20
|
+
#Linguistics::EN.has_link_parser?
|
21
|
+
temp_sentence = "unknown"
|
22
|
+
if ! @a_sentence_in_to_tag.to_s.empty?
|
23
|
+
temp_sentence = @a_sentence_in_to_tag.to_s.downcase
|
24
|
+
end
|
25
|
+
|
26
|
+
@showrwdelizasentenceresult = "\n"
|
27
|
+
@showrwdelizasentenceresult += "Sentence = "
|
28
|
+
|
29
|
+
@showrwdelizasentenceresult += "#{temp_sentence}"
|
30
|
+
@showrwdelizasentenceresult += "\n"
|
31
|
+
@showrwdelizasentenceresult += "Subject = "
|
32
|
+
@showrwdelizasentenceresult += "#{temp_sentence}".en.sentence.subject.to_s
|
33
|
+
@showrwdelizasentenceresult += "\n"
|
34
|
+
@showrwdelizasentenceresult += "Verb = "
|
35
|
+
@showrwdelizasentenceresult += "#{temp_sentence}".en.sentence.verb.to_s
|
36
|
+
@showrwdelizasentenceresult += "\n"
|
37
|
+
@showrwdelizasentenceresult += "Object = "
|
38
|
+
@showrwdelizasentenceresult += "#{temp_sentence}".en.sentence.object.to_s
|
39
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# Application RwdTinker orginally (c) 2004 Steven Gibson under GPL.
|
2
|
+
# This application is a framework for writing programs from RubyWebDialogs
|
3
|
+
# For information see http://www.rubyforge.net/projects/rwdapplications
|
4
|
+
|
5
|
+
require 'resolv'
|
6
|
+
require 'date'
|
7
|
+
|
8
|
+
# return the platform information
|
9
|
+
def runviewplatform
|
10
|
+
@platformdisplay = "Platform is " + RUBY_PLATFORM + "\n"
|
11
|
+
@platformdisplay = @platformdisplay + "Ruby Version " + VERSION + "\n"
|
12
|
+
@platformdisplay = @platformdisplay + "rwdtinker version " + RwdTinkerVersion + "\n"
|
13
|
+
@platformdisplay = @platformdisplay + "program directory " + $progdir + "\n"
|
14
|
+
@platformdisplay = @platformdisplay + "hostname " + Resolv.getname(Resolv.getaddress("localhost")) + "\n"
|
15
|
+
@platformdisplay = @platformdisplay + "application name " + $rwdapplicationidentity + "\n"
|
16
|
+
@platformdisplay = @platformdisplay + "Date " + Date.today().to_s
|
17
|
+
|
18
|
+
end
|
19
|
+
|
@@ -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,240 @@
|
|
1
|
+
|
2
|
+
#***********************************************************************
|
3
|
+
#* Rwd/Tinker -- A Ruby program for the RudyWebDialog.
|
4
|
+
#* Copyright (c) 2004 - 2005 by Steven Gibson. All Rights Reserved.
|
5
|
+
#*
|
6
|
+
#* This library is free software; you can redistribute it and/or
|
7
|
+
#* modify it under the terms of the GNU General Public
|
8
|
+
#* License as published by the Free Software Foundation; either
|
9
|
+
#* .
|
10
|
+
#*
|
11
|
+
#* These files are distributed in the hope that they will be useful,
|
12
|
+
#* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
+
#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
14
|
+
#* General Public License for more details.
|
15
|
+
#*
|
16
|
+
#* You should have received a copy of the GNU General Public
|
17
|
+
#* License along with these files; if not, write to the Free Software
|
18
|
+
#* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
19
|
+
#*
|
20
|
+
#* For further information please contact the author by e-mail
|
21
|
+
#* at "smalllinux@gmail.com".
|
22
|
+
#***********************************************************************/
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
# integrate the new configuration files
|
27
|
+
def initiateapplet(nametextlocal)
|
28
|
+
|
29
|
+
debuginitiate = 0
|
30
|
+
|
31
|
+
if $DEBUG
|
32
|
+
$stderr.puts "starting config load with: #{nametextlocal}"
|
33
|
+
end
|
34
|
+
|
35
|
+
|
36
|
+
Dir.chdir($progdir ) #changes the current working directory
|
37
|
+
|
38
|
+
@confignew = "configuration/" + "#{nametextlocal}.cnf"
|
39
|
+
@configdist = "configuration/" + "#{nametextlocal}.dist"
|
40
|
+
Rconftool::install(@configdist,@confignew)
|
41
|
+
|
42
|
+
begin
|
43
|
+
|
44
|
+
configfileload = File.open(@configdist){|f| f.read}
|
45
|
+
|
46
|
+
eval configfileload #load config file
|
47
|
+
|
48
|
+
|
49
|
+
|
50
|
+
rescue
|
51
|
+
|
52
|
+
if $DEBUG
|
53
|
+
$stderr.puts "error in initiateapplets - config load"
|
54
|
+
end
|
55
|
+
debuginitiate += 1
|
56
|
+
end
|
57
|
+
$tempdoc = " "
|
58
|
+
|
59
|
+
Dir.chdir($progdir) # change back to top program directory
|
60
|
+
|
61
|
+
# build the English Language hash file from the parts
|
62
|
+
languagehashvariable = 'Message.update('
|
63
|
+
startlangdir = File.join(LangDir,"en")
|
64
|
+
#get a list of the files and subdirectories on the starting directory only
|
65
|
+
alanghash = Array.new(Dir[startlangdir].entries.sort)
|
66
|
+
#loop through the list, ignore the files and add all new directories found
|
67
|
+
alanghash.each do |x|
|
68
|
+
#if a directory...
|
69
|
+
if(test(?d,x))
|
70
|
+
# add to the original list of directories
|
71
|
+
@@tmproot = x + "/**"
|
72
|
+
#adds the new ones to the array
|
73
|
+
blanghash = Dir[@@tmproot].entries.sort
|
74
|
+
blanghash.each do |x|
|
75
|
+
if(test(?d,x))
|
76
|
+
alanghash.push(x) #appends to the end of the array...
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
alanghash.each do |x|
|
82
|
+
#if it is a file...
|
83
|
+
if(!test(?d,x))
|
84
|
+
alanghash.delete(x)
|
85
|
+
else #it is a directory...
|
86
|
+
findfiles(x + "/**")
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
|
91
|
+
#writes the contents of doc into the languagehashvariable
|
92
|
+
|
93
|
+
|
94
|
+
languagehashvariable = languagehashvariable + $tempdoc + ' :rwdtinker => "Rwdtinker" ) ;'
|
95
|
+
|
96
|
+
# END of en Lang building
|
97
|
+
$tempdoc = " "
|
98
|
+
Dir.chdir($progdir) # change back to top program directory
|
99
|
+
|
100
|
+
# build the local Language hash file from the parts
|
101
|
+
startlangdir = File.join(LangDir,$lang)
|
102
|
+
#get a list of the files and subdirectories on the starting directory only
|
103
|
+
alanghash = Array.new(Dir[startlangdir].entries.sort)
|
104
|
+
#loop through the list, ignore the files and add all new directories found
|
105
|
+
alanghash.each do |x|
|
106
|
+
#if a directory...
|
107
|
+
if(test(?d,x))
|
108
|
+
# add to the original list of directories
|
109
|
+
@@tmproot = x + "/**"
|
110
|
+
#adds the new ones to the array
|
111
|
+
blanghash = Dir[@@tmproot].entries.sort
|
112
|
+
blanghash.each do |x|
|
113
|
+
if(test(?d,x))
|
114
|
+
alanghash.push(x) #appends to the end of the array...
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|
119
|
+
alanghash.each do |x|
|
120
|
+
#if it is a file...
|
121
|
+
if(!test(?d,x))
|
122
|
+
alanghash.delete(x)
|
123
|
+
else #it is a directory...
|
124
|
+
findfiles(x + "/**")
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
|
129
|
+
#writes the contents of doc into the variable
|
130
|
+
|
131
|
+
languagehashvariable = languagehashvariable + " Message.update(" + $tempdoc + ' :rwdtinker => "Rwdtinker" ) '
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
$tempdoc = " "
|
136
|
+
|
137
|
+
Dir.chdir($progdir) # change back to top program directory
|
138
|
+
|
139
|
+
temp = eval( languagehashvariable )
|
140
|
+
|
141
|
+
|
142
|
+
tempguistorage = $rwd_gui_tinker # if gui load fails restore old
|
143
|
+
begin # error trap
|
144
|
+
|
145
|
+
# build the actual GUI from the gui parts
|
146
|
+
$tempdoc = " "
|
147
|
+
#get a list of the files and subdirectories on the starting directory only
|
148
|
+
a = Array.new(Dir[GuiDir].entries.sort)
|
149
|
+
#loop through the list, ignore the files and add all new directories found
|
150
|
+
a.each do |x|
|
151
|
+
#if a directory...
|
152
|
+
if(test(?d,x))
|
153
|
+
#use this new dir find to add to the original list of directories
|
154
|
+
@@root = x + "/**"
|
155
|
+
#adds the new ones to the array
|
156
|
+
b = Dir[@@root].entries.sort
|
157
|
+
b.each do |x|
|
158
|
+
if(test(?d,x))
|
159
|
+
a.push(x) #appends to the end of the array...
|
160
|
+
end
|
161
|
+
end
|
162
|
+
end
|
163
|
+
end
|
164
|
+
a.each do |x|
|
165
|
+
#if it is a file...
|
166
|
+
if(!test(?d,x))
|
167
|
+
a.delete(x)
|
168
|
+
|
169
|
+
else #it is a directory...
|
170
|
+
loadguifile(x + "/**")
|
171
|
+
|
172
|
+
|
173
|
+
end
|
174
|
+
end
|
175
|
+
|
176
|
+
$rwd_gui_tinker = $tempdoc
|
177
|
+
|
178
|
+
|
179
|
+
rescue
|
180
|
+
$rwd_gui_tinker = tempguistorage # restore old gui
|
181
|
+
if $DEBUG
|
182
|
+
$stderr.puts "error in initiateapplets - gui building"
|
183
|
+
end
|
184
|
+
|
185
|
+
debuginitiate += 1
|
186
|
+
end
|
187
|
+
|
188
|
+
begin # error trap
|
189
|
+
# now load in the code files
|
190
|
+
|
191
|
+
$tempdoc = ""
|
192
|
+
tempcodeinstallline = ""
|
193
|
+
|
194
|
+
@fileName = "installed/" + nametextlocal + ".inf"
|
195
|
+
|
196
|
+
tmpfilearray = File.readlines(@fileName)
|
197
|
+
|
198
|
+
tmpfilearray.each do |line|
|
199
|
+
|
200
|
+
tempcodeinstallline = line.chomp
|
201
|
+
if tempcodeinstallline.include?('code/')
|
202
|
+
findfiles(tempcodeinstallline + "/**")
|
203
|
+
tempcoderesult = eval( $tempdoc ) # read the program code and evaluate
|
204
|
+
end
|
205
|
+
end
|
206
|
+
|
207
|
+
|
208
|
+
rescue
|
209
|
+
if $DEBUG
|
210
|
+
$stderr.puts "error in initiateapplets - code building"
|
211
|
+
end
|
212
|
+
debuginitiate += 1
|
213
|
+
|
214
|
+
|
215
|
+
end
|
216
|
+
|
217
|
+
setuphelpaboutoptions # update the help about list
|
218
|
+
setuptinkerdocuments # update the document pull down list
|
219
|
+
runhelpwindow # update the help menu
|
220
|
+
showjumplinkoptions # update the application link menu
|
221
|
+
runrwdtinkerbackwindow # back to applet window
|
222
|
+
|
223
|
+
# resultend = tempcodeinstallline .index("\n",resultstart)
|
224
|
+
tempresult = @fileName
|
225
|
+
|
226
|
+
return " applet loading successful " + tempresult
|
227
|
+
|
228
|
+
|
229
|
+
|
230
|
+
if debuginitiate > 0
|
231
|
+
return " initiateapplet .."
|
232
|
+
else
|
233
|
+
return " initiateapplet success"
|
234
|
+
end
|
235
|
+
|
236
|
+
end
|
237
|
+
|
238
|
+
|
239
|
+
|
240
|
+
|