rwdlanguage 0.01

Sign up to get free protection for your applications and to get access to all the features.
Files changed (187) hide show
  1. data/Readme.txt +475 -0
  2. data/bin/rwdlanguage +19 -0
  3. data/code/01rwdcore/01rwdcore.rb +29 -0
  4. data/code/01rwdcore/02helptexthashbegin.rb +16 -0
  5. data/code/01rwdcore/03helptexthash.rb +21 -0
  6. data/code/01rwdcore/jumplinkcommand.rb +36 -0
  7. data/code/01rwdcore/openhelpwindow.rb +38 -0
  8. data/code/01rwdcore/returntomain.rb +10 -0
  9. data/code/01rwdcore/rundocuments.rb +10 -0
  10. data/code/01rwdcore/runeditconfiguration.rb +10 -0
  11. data/code/01rwdcore/runhelpabout.rb +15 -0
  12. data/code/01rwdcore/runopentinkerdocument.rb +7 -0
  13. data/code/01rwdcore/runtab.rb +15 -0
  14. data/code/01rwdcore/rwdtinkerversion.rb +22 -0
  15. data/code/01rwdcore/rwdwindowreturn.rb +9 -0
  16. data/code/01rwdcore/selectiontab.rb +11 -0
  17. data/code/01rwdcore/setuphelpaboutoptions.rb +15 -0
  18. data/code/01rwdcore/setuptinkerdocuments.rb +7 -0
  19. data/code/01rwdcore/test_cases.rb +158 -0
  20. data/code/01rwdcore/test_harness.rb +20 -0
  21. data/code/01rwdcore/uploadreturns.rb +65 -0
  22. data/code/dd0viewphoto/dd0viewphoto.rb +5 -0
  23. data/code/superant.com.language/0uninstallapplet.rb +22 -0
  24. data/code/superant.com.language/googlelang.rb +25 -0
  25. data/code/superant.com.language/helptexthashload.rb +22 -0
  26. data/code/superant.com.language/loadconfigurationrecord.rb +22 -0
  27. data/code/superant.com.language/loadconfigurationvariables.rb +14 -0
  28. data/code/superant.com.language/openhelpwindow.rb +24 -0
  29. data/code/superant.com.language/rubySteak.rb +40 -0
  30. data/code/superant.com.language/runappletwindow.rb +12 -0
  31. data/code/superant.com.language/runrwdshellwindow.rb +12 -0
  32. data/code/superant.com.language/runrwdwordsbackwindow.rb +10 -0
  33. data/code/superant.com.language/rwdtinkerversion.rb +10 -0
  34. data/code/superant.com.language/saveconfigurationrecord.rb +20 -0
  35. data/code/superant.com.language/test_cases.rb +20 -0
  36. data/code/superant.com.rwdtinkerbackwindow/changelocale.rb +84 -0
  37. data/code/superant.com.rwdtinkerbackwindow/diagnostictab.rb +19 -0
  38. data/code/superant.com.rwdtinkerbackwindow/initiateapplets.rb +169 -0
  39. data/code/superant.com.rwdtinkerbackwindow/installgemapplet.rb +38 -0
  40. data/code/superant.com.rwdtinkerbackwindow/installremotegem.rb +20 -0
  41. data/code/superant.com.rwdtinkerbackwindow/listgemdirs.rb +12 -0
  42. data/code/superant.com.rwdtinkerbackwindow/listgemzips.rb +55 -0
  43. data/code/superant.com.rwdtinkerbackwindow/listinstalledfiles.rb +14 -0
  44. data/code/superant.com.rwdtinkerbackwindow/listzips.rb +37 -0
  45. data/code/superant.com.rwdtinkerbackwindow/loadconfigurationrecord.rb +24 -0
  46. data/code/superant.com.rwdtinkerbackwindow/loadconfigurationvariables.rb +14 -0
  47. data/code/superant.com.rwdtinkerbackwindow/network.rb +87 -0
  48. data/code/superant.com.rwdtinkerbackwindow/openappletname.rb +19 -0
  49. data/code/superant.com.rwdtinkerbackwindow/openhelpwindowtinkerwin2.rb +40 -0
  50. data/code/superant.com.rwdtinkerbackwindow/remotegemlist.rb +24 -0
  51. data/code/superant.com.rwdtinkerbackwindow/removeapplet.rb +46 -0
  52. data/code/superant.com.rwdtinkerbackwindow/removeappletvariables.rb +52 -0
  53. data/code/superant.com.rwdtinkerbackwindow/runremoteinstall.rb +11 -0
  54. data/code/superant.com.rwdtinkerbackwindow/runrwdtinkerbackwindow.rb +15 -0
  55. data/code/superant.com.rwdtinkerbackwindow/rwdtinkerwin2version.rb +13 -0
  56. data/code/superant.com.rwdtinkerbackwindow/saveconfigurationrecord.rb +19 -0
  57. data/code/superant.com.rwdtinkerbackwindow/showlocaleoptions.rb +9 -0
  58. data/code/superant.com.rwdtinkerbackwindow/viewappletcontents.rb +23 -0
  59. data/code/superant.com.rwdtinkerbackwindow/viewgemappletcontents.rb +24 -0
  60. data/code/superant.com.rwdtinkerbackwindow/viewlogfile.rb +16 -0
  61. data/code/superant.com.thesaurus/clearhttpview3.rb +9 -0
  62. data/code/superant.com.thesaurus/listwordlookup.rb +37 -0
  63. data/code/superant.com.thesaurus/runappletwindow.rb +12 -0
  64. data/code/superant.com.words/dictlookup.rb +20 -0
  65. data/code/superant.com.words/runrwdwordsbackwindow.rb +10 -0
  66. data/code/superant.com.words/rwdtinkerversion.rb +10 -0
  67. data/code/zz0applicationend/zz0end.rb +5 -0
  68. data/configuration/rwdtinker.dist +15 -0
  69. data/configuration/rwdwlanguage.dist +21 -0
  70. data/configuration/tinkerwin2variables.dist +23 -0
  71. data/gui/00coreguibegin/applicationguitop.rwd +9 -0
  72. data/gui/frontwindow0/cc0openphoto.rwd +22 -0
  73. data/gui/frontwindowselections/00selectiontabbegin.rwd +11 -0
  74. data/gui/frontwindowselections/jumplinkcommands.rwd +15 -0
  75. data/gui/frontwindowselections/wwselectionend.rwd +3 -0
  76. data/gui/frontwindowtdocuments/00documentbegin.rwd +6 -0
  77. data/gui/frontwindowtdocuments/tinkerdocuments.rwd +14 -0
  78. data/gui/frontwindowtdocuments/zzdocumentend.rwd +8 -0
  79. data/gui/helpaboutbegin/zzzrwdlasttab.rwd +6 -0
  80. data/gui/helpaboutbegin/zzzzhelpscreenstart.rwd +3 -0
  81. data/gui/helpaboutbegin/zzzzzzhelpabouttab.rwd +15 -0
  82. data/gui/helpaboutzend/helpscreenend.rwd +3 -0
  83. data/gui/helpaboutzend/zhelpscreenstart2.rwd +3 -0
  84. data/gui/helpaboutzend/zzzzhelpabout2.rwd +15 -0
  85. data/gui/helpaboutzend/zzzzhelpscreen2end.rwd +3 -0
  86. data/gui/tinkerbackwindows/superant.com.language/1appname.rwd +4 -0
  87. data/gui/tinkerbackwindows/superant.com.language/22google.rwd +38 -0
  88. data/gui/tinkerbackwindows/superant.com.language/44germany.rwd +19 -0
  89. data/gui/tinkerbackwindows/superant.com.language/67viewconfiguration.rwd +27 -0
  90. data/gui/tinkerbackwindows/superant.com.language/77jumplinkcommands.rwd +17 -0
  91. data/gui/tinkerbackwindows/superant.com.language/z9end.rwd +6 -0
  92. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/1appname.rwd +5 -0
  93. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/40rwdlistzips.rwd +41 -0
  94. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/45installremotezip.rwd +44 -0
  95. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/50rwdlistapplets.rwd +44 -0
  96. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/60editconfiguration.rwd +30 -0
  97. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/70rwddiagnostics.rwd +29 -0
  98. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/75rwdlogfile.rwd +20 -0
  99. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/80localechanger.rwd +17 -0
  100. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/81jumplinkcommands.rwd +17 -0
  101. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/9backend.rwd +6 -0
  102. data/gui/tinkerbackwindows/superant.com.tinkerhelpwindow/1appname.rwd +31 -0
  103. data/gui/tinkerbackwindows/superant.com.tinkerhelpwindow/9end.rwd +4 -0
  104. data/gui/tinkerbackwindows/superant.com.versionwindow/1appname.rwd +19 -0
  105. data/gui/tinkerbackwindows/superant.com.versionwindow/helpaboutwindow.rwd +17 -0
  106. data/gui/tinkerbackwindows/superant.com.words/1appname.rwd +4 -0
  107. data/gui/tinkerbackwindows/superant.com.words/1dictionary.rwd +19 -0
  108. data/gui/tinkerbackwindows/superant.com.words/4thesaurus.rwd +36 -0
  109. data/gui/tinkerbackwindows/superant.com.words/77jumplinkcommands.rwd +17 -0
  110. data/gui/tinkerbackwindows/superant.com.words/z9end.rwd +6 -0
  111. data/gui/zzcoreguiend/yy9rwdend.rwd +4 -0
  112. data/init.rb +179 -0
  113. data/installed/rwdwlanguage.inf +24 -0
  114. data/installed/temp.rb +1 -0
  115. data/lang/en/rwdcore/en.po +197 -0
  116. data/lang/en/rwdlanguage/en.po +32 -0
  117. data/lang/es/rwdcore/es.po +184 -0
  118. data/lang/es/rwdlanguage/en.po +32 -0
  119. data/lang/fr/rwdcore/fr.po +169 -0
  120. data/lang/fr/rwdlanguage/en.po +32 -0
  121. data/lang/hi/rwdcore/hi.po +173 -0
  122. data/lang/hi/rwdlanguage/en.po +32 -0
  123. data/lang/ja/rwdcore/ja.po +171 -0
  124. data/lang/ja/rwdlanguage/en.po +32 -0
  125. data/lang/nl/rwdcore/nl.po +169 -0
  126. data/lang/nl/rwdlanguage/en.po +32 -0
  127. data/lib/dict.rb +438 -0
  128. data/lib/g_translate.rb +43 -0
  129. data/lib/g_translate/client.rb +84 -0
  130. data/lib/g_translate/translator.rb +57 -0
  131. data/lib/ger-eng.txt +111283 -0
  132. data/lib/oothesaurus.rb +76 -0
  133. data/lib/rconftool.rb +387 -0
  134. data/lib/rwd/browser.rb +123 -0
  135. data/lib/rwd/ftools.rb +174 -0
  136. data/lib/rwd/mime.rb +328 -0
  137. data/lib/rwd/net.rb +877 -0
  138. data/lib/rwd/ruby.rb +889 -0
  139. data/lib/rwd/rwd.rb +1425 -0
  140. data/lib/rwd/sgml.rb +236 -0
  141. data/lib/rwd/thread.rb +63 -0
  142. data/lib/rwd/tree.rb +371 -0
  143. data/lib/rwd/xml.rb +101 -0
  144. data/lib/rwdthemes/default.rwd +317 -0
  145. data/lib/rwdthemes/pda.rwd +72 -0
  146. data/lib/rwdthemes/windowslike.rwd +171 -0
  147. data/lib/rwdtinker/rwdcodedir.rb +56 -0
  148. data/lib/rwdtinker/rwdguidir.rb +57 -0
  149. data/lib/rwdtinker/rwdlangdir.rb +60 -0
  150. data/lib/rwdtinker/rwdtinkertools.rb +25 -0
  151. data/lib/zip/ioextras.rb +155 -0
  152. data/lib/zip/stdrubyext.rb +111 -0
  153. data/lib/zip/tempfile_bugfixed.rb +195 -0
  154. data/lib/zip/zip.rb +1847 -0
  155. data/lib/zip/zipfilesystem.rb +609 -0
  156. data/lib/zip/ziprequire.rb +90 -0
  157. data/rwd_files/HowTo_Language.txt +179 -0
  158. data/rwd_files/HowTo_Tinker.txt +515 -0
  159. data/rwd_files/HowTo_TinkerWin2.txt +202 -0
  160. data/rwd_files/Readme.txt +57 -0
  161. data/rwd_files/RubyWebDialogs.html +6 -0
  162. data/rwd_files/Tinkerhelptexthash.txt +84 -0
  163. data/rwd_files/favicon.ico +0 -0
  164. data/rwd_files/log/rwdtinker.log +726 -0
  165. data/rwd_files/rdoc-style.css +175 -0
  166. data/rwd_files/rwdapplications.html +76 -0
  167. data/rwd_files/rwdlanguagehelpfiles.txt +34 -0
  168. data/rwd_files/tinker.png +0 -0
  169. data/rwdconfig.dist +24 -0
  170. data/rwdlanguage.rb +1 -0
  171. data/tests/RubyGauge.rb +179 -0
  172. data/tests/checkdepends.sh +4 -0
  173. data/tests/cleancnf.sh +6 -0
  174. data/tests/makedist-rwdwlanguage.rb +56 -0
  175. data/tests/makedist.rb +66 -0
  176. data/tests/rdep.rb +354 -0
  177. data/tests/totranslate.lang +93 -0
  178. data/zips/rwdwcalc-0.63.zip +0 -0
  179. data/zips/rwdwfoldeditor-0.08.zip +0 -0
  180. data/zips/rwdwhypernote-0.16.zip +0 -0
  181. data/zips/rwdwlanguage-0.01.zip +0 -0
  182. data/zips/rwdwmovies-0.98.zip +0 -0
  183. data/zips/rwdwruby-1.08.zip +0 -0
  184. data/zips/temp.rb +1 -0
  185. data/zips/tinkerbellw-0.04.zip +0 -0
  186. data/zips/wrubyslippers-1.08.zip +0 -0
  187. metadata +246 -0
@@ -0,0 +1,175 @@
1
+
2
+ body {
3
+ margin: 0;
4
+ padding: 0;
5
+ background: white;
6
+ }
7
+
8
+ h1,h2,h3,h4 { margin: 0; color: #efefef; background: transparent; }
9
+ h1 { font-size: 120%; }
10
+ h2,h3,h4 { margin-top: 1em; }
11
+
12
+ a { background: #eef; color: #039; text-decoration: none; }
13
+ a:hover { background: #039; color: #eef; }
14
+
15
+ /* Override the base stylesheet's Anchor inside a table cell */
16
+ td > a {
17
+ background: transparent;
18
+ color: #039;
19
+ text-decoration: none;
20
+ }
21
+
22
+ /* === Structural elements =================================== */
23
+
24
+ div#index {
25
+ margin: 0;
26
+ padding: 0;
27
+ font-size: 0.9em;
28
+ }
29
+
30
+ div#index a {
31
+ margin-left: 0.7em;
32
+ }
33
+
34
+ div#classHeader {
35
+ width: auto;
36
+ background: #039;
37
+ color: white;
38
+ padding: 0.5em 1.5em 0.5em 1.5em;
39
+ margin: 0;
40
+ border-bottom: 3px solid #006;
41
+ }
42
+
43
+ div#classHeader a {
44
+ background: inherit;
45
+ color: white;
46
+ }
47
+
48
+ div#classHeader td {
49
+ background: inherit;
50
+ color: white;
51
+ }
52
+
53
+ div#fileHeader {
54
+ width: auto;
55
+ background: #039;
56
+ color: white;
57
+ padding: 0.5em 1.5em 0.5em 1.5em;
58
+ margin: 0;
59
+ border-bottom: 3px solid #006;
60
+ }
61
+
62
+ div#fileHeader a {
63
+ background: inherit;
64
+ color: white;
65
+ }
66
+
67
+ div#fileHeader td {
68
+ background: inherit;
69
+ color: white;
70
+ }
71
+
72
+ div#bodyContent {
73
+ padding: 0 1.5em 0 1.5em;
74
+ }
75
+
76
+ div#description {
77
+ padding: 0.5em 1.5em;
78
+ background: #efefef;
79
+ border: 1px dotted #999;
80
+ }
81
+
82
+ div#description h1,h2,h3,h4,h5,h6 {
83
+ color: black;
84
+ background: transparent;
85
+ }
86
+
87
+ div#validator-badges {
88
+ text-align: center;
89
+ }
90
+ div#validator-badges img { border: 0; }
91
+
92
+ div#copyright {
93
+ color: #333;
94
+ background: #efefef;
95
+ font: 0.75em sans-serif;
96
+ margin-top: 5em;
97
+ margin-bottom: 0;
98
+ padding: 0.5em 2em;
99
+ }
100
+
101
+
102
+ /* === Classes =================================== */
103
+
104
+ table.header-table {
105
+ color: white;
106
+ font-size: small;
107
+ }
108
+
109
+ .type-note {
110
+ font-size: small;
111
+ color: #DEDEDE;
112
+ }
113
+
114
+ .section-bar {
115
+ background: #eee;
116
+ color: #333;
117
+ padding: 3px;
118
+ border: 1px solid #999;
119
+ }
120
+
121
+ .top-aligned-row { vertical-align: vertical-align: top }
122
+
123
+ /* --- Context section classes ----------------------- */
124
+
125
+ .context-row { }
126
+ .context-item-name { font-family: monospace; font-weight: bold; color: black; }
127
+ .context-item-value { font-size: x-small; color: #448; }
128
+ .context-item-desc { background: #efefef; }
129
+
130
+ /* --- Method classes -------------------------- */
131
+ .method-detail {
132
+ background: #EFEFEF;
133
+ padding: 0;
134
+ margin-top: 0.5em;
135
+ margin-bottom: 0.5em;
136
+ border: 1px dotted #DDD;
137
+ }
138
+ .method-heading {
139
+ color: black;
140
+ background: #AAA;
141
+ border-bottom: 1px solid #666;
142
+ padding: 0.2em 0.5em 0 0.5em;
143
+ }
144
+ .method-signature { color: black; background: inherit; }
145
+ .method-name { font-weight: bold; }
146
+ .method-args { font-style: italic; }
147
+ .method-description { padding: 0 0.5em 0 0.5em; }
148
+
149
+ /* --- Source code sections -------------------- */
150
+
151
+ a.source-toggle { font-size: 90%; }
152
+ div.method-source-code {
153
+ background: #262626;
154
+ color: #ffdead;
155
+ margin: 1em;
156
+ padding: 0.5em;
157
+ border: 1px dashed #999;
158
+ overflow: hidden;
159
+ }
160
+
161
+ div.method-source-code pre { color: #ffdead; overflow: hidden; }
162
+
163
+ /* --- Ruby keyword styles --------------------- */
164
+
165
+ .standalone-code { background: #221111; color: #ffdead; overflow: hidden; }
166
+
167
+ .ruby-constant { color: #7fffd4; background: transparent; }
168
+ .ruby-keyword { color: #00ffff; background: transparent; }
169
+ .ruby-ivar { color: #eedd82; background: transparent; }
170
+ .ruby-operator { color: #00ffee; background: transparent; }
171
+ .ruby-identifier { color: #ffdead; background: transparent; }
172
+ .ruby-node { color: #ffa07a; background: transparent; }
173
+ .ruby-comment { color: #b22222; font-weight: bold; background: transparent; }
174
+ .ruby-regexp { color: #ffa07a; background: transparent; }
175
+ .ruby-value { color: #7fffd4; background: transparent; }
@@ -0,0 +1,76 @@
1
+ <html>
2
+ <head>
3
+ <title>
4
+ rwdapplications information
5
+ </title>
6
+ </head>
7
+ <body>
8
+ <h1>
9
+ rwdapplications information (rwdshell)
10
+ </h1>
11
+ <br>
12
+ <h2>
13
+ Overview of the Project
14
+ </h2>
15
+ <h3><b>
16
+ RwdTinker framework for RubyWebDialogs</b>
17
+ <p>
18
+ RwdTinker is a web brower interface to and system for developing programs
19
+ <p>
20
+ Usage
21
+ <p>
22
+ How to Use the Tinker framework Program (rwdtinker)
23
+ <p>
24
+ 1. stand alone application 2. framework for building applications 3. Open brower windows with html documents
25
+ <p>
26
+ The GUI interface used is RubyWebDialogs The source code and the gui code are split into atomic parts and use init.rb to merge the parts together.
27
+ <p>
28
+ With the framework, we are able to ship a "plugin" or "applet" that can be dropped into a directory and installed automatically. Also uninstalled. I am calling this framework Tinker, so the core program I call rwdtinker. My wife, Charlotte. suggested the name. It relates to the "Tinker Toys" that has blocks and dowls and shapes that can be assembled by children and take different shapes. Without the word toy, it reminds us if the older English meaning of "a person who repairs pots and household devices by soldering and hammering.
29
+ <p>
30
+ The delivered applet is setup in the required directory structure with code configueration gui including help files location of documentation rwd_files = where documention for the applet can go. installed = a inf file that lists the manifest of files
31
+ <p>
32
+ This package is zipped up and uploaded as a file like rwdashedule-0.2.zip
33
+ <p>
34
+ The enduser who has the rwdtinker program drops the zip file into a directory called zips. I have parts of rwdtinker now (for Linux) that can install it automatically and remove it (based on the .inf file)
35
+ <h2>
36
+
37
+ Some additional programs in this series
38
+ </h2>
39
+ <br><blockquote>
40
+ rwdaddresses a little address book
41
+ <br><br>
42
+ rwdmovies a database for tracking your dvds and vhs movie collection
43
+ <br><br>
44
+
45
+ you can find these on rubyforge.org
46
+
47
+ </blockquote>
48
+ <br>
49
+
50
+ <br><blockquote>
51
+ Also look for a program called redpimp on rubyforge.org
52
+
53
+ <br><br>
54
+ It is planned to be a pim using RubyWebDialogs
55
+ <br><br>
56
+
57
+ you can find this at http://redpimp.rubyforge.org
58
+
59
+ </blockquote>
60
+ <br>
61
+
62
+
63
+ <br><br>
64
+ For more information see:<br>
65
+ <a href=http://rwdapplications.rubyforge.org/wiki/wiki.pl>http://rwdapplications.rubyforge.org/wiki/wiki.pl</a>
66
+ <br>
67
+ <br>
68
+ For more information about RubyWebDialogs see:<br>
69
+ <a href=http://www.erikveen.dds.nl/rubywebdialogs/index.html>http://www.erikveen.dds.nl/rubywebdialogs/index.html</a>
70
+ <br><br>
71
+ Thanks, Steven Gibson
72
+
73
+
74
+
75
+ </body>
76
+ </html>
@@ -0,0 +1,34 @@
1
+
2
+
3
+ Helptext.update( :rwdlanguage_generalhelp => "RwdLanguage
4
+ to look up words and meanings by computer
5
+ ")
6
+
7
+ Helptext.update( :googlewindow_help => "enter a phrase and it will query Google and return translations for:<br>
8
+ 'ar', 'zh', 'nl', 'fr', 'de', 'el', 'it', 'ja', 'ko',
9
+ 'pt', 'ru', 'es','hi','he'
10
+ ")
11
+
12
+ Helptext.update( :germandictlookup_help => "you can look up a word in the included geman-enlish dictionary<br>the DE <-> EN result means nothing found")
13
+
14
+ Helptext.update( :viewrwdlanguageconfiguration_help => "You can view or edit the configuration file here")
15
+
16
+ Helptext.update( :superantcomthesaurus_help => "This program is a thesaurus word search
17
+
18
+ If you have entered a word in this tab
19
+
20
+ You can search by clicking Display word results
21
+
22
+ This should search the thesaurus files you have set up and return a list of words on separate lines
23
+
24
+ You can click on one of those and it should be transfered to the search box, then click Display again
25
+
26
+ The words with bracketed comments won't be found, erase the bracketed part first
27
+
28
+ This uses the openoffice Thesaurus
29
+ make a link from the actual oo thesaurus files you use to rwd_files/idx and rwd_files/dat
30
+
31
+ "
32
+ )
33
+
34
+ Helptext.update( :sagdictlookup_help => "you can look up a word in the online English dictionary")
Binary file
data/rwdconfig.dist ADDED
@@ -0,0 +1,24 @@
1
+ ##VERSION: (1.85)
2
+ # rwdtinker core configuration file
3
+ ##NAME: (ConfigLocation):(1.78)
4
+ ConfigLocation=""
5
+ ##NAME: (ZipsLocation):(1.78)
6
+ ZipsLocation=""
7
+ ##NAME: ($testharnessarray):(1.78)
8
+ $testharnessarray = ["rwdtinker_all_tests"]
9
+ ##NAME: (TestNow):(1.78)
10
+ TestNow= false # turning this on will run the unit tests
11
+ ##NAME: ($testharness):(1.78)
12
+ $testharness=true
13
+ ##NAME: ($tinkerhelpaboutarray):(1.78)
14
+ $tinkerhelpaboutarray = ["Tinker"]
15
+ ##NAME: ($helptopicsarray):(1.78)
16
+ $helptopicsarray = [ "general_help","network_help"]
17
+ ##NAME: ($tinkerdocumentsarray):(1.78)
18
+ $tinkerdocumentsarray = ["HowTo_Tinker.txt" , "rwdapplications.html" , "RubyWebDialogs.html"]
19
+ ##NAME: (JumpLink):(1.78)
20
+ JumpLink = Hash.new { |hh, kk| hh[kk] = "ERROR: link not found: #{kk.inspect}."; hh[kk] }
21
+ ##NAME: ($rwdjumplink):(1.78)
22
+ $rwdjumplink = ["helpscreen", "tinkerbackwindow", "returntomain", "opendocuments", "editconfiguration"]
23
+ ##NAME: (TabHash):(1.85)
24
+ TabHash = Hash["selectiontab", "main"]
data/rwdlanguage.rb ADDED
@@ -0,0 +1 @@
1
+ # this file does nothing
@@ -0,0 +1,179 @@
1
+ #--------------------------------------------------------------------#
2
+ # #
3
+ # RubyGauge version 1 #
4
+ # Copyright (c) 2005, Harrison Ainsworth. #
5
+ # #
6
+ # http://hxa7241.org/ #
7
+ # #
8
+ #--------------------------------------------------------------------#
9
+
10
+
11
+
12
+
13
+ require 'find'
14
+
15
+
16
+
17
+
18
+ # Counts lines of code in ruby source files.
19
+ #
20
+ # just a simple example ruby program, produced as an exercise.
21
+ #
22
+ # * directories are looked in recursively for source files
23
+ # * source files with the following name extensions are recognized:
24
+ # .rb .rbw
25
+ # * a line is counted as code if it is not empty and not solely comment
26
+ #
27
+ # == requirements
28
+ # ruby 1.8
29
+ #
30
+ # == usage
31
+ # RubyGauge.rb [-f...] (file|directory)pathname ...
32
+ # RubyGauge.rb -help|-?
33
+ #
34
+ # switches:
35
+ # -f<[l|s][1|2]> set output format to long/short, linecount only /
36
+ # linecount and filecount (defaults to -fl2)
37
+ # -help|-? prints this message
38
+ #
39
+ # ==acknowledgements
40
+ # * ruby: http://ruby-lang.org/
41
+ # * the pragmaticprogrammers pickaxe book:
42
+ # http://phrogz.net/ProgrammingRuby/
43
+ # * rubygarden: http://rubygarden.org/ruby?CodingInRuby
44
+ #
45
+ # == license
46
+ # this software is too short and insignificant to have a license.
47
+
48
+ module RubyGauge
49
+
50
+ # Entry point if run from the command line.
51
+ #
52
+ # Reads command line args, writes output to stdout.
53
+ #
54
+ def RubyGauge.main
55
+
56
+ # check if help message needed
57
+ if $*.empty? || !(RubyGauge.getSwitchs( $*, '(help|\?)' ).empty?)
58
+
59
+ puts "\n#{@@BANNER}\n#{@@HELP}"
60
+
61
+ else
62
+
63
+ # count
64
+ pathnames = RubyGauge.getTokens( $*, '^[^-\/]', ' ' )
65
+
66
+ fileCount = []
67
+ lineCount = RubyGauge.countLinesInFileTree( pathnames, fileCount )
68
+
69
+ # output counts
70
+ format = RubyGauge.getSwitchs( $*, 'f', '-fl2' ).last[2,2]
71
+
72
+ (@@LINES_FORMAT = { 's' => "#{lineCount}" }).default = "\n #{lineCount} line#{lineCount == 1 ? '' : 's'} of code\n"
73
+ (@@FILES_FORMAT = { 's' => " #{fileCount}" }).default = " #{fileCount[0]} file#{fileCount[0] == 1 ? '' : 's'}\n"
74
+ print @@LINES_FORMAT[format[0,1]]
75
+ print @@FILES_FORMAT[format[0,1]] unless format[1,1] == '1'
76
+
77
+ end
78
+
79
+ end
80
+
81
+
82
+ def RubyGauge.getSwitchs( commandline, pattern, default=nil )
83
+
84
+ RubyGauge.getTokens( commandline, '^(-|\/)' + pattern, default )
85
+
86
+ end
87
+
88
+
89
+ def RubyGauge.getTokens( commandline, pattern, default=nil )
90
+
91
+ tokens = []
92
+
93
+ commandline.each do |token|
94
+ if token =~ /#{pattern}/
95
+ tokens.push token
96
+ end
97
+ end
98
+
99
+ if tokens.empty? && default
100
+ tokens.push default
101
+ end
102
+
103
+ tokens
104
+
105
+ end
106
+
107
+
108
+ # Counts lines of ruby code in filetree recursively.
109
+ #
110
+ # A line is counted as code if it is not empty and not solely comment.
111
+ #
112
+ # == parameters
113
+ # * pathnames: Array of String of file or directory pathname
114
+ # (relative or absolute)
115
+ # * fileCount: Array of Numeric, length 1. Just an example of a
116
+ # 'reference' parameter
117
+ # * return: Fixnum of the line count
118
+ #
119
+ def RubyGauge.countLinesInFileTree( pathnames, fileCount=[] )
120
+
121
+ fileCount[0] = 0
122
+ lineCount = 0
123
+
124
+ # scan directory tree
125
+ Find.find( *pathnames ) do |fileOrDirName|
126
+
127
+ # filter file types (to ruby)
128
+ if FileTest.file?( fileOrDirName ) &&
129
+ FileTest.readable?( fileOrDirName ) &&
130
+ fileOrDirName =~ /\.(rb|rbw)\Z/
131
+
132
+ fileCount[0] += 1
133
+
134
+ filePathname = File.expand_path( fileOrDirName )
135
+
136
+ # read file
137
+ File.open( filePathname, 'r' ) do |file|
138
+
139
+ # scan file lines
140
+ file.each_line do |line|
141
+ # select non blank, non comment-only line
142
+ unless line =~ /^\s*(#|\Z)/
143
+ lineCount += 1
144
+ end
145
+ end
146
+
147
+ end
148
+
149
+ end
150
+ end
151
+
152
+ lineCount
153
+
154
+ end
155
+
156
+
157
+ @@BANNER = "-------------------------------------------------------------\n" +
158
+ "RubyGauge 2005 (v1)\n" +
159
+ "Copyright (c) 2005, Harrison Ainsworth.\n\n" +
160
+ "http://hxa7241.org/\n" +
161
+ "-------------------------------------------------------------\n"
162
+
163
+ @@HELP = "RubyGauge counts lines of code in ruby source files.\n\n" +
164
+ "* directories are looked in recursively for source files\n" +
165
+ "* source files with the following name extensions are recognized: .rb .rbw\n" +
166
+ "* a line is counted as code if it is not empty and not solely comment\n" +
167
+ "\nusage:\n" +
168
+ " RubyGauge.rb [-f...] (file|directory)pathname ...\n" +
169
+ " RubyGauge.rb -help|-?\n" +
170
+ "\nswitches:\n" +
171
+ " -f<[l|s][1|2]> set output format to long/short, linecount only / linecount and filecount (defaults to -fl2)\n" +
172
+ " -help|-? prints this message\n"
173
+
174
+ end
175
+
176
+
177
+
178
+
179
+ RubyGauge.main