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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 08d0469722f4af2b09e0684dbb47f03e2c060734
4
- data.tar.gz: ac36637449d471f3cdd81fe509e560c475839ff3
3
+ metadata.gz: 2331dc63f0fcd3803ccebebb54054fda385884b9
4
+ data.tar.gz: 668b9180bc48009d40f57f5e5ecd8f1b52431a17
5
5
  SHA512:
6
- metadata.gz: 45d9a46db9354c8dafe08badec6fa347daeb8d9a4a65e3a3003e6d9169e742b30ab03e2b2b9fe7b0da3aa4a23c68e389960e4b6f8d9712de0a1c1dc4d2dfb9f2
7
- data.tar.gz: 39c79479b9381ca33988d6c91251e6fc7a1cdca11ea0fed07e3719b6bc29ee1358b5313668aea8796d7cb567010f9325bf9c86279343b21f191f29684e70fd42
6
+ metadata.gz: 2c8b30a6f00e2f83ff8a58c8d43aeb3a9ea9070cceaa03108032617c12f5ad2d3609399ee4bd90d81adbb3b492ab70dc496fea7b96840e59231a51d51d8cfcc2
7
+ data.tar.gz: dd2b3f895761ae9315b76d1fc97d996ef6d87b319673b0096c941c3b48c539a811656286475b6fcdca0b2a6049fae9b15df9b9c3489b9ae6572646e69750f706
@@ -1 +1 @@
1
- require 'yard/mruby'
1
+ require 'yard/mruby' unless Kernel.const_defined?(:YARD) && YARD.const_defined?(:MRuby)
@@ -4,5 +4,6 @@ require_relative "mruby/version"
4
4
  require_relative "mruby/code_objects"
5
5
  require_relative "mruby/parser"
6
6
  require_relative "mruby/handlers"
7
+ require_relative "mruby/tags"
7
8
  require_relative "mruby/templates"
8
9
  require_relative "mruby/cli"
@@ -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 src/**/*.c include/**/*.h} if self.files.empty?
7
+ self.files = %w{src/**/*.c mrblib/**/*.rb include/**/*.h} if self.files.empty?
8
8
  end
9
9
  end
10
10
 
@@ -3,3 +3,4 @@ require_relative 'code_objects/header_base_object'
3
3
  require_relative 'code_objects/header_object'
4
4
  require_relative 'code_objects/function_object'
5
5
  require_relative 'code_objects/define_object'
6
+ require_relative 'code_objects/typedef_object'
@@ -11,6 +11,10 @@ module YARD::MRuby::CodeObjects
11
11
  children.find_all {|d| d.is_a?(DefineObject) }
12
12
  end
13
13
 
14
+ def typedefs
15
+ children.find_all {|d| d.is_a?(TypedefObject) }
16
+ end
17
+
14
18
  def path
15
19
  self.name
16
20
  end
@@ -0,0 +1,8 @@
1
+ module YARD::MRuby::CodeObjects
2
+
3
+ # A TypedefObject represents a MRuby C API typedef declaration inside a header inside an include directory
4
+ class TypedefObject < HeaderBaseObject
5
+ end
6
+ end
7
+
8
+
@@ -2,3 +2,4 @@ require_relative 'header/base'
2
2
  require_relative 'header/function_handler'
3
3
  require_relative 'header/define_handler'
4
4
  require_relative 'header/header_decl_handler'
5
+ require_relative 'header/typedef_handler'
@@ -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
@@ -8,7 +8,7 @@ module YARD::MRuby::Handlers::C::Source
8
8
  \s*\(
9
9
  \s*\w+\s*,
10
10
  \s*(\w+)\s*,
11
- \s*"(\w+)"\s*,
11
+ \s*"([^"]+)"\s*,
12
12
  \s*(\w+)\s*,
13
13
  /mx
14
14
 
@@ -0,0 +1,2 @@
1
+ YARD::Tags::Library.define_tag("ISO Reference", :ISO, :with_title_and_text)
2
+ YARD::Tags::Library.define_tag("Required mrbgem", :mrbgem, :with_title_and_text)
@@ -1,5 +1,5 @@
1
1
  module YARD
2
2
  module MRuby
3
- VERSION = "0.2.0"
3
+ VERSION = "0.2.1"
4
4
  end
5
5
  end
@@ -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 %>
@@ -0,0 +1,3 @@
1
+ <% if object.has_tag?(:ISO) %>
2
+ <p class="tag_title"><strong>ISO</strong>: <%= object.tag(:ISO).name %></p>
3
+ <% end %>
@@ -0,0 +1,3 @@
1
+ <% if object.has_tag?(:mrbgem) %>
2
+ <p class="tag_title"><strong>Required mrbgem</strong>: <%= object.tag(:mrbgem).name %></p>
3
+ <% end %>
@@ -1,5 +1,8 @@
1
1
  def init
2
2
  super
3
+
4
+ sections << :iso
5
+ sections << :mrbgem
3
6
  end
4
7
 
5
8
  def param
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.0
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: 2015-10-08 00:00:00.000000000 Z
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