bitclust-core 1.2.1 → 1.2.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/data/bitclust/catalog/ja_JP.UTF-8 +4 -0
  3. data/data/bitclust/template.lillia/layout +1 -1
  4. data/data/bitclust/template.offline/class +127 -34
  5. data/data/bitclust/template.offline/class-index +33 -6
  6. data/data/bitclust/template.offline/doc +41 -8
  7. data/data/bitclust/template.offline/function +42 -9
  8. data/data/bitclust/template.offline/function-index +33 -7
  9. data/data/bitclust/template.offline/layout +21 -14
  10. data/data/bitclust/template.offline/library +48 -12
  11. data/data/bitclust/template.offline/library-index +33 -6
  12. data/data/bitclust/template.offline/method +56 -11
  13. data/lib/bitclust/classentry.rb +13 -2
  14. data/lib/bitclust/compat.rb +8 -0
  15. data/lib/bitclust/completion.rb +1 -0
  16. data/lib/bitclust/docentry.rb +4 -2
  17. data/lib/bitclust/entry.rb +3 -0
  18. data/lib/bitclust/functionentry.rb +8 -7
  19. data/lib/bitclust/functionreferenceparser.rb +2 -0
  20. data/lib/bitclust/libraryentry.rb +4 -1
  21. data/lib/bitclust/lineinput.rb +6 -2
  22. data/lib/bitclust/methoddatabase.rb +3 -0
  23. data/lib/bitclust/methodentry.rb +10 -8
  24. data/lib/bitclust/methodid.rb +1 -0
  25. data/lib/bitclust/nameutils.rb +15 -11
  26. data/lib/bitclust/preprocessor.rb +26 -21
  27. data/lib/bitclust/rdcompiler.rb +29 -19
  28. data/lib/bitclust/requesthandler.rb +3 -3
  29. data/lib/bitclust/ridatabase.rb +2 -1
  30. data/lib/bitclust/rrdparser.rb +19 -20
  31. data/lib/bitclust/screen.rb +39 -4
  32. data/lib/bitclust/silent_progress_bar.rb +8 -4
  33. data/lib/bitclust/simplesearcher.rb +1 -1
  34. data/lib/bitclust/subcommand.rb +9 -0
  35. data/lib/bitclust/subcommands/chm_command.rb +3 -3
  36. data/lib/bitclust/subcommands/methods_command.rb +1 -1
  37. data/lib/bitclust/subcommands/server_command.rb +6 -1
  38. data/lib/bitclust/subcommands/setup_command.rb +2 -2
  39. data/lib/bitclust/subcommands/statichtml_command.rb +44 -21
  40. data/lib/bitclust/syntax_highlighter.rb +5 -3
  41. data/lib/bitclust/version.rb +1 -1
  42. data/test/test_bitclust.rb +1 -1
  43. data/test/test_entry.rb +14 -1
  44. data/test/test_functionreferenceparser.rb +4 -4
  45. data/test/test_preprocessor.rb +21 -0
  46. data/test/test_rdcompiler.rb +240 -0
  47. data/test/test_rrdparser.rb +16 -0
  48. data/test/test_syntax_highlighter.rb +22 -4
  49. data/theme/default/rurema.png +0 -0
  50. data/theme/default/rurema.svg +31 -0
  51. data/theme/default/script.js +34 -0
  52. data/theme/default/style.css +112 -8
  53. metadata +32 -19
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f862080777927bb3b01d118c4eed19be1924fc7764a66ada4a05d2dced710474
4
- data.tar.gz: 8686589708e6c3514eaf06ac27622e57fc6b74945734d6303306b0567b1cbec6
3
+ metadata.gz: 9351ae4c31a9070629d3caca3ea7d7dbc1b323ca1b5840de4aa78d6fd482fe7b
4
+ data.tar.gz: b80b4414d21ee137c425025778ad750122835b5294ab55012ed7debba0d0ea89
5
5
  SHA512:
