{"action":"created","issue":{"url":"https://api.github.com/repos/lsegal/yard/issues/867","labels_url":"https://api.github.com/repos/lsegal/yard/issues/867/labels{/name}","comments_url":"https://api.github.com/repos/lsegal/yard/issues/867/comments","events_url":"https://api.github.com/repos/lsegal/yard/issues/867/events","html_url":"https://github.com/lsegal/yard/issues/867","id":77946174,"number":867,"title":"Unhandled exception in YARD::Handlers::Ruby::CommentHandler","user":{"login":"DanRathbun","id":334837,"avatar_url":"https://avatars.githubusercontent.com/u/334837?v=3","gravatar_id":"","url":"https://api.github.com/users/DanRathbun","html_url":"https://github.com/DanRathbun","followers_url":"https://api.github.com/users/DanRathbun/followers","following_url":"https://api.github.com/users/DanRathbun/following{/other_user}","gists_url":"https://api.github.com/users/DanRathbun/gists{/gist_id}","starred_url":"https://api.github.com/users/DanRathbun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanRathbun/subscriptions","organizations_url":"https://api.github.com/users/DanRathbun/orgs","repos_url":"https://api.github.com/users/DanRathbun/repos","events_url":"https://api.github.com/users/DanRathbun/events{/privacy}","received_events_url":"https://api.github.com/users/DanRathbun/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-05-19T05:50:39Z","updated_at":"2015-05-19T08:37:26Z","closed_at":null,"body":"[Backstory] I want to have all the basic Ruby methods show in my API docs from BasicObject, Object, Kernel, & standard mixins (Comparable, Enumerable, etc.).. so I I have stub rb files (empty methods.)\r\n\r\nHaving some issues documenting core methods with the more obscure symbolic names.\r\n\r\nBut the BasicObject negation method takes the cake. I got some mediocre errors when I tried:\r\n```ruby\r\ndef !()\r\nend\r\n```\r\nand\r\n```\r\ndefine_method(:!) {} \r\n```\r\nSo, I decided to try the **`@!method`** directive (which appears on line 14 of the file.)\r\nHere is a snippet from the file: \r\n```ruby\r\n  class BasicObject\r\n\r\n    # @!method !()\r\n    # Negation of an object's boolean nature.\r\n    #  The Ruby interpreter will call this method upon the object (or result of expression,) immediately following the **!** operator.\r\n    #\r\n    # @example\r\n    #   no_key  = !dictionary.has_key?(:name)\r\n    #   invalid = !model.valid?\r\n    #   has_chars = !some_string.empty?\r\n    #\r\n    #  To explicitly call this method, you must use dot notation, or +send+ with the symbol +`:!`+ as an argument.\r\n    #\r\n    # @example\r\n    #   no_key  = dictionary.has_key?(:name).!\r\n    #   invalid = model.valid?.send(:!)\r\n    #   has_chars = some_string.empty?.__send__(:!)\r\n    #\r\n    # @return [Boolean] true if itself evaluates to false or nil, otherwise false.\r\n\r\n\r\n    # Not equal to. Test if two objects are not-equal.\r\n    # @param other [Object] the other object to compare.\r\n    # @return [Boolean] true if two objects are not-equal, otherwise false.\r\n    def !=(other)\r\n    end\r\n\r\n  end\r\n```\r\n\r\nThis is what spit out from YARD:\r\n```\r\n[error]: Unhandled exception in YARD::Handlers::Ruby::CommentHandler:\r\n[error]:   in `ruby/2.0/!init_ruby_20.rb`:14:\r\n\r\n        14:\r\n\r\n[error]: ArgumentError: invalid empty object name\r\n[error]: Stack trace:\r\n        C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/yard-0.8.7.6/lib/yard/code_objec\r\nts/base.rb:168:in `new'\r\n        C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/yard-0.8.7.6/lib/yard/tags/direc\r\ntives.rb:401:in `create_object'\r\n        C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/yard-0.8.7.6/lib/yard/tags/direc\r\ntives.rb:359:in `after_parse'\r\n        C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/yard-0.8.7.6/lib/yard/docstring_\r\nparser.rb:264:in `block in call_directives_after_parse'\r\n        C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/yard-0.8.7.6/lib/yard/docstring_\r\nparser.rb:263:in `each'\r\n        C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/yard-0.8.7.6/lib/yard/docstring_\r\nparser.rb:263:in `call_directives_after_parse'\r\n#... followed by a bunch of warnings about tag errors, unknown param names, etc.\r\n# (just stuff that needs fixing.)\r\n```\r\nThe negation method did not list on the doc page.\r\n\r\nRuby v2.0.0-p247\r\nYARD-0.8.7.6"},"comment":{"url":"https://api.github.com/repos/lsegal/yard/issues/comments/103399859","html_url":"https://github.com/lsegal/yard/issues/867#issuecomment-103399859","issue_url":"https://api.github.com/repos/lsegal/yard/issues/867","id":103399859,"user":{"login":"lsegal","id":686,"avatar_url":"https://avatars.githubusercontent.com/u/686?v=3","gravatar_id":"","url":"https://api.github.com/users/lsegal","html_url":"https://github.com/lsegal","followers_url":"https://api.github.com/users/lsegal/followers","following_url":"https://api.github.com/users/lsegal/following{/other_user}","gists_url":"https://api.github.com/users/lsegal/gists{/gist_id}","starred_url":"https://api.github.com/users/lsegal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lsegal/subscriptions","organizations_url":"https://api.github.com/users/lsegal/orgs","repos_url":"https://api.github.com/users/lsegal/repos","events_url":"https://api.github.com/users/lsegal/events{/privacy}","received_events_url":"https://api.github.com/users/lsegal/received_events","type":"User","site_admin":false},"created_at":"2015-05-19T08:37:26Z","updated_at":"2015-05-19T08:37:26Z","body":"> Tried the following instead of the @!method directive:\r\n\r\nThe SyntaxError you're seeing is coming from a real syntax error in Ruby. In other word, that's not legal Ruby code:\r\n\r\n```sh\r\n$ ruby test.rb\r\ntest.rb:1: `@!' is not allowed as an instance variable name\r\ntest.rb:1: syntax error, unexpected end-of-input\r\ndef @!()\r\n     ^\r\n```\r\n\r\nI'm not entirely sure what a \"mediocre error\" is (a stack trace would help) but YARD should support any valid method without using directives, and in my tests it does. This worked for me:\r\n\r\n```ruby\r\nclass Bar\r\n  # docstring here\r\n  def !()\r\n  end\r\nend\r\n```\r\n"}}