{"action":"created","comment":{"url":"https://api.github.com/repos/bblimke/webmock/pulls/comments/37683088","id":37683088,"diff_hunk":"@@ -0,0 +1,104 @@\n+begin\n+  require 'manticore'\n+rescue LoadError\n+  # manticore not found\n+end\n+\n+if defined?(Manticore)\n+  module WebMock\n+    module HttpLibAdapters\n+      class ManticoreAdapter < HttpLibAdapter\n+        adapter_for :manticore\n+\n+        OriginalManticoreClient = Manticore::Client\n+\n+        def self.enable!\n+          Manticore.send(:remove_const, :Client)\n+          Manticore.send(:const_set, :Client, WebMockManticoreClient)\n+        end\n+\n+        def self.disable!\n+          Manticore.send(:remove_const, :Client)\n+          Manticore.send(:const_set, :Client, OriginalManticoreClient)\n+        end\n+\n+        class WebMockManticoreClient < Manticore::Client\n+          def http(method, uri, options = {})\n+            @method = method\n+            @uri = uri\n+            @options = options\n+            super(method, WebMock::Util::URI.normalize_uri(uri).to_s, format_options(options))\n+          end\n+\n+          private\n+\n+          def format_options(options)\n+            return options unless headers = options[:headers]\n+\n+            options.merge(:headers => join_array_values(headers))\n+          end\n+\n+          def join_array_values(headers)\n+            headers.reduce({}) do |h, (k,v)|\n+              v = v.join(', ') if v.is_a?(Array)\n+              h.merge(k => v)\n+            end\n+          end\n+\n+          def response_object_for(client, request, context, &block)","path":"lib/webmock/http_lib_adapters/manticore_adapter.rb","position":48,"original_position":48,"commit_id":"2bfe2ddda763feee86678bb5421824197ba2f653","original_commit_id":"2bfe2ddda763feee86678bb5421824197ba2f653","user":{"login":"cheald","id":9830,"avatar_url":"https://avatars.githubusercontent.com/u/9830?v=3","gravatar_id":"","url":"https://api.github.com/users/cheald","html_url":"https://github.com/cheald","followers_url":"https://api.github.com/users/cheald/followers","following_url":"https://api.github.com/users/cheald/following{/other_user}","gists_url":"https://api.github.com/users/cheald/gists{/gist_id}","starred_url":"https://api.github.com/users/cheald/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cheald/subscriptions","organizations_url":"https://api.github.com/users/cheald/orgs","repos_url":"https://api.github.com/users/cheald/repos","events_url":"https://api.github.com/users/cheald/events{/privacy}","received_events_url":"https://api.github.com/users/cheald/received_events","type":"User","site_admin":false},"body":"*sigh* nevermind, it's overriding a Manticore method. I should go make :coffee:","created_at":"2015-08-21T22:10:30Z","updated_at":"2015-08-21T22:10:30Z","html_url":"https://github.com/bblimke/webmock/pull/505#discussion_r37683088","pull_request_url":"https://api.github.com/repos/bblimke/webmock/pulls/505","_links":{"self":{"href":"https://api.github.com/repos/bblimke/webmock/pulls/comments/37683088"},"html":{"href":"https://github.com/bblimke/webmock/pull/505#discussion_r37683088"},"pull_request":{"href":"https://api.github.com/repos/bblimke/webmock/pulls/505"}}},"pull_request":{"url":"https://api.github.com/repos/bblimke/webmock/pulls/505","id":43062799,"html_url":"https://github.com/bblimke/webmock/pull/505","diff_url":"https://github.com/bblimke/webmock/pull/505.diff","patch_url":"https://github.com/bblimke/webmock/pull/505.patch","issue_url":"https://api.github.com/repos/bblimke/webmock/issues/505","number":505,"state":"open","locked":false,"title":"Add manticore adapter","user":{"login":"mikeknep","id":2057981,"avatar_url":"https://avatars.githubusercontent.com/u/2057981?v=3","gravatar_id":"","url":"https://api.github.com/users/mikeknep","html_url":"https://github.com/mikeknep","followers_url":"https://api.github.com/users/mikeknep/followers","following_url":"https://api.github.com/users/mikeknep/following{/other_user}","gists_url":"https://api.github.com/users/mikeknep/gists{/gist_id}","starred_url":"https://api.github.com/users/mikeknep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikeknep/subscriptions","organizations_url":"https://api.github.com/users/mikeknep/orgs","repos_url":"https://api.github.com/users/mikeknep/repos","events_url":"https://api.github.com/users/mikeknep/events{/privacy}","received_events_url":"https://api.github.com/users/mikeknep/received_events","type":"User","site_admin":false},"body":"Adds an adapter for [Manticore](https://github.com/cheald/manticore), addressing #454.\r\n\r\nI don't know if there is any functionality unique to Manticore that warrants additional tests beyond the shared \"with WebMock\" suite. @cheald, any thoughts?\r\n\r\nManticore specs pass locally on JRuby 1.7.8 and JRuby 9.0.0.0. Running the full suite on both JRuby versions yields 36 failing http_rb_adapter specs (this is also the case on master branch).\r\n\r\nI noticed that each adapter's spec_helper is handling array values in headers in unique but similar ways. I think a helper could be added to `WebMock::Util::Headers` to address this duplication. However, rather than add that and refactor across libraries now, I figured it'd be better to keep this PR focused exclusively on Manticore. (I bring this up because this PR adds duplicate `join_array_values` methods in the adapter and spec_helper.)","created_at":"2015-08-21T17:46:25Z","updated_at":"2015-08-21T22:10:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"726a8191c0605c04dcf2798d49ac3895e92553d8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/bblimke/webmock/pulls/505/commits","review_comments_url":"https://api.github.com/repos/bblimke/webmock/pulls/505/comments","review_comment_url":"https://api.github.com/repos/bblimke/webmock/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bblimke/webmock/issues/505/comments","statuses_url":"https://api.github.com/repos/bblimke/webmock/statuses/2bfe2ddda763feee86678bb5421824197ba2f653","head":{"label":"mikeknep:manticore-adapter","ref":"manticore-adapter","sha":"2bfe2ddda763feee86678bb5421824197ba2f653","user":{"login":"mikeknep","id":2057981,"avatar_url":"https://avatars.githubusercontent.com/u/2057981?v=3","gravatar_id":"","url":"https://api.github.com/users/mikeknep","html_url":"https://github.com/mikeknep","followers_url":"https://api.github.com/users/mikeknep/followers","following_url":"https://api.github.com/users/mikeknep/following{/other_user}","gists_url":"https://api.github.com/users/mikeknep/gists{/gist_id}","starred_url":"https://api.github.com/users/mikeknep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikeknep/subscriptions","organizations_url":"https://api.github.com/users/mikeknep/orgs","repos_url":"https://api.github.com/users/mikeknep/repos","events_url":"https://api.github.com/users/mikeknep/events{/privacy}","received_events_url":"https://api.github.com/users/mikeknep/received_events","type":"User","site_admin":false},"repo":{"id":40925690,"name":"webmock","full_name":"mikeknep/webmock","owner":{"login":"mikeknep","id":2057981,"avatar_url":"https://avatars.githubusercontent.com/u/2057981?v=3","gravatar_id":"","url":"https://api.github.com/users/mikeknep","html_url":"https://github.com/mikeknep","followers_url":"https://api.github.com/users/mikeknep/followers","following_url":"https://api.github.com/users/mikeknep/following{/other_user}","gists_url":"https://api.github.com/users/mikeknep/gists{/gist_id}","starred_url":"https://api.github.com/users/mikeknep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikeknep/subscriptions","organizations_url":"https://api.github.com/users/mikeknep/orgs","repos_url":"https://api.github.com/users/mikeknep/repos","events_url":"https://api.github.com/users/mikeknep/events{/privacy}","received_events_url":"https://api.github.com/users/mikeknep/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mikeknep/webmock","description":"Library for stubbing and setting expectations on HTTP requests in Ruby.","fork":true,"url":"https://api.github.com/repos/mikeknep/webmock","forks_url":"https://api.github.com/repos/mikeknep/webmock/forks","keys_url":"https://api.github.com/repos/mikeknep/webmock/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mikeknep/webmock/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mikeknep/webmock/teams","hooks_url":"https://api.github.com/repos/mikeknep/webmock/hooks","issue_events_url":"https://api.github.com/repos/mikeknep/webmock/issues/events{/number}","events_url":"https://api.github.com/repos/mikeknep/webmock/events","assignees_url":"https://api.github.com/repos/mikeknep/webmock/assignees{/user}","branches_url":"https://api.github.com/repos/mikeknep/webmock/branches{/branch}","tags_url":"https://api.github.com/repos/mikeknep/webmock/tags","blobs_url":"https://api.github.com/repos/mikeknep/webmock/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mikeknep/webmock/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mikeknep/webmock/git/refs{/sha}","trees_url":"https://api.github.com/repos/mikeknep/webmock/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mikeknep/webmock/statuses/{sha}","languages_url":"https://api.github.com/repos/mikeknep/webmock/languages","stargazers_url":"https://api.github.com/repos/mikeknep/webmock/stargazers","contributors_url":"https://api.github.com/repos/mikeknep/webmock/contributors","subscribers_url":"https://api.github.com/repos/mikeknep/webmock/subscribers","subscription_url":"https://api.github.com/repos/mikeknep/webmock/subscription","commits_url":"https://api.github.com/repos/mikeknep/webmock/commits{/sha}","git_commits_url":"https://api.github.com/repos/mikeknep/webmock/git/commits{/sha}","comments_url":"https://api.github.com/repos/mikeknep/webmock/comments{/number}","issue_comment_url":"https://api.github.com/repos/mikeknep/webmock/issues/comments{/number}","contents_url":"https://api.github.com/repos/mikeknep/webmock/contents/{+path}","compare_url":"https://api.github.com/repos/mikeknep/webmock/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mikeknep/webmock/merges","archive_url":"https://api.github.com/repos/mikeknep/webmock/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mikeknep/webmock/downloads","issues_url":"https://api.github.com/repos/mikeknep/webmock/issues{/number}","pulls_url":"https://api.github.com/repos/mikeknep/webmock/pulls{/number}","milestones_url":"https://api.github.com/repos/mikeknep/webmock/milestones{/number}","notifications_url":"https://api.github.com/repos/mikeknep/webmock/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mikeknep/webmock/labels{/name}","releases_url":"https://api.github.com/repos/mikeknep/webmock/releases{/id}","created_at":"2015-08-17T20:17:03Z","updated_at":"2015-08-17T20:17:03Z","pushed_at":"2015-08-21T20:23:47Z","git_url":"git://github.com/mikeknep/webmock.git","ssh_url":"git@github.com:mikeknep/webmock.git","clone_url":"https://github.com/mikeknep/webmock.git","svn_url":"https://github.com/mikeknep/webmock","homepage":"","size":3670,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"bblimke:master","ref":"master","sha":"80250907b92b1333457ae9130c0ef55b1aa4d4d4","user":{"login":"bblimke","id":15547,"avatar_url":"https://avatars.githubusercontent.com/u/15547?v=3","gravatar_id":"","url":"https://api.github.com/users/bblimke","html_url":"https://github.com/bblimke","followers_url":"https://api.github.com/users/bblimke/followers","following_url":"https://api.github.com/users/bblimke/following{/other_user}","gists_url":"https://api.github.com/users/bblimke/gists{/gist_id}","starred_url":"https://api.github.com/users/bblimke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bblimke/subscriptions","organizations_url":"https://api.github.com/users/bblimke/orgs","repos_url":"https://api.github.com/users/bblimke/repos","events_url":"https://api.github.com/users/bblimke/events{/privacy}","received_events_url":"https://api.github.com/users/bblimke/received_events","type":"User","site_admin":false},"repo":{"id":363163,"name":"webmock","full_name":"bblimke/webmock","owner":{"login":"bblimke","id":15547,"avatar_url":"https://avatars.githubusercontent.com/u/15547?v=3","gravatar_id":"","url":"https://api.github.com/users/bblimke","html_url":"https://github.com/bblimke","followers_url":"https://api.github.com/users/bblimke/followers","following_url":"https://api.github.com/users/bblimke/following{/other_user}","gists_url":"https://api.github.com/users/bblimke/gists{/gist_id}","starred_url":"https://api.github.com/users/bblimke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bblimke/subscriptions","organizations_url":"https://api.github.com/users/bblimke/orgs","repos_url":"https://api.github.com/users/bblimke/repos","events_url":"https://api.github.com/users/bblimke/events{/privacy}","received_events_url":"https://api.github.com/users/bblimke/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bblimke/webmock","description":"Library for stubbing and setting expectations on HTTP requests in Ruby.","fork":false,"url":"https://api.github.com/repos/bblimke/webmock","forks_url":"https://api.github.com/repos/bblimke/webmock/forks","keys_url":"https://api.github.com/repos/bblimke/webmock/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bblimke/webmock/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bblimke/webmock/teams","hooks_url":"https://api.github.com/repos/bblimke/webmock/hooks","issue_events_url":"https://api.github.com/repos/bblimke/webmock/issues/events{/number}","events_url":"https://api.github.com/repos/bblimke/webmock/events","assignees_url":"https://api.github.com/repos/bblimke/webmock/assignees{/user}","branches_url":"https://api.github.com/repos/bblimke/webmock/branches{/branch}","tags_url":"https://api.github.com/repos/bblimke/webmock/tags","blobs_url":"https://api.github.com/repos/bblimke/webmock/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bblimke/webmock/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bblimke/webmock/git/refs{/sha}","trees_url":"https://api.github.com/repos/bblimke/webmock/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bblimke/webmock/statuses/{sha}","languages_url":"https://api.github.com/repos/bblimke/webmock/languages","stargazers_url":"https://api.github.com/repos/bblimke/webmock/stargazers","contributors_url":"https://api.github.com/repos/bblimke/webmock/contributors","subscribers_url":"https://api.github.com/repos/bblimke/webmock/subscribers","subscription_url":"https://api.github.com/repos/bblimke/webmock/subscription","commits_url":"https://api.github.com/repos/bblimke/webmock/commits{/sha}","git_commits_url":"https://api.github.com/repos/bblimke/webmock/git/commits{/sha}","comments_url":"https://api.github.com/repos/bblimke/webmock/comments{/number}","issue_comment_url":"https://api.github.com/repos/bblimke/webmock/issues/comments{/number}","contents_url":"https://api.github.com/repos/bblimke/webmock/contents/{+path}","compare_url":"https://api.github.com/repos/bblimke/webmock/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bblimke/webmock/merges","archive_url":"https://api.github.com/repos/bblimke/webmock/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bblimke/webmock/downloads","issues_url":"https://api.github.com/repos/bblimke/webmock/issues{/number}","pulls_url":"https://api.github.com/repos/bblimke/webmock/pulls{/number}","milestones_url":"https://api.github.com/repos/bblimke/webmock/milestones{/number}","notifications_url":"https://api.github.com/repos/bblimke/webmock/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bblimke/webmock/labels{/name}","releases_url":"https://api.github.com/repos/bblimke/webmock/releases{/id}","created_at":"2009-11-06T10:37:29Z","updated_at":"2015-08-21T21:09:58Z","pushed_at":"2015-08-21T20:40:07Z","git_url":"git://github.com/bblimke/webmock.git","ssh_url":"git@github.com:bblimke/webmock.git","clone_url":"https://github.com/bblimke/webmock.git","svn_url":"https://github.com/bblimke/webmock","homepage":"","size":3670,"stargazers_count":1864,"watchers_count":1864,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":266,"mirror_url":null,"open_issues_count":58,"forks":266,"open_issues":58,"watchers":1864,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bblimke/webmock/pulls/505"},"html":{"href":"https://github.com/bblimke/webmock/pull/505"},"issue":{"href":"https://api.github.com/repos/bblimke/webmock/issues/505"},"comments":{"href":"https://api.github.com/repos/bblimke/webmock/issues/505/comments"},"review_comments":{"href":"https://api.github.com/repos/bblimke/webmock/pulls/505/comments"},"review_comment":{"href":"https://api.github.com/repos/bblimke/webmock/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bblimke/webmock/pulls/505/commits"},"statuses":{"href":"https://api.github.com/repos/bblimke/webmock/statuses/2bfe2ddda763feee86678bb5421824197ba2f653"}}}}