6
- metadata.gz: 1e183939ea2f3463750a8ed60498a3b9f63f2792af3d1f90751bf6b8f41ddfee0b98704f8ffc5f52fb161750ad6e5705d5d4714fb70d124e13290f59a7168726
7
- data.tar.gz: 1ea7d07e5bed99ab26ef3e7266bc1cd981890e9cb0e7da998f8d49b46a025854b610efb795487dcb7e969186f03f5a24278c766bf0991faa7667a73a6d7aaf34
6
+ metadata.gz: def1f2a7b7b27922f0dfd2b3559a273e3289b46407be4e478a6af86a05a579ae7d3e6de8321474589fb29aa2a71359bd4dfb76691e73d27f972922b99edd1df3
7
+ data.tar.gz: 39af952569f246199ec9d258ede5faa937241aeb790368fb8d629aa31531ae0c6277e8c9b80f4e95b608d1131021dfebbd29c321f24519d8d8072d7820a465a2
@@ -10,6 +10,10 @@ All Functions
10
10
  関数一覧
11
11
  All Libraries
12
12
  ライブラリ一覧
13
+ Ancestor Methods
14
+ 継承しているメソッド
15
+ Ancestor Methods %s
16
+ %sから継承しているメソッド
13
17
  Builtin
14
18
  組み込み
15
19
  Builtin Library
@@ -8,7 +8,7 @@
8
8
  <link rel="stylesheet" type="text/css" href="<%=h css_url() %>">
9
9
  <script type="text/javascript" src="<%=h js_url() %>"></script>
10
10
  <link rel="icon" type="image/png" href="<%=h favicon_url() %>">
11
- <title><%=h @title %> (Ruby <%=h ruby_version %>)</title>
11
+ <title><%=h @title %> (Ruby <%=h ruby_version %> リファレンスマニュアル)</title>
12
12
  <meta name="description" content="<%=h @description %>">
13
13
  </head>
14
14
  <body>
@@ -1,52 +1,112 @@
1
1
  <%
2
2
  @title = "#{@entry.type} #{@entry.name}"
3
3
  @description = @entry.description
4
+ @edit_url = edit_url(@entry.source_location) if @conf[:edit_base_url] && @entry.source_location
4
5
  %>
5
- <p>
6
- <%= manual_home_link() %>
7
- &gt; <a href="<%= library_index_url() %>"><%= _('All Libraries') %></a>
8
- &gt; <%= friendly_library_link(@entry.library.name) %>
9
- &gt; <%=h _(@entry.type.to_s + ' %s', @entry.name) %>
10
- </p>
11
-
12
- <%
13
- headline_init
6
+ <% if @conf[:canonical_base_url] %>
7
+ <script type="application/ld+json">
8
+ <%=
9
+ breadcrumb_json_ld(
10
+ [
11
+ {
12
+ name: manual_home_name,
13
+ url: absolute_url_to(@urlmapper.document_url('index'))
14
+ },
15
+ {
16
+ name: _('All Libraries'),
17
+ url: absolute_url_to(library_index_url)
18
+ },
19
+ {
20
+ name: friendly_library_name(@entry.library.name),
21
+ url: absolute_url_to(@urlmapper.library_url(@entry.library.name))
22
+ },
23
+ {
24
+ name: _("#{@entry.type} %s", @entry.name),
25
+ url: canonical_url
26
+ }
27
+ ]
28
+ )
14
29
  %>
15
- <%= headline("#{@entry.type} #{@entry.name}" + @entry.ancestors[1..@alevel].map{|c| " + #{c.name}" }.join) %>
16
- <p>
30
+ </script>
31
+ <% end %>
32
+ <header>
33
+ <nav>
34
+ <ol class="inline-breadcrumb-list">
35
+ <li>
36
+ <%= manual_home_link() %>
37
+ </li>
38
+ <li>
39
+ <a href="<%= library_index_url() %>"><%= _('All Libraries') %></a>
40
+ </li>
41
+ <li>
42
+ <%= friendly_library_link(@entry.library.name) %>
43
+ </li>
44
+ <li>
45
+ <%=h _(@entry.type.to_s + ' %s', @entry.name) %>
46
+ </li>
47
+ </ol>
48
+ </nav>
49
+ <% headline_init %>
50
+ <%= headline("#{@entry.type} #{@entry.name}" + @entry.ancestors[1..@alevel].map{|c| " + #{c.name}" }.join, edit_url: @edit_url) %>
51
+ </header>
52
+
53
+ <main>
17
54
  <%
18
55
  myself, *supers = @entry.ancestors
