Sha256: c142974031186142c79ac3ff77cdd09de3432c4cdb4fb9586307e14f992fc8a0

Contents?: true

Size: 437 Bytes

Versions: 5

Compression:

Stored size: 437 Bytes

Contents

class YARD::Handlers::Ruby::Legacy::ExceptionHandler < YARD::Handlers::Ruby::Legacy::Base
  handles /\Araise(\s|\()/
  
  process do
    return unless owner.is_a?(MethodObject) # Only methods yield
    return if owner.has_tag?(:raise)

    if klass = statement.tokens.to_s[/^raise[\(\s]*(#{NAMESPACEMATCH})(?:\)|,|\s|(?:\s*(?:\.|\:\:)\s*)?new|$)/, 1]
      owner.docstring.add_tag YARD::Tags::Tag.new(:raise, '', klass)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
yard-0.5.8 lib/yard/handlers/ruby/legacy/exception_handler.rb
yard-0.5.7 lib/yard/handlers/ruby/legacy/exception_handler.rb
yard-0.5.6 lib/yard/handlers/ruby/legacy/exception_handler.rb
yard-0.5.5 lib/yard/handlers/ruby/legacy/exception_handler.rb
yard-0.5.4 lib/yard/handlers/ruby/legacy/exception_handler.rb