{"action":"created","comment":{"url":"https://api.github.com/repos/rapid7/nexpose-client/pulls/comments/27843612","id":27843612,"diff_hunk":"@@ -203,9 +203,50 @@ def add_ip(ip)\n     #\n     # @param [String] ip IP address of an asset.\n     def remove_ip(ip)\n-      @assets = assets.reject { |asset| asset == IPRange.new(ip) }\n+      ip = IPRange.new(ip)\n+      @assets.each do |asset_range|\n+        next if asset_range.is_a?(Nexpose::HostName)\n+        if asset_range.include?(ip)\n+          asset = split_ip_range(asset_range, ip)\n+          @assets.delete(asset_range)\n+          @assets.push(asset)\n+          @assets.flatten!","path":"lib/nexpose/site.rb","position":12,"original_position":12,"commit_id":"b3bb3de4b024febca5ed8285af10c4f6ccf4f0f7","original_commit_id":"dcbb04d1ba797bc6e9dbc0090cb1b098a55b371e","user":{"login":"erran-r7","id":2153375,"avatar_url":"https://avatars.githubusercontent.com/u/2153375?v=3","gravatar_id":"","url":"https://api.github.com/users/erran-r7","html_url":"https://github.com/erran-r7","followers_url":"https://api.github.com/users/erran-r7/followers","following_url":"https://api.github.com/users/erran-r7/following{/other_user}","gists_url":"https://api.github.com/users/erran-r7/gists{/gist_id}","starred_url":"https://api.github.com/users/erran-r7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erran-r7/subscriptions","organizations_url":"https://api.github.com/users/erran-r7/orgs","repos_url":"https://api.github.com/users/erran-r7/repos","events_url":"https://api.github.com/users/erran-r7/events{/privacy}","received_events_url":"https://api.github.com/users/erran-r7/received_events","type":"User","site_admin":false},"body":"Instead of calling `Array#flatten!`, you can use `Array#+` which keeps things one-dimensional:\r\n\r\n```ruby\r\nassets += Array(asset)\r\n```","created_at":"2015-04-07T00:32:39Z","updated_at":"2015-04-07T00:32:39Z","html_url":"https://github.com/rapid7/nexpose-client/pull/156#discussion_r27843612","pull_request_url":"https://api.github.com/repos/rapid7/nexpose-client/pulls/156","_links":{"self":{"href":"https://api.github.com/repos/rapid7/nexpose-client/pulls/comments/27843612"},"html":{"href":"https://github.com/rapid7/nexpose-client/pull/156#discussion_r27843612"},"pull_request":{"href":"https://api.github.com/repos/rapid7/nexpose-client/pulls/156"}}},"pull_request":{"url":"https://api.github.com/repos/rapid7/nexpose-client/pulls/156","id":32724071,"html_url":"https://github.com/rapid7/nexpose-client/pull/156","diff_url":"https://github.com/rapid7/nexpose-client/pull/156.diff","patch_url":"https://github.com/rapid7/nexpose-client/pull/156.patch","issue_url":"https://api.github.com/repos/rapid7/nexpose-client/issues/156","number":156,"state":"open","locked":false,"title":"Remove asset from range","user":{"login":"sgreen-r7","id":10285110,"avatar_url":"https://avatars.githubusercontent.com/u/10285110?v=3","gravatar_id":"","url":"https://api.github.com/users/sgreen-r7","html_url":"https://github.com/sgreen-r7","followers_url":"https://api.github.com/users/sgreen-r7/followers","following_url":"https://api.github.com/users/sgreen-r7/following{/other_user}","gists_url":"https://api.github.com/users/sgreen-r7/gists{/gist_id}","starred_url":"https://api.github.com/users/sgreen-r7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sgreen-r7/subscriptions","organizations_url":"https://api.github.com/users/sgreen-r7/orgs","repos_url":"https://api.github.com/users/sgreen-r7/repos","events_url":"https://api.github.com/users/sgreen-r7/events{/privacy}","received_events_url":"https://api.github.com/users/sgreen-r7/received_events","type":"User","site_admin":false},"body":"An effort to fix https://github.com/rapid7/nexpose-client/issues/148\r\n\r\nThis should correctly remove a single ip from a range.","created_at":"2015-04-07T00:27:32Z","updated_at":"2015-04-07T00:32:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0757ae00c2a7bf6c9b11aba091803ca59a6363b9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rapid7/nexpose-client/pulls/156/commits","review_comments_url":"https://api.github.com/repos/rapid7/nexpose-client/pulls/156/comments","review_comment_url":"https://api.github.com/repos/rapid7/nexpose-client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rapid7/nexpose-client/issues/156/comments","statuses_url":"https://api.github.com/repos/rapid7/nexpose-client/statuses/b3bb3de4b024febca5ed8285af10c4f6ccf4f0f7","head":{"label":"rapid7:remove_asset_from_range","ref":"remove_asset_from_range","sha":"b3bb3de4b024febca5ed8285af10c4f6ccf4f0f7","user":{"login":"rapid7","id":1013671,"avatar_url":"https://avatars.githubusercontent.com/u/1013671?v=3","gravatar_id":"","url":"https://api.github.com/users/rapid7","html_url":"https://github.com/rapid7","followers_url":"https://api.github.com/users/rapid7/followers","following_url":"https://api.github.com/users/rapid7/following{/other_user}","gists_url":"https://api.github.com/users/rapid7/gists{/gist_id}","starred_url":"https://api.github.com/users/rapid7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rapid7/subscriptions","organizations_url":"https://api.github.com/users/rapid7/orgs","repos_url":"https://api.github.com/users/rapid7/repos","events_url":"https://api.github.com/users/rapid7/events{/privacy}","received_events_url":"https://api.github.com/users/rapid7/received_events","type":"Organization","site_admin":false},"repo":{"id":2622467,"name":"nexpose-client","full_name":"rapid7/nexpose-client","owner":{"login":"rapid7","id":1013671,"avatar_url":"https://avatars.githubusercontent.com/u/1013671?v=3","gravatar_id":"","url":"https://api.github.com/users/rapid7","html_url":"https://github.com/rapid7","followers_url":"https://api.github.com/users/rapid7/followers","following_url":"https://api.github.com/users/rapid7/following{/other_user}","gists_url":"https://api.github.com/users/rapid7/gists{/gist_id}","starred_url":"https://api.github.com/users/rapid7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rapid7/subscriptions","organizations_url":"https://api.github.com/users/rapid7/orgs","repos_url":"https://api.github.com/users/rapid7/repos","events_url":"https://api.github.com/users/rapid7/events{/privacy}","received_events_url":"https://api.github.com/users/rapid7/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rapid7/nexpose-client","description":"Rapid7 Nexpose API client library written in Ruby","fork":false,"url":"https://api.github.com/repos/rapid7/nexpose-client","forks_url":"https://api.github.com/repos/rapid7/nexpose-client/forks","keys_url":"https://api.github.com/repos/rapid7/nexpose-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rapid7/nexpose-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rapid7/nexpose-client/teams","hooks_url":"https://api.github.com/repos/rapid7/nexpose-client/hooks","issue_events_url":"https://api.github.com/repos/rapid7/nexpose-client/issues/events{/number}","events_url":"https://api.github.com/repos/rapid7/nexpose-client/events","assignees_url":"https://api.github.com/repos/rapid7/nexpose-client/assignees{/user}","branches_url":"https://api.github.com/repos/rapid7/nexpose-client/branches{/branch}","tags_url":"https://api.github.com/repos/rapid7/nexpose-client/tags","blobs_url":"https://api.github.com/repos/rapid7/nexpose-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rapid7/nexpose-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rapid7/nexpose-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/rapid7/nexpose-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rapid7/nexpose-client/statuses/{sha}","languages_url":"https://api.github.com/repos/rapid7/nexpose-client/languages","stargazers_url":"https://api.github.com/repos/rapid7/nexpose-client/stargazers","contributors_url":"https://api.github.com/repos/rapid7/nexpose-client/contributors","subscribers_url":"https://api.github.com/repos/rapid7/nexpose-client/subscribers","subscription_url":"https://api.github.com/repos/rapid7/nexpose-client/subscription","commits_url":"https://api.github.com/repos/rapid7/nexpose-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/rapid7/nexpose-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/rapid7/nexpose-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/rapid7/nexpose-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/rapid7/nexpose-client/contents/{+path}","compare_url":"https://api.github.com/repos/rapid7/nexpose-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rapid7/nexpose-client/merges","archive_url":"https://api.github.com/repos/rapid7/nexpose-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rapid7/nexpose-client/downloads","issues_url":"https://api.github.com/repos/rapid7/nexpose-client/issues{/number}","pulls_url":"https://api.github.com/repos/rapid7/nexpose-client/pulls{/number}","milestones_url":"https://api.github.com/repos/rapid7/nexpose-client/milestones{/number}","notifications_url":"https://api.github.com/repos/rapid7/nexpose-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rapid7/nexpose-client/labels{/name}","releases_url":"https://api.github.com/repos/rapid7/nexpose-client/releases{/id}","created_at":"2011-10-21T19:04:49Z","updated_at":"2015-03-28T00:44:42Z","pushed_at":"2015-04-07T00:30:28Z","git_url":"git://github.com/rapid7/nexpose-client.git","ssh_url":"git@github.com:rapid7/nexpose-client.git","clone_url":"https://github.com/rapid7/nexpose-client.git","svn_url":"https://github.com/rapid7/nexpose-client","homepage":"http://www.rapid7.com/","size":3943,"stargazers_count":67,"watchers_count":67,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":52,"mirror_url":null,"open_issues_count":9,"forks":52,"open_issues":9,"watchers":67,"default_branch":"master"}},"base":{"label":"rapid7:master","ref":"master","sha":"49fc8d2beeb2f7077b5216772b3d7943038ca3a2","user":{"login":"rapid7","id":1013671,"avatar_url":"https://avatars.githubusercontent.com/u/1013671?v=3","gravatar_id":"","url":"https://api.github.com/users/rapid7","html_url":"https://github.com/rapid7","followers_url":"https://api.github.com/users/rapid7/followers","following_url":"https://api.github.com/users/rapid7/following{/other_user}","gists_url":"https://api.github.com/users/rapid7/gists{/gist_id}","starred_url":"https://api.github.com/users/rapid7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rapid7/subscriptions","organizations_url":"https://api.github.com/users/rapid7/orgs","repos_url":"https://api.github.com/users/rapid7/repos","events_url":"https://api.github.com/users/rapid7/events{/privacy}","received_events_url":"https://api.github.com/users/rapid7/received_events","type":"Organization","site_admin":false},"repo":{"id":2622467,"name":"nexpose-client","full_name":"rapid7/nexpose-client","owner":{"login":"rapid7","id":1013671,"avatar_url":"https://avatars.githubusercontent.com/u/1013671?v=3","gravatar_id":"","url":"https://api.github.com/users/rapid7","html_url":"https://github.com/rapid7","followers_url":"https://api.github.com/users/rapid7/followers","following_url":"https://api.github.com/users/rapid7/following{/other_user}","gists_url":"https://api.github.com/users/rapid7/gists{/gist_id}","starred_url":"https://api.github.com/users/rapid7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rapid7/subscriptions","organizations_url":"https://api.github.com/users/rapid7/orgs","repos_url":"https://api.github.com/users/rapid7/repos","events_url":"https://api.github.com/users/rapid7/events{/privacy}","received_events_url":"https://api.github.com/users/rapid7/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rapid7/nexpose-client","description":"Rapid7 Nexpose API client library written in Ruby","fork":false,"url":"https://api.github.com/repos/rapid7/nexpose-client","forks_url":"https://api.github.com/repos/rapid7/nexpose-client/forks","keys_url":"https://api.github.com/repos/rapid7/nexpose-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rapid7/nexpose-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rapid7/nexpose-client/teams","hooks_url":"https://api.github.com/repos/rapid7/nexpose-client/hooks","issue_events_url":"https://api.github.com/repos/rapid7/nexpose-client/issues/events{/number}","events_url":"https://api.github.com/repos/rapid7/nexpose-client/events","assignees_url":"https://api.github.com/repos/rapid7/nexpose-client/assignees{/user}","branches_url":"https://api.github.com/repos/rapid7/nexpose-client/branches{/branch}","tags_url":"https://api.github.com/repos/rapid7/nexpose-client/tags","blobs_url":"https://api.github.com/repos/rapid7/nexpose-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rapid7/nexpose-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rapid7/nexpose-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/rapid7/nexpose-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rapid7/nexpose-client/statuses/{sha}","languages_url":"https://api.github.com/repos/rapid7/nexpose-client/languages","stargazers_url":"https://api.github.com/repos/rapid7/nexpose-client/stargazers","contributors_url":"https://api.github.com/repos/rapid7/nexpose-client/contributors","subscribers_url":"https://api.github.com/repos/rapid7/nexpose-client/subscribers","subscription_url":"https://api.github.com/repos/rapid7/nexpose-client/subscription","commits_url":"https://api.github.com/repos/rapid7/nexpose-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/rapid7/nexpose-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/rapid7/nexpose-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/rapid7/nexpose-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/rapid7/nexpose-client/contents/{+path}","compare_url":"https://api.github.com/repos/rapid7/nexpose-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rapid7/nexpose-client/merges","archive_url":"https://api.github.com/repos/rapid7/nexpose-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rapid7/nexpose-client/downloads","issues_url":"https://api.github.com/repos/rapid7/nexpose-client/issues{/number}","pulls_url":"https://api.github.com/repos/rapid7/nexpose-client/pulls{/number}","milestones_url":"https://api.github.com/repos/rapid7/nexpose-client/milestones{/number}","notifications_url":"https://api.github.com/repos/rapid7/nexpose-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rapid7/nexpose-client/labels{/name}","releases_url":"https://api.github.com/repos/rapid7/nexpose-client/releases{/id}","created_at":"2011-10-21T19:04:49Z","updated_at":"2015-03-28T00:44:42Z","pushed_at":"2015-04-07T00:30:28Z","git_url":"git://github.com/rapid7/nexpose-client.git","ssh_url":"git@github.com:rapid7/nexpose-client.git","clone_url":"https://github.com/rapid7/nexpose-client.git","svn_url":"https://github.com/rapid7/nexpose-client","homepage":"http://www.rapid7.com/","size":3943,"stargazers_count":67,"watchers_count":67,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":52,"mirror_url":null,"open_issues_count":9,"forks":52,"open_issues":9,"watchers":67,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rapid7/nexpose-client/pulls/156"},"html":{"href":"https://github.com/rapid7/nexpose-client/pull/156"},"issue":{"href":"https://api.github.com/repos/rapid7/nexpose-client/issues/156"},"comments":{"href":"https://api.github.com/repos/rapid7/nexpose-client/issues/156/comments"},"review_comments":{"href":"https://api.github.com/repos/rapid7/nexpose-client/pulls/156/comments"},"review_comment":{"href":"https://api.github.com/repos/rapid7/nexpose-client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rapid7/nexpose-client/pulls/156/commits"},"statuses":{"href":"https://api.github.com/repos/rapid7/nexpose-client/statuses/b3bb3de4b024febca5ed8285af10c4f6ccf4f0f7"}}}}