Sha256: 6b899d9cb427039c5ea061284cc142ee1e341ba126237987fb9eb77cbdaa929d

Contents?: true

Size: 489 Bytes

Versions: 7

Compression:

Stored size: 489 Bytes

Contents

# (see Ruby::ExceptionHandler)
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(?:if|unless|until)|;|(?:(?:\.|\:\:)\s*)?new|$)/, 1]
      owner.docstring.add_tag YARD::Tags::Tag.new(:raise, '', klass)
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
yard-0.6.8 lib/yard/handlers/ruby/legacy/exception_handler.rb
yard-0.6.7 lib/yard/handlers/ruby/legacy/exception_handler.rb
yard-0.6.6 lib/yard/handlers/ruby/legacy/exception_handler.rb
yard-0.6.5 lib/yard/handlers/ruby/legacy/exception_handler.rb
yard-0.6.4 lib/yard/handlers/ruby/legacy/exception_handler.rb
yard-0.6.3 lib/yard/handlers/ruby/legacy/exception_handler.rb
yard-0.6.2 lib/yard/handlers/ruby/legacy/exception_handler.rb