bitclust-core 0.5.0

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.
Files changed (127) hide show
  1. data/ChangeLog +2907 -0
  2. data/Gemfile +7 -0
  3. data/README +21 -0
  4. data/Rakefile +20 -0
  5. data/bin/bitclust +14 -0
  6. data/bin/refe +36 -0
  7. data/bitclust-dev.gemspec +33 -0
  8. data/bitclust.gemspec +30 -0
  9. data/config.in +23 -0
  10. data/config.ru +48 -0
  11. data/config.ru.sample +31 -0
  12. data/data/bitclust/catalog/ja_JP.EUC-JP +78 -0
  13. data/data/bitclust/catalog/ja_JP.UTF-8 +78 -0
  14. data/data/bitclust/template.lillia/class +98 -0
  15. data/data/bitclust/template.lillia/class-index +28 -0
  16. data/data/bitclust/template.lillia/doc +48 -0
  17. data/data/bitclust/template.lillia/layout +19 -0
  18. data/data/bitclust/template.lillia/library +129 -0
  19. data/data/bitclust/template.lillia/library-index +32 -0
  20. data/data/bitclust/template.lillia/method +20 -0
  21. data/data/bitclust/template.lillia/rd_file +6 -0
  22. data/data/bitclust/template.offline/class +67 -0
  23. data/data/bitclust/template.offline/class-index +28 -0
  24. data/data/bitclust/template.offline/doc +13 -0
  25. data/data/bitclust/template.offline/function +22 -0
  26. data/data/bitclust/template.offline/function-index +24 -0
  27. data/data/bitclust/template.offline/layout +18 -0
  28. data/data/bitclust/template.offline/library +87 -0
  29. data/data/bitclust/template.offline/library-index +32 -0
  30. data/data/bitclust/template.offline/method +21 -0
  31. data/data/bitclust/template.offline/rd_file +6 -0
  32. data/data/bitclust/template/class +133 -0
  33. data/data/bitclust/template/class-index +30 -0
  34. data/data/bitclust/template/doc +14 -0
  35. data/data/bitclust/template/function +21 -0
  36. data/data/bitclust/template/function-index +25 -0
  37. data/data/bitclust/template/layout +19 -0
  38. data/data/bitclust/template/library +89 -0
  39. data/data/bitclust/template/library-index +35 -0
  40. data/data/bitclust/template/method +24 -0
  41. data/data/bitclust/template/opensearchdescription +10 -0
  42. data/data/bitclust/template/search +57 -0
  43. data/lib/bitclust.rb +9 -0
  44. data/lib/bitclust/app.rb +129 -0
  45. data/lib/bitclust/classentry.rb +425 -0
  46. data/lib/bitclust/compat.rb +39 -0
  47. data/lib/bitclust/completion.rb +531 -0
  48. data/lib/bitclust/crossrubyutils.rb +91 -0
  49. data/lib/bitclust/database.rb +181 -0
  50. data/lib/bitclust/docentry.rb +83 -0
  51. data/lib/bitclust/entry.rb +223 -0
  52. data/lib/bitclust/exception.rb +38 -0
  53. data/lib/bitclust/functiondatabase.rb +115 -0
  54. data/lib/bitclust/functionentry.rb +81 -0
  55. data/lib/bitclust/functionreferenceparser.rb +76 -0
  56. data/lib/bitclust/htmlutils.rb +80 -0
  57. data/lib/bitclust/interface.rb +87 -0
  58. data/lib/bitclust/libraryentry.rb +211 -0
  59. data/lib/bitclust/lineinput.rb +165 -0
  60. data/lib/bitclust/messagecatalog.rb +95 -0
  61. data/lib/bitclust/methoddatabase.rb +401 -0
  62. data/lib/bitclust/methodentry.rb +202 -0
  63. data/lib/bitclust/methodid.rb +209 -0
  64. data/lib/bitclust/methodsignature.rb +82 -0
  65. data/lib/bitclust/nameutils.rb +236 -0
  66. data/lib/bitclust/parseutils.rb +60 -0
  67. data/lib/bitclust/preprocessor.rb +273 -0
  68. data/lib/bitclust/rdcompiler.rb +507 -0
  69. data/lib/bitclust/refsdatabase.rb +66 -0
  70. data/lib/bitclust/requesthandler.rb +330 -0
  71. data/lib/bitclust/ridatabase.rb +349 -0
  72. data/lib/bitclust/rrdparser.rb +522 -0
  73. data/lib/bitclust/runner.rb +143 -0
  74. data/lib/bitclust/screen.rb +554 -0
  75. data/lib/bitclust/searcher.rb +518 -0
  76. data/lib/bitclust/server.rb +59 -0
  77. data/lib/bitclust/simplesearcher.rb +84 -0
  78. data/lib/bitclust/subcommand.rb +746 -0
  79. data/lib/bitclust/textutils.rb +51 -0
  80. data/lib/bitclust/version.rb +3 -0
  81. data/packer.rb +224 -0
  82. data/refe2.gemspec +29 -0
  83. data/server.exe +0 -0
  84. data/server.exy +159 -0
  85. data/server.rb +10 -0
  86. data/setup.rb +1596 -0
  87. data/standalone.rb +193 -0
  88. data/test/run_test.rb +15 -0
  89. data/test/test_bitclust.rb +81 -0
  90. data/test/test_entry.rb +39 -0
  91. data/test/test_functiondatabase.rb +55 -0
  92. data/test/test_libraryentry.rb +31 -0
  93. data/test/test_methoddatabase.rb +81 -0
  94. data/test/test_methodsignature.rb +14 -0
  95. data/test/test_nameutils.rb +324 -0
  96. data/test/test_preprocessor.rb +84 -0
  97. data/test/test_rdcompiler.rb +534 -0
  98. data/test/test_refsdatabase.rb +76 -0
  99. data/test/test_rrdparser.rb +26 -0
  100. data/test/test_runner.rb +102 -0
  101. data/test/test_simplesearcher.rb +48 -0
  102. data/theme/default/images/external.png +0 -0
  103. data/theme/default/rurema.png +0 -0
  104. data/theme/default/style.css +288 -0
  105. data/theme/default/test.css +254 -0
  106. data/theme/lillia/rurema.png +0 -0
  107. data/theme/lillia/style.css +331 -0
  108. data/theme/lillia/test.css +254 -0
  109. data/tools/bc-ancestors.rb +153 -0
  110. data/tools/bc-checkparams.rb +246 -0
  111. data/tools/bc-classes.rb +80 -0
  112. data/tools/bc-convert.rb +165 -0
  113. data/tools/bc-list.rb +63 -0
  114. data/tools/bc-methods.rb +171 -0
  115. data/tools/bc-preproc.rb +42 -0
  116. data/tools/bc-rdoc.rb +343 -0
  117. data/tools/bc-tochm.rb +301 -0
  118. data/tools/bc-tohtml.rb +125 -0
  119. data/tools/bc-tohtmlpackage.rb +241 -0
  120. data/tools/check-signature.rb +19 -0
  121. data/tools/forall-ruby.rb +20 -0
  122. data/tools/gencatalog.rb +69 -0
  123. data/tools/statrefm.rb +98 -0
  124. data/tools/stattodo.rb +150 -0
  125. data/tools/update-database.rb +146 -0
  126. data/view.cgi +6 -0
  127. metadata +222 -0
