{"action":"closed","number":19157,"pull_request":{"url":"https://api.github.com/repos/rails/rails/pulls/19157","id":30254362,"html_url":"https://github.com/rails/rails/pull/19157","diff_url":"https://github.com/rails/rails/pull/19157.diff","patch_url":"https://github.com/rails/rails/pull/19157.patch","issue_url":"https://api.github.com/repos/rails/rails/issues/19157","number":19157,"state":"closed","locked":false,"title":"Add Enumerable#without","user":{"login":"todd","id":120350,"avatar_url":"https://avatars.githubusercontent.com/u/120350?v=3","gravatar_id":"","url":"https://api.github.com/users/todd","html_url":"https://github.com/todd","followers_url":"https://api.github.com/users/todd/followers","following_url":"https://api.github.com/users/todd/following{/other_user}","gists_url":"https://api.github.com/users/todd/gists{/gist_id}","starred_url":"https://api.github.com/users/todd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/todd/subscriptions","organizations_url":"https://api.github.com/users/todd/orgs","repos_url":"https://api.github.com/users/todd/repos","events_url":"https://api.github.com/users/todd/events{/privacy}","received_events_url":"https://api.github.com/users/todd/received_events","type":"User","site_admin":false},"body":"Re: #19082 \r\n\r\nI mostly took the code @dhh provided in the aforementioned issue and made a minor tweak after reviewing the relevant Ruby source and running some benchmarks - `Array#reject` is actually slower than `Array#-`, so I'm conditionally calling `-` on the enumerable if it's an `Array`. I can provide some benchmarks if anyone would like to see them. I'd also love for someone more well-versed in Ruby internals to take a look at this if they have the time.","created_at":"2015-03-02T02:01:15Z","updated_at":"2015-03-02T03:05:47Z","closed_at":"2015-03-02T03:05:47Z","merged_at":"2015-03-02T03:05:47Z","merge_commit_sha":"d77b4cd1404cdb3cb2989fe68955d5dcb4b91a2e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rails/rails/pulls/19157/commits","review_comments_url":"https://api.github.com/repos/rails/rails/pulls/19157/comments","review_comment_url":"https://api.github.com/repos/rails/rails/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rails/rails/issues/19157/comments","statuses_url":"https://api.github.com/repos/rails/rails/statuses/c7a37c10ade8372c712be01a7e4ddbe8785c5139","head":{"label":"todd:enumerable_without","ref":"enumerable_without","sha":"c7a37c10ade8372c712be01a7e4ddbe8785c5139","user":{"login":"todd","id":120350,"avatar_url":"https://avatars.githubusercontent.com/u/120350?v=3","gravatar_id":"","url":"https://api.github.com/users/todd","html_url":"https://github.com/todd","followers_url":"https://api.github.com/users/todd/followers","following_url":"https://api.github.com/users/todd/following{/other_user}","gists_url":"https://api.github.com/users/todd/gists{/gist_id}","starred_url":"https://api.github.com/users/todd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/todd/subscriptions","organizations_url":"https://api.github.com/users/todd/orgs","repos_url":"https://api.github.com/users/todd/repos","events_url":"https://api.github.com/users/todd/events{/privacy}","received_events_url":"https://api.github.com/users/todd/received_events","type":"User","site_admin":false},"repo":{"id":31515839,"name":"rails","full_name":"todd/rails","owner":{"login":"todd","id":120350,"avatar_url":"https://avatars.githubusercontent.com/u/120350?v=3","gravatar_id":"","url":"https://api.github.com/users/todd","html_url":"https://github.com/todd","followers_url":"https://api.github.com/users/todd/followers","following_url":"https://api.github.com/users/todd/following{/other_user}","gists_url":"https://api.github.com/users/todd/gists{/gist_id}","starred_url":"https://api.github.com/users/todd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/todd/subscriptions","organizations_url":"https://api.github.com/users/todd/orgs","repos_url":"https://api.github.com/users/todd/repos","events_url":"https://api.github.com/users/todd/events{/privacy}","received_events_url":"https://api.github.com/users/todd/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/todd/rails","description":"Ruby on Rails","fork":true,"url":"https://api.github.com/repos/todd/rails","forks_url":"https://api.github.com/repos/todd/rails/forks","keys_url":"https://api.github.com/repos/todd/rails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/todd/rails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/todd/rails/teams","hooks_url":"https://api.github.com/repos/todd/rails/hooks","issue_events_url":"https://api.github.com/repos/todd/rails/issues/events{/number}","events_url":"https://api.github.com/repos/todd/rails/events","assignees_url":"https://api.github.com/repos/todd/rails/assignees{/user}","branches_url":"https://api.github.com/repos/todd/rails/branches{/branch}","tags_url":"https://api.github.com/repos/todd/rails/tags","blobs_url":"https://api.github.com/repos/todd/rails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/todd/rails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/todd/rails/git/refs{/sha}","trees_url":"https://api.github.com/repos/todd/rails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/todd/rails/statuses/{sha}","languages_url":"https://api.github.com/repos/todd/rails/languages","stargazers_url":"https://api.github.com/repos/todd/rails/stargazers","contributors_url":"https://api.github.com/repos/todd/rails/contributors","subscribers_url":"https://api.github.com/repos/todd/rails/subscribers","subscription_url":"https://api.github.com/repos/todd/rails/subscription","commits_url":"https://api.github.com/repos/todd/rails/commits{/sha}","git_commits_url":"https://api.github.com/repos/todd/rails/git/commits{/sha}","comments_url":"https://api.github.com/repos/todd/rails/comments{/number}","issue_comment_url":"https://api.github.com/repos/todd/rails/issues/comments{/number}","contents_url":"https://api.github.com/repos/todd/rails/contents/{+path}","compare_url":"https://api.github.com/repos/todd/rails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/todd/rails/merges","archive_url":"https://api.github.com/repos/todd/rails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/todd/rails/downloads","issues_url":"https://api.github.com/repos/todd/rails/issues{/number}","pulls_url":"https://api.github.com/repos/todd/rails/pulls{/number}","milestones_url":"https://api.github.com/repos/todd/rails/milestones{/number}","notifications_url":"https://api.github.com/repos/todd/rails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/todd/rails/labels{/name}","releases_url":"https://api.github.com/repos/todd/rails/releases{/id}","created_at":"2015-03-02T00:00:49Z","updated_at":"2015-03-02T00:01:23Z","pushed_at":"2015-03-02T02:45:54Z","git_url":"git://github.com/todd/rails.git","ssh_url":"git@github.com:todd/rails.git","clone_url":"https://github.com/todd/rails.git","svn_url":"https://github.com/todd/rails","homepage":"http://rubyonrails.org","size":381615,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rails:master","ref":"master","sha":"3a156ec8e79b88ff90e8f5ed34dd05b89e94b72f","user":{"login":"rails","id":4223,"avatar_url":"https://avatars.githubusercontent.com/u/4223?v=3","gravatar_id":"","url":"https://api.github.com/users/rails","html_url":"https://github.com/rails","followers_url":"https://api.github.com/users/rails/followers","following_url":"https://api.github.com/users/rails/following{/other_user}","gists_url":"https://api.github.com/users/rails/gists{/gist_id}","starred_url":"https://api.github.com/users/rails/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rails/subscriptions","organizations_url":"https://api.github.com/users/rails/orgs","repos_url":"https://api.github.com/users/rails/repos","events_url":"https://api.github.com/users/rails/events{/privacy}","received_events_url":"https://api.github.com/users/rails/received_events","type":"Organization","site_admin":false},"repo":{"id":8514,"name":"rails","full_name":"rails/rails","owner":{"login":"rails","id":4223,"avatar_url":"https://avatars.githubusercontent.com/u/4223?v=3","gravatar_id":"","url":"https://api.github.com/users/rails","html_url":"https://github.com/rails","followers_url":"https://api.github.com/users/rails/followers","following_url":"https://api.github.com/users/rails/following{/other_user}","gists_url":"https://api.github.com/users/rails/gists{/gist_id}","starred_url":"https://api.github.com/users/rails/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rails/subscriptions","organizations_url":"https://api.github.com/users/rails/orgs","repos_url":"https://api.github.com/users/rails/repos","events_url":"https://api.github.com/users/rails/events{/privacy}","received_events_url":"https://api.github.com/users/rails/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rails/rails","description":"Ruby on Rails","fork":false,"url":"https://api.github.com/repos/rails/rails","forks_url":"https://api.github.com/repos/rails/rails/forks","keys_url":"https://api.github.com/repos/rails/rails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rails/rails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rails/rails/teams","hooks_url":"https://api.github.com/repos/rails/rails/hooks","issue_events_url":"https://api.github.com/repos/rails/rails/issues/events{/number}","events_url":"https://api.github.com/repos/rails/rails/events","assignees_url":"https://api.github.com/repos/rails/rails/assignees{/user}","branches_url":"https://api.github.com/repos/rails/rails/branches{/branch}","tags_url":"https://api.github.com/repos/rails/rails/tags","blobs_url":"https://api.github.com/repos/rails/rails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rails/rails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rails/rails/git/refs{/sha}","trees_url":"https://api.github.com/repos/rails/rails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rails/rails/statuses/{sha}","languages_url":"https://api.github.com/repos/rails/rails/languages","stargazers_url":"https://api.github.com/repos/rails/rails/stargazers","contributors_url":"https://api.github.com/repos/rails/rails/contributors","subscribers_url":"https://api.github.com/repos/rails/rails/subscribers","subscription_url":"https://api.github.com/repos/rails/rails/subscription","commits_url":"https://api.github.com/repos/rails/rails/commits{/sha}","git_commits_url":"https://api.github.com/repos/rails/rails/git/commits{/sha}","comments_url":"https://api.github.com/repos/rails/rails/comments{/number}","issue_comment_url":"https://api.github.com/repos/rails/rails/issues/comments{/number}","contents_url":"https://api.github.com/repos/rails/rails/contents/{+path}","compare_url":"https://api.github.com/repos/rails/rails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rails/rails/merges","archive_url":"https://api.github.com/repos/rails/rails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rails/rails/downloads","issues_url":"https://api.github.com/repos/rails/rails/issues{/number}","pulls_url":"https://api.github.com/repos/rails/rails/pulls{/number}","milestones_url":"https://api.github.com/repos/rails/rails/milestones{/number}","notifications_url":"https://api.github.com/repos/rails/rails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rails/rails/labels{/name}","releases_url":"https://api.github.com/repos/rails/rails/releases{/id}","created_at":"2008-04-11T02:19:47Z","updated_at":"2015-03-02T00:35:20Z","pushed_at":"2015-03-02T03:05:47Z","git_url":"git://github.com/rails/rails.git","ssh_url":"git@github.com:rails/rails.git","clone_url":"https://github.com/rails/rails.git","svn_url":"https://github.com/rails/rails","homepage":"http://rubyonrails.org","size":381615,"stargazers_count":25134,"watchers_count":25134,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":9824,"mirror_url":null,"open_issues_count":718,"forks":9824,"open_issues":718,"watchers":25134,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rails/rails/pulls/19157"},"html":{"href":"https://github.com/rails/rails/pull/19157"},"issue":{"href":"https://api.github.com/repos/rails/rails/issues/19157"},"comments":{"href":"https://api.github.com/repos/rails/rails/issues/19157/comments"},"review_comments":{"href":"https://api.github.com/repos/rails/rails/pulls/19157/comments"},"review_comment":{"href":"https://api.github.com/repos/rails/rails/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rails/rails/pulls/19157/commits"},"statuses":{"href":"https://api.github.com/repos/rails/rails/statuses/c7a37c10ade8372c712be01a7e4ddbe8785c5139"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"dhh","id":2741,"avatar_url":"https://avatars.githubusercontent.com/u/2741?v=3","gravatar_id":"","url":"https://api.github.com/users/dhh","html_url":"https://github.com/dhh","followers_url":"https://api.github.com/users/dhh/followers","following_url":"https://api.github.com/users/dhh/following{/other_user}","gists_url":"https://api.github.com/users/dhh/gists{/gist_id}","starred_url":"https://api.github.com/users/dhh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhh/subscriptions","organizations_url":"https://api.github.com/users/dhh/orgs","repos_url":"https://api.github.com/users/dhh/repos","events_url":"https://api.github.com/users/dhh/events{/privacy}","received_events_url":"https://api.github.com/users/dhh/received_events","type":"User","site_admin":false},"comments":2,"review_comments":11,"commits":1,"additions":46,"deletions":0,"changed_files":5}}