19
56
  n = 0
20
57
  %>
58
+
21
59
  <% unless @entry.alias? %>
22
- <%= _('ancestors') %>: <%= escape_html(myself.name) %>
23
- <% supers.each do |c| %>
24
- <%= @conf[:tochm_mode] ? "&lt;" : a_href("?a=#{n}", "<") %> <%= class_link(c.name) %>
25
- <% n += 1 %>
26
- <% end %>
60
+ <nav>
61
+ <%= _('ancestors') %>:
62
+ <ol class="inline-ancestors-list">
63
+ <% supers.reverse_each do |c| %>
64
+ <li>
65
+ <%= class_link(c.name) %>
66
+ </li>
67
+ <% n += 1 %>
68
+ <% end %>
69
+ <li>
70
+ <%= @entry.object? ? class_link(myself.name) : escape_html(myself.name) %>
71
+ </li>
72
+ </ol>
73
+ </nav>
27
74
  <% end %>
28
75
 
29
76
  <% unless @entry.extended.empty? %>
30
- <br>extend: <%= @entry.extended.map {|c| class_link(c.name) }.join(', ') %>
77
+ <p>
78
+ extend: <%= @entry.extended.map {|c| class_link(c.name) }.join(', ') %>
79
+ </p>
31
80
  <% end %>
81
+
32
82
  <% unless @entry.aliases.empty? %>
33
- <br>aliases: <%=h @entry.aliases.map{|c| c.name}.join(', ') %>
83
+ <p>
84
+ aliases: <%=h @entry.aliases.map{|c| c.name}.join(', ') %>
85
+ </p>
34
86
  <% end %>
87
+
35
88
  <% unless @entry.dynamically_included.empty? %>
36
- <br> dynamic include:
37
- <%= @entry.dynamically_included.map{|m|
38
- class_link(m.name) + " (by " + library_link(m.library.name) + ")"
39
- }.join(", ")
40
- %>
89
+ <p>
90
+ dynamic include:
91
+ <%=
92
+ @entry.dynamically_included.map {|m|
93
+ class_link(m.name) + " (by " + library_link(m.library.name) + ")"
94
+ }.join(", ")
95
+ %>
96
+ </p>
41
97
  <% end %>
98
+
42
99
  <% unless @entry.dynamically_extended.empty? %>
43
- <br> dynamic extend:
44
- <%= @entry.dynamically_extended.map{|m|
45
- class_link(m.name) + " (by " + library_link(m.library.name) + ")"
46
- }.join(", ")
47
- %>
48
- <% end %>
100
+ <p>
101
+ dynamic extend:
102
+ <%=
103
+ @entry.dynamically_extended.map {|m|
104
+ class_link(m.name) + " (by " + library_link(m.library.name) + ")"
105
+ }.join(", ")
106
+ %>
49
107
  </p>
108
+ <% end %>
109
+
50
110
  <%
51
111
  headline_push
52
112
  %>
@@ -68,19 +128,52 @@
68
128
  <% items.each do |label, entries, prefix| next if entries.empty? %>
69
129
  <dt><%= label %></dt>
70
130
  <dd>
131
+ <ul class="class-toc">
71
132
  <%
72
- entries.each do |m|
73
- m.names.each do |mname|
133
+ entries.inject([]){ |ary, m| ary.concat(m.names.map{ |mname| [m.index_id, mname] }) }
134
+ .uniq
135
+ .sort_by{ |_, mname| mname.gsub(/(?=[^\da-zA-Z])/, "\t") }
136
+ .each do |index_id, mname|
74
137
  %>
75
- <a href="#<%= m.index_id %>"><%= "#{prefix}#{mname}" %></a>
138
+ <li><a href="#<%= index_id %>"><%= escape_html "#{prefix}#{mname}" %></a></li>
76
139
  <%
77
- end
78
140
  end
79
141
  %>
142
+ </ul>
80
143
  </dd>
81
144
  <% end %>
82
145
  </dl>
83
146
 
