• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

mrubyを超漢字で動作させる


Commit MetaInfo

Revisão5cdcce8dbddd94ecb9503a0a1d47370c4ef97177 (tree)
Hora2015-10-21 00:16:47
AutorSeba Gamboa <me@sagm...>
CommiterSeba Gamboa

Mensagem de Log

Mark core gems with mrbgem tag

Mudança Sumário

Diff

--- a/include/mruby/error.h
+++ b/include/mruby/error.h
@@ -32,12 +32,34 @@ MRB_API mrb_noreturn void mrb_no_method_error(mrb_state *mrb, mrb_sym id, mrb_va
3232 /* declaration for fail method */
3333 MRB_API mrb_value mrb_f_raise(mrb_state*, mrb_value);
3434
35-/* functions defined in mruby-error mrbgem */
35+/**
36+ * Protect
37+ *
38+ * @mrbgem mruby-error
39+ */
3640 MRB_API mrb_value mrb_protect(mrb_state *mrb, mrb_func_t body, mrb_value data, mrb_bool *state);
41+
42+/**
43+ * Ensure
44+ *
45+ * @mrbgem mruby-error
46+ */
3747 MRB_API mrb_value mrb_ensure(mrb_state *mrb, mrb_func_t body, mrb_value b_data,
3848 mrb_func_t ensure, mrb_value e_data);
49+
50+/**
51+ * Rescue
52+ *
53+ * @mrbgem mruby-error
54+ */
3955 MRB_API mrb_value mrb_rescue(mrb_state *mrb, mrb_func_t body, mrb_value b_data,
4056 mrb_func_t rescue, mrb_value r_data);
57+
58+/**
59+ * Rescue exception
60+ *
61+ * @mrbgem mruby-error
62+ */
4163 MRB_API mrb_value mrb_rescue_exceptions(mrb_state *mrb, mrb_func_t body, mrb_value b_data,
4264 mrb_func_t rescue, mrb_value r_data,
4365 mrb_int len, struct RClass **classes);
--- a/mrbgems/mruby-array-ext/mrblib/array.rb
+++ b/mrbgems/mruby-array-ext/mrblib/array.rb
@@ -1,4 +1,5 @@
11 class Array
2+
23 ##
34 # call-seq:
45 # ary.uniq! -> ary or nil
@@ -15,6 +16,7 @@ class Array
1516 # c = [["student","sam"], ["student","george"], ["teacher","matz"]]
1617 # c.uniq! { |s| s.first } # => [["student", "sam"], ["teacher", "matz"]]
1718 #
19+ # @mrbgem mruby-array-ext
1820 def uniq!(&block)
1921 ary = self.dup
2022 result = []
@@ -54,6 +56,7 @@ class Array
5456 # b = [["student","sam"], ["student","george"], ["teacher","matz"]]
5557 # b.uniq { |s| s.first } # => [["student", "sam"], ["teacher", "matz"]]
5658 #
59+ # @mrbgem mruby-array-ext
5760 def uniq(&block)
5861 ary = self.dup
5962 if block
@@ -75,6 +78,7 @@ class Array
7578 #
7679 # [ 1, 1, 2, 2, 3, 3, 4, 5 ] - [ 1, 2, 4 ] #=> [ 3, 3, 5 ]
7780 #
81+ # @mrbgem mruby-array-ext
7882 def -(elem)
7983 raise TypeError, "can't convert #{elem.class} into Array" unless elem.class == Array
8084
@@ -95,6 +99,7 @@ class Array
9599 # [ "a", "b", "c" ] | [ "c", "d", "a" ]
96100 # #=> [ "a", "b", "c", "d" ]
97101 #
102+ # @mrbgem mruby-array-ext
98103 def |(elem)
99104 raise TypeError, "can't convert #{elem.class} into Array" unless elem.class == Array
100105
@@ -111,6 +116,7 @@ class Array
111116 #
112117 # [ 1, 1, 3, 5 ] & [ 1, 2, 3 ] #=> [ 1, 3 ]
113118 #
119+ # @mrbgem mruby-array-ext
114120 def &(elem)
115121 raise TypeError, "can't convert #{elem.class} into Array" unless elem.class == Array
116122
@@ -143,6 +149,7 @@ class Array
143149 # a = [ 1, 2, [3, [4, 5] ] ]
144150 # a.flatten(1) #=> [1, 2, 3, [4, 5]]
145151 #
152+ # @mrbgem mruby-array-ext
146153 def flatten(depth=nil)
147154 ar = []
148155 self.each do |e|
@@ -172,6 +179,7 @@ class Array
172179 # a = [ 1, 2, [3, [4, 5] ] ]
173180 # a.flatten!(1) #=> [1, 2, 3, [4, 5]]
174181 #
182+ # @mrbgem mruby-array-ext
175183 def flatten!(depth=nil)
176184 modified = false
177185 ar = []
@@ -199,6 +207,7 @@ class Array
199207 # [ "a", nil, "b", nil, "c", nil ].compact
200208 # #=> [ "a", "b", "c" ]
201209 #
210+ # @mrbgem mruby-array-ext
202211 def compact
203212 result = self.dup
204213 result.compact!
@@ -216,6 +225,7 @@ class Array
216225 # [ "a", nil, "b", nil, "c" ].compact! #=> [ "a", "b", "c" ]
217226 # [ "a", "b", "c" ].compact! #=> nil
218227 #
228+ # @mrbgem mruby-array-ext
219229 def compact!
220230 result = self.select { |e| !e.nil? }
221231 if result.size == self.size
@@ -226,6 +236,7 @@ class Array
226236 end
227237
228238 # for efficiency
239+ # @mrbgem mruby-array-ext
229240 def reverse_each(&block)
230241 return to_enum :reverse_each unless block_given?
231242
@@ -238,6 +249,7 @@ class Array
238249 end
239250
240251 NONE=Object.new
252+
241253 ##
242254 # call-seq:
243255 # ary.fetch(index) -> obj
@@ -260,7 +272,7 @@ class Array
260272 # a.fetch(100) { |i| puts "#{i} is out of bounds" }
261273 # #=> "100 is out of bounds"
262274 #
263-
275+ # @mrbgem mruby-array-ext
264276 def fetch(n=nil, ifnone=NONE, &block)
265277 warn "block supersedes default value argument" if !n.nil? && ifnone != NONE && block
266278
@@ -310,7 +322,7 @@ class Array
310322 # a.fill(1, 2) { |i| i+1 } #=> [0, 2, 3, 27]
311323 # a.fill(0..1) { |i| i+1 } #=> [1, 2, 3, 27]
312324 #
313-
325+ # @mrbgem mruby-array-ext
314326 def fill(arg0=nil, arg1=nil, arg2=nil, &block)
315327 if arg0.nil? && arg1.nil? && arg2.nil? && !block
316328 raise ArgumentError, "wrong number of arguments (0 for 1..3)"
@@ -394,7 +406,8 @@ class Array
394406 # a #=> ["a", "b", "c", "d"]
395407 # a.rotate(2) #=> ["c", "d", "a", "b"]
396408 # a.rotate(-3) #=> ["b", "c", "d", "a"]
397-
409+ #
410+ # @mrbgem mruby-array-ext
398411 def rotate(count=1)
399412 ary = []
400413 len = self.length
@@ -425,12 +438,12 @@ class Array
425438 # a #=> ["b", "c", "d", "a"]
426439 # a.rotate!(2) #=> ["d", "a", "b", "c"]
427440 # a.rotate!(-3) #=> ["a", "b", "c", "d"]
428-
441+ #
442+ # @mrbgem mruby-array-ext
429443 def rotate!(count=1)
430444 self.replace(self.rotate(count))
431445 end
432446
433- ##
434447 # call-seq:
435448 # ary.delete_if { |item| block } -> ary
436449 # ary.delete_if -> Enumerator
@@ -446,7 +459,8 @@ class Array
446459 #
447460 # scores = [ 97, 42, 75 ]
448461 # scores.delete_if {|score| score < 80 } #=> [97]
449-
462+ #
463+ # @mrbgem mruby-array-ext
450464 def delete_if(&block)
451465 return to_enum :delete_if unless block_given?
452466
@@ -475,7 +489,8 @@ class Array
475489 # See also Enumerable#reject and Array#delete_if.
476490 #
477491 # If no block is given, an Enumerator is returned instead.
478-
492+ #
493+ # @mrbgem mruby-array-ext
479494 def reject!(&block)
480495 return to_enum :reject! unless block_given?
481496
@@ -507,7 +522,8 @@ class Array
507522 # a = %w{ a b c d }
508523 # a.insert(2, 99) #=> ["a", "b", 99, "c", "d"]
509524 # a.insert(-2, 1, 2, 3) #=> ["a", "b", 99, "c", 1, 2, 3, "d"]
510-
525+ #
526+ # @mrbgem mruby-array-ext
511527 def insert(idx, *args)
512528 idx += self.size + 1 if idx < 0
513529 self[idx, 0] = args
@@ -565,7 +581,8 @@ class Array
565581 # You must not mix the two modes at a time; the block must always
566582 # return either true/false, or always return a number. It is
567583 # undefined which value is actually picked up at each iteration.
568-
584+ #
585+ # @mrbgem mruby-array-ext
569586 def bsearch(&block)
570587 return to_enum :bsearch unless block_given?
571588
@@ -612,7 +629,8 @@ class Array
612629 #
613630 # scores = [ 97, 42, 75 ]
614631 # scores.delete_if {|score| score < 80 } #=> [97]
615-
632+ #
633+ # @mrbgem mruby-array-ext
616634 def delete_if(&block)
617635 return to_enum :delete_if unless block_given?
618636
@@ -641,7 +659,8 @@ class Array
641659 #
642660 # a = [1, 2, 3, 4, 5]
643661 # a.keep_if { |val| val > 3 } #=> [4, 5]
644-
662+ #
663+ # @mrbgem mruby-array-ext
645664 def keep_if(&block)
646665 return to_enum :keep_if unless block_given?
647666
@@ -670,7 +689,8 @@ class Array
670689 # See also Array#keep_if
671690 #
672691 # If no block is given, an Enumerator is returned instead.
673-
692+ #
693+ # @mrbgem mruby-array-ext
674694 def select!(&block)
675695 return to_enum :select! unless block_given?
676696
@@ -694,6 +714,8 @@ class Array
694714 # first object for which the block returns +true+. Returns +nil+ if no
695715 # match is found.
696716 #
717+ # @mrbgem mruby-array-ext
718+ #
697719 # ISO 15.2.12.5.14
698720 def index(val=NONE, &block)
699721 return to_enum(:find_index, val) if !block && val == NONE
--- a/mrbgems/mruby-array-ext/src/array.c
+++ b/mrbgems/mruby-array-ext/src/array.c
@@ -4,7 +4,7 @@
44 #include "mruby/range.h"
55 #include "mruby/hash.h"
66
7-/*
7+/**
88 * call-seq:
99 * ary.assoc(obj) -> new_ary or nil
1010 *
@@ -22,8 +22,9 @@
2222 * a = [ s1, s2, s3 ]
2323 * a.assoc("letters") #=> [ "letters", "a", "b", "c" ]
2424 * a.assoc("foo") #=> nil
25+ *
26+ * @mrbgem mruby-array-ext
2527 */
26-
2728 static mrb_value
2829 mrb_ary_assoc(mrb_state *mrb, mrb_value ary)
2930 {
@@ -73,7 +74,7 @@ mrb_ary_rassoc(mrb_state *mrb, mrb_value ary)
7374 return mrb_nil_value();
7475 }
7576
76-/*
77+/**
7778 * call-seq:
7879 * ary.at(index) -> obj or nil
7980 *
@@ -84,8 +85,9 @@ mrb_ary_rassoc(mrb_state *mrb, mrb_value ary)
8485 * a = [ "a", "b", "c", "d", "e" ]
8586 * a.at(0) #=> "a"
8687 * a.at(-1) #=> "e"
88+ *
89+ * @mrbgem mruby-array-ext
8790 */
88-
8991 static mrb_value
9092 mrb_ary_at(mrb_state *mrb, mrb_value ary)
9193 {
@@ -95,6 +97,10 @@ mrb_ary_at(mrb_state *mrb, mrb_value ary)
9597 return mrb_ary_entry(ary, pos);
9698 }
9799
100+/**
101+ *
102+ * @mrbgem mruby-array-ext
103+ */
98104 static mrb_value
99105 mrb_ary_values_at(mrb_state *mrb, mrb_value self)
100106 {
@@ -106,7 +112,7 @@ mrb_ary_values_at(mrb_state *mrb, mrb_value self)
106112 return mrb_get_values_at(mrb, self, RARRAY_LEN(self), argc, argv, mrb_ary_ref);
107113 }
108114
109-/*
115+/**
110116 * call-seq:
111117 * ary.to_h -> Hash
112118 *
@@ -115,8 +121,9 @@ mrb_ary_values_at(mrb_state *mrb, mrb_value self)
115121 *
116122 * [[:foo, :bar], [1, 2]].to_h
117123 * # => {:foo => :bar, 1 => 2}
124+ *
125+ * @mrbgem mruby-array-ext
118126 */
119-
120127 static mrb_value
121128 mrb_ary_to_h(mrb_state *mrb, mrb_value ary)
122129 {
--- a/mrbgems/mruby-enum-ext/mrblib/enum.rb
+++ b/mrbgems/mruby-enum-ext/mrblib/enum.rb
@@ -1,7 +1,5 @@
1-##
2-# Enumerable
3-#
41 module Enumerable
2+
53 ##
64 # call-seq:
75 # enum.drop(n) -> array
@@ -11,7 +9,8 @@ module Enumerable
119 #
1210 # a = [1, 2, 3, 4, 5, 0]
1311 # a.drop(3) #=> [4, 5, 0]
14-
12+ #
13+ # @mrbgem mruby-enum-ext
1514 def drop(n)
1615 raise TypeError, "no implicit conversion of #{n.class} into Integer" unless n.respond_to?(:to_int)
1716 raise ArgumentError, "attempt to drop negative size" if n < 0
@@ -35,7 +34,8 @@ module Enumerable
3534 #
3635 # a = [1, 2, 3, 4, 5, 0]
3736 # a.drop_while {|i| i < 3 } #=> [3, 4, 5, 0]
38-
37+ #
38+ # @mrbgem mruby-enum-ext
3939 def drop_while(&block)
4040 return to_enum :drop_while unless block
4141
@@ -55,7 +55,8 @@ module Enumerable
5555 #
5656 # a = [1, 2, 3, 4, 5, 0]
5757 # a.take(3) #=> [1, 2, 3]
58-
58+ #
59+ # @mrbgem mruby-enum-ext
5960 def take(n)
6061 raise TypeError, "no implicit conversion of #{n.class} into Integer" unless n.respond_to?(:to_int)
6162 raise ArgumentError, "attempt to take negative size" if n < 0
@@ -81,7 +82,8 @@ module Enumerable
8182 #
8283 # a = [1, 2, 3, 4, 5, 0]
8384 # a.take_while {|i| i < 3 } #=> [1, 2]
84-
85+ #
86+ # @mrbgem mruby-enum-ext
8587 def take_while(&block)
8688 return to_enum :take_while unless block
8789
@@ -111,7 +113,8 @@ module Enumerable
111113 # [6, 7, 8]
112114 # [7, 8, 9]
113115 # [8, 9, 10]
114-
116+ #
117+ # @mrbgem mruby-enum-ext
115118 def each_cons(n, &block)
116119 raise TypeError, "no implicit conversion of #{n.class} into Integer" unless n.respond_to?(:to_int)
117120 raise ArgumentError, "invalid size" if n <= 0
@@ -139,7 +142,8 @@ module Enumerable
139142 # [4, 5, 6]
140143 # [7, 8, 9]
141144 # [10]
142-
145+ #
146+ # @mrbgem mruby-enum-ext
143147 def each_slice(n, &block)
144148 raise TypeError, "no implicit conversion of #{n.class} into Integer" unless n.respond_to?(:to_int)
145149 raise ArgumentError, "invalid slice size" if n <= 0
@@ -167,7 +171,8 @@ module Enumerable
167171 # corresponding to the key.
168172 #
169173 # (1..6).group_by {|i| i%3} #=> {0=>[3, 6], 1=>[1, 4], 2=>[2, 5]}
170-
174+ #
175+ # @mrbgem mruby-enum-ext
171176 def group_by(&block)
172177 return to_enum :group_by unless block
173178
@@ -189,7 +194,8 @@ module Enumerable
189194 # values in <i>enum</i> through the given block.
190195 #
191196 # If no block is given, an enumerator is returned instead.
192-
197+ #
198+ # @mrbgem mruby-enum-ext
193199 def sort_by(&block)
194200 return to_enum :sort_by unless block
195201
@@ -216,6 +222,8 @@ module Enumerable
216222 # Returns the first element, or the first +n+ elements, of the enumerable.
217223 # If the enumerable is empty, the first form returns <code>nil</code>, and the
218224 # second form returns an empty array.
225+ #
226+ # @mrbgem mruby-enum-ext
219227 def first(n=NONE)
220228 if n == NONE
221229 self.each do |*val|
@@ -244,6 +252,8 @@ module Enumerable
244252 # If an argument is given, the number of items in +enum+ that
245253 # are equal to +item+ are counted. If a block is given, it
246254 # counts the number of elements yielding a true value.
255+ #
256+ # @mrbgem mruby-enum-ext
247257 def count(v=NONE, &block)
248258 count = 0
249259 if block
@@ -276,6 +286,8 @@ module Enumerable
276286 #
277287 # [1, 2, 3, 4].flat_map { |e| [e, -e] } #=> [1, -1, 2, -2, 3, -3, 4, -4]
278288 # [[1, 2], [3, 4]].flat_map { |e| e + [100] } #=> [1, 2, 100, 3, 4, 100]
289+ #
290+ # @mrbgem mruby-enum-ext
279291 def flat_map(&block)
280292 return to_enum :flat_map unless block
281293
@@ -303,7 +315,8 @@ module Enumerable
303315 # If no block is given, an enumerator is returned instead.
304316 #
305317 # %w[albatross dog horse].max_by {|x| x.length } #=> "albatross"
306-
318+ #
319+ # @mrbgem mruby-enum-ext
307320 def max_by(&block)
308321 return to_enum :max_by unless block
309322
@@ -337,7 +350,8 @@ module Enumerable
337350 # If no block is given, an enumerator is returned instead.
338351 #
339352 # %w[albatross dog horse].min_by {|x| x.length } #=> "dog"
340-
353+ #
354+ # @mrbgem mruby-enum-ext
341355 def min_by(&block)
342356 return to_enum :min_by unless block
343357
@@ -373,7 +387,8 @@ module Enumerable
373387 # a = %w(albatross dog horse)
374388 # a.minmax #=> ["albatross", "horse"]
375389 # a.minmax { |a, b| a.length <=> b.length } #=> ["dog", "albatross"]
376-
390+ #
391+ # @mrbgem mruby-enum-ext
377392 def minmax(&block)
378393 max = nil
379394 min = nil
@@ -411,7 +426,8 @@ module Enumerable
411426 # If no block is given, an enumerator is returned instead.
412427 #
413428 # %w(albatross dog horse).minmax_by { |x| x.length } #=> ["dog", "albatross"]
414-
429+ #
430+ # @mrbgem mruby-enum-ext
415431 def minmax_by(&block)
416432 return to_enum :minmax_by unless block
417433
@@ -454,7 +470,8 @@ module Enumerable
454470 # [].none? #=> true
455471 # [nil, false].none? #=> true
456472 # [nil, true].none? #=> false
457-
473+ #
474+ # @mrbgem mruby-enum-ext
458475 def none?(&block)
459476 if block
460477 self.each do |*val|
@@ -484,7 +501,7 @@ module Enumerable
484501 # [nil, true, 99].one? #=> false
485502 # [nil, true, false].one? #=> true
486503 #
487-
504+ # @mrbgem mruby-enum-ext
488505 def one?(&block)
489506 count = 0
490507 if block
@@ -515,7 +532,7 @@ module Enumerable
515532 # (1..10).each_with_object([]) { |i, a| a << i*2 }
516533 # #=> [2, 4, 6, 8, 10, 12, 14, 16, 18, 20]
517534 #
518-
535+ # @mrbgem mruby-enum-ext
519536 def each_with_object(obj=nil, &block)
520537 raise ArgumentError, "wrong number of arguments (0 for 1)" if obj.nil?
521538
@@ -542,7 +559,7 @@ module Enumerable
542559 # 2
543560 # 1
544561 #
545-
562+ # @mrbgem mruby-enum-ext
546563 def reverse_each(&block)
547564 return to_enum :reverse_each unless block
548565
@@ -574,7 +591,7 @@ module Enumerable
574591 # a.cycle { |x| puts x } # print, a, b, c, a, b, c,.. forever.
575592 # a.cycle(2) { |x| puts x } # print, a, b, c, a, b, c.
576593 #
577-
594+ # @mrbgem mruby-enum-ext
578595 def cycle(n=nil, &block)
579596 return to_enum(:cycle, n) if !block && n.nil?
580597
@@ -623,7 +640,7 @@ module Enumerable
623640 # (1..100).find_index { |i| i % 5 == 0 and i % 7 == 0 } #=> 34
624641 # (1..100).find_index(50) #=> 49
625642 #
626-
643+ # @mrbgem mruby-enum-ext
627644 def find_index(val=NONE, &block)
628645 return to_enum(:find_index, val) if !block && val == NONE
629646
@@ -653,7 +670,7 @@ module Enumerable
653670 # <code>enum#size</code>. If the size of any argument is less than
654671 # <code>enum#size</code>, <code>nil</code> values are supplied.
655672 #
656-
673+ # @mrbgem mruby-enum-ext
657674 def zip(*arg)
658675 ary = []
659676 arg = arg.map{|a|a.to_a}
@@ -682,7 +699,7 @@ module Enumerable
682699 # %i[hello world].each_with_index.to_h
683700 # # => {:hello => 0, :world => 1}
684701 #
685-
702+ # @mrbgem mruby-enum-ext
686703 def to_h
687704 h = {}
688705 self.each do |*v|
--- a/mrbgems/mruby-enum-lazy/mrblib/lazy.rb
+++ b/mrbgems/mruby-enum-lazy/mrblib/lazy.rb
@@ -1,30 +1,33 @@
1-# = Enumerable#lazy implementation
2-#
3-# Enumerable#lazy returns an instance of Enumerable::Lazy.
4-# You can use it just like as normal Enumerable object,
5-# except these methods act as 'lazy':
6-#
7-# - map collect
8-# - select find_all
9-# - reject
10-# - grep
11-# - drop
12-# - drop_while
13-# - take_while
14-# - flat_map collect_concat
15-# - zip
16-#
17-# == Acknowledgements
18-#
19-# Based on https://github.com/yhara/enumerable-lazy
20-# Inspired by https://github.com/antimon2/enumerable_lz
21-# http://jp.rubyist.net/magazine/?0034-Enumerable_lz (ja)
22-
231 module Enumerable
2+
3+ # = Enumerable#lazy implementation
4+ #
5+ # Enumerable#lazy returns an instance of Enumerable::Lazy.
6+ # You can use it just like as normal Enumerable object,
7+ # except these methods act as 'lazy':
8+ #
9+ # - map collect
10+ # - select find_all
11+ # - reject
12+ # - grep
13+ # - drop
14+ # - drop_while
15+ # - take_while
16+ # - flat_map collect_concat
17+ # - zip
18+ #
19+ # @mrbgem mruby-enum-lazy
2420 def lazy
2521 Lazy.new(self)
2622 end
2723
24+ # == Acknowledgements
25+ #
26+ # Based on https://github.com/yhara/enumerable-lazy
27+ # Inspired by https://github.com/antimon2/enumerable_lz
28+ # http://jp.rubyist.net/magazine/?0034-Enumerable_lz (ja)
29+ #
30+ # @mrbgem mruby-enum-lazy
2831 class Lazy < Enumerator
2932 def initialize(obj, &block)
3033 super(){|yielder|
--- a/mrbgems/mruby-enumerator/mrblib/enumerator.rb
+++ b/mrbgems/mruby-enumerator/mrblib/enumerator.rb
@@ -84,7 +84,8 @@
8484 # # implementing an internal iterator.
8585 # puts ext_each(o.to_enum) {|*x| puts x; [:b, *x] }
8686 # # => [], [:b], [1], [:b, 1], [1, 2], [:b, 1, 2], 3
87-
87+#
88+# @mrbgem mruby-enumerator
8889 class Enumerator
8990 include Enumerable
9091
--- a/mrbgems/mruby-eval/src/eval.c
+++ b/mrbgems/mruby-eval/src/eval.c
@@ -195,6 +195,10 @@ create_proc_from_string(mrb_state *mrb, char *s, int len, mrb_value binding, cha
195195 return proc;
196196 }
197197
198+/**
199+ *
200+ * @mrbgem mruby-eval
201+ */
198202 static mrb_value
199203 f_eval(mrb_state *mrb, mrb_value self)
200204 {
@@ -221,6 +225,10 @@ mrb_value mrb_obj_instance_eval(mrb_state *mrb, mrb_value self);
221225
222226 #define CI_ACC_SKIP -1
223227
228+/**
229+ *
230+ * @mrbgem mruby-eval
231+ */
224232 static mrb_value
225233 f_instance_eval(mrb_state *mrb, mrb_value self)
226234 {
--- a/mrbgems/mruby-exit/src/mruby-exit.c
+++ b/mrbgems/mruby-exit/src/mruby-exit.c
@@ -1,6 +1,10 @@
11 #include <stdlib.h>
22 #include "mruby.h"
33
4+/**
5+ *
6+ * @mrbgem mruby-exit
7+ */
48 static mrb_value
59 f_exit(mrb_state *mrb, mrb_value self)
610 {
--- a/mrbgems/mruby-fiber/src/fiber.c
+++ b/mrbgems/mruby-fiber/src/fiber.c
@@ -368,6 +368,13 @@ mrb_mruby_fiber_gem_init(mrb_state* mrb)
368368 {
369369 struct RClass *c;
370370
371+
372+
373+ /**
374+ * Fiber
375+ *
376+ * @mrbgem mruby-fiber
377+ */
371378 c = mrb_define_class(mrb, "Fiber", mrb->object_class);
372379 MRB_SET_INSTANCE_TT(c, MRB_TT_FIBER);
373380
@@ -380,6 +387,11 @@ mrb_mruby_fiber_gem_init(mrb_state* mrb)
380387 mrb_define_class_method(mrb, c, "yield", fiber_yield, MRB_ARGS_ANY());
381388 mrb_define_class_method(mrb, c, "current", fiber_current, MRB_ARGS_NONE());
382389
390+ /**
391+ * FiberError
392+ *
393+ * @mrbgem mruby-fiber
394+ */
383395 mrb_define_class(mrb, "FiberError", mrb->eStandardError_class);
384396 }
385397
--- a/mrbgems/mruby-hash-ext/mrblib/hash.rb
+++ b/mrbgems/mruby-hash-ext/mrblib/hash.rb
@@ -1,6 +1,8 @@
11 class Hash
22
33 # ISO does not define Hash#each_pair, so each_pair is defined in gem.
4+ #
5+ # @mrbgem mruby-hash-ext
46 alias each_pair each
57
68 ##
@@ -22,7 +24,7 @@ class Hash
2224 # Hash[ [ ["a", 100], ["b", 200] ] ] #=> {"a"=>100, "b"=>200}
2325 # Hash["a" => 100, "b" => 200] #=> {"a"=>100, "b"=>200}
2426 #
25-
27+ # @mrbgem mruby-hash-ext
2628 def self.[](*object)
2729 length = object.length
2830 if length == 1
@@ -80,7 +82,7 @@ class Hash
8082 # h1.merge!(h2) { |key, v1, v2| v1 }
8183 # #=> {"a"=>100, "b"=>200, "c"=>300}
8284 #
83-
85+ # @mrbgem mruby-hash-ext
8486 def merge!(other, &block)
8587 raise TypeError, "can't convert argument into Hash" unless other.respond_to?(:to_hash)
8688 if block
@@ -122,7 +124,7 @@ class Hash
122124 # prog.rb:2:in 'fetch': key not found (KeyError)
123125 # from prog.rb:2
124126 #
125-
127+ # @mrbgem mruby-hash-ext
126128 def fetch(key, none=NONE, &block)
127129 unless self.key?(key)
128130 if block
@@ -150,7 +152,7 @@ class Hash
150152 # h = { "a" => 100, "b" => 200, "c" => 300 }
151153 # h.delete_if {|key, value| key >= "b" } #=> {"a"=>100}
152154 #
153-
155+ # @mrbgem mruby-hash-ext
154156 def delete_if(&block)
155157 return to_enum :delete_if unless block_given?
156158
@@ -175,7 +177,7 @@ class Hash
175177 # a.flatten # => [1, "one", 2, [2, "two"], 3, "three"]
176178 # a.flatten(2) # => [1, "one", 2, 2, "two", 3, "three"]
177179 #
178-
180+ # @mrbgem mruby-hash-ext
179181 def flatten(level=1)
180182 self.to_a.flatten(level)
181183 end
@@ -190,7 +192,7 @@ class Hash
190192 # h = { "n" => 100, "m" => 100, "y" => 300, "d" => 200, "a" => 0 }
191193 # h.invert #=> {0=>"a", 100=>"m", 200=>"d", 300=>"y"}
192194 #
193-
195+ # @mrbgem mruby-hash-ext
194196 def invert
195197 h = Hash.new
196198 self.each {|k, v| h[v] = k }
@@ -207,7 +209,7 @@ class Hash
207209 #
208210 # If no block is given, an enumerator is returned instead.
209211 #
210-
212+ # @mrbgem mruby-hash-ext
211213 def keep_if(&block)
212214 return to_enum :keep_if unless block_given?
213215
@@ -232,7 +234,7 @@ class Hash
232234 # h.key(300) #=> "c"
233235 # h.key(999) #=> nil
234236 #
235-
237+ # @mrbgem mruby-hash-ext
236238 def key(val)
237239 self.each do |k, v|
238240 return k if v == val
@@ -247,6 +249,7 @@ class Hash
247249 # Returns +self+. If called on a subclass of Hash, converts
248250 # the receiver to a Hash object.
249251 #
252+ # @mrbgem mruby-hash-ext
250253 def to_h
251254 self
252255 end
--- a/mrbgems/mruby-hash-ext/src/hash-ext.c
+++ b/mrbgems/mruby-hash-ext/src/hash-ext.c
@@ -17,6 +17,8 @@
1717 *
1818 * h = { "cat" => "feline", "dog" => "canine", "cow" => "bovine" }
1919 * h.values_at("cow", "cat") #=> ["bovine", "feline"]
20+ *
21+ * @mrbgem mruby-hash-ext
2022 */
2123
2224 static mrb_value
--- a/mrbgems/mruby-kernel-ext/src/kernel.c
+++ b/mrbgems/mruby-kernel-ext/src/kernel.c
@@ -11,6 +11,7 @@
1111 * Symbol.
1212 * If called outside of a method, it returns <code>nil</code>.
1313 *
14+ * @mrbgem mruby-kernel-ext
1415 */
1516 static mrb_value
1617 mrb_f_method(mrb_state *mrb, mrb_value self)
@@ -45,6 +46,8 @@ mrb_f_method(mrb_state *mrb, mrb_value self)
4546 * Integer("0930", 10) #=> 930
4647 * Integer("111", 2) #=> 7
4748 * Integer(nil) #=> TypeError
49+ *
50+ * @mrbgem mruby-kernel-ext
4851 */
4952 static mrb_value
5053 mrb_f_integer(mrb_state *mrb, mrb_value self)
@@ -67,6 +70,8 @@ mrb_f_integer(mrb_state *mrb, mrb_value self)
6770 * Float(123.456) #=> 123.456
6871 * Float("123.456") #=> 123.456
6972 * Float(nil) #=> TypeError
73+ *
74+ * @mrbgem mruby-kernel-ext
7075 */
7176 static mrb_value
7277 mrb_f_float(mrb_state *mrb, mrb_value self)
@@ -88,6 +93,8 @@ mrb_f_float(mrb_state *mrb, mrb_value self)
8893 * String(self) #=> "main"
8994 * String(self.class) #=> "Object"
9095 * String(123456) #=> "123456"
96+ *
97+ * @mrbgem mruby-kernel-ext
9198 */
9299 static mrb_value
93100 mrb_f_string(mrb_state *mrb, mrb_value self)
@@ -112,6 +119,7 @@ mrb_f_string(mrb_state *mrb, mrb_value self)
112119 *
113120 * Array(1..5) #=> [1, 2, 3, 4, 5]
114121 *
122+ * @mrbgem mruby-kernel-ext
115123 */
116124 static mrb_value
117125 mrb_f_array(mrb_state *mrb, mrb_value self)
@@ -142,6 +150,8 @@ mrb_f_array(mrb_state *mrb, mrb_value self)
142150 * Hash(nil) #=> {}
143151 * Hash(key: :value) #=> {:key => :value}
144152 * Hash([1, 2, 3]) #=> TypeError
153+ *
154+ * @mrbgem mruby-kernel-ext
145155 */
146156 static mrb_value
147157 mrb_f_hash(mrb_state *mrb, mrb_value self)
--- a/mrbgems/mruby-math/src/math.c
+++ b/mrbgems/mruby-math/src/math.c
@@ -721,6 +721,12 @@ void
721721 mrb_mruby_math_gem_init(mrb_state* mrb)
722722 {
723723 struct RClass *mrb_math;
724+
725+ /**
726+ * Math functions
727+ *
728+ * @mrbgem mruby-math
729+ */
724730 mrb_math = mrb_define_module(mrb, "Math");
725731
726732 mrb_define_class_under(mrb, mrb_math, "DomainError", mrb->eStandardError_class);
--- a/mrbgems/mruby-numeric-ext/mrblib/numeric_ext.rb
+++ b/mrbgems/mruby-numeric-ext/mrblib/numeric_ext.rb
@@ -1,5 +1,8 @@
11 module Integral
2+
3+ # @mrbgem mruby-numeric-ext
24 def div(other)
35 self.divmod(other)[0]
46 end
7+
58 end
--- a/mrbgems/mruby-numeric-ext/src/numeric_ext.c
+++ b/mrbgems/mruby-numeric-ext/src/numeric_ext.c
@@ -1,6 +1,9 @@
11 #include <limits.h>
22 #include "mruby.h"
33
4+/**
5+ * @mrbgem mruby-numeric-ext
6+ */
47 static mrb_value
58 mrb_int_chr(mrb_state *mrb, mrb_value x)
69 {
--- a/mrbgems/mruby-object-ext/mrblib/object.rb
+++ b/mrbgems/mruby-object-ext/mrblib/object.rb
@@ -12,6 +12,7 @@ class Object
1212 # .select {|x| x%2==0} .tap {|x| puts "evens: #{x.inspect}"}
1313 # .map { |x| x*x } .tap {|x| puts "squares: #{x.inspect}"}
1414 #
15+ # @mrbgem mruby-object-ext
1516 def tap
1617 yield self
1718 self
--- a/mrbgems/mruby-object-ext/src/object.c
+++ b/mrbgems/mruby-object-ext/src/object.c
@@ -7,8 +7,9 @@
77 * nil.to_a -> []
88 *
99 * Always returns an empty array.
10+ *
11+ * @mrbgem mruby-object-ext
1012 */
11-
1213 static mrb_value
1314 nil_to_a(mrb_state *mrb, mrb_value obj)
1415 {
@@ -20,8 +21,9 @@ nil_to_a(mrb_state *mrb, mrb_value obj)
2021 * nil.to_f -> 0.0
2122 *
2223 * Always returns zero.
24+ *
25+ * @mrbgem mruby-object-ext
2326 */
24-
2527 static mrb_value
2628 nil_to_f(mrb_state *mrb, mrb_value obj)
2729 {
@@ -33,8 +35,9 @@ nil_to_f(mrb_state *mrb, mrb_value obj)
3335 * nil.to_i -> 0
3436 *
3537 * Always returns zero.
38+ *
39+ * @mrbgem mruby-object-ext
3640 */
37-
3841 static mrb_value
3942 nil_to_i(mrb_state *mrb, mrb_value obj)
4043 {
@@ -57,8 +60,9 @@ nil_to_i(mrb_state *mrb, mrb_value obj)
5760 * end
5861 * k = KlassWithSecret.new
5962 * k.instance_exec(5) {|x| @secret+x } #=> 104
63+ *
64+ * @mrbgem mruby-object-ext
6065 */
61-
6266 static mrb_value
6367 mrb_obj_instance_exec(mrb_state *mrb, mrb_value self)
6468 {
--- a/mrbgems/mruby-objectspace/src/mruby_objectspace.c
+++ b/mrbgems/mruby-objectspace/src/mruby_objectspace.c
@@ -174,6 +174,12 @@ os_each_object(mrb_state *mrb, mrb_value self)
174174 void
175175 mrb_mruby_objectspace_gem_init(mrb_state *mrb)
176176 {
177+
178+ /**
179+ * ObjectSpace
180+ *
181+ * @mrbgem mruby-objectspace
182+ */
177183 struct RClass *os = mrb_define_module(mrb, "ObjectSpace");
178184 mrb_define_class_method(mrb, os, "count_objects", os_count_objects, MRB_ARGS_OPT(1));
179185 mrb_define_class_method(mrb, os, "each_object", os_each_object, MRB_ARGS_OPT(1));
--- a/mrbgems/mruby-print/mrblib/print.rb
+++ b/mrbgems/mruby-print/mrblib/print.rb
@@ -1,11 +1,9 @@
1-##
2-# Kernel
3-#
4-# ISO 15.3.1
51 module Kernel
2+
63 ##
74 # Invoke method +print+ on STDOUT and passing +*args+
85 #
6+ # @mrbgem mruby-print
97 # ISO 15.3.1.2.10
108 def print(*args)
119 i = 0
@@ -19,6 +17,7 @@ module Kernel
1917 ##
2018 # Invoke method +puts+ on STDOUT and passing +*args*+
2119 #
20+ # @mrbgem mruby-print
2221 # ISO 15.3.1.2.11
2322 def puts(*args)
2423 i = 0
@@ -36,6 +35,7 @@ module Kernel
3635 ##
3736 # Print human readable object description
3837 #
38+ # @mrbgem mruby-print
3939 # ISO 15.3.1.3.34
4040 def p(*args)
4141 i = 0
--- a/mrbgems/mruby-proc-ext/mrblib/proc.rb
+++ b/mrbgems/mruby-proc-ext/mrblib/proc.rb
@@ -1,17 +1,21 @@
11 class Proc
22
3+ # @mrbgem mruby-proc-ext
34 def ===(*args)
45 call(*args)
56 end
67
8+ # @mrbgem mruby-proc-ext
79 def yield(*args)
810 call(*args)
911 end
1012
13+ # @mrbgem mruby-proc-ext
1114 def to_proc
1215 self
1316 end
1417
18+ # @mrbgem mruby-proc-ext
1519 def curry(arity=self.arity)
1620 type = :proc
1721 abs = lambda {|a| a < 0 ? -a - 1 : a}
--- a/mrbgems/mruby-proc-ext/src/proc.c
+++ b/mrbgems/mruby-proc-ext/src/proc.c
@@ -5,6 +5,9 @@
55 #include "mruby/string.h"
66 #include "mruby/debug.h"
77
8+/**
9+ * @mrbgem mruby-proc-ext
10+ */
811 static mrb_value
912 mrb_proc_lambda(mrb_state *mrb, mrb_value self)
1013 {
@@ -12,6 +15,9 @@ mrb_proc_lambda(mrb_state *mrb, mrb_value self)
1215 return mrb_bool_value(MRB_PROC_STRICT_P(p));
1316 }
1417
18+/**
19+ * @mrbgem mruby-proc-ext
20+ */
1521 static mrb_value
1622 mrb_proc_source_location(mrb_state *mrb, mrb_value self)
1723 {
@@ -33,6 +39,9 @@ mrb_proc_source_location(mrb_state *mrb, mrb_value self)
3339 }
3440 }
3541
42+/**
43+ * @mrbgem mruby-proc-ext
44+ */
3645 static mrb_value
3746 mrb_proc_inspect(mrb_state *mrb, mrb_value self)
3847 {
@@ -67,6 +76,9 @@ mrb_proc_inspect(mrb_state *mrb, mrb_value self)
6776 return str;
6877 }
6978
79+/**
80+ * @mrbgem mruby-proc-ext
81+ */
7082 static mrb_value
7183 mrb_kernel_proc(mrb_state *mrb, mrb_value self)
7284 {
@@ -88,8 +100,9 @@ mrb_kernel_proc(mrb_state *mrb, mrb_value self)
88100 *
89101 * prc = lambda{|x, y=42, *other|}
90102 * prc.parameters #=> [[:req, :x], [:opt, :y], [:rest, :other]]
103+ *
104+ * @mrbgem mruby-proc-ext
91105 */
92-
93106 static mrb_value
94107 mrb_proc_parameters(mrb_state *mrb, mrb_value self)
95108 {
--- a/mrbgems/mruby-random/src/random.c
+++ b/mrbgems/mruby-random/src/random.c
@@ -104,6 +104,9 @@ get_random_state(mrb_state *mrb)
104104 return DATA_GET_PTR(mrb, random_val, &mt_state_type, mt_state);
105105 }
106106
107+/**
108+ * @mrbgem mruby-random
109+ */
107110 static mrb_value
108111 mrb_random_g_rand(mrb_state *mrb, mrb_value self)
109112 {
@@ -111,6 +114,9 @@ mrb_random_g_rand(mrb_state *mrb, mrb_value self)
111114 return mrb_random_rand(mrb, random);
112115 }
113116
117+/**
118+ * @mrbgem mruby-random
119+ */
114120 static mrb_value
115121 mrb_random_g_srand(mrb_state *mrb, mrb_value self)
116122 {
@@ -196,8 +202,9 @@ mrb_random_srand(mrb_state *mrb, mrb_value self)
196202 * ary.shuffle! -> ary
197203 *
198204 * Shuffles elements in self in place.
205+ *
206+ * @mrbgem mruby-random
199207 */
200-
201208 static mrb_value
202209 mrb_ary_shuffle_bang(mrb_state *mrb, mrb_value ary)
203210 {
@@ -234,8 +241,9 @@ mrb_ary_shuffle_bang(mrb_state *mrb, mrb_value ary)
234241 * ary.shuffle -> new_ary
235242 *
236243 * Returns a new array with elements of self shuffled.
244+ *
245+ * @mrbgem mruby-random
237246 */
238-
239247 static mrb_value
240248 mrb_ary_shuffle(mrb_state *mrb, mrb_value ary)
241249 {
@@ -258,8 +266,9 @@ mrb_ary_shuffle(mrb_state *mrb, mrb_value ary)
258266 *
259267 * If the array is empty the first form returns +nil+ and the second form
260268 * returns an empty array.
269+ *
270+ * @mrbgem mruby-random
261271 */
262-
263272 static mrb_value
264273 mrb_ary_sample(mrb_state *mrb, mrb_value ary)
265274 {
@@ -323,6 +332,9 @@ void mrb_mruby_random_gem_init(mrb_state *mrb)
323332 mrb_define_method(mrb, mrb->kernel_module, "rand", mrb_random_g_rand, MRB_ARGS_OPT(1));
324333 mrb_define_method(mrb, mrb->kernel_module, "srand", mrb_random_g_srand, MRB_ARGS_OPT(1));
325334
335+ /**
336+ * @mrbgem mruby-random
337+ */
326338 random = mrb_define_class(mrb, "Random", mrb->object_class);
327339 MRB_SET_INSTANCE_TT(random, MRB_TT_DATA);
328340 mrb_define_class_method(mrb, random, "rand", mrb_random_g_rand, MRB_ARGS_OPT(1));
--- a/mrbgems/mruby-range-ext/src/range.c
+++ b/mrbgems/mruby-range-ext/src/range.c
@@ -38,6 +38,8 @@ r_lt(mrb_state *mrb, mrb_value a, mrb_value b)
3838 * ("a".."z").cover?("c") #=> true
3939 * ("a".."z").cover?("5") #=> false
4040 * ("a".."z").cover?("cc") #=> true
41+ *
42+ * @mrbgem mruby-range-ext
4143 */
4244 static mrb_value
4345 mrb_range_cover(mrb_state *mrb, mrb_value range)
@@ -75,6 +77,8 @@ mrb_range_cover(mrb_state *mrb, mrb_value range)
7577 *
7678 * (10..20).first #=> 10
7779 * (10..20).first(3) #=> [10, 11, 12]
80+ *
81+ * @mrbgem mruby-range-ext
7882 */
7983 static mrb_value
8084 mrb_range_first(mrb_state *mrb, mrb_value range)
@@ -106,6 +110,8 @@ mrb_range_first(mrb_state *mrb, mrb_value range)
106110 * (10...20).last #=> 20
107111 * (10..20).last(3) #=> [18, 19, 20]
108112 * (10...20).last(3) #=> [17, 18, 19]
113+ *
114+ * @mrbgem mruby-range-ext
109115 */
110116 static mrb_value
111117 mrb_range_last(mrb_state *mrb, mrb_value range)
@@ -131,8 +137,9 @@ mrb_range_last(mrb_state *mrb, mrb_value range)
131137 *
132138 * (10..20).size #=> 11
133139 * ('a'..'z').size #=> nil
140+ *
141+ * @mrbgem mruby-range-ext
134142 */
135-
136143 static mrb_value
137144 mrb_range_size(mrb_state *mrb, mrb_value range)
138145 {
--- a/mrbgems/mruby-sprintf/mrblib/string.rb
+++ b/mrbgems/mruby-sprintf/mrblib/string.rb
@@ -1,4 +1,6 @@
11 class String
2+
3+ # @mrbgem mruby-sprintf
24 def %(args)
35 if args.is_a? Array
46 sprintf(self, *args)
--- a/mrbgems/mruby-sprintf/src/kernel.c
+++ b/mrbgems/mruby-sprintf/src/kernel.c
@@ -6,6 +6,9 @@
66
77 #include "mruby.h"
88
9+/**
10+ * @mrbgem mruby-sprintf
11+ */
912 mrb_value mrb_f_sprintf(mrb_state *mrb, mrb_value obj); /* in sprintf.c */
1013
1114 void
--- a/mrbgems/mruby-string-ext/mrblib/string.rb
+++ b/mrbgems/mruby-string-ext/mrblib/string.rb
@@ -9,6 +9,7 @@ class String
99 # a = "abcde"
1010 # a.clear #=> ""
1111 #
12+ # @mrbgem mruby-string-ext
1213 def clear
1314 self.replace("")
1415 end
@@ -23,6 +24,7 @@ class String
2324 # " hello ".lstrip #=> "hello "
2425 # "hello".lstrip #=> "hello"
2526 #
27+ # @mrbgem mruby-string-ext
2628 def lstrip
2729 a = 0
2830 z = self.size - 1
@@ -40,6 +42,7 @@ class String
4042 # " hello ".rstrip #=> " hello"
4143 # "hello".rstrip #=> "hello"
4244 #
45+ # @mrbgem mruby-string-ext
4346 def rstrip
4447 a = 0
4548 z = self.size - 1
@@ -56,6 +59,7 @@ class String
5659 # " hello ".strip #=> "hello"
5760 # "\tgoodbye\r\n".strip #=> "goodbye"
5861 #
62+ # @mrbgem mruby-string-ext
5963 def strip
6064 a = 0
6165 z = self.size - 1
@@ -75,6 +79,7 @@ class String
7579 # " hello ".lstrip #=> "hello "
7680 # "hello".lstrip! #=> nil
7781 #
82+ # @mrbgem mruby-string-ext
7883 def lstrip!
7984 s = self.lstrip
8085 (s == self) ? nil : self.replace(s)
@@ -91,6 +96,7 @@ class String
9196 # " hello ".rstrip #=> " hello"
9297 # "hello".rstrip! #=> nil
9398 #
99+ # @mrbgem mruby-string-ext
94100 def rstrip!
95101 s = self.rstrip
96102 (s == self) ? nil : self.replace(s)
@@ -103,6 +109,7 @@ class String
103109 # Removes leading and trailing whitespace from <i>str</i>. Returns
104110 # <code>nil</code> if <i>str</i> was not altered.
105111 #
112+ # @mrbgem mruby-string-ext
106113 def strip!
107114 s = self.strip
108115 (s == self) ? nil : self.replace(s)
@@ -119,6 +126,7 @@ class String
119126 # "abcdef".casecmp("abcdefg") #=> -1
120127 # "abcdef".casecmp("ABCDEF") #=> 0
121128 #
129+ # @mrbgem mruby-string-ext
122130 def casecmp(str)
123131 self.downcase <=> str.to_str.downcase
124132 rescue NoMethodError
@@ -136,6 +144,7 @@ class String
136144 end
137145 end
138146
147+ # @mrbgem mruby-string-ext
139148 def rpartition(sep)
140149 raise TypeError, "type mismatch: #{sep.class} given" unless sep.is_a? String
141150 n = rindex(sep)
@@ -163,6 +172,7 @@ class String
163172 # string.slice!("r") #=> "r"
164173 # string #=> "thsa sting"
165174 #
175+ # @mrbgem mruby-string-ext
166176 def slice!(arg1, arg2=nil)
167177 raise "wrong number of arguments (for 1..2)" if arg1.nil? && arg2.nil?
168178
@@ -234,6 +244,7 @@ class String
234244 # "abcd".insert(-3, 'X') #=> "abXcd"
235245 # "abcd".insert(-1, 'X') #=> "abcdX"
236246 #
247+ # @mrbgem mruby-string-ext
237248 def insert(idx, str)
238249 pos = idx.to_i
239250 pos += self.size + 1 if pos < 0
@@ -256,6 +267,8 @@ class String
256267 # "hello".ljust(4) #=> "hello"
257268 # "hello".ljust(20) #=> "hello "
258269 # "hello".ljust(20, '1234') #=> "hello123412341234123"
270+ #
271+ # @mrbgem mruby-string-ext
259272 def ljust(idx, padstr = ' ')
260273 if idx <= self.size
261274 return self
@@ -297,6 +310,7 @@ class String
297310 # "25".upto("5").to_a #=> []
298311 # "07".upto("11").to_a #=> ["07", "08", "09", "10", "11"]
299312 #
313+ # @mrbgem mruby-string-ext
300314 def upto(other_str, excl=false, &block)
301315 return to_enum :upto, other_str, excl unless block
302316
@@ -311,6 +325,7 @@ class String
311325 end
312326 end
313327
328+ # @mrbgem mruby-string-ext
314329 def chars(&block)
315330 if block_given?
316331 self.split('').map do |i|
@@ -323,6 +338,7 @@ class String
323338 end
324339 alias each_char chars
325340
341+ # @mrbgem mruby-string-ext
326342 def codepoints(&block)
327343 len = self.size
328344
--- a/mrbgems/mruby-string-ext/src/string.c
+++ b/mrbgems/mruby-string-ext/src/string.c
@@ -5,6 +5,9 @@
55 #include "mruby/string.h"
66 #include "mruby/range.h"
77
8+/**
9+ * @mrbgem mruby-string-ext
10+ */
811 static mrb_value
912 mrb_str_getbyte(mrb_state *mrb, mrb_value str)
1013 {
@@ -19,6 +22,9 @@ mrb_str_getbyte(mrb_state *mrb, mrb_value str)
1922 return mrb_fixnum_value((unsigned char)RSTRING_PTR(str)[pos]);
2023 }
2124
25+/**
26+ * @mrbgem mruby-string-ext
27+ */
2228 static mrb_value
2329 mrb_str_setbyte(mrb_state *mrb, mrb_value str)
2430 {
@@ -38,6 +44,9 @@ mrb_str_setbyte(mrb_state *mrb, mrb_value str)
3844 return mrb_fixnum_value((unsigned char)byte);
3945 }
4046
47+/**
48+ * @mrbgem mruby-string-ext
49+ */
4150 static mrb_value
4251 mrb_str_byteslice(mrb_state *mrb, mrb_value str)
4352 {
@@ -79,6 +88,8 @@ mrb_str_byteslice(mrb_state *mrb, mrb_value str)
7988 * Equivalent to <code>String#swapcase</code>, but modifies the receiver in
8089 * place, returning <i>str</i>, or <code>nil</code> if no changes were made.
8190 * Note: case conversion is effective only in ASCII region.
91+ *
92+ * @mrbgem mruby-string-ext
8293 */
8394 static mrb_value
8495 mrb_str_swapcase_bang(mrb_state *mrb, mrb_value str)
@@ -116,6 +127,8 @@ mrb_str_swapcase_bang(mrb_state *mrb, mrb_value str)
116127 *
117128 * "Hello".swapcase #=> "hELLO"
118129 * "cYbEr_PuNk11".swapcase #=> "CyBeR_pUnK11"
130+ *
131+ * @mrbgem mruby-string-ext
119132 */
120133 static mrb_value
121134 mrb_str_swapcase(mrb_state *mrb, mrb_value self)
@@ -141,6 +154,8 @@ mrb_str_swapcase(mrb_state *mrb, mrb_value self)
141154 * a = "hello "
142155 * a << "world" #=> "hello world"
143156 * a.concat(33) #=> "hello world!"
157+ *
158+ * @mrbgem mruby-string-ext
144159 */
145160 static mrb_value
146161 mrb_str_concat2(mrb_state *mrb, mrb_value self)
@@ -163,6 +178,8 @@ mrb_str_concat2(mrb_state *mrb, mrb_value self)
163178 * "hello".start_with?("heaven", "hell") #=> true
164179 * "hello".start_with?("heaven", "paradise") #=> false
165180 * "h".start_with?("heaven", "hell") #=> false
181+ *
182+ * @mrbgem mruby-string-ext
166183 */
167184 static mrb_value
168185 mrb_str_start_with(mrb_state *mrb, mrb_value self)
@@ -192,6 +209,8 @@ mrb_str_start_with(mrb_state *mrb, mrb_value self)
192209 * str.end_with?([suffixes]+) -> true or false
193210 *
194211 * Returns true if +str+ ends with one of the +suffixes+ given.
212+ *
213+ * @mrbgem mruby-string-ext
195214 */
196215 static mrb_value
197216 mrb_str_end_with(mrb_state *mrb, mrb_value self)
@@ -218,12 +237,18 @@ mrb_str_end_with(mrb_state *mrb, mrb_value self)
218237 return mrb_false_value();
219238 }
220239
240+/*
241+ * @mrbgem mruby-string-ext
242+ */
221243 static mrb_value
222244 mrb_str_hex(mrb_state *mrb, mrb_value self)
223245 {
224246 return mrb_str_to_inum(mrb, self, 16, FALSE);
225247 }
226248
249+/*
250+ * @mrbgem mruby-string-ext
251+ */
227252 static mrb_value
228253 mrb_str_oct(mrb_state *mrb, mrb_value self)
229254 {
@@ -238,6 +263,8 @@ mrb_str_oct(mrb_state *mrb, mrb_value self)
238263 *
239264 * a = "abcde"
240265 * a.chr #=> "a"
266+ *
267+ * @mrbgem mruby-string-ext
241268 */
242269 static mrb_value
243270 mrb_str_chr(mrb_state *mrb, mrb_value self)
@@ -245,6 +272,9 @@ mrb_str_chr(mrb_state *mrb, mrb_value self)
245272 return mrb_str_substr(mrb, self, 0, 1);
246273 }
247274
275+/*
276+ * @mrbgem mruby-string-ext
277+ */
248278 static mrb_value
249279 mrb_fixnum_chr(mrb_state *mrb, mrb_value num)
250280 {
@@ -298,6 +328,8 @@ mrb_fixnum_chr(mrb_state *mrb, mrb_value num)
298328 *
299329 * a = "abc\ndef"
300330 * a.lines #=> ["abc\n", "def"]
331+ *
332+ * @mrbgem mruby-string-ext
301333 */
302334 static mrb_value
303335 mrb_str_lines(mrb_state *mrb, mrb_value self)
@@ -345,6 +377,8 @@ mrb_str_lines(mrb_state *mrb, mrb_value self)
345377 *
346378 * a = "abc"
347379 * a.succ #=> "abd"
380+ *
381+ * @mrbgem mruby-string-ext
348382 */
349383 static mrb_value
350384 mrb_str_succ_bang(mrb_state *mrb, mrb_value self)
@@ -419,6 +453,9 @@ mrb_str_succ_bang(mrb_state *mrb, mrb_value self)
419453 return self;
420454 }
421455
456+/*
457+ * @mrbgem mruby-string-ext
458+ */
422459 static mrb_value
423460 mrb_str_succ(mrb_state *mrb, mrb_value self)
424461 {
@@ -438,6 +475,8 @@ mrb_str_succ(mrb_state *mrb, mrb_value self)
438475 * a = "world"
439476 * a.prepend("hello ") #=> "hello world"
440477 * a #=> "hello world"
478+ *
479+ * @mrbgem mruby-string-ext
441480 */
442481 static mrb_value
443482 mrb_str_prepend(mrb_state *mrb, mrb_value self)
@@ -516,6 +555,9 @@ utf8code(unsigned char* p)
516555 return p[0];
517556 }
518557
558+/*
559+ * @mrbgem mruby-string-ext
560+ */
519561 static mrb_value
520562 mrb_str_ord(mrb_state* mrb, mrb_value str)
521563 {
--- a/mrbgems/mruby-struct/src/struct.c
+++ b/mrbgems/mruby-struct/src/struct.c
@@ -739,26 +739,28 @@ mrb_struct_values_at(mrb_state *mrb, mrb_value self)
739739
740740 return mrb_get_values_at(mrb, self, RSTRUCT_LEN(self), argc, argv, struct_aref_int);
741741 }
742-
743-/*
744- * A <code>Struct</code> is a convenient way to bundle a number of
745- * attributes together, using accessor methods, without having to write
746- * an explicit class.
747- *
748- * The <code>Struct</code> class is a generator of specific classes,
749- * each one of which is defined to hold a set of variables and their
750- * accessors. In these examples, we'll call the generated class
751- * "<i>Customer</i>Class," and we'll show an example instance of that
752- * class as "<i>Customer</i>Inst."
753- *
754- * In the descriptions that follow, the parameter <i>symbol</i> refers
755- * to a symbol, which is either a quoted string or a
756- * <code>Symbol</code> (such as <code>:name</code>).
757- */
758742 void
759743 mrb_mruby_struct_gem_init(mrb_state* mrb)
760744 {
761745 struct RClass *st;
746+
747+ /*
748+ * A <code>Struct</code> is a convenient way to bundle a number of
749+ * attributes together, using accessor methods, without having to write
750+ * an explicit class.
751+ *
752+ * The <code>Struct</code> class is a generator of specific classes,
753+ * each one of which is defined to hold a set of variables and their
754+ * accessors. In these examples, we'll call the generated class
755+ * "<i>Customer</i>Class," and we'll show an example instance of that
756+ * class as "<i>Customer</i>Inst."
757+ *
758+ * In the descriptions that follow, the parameter <i>symbol</i> refers
759+ * to a symbol, which is either a quoted string or a
760+ * <code>Symbol</code> (such as <code>:name</code>).
761+ *
762+ * @mrbgem mruby-struct
763+ */
762764 st = mrb_define_class(mrb, "Struct", mrb->object_class);
763765
764766 mrb_define_class_method(mrb, st, "new", mrb_struct_s_def, MRB_ARGS_ANY()); /* 15.2.18.3.1 */
--- a/mrbgems/mruby-symbol-ext/mrblib/symbol.rb
+++ b/mrbgems/mruby-symbol-ext/mrblib/symbol.rb
@@ -1,6 +1,7 @@
11 class Symbol
22 include Comparable
33
4+ # @mrbgem mruby-symbol-ext
45 alias intern to_sym
56
67 def to_proc
@@ -14,7 +15,8 @@ class Symbol
1415 # sym.capitalize -> symbol
1516 #
1617 # Same as <code>sym.to_s.capitalize.intern</code>.
17-
18+ #
19+ # @mrbgem mruby-symbol-ext
1820 def capitalize
1921 (self.to_s.capitalize! || self).to_sym
2022 end
@@ -24,7 +26,8 @@ class Symbol
2426 # sym.downcase -> symbol
2527 #
2628 # Same as <code>sym.to_s.downcase.intern</code>.
27-
29+ #
30+ # @mrbgem mruby-symbol-ext
2831 def downcase
2932 (self.to_s.downcase! || self).to_sym
3033 end
@@ -34,7 +37,8 @@ class Symbol
3437 # sym.upcase -> symbol
3538 #
3639 # Same as <code>sym.to_s.upcase.intern</code>.
37-
40+ #
41+ # @mrbgem mruby-symbol-ext
3842 def upcase
3943 (self.to_s.upcase! || self).to_sym
4044 end
@@ -44,7 +48,8 @@ class Symbol
4448 # sym.casecmp(other) -> -1, 0, +1 or nil
4549 #
4650 # Case-insensitive version of <code>Symbol#<=></code>.
47-
51+ #
52+ # @mrbgem mruby-symbol-ext
4853 def casecmp(other)
4954 return nil unless other.kind_of?(Symbol)
5055 lhs = self.to_s; lhs.upcase!
@@ -57,7 +62,8 @@ class Symbol
5762 # sym.empty? -> true or false
5863 #
5964 # Returns that _sym_ is :"" or not.
60-
65+ #
66+ # @mrbgem mruby-symbol-ext
6167 def empty?
6268 self.length == 0
6369 end
--- a/mrbgems/mruby-symbol-ext/src/symbol.c
+++ b/mrbgems/mruby-symbol-ext/src/symbol.c
@@ -21,6 +21,8 @@ typedef struct symbol_name {
2121 * :default_proc, :compact, :extend,
2222 * :Tms, :getwd, :$=, :ThreadGroup,
2323 * :wait2, :$>]
24+ *
25+ * @mrbgem mruby-symbol-ext
2426 */
2527 static mrb_value
2628 mrb_sym_all_symbols(mrb_state *mrb, mrb_value self)
@@ -40,6 +42,8 @@ mrb_sym_all_symbols(mrb_state *mrb, mrb_value self)
4042 * sym.length -> integer
4143 *
4244 * Same as <code>sym.to_s.length</code>.
45+ *
46+ * @mrbgem mruby-symbol-ext
4347 */
4448 static mrb_value
4549 mrb_sym_length(mrb_state *mrb, mrb_value self)
--- a/mrbgems/mruby-time/mrblib/time.rb
+++ b/mrbgems/mruby-time/mrblib/time.rb
@@ -1,3 +1,6 @@
1+# Time class
2+#
3+# @mrbgem mruby-time
14 class Time
25 def sunday?; wday == 0 end
36 def monday?; wday == 1 end
--- a/mrbgems/mruby-toplevel-ext/mrblib/toplevel.rb
+++ b/mrbgems/mruby-toplevel-ext/mrblib/toplevel.rb
@@ -1,11 +1,16 @@
1-
1+# @mrbgem mruby-toplevel-ext
22 def self.include (*modules)
33 self.class.include(*modules)
44 end
55
6+# @mrbgem mruby-toplevel-ext
67 def self.private(*methods)
78 end
9+
10+# @mrbgem mruby-toplevel-ext
811 def self.protected(*methods)
912 end
13+
14+# @mrbgem mruby-toplevel-ext
1015 def self.public(*methods)
1116 end