gonzui 1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (116) hide show
  1. data/AUTHORS.txt +9 -0
  2. data/History.txt +5539 -0
  3. data/Manifest.txt +115 -0
  4. data/PostInstall.txt +17 -0
  5. data/README.rdoc +149 -0
  6. data/Rakefile +28 -0
  7. data/bin/gonzui-db +167 -0
  8. data/bin/gonzui-import +177 -0
  9. data/bin/gonzui-remove +58 -0
  10. data/bin/gonzui-search +68 -0
  11. data/bin/gonzui-server +176 -0
  12. data/bin/gonzui-update +53 -0
  13. data/data/gonzui/catalog/catalog.ja +80 -0
  14. data/data/gonzui/doc/favicon.ico +0 -0
  15. data/data/gonzui/doc/folder.png +0 -0
  16. data/data/gonzui/doc/gonzui.css +279 -0
  17. data/data/gonzui/doc/gonzui.js +111 -0
  18. data/data/gonzui/doc/text.png +0 -0
  19. data/data/gonzuirc.sample +29 -0
  20. data/ext/autopack/autopack.c +88 -0
  21. data/ext/autopack/extconf.rb +3 -0
  22. data/ext/delta/delta.c +147 -0
  23. data/ext/delta/extconf.rb +5 -0
  24. data/ext/texttokenizer/extconf.rb +5 -0
  25. data/ext/texttokenizer/texttokenizer.c +93 -0
  26. data/ext/xmlformatter/extconf.rb +5 -0
  27. data/ext/xmlformatter/xmlformatter.c +207 -0
  28. data/lib/gonzui.rb +59 -0
  29. data/lib/gonzui/apt.rb +193 -0
  30. data/lib/gonzui/bdbdbm.rb +118 -0
  31. data/lib/gonzui/cmdapp.rb +14 -0
  32. data/lib/gonzui/cmdapp/app.rb +175 -0
  33. data/lib/gonzui/cmdapp/search.rb +134 -0
  34. data/lib/gonzui/config.rb +117 -0
  35. data/lib/gonzui/content.rb +19 -0
  36. data/lib/gonzui/dbm.rb +673 -0
  37. data/lib/gonzui/deindexer.rb +162 -0
  38. data/lib/gonzui/delta.rb +49 -0
  39. data/lib/gonzui/extractor.rb +347 -0
  40. data/lib/gonzui/fetcher.rb +309 -0
  41. data/lib/gonzui/gettext.rb +144 -0
  42. data/lib/gonzui/importer.rb +84 -0
  43. data/lib/gonzui/indexer.rb +316 -0
  44. data/lib/gonzui/info.rb +80 -0
  45. data/lib/gonzui/license.rb +100 -0
  46. data/lib/gonzui/logger.rb +48 -0
  47. data/lib/gonzui/monitor.rb +177 -0
  48. data/lib/gonzui/progressbar.rb +235 -0
  49. data/lib/gonzui/remover.rb +38 -0
  50. data/lib/gonzui/searcher.rb +330 -0
  51. data/lib/gonzui/searchquery.rb +235 -0
  52. data/lib/gonzui/searchresult.rb +111 -0
  53. data/lib/gonzui/updater.rb +254 -0
  54. data/lib/gonzui/util.rb +415 -0
  55. data/lib/gonzui/vcs.rb +128 -0
  56. data/lib/gonzui/webapp.rb +25 -0
  57. data/lib/gonzui/webapp/advsearch.rb +123 -0
  58. data/lib/gonzui/webapp/filehandler.rb +24 -0
  59. data/lib/gonzui/webapp/jsfeed.rb +61 -0
  60. data/lib/gonzui/webapp/markup.rb +445 -0
  61. data/lib/gonzui/webapp/search.rb +269 -0
  62. data/lib/gonzui/webapp/servlet.rb +319 -0
  63. data/lib/gonzui/webapp/snippet.rb +155 -0
  64. data/lib/gonzui/webapp/source.rb +37 -0
  65. data/lib/gonzui/webapp/stat.rb +137 -0
  66. data/lib/gonzui/webapp/top.rb +63 -0
  67. data/lib/gonzui/webapp/uri.rb +140 -0
  68. data/lib/gonzui/webapp/webrick.rb +48 -0
  69. data/script/console +10 -0
  70. data/script/destroy +14 -0
  71. data/script/generate +14 -0
  72. data/script/makemanifest.rb +21 -0
  73. data/tasks/extconf.rake +13 -0
  74. data/tasks/extconf/autopack.rake +43 -0
  75. data/tasks/extconf/delta.rake +43 -0
  76. data/tasks/extconf/texttokenizer.rake +43 -0
  77. data/tasks/extconf/xmlformatter.rake +43 -0
  78. data/test/_external_tools.rb +13 -0
  79. data/test/_test-util.rb +142 -0
  80. data/test/foo/Makefile.foo +66 -0
  81. data/test/foo/bar.c +5 -0
  82. data/test/foo/bar.h +6 -0
  83. data/test/foo/foo.c +25 -0
  84. data/test/foo/foo.spec +33 -0
  85. data/test/test_apt.rb +42 -0
  86. data/test/test_autopack_extn.rb +7 -0
  87. data/test/test_bdbdbm.rb +79 -0
  88. data/test/test_cmdapp-app.rb +35 -0
  89. data/test/test_cmdapp-search.rb +99 -0
  90. data/test/test_config.rb +28 -0
  91. data/test/test_content.rb +15 -0
  92. data/test/test_dbm.rb +171 -0
  93. data/test/test_deindexer.rb +50 -0
  94. data/test/test_delta.rb +66 -0
  95. data/test/test_extractor.rb +78 -0
  96. data/test/test_fetcher.rb +75 -0
  97. data/test/test_gettext.rb +50 -0
  98. data/test/test_gonzui.rb +11 -0
  99. data/test/test_helper.rb +10 -0
  100. data/test/test_importer.rb +56 -0
  101. data/test/test_indexer.rb +37 -0
  102. data/test/test_info.rb +82 -0
  103. data/test/test_license.rb +49 -0
  104. data/test/test_logger.rb +60 -0
  105. data/test/test_monitor.rb +23 -0
  106. data/test/test_searcher.rb +37 -0
  107. data/test/test_searchquery.rb +27 -0
  108. data/test/test_searchresult.rb +43 -0
  109. data/test/test_texttokenizer.rb +47 -0
  110. data/test/test_updater.rb +95 -0
  111. data/test/test_util.rb +149 -0
  112. data/test/test_vcs.rb +61 -0
  113. data/test/test_webapp-markup.rb +42 -0
  114. data/test/test_webapp-util.rb +19 -0
  115. data/test/test_webapp-xmlformatter.rb +19 -0
  116. metadata +291 -0
