GitHub PullRequestEvent at 2014-11-07 17:52:48
Repository: json-schema
Actor: RST-J
Payload: {"action":"closed","number":177,"pull_request":{"url":"https://api.github.com/repos/hoxworth/json-schema/pulls/177","id":23951029,"html_url":"https://github.com/hoxworth/json-schema/pull/177","diff_url":"https://github.com/hoxworth/json-schema/pull/177.diff","patch_url":"https://github.com/hoxworth/json-schema/pull/177.patch","issue_url":"https://api.github.com/repos/hoxworth/json-schema/issues/177","number":177,"state":"closed","locked":false,"title":"Refactor ref schema URI construction.","user":{"login":"gabrielg","id":3902,"avatar_url":"https://avatars.githubusercontent.com/u/3902?v=3","gravatar_id":"","url":"https://api.github.com/users/gabrielg","html_url":"https://github.com/gabrielg","followers_url":"https://api.github.com/users/gabrielg/followers","following_url":"https://api.github.com/users/gabrielg/following{/other_user}","gists_url":"https://api.github.com/users/gabrielg/gists{/gist_id}","starred_url":"https://api.github.com/users/gabrielg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabrielg/subscriptions","organizations_url":"https://api.github.com/users/gabrielg/orgs","repos_url":"https://api.github.com/users/gabrielg/repos","events_url":"https://api.github.com/users/gabrielg/events{/privacy}","received_events_url":"https://api.github.com/users/gabrielg/received_events","type":"User","site_admin":false},"body":"I'm fairly certain I've found a bug in handling of the `id` property, but in the process of tracking it down I found some opportunities for refactoring while trying to reason about how schema URIs were constructed. Rather than lump a bug fix and a refactor into the one PR, I'm starting with this PR that just includes the refactoring. Ran all tests and they are passing locally.\r\n\r\nThis refactors `JSON::Validator#load_ref_schema` to not implement a lot of logic that `Pathname` and `URI` are already capable of, and splits some of it into a separate method for clarity. Some `JSON::Validator` class methods are also added to hide away the specific implementation of how already loaded schemas are kept around.\r\n\r\n* Refactor `JSON::Validator#load_schema_ref` to move absolute URI construction to its own method, and to bail ASAP if the schema is already loaded.\r\n* Add `JSON::Validator#absolutize_ref_uri` to handle logic around constructing an absolute URI to a schema based on the ref URI and its parent schema URI.\r\n* Add `JSON::Validator.schema_for_uri` to fetch an already loaded schema for a given URI.\r\n* Add `JSON::Validator.schema_loaded?` predicate method for testing whether a schema is already loaded.\r\n* Move some existing code to use the new class methods.","created_at":"2014-11-06T00:43:53Z","updated_at":"2014-11-07T17:52:48Z","closed_at":"2014-11-07T17:52:48Z","merged_at":"2014-11-07T17:52:48Z","merge_commit_sha":"091c0cb5be335091353d0b0e68ece99a22d93c4c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/hoxworth/json-schema/pulls/177/commits","review_comments_url":"https://api.github.com/repos/hoxworth/json-schema/pulls/177/comments","review_comment_url":"https://api.github.com/repos/hoxworth/json-schema/pulls/comments/{number}","comments_url":"https://api.github.com/repos/hoxworth/json-schema/issues/177/comments","statuses_url":"https://api.github.com/repos/hoxworth/json-schema/statuses/e7fe965458a42d540dd3a54e08367bbbfc251a41","head":{"label":"gabrielg:refactor-ref-schema-uri-construction","ref":"refactor-ref-schema-uri-construction","sha":"e7fe965458a42d540dd3a54e08367bbbfc251a41","user":{"login":"gabrielg","id":3902,"avatar_url":"https://avatars.githubusercontent.com/u/3902?v=3","gravatar_id":"","url":"https://api.github.com/users/gabrielg","html_url":"https://github.com/gabrielg","followers_url":"https://api.github.com/users/gabrielg/followers","following_url":"https://api.github.com/users/gabrielg/following{/other_user}","gists_url":"https://api.github.com/users/gabrielg/gists{/gist_id}","starred_url":"https://api.github.com/users/gabrielg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabrielg/subscriptions","organizations_url":"https://api.github.com/users/gabrielg/orgs","repos_url":"https://api.github.com/users/gabrielg/repos","events_url":"https://api.github.com/users/gabrielg/events{/privacy}","received_events_url":"https://api.github.com/users/gabrielg/received_events","type":"User","site_admin":false},"repo":{"id":26243973,"name":"json-schema","full_name":"gabrielg/json-schema","owner":{"login":"gabrielg","id":3902,"avatar_url":"https://avatars.githubusercontent.com/u/3902?v=3","gravatar_id":"","url":"https://api.github.com/users/gabrielg","html_url":"https://github.com/gabrielg","followers_url":"https://api.github.com/users/gabrielg/followers","following_url":"https://api.github.com/users/gabrielg/following{/other_user}","gists_url":"https://api.github.com/users/gabrielg/gists{/gist_id}","starred_url":"https://api.github.com/users/gabrielg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabrielg/subscriptions","organizations_url":"https://api.github.com/users/gabrielg/orgs","repos_url":"https://api.github.com/users/gabrielg/repos","events_url":"https://api.github.com/users/gabrielg/events{/privacy}","received_events_url":"https://api.github.com/users/gabrielg/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gabrielg/json-schema","description":"Ruby JSON Schema Validator","fork":true,"url":"https://api.github.com/repos/gabrielg/json-schema","forks_url":"https://api.github.com/repos/gabrielg/json-schema/forks","keys_url":"https://api.github.com/repos/gabrielg/json-schema/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gabrielg/json-schema/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gabrielg/json-schema/teams","hooks_url":"https://api.github.com/repos/gabrielg/json-schema/hooks","issue_events_url":"https://api.github.com/repos/gabrielg/json-schema/issues/events{/number}","events_url":"https://api.github.com/repos/gabrielg/json-schema/events","assignees_url":"https://api.github.com/repos/gabrielg/json-schema/assignees{/user}","branches_url":"https://api.github.com/repos/gabrielg/json-schema/branches{/branch}","tags_url":"https://api.github.com/repos/gabrielg/json-schema/tags","blobs_url":"https://api.github.com/repos/gabrielg/json-schema/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gabrielg/json-schema/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gabrielg/json-schema/git/refs{/sha}","trees_url":"https://api.github.com/repos/gabrielg/json-schema/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gabrielg/json-schema/statuses/{sha}","languages_url":"https://api.github.com/repos/gabrielg/json-schema/languages","stargazers_url":"https://api.github.com/repos/gabrielg/json-schema/stargazers","contributors_url":"https://api.github.com/repos/gabrielg/json-schema/contributors","subscribers_url":"https://api.github.com/repos/gabrielg/json-schema/subscribers","subscription_url":"https://api.github.com/repos/gabrielg/json-schema/subscription","commits_url":"https://api.github.com/repos/gabrielg/json-schema/commits{/sha}","git_commits_url":"https://api.github.com/repos/gabrielg/json-schema/git/commits{/sha}","comments_url":"https://api.github.com/repos/gabrielg/json-schema/comments{/number}","issue_comment_url":"https://api.github.com/repos/gabrielg/json-schema/issues/comments/{number}","contents_url":"https://api.github.com/repos/gabrielg/json-schema/contents/{+path}","compare_url":"https://api.github.com/repos/gabrielg/json-schema/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gabrielg/json-schema/merges","archive_url":"https://api.github.com/repos/gabrielg/json-schema/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gabrielg/json-schema/downloads","issues_url":"https://api.github.com/repos/gabrielg/json-schema/issues{/number}","pulls_url":"https://api.github.com/repos/gabrielg/json-schema/pulls{/number}","milestones_url":"https://api.github.com/repos/gabrielg/json-schema/milestones{/number}","notifications_url":"https://api.github.com/repos/gabrielg/json-schema/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gabrielg/json-schema/labels{/name}","releases_url":"https://api.github.com/repos/gabrielg/json-schema/releases{/id}","created_at":"2014-11-05T23:06:59Z","updated_at":"2014-11-05T23:13:20Z","pushed_at":"2014-11-07T00:23:28Z","git_url":"git://github.com/gabrielg/json-schema.git","ssh_url":"git@github.com:gabrielg/json-schema.git","clone_url":"https://github.com/gabrielg/json-schema.git","svn_url":"https://github.com/gabrielg/json-schema","homepage":"","size":2080,"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":"hoxworth:master","ref":"master","sha":"fef4526cef50367dabe8c3b3d909c01c86d8604b","user":{"login":"hoxworth","id":15193,"avatar_url":"https://avatars.githubusercontent.com/u/15193?v=3","gravatar_id":"","url":"https://api.github.com/users/hoxworth","html_url":"https://github.com/hoxworth","followers_url":"https://api.github.com/users/hoxworth/followers","following_url":"https://api.github.com/users/hoxworth/following{/other_user}","gists_url":"https://api.github.com/users/hoxworth/gists{/gist_id}","starred_url":"https://api.github.com/users/hoxworth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hoxworth/subscriptions","organizations_url":"https://api.github.com/users/hoxworth/orgs","repos_url":"https://api.github.com/users/hoxworth/repos","events_url":"https://api.github.com/users/hoxworth/events{/privacy}","received_events_url":"https://api.github.com/users/hoxworth/received_events","type":"User","site_admin":false},"repo":{"id":1110217,"name":"json-schema","full_name":"hoxworth/json-schema","owner":{"login":"hoxworth","id":15193,"avatar_url":"https://avatars.githubusercontent.com/u/15193?v=3","gravatar_id":"","url":"https://api.github.com/users/hoxworth","html_url":"https://github.com/hoxworth","followers_url":"https://api.github.com/users/hoxworth/followers","following_url":"https://api.github.com/users/hoxworth/following{/other_user}","gists_url":"https://api.github.com/users/hoxworth/gists{/gist_id}","starred_url":"https://api.github.com/users/hoxworth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hoxworth/subscriptions","organizations_url":"https://api.github.com/users/hoxworth/orgs","repos_url":"https://api.github.com/users/hoxworth/repos","events_url":"https://api.github.com/users/hoxworth/events{/privacy}","received_events_url":"https://api.github.com/users/hoxworth/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hoxworth/json-schema","description":"Ruby JSON Schema Validator","fork":false,"url":"https://api.github.com/repos/hoxworth/json-schema","forks_url":"https://api.github.com/repos/hoxworth/json-schema/forks","keys_url":"https://api.github.com/repos/hoxworth/json-schema/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hoxworth/json-schema/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hoxworth/json-schema/teams","hooks_url":"https://api.github.com/repos/hoxworth/json-schema/hooks","issue_events_url":"https://api.github.com/repos/hoxworth/json-schema/issues/events{/number}","events_url":"https://api.github.com/repos/hoxworth/json-schema/events","assignees_url":"https://api.github.com/repos/hoxworth/json-schema/assignees{/user}","branches_url":"https://api.github.com/repos/hoxworth/json-schema/branches{/branch}","tags_url":"https://api.github.com/repos/hoxworth/json-schema/tags","blobs_url":"https://api.github.com/repos/hoxworth/json-schema/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hoxworth/json-schema/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hoxworth/json-schema/git/refs{/sha}","trees_url":"https://api.github.com/repos/hoxworth/json-schema/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hoxworth/json-schema/statuses/{sha}","languages_url":"https://api.github.com/repos/hoxworth/json-schema/languages","stargazers_url":"https://api.github.com/repos/hoxworth/json-schema/stargazers","contributors_url":"https://api.github.com/repos/hoxworth/json-schema/contributors","subscribers_url":"https://api.github.com/repos/hoxworth/json-schema/subscribers","subscription_url":"https://api.github.com/repos/hoxworth/json-schema/subscription","commits_url":"https://api.github.com/repos/hoxworth/json-schema/commits{/sha}","git_commits_url":"https://api.github.com/repos/hoxworth/json-schema/git/commits{/sha}","comments_url":"https://api.github.com/repos/hoxworth/json-schema/comments{/number}","issue_comment_url":"https://api.github.com/repos/hoxworth/json-schema/issues/comments/{number}","contents_url":"https://api.github.com/repos/hoxworth/json-schema/contents/{+path}","compare_url":"https://api.github.com/repos/hoxworth/json-schema/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hoxworth/json-schema/merges","archive_url":"https://api.github.com/repos/hoxworth/json-schema/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hoxworth/json-schema/downloads","issues_url":"https://api.github.com/repos/hoxworth/json-schema/issues{/number}","pulls_url":"https://api.github.com/repos/hoxworth/json-schema/pulls{/number}","milestones_url":"https://api.github.com/repos/hoxworth/json-schema/milestones{/number}","notifications_url":"https://api.github.com/repos/hoxworth/json-schema/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hoxworth/json-schema/labels{/name}","releases_url":"https://api.github.com/repos/hoxworth/json-schema/releases{/id}","created_at":"2010-11-24T20:05:16Z","updated_at":"2014-11-05T01:09:14Z","pushed_at":"2014-11-07T17:52:48Z","git_url":"git://github.com/hoxworth/json-schema.git","ssh_url":"git@github.com:hoxworth/json-schema.git","clone_url":"https://github.com/hoxworth/json-schema.git","svn_url":"https://github.com/hoxworth/json-schema","homepage":"","size":2080,"stargazers_count":356,"watchers_count":356,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":86,"mirror_url":null,"open_issues_count":21,"forks":86,"open_issues":21,"watchers":356,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hoxworth/json-schema/pulls/177"},"html":{"href":"https://github.com/hoxworth/json-schema/pull/177"},"issue":{"href":"https://api.github.com/repos/hoxworth/json-schema/issues/177"},"comments":{"href":"https://api.github.com/repos/hoxworth/json-schema/issues/177/comments"},"review_comments":{"href":"https://api.github.com/repos/hoxworth/json-schema/pulls/177/comments"},"review_comment":{"href":"https://api.github.com/repos/hoxworth/json-schema/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/hoxworth/json-schema/pulls/177/commits"},"statuses":{"href":"https://api.github.com/repos/hoxworth/json-schema/statuses/e7fe965458a42d540dd3a54e08367bbbfc251a41"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"RST-J","id":4967885,"avatar_url":"https://avatars.githubusercontent.com/u/4967885?v=3","gravatar_id":"","url":"https://api.github.com/users/RST-J","html_url":"https://github.com/RST-J","followers_url":"https://api.github.com/users/RST-J/followers","following_url":"https://api.github.com/users/RST-J/following{/other_user}","gists_url":"https://api.github.com/users/RST-J/gists{/gist_id}","starred_url":"https://api.github.com/users/RST-J/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RST-J/subscriptions","organizations_url":"https://api.github.com/users/RST-J/orgs","repos_url":"https://api.github.com/users/RST-J/repos","events_url":"https://api.github.com/users/RST-J/events{/privacy}","received_events_url":"https://api.github.com/users/RST-J/received_events","type":"User","site_admin":false},"comments":2,"review_comments":0,"commits":1,"additions":27,"deletions":26,"changed_files":1}}