147
+ <%
148
+ _myself, *ancestors = @entry.ancestors.reject { |c| %w[Object Kernel BasicObject].include?(c.name) }
149
+ displayed_methods = Set.new(ents.instance_methods.map(&:name))
150
+ %>
151
+
152
+ <% unless ancestors.empty? %>
153
+ <%= headline(_("Ancestor Methods")) %>
154
+ <dl>
155
+ <% ancestors.each do |c|
156
+ undefined_methods = @entry.partitioned_entries.undefined
157
+ methods = c.partitioned_entries(@alevel).instance_methods
158
+ .flat_map { |m| m.names.map { |n| [n, m] } }
159
+ .reject { |name,| displayed_methods.include?(name) }
160
+ .reject { |name,| undefined_methods.any? { |m| m.names.include?(name) } }
161
+ .sort
162
+ next if methods.empty? %>
163
+ <dt><%= _('Ancestor Methods %s', c.name) %></dt>
164
+ <dd>
165
+ <ul class="class-toc">
166
+ <% methods.each do |name, m| %>
167
+ <li><%= method_link(m.spec_string, name) %></li>
168
+ <% displayed_methods << name %>
169
+ <% end %>
170
+ </ul>
171
+ </dd>
172
+ <%
173
+ end
174
+ end %>
175
+ </dl>
176
+
84
177
  <%
85
178
  items.each do |label, entries|
86
179
  unless entries.empty? %>
@@ -101,4 +194,4 @@
101
194
  end
102
195
  headline_pop
103
196
  %>
104
-
197
+ </main>
@@ -2,14 +2,40 @@
2
2
  @title = _('Class Index')
3
3
  @description = _('Class Index')
4
4
  %>
5
- <p>
6
- <%= manual_home_link() %>
7
- &gt; <%= _('All Classes') %>
8
- </p>
9
- <%
10
- headline_init
5
+ <% if @conf[:canonical_base_url] %>
6
+ <script type="application/ld+json">
7
+ <%=
8
+ breadcrumb_json_ld(
9
+ [
10
+ {
11
+ name: manual_home_name,
12
+ url: absolute_url_to(@urlmapper.document_url('index'))
13
+ },
14
+ {
15
+ name: _('All Classes'),
16
+ url: canonical_url
17
+ }
18
+ ]
19
+ )
11
20
  %>
21
+ </script>
22
+ <% end %>
23
+ <header>
24
+ <nav>
25
+ <ol class="inline-breadcrumb-list">
26
+ <li>
27
+ <%= manual_home_link() %>
28
+ </li>
29
+ <li>
30
+ <%= _('All Classes') %>
31
+ </li>
32
+ </ol>
33
+ </nav>
34
+ <% headline_init %>
12
35
  <%= headline(_("Class Index")) %>
36
+ </header>
37
+
38
+ <main>
13
39
  <p>
14
40
  <%= @entries.size %> classes/modules in database
15
41
  </p>
@@ -29,3 +55,4 @@
29
55
  headline_pop
30
56
  %>
31
57
  </ul>
58
+ </main>
@@ -1,16 +1,49 @@
1
1
  <%
2
2
  @title = @entry.title
3
3
  @description = @entry.description
4
+ @edit_url = edit_url(@entry.source_location) if @conf[:edit_base_url] && @entry.source_location
4
5
  %>
5
- <p>
6
- <% if @entry.name == 'index' %>
7
- <%= _('Ruby %s Reference Manual', ruby_version()) %>
8
- <% else %>
9
- <%= manual_home_link() %>
10
- &gt; <%=h breadcrumb_title %>
6
+ <% if @conf[:canonical_base_url] %>
7
+ <script type="application/ld+json">
8
+ <%=
9
+ items = [
10
+ {
11
+ name: manual_home_name,
12
+ url: absolute_url_to(@urlmapper.document_url('index'))
13
+ }
14
+ ]
15
+ if @entry.name != 'index'
16
+ items << {
17
+ name: breadcrumb_title,
18
+ url: canonical_url
19
+ }
20
+ end
21
+ breadcrumb_json_ld(items)
22
+ %>
23
+ </script>
11
24
  <% end %>
12
- </p>
25
+ <header>
26
+ <nav>
27
+ <ol class="inline-breadcrumb-list">
28
+ <% if @entry.name == 'index' %>
29
+ <li>
30
+ <%= manual_home_name %>
31
+ </li>
32
+ <% else %>
33
+ <li>
34
+ <%= manual_home_link() %>
35
+ </li>
36
+ <li>
37
+ <%=h breadcrumb_title %>
38
+ </li>
39
+ <% end %>
40
+ </ol>
41
+ </nav>
13
42
  <% headline_init %>
