{"action":"opened","issue":{"url":"https://api.github.com/repos/guard/guard/issues/787","labels_url":"https://api.github.com/repos/guard/guard/issues/787/labels{/name}","comments_url":"https://api.github.com/repos/guard/guard/issues/787/comments","events_url":"https://api.github.com/repos/guard/guard/issues/787/events","html_url":"https://github.com/guard/guard/issues/787","id":104216379,"number":787,"title":"Guard confused by symlinked folders","user":{"login":"ITler","id":3343546,"avatar_url":"https://avatars.githubusercontent.com/u/3343546?v=3","gravatar_id":"","url":"https://api.github.com/users/ITler","html_url":"https://github.com/ITler","followers_url":"https://api.github.com/users/ITler/followers","following_url":"https://api.github.com/users/ITler/following{/other_user}","gists_url":"https://api.github.com/users/ITler/gists{/gist_id}","starred_url":"https://api.github.com/users/ITler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ITler/subscriptions","organizations_url":"https://api.github.com/users/ITler/orgs","repos_url":"https://api.github.com/users/ITler/repos","events_url":"https://api.github.com/users/ITler/events{/privacy}","received_events_url":"https://api.github.com/users/ITler/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-09-01T08:41:22Z","updated_at":"2015-09-01T08:41:22Z","closed_at":null,"body":"Hope filing the issue here is correct.\r\nWhen setting up my dev environment (current Ubuntu 14LTS, XFS filesystem, current rvm with ruby 2.2.1 and current gems) for coding puppet modules I ran into problems indicated by [duplicate directories error][dd].\r\nThat's why I follow [puppet module development recommendations][pmdr]. When I get to the point of using rspec, I've got following puppet module structure (tool based creation):\r\n\r\n    my_module /                            \r\n    - manifests                   \r\n      - init.pp                   \r\n    - spec                        \r\n      - classes                   \r\n        - init_spec.rb            \r\n      - fixtures                  \r\n        - modules                 \r\n          - my_module ---> symlink to module root\r\n    [...]\r\n\r\nWhen starting guard and the directory symlink `spec/fixtures/modules/my_module` already exists then guard (listen gem) is not able to recognize file modifications within my **entire module** path.  \r\nOn guard pry console `Guard.state.session.watchdirs` shows correct path.\r\n\r\n    #Guardfile\r\n    ignore %r{spec/fixtures} # does not help\r\n    notification :libnotify\r\n\r\n    guard 'rspec', :cmd => \"bundle exec rspec\", :cmd_additional_args => '-f d -c --exclude-pattern \"spec/fixtures/**/*\"' do # --exclude-pattern does not help\r\n      watch(%r{^spec/.+_spec\\.rb$})\r\n      watch('spec/spec_helper.rb')  { \"spec\" }\r\n    end\r\n\r\n    guard 'rspec', :cmd => \"bundle exec rspec\", :cmd_additional_args => '-f d -c --fail-fast --exclude-pattern \"spec/fixtures/**/*\"' do # --exclude-pattern does not help\r\n      watch(%r{^manifests/(.+)\\.pp$})  { |m| \"spec/classes/#{m[1]}_spec.rb\" }\r\n    end\r\n\r\nWhen creating `spec/fixtures/modules/my_module` **after** starting guard (usually using `rake spec_prep`), guard (listen) is **sometimes** working as expected. Sometimes guard doesn't recognize changes to manifest files (`manifests/*.pp`), sometimes changes to manifest's spec files (`spec/*_spec.rb`). So this work-around is not _stable_.\r\nI've just found your [Understanding-Guard guide][ug]. Great, I've found out, that using `-p` option will allow guard to work properly even if symlinked `spec/fixtures/modules/my_module` exists before starting guard. And this seems to be _stable_ behaviour.\r\n\r\nI couldn't work out answers to my follow up questions. Maybe, you could answers them. I would like to know:\r\n\r\n1. What are the detriments of using `-p`? There should be any (like increased CPU usage?), otherwise polling would be default behaviour of guard.\r\n2. Will there be an update of guard (or listen) that solidly solves that issue?\r\n3. What did I miss, in general?\r\n4. If this won't / can't be fixed shortly, I would need a stable and easy to handle work-around. What else could I do without changing the overall module file structure? (This seems to effect all users using this workflow)\r\n\r\n[pmdr]: https://docs.puppetlabs.com/guides/module_guides/bgtm.html\r\n[dd]: https://github.com/guard/listen/wiki/Duplicate-directory-errors\r\n[ug]: https://github.com/guard/guard/wiki/Understanding-Guard"}}