@@ -0,0 +1,28 @@
1
+ <% @title = _('Class Index') %>
2
+ <p>
3
+ <%= manual_home_link() %>
4
+ &gt; <%= _('All Classes') %>
5
+ </p>
6
+ <%
7
+ headline_init
8
+ %>
9
+ <%= headline(_("Class Index")) %>
10
+ <p>
11
+ <%= @entries.size %> classes/modules in database
12
+ </p>
13
+ <%
14
+ headline_push
15
+ @entries.each do |c|
16
+ %>
17
+ <%= headline_noescape("#{c.type} #{class_link(c.name)}") %>
18
+ <p>
19
+ <%
20
+ c.entries.sort.each do |m| %>
21
+ <%= link_to_method(m) %>
22
+ <% end %>
23
+ </p>
24
+ <%
25
+ end
26
+ headline_pop
27
+ %>
28
+ </ul>
@@ -0,0 +1,48 @@
1
+ <% @title = @entry.title %>
2
+ <div id="main">
3
+ <p>
4
+ <% if @entry.name == 'index' %>
5
+ <%= _('Ruby %s Reference Manual', ruby_version()) %>
6
+ <% else %>
7
+ <%= manual_home_link() %>
8
+ &gt; <%=h @entry.name %>
9
+ <% end %>
10
+ </p>
11
+ <% headline_init %>
12
+ <%= headline(@entry.title) %>
13
+ <% headline_push %>
14
+ <%= compile_rd(@entry.source) %>
15
+ </div>
16
+
17
+ <div id="leftbox">
18
+
19
+
20
+ <div class="leftlist" id="leftlist-up">
21
+ <h2>Libraries</h2>
22
+ <form>
23
+ <input type="text" name="pattern" onkeyup="isearch('index-libraries-list', this.value)">
24
+ </form>
25
+ <ul id="index-libraries-list">
26
+ <%
27
+ @entry.libraries.sort.each do |lib|
28
+ %>
29
+ <li><%= library_link(lib.name) %></li>
30
+ <% end %>
31
+ </ul>
32
+ </div>
33
+
34
+ <div class="leftlist" id="leftlist-bottom">
35
+ <h2>Classes</h2>
36
+ <form>
37
+ <input type="text" name="pattern" onkeyup="isearch('index-classes-list', this.value)">
38
+ </form>
39
+ <ul id="index-classes-list">
40
+ <%
41
+ ((@entry.classes - @entry.error_classes).sort + @entry.error_classes.sort).each do |c|
42
+ %>
43
+ <li><%= class_link(c.name, "#{c.name}") %></li>
44
+ <% end %>
45
+ </ul>
46
+ </div>
47
+
48
+ </div>
@@ -0,0 +1,19 @@
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2
+ <html lang="ja-JP">
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=<%=h charset() %>">
5
+ <meta http-equiv="Content-Language" content="ja-JP">
6
+ <link rel="stylesheet" type="text/css" href="<%=h css_url() %>">
7
+ <script type="text/javascript" src="<%=h js_url() %>"></script>
8
+ <link rel="icon" type="image/png" href="<%=h favicon_url() %>">
9
+ <title><%=h @title %></title>
10
+ </head>
11
+ <body>
12
+ <%= yield %>
13
+ <div id="footer">
14
+ <a rel="license" href="http://creativecommons.org/licenses/by/3.0/">
15
+ <img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by/3.0/88x31.png" />
16
+ </a>
17
+ </div>
18
+ </body>
19
+ </html>
@@ -0,0 +1,129 @@
1
+ <% @title = "library #{@entry.name}" %>
2
+ <div id="main">
3
+
4
+ <p>
5
+ <%= manual_home_link() %>
6
+ &gt; <a href="<%= library_index_url() %>"><%= _('All Libraries') %></a>
7
+ &gt; library <%=h @entry.name %>
8
+ </p>
9
+ <%
10
+ headline_init
11
+ %>
12
+ <%= headline(@entry.id == '_builtin' ? '組み込みライブラリ' : "library #{@entry.name}") %>
13
+
14
+ <%
15
+ headline_push
16
+ err_classes = @entry.error_classes
17
+ modules = @entry.all_classes.select{|c| c.module? }.sort
18
+ objects = @entry.all_classes.select{|c| c.object? }.sort
19
+ classes = (@entry.all_classes - @entry.all_error_classes - modules - objects).sort
20
+
21
+ class_tree = classes.group_by{|c| c.superclass }
22
+ class_root = class_tree.keys.select{|c| !c || !classes.include?(c)}
23
+ class_root.map!{|c| class_tree[c] }.flatten!
24
+ err_class_tree = err_classes.group_by{|c| c.superclass }
25
+ err_class_root = err_class_tree.keys.select{|c| !c || !err_classes.include?(c)}
26
+ err_class_root.map!{|c| err_class_tree[c] }.flatten!
27
+ %>
28
+
29
+
30
+ <%= headline(_("Abstract")) %>
31
+ <%= compile_rd(@entry.source) %>
32
+ <% draw_tree = proc do |list, tree, indent = 0| %>
33
+ <tr>
34
+ <% list.each do |c| %>
35
+ <td class="signature" style="text-indent: <%= indent * 1.0%>em;"><span style="display:none"><%= "&nbsp;" * indent %></span>
36
+ <%= class_link(c.name, c.name) %></td>
37
+ <td class="description"><%= compile_rd(c.synopsis_source) %></td>
38
+ </tr>
39
+ <%
40
+ tree && tree[c] && draw_tree.call(tree[c], tree, indent + 1)
41
+ end
42
+ end
43
+ %>
44
+ <%
45
+ [[class_root, class_tree , _('Classes')],
46
+ [modules, nil , _('Modules')],
47
+ [objects, nil , _('Objects')],
48
+ [err_class_root, err_class_tree, _('Exception Classes')]].each do |cs, tree, msg|
49
+ unless cs.empty?
50
+ %>
51
+ <%= headline(msg) %>
52
+ <table class="entries libraries">
53
+ <% draw_tree.call(cs, tree) %>
54
+ </table>
55
+ <%
56
+ end
57
+ end
58
+ %>
59
+ <%
60
+ [[@entry.requires.sort, _('Required Libraries')],
61
+ [(@entry.sublibraries - @entry.requires).sort, _('Sub-Libraries')]].each do |cs, msg|
62
+ unless cs.empty?
63
+ %>
64
+ <%= headline(msg) %>
65
+ <table class="entries libraries">
66
+ <% cs.each do |c| %>
67
+ <tr>
68
+ <td class="signature"><%= library_link(c.name) %></td>
69
+ <td class="description"><%= compile_rd(c.synopsis_source) %></td>
70
+ <% end %>
71
+ </table>
72
+ <%
73
+ end
74
+ end
75
+ %>
76
+ <%
77
+ ents = @entry.methods.sort
78
+ unless ents.empty?
79
+ %>
80
+ <%= headline(_("Added/Redefined Methods")) %>
81
+ <dl class="rightlist">
82
+ <% headline_push
83
+ ents.each do |m|
84
+ %>
85
+ <span id="<%= BitClust::NameUtils.encodename_url(m.name) %>"></span>
86
+ <%= compile_method(m, true) %>
87
+ <%
88
+ end
89
+ headline_pop
90
+ %>
91
+ </dl>
92
+ <%
93
+ end
94
+ %>
95
+
96
+ </div>
97
+
98
+
99
+ <div id="leftbox">
100
+
101
+ <div class="leftlist" id="leftlist-up">
102
+ <h2>Classes</h2>
103
+ <form>
104
+ <input type="text" name="pattern" onkeyup="isearch('index-classes-list', this.value)">
105
+ </form>
106
+ <ul id="index-classes-list">
107
+ <%
108
+ ((@entry.all_classes - @entry.all_error_classes).sort + @entry.all_error_classes.sort).each do |c|
109
+ %>
110
+ <li><%= class_link(c.name, "#{c.name}") %></li>
111
+ <% end %>
112
+ </ul>
113
+ </div>
114
+
115
+ <div class="leftlist" id="leftlist-bottom">
116
+ <h2>Sublibraries</h2>
117
+ <form>
118
+ <input type="text" name="pattern" onkeyup="isearch('index-libraries-list', this.value)">
119
+ </form>
120
+ <ul id="index-libraries-list">
121
+ <%
122
+ (@entry.sublibraries.sort + (@entry.requires - @entry.sublibraries).sort).each do |lib|
123
+ %>
124
+ <li><%= library_link(lib.name) %></li>
125
+ <% end %>
126
+ </ul>
127
+ </div>
128
+
129
+ </div>
@@ -0,0 +1,32 @@
1
+ <% @title = _('Library Index') %>
2
+ <p>
3
+ <%= manual_home_link() %>
4
+ &gt; <%= _("All Libraries") %>
5
+ </p>
6
+ <%
7
+ headline_init
8
+ %>
9
+ <%= headline(_("Library Index")) %>
10
+ <table class="entries libraries">
11
+ <%
12
+ headline_push
13
+ lib = @entries.detect {|lib| lib.id == '_builtin' }
14
+ %>
15
+ <tr>
16
+ <td class="signature"><%= library_link(lib.name, _('Builtin Library')) %></td>
17
+ <td class="description"><%= compile_rd(lib.synopsis_source) %></td>
18
+ </tr>
19
+ <%
20
+ @entries.each do |lib|
21
+ next if lib.id == '_builtin'
22
+ next if lib.is_sublibrary
23
+ %>
24
+ <tr>
25
+ <td class="signature"><%= library_link(lib.name) %></td>
26
+ <td class="description"><%= compile_rd(lib.synopsis_source) %></td>
27
+ </tr>
28
+ <%
29
+ end
30
+ headline_pop
31
+ %>
32
+ </table>
@@ -0,0 +1,20 @@
1
+ <%
2
+ entry = @entries.sort.first
3
+ %>
4
+ <% @title = "#{entry.type_label} #{entry.label}" %>
5
+ <p>
6
+ <%= manual_home_link() %>
7
+ &gt; <a href="<%= library_index_url() %>"><%= _('All Libraries') %></a>
8
+ &gt; library <%= library_link(entry.library.name) %>
9
+ &gt; <%= entry.klass.type %> <%= class_link(entry.klass.name) %>
10
+ &gt; <% if entry.typename == :special_variable %>$<% end %><%=h entry.name %>
11
+ <% unless entry.really_public? %>(<%= entry.visibility %>)<% end %>
12
+ </p>
13
+
14
+ <% headline_init %>
15
+ <%= headline("#{entry.type_label} #{entry.label}") %>
16
+ <dl class="methodlist">
17
+ <% @entries.sort.each do |ent| %>
18
+ <%= compile_method(ent) %>
19
+ <% end %>
20
+ </dl>
@@ -0,0 +1,6 @@
1
+ <%
2
+ headline_init
3
+ headline_push
4
+ headline_push
5
+ %>
6
+ <%= compile_rd(@source) %>
@@ -0,0 +1,67 @@
1
+ <% @title = "#{@entry.type} #{@entry.name}" %>
2
+ <p>
3
+ <%= manual_home_link() %>
4
+ &gt; <a href="<%= library_index_url() %>"><%= _('All Libraries') %></a>
5
+ &gt; <%= friendly_library_link(@entry.library.name) %>
6
+ &gt; <%=h _(@entry.type.to_s + ' %s', @entry.name) %>
7
+ </p>
8
+
9
+ <%
10
+ headline_init
11
+ %>
12
+ <%= headline("#{@entry.type} #{@entry.name}" + @entry.ancestors[1..@alevel].map{|c| " + #{c.name}" }.join) %>
13
+ <p>
14
+ <%
15
+ myself, *supers = @entry.ancestors
16
+ n = 0
17
+ %>
18
+ <% unless @entry.alias? %>
19
+ <%= _('ancestors') %>: <%= escape_html(myself.name) %>
20
+ <% supers.each do |c| %>
21
+ <%= @conf[:tochm_mode] ? "&lt;" : a_href("?a=#{n}", "<") %> <%= class_link(c.name) %>
22
+ <% n += 1 %>
23
+ <% end %>
24
+ <% end %>
25
+
26
+ <% unless @entry.extended.empty? %>
27
+ <br>extend: <%= @entry.extended.map {|c| class_link(c.name) }.join(', ') %>
28
+ <% end %>
29
+ <% unless @entry.aliases.empty? %>
30
+ <br>aliases: <%=h @entry.aliases.map{|c| c.name}.join(', ') %>
31
+ <% end %>
32
+ </p>
33
+ <%
34
+ headline_push
35
+ %>
36
+ <%= headline(_("Abstract")) %>
37
+ <%= compile_rd(@entry.source) %>
38
+
39
+ <%
40
+ ents = @entry.partitioned_entries(@alevel)
41
+ [[_('Singleton Methods'), ents.singleton_methods ],
42
+ [_('Instance Methods'), ents.instance_methods ],
43
+ [_('Private Singleton Methods'), ents.private_singleton_methods ],
44
+ [_('Private Instance Methods'), ents.private_instance_methods ],
45
+ [_('Module Functions'), ents.module_functions ],
46
+ [_('Constants'), ents.constants ],
47
+ [_('Special Variables'), ents.special_variables ]]\
48
+ .each do |label, entries|
49
+ unless entries.empty? %>
50
+ <%= headline(label) %>
51
+ <dl>
52
+ <%
53
+ headline_push
54
+ entries.each do |m|
55
+ %>
56
+ <%= compile_method(m) %>
57
+ <%
58
+ end
59
+ headline_pop
60
+ %>
61
+ </dl>
62
+ <%
63
+ end
64
+ end
65
+ headline_pop
66
+ %>
67
+
@@ -0,0 +1,28 @@
1
+ <% @title = _('Class Index') %>
2
+ <p>
3
+ <%= manual_home_link() %>
4
+ &gt; <%= _('All Classes') %>
5
+ </p>
6
+ <%
7
+ headline_init
8
+ %>
9
+ <%= headline(_("Class Index")) %>
10
+ <p>
11
+ <%= @entries.size %> classes/modules in database
12
+ </p>
13
+ <%
14
+ headline_push
15
+ @entries.each do |c|
16
+ %>
17
+ <%= headline_noescape("#{c.type} #{class_link(c.name)}") %>
18
+ <p>
19
+ <%
20
+ c.entries.sort.each do |m| %>
21
+ <%= link_to_method(m) %>
22
+ <% end %>
23
+ </p>
24
+ <%
25
+ end
26
+ headline_pop
27
+ %>
28
+ </ul>
@@ -0,0 +1,13 @@
1
+ <% @title = @entry.title %>
2
+ <p>
3
+ <% if @entry.name == 'index' %>
4
+ <%= _('Ruby %s Reference Manual', ruby_version()) %>
5
+ <% else %>
6
+ <%= manual_home_link() %>
7
+ &gt; <%=h @entry.name %>
8
+ <% end %>
9
+ </p>
10
+ <% headline_init %>
11
+ <%= headline(@entry.title) %>
12
+ <% headline_push %>
13
+ <%= compile_rd(@entry.source) %>
@@ -0,0 +1,22 @@
1
+ <%
2
+ entry = @entry
3
+ @title = "#{entry.type_label} #{entry.label}"
4
+ %>
5
+ <p>
6
+ <%= manual_home_link() %>
7
+ &gt; <a href="<%= function_index_url() %>"><%= _('All Functions') %></a>
8
+ &gt; <%=h entry.name %>
9
+ <% unless entry.public? %>(static)<% end %>
10
+ </p>
11
+
12
+ <% headline_init %>
13
+ <%= headline("#{entry.type_label} #{entry.label}") %>
14
+ <dl class="functionlist">
15
+ <dt>
16
+ <code><%= entry.header %></code>
17
+ </dt>
18
+ <dd>
19
+ <%= compile_function(entry) %>
20
+ </dd>
21
+ </dl>
22
+
@@ -0,0 +1,24 @@
1
+ <% @title = _('Function Index') %>
2
+ <p>
3
+ <%= manual_home_link() %>
4
+ &gt; <%= _('All Functions') %>
5
+ </p>
6
+ <%
7
+ headline_init
8
+ %>
9
+ <%= headline(_("Function Index")) %>
10
+ <table class="entries functions">
11
+ <%
12
+ headline_push
13
+ @entries.each do |f|
14
+ %>
15
+ <tr>
16
+ <td class="signature"><%= function_link(f.name) %></td>
17
+ <td class="description"><%= compile_rd(f.synopsis_source) %></td>
18
+ </tr>
19
+ <%
20
+ end
21
+ headline_pop
22
+ %>
23
+ </table>
24
+