{"action":"closed","issue":{"url":"https://api.github.com/repos/panthomakos/guard-yard/issues/20","labels_url":"https://api.github.com/repos/panthomakos/guard-yard/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/panthomakos/guard-yard/issues/20/comments","events_url":"https://api.github.com/repos/panthomakos/guard-yard/issues/20/events","html_url":"https://github.com/panthomakos/guard-yard/issues/20","id":120258783,"number":20,"title":"NoMethodError: undefined method `namespace' for nil:NilClass (from YARD)","user":{"login":"paddor","id":8876,"avatar_url":"https://avatars.githubusercontent.com/u/8876?v=3","gravatar_id":"","url":"https://api.github.com/users/paddor","html_url":"https://github.com/paddor","followers_url":"https://api.github.com/users/paddor/followers","following_url":"https://api.github.com/users/paddor/following{/other_user}","gists_url":"https://api.github.com/users/paddor/gists{/gist_id}","starred_url":"https://api.github.com/users/paddor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paddor/subscriptions","organizations_url":"https://api.github.com/users/paddor/orgs","repos_url":"https://api.github.com/users/paddor/repos","events_url":"https://api.github.com/users/paddor/events{/privacy}","received_events_url":"https://api.github.com/users/paddor/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-12-03T20:09:10Z","updated_at":"2015-12-16T07:32:15Z","closed_at":"2015-12-16T07:32:15Z","body":"Consider the following Guardfile:\r\n\r\n```ruby\r\nguard 'yard' do\r\n  watch(%r{lib/.+\\.rb})\r\nend\r\n```\r\n\r\nWhen I run:\r\n\r\n```\r\nrm -rf .yardoc doc\r\nbundle exec guard\r\n```\r\n\r\nI get:\r\n\r\n```\r\n20:45:48 - INFO - [Guard::Yard] Documentation missing.\r\n20:45:48 - INFO - [Guard::Yard] Generating all documentation.\r\nFiles:          36\r\nModules:         7 (    5 undocumented)\r\nClasses:        67 (   26 undocumented)\r\nConstants:      32 (   30 undocumented)\r\nMethods:       791 (   46 undocumented)\r\n 88.07% documented\r\n20:45:56 - INFO - [Guard::Yard] Documentation has been generated.\r\n20:45:56 - INFO - [Guard::Yard] Stopping YARD Documentation Server.\r\n20:45:56 - INFO - [Guard::Yard] Starting YARD Documentation Server.\r\n[2015-12-03 20:45:56] INFO  WEBrick 1.3.1\r\n[2015-12-03 20:45:56] INFO  ruby 2.2.3 (2015-08-18) [x86_64-darwin14]\r\n[2015-12-03 20:45:56] INFO  WEBrick::HTTPServer#start: pid=10327 port=8808\r\n20:45:57 - INFO - [Guard::Yard] Server successfully started.\r\n20:45:57 - INFO - Guard is now watching at '/Users/paddor/src/ruby/cztop'\r\n```\r\n\r\nSo far so good. When I change a file, I get:\r\n\r\n```\r\n20:46:00 - INFO - [Guard::Yard] Detected changes in lib/cztop/frame.rb.\r\n20:46:00 - ERROR - Guard::Yard failed to achieve its <run_on_changes>, exception was:\r\n> [#] NoMethodError: undefined method `namespace' for nil:NilClass\r\n> [#] /Users/paddor/.gem/ruby/2.2.3/gems/yard-0.8.7.6/lib/yard/serializers/file_system_serializer.rb:57:in `serialized_path'\r\n> [#] /Users/paddor/.gem/ruby/2.2.3/gems/yard-0.8.7.6/lib/yard/templates/helpers/html_helper.rb:359:in `url_for_file'\r\n> [#] /Users/paddor/.gem/ruby/2.2.3/gems/yard-0.8.7.6/lib/yard/templates/helpers/html_helper.rb:376:in `url_for_list'\r\n> [#] /Users/paddor/.gem/ruby/2.2.3/gems/yard-0.8.7.6/templates/default/fulldoc/html/setup.rb:165:in `generate_list_contents'\r\n> [#] /Users/paddor/.gem/ruby/2.2.3/gems/yard-0.8.7.6/templates/default/fulldoc/html/setup.rb:151:in `generate_class_list'\r\n> [#] /Users/paddor/.gem/ruby/2.2.3/gems/yard-0.8.7.6/templates/default/fulldoc/html/setup.rb:125:in `block in generate_assets'\r\n> [#] /Users/paddor/.gem/ruby/2.2.3/gems/yard-0.8.7.6/templates/default/fulldoc/html/setup.rb:122:in `each'\r\n> [#] /Users/paddor/.gem/ruby/2.2.3/gems/yard-0.8.7.6/templates/default/fulldoc/html/setup.rb:122:in `generate_assets'\r\n> [#] /Users/paddor/.gem/ruby/2.2.3/gems/yard-0.8.7.6/templates/default/fulldoc/html/setup.rb:7:in `init'\r\n> [#] /Users/paddor/.gem/ruby/2.2.3/gems/yard-0.8.7.6/lib/yard/templates/template.rb:185:in `initialize'\r\n> [#] /Users/paddor/.gem/ruby/2.2.3/gems/yard-0.8.7.6/lib/yard/templates/template.rb:130:in `new'\r\n> [#] /Users/paddor/.gem/ruby/2.2.3/gems/yard-0.8.7.6/lib/yard/templates/template.rb:135:in `run'\r\n> [#] /Users/paddor/.gem/ruby/2.2.3/gems/yard-0.8.7.6/lib/yard/templates/engine.rb:104:in `generate'\r\n> [#] /Users/paddor/.gem/ruby/2.2.3/gems/guard-yard-2.1.4/lib/guard/yard.rb:65:in `document'\r\n> [#] /Users/paddor/.gem/ruby/2.2.3/gems/guard-yard-2.1.4/lib/guard/yard.rb:38:in `block in run_on_changes'\r\n> [#] /Users/paddor/.gem/ruby/2.2.3/gems/guard-yard-2.1.4/lib/guard/yard.rb:38:in `each'\r\n> [#] /Users/paddor/.gem/ruby/2.2.3/gems/guard-yard-2.1.4/lib/guard/yard.rb:38:in `run_on_changes'\r\n> [#] /Users/paddor/.gem/ruby/2.2.3/gems/guard-2.13.0/lib/guard/runner.rb:82:in `block in _supervise'\r\n> [#] /Users/paddor/.gem/ruby/2.2.3/gems/guard-2.13.0/lib/guard/runner.rb:79:in `catch'\r\n> [#] /Users/paddor/.gem/ruby/2.2.3/gems/guard-2.13.0/lib/guard/runner.rb:79:in `_supervise'\r\n> [#] /Users/paddor/.gem/ruby/2.2.3/gems/guard-2.13.0/lib/guard/runner.rb:61:in `block (3 levels) in run_on_changes'\r\n> [#] /Users/paddor/.gem/ruby/2.2.3/gems/guard-2.13.0/lib/guard/runner.rb:56:in `each'\r\n> [#] /Users/paddor/.gem/ruby/2.2.3/gems/guard-2.13.0/lib/guard/runner.rb:56:in `block (2 levels) in run_on_changes'\r\n> [#] /Users/paddor/.gem/ruby/2.2.3/gems/guard-2.13.0/lib/guard/runner.rb:119:in `block (2 levels) in _run_group_plugins'\r\n> [#] /Users/paddor/.gem/ruby/2.2.3/gems/guard-2.13.0/lib/guard/runner.rb:117:in `each'\r\n> [#] /Users/paddor/.gem/ruby/2.2.3/gems/guard-2.13.0/lib/guard/runner.rb:117:in `block in _run_group_plugins'\r\n> [#] /Users/paddor/.gem/ruby/2.2.3/gems/guard-2.13.0/lib/guard/runner.rb:116:in `catch'\r\n> [#] /Users/paddor/.gem/ruby/2.2.3/gems/guard-2.13.0/lib/guard/runner.rb:116:in `_run_group_plugins'\r\n> [#] /Users/paddor/.gem/ruby/2.2.3/gems/guard-2.13.0/lib/guard/runner.rb:54:in `block in run_on_changes'\r\n> [#] /Users/paddor/.gem/ruby/2.2.3/gems/guard-2.13.0/lib/guard/runner.rb:53:in `each'\r\n> [#] /Users/paddor/.gem/ruby/2.2.3/gems/guard-2.13.0/lib/guard/runner.rb:53:in `run_on_changes'\r\n> [#] /Users/paddor/.gem/ruby/2.2.3/gems/guard-2.13.0/lib/guard/internals/queue.rb:23:in `process'\r\n> [#] /Users/paddor/.gem/ruby/2.2.3/gems/guard-2.13.0/lib/guard/commander.rb:43:in `start'\r\n> [#] /Users/paddor/.gem/ruby/2.2.3/gems/guard-2.13.0/lib/guard/cli/environments/valid.rb:16:in `start_guard'\r\n> [#] /Users/paddor/.gem/ruby/2.2.3/gems/guard-2.13.0/lib/guard/cli.rb:122:in `start'\r\n> [#] /Users/paddor/.gem/ruby/2.2.3/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'\r\n> [#] /Users/paddor/.gem/ruby/2.2.3/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'\r\n> [#] /Users/paddor/.gem/ruby/2.2.3/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'\r\n> [#] /Users/paddor/.gem/ruby/2.2.3/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'\r\n> [#] /Users/paddor/.gem/ruby/2.2.3/gems/guard-2.13.0/lib/guard/aruba_adapter.rb:32:in `execute'\r\n> [#] /Users/paddor/.gem/ruby/2.2.3/gems/guard-2.13.0/lib/guard/aruba_adapter.rb:19:in `execute!'\r\n> [#] /Users/paddor/.gem/ruby/2.2.3/gems/guard-2.13.0/bin/_guard-core:11:in `<main>'\r\n20:46:00 - INFO - Guard::Yard has just been fired\r\n[1] guard(main)>\r\n```\r\n\r\nNow this doesn't happen when I just run `yard`.\r\n\r\nAlso, often times, this `yard server` keeps running even if I quit the guard shell. I don't see the point of `yard server`. How to disable it?\r\n\r\nOr is the only sane way to do this like this?\r\n\r\n```ruby\r\nguard :shell do\r\n  watch(%r{lib/.+\\.rb}) do |m|\r\n    # regenreate documentation\r\n    puts \"Regenerating documentation ...\"\r\n    system(\"yard\")\r\n  end\r\nend\r\n```\r\n\r\nThanks for your help."}}