14
- <%= headline(@entry.title) %>
43
+ <%= headline(@entry.title, edit_url: @edit_url) %>
44
+ </header>
45
+
46
+ <main>
15
47
  <% headline_push %>
16
48
  <%= compile_rd(@entry.source) %>
49
+ </main>
@@ -2,16 +2,49 @@
2
2
  entry = @entry
3
3
  @title = "#{entry.type_label} #{entry.label}"
4
4
  @description = @entry.description
5
+ @edit_url = edit_url(@entry.source_location) if @conf[:edit_base_url] && @entry.source_location
5
6
  %>
6
- <p>
7
- <%= manual_home_link() %>
8
- &gt; <a href="<%= function_index_url() %>"><%= _('All Functions') %></a>
9
- &gt; <%=h entry.name %>
10
- <% unless entry.public? %>(static)<% end %>
11
- </p>
12
-
7
+ <% if @conf[:canonical_base_url] %>
8
+ <script type="application/ld+json">
9
+ <%=
10
+ breadcrumb_json_ld(
11
+ [
12
+ {
13
+ name: manual_home_name,
14
+ url: absolute_url_to(@urlmapper.document_url('index'))
15
+ },
16
+ {
17
+ name: _('All Functions'),
18
+ url: absolute_url_to(function_index_url)
19
+ },
20
+ {
21
+ name: "#{entry.name}#{' (static)' unless entry.public?}",
22
+ url: canonical_url
23
+ }
24
+ ]
25
+ )
26
+ %>
27
+ </script>
28
+ <% end %>
29
+ <header>
30
+ <nav>
31
+ <ol class="inline-breadcrumb-list">
32
+ <li>
33
+ <%= manual_home_link() %>
34
+ </li>
35
+ <li>
36
+ <a href="<%= function_index_url() %>"><%= _('All Functions') %></a>
37
+ </li>
38
+ <li>
39
+ <%=h entry.name %> <% unless entry.public? %>(static)<% end %>
40
+ </li>
41
+ </ol>
42
+ </nav>
13
43
  <% headline_init %>
14
- <%= headline("#{entry.type_label} #{entry.label}") %>
44
+ <%= headline("#{entry.type_label} #{entry.label}", edit_url: @edit_url) %>
45
+ </header>
46
+
47
+ <main>
15
48
  <dl class="functionlist">
16
49
  <dt>
17
50
  <code><%= entry.header %></code>
@@ -20,4 +53,4 @@
20
53
  <%= compile_function(entry) %>
21
54
  </dd>
22
55
  </dl>
23
-
56
+ </main>
@@ -2,14 +2,40 @@
2
2
  @title = _('Function Index')
3
3
  @description = _('Function Index')
4
4
  %>
5
- <p>
6
- <%= manual_home_link() %>
7
- &gt; <%= _('All Functions') %>
8
- </p>
9
- <%
10
- headline_init
5
+ <% if @conf[:canonical_base_url] %>
6
+ <script type="application/ld+json">
7
+ <%=
8
+ breadcrumb_json_ld(
9
+ [
10
+ {
11
+ name: manual_home_name,
12
+ url: absolute_url_to(@urlmapper.document_url('index'))
13
+ },
14
+ {
15
+ name: _('All Functions'),
16
+ url: canonical_url
17
+ }
18
+ ]
19
+ )
11
20
  %>
21
+ </script>
22
+ <% end %>
23
+ <header>
24
+ <nav>
25
+ <ol class="inline-breadcrumb-list">
26
+ <li>
27
+ <%= manual_home_link() %>
28
+ </li>
29
+ <li>
30
+ <%= _('All Functions') %>
31
+ </li>
32
+ </ol>
33
+ </nav>
34
+ <% headline_init %>
12
35
  <%= headline(_("Function Index")) %>
36
+ </header>
37
+
38
+ <main>
13
39
  <table class="entries functions">
14
40
  <%
15
41
  headline_push
@@ -24,4 +50,4 @@
24
50
  headline_pop
25
51
  %>
26
52
  </table>
27
-
53
+ </main>