1 lib_dir = File.expand_path(File.join(File.dirname(__FILE__), '../../../lib'))
2 $LOAD_PATH.unshift(lib_dir)
4 require 'yard-google-code'
7 tags = Tags::Library.visible_tags - [:abstract, :deprecated, :note, :todo]
8 create_tag_methods(tags - [:example, :option, :overload, :see])
10 sections.any(:overload).push(T('docstring'))
14 if object.type == :method
15 return if object.name == :initialize && object.scope == :instance
16 return if object.tags(:return).size == 1 && object.tag(:return).types == ['void']
23 def tag(name, opts = nil)
24 return unless object.has_tag?(name)
25 opts ||= options_for_tag(name)
26 @no_names = true if opts[:no_names]
27 @no_types = true if opts[:no_types]
30 @no_names, @no_types = nil, nil
34 def create_tag_methods(tags)
36 next if respond_to?(tag)
37 instance_eval(<<-eof, __FILE__, __LINE__ + 1)
38 def #{tag}; tag(#{tag.inspect}) end
43 def options_for_tag(tag)
44 opts = {:no_types => true, :no_names => true}
45 case Tags::Library.factory_method_for(tag)
47 opts[:no_types] = false
48 when :with_types_and_name
49 opts[:no_types] = false
50 opts[:no_names] = false
52 opts[:no_names] = false