lib/inch/code_object/provider/yard/object/base.rb in inch-0.4.5 vs lib/inch/code_object/provider/yard/object/base.rb in inch-0.4.6
- old
+ new
@@ -16,10 +16,11 @@
# @return [String] the codebase's directory
attr_accessor :base_dir
# Tags considered by wrapper methods like {#has_code_example?}
CONSIDERED_YARD_TAGS = %w(api example param private return since)
+ AUTO_GENERATED_TAG_NAMES = %w(raise yield)
# convenient shortcuts to (YARD) code object
def_delegators :object, :type, :namespace, :source, :source_type, :group, :dynamic, :visibility
# @param object [YARD::CodeObjects::Base] the actual (YARD) code object
@@ -264,11 +265,11 @@
# @return [Array]
# YARD tags that are not already covered by other wrapper methods
def unconsidered_tags
@unconsidered_tags ||= tags.reject do |tag|
- (tag.tag_name == "raise" && tag.text.empty?) ||
+ auto_generated_tag?(tag) ||
CONSIDERED_YARD_TAGS.include?(tag.tag_name)
end
end
def __depth(i = 0)
@@ -287,9 +288,13 @@
def __private_tag
tag(:private) || (parent && parent.private_tag)
end
+ def auto_generated_tag?(tag)
+ tag.text.to_s.empty? &&
+ AUTO_GENERATED_TAG_NAMES.include?(tag.tag_name)
+ end
end
end
end
end
end