yard-mruby 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/yard-mruby.rb +1 -1
- data/lib/yard/mruby.rb +1 -0
- data/lib/yard/mruby/cli/yardoc.rb +1 -1
- data/lib/yard/mruby/code_objects.rb +1 -0
- data/lib/yard/mruby/code_objects/header_object.rb +4 -0
- data/lib/yard/mruby/code_objects/typedef_object.rb +8 -0
- data/lib/yard/mruby/handlers/c/header.rb +1 -0
- data/lib/yard/mruby/handlers/c/header/typedef_handler.rb +31 -0
- data/lib/yard/mruby/handlers/c/source/method_handler.rb +1 -1
- data/lib/yard/mruby/tags.rb +2 -0
- data/lib/yard/mruby/version.rb +1 -1
- data/templates/default/header/html/setup.rb +8 -0
- data/templates/default/header/html/typedef_summary.erb +11 -0
- data/templates/default/tags/html/iso.erb +3 -0
- data/templates/default/tags/html/mrbgem.erb +3 -0
- data/templates/default/tags/setup.rb +3 -0
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2331dc63f0fcd3803ccebebb54054fda385884b9
|
4
|
+
data.tar.gz: 668b9180bc48009d40f57f5e5ecd8f1b52431a17
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c8b30a6f00e2f83ff8a58c8d43aeb3a9ea9070cceaa03108032617c12f5ad2d3609399ee4bd90d81adbb3b492ab70dc496fea7b96840e59231a51d51d8cfcc2
|
7
|
+
data.tar.gz: dd2b3f895761ae9315b76d1fc97d996ef6d87b319673b0096c941c3b48c539a811656286475b6fcdca0b2a6049fae9b15df9b9c3489b9ae6572646e69750f706
|
data/lib/yard-mruby.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
require 'yard/mruby'
|
1
|
+
require 'yard/mruby' unless Kernel.const_defined?(:YARD) && YARD.const_defined?(:MRuby)
|
data/lib/yard/mruby.rb
CHANGED
@@ -4,7 +4,7 @@ module YARD::MRuby::CLI
|
|
4
4
|
# Redefines default files for YARD::CLI::Yardoc
|
5
5
|
def parse_arguments(*args)
|
6
6
|
super(*args)
|
7
|
-
self.files = %w{mrblib/**/*.rb
|
7
|
+
self.files = %w{src/**/*.c mrblib/**/*.rb include/**/*.h} if self.files.empty?
|
8
8
|
end
|
9
9
|
end
|
10
10
|
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module YARD::MRuby::Handlers::C::Header
|
2
|
+
class TypedefHandler < Base
|
3
|
+
MATCH = /
|
4
|
+
typedef
|
5
|
+
(\s+(\*)?([A-Za-z0-9_\*]+))+
|
6
|
+
;
|
7
|
+
/mx
|
8
|
+
|
9
|
+
|
10
|
+
handles MATCH
|
11
|
+
statement_class ToplevelStatement
|
12
|
+
|
13
|
+
process do
|
14
|
+
handle_typedef(statement)
|
15
|
+
end
|
16
|
+
|
17
|
+
def handle_typedef(statement)
|
18
|
+
header = self.header(statement.file)
|
19
|
+
|
20
|
+
statement.source.scan(MATCH) do |match|
|
21
|
+
name = match.last
|
22
|
+
register TypedefObject.new(header, name) do |obj|
|
23
|
+
if statement.comments
|
24
|
+
register_docstring(obj, statement.comments.source, statement)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
data/lib/yard/mruby/version.rb
CHANGED
@@ -5,6 +5,7 @@ def init
|
|
5
5
|
sections :header, :pre_docstring, T('docstring'), :includes,
|
6
6
|
:function_summary, [:item_summary],
|
7
7
|
:define_summary, [T('docstring')],
|
8
|
+
:typedef_summary, [T('docstring')],
|
8
9
|
:function_details_list, [T('function_details')]
|
9
10
|
end
|
10
11
|
|
@@ -22,3 +23,10 @@ def define_listing
|
|
22
23
|
@defines = object.defines
|
23
24
|
@defines
|
24
25
|
end
|
26
|
+
|
27
|
+
def typedef_listing
|
28
|
+
return @typedefs if @typedefs
|
29
|
+
|
30
|
+
@typedefs = object.typedefs
|
31
|
+
@typedefs
|
32
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<% if typedef_listing.size > 0 %>
|
2
|
+
<h2>Typedef Summary</h2>
|
3
|
+
<dl class="constants">
|
4
|
+
<% typedef_listing.each do |typedef| %>
|
5
|
+
<dt id="<%= anchor_for(typedef) %>" class="<%= typedef.has_tag?(:deprecated) ? 'deprecated' : '' %>"><small>typedef</small> <%= typedef.name %>
|
6
|
+
<%= yieldall :object => typedef %>
|
7
|
+
</dt>
|
8
|
+
<dd><pre class="code"><%#= format_constant typedef.value %></pre></dd>
|
9
|
+
<% end %>
|
10
|
+
</dl>
|
11
|
+
<% end %>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yard-mruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Seba Gamboa
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: yard
|
@@ -95,6 +95,7 @@ files:
|
|
95
95
|
- lib/yard/mruby/code_objects/header_base_object.rb
|
96
96
|
- lib/yard/mruby/code_objects/header_object.rb
|
97
97
|
- lib/yard/mruby/code_objects/headers_root.rb
|
98
|
+
- lib/yard/mruby/code_objects/typedef_object.rb
|
98
99
|
- lib/yard/mruby/handlers.rb
|
99
100
|
- lib/yard/mruby/handlers/c.rb
|
100
101
|
- lib/yard/mruby/handlers/c/header.rb
|
@@ -102,6 +103,7 @@ files:
|
|
102
103
|
- lib/yard/mruby/handlers/c/header/define_handler.rb
|
103
104
|
- lib/yard/mruby/handlers/c/header/function_handler.rb
|
104
105
|
- lib/yard/mruby/handlers/c/header/header_decl_handler.rb
|
106
|
+
- lib/yard/mruby/handlers/c/header/typedef_handler.rb
|
105
107
|
- lib/yard/mruby/handlers/c/source.rb
|
106
108
|
- lib/yard/mruby/handlers/c/source/base.rb
|
107
109
|
- lib/yard/mruby/handlers/c/source/class_handler.rb
|
@@ -115,6 +117,7 @@ files:
|
|
115
117
|
- lib/yard/mruby/parser/c/header_parser.rb
|
116
118
|
- lib/yard/mruby/parser/c/parser.rb
|
117
119
|
- lib/yard/mruby/parser/c/source_parser.rb
|
120
|
+
- lib/yard/mruby/tags.rb
|
118
121
|
- lib/yard/mruby/templates.rb
|
119
122
|
- lib/yard/mruby/templates/helpers.rb
|
120
123
|
- lib/yard/mruby/templates/helpers/html_helper.rb
|
@@ -151,10 +154,13 @@ files:
|
|
151
154
|
- templates/default/header/html/item_summary.erb
|
152
155
|
- templates/default/header/html/pre_docstring.erb
|
153
156
|
- templates/default/header/html/setup.rb
|
157
|
+
- templates/default/header/html/typedef_summary.erb
|
154
158
|
- templates/default/headersroot/html/headers_list.erb
|
155
159
|
- templates/default/headersroot/html/setup.rb
|
156
160
|
- templates/default/layout/html/footer.erb
|
157
161
|
- templates/default/layout/html/setup.rb
|
162
|
+
- templates/default/tags/html/iso.erb
|
163
|
+
- templates/default/tags/html/mrbgem.erb
|
158
164
|
- templates/default/tags/setup.rb
|
159
165
|
- yard-mruby.gemspec
|
160
166
|
homepage: https://github.com/sagmor/yard-mruby
|