rwdtinker 1.83 → 1.84
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.
- data/code/01rwdcore/01rwdcore.rb +1 -2
- data/code/01rwdcore/test_cases.rb +100 -51
- data/code/01rwdcore/test_harness.rb +8 -1
- data/code/superant.com.rwdtinkerbackwindow/changelocale.rb +84 -0
- data/code/superant.com.rwdtinkerbackwindow/openhelpwindowtinkerwin2.rb +3 -1
- data/code/superant.com.rwdtinkerbackwindow/showlocaleoptions.rb +9 -0
- data/configuration/rwdtinker.dist +3 -3
- data/configuration/tinkerwin2variables.dist +1 -1
- data/gui/00coreguibegin/applicationguitop.rwd +3 -5
- data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/80localechanger.rwd +17 -0
- data/lang/en/rwdcore/en.po +13 -1
- data/lang/es/rwdcore/es.po +6 -0
- data/lib/zip/ioextras.rb +43 -2
- data/lib/zip/stdrubyext.rb +5 -5
- data/lib/zip/tempfile_bugfixed.rb +2 -2
- data/lib/zip/zip.rb +618 -149
- data/lib/zip/zipfilesystem.rb +59 -8
- data/lib/zip/ziprequire.rb +32 -3
- data/rwd_files/HowTo_Tinker.txt +5 -0
- data/rwd_files/Tinkerhelptexthash.txt +3 -1
- data/rwdconfig.dist +1 -1
- data/tests/makedist.rb +1 -1
- data/zips/rwdwfoldeditor-0.07.zip +0 -0
- data/zips/rwdwhypernote-0.16.zip +0 -0
- metadata +7 -4
- data/zips/rwdwfoldeditor-0.05.zip +0 -0
- data/zips/rwdwmpd-0.07.zip +0 -0
data/code/01rwdcore/01rwdcore.rb
CHANGED
|
@@ -1,71 +1,120 @@
|
|
|
1
1
|
# test harness
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
require 'test/unit/testcase'
|
|
5
|
-
require 'test/unit/assertions'
|
|
6
|
-
include Test::Unit::Assertions
|
|
7
|
-
include Test::Unit
|
|
8
|
-
def rwdtinker_all_tests
|
|
9
|
-
print "in rwdtinker all tests\n"
|
|
10
|
-
$testrwdtinkertestcase = TestSuite.new
|
|
11
|
-
test_runrwdtinkerbackwindow
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
def test_runrwdtinkerbackwindow
|
|
15
|
-
|
|
16
4
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
5
|
+
def rwdtinker_all_tests
|
|
6
|
+
$rwdtinkerlog.info "in rwdtinker all tests"
|
|
7
|
+
|
|
8
|
+
$rwdtinkerlog.info "Starting rwdtinker tests!\n"
|
|
20
9
|
runrwdtinkerbackwindow
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
10
|
+
|
|
11
|
+
if "tinkerbackwindow" == @rwd_window
|
|
12
|
+
$testasserts += 1
|
|
13
|
+
else
|
|
14
|
+
$testfailures += 1
|
|
15
|
+
$testerrorarray << "runrwdtinkerbackwindow"
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
runselectiontab
|
|
19
|
+
|
|
20
|
+
if "selectiontab" == @rwd_tab
|
|
21
|
+
$testasserts += 1
|
|
22
|
+
else
|
|
23
|
+
$testfailures += 1
|
|
24
|
+
$testerrorarray << "selectiontab"
|
|
25
|
+
end
|
|
26
|
+
|
|
25
27
|
showjumplinkoptions
|
|
26
28
|
@a_jumplinkinput = "returntomain"
|
|
27
29
|
runjumplinkcommand
|
|
28
|
-
|
|
30
|
+
if "main" == @rwd_window
|
|
31
|
+
$testasserts += 1
|
|
32
|
+
else
|
|
33
|
+
$testfailures += 1
|
|
34
|
+
$testerrorarray << "returntomain"
|
|
35
|
+
end
|
|
29
36
|
@a_jumplinkinput = "helpscreen"
|
|
30
37
|
runjumplinkcommand
|
|
31
38
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
39
|
+
if "rwdtinkerhelpwindow" == @rwd_window
|
|
40
|
+
$testasserts += 1
|
|
41
|
+
else
|
|
42
|
+
$testfailures += 1
|
|
43
|
+
$testerrorarray << "helpscreen"
|
|
44
|
+
end
|
|
45
|
+
|
|
35
46
|
runtinkerdocuments
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
assert_not_nil(@appletcontentstext) ; testasserts += 1
|
|
43
|
-
runrwdtinkerwin2version
|
|
44
|
-
assert_equal("applicationversion",@rwd_window) ; testasserts += 1
|
|
45
|
-
returntomain
|
|
46
|
-
assert_equal("main",@rwd_window) ; testasserts += 1
|
|
47
|
-
runrwdtinkerbackwindow
|
|
48
|
-
|
|
49
|
-
assert_equal("tinkerbackwindow",@rwd_window) ; testasserts += 1
|
|
50
|
-
runremotezipsinstall
|
|
51
|
-
assert_equal("superantcomremotezipsinstall",@rwd_tab) ; testasserts += 1
|
|
52
|
-
runeditconfiguration
|
|
53
|
-
assert_equal("editconfigurationfile",@rwd_tab) ; testasserts += 1
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
$stderr.print "tests completed succesfully!\n"
|
|
57
|
-
$stderr.print testasserts, " asserts performed\n"
|
|
47
|
+
if "documentsrwdtinkerone" == @rwd_tab
|
|
48
|
+
$testasserts += 1
|
|
49
|
+
else
|
|
50
|
+
$testfailures += 1
|
|
51
|
+
$testerrorarray << "runtinkerdocuments"
|
|
52
|
+
end
|
|
58
53
|
|
|
59
|
-
rescue NotImplementedError, Exception
|
|
60
|
-
$stderr.print $!
|
|
61
54
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
55
|
+
runrwdtinkerwin2version
|
|
56
|
+
if "applicationversion" == @rwd_window
|
|
57
|
+
$testasserts += 1
|
|
58
|
+
else
|
|
59
|
+
$testfailures += 1
|
|
60
|
+
$testerrorarray << "runrwdtinkerwin2version"
|
|
61
|
+
end
|
|
65
62
|
|
|
63
|
+
|
|
64
|
+
runremotezipsinstall
|
|
65
|
+
if "superantcomremotezipsinstall" == @rwd_tab
|
|
66
|
+
$testasserts += 1
|
|
67
|
+
else
|
|
68
|
+
$testfailures += 1
|
|
69
|
+
$testerrorarray << "runremotezipsinstall"
|
|
70
|
+
end
|
|
66
71
|
|
|
72
|
+
runeditconfiguration
|
|
73
|
+
if "editconfigurationfile" == @rwd_tab
|
|
74
|
+
$testasserts += 1
|
|
75
|
+
else
|
|
76
|
+
$testfailures += 1
|
|
77
|
+
$testerrorarray << "runeditconfiguration"
|
|
78
|
+
end
|
|
79
|
+
runhelpwindowtinkerwin2
|
|
80
|
+
|
|
81
|
+
if @rwd_tab == "editconfigurationfile" && @rwdhelpdataoutput.include?("Remember to reload the configuration variables")
|
|
82
|
+
$testasserts += 1
|
|
83
|
+
else
|
|
84
|
+
$testfailures += 1
|
|
85
|
+
$testerrorarray << "applet_tinkerbackeditconfiguration"
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
rwd_jump("rwdlogfiletab", "rwd_tab_rwdlogfiletab")
|
|
90
|
+
|
|
91
|
+
if @rwd_tab == "rwdlogfiletab"
|
|
92
|
+
$testasserts += 1
|
|
93
|
+
else
|
|
94
|
+
$testfailures += 1
|
|
95
|
+
$testerrorarray << "rwdlogfiletab"
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
rwd_jump( "diagnostictab")
|
|
99
|
+
if @rwd_tab == "diagnostictab"
|
|
100
|
+
$testasserts += 1
|
|
101
|
+
else
|
|
102
|
+
$testfailures += 1
|
|
103
|
+
$testerrorarray << "diagnostictab"
|
|
104
|
+
end
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
def rwd_jump(tab, go="")
|
|
108
|
+
@rwd_tab = tab
|
|
109
|
+
@rwd_action = go
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
def teststobedown
|
|
113
|
+
runrwdtinkerbackwindow
|
|
114
|
+
@a_installapplet="/usr/src/rwdapplets/rwdtinker/zips/rwdahelloworld-0.5"
|
|
115
|
+
viewgemappletcontents
|
|
116
|
+
assert_not_nil(@appletcontentstext) ; testasserts += 1
|
|
67
117
|
|
|
68
|
-
def teststobedown
|
|
69
118
|
runtinkerhelpabout
|
|
70
119
|
assert_equal("rwdtinkerhelpwindow",@rwd_tab) ; testasserts += 1
|
|
71
120
|
raise NotImplementedError, 'Need to write test_choosenewhelptopic'
|
|
@@ -2,12 +2,19 @@
|
|
|
2
2
|
def rwdtest_harness
|
|
3
3
|
|
|
4
4
|
print "in test harness\n"
|
|
5
|
-
|
|
5
|
+
$testasserts = 0
|
|
6
|
+
$testerrorarray = [""]
|
|
7
|
+
$testfailures = 0
|
|
8
|
+
|
|
6
9
|
$testharnessarray.each { |x|
|
|
7
10
|
print "calling #{x}\n"
|
|
8
11
|
eval("#{x}")
|
|
9
12
|
|
|
10
13
|
}
|
|
14
|
+
$rwdtinkerlog.info "successes = #{$testasserts}"
|
|
15
|
+
$rwdtinkerlog.info "failures = #{$testfailures}"
|
|
16
|
+
$rwdtinkerlog.info "failed methods #{$testerrorarray}"
|
|
17
|
+
$rwdtinkerlog.info "tested methods #{$testharnessarray}"
|
|
11
18
|
|
|
12
19
|
end
|
|
13
20
|
|
|
@@ -0,0 +1,84 @@
|
|
|
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
|
+
def runlocalechangercommand
|
|
25
|
+
|
|
26
|
+
$rwdtinkerlog.info "preparing to restart gui"
|
|
27
|
+
|
|
28
|
+
$lang = @a_localechooseinput # pick the language of choice
|
|
29
|
+
|
|
30
|
+
tempdoc = " "
|
|
31
|
+
|
|
32
|
+
Dir.chdir($progdir) # change back to top program directory
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
# build the English Language hash file from the parts
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
require 'lib/rwdtinker/rwdlangdir'
|
|
39
|
+
|
|
40
|
+
tempdoc = " "
|
|
41
|
+
#go get all the po language file files in english
|
|
42
|
+
tempdoc = RwdtinkerTools.findlanguagefiles(LangDir,"en")
|
|
43
|
+
|
|
44
|
+
#writes the contents of doc into the languagehashvariable
|
|
45
|
+
languagehashvariable = tempdoc
|
|
46
|
+
|
|
47
|
+
# END of en Lang building
|
|
48
|
+
tempdoc = " "
|
|
49
|
+
Dir.chdir($progdir) # change back to top program directory
|
|
50
|
+
|
|
51
|
+
# build the local Language hash file from the parts
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
# Go get all the po files for the language of choice
|
|
56
|
+
tempdoc = RwdtinkerTools.findlanguagefiles(LangDir,$lang)
|
|
57
|
+
# the contents of doc into the variable
|
|
58
|
+
languagehashvariable = languagehashvariable + tempdoc
|
|
59
|
+
|
|
60
|
+
Dir.chdir($progdir) # change back to top program directory
|
|
61
|
+
|
|
62
|
+
# lets read those po files, first english then the chosen language
|
|
63
|
+
temp = eval( languagehashvariable )
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
# build the actual GUI from the gui parts
|
|
69
|
+
require 'lib/rwdtinker/rwdguidir'
|
|
70
|
+
|
|
71
|
+
tempdoc = RwdtinkerTools.findguifiles(GuiDir)
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
# gui variable is done
|
|
75
|
+
guiRWD = ""
|
|
76
|
+
$rwd_gui_tinker = tempdoc
|
|
77
|
+
|
|
78
|
+
$rwdtinkerlog.info "restarting gui now"
|
|
79
|
+
|
|
80
|
+
RWDWindow.new($rwd_gui_tinker, @rwd_window).render("DEFAULT")
|
|
81
|
+
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
|
|
@@ -23,7 +23,9 @@ def runhelpwindowtinkerwin2
|
|
|
23
23
|
if @rwd_tab == "superantcomremotezipsinstall"
|
|
24
24
|
$help_topic = "remotegemapplet_install"
|
|
25
25
|
end
|
|
26
|
-
|
|
26
|
+
if @rwd_tab == "localechangertab"
|
|
27
|
+
$help_topic = "localechanger_help"
|
|
28
|
+
end
|
|
27
29
|
|
|
28
30
|
if @rwd_window != "rwdtinkerhelpwindow"
|
|
29
31
|
$previouswindow = @rwd_window
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
##VERSION: (1.
|
|
1
|
+
##VERSION: (1.84)
|
|
2
2
|
ConfigurationDir = "configuration" # for use in program - init.rb has this value without using this constant
|
|
3
3
|
CodeName = "rwdtinker"
|
|
4
4
|
CodeNameFile = CodeName + ".rb"
|
|
@@ -10,6 +10,6 @@ LangDir = "lang"
|
|
|
10
10
|
$prevouswindow ="main"
|
|
11
11
|
$rwdcontrolports =["13713","13714","13715","13716"] # remote control code not actived 2007
|
|
12
12
|
$port = 7705
|
|
13
|
-
##NAME: (RwdTinkerVersion):(1.
|
|
14
|
-
RwdTinkerVersion = "1.
|
|
13
|
+
##NAME: (RwdTinkerVersion):(1.84)
|
|
14
|
+
RwdTinkerVersion = "1.84"
|
|
15
15
|
|
|
@@ -3,9 +3,7 @@ $rwdguivar=
|
|
|
3
3
|
<window name=\"main\" title=\"RwdTinker - Webdialogs for Ruby\">
|
|
4
4
|
<tabs>"
|
|
5
5
|
|
|
6
|
-
__END__
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
=end
|
|
7
|
+
#Application RwdTinker orginally (c) 2004 Steven Gibson under GPL.
|
|
8
|
+
#This is the first part of the window for the core application
|
|
9
|
+
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
$rwdguivar=
|
|
2
|
+
"
|
|
3
|
+
<tab name=localechangertab caption=#{Message[:localechangertablabel]}>
|
|
4
|
+
<horizontal>
|
|
5
|
+
<button caption=#{Message[:tinkercoreshowlocale_choices]} action=\"showlocalechoicesoptions\"/>
|
|
6
|
+
<button caption=#{Message[:help]} action=\"runhelpwindowtinkerwin2\"/>
|
|
7
|
+
</horizontal>
|
|
8
|
+
<table>
|
|
9
|
+
<select name=\"a_localechooseinput\"> %%localechooseoptions%% </select>
|
|
10
|
+
|
|
11
|
+
</table>
|
|
12
|
+
|
|
13
|
+
<horizontal>
|
|
14
|
+
<button caption=#{Message[:tinkercorechangelocale]} action=\"runlocalechangercommand\"/>
|
|
15
|
+
</horizontal>
|
|
16
|
+
</tab>
|
|
17
|
+
"
|
data/lang/en/rwdcore/en.po
CHANGED
|
@@ -66,6 +66,12 @@ msgid "file_name"
|
|
|
66
66
|
msgid "listzipdirappletsavailable"
|
|
67
67
|
msgstr '"List (zip directory) applets available for installation"'
|
|
68
68
|
|
|
69
|
+
msgid "localechangertablabel"
|
|
70
|
+
msgstr '"Locale Changer"'
|
|
71
|
+
|
|
72
|
+
msgid "locale_changer_help"
|
|
73
|
+
msgstr "You can change the locale on this tab<br>Click on Show Locale Choices to fill in the pull down options<br>When you click on Change Locale Now the entire GUI will be reloaded"
|
|
74
|
+
|
|
69
75
|
msgid "menu_panel"
|
|
70
76
|
msgstr '"Menu Panel"'
|
|
71
77
|
|
|
@@ -129,6 +135,12 @@ msgid "selection_panel"
|
|
|
129
135
|
msgid "selection_tab"
|
|
130
136
|
msgstr '"Menu Tab"'
|
|
131
137
|
|
|
138
|
+
msgid "tinkercoreshowlocale_choices"
|
|
139
|
+
msgstr '"Show Locale Choices"'
|
|
140
|
+
|
|
141
|
+
msgid "tinkercorechangelocale"
|
|
142
|
+
msgstr '"Change Locale Now"'
|
|
143
|
+
|
|
132
144
|
msgid "tinker_logo"
|
|
133
145
|
msgstr '"Tinker Logo"'
|
|
134
146
|
|
|
@@ -173,7 +185,7 @@ msgstr '"View Install Text"'
|
|
|
173
185
|
rwdapplications. On the front screen you can view
|
|
174
186
|
documents and make menu choices. On the back
|
|
175
187
|
screen you will find:<p>
|
|
176
|
-
You can work with Applets: go to
|
|
188
|
+
You can work with Applets: go to Selection tab, <br>
|
|
177
189
|
On that back screen you will find:<br>
|
|
178
190
|
List Applets: you can see and delete installed applets<br>
|
|
179
191
|
List Zips: you can see lists of applets that you can install<br>
|
data/lang/es/rwdcore/es.po
CHANGED
|
@@ -135,6 +135,12 @@ msgstr '"Panel de Selección"'
|
|
|
135
135
|
msgid "tinker_logo"
|
|
136
136
|
msgstr '"Insignia de Tinker"'
|
|
137
137
|
|
|
138
|
+
msgid "tinkercorechangelocale"
|
|
139
|
+
msgstr '"Cambiar localización ahora"'
|
|
140
|
+
|
|
141
|
+
msgid "tinkercoreshowlocale_choices"
|
|
142
|
+
msgstr '"Mostrar opciones de localización"'
|
|
143
|
+
|
|
138
144
|
msgid "selection_tab"
|
|
139
145
|
msgstr '"Tab de Selección"'
|
|
140
146
|
|
data/lib/zip/ioextras.rb
CHANGED
|
@@ -1,4 +1,16 @@
|
|
|
1
|
-
module IOExtras
|
|
1
|
+
module IOExtras #:nodoc:
|
|
2
|
+
|
|
3
|
+
CHUNK_SIZE = 32768
|
|
4
|
+
|
|
5
|
+
RANGE_ALL = 0..-1
|
|
6
|
+
|
|
7
|
+
def self.copy_stream(ostream, istream)
|
|
8
|
+
s = ''
|
|
9
|
+
ostream.write(istream.read(CHUNK_SIZE, s)) until istream.eof?
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
# Implements kind_of? in order to pretend to be an IO object
|
|
2
14
|
module FakeIO
|
|
3
15
|
def kind_of?(object)
|
|
4
16
|
object == IO || super
|
|
@@ -20,6 +32,34 @@ module IOExtras
|
|
|
20
32
|
|
|
21
33
|
attr_accessor :lineno
|
|
22
34
|
|
|
35
|
+
def read(numberOfBytes = nil, buf = nil)
|
|
36
|
+
tbuf = nil
|
|
37
|
+
|
|
38
|
+
if @outputBuffer.length > 0
|
|
39
|
+
if numberOfBytes <= @outputBuffer.length
|
|
40
|
+
tbuf = @outputBuffer.slice!(0, numberOfBytes)
|
|
41
|
+
else
|
|
42
|
+
numberOfBytes -= @outputBuffer.length if (numberOfBytes)
|
|
43
|
+
rbuf = sysread(numberOfBytes, buf)
|
|
44
|
+
tbuf = @outputBuffer
|
|
45
|
+
tbuf << rbuf if (rbuf)
|
|
46
|
+
@outputBuffer = ""
|
|
47
|
+
end
|
|
48
|
+
else
|
|
49
|
+
tbuf = sysread(numberOfBytes, buf)
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
return nil unless (tbuf)
|
|
53
|
+
|
|
54
|
+
if buf
|
|
55
|
+
buf.replace(tbuf)
|
|
56
|
+
else
|
|
57
|
+
buf = tbuf
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
buf
|
|
61
|
+
end
|
|
62
|
+
|
|
23
63
|
def readlines(aSepString = $/)
|
|
24
64
|
retVal = []
|
|
25
65
|
each_line(aSepString) { |line| retVal << line }
|
|
@@ -66,7 +106,8 @@ module IOExtras
|
|
|
66
106
|
end
|
|
67
107
|
|
|
68
108
|
|
|
69
|
-
#
|
|
109
|
+
# Implements many of the output convenience methods of IO.
|
|
110
|
+
# relies on <<
|
|
70
111
|
module AbstractOutputStream
|
|
71
112
|
include FakeIO
|
|
72
113
|
|