@@ -0,0 +1,53 @@
1
+ #!/usr/bin/evn ruby
2
+ #
3
+ # gonzui-update - a tool to remove contents from a gonzui DB
4
+ #
5
+ # Copyright (C) 2004-2005 Satoru Takabayashi <satoru@namazu.org>
6
+ # All rights reserved.
7
+ # This is free software with ABSOLUTELY NO WARRANTY.
8
+ #
9
+ # You can redistribute it and/or modify it under the terms of
10
+ # the GNU General Public License version 2.
11
+ #
12
+
13
+ # %LOADPATH%
14
+ require 'getoptlong'
15
+ require 'gonzui'
16
+ require 'gonzui/cmdapp'
17
+
18
+ include Gonzui
19
+ include Gonzui::Util
20
+
21
+ class GonzuiUpdate < Gonzui::CommandLineApplication
22
+ def do_show_usage
23
+ puts "Usage: #{program_name} [OPTION]"
24
+ end
25
+
26
+ def do_get_option_table
27
+ []
28
+ end
29
+
30
+ def do_process_options(options)
31
+ end
32
+
33
+ def do_start
34
+ parse_options()
35
+ ensure_db_directory_available
36
+ init_logger
37
+
38
+ show_progress = if @config.quiet then false else true end
39
+ updater = Updater.new(@config, :show_progress => show_progress)
40
+ begin
41
+ updater.update {|package_name|
42
+ @logger.log("updated %s", package_name)
43
+ }
44
+ print updater.summary
45
+ rescue GonzuiError => e
46
+ wprintf("%s", e.message)
47
+ ensure
48
+ updater.finish
49
+ end
50
+ end
51
+ end
52
+
53
+ GonzuiUpdate.start
@@ -0,0 +1,80 @@
1
+ # -*- mode: ruby -*-
2
+ {
3
+ " contents." => " コンテンツ",
4
+ " for " => " 件) ",
5
+ " of " => " (全 ",
6
+ " seconds)" => " 秒)",
7
+ "No contents were found matching %s" => "%s に対応するコンテンツが見つかりませんでした。",
8
+ "." => " 件)",
9
+ "About gonzui" => "gonzuiについて",
10
+ "Advanced Search" => "高度な検索",
11
+ "All" => "すべて",
12
+ "Contents" => "コンテンツ",
13
+ "Frequency" => "出現頻度",
14
+ "Function Call" => "関数呼出",
15
+ "Function Declaration" => "関数宣言",
16
+ "Function Definition" => "関数定義",
17
+ "Function Name" => "関数名",
18
+ "Function Popularity" => "関数ランキング",
19
+ "Function" => "関数",
20
+ "Google it" => "Google する",
21
+ "Search this content: " => "コンテンツ内検索: ",
22
+ "Format: " => "フォーマット: ",
23
+ "Formats" => "フォーマット",
24
+ "Lines of Indexed Contents" => "検索可能なコンテンツの行",
25
+ "List of Packages" => "パッケージ一覧",
26
+ "List of all packages" => "全パッケージ一覧",
27
+ "More results from %s" => "%s 内の検索結果",
28
+ "Overview" => "概要",
29
+ "Packages " => "パッケージ ",
30
+ "Packages" => "パッケージ",
31
+ "Rank" => "順位",
32
+ "Results " => "検索結果 ",
33
+ "Search" => "検索",
34
+ "Indexed Keys" => "検索可能キーワード",
35
+ "Searching %s packages of %s contents" => "%s パッケージ %s コンテンツから検索",
36
+ "Size: %s (%s lines)" => "サイズ: %s (%s 行)",
37
+ "Contents by Format" => "フォーマット別コンテンツ",
38
+ "Indexed Contents" => "検索可能コンテンツ",
39
+ "Binary Contents" => "バイナリコンテンツ",
40
+ "Statistics" => "統計情報",
41
+ "Statistics" => "統計情報",
42
+ "Top Functions" => "関数ランキング",
43
+ "No contents were found matching your search - %s." =>
44
+ "「%s」にマッチするコンテンツは見つかりませんでした。",
45
+ "bare source" => "生のソース",
46
+ "next" => "次",
47
+ "prev" => "前",
48
+ "permlink" => "固定リンク",
49
+ "Class Definition" => "クラス定義",
50
+ "Class Reference" => "クラス参照",
51
+ "Constant" => "定数",
52
+ "Floating" => "実数",
53
+ "Identifier" => "識別子",
54
+ "Integer" => "整数",
55
+ "Keyword" => "キーワード",
56
+ "Literal" => "リテラル",
57
+ "Module Definition" => "モジュール定義",
58
+ "Object" => "オブジェクト",
59
+ "Primitive Type" => "組込み型",
60
+ "String" => "文字列",
61
+ "Symbol" => "シンボル",
62
+ "Character" => "文字",
63
+ "Find" => "検索",
64
+ "Target" => "種類",
65
+ "Format" => "フォーマット",
66
+ "Phrase" => "フレーズ",
67
+ " - %s - %s lines" => " - %s - %s行",
68
+ "Comment" => "コメント",
69
+ "package: duplicated." => "package: が重複しています。",
70
+ "path: duplicated." => "path: が重複しています。",
71
+ "package: and path: cannot be specified together." =>
72
+ "package: と path: は同時に指定できません。",
73
+ "\"%s\" (and any subsequent words) was ignored because queries are limited to %d words." =>
74
+ "検索が %2$d 語に制限されているため、\"%1$s\" とその後の語句は無効です。",
75
+ "%d results" => "%d 件",
76
+ "Word" => "ワード",
77
+ "Imaginary" => "虚数",
78
+ "Text" => "テキスト",
79
+ "License" => "ライセンス",
80
+ }
@@ -0,0 +1,279 @@
1
+ a {
2
+ text-decoration: none;
3
+ }
4
+
5
+ a:active, a:focus, a:hover {
6
+ text-decoration: underline;
7
+ }
8
+
9
+ a.directory {
10
+ font-weight: bold;
11
+ }
12
+
13
+ a.file {
14
+ }
15
+
16
+ a.more {
17
+ font-size: smaller;
18
+ text-decoration: none;
19
+ color: gray;
20
+ }
21
+
22
+ a img {
23
+ border-style: none;
24
+ }
25
+
26
+ body {
27
+ font-family: 'Lucida Sans Unicode', Verdana, sans-serif;
28
+ margin: 2em;
29
+ line-height: 150%;
30
+ background-color: white;
31
+ }
32
+
33
+ div.bar {
34
+ border-style: solid;
35
+ border-width: 0 1px 1px 0;
36
+ border-color: #aaf;
37
+ background-color: #77f;
38
+ font-size: 5px; /* for IE */
39
+ height: 9px;
40
+ }
41
+
42
+ div.center {
43
+ text-align: center;
44
+ }
45
+
46
+ div.message {
47
+ margin-left: 2em;
48
+ margin-top: 1em;
49
+ }
50
+
51
+ div.notice {
52
+ color: gray;
53
+ font-size: small;
54
+ margin-bottom: 0.5em;
55
+ }
56
+
57
+ div.separator {
58
+ border-style: dotted;
59
+ border-width: 1px 0 0 0;
60
+ border-color: gray;
61
+ margin: 0.4em 0 0.4em 0;
62
+ }
63
+
64
+ div.footer {
65
+ text-align: center;
66
+ margin-top: 3em;
67
+ font-size: smaller;
68
+ line-height: 200%;
69
+ }
70
+
71
+ div.image {
72
+ text-align: center;
73
+ margin-top: 1.5em;
74
+ }
75
+
76
+ div.navi {
77
+ text-align: center;
78
+ margin-top: 3em;
79
+ }
80
+
81
+ div.advanced-search {
82
+ border-color: gray;
83
+ border-style: solid;
84
+ border-width: 1px 0 1px 0;
85
+ margin: 0
86
+ }
87
+
88
+ div.advanced-search form {
89
+ padding: 10px;
90
+ margin: 0;
91
+ }
92
+
93
+ div.isearch {
94
+ text-align: right;
95
+ border-color: gray;
96
+ border-style: solid;
97
+ border-width: 1px 0 1px 0;
98
+ padding: 6px 6px 4px 6px;
99
+ }
100
+
101
+ div.isearch p, div.isearch form {
102
+ margin: 0;
103
+ }
104
+
105
+ dt.package {
106
+ font-weight: bold;
107
+ }
108
+
109
+ dt.source {
110
+ text-indent: 1.5em;
111
+ }
112
+
113
+ form {
114
+ font-size: smaller;
115
+ }
116
+
117
+ h1 a {
118
+ color: black;
119
+ text-decoration: none;
120
+ }
121
+
122
+ table.status {
123
+ font-size: medium;
124
+ border-style: solid;
125
+ border-width: 1px 0 0 0;
126
+ border-color: black;
127
+ background-color: #e4e4e4;
128
+ padding-left: 2px;
129
+ width: 100%;
130
+ }
131
+
132
+ pre {
133
+ font-size: smaller;
134
+ line-height: 120%;
135
+ font-family: 'Lucida Console', 'Courier',
136
+ 'Courier New', monospace;
137
+ }
138
+
139
+ pre.lines {
140
+ margin-top: 2px;
141
+ border-style: solid;
142
+ border-width: 1px;
143
+ border-color: gray;
144
+ padding: 0.4em;
145
+ margin-bottom: 0;
146
+ }
147
+
148
+ pre.lines strong {
149
+ background-color: #ffff88;
150
+ }
151
+
152
+ span.classdef, span.moduledef {
153
+ color: #44aa44;
154
+ font-weight: bold;
155
+ }
156
+
157
+ span.const {
158
+ color: #44aa44;
159
+ }
160
+
161
+ span.comment {
162
+ color: gray;
163
+ }
164
+
165
+ span.keyword {
166
+ color: #8800cc;
167
+ }
168
+
169
+ span.size {
170
+ font-size: smaller;
171
+ color: gray;
172
+ }
173
+
174
+ span.string, span.character {
175
+ color: #888800;
176
+ }
177
+
178
+ span.symbol {
179
+ color: #ff6666;
180
+ }
181
+
182
+ span.type {
183
+ color: #44aa44;
184
+ }
185
+
186
+ span.lineno, span.lineno a {
187
+ color: gray;
188
+ text-decoration: none;
189
+ }
190
+
191
+ span.lineno a:hover {
192
+ text-decoration: underline;
193
+ }
194
+
195
+ span.spacer {
196
+ padding-left: 0.5em;
197
+ padding-right: 0.5em;
198
+ }
199
+
200
+ strong.highlight {
201
+ background-color: #ffff88;
202
+ }
203
+
204
+ table.fullwidth {
205
+ width: 100%;
206
+ border-color: black;
207
+ border-collapse: collapse;
208
+ border-style: solid;
209
+ border-width: 1px 0 1px 0;
210
+ margin-bottom: 2em;
211
+ }
212
+
213
+ table.fullwidth td {
214
+ padding: 2px 8px 2px 8px;
215
+ border-color: #888;
216
+ }
217
+
218
+ table.item td {
219
+ padding: 0 1px 0 1px;
220
+ }
221
+
222
+ table.status td.center {
223
+ text-align: left;
224
+ font-size: smaller;
225
+ }
226
+
227
+ table.status td.left {
228
+ font-weight: bold;
229
+ }
230
+
231
+ table.status td.right {
232
+ text-align: right;
233
+ font-size: smaller;
234
+ }
235
+
236
+ td.first-center {
237
+ text-align: center;
238
+ }
239
+
240
+ td.function {
241
+ width: auto;
242
+ }
243
+
244
+ td.nonfirst, td.nonfirst-center, td.nonfirst-right {
245
+ border-style: solid;
246
+ border-width: 0 0 0 1px;
247
+ }
248
+
249
+ td.nonfirst-right {
250
+ text-align: right;
251
+ }
252
+
253
+ td.nonfirst-center {
254
+ text-align: center;
255
+ }
256
+
257
+ tr.even {
258
+ background-color: #e8ffd8;
259
+ }
260
+
261
+ tr.heading {
262
+ background-color: #ffeeee;
263
+ font-weight: bold;
264
+ }
265
+
266
+ tr.heading td.first,
267
+ tr.heading td.first-center
268
+ {
269
+ border-style: solid;
270
+ border-width: 0 0 1px 0px;
271
+ }
272
+
273
+ tr.heading td.nonfirst,
274
+ tr.heading td.nonfirst-center
275
+ {
276
+ border-style: solid;
277
+ border-width: 0 0 1px 1px;
278
+ }
279
+
@@ -0,0 +1,111 @@
1
+ // -*- mode: c -*-
2
+ var highlightColor = "#ffff88";
3
+ var backgroundColor = "white";
4
+ var lineCache;
5
+ var classCache;
6
+ var previousId;
7
+ var previousLineNo;
8
+
9
+ function initCache () {
10
+ spanCache = document.getElementsByTagName("span");
11
+ lineCache = new Array();
12
+ classCache = new Array();
13
+
14
+ var length = spanCache.length;
15
+ for (var i = 0; i < length; i++) {
16
+ var e = spanCache[i];
17
+
18
+ // build lineCache
19
+ if (e.className == "line") {
20
+ lineCache.push(e, e.title);
21
+ }
22
+
23
+ // build classCache
24
+ // Use "className" because IE doesn't allow duplicated "id"s.
25
+ var id = e.className;
26
+ if (id) {
27
+ if (!classCache[id]) {
28
+ classCache[id] = new Array();
29
+ }
30
+ classCache[id].push(e);
31
+ }
32
+ }
33
+ }
34
+
35
+ function setHighlight (id, color) {
36
+ var elements = classCache[id];
37
+ var length = elements.length;
38
+ for (var i = 0; i < length; i++) {
39
+ var e = elements[i];
40
+ e.style.backgroundColor = color;
41
+ }
42
+ }
43
+
44
+ function clearHighlight () {
45
+ if (previousId)
46
+ setHighlight(previousId, backgroundColor);
47
+ }
48
+
49
+ function highlight (id) {
50
+ clearHighlight();
51
+ setHighlight(id, highlightColor);
52
+ previousId = id;
53
+ return true;
54
+ }
55
+
56
+ function quotemeta (string) {
57
+ return string.replace(/(\W)/, "\\$1");
58
+ }
59
+
60
+ function isearch (string) {
61
+ var pattern = new RegExp(quotemeta(string), "i");
62
+ var length = lineCache.length;
63
+ for (var i = 0; i < length; i += 2) {
64
+ var e = lineCache[i];
65
+ var title = lineCache[i + 1];
66
+ if (title.match(pattern)) {
67
+ e.style.display = "inline";
68
+ } else {
69
+ e.style.display = "none";
70
+ }
71
+ }
72
+ }
73
+
74
+ function onLineNoClick (e) {
75
+ if (previousLineNo)
76
+ previousLineNo.style.backgroundColor = backgroundColor;
77
+ e.style.backgroundColor = highlightColor;
78
+ previousLineNo = e;
79
+ var length = lineCache.length;
80
+ for (var i = 0; i < length; i += 2) {
81
+ var e = lineCache[i];
82
+ e.style.display = "inline";
83
+ }
84
+ }
85
+
86
+ function passQuery (e) {
87
+ q = document.getElementsByName("q")[0].value;
88
+ if (q) {
89
+ e.href += "?q=" + encodeURIComponent(q) ;
90
+ }
91
+ return true;
92
+ }
93
+
94
+ function initFocus () {
95
+ q = document.getElementsByName("q")[0];
96
+ if (q) {
97
+ q.focus();
98
+ }
99
+ }
100
+
101
+ //
102
+ // aliases
103
+ //
104
+ function hl (id) {
105
+ highlight(id);
106
+ }
107
+
108
+ function olnc (e) {
109
+ onLineNoClick(e);
110
+ }
111
+