GitHub PullRequestReviewCommentEvent at 2014-11-12 18:55:46
Repository: listen
Actor: houndci
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/guard/listen/pulls/comments/20240903","id":20240903,"diff_hunk":"@@ -34,4 +37,101 @@\n       it { should eq 1234 }\n     end\n   end\n+\n+  describe 'multiple dirs' do\n+    subject do\n+      dirs = config.keys.map { |p| Pathname(p.to_s) }\n+      described_class.new(directories: dirs)\n+    end\n+\n+    let(:foo1) { double('foo1') }\n+    let(:foo2) { double('foo2') }\n+    let(:foo3) { double('foo3') }\n+\n+    before do\n+      allow(FSEvent).to receive(:new).and_return(*config.values, nil)\n+      config.each do |dir, obj|\n+        allow(obj).to receive(:watch).with(dir.to_s, latency: 0.1)\n+      end\n+      subject.configure\n+    end\n+\n+    describe 'configuration' do\n+      context 'with 1 directory' do\n+        let(:config) { { dir1: foo1 } }\n+\n+        it 'configures directory' do\n+          expect(foo1).to have_received(:watch).with('dir1', latency: 0.1)\n+        end\n+      end\n+\n+      context 'with 2 directories' do\n+        let(:config) { { dir1: foo1, dir2: foo2 } }\n+\n+        it 'configures directories' do\n+          expect(foo1).to have_received(:watch).with('dir1', latency: 0.1)\n+          expect(foo2).to have_received(:watch).with('dir2', latency: 0.1)\n+        end\n+      end\n+\n+      context 'with 3 directories' do\n+        let(:config) { { dir1: foo1, dir2: foo2, dir3: foo3 } }\n+\n+        it 'configures directories' do\n+          expect(foo1).to have_received(:watch).with('dir1', latency: 0.1)\n+          expect(foo2).to have_received(:watch).with('dir2', latency: 0.1)\n+          expect(foo3).to have_received(:watch).with('dir3', latency: 0.1)\n+        end\n+      end\n+    end\n+\n+    describe 'running threads' do\n+      let(:running) { [] }\n+\n+      before do\n+        started = Queue.new\n+        threads = Queue.new\n+\n+        config.each do |name, obj|\n+          allow(obj).to receive(:run).once do\n+            threads << Thread.current\n+            started << name\n+            sleep 5\n+          end\n+        end\n+\n+        Timeout.timeout(0.3) do\n+          subject.start\n+          sleep 0.1\n+        end\n+\n+        running << started.pop until started.empty?\n+\n+        killed = Queue.new\n+        killed << threads.pop.kill until threads.empty?\n+        killed.pop.join until killed.empty?\n+      end\n+\n+      context 'with 1 directory' do\n+        let(:config) { { dir1: foo1 } }\n+        it 'runs all the workers without blocking' do","path":"spec/lib/listen/adapter/darwin_spec.rb","position":90,"original_position":90,"commit_id":"6f8cec779d68c9ec761101bfd3d513c6df8557b7","original_commit_id":"6f8cec779d68c9ec761101bfd3d513c6df8557b7","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.","created_at":"2014-11-12T18:55:46Z","updated_at":"2014-11-12T18:55:46Z","html_url":"https://github.com/guard/listen/pull/270#discussion_r20240903","pull_request_url":"https://api.github.com/repos/guard/listen/pulls/270","_links":{"self":{"href":"https://api.github.com/repos/guard/listen/pulls/comments/20240903"},"html":{"href":"https://github.com/guard/listen/pull/270#discussion_r20240903"},"pull_request":{"href":"https://api.github.com/repos/guard/listen/pulls/270"}}},"pull_request":{"url":"https://api.github.com/repos/guard/listen/pulls/270","id":24315505,"html_url":"https://github.com/guard/listen/pull/270","diff_url":"https://github.com/guard/listen/pull/270.diff","patch_url":"https://github.com/guard/listen/pull/270.patch","issue_url":"https://api.github.com/repos/guard/listen/issues/270","number":270,"state":"open","locked":false,"title":"Fix 243 darwin dirs","user":{"login":"e2","id":150197,"avatar_url":"https://avatars.githubusercontent.com/u/150197?v=3","gravatar_id":"","url":"https://api.github.com/users/e2","html_url":"https://github.com/e2","followers_url":"https://api.github.com/users/e2/followers","following_url":"https://api.github.com/users/e2/following{/other_user}","gists_url":"https://api.github.com/users/e2/gists{/gist_id}","starred_url":"https://api.github.com/users/e2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/e2/subscriptions","organizations_url":"https://api.github.com/users/e2/orgs","repos_url":"https://api.github.com/users/e2/repos","events_url":"https://api.github.com/users/e2/events{/privacy}","received_events_url":"https://api.github.com/users/e2/received_events","type":"User","site_admin":false},"body":"- update rubocop setup,\r\n- fix rubocop offences + logging class (just to reduce lines for Rubocop)\r\n- each FSEvent in separate thread (so multiple dirs work)\r\n- prevent leaking threads which reference Listener mocks from other specs\r\n","created_at":"2014-11-12T18:55:28Z","updated_at":"2014-11-12T18:55:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3defae32e48842da0158ded6b9f4cd1d151ae86f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/guard/listen/pulls/270/commits","review_comments_url":"https://api.github.com/repos/guard/listen/pulls/270/comments","review_comment_url":"https://api.github.com/repos/guard/listen/pulls/comments/{number}","comments_url":"https://api.github.com/repos/guard/listen/issues/270/comments","statuses_url":"https://api.github.com/repos/guard/listen/statuses/6f8cec779d68c9ec761101bfd3d513c6df8557b7","head":{"label":"guard:fix_243_darwin_dirs","ref":"fix_243_darwin_dirs","sha":"6f8cec779d68c9ec761101bfd3d513c6df8557b7","user":{"login":"guard","id":351846,"avatar_url":"https://avatars.githubusercontent.com/u/351846?v=3","gravatar_id":"","url":"https://api.github.com/users/guard","html_url":"https://github.com/guard","followers_url":"https://api.github.com/users/guard/followers","following_url":"https://api.github.com/users/guard/following{/other_user}","gists_url":"https://api.github.com/users/guard/gists{/gist_id}","starred_url":"https://api.github.com/users/guard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guard/subscriptions","organizations_url":"https://api.github.com/users/guard/orgs","repos_url":"https://api.github.com/users/guard/repos","events_url":"https://api.github.com/users/guard/events{/privacy}","received_events_url":"https://api.github.com/users/guard/received_events","type":"Organization","site_admin":false},"repo":{"id":3148139,"name":"listen","full_name":"guard/listen","owner":{"login":"guard","id":351846,"avatar_url":"https://avatars.githubusercontent.com/u/351846?v=3","gravatar_id":"","url":"https://api.github.com/users/guard","html_url":"https://github.com/guard","followers_url":"https://api.github.com/users/guard/followers","following_url":"https://api.github.com/users/guard/following{/other_user}","gists_url":"https://api.github.com/users/guard/gists{/gist_id}","starred_url":"https://api.github.com/users/guard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guard/subscriptions","organizations_url":"https://api.github.com/users/guard/orgs","repos_url":"https://api.github.com/users/guard/repos","events_url":"https://api.github.com/users/guard/events{/privacy}","received_events_url":"https://api.github.com/users/guard/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/guard/listen","description":"The Listen gem listens to file modifications and notifies you about the changes.","fork":false,"url":"https://api.github.com/repos/guard/listen","forks_url":"https://api.github.com/repos/guard/listen/forks","keys_url":"https://api.github.com/repos/guard/listen/keys{/key_id}","collaborators_url":"https://api.github.com/repos/guard/listen/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/guard/listen/teams","hooks_url":"https://api.github.com/repos/guard/listen/hooks","issue_events_url":"https://api.github.com/repos/guard/listen/issues/events{/number}","events_url":"https://api.github.com/repos/guard/listen/events","assignees_url":"https://api.github.com/repos/guard/listen/assignees{/user}","branches_url":"https://api.github.com/repos/guard/listen/branches{/branch}","tags_url":"https://api.github.com/repos/guard/listen/tags","blobs_url":"https://api.github.com/repos/guard/listen/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/guard/listen/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/guard/listen/git/refs{/sha}","trees_url":"https://api.github.com/repos/guard/listen/git/trees{/sha}","statuses_url":"https://api.github.com/repos/guard/listen/statuses/{sha}","languages_url":"https://api.github.com/repos/guard/listen/languages","stargazers_url":"https://api.github.com/repos/guard/listen/stargazers","contributors_url":"https://api.github.com/repos/guard/listen/contributors","subscribers_url":"https://api.github.com/repos/guard/listen/subscribers","subscription_url":"https://api.github.com/repos/guard/listen/subscription","commits_url":"https://api.github.com/repos/guard/listen/commits{/sha}","git_commits_url":"https://api.github.com/repos/guard/listen/git/commits{/sha}","comments_url":"https://api.github.com/repos/guard/listen/comments{/number}","issue_comment_url":"https://api.github.com/repos/guard/listen/issues/comments/{number}","contents_url":"https://api.github.com/repos/guard/listen/contents/{+path}","compare_url":"https://api.github.com/repos/guard/listen/compare/{base}...{head}","merges_url":"https://api.github.com/repos/guard/listen/merges","archive_url":"https://api.github.com/repos/guard/listen/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/guard/listen/downloads","issues_url":"https://api.github.com/repos/guard/listen/issues{/number}","pulls_url":"https://api.github.com/repos/guard/listen/pulls{/number}","milestones_url":"https://api.github.com/repos/guard/listen/milestones{/number}","notifications_url":"https://api.github.com/repos/guard/listen/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/guard/listen/labels{/name}","releases_url":"https://api.github.com/repos/guard/listen/releases{/id}","created_at":"2012-01-10T20:02:29Z","updated_at":"2014-11-12T01:21:31Z","pushed_at":"2014-11-12T18:42:08Z","git_url":"git://github.com/guard/listen.git","ssh_url":"git@github.com:guard/listen.git","clone_url":"https://github.com/guard/listen.git","svn_url":"https://github.com/guard/listen","homepage":"https://rubygems.org/gems/listen","size":4175,"stargazers_count":548,"watchers_count":548,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":91,"mirror_url":null,"open_issues_count":14,"forks":91,"open_issues":14,"watchers":548,"default_branch":"master"}},"base":{"label":"guard:master","ref":"master","sha":"817e66ce9d7f0db1faae8f395ec72041abdab603","user":{"login":"guard","id":351846,"avatar_url":"https://avatars.githubusercontent.com/u/351846?v=3","gravatar_id":"","url":"https://api.github.com/users/guard","html_url":"https://github.com/guard","followers_url":"https://api.github.com/users/guard/followers","following_url":"https://api.github.com/users/guard/following{/other_user}","gists_url":"https://api.github.com/users/guard/gists{/gist_id}","starred_url":"https://api.github.com/users/guard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guard/subscriptions","organizations_url":"https://api.github.com/users/guard/orgs","repos_url":"https://api.github.com/users/guard/repos","events_url":"https://api.github.com/users/guard/events{/privacy}","received_events_url":"https://api.github.com/users/guard/received_events","type":"Organization","site_admin":false},"repo":{"id":3148139,"name":"listen","full_name":"guard/listen","owner":{"login":"guard","id":351846,"avatar_url":"https://avatars.githubusercontent.com/u/351846?v=3","gravatar_id":"","url":"https://api.github.com/users/guard","html_url":"https://github.com/guard","followers_url":"https://api.github.com/users/guard/followers","following_url":"https://api.github.com/users/guard/following{/other_user}","gists_url":"https://api.github.com/users/guard/gists{/gist_id}","starred_url":"https://api.github.com/users/guard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guard/subscriptions","organizations_url":"https://api.github.com/users/guard/orgs","repos_url":"https://api.github.com/users/guard/repos","events_url":"https://api.github.com/users/guard/events{/privacy}","received_events_url":"https://api.github.com/users/guard/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/guard/listen","description":"The Listen gem listens to file modifications and notifies you about the changes.","fork":false,"url":"https://api.github.com/repos/guard/listen","forks_url":"https://api.github.com/repos/guard/listen/forks","keys_url":"https://api.github.com/repos/guard/listen/keys{/key_id}","collaborators_url":"https://api.github.com/repos/guard/listen/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/guard/listen/teams","hooks_url":"https://api.github.com/repos/guard/listen/hooks","issue_events_url":"https://api.github.com/repos/guard/listen/issues/events{/number}","events_url":"https://api.github.com/repos/guard/listen/events","assignees_url":"https://api.github.com/repos/guard/listen/assignees{/user}","branches_url":"https://api.github.com/repos/guard/listen/branches{/branch}","tags_url":"https://api.github.com/repos/guard/listen/tags","blobs_url":"https://api.github.com/repos/guard/listen/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/guard/listen/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/guard/listen/git/refs{/sha}","trees_url":"https://api.github.com/repos/guard/listen/git/trees{/sha}","statuses_url":"https://api.github.com/repos/guard/listen/statuses/{sha}","languages_url":"https://api.github.com/repos/guard/listen/languages","stargazers_url":"https://api.github.com/repos/guard/listen/stargazers","contributors_url":"https://api.github.com/repos/guard/listen/contributors","subscribers_url":"https://api.github.com/repos/guard/listen/subscribers","subscription_url":"https://api.github.com/repos/guard/listen/subscription","commits_url":"https://api.github.com/repos/guard/listen/commits{/sha}","git_commits_url":"https://api.github.com/repos/guard/listen/git/commits{/sha}","comments_url":"https://api.github.com/repos/guard/listen/comments{/number}","issue_comment_url":"https://api.github.com/repos/guard/listen/issues/comments/{number}","contents_url":"https://api.github.com/repos/guard/listen/contents/{+path}","compare_url":"https://api.github.com/repos/guard/listen/compare/{base}...{head}","merges_url":"https://api.github.com/repos/guard/listen/merges","archive_url":"https://api.github.com/repos/guard/listen/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/guard/listen/downloads","issues_url":"https://api.github.com/repos/guard/listen/issues{/number}","pulls_url":"https://api.github.com/repos/guard/listen/pulls{/number}","milestones_url":"https://api.github.com/repos/guard/listen/milestones{/number}","notifications_url":"https://api.github.com/repos/guard/listen/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/guard/listen/labels{/name}","releases_url":"https://api.github.com/repos/guard/listen/releases{/id}","created_at":"2012-01-10T20:02:29Z","updated_at":"2014-11-12T01:21:31Z","pushed_at":"2014-11-12T18:42:08Z","git_url":"git://github.com/guard/listen.git","ssh_url":"git@github.com:guard/listen.git","clone_url":"https://github.com/guard/listen.git","svn_url":"https://github.com/guard/listen","homepage":"https://rubygems.org/gems/listen","size":4175,"stargazers_count":548,"watchers_count":548,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":91,"mirror_url":null,"open_issues_count":14,"forks":91,"open_issues":14,"watchers":548,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/guard/listen/pulls/270"},"html":{"href":"https://github.com/guard/listen/pull/270"},"issue":{"href":"https://api.github.com/repos/guard/listen/issues/270"},"comments":{"href":"https://api.github.com/repos/guard/listen/issues/270/comments"},"review_comments":{"href":"https://api.github.com/repos/guard/listen/pulls/270/comments"},"review_comment":{"href":"https://api.github.com/repos/guard/listen/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/guard/listen/pulls/270/commits"},"statuses":{"href":"https://api.github.com/repos/guard/listen/statuses/6f8cec779d68c9ec761101bfd3d513c6df8557b7"}}}}