{"action":"created","comment":{"url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/pulls/comments/64942895","id":64942895,"diff_hunk":"@@ -141,27 +144,54 @@ def define_error(options)\n       status ||= defined?(Rack::Utils) && :bad_request || 400\n       status.freeze\n \n-      severity ||= :error\n+      if status\n+        error.send :define_method, :default_status, -> { status }\n+        error.send :private, :default_status\n+        error.send :define_singleton_method, :default_status, -> { status }\n+      end\n+\n+      severity ||= @severity || :error\n       severity.freeze\n \n-      error.send :define_method, :default_status, -> { status } if status\n-      error.send :define_method, :default_severity, -> { severity } if severity\n-      error.send :private, :default_status\n+      if severity\n+        error.send :define_method, :default_severity, -> { severity }\n+        if severity\n+          error.send :define_singleton_method, :default_severity, -> { severity }\n+        end\n+      end\n+\n+      error.instance_exec(&block) if block\n \n       const_set(error_name, error)\n     end\n \n-    ##\n-    def self.included(_mod)\n+    # Override the default severity with +value+ for errors defined in\n+    # the provided +block+.","path":"lib/kinetic_cafe/error_dsl.rb","position":73,"original_position":62,"commit_id":"3a88c4a5b0c5b37a56f4be38beb6ef9e2a992356","original_commit_id":"d6b0ec5501425bad91ab4231af19321695c21126","user":{"login":"jmignac","id":6677809,"avatar_url":"https://avatars.githubusercontent.com/u/6677809?v=3","gravatar_id":"","url":"https://api.github.com/users/jmignac","html_url":"https://github.com/jmignac","followers_url":"https://api.github.com/users/jmignac/followers","following_url":"https://api.github.com/users/jmignac/following{/other_user}","gists_url":"https://api.github.com/users/jmignac/gists{/gist_id}","starred_url":"https://api.github.com/users/jmignac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmignac/subscriptions","organizations_url":"https://api.github.com/users/jmignac/orgs","repos_url":"https://api.github.com/users/jmignac/repos","events_url":"https://api.github.com/users/jmignac/events{/privacy}","received_events_url":"https://api.github.com/users/jmignac/received_events","type":"User","site_admin":false},"body":"`# the provided +block+. Then, execute the block using the new default value for +@severity+ and change +@severity+ back to its old value` to keep the integrity of the class.`. Or something like that. Thoughts?","created_at":"2016-05-27T17:50:12Z","updated_at":"2016-05-27T17:50:12Z","html_url":"https://github.com/KineticCafe/kinetic_cafe_error/pull/15#discussion_r64942895","pull_request_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/pulls/15","_links":{"self":{"href":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/pulls/comments/64942895"},"html":{"href":"https://github.com/KineticCafe/kinetic_cafe_error/pull/15#discussion_r64942895"},"pull_request":{"href":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/pulls/15"}}},"pull_request":{"url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/pulls/15","id":71630431,"html_url":"https://github.com/KineticCafe/kinetic_cafe_error/pull/15","diff_url":"https://github.com/KineticCafe/kinetic_cafe_error/pull/15.diff","patch_url":"https://github.com/KineticCafe/kinetic_cafe_error/pull/15.patch","issue_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/issues/15","number":15,"state":"open","locked":false,"title":"kinetic_cafe_error 1.12","user":{"login":"ravster","id":1226368,"avatar_url":"https://avatars.githubusercontent.com/u/1226368?v=3","gravatar_id":"","url":"https://api.github.com/users/ravster","html_url":"https://github.com/ravster","followers_url":"https://api.github.com/users/ravster/followers","following_url":"https://api.github.com/users/ravster/following{/other_user}","gists_url":"https://api.github.com/users/ravster/gists{/gist_id}","starred_url":"https://api.github.com/users/ravster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ravster/subscriptions","organizations_url":"https://api.github.com/users/ravster/orgs","repos_url":"https://api.github.com/users/ravster/repos","events_url":"https://api.github.com/users/ravster/events{/privacy}","received_events_url":"https://api.github.com/users/ravster/received_events","type":"User","site_admin":false},"body":"- Refactor rake task to be more testable\r\n- Add severity block\r\n- Allow errors to be nested","created_at":"2016-05-26T21:50:01Z","updated_at":"2016-05-27T17:50:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d99a5389b3a07aab068afc5f9423b6da3745ed11","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/pulls/15/commits","review_comments_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/pulls/15/comments","review_comment_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/pulls/comments{/number}","comments_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/issues/15/comments","statuses_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/statuses/3a88c4a5b0c5b37a56f4be38beb6ef9e2a992356","head":{"label":"KineticCafe:testable-rake-tasks","ref":"testable-rake-tasks","sha":"3a88c4a5b0c5b37a56f4be38beb6ef9e2a992356","user":{"login":"KineticCafe","id":11218112,"avatar_url":"https://avatars.githubusercontent.com/u/11218112?v=3","gravatar_id":"","url":"https://api.github.com/users/KineticCafe","html_url":"https://github.com/KineticCafe","followers_url":"https://api.github.com/users/KineticCafe/followers","following_url":"https://api.github.com/users/KineticCafe/following{/other_user}","gists_url":"https://api.github.com/users/KineticCafe/gists{/gist_id}","starred_url":"https://api.github.com/users/KineticCafe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KineticCafe/subscriptions","organizations_url":"https://api.github.com/users/KineticCafe/orgs","repos_url":"https://api.github.com/users/KineticCafe/repos","events_url":"https://api.github.com/users/KineticCafe/events{/privacy}","received_events_url":"https://api.github.com/users/KineticCafe/received_events","type":"Organization","site_admin":false},"repo":{"id":36387556,"name":"kinetic_cafe_error","full_name":"KineticCafe/kinetic_cafe_error","owner":{"login":"KineticCafe","id":11218112,"avatar_url":"https://avatars.githubusercontent.com/u/11218112?v=3","gravatar_id":"","url":"https://api.github.com/users/KineticCafe","html_url":"https://github.com/KineticCafe","followers_url":"https://api.github.com/users/KineticCafe/followers","following_url":"https://api.github.com/users/KineticCafe/following{/other_user}","gists_url":"https://api.github.com/users/KineticCafe/gists{/gist_id}","starred_url":"https://api.github.com/users/KineticCafe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KineticCafe/subscriptions","organizations_url":"https://api.github.com/users/KineticCafe/orgs","repos_url":"https://api.github.com/users/KineticCafe/repos","events_url":"https://api.github.com/users/KineticCafe/events{/privacy}","received_events_url":"https://api.github.com/users/KineticCafe/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/KineticCafe/kinetic_cafe_error","description":"An API-aware exception class for Ruby","fork":false,"url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error","forks_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/forks","keys_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/keys{/key_id}","collaborators_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/teams","hooks_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/hooks","issue_events_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/issues/events{/number}","events_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/events","assignees_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/assignees{/user}","branches_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/branches{/branch}","tags_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/tags","blobs_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/git/refs{/sha}","trees_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/git/trees{/sha}","statuses_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/statuses/{sha}","languages_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/languages","stargazers_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/stargazers","contributors_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/contributors","subscribers_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/subscribers","subscription_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/subscription","commits_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/commits{/sha}","git_commits_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/git/commits{/sha}","comments_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/comments{/number}","issue_comment_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/issues/comments{/number}","contents_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/contents/{+path}","compare_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/compare/{base}...{head}","merges_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/merges","archive_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/downloads","issues_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/issues{/number}","pulls_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/pulls{/number}","milestones_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/milestones{/number}","notifications_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/labels{/name}","releases_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/releases{/id}","deployments_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/deployments","created_at":"2015-05-27T18:35:11Z","updated_at":"2016-05-09T13:16:13Z","pushed_at":"2016-05-27T17:48:53Z","git_url":"git://github.com/KineticCafe/kinetic_cafe_error.git","ssh_url":"git@github.com:KineticCafe/kinetic_cafe_error.git","clone_url":"https://github.com/KineticCafe/kinetic_cafe_error.git","svn_url":"https://github.com/KineticCafe/kinetic_cafe_error","homepage":null,"size":116,"stargazers_count":5,"watchers_count":5,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":5,"default_branch":"master"}},"base":{"label":"KineticCafe:master","ref":"master","sha":"e25d98ed23529c5bc3dcca972bacb16ee83a703d","user":{"login":"KineticCafe","id":11218112,"avatar_url":"https://avatars.githubusercontent.com/u/11218112?v=3","gravatar_id":"","url":"https://api.github.com/users/KineticCafe","html_url":"https://github.com/KineticCafe","followers_url":"https://api.github.com/users/KineticCafe/followers","following_url":"https://api.github.com/users/KineticCafe/following{/other_user}","gists_url":"https://api.github.com/users/KineticCafe/gists{/gist_id}","starred_url":"https://api.github.com/users/KineticCafe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KineticCafe/subscriptions","organizations_url":"https://api.github.com/users/KineticCafe/orgs","repos_url":"https://api.github.com/users/KineticCafe/repos","events_url":"https://api.github.com/users/KineticCafe/events{/privacy}","received_events_url":"https://api.github.com/users/KineticCafe/received_events","type":"Organization","site_admin":false},"repo":{"id":36387556,"name":"kinetic_cafe_error","full_name":"KineticCafe/kinetic_cafe_error","owner":{"login":"KineticCafe","id":11218112,"avatar_url":"https://avatars.githubusercontent.com/u/11218112?v=3","gravatar_id":"","url":"https://api.github.com/users/KineticCafe","html_url":"https://github.com/KineticCafe","followers_url":"https://api.github.com/users/KineticCafe/followers","following_url":"https://api.github.com/users/KineticCafe/following{/other_user}","gists_url":"https://api.github.com/users/KineticCafe/gists{/gist_id}","starred_url":"https://api.github.com/users/KineticCafe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KineticCafe/subscriptions","organizations_url":"https://api.github.com/users/KineticCafe/orgs","repos_url":"https://api.github.com/users/KineticCafe/repos","events_url":"https://api.github.com/users/KineticCafe/events{/privacy}","received_events_url":"https://api.github.com/users/KineticCafe/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/KineticCafe/kinetic_cafe_error","description":"An API-aware exception class for Ruby","fork":false,"url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error","forks_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/forks","keys_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/keys{/key_id}","collaborators_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/teams","hooks_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/hooks","issue_events_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/issues/events{/number}","events_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/events","assignees_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/assignees{/user}","branches_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/branches{/branch}","tags_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/tags","blobs_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/git/refs{/sha}","trees_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/git/trees{/sha}","statuses_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/statuses/{sha}","languages_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/languages","stargazers_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/stargazers","contributors_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/contributors","subscribers_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/subscribers","subscription_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/subscription","commits_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/commits{/sha}","git_commits_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/git/commits{/sha}","comments_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/comments{/number}","issue_comment_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/issues/comments{/number}","contents_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/contents/{+path}","compare_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/compare/{base}...{head}","merges_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/merges","archive_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/downloads","issues_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/issues{/number}","pulls_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/pulls{/number}","milestones_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/milestones{/number}","notifications_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/labels{/name}","releases_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/releases{/id}","deployments_url":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/deployments","created_at":"2015-05-27T18:35:11Z","updated_at":"2016-05-09T13:16:13Z","pushed_at":"2016-05-27T17:48:53Z","git_url":"git://github.com/KineticCafe/kinetic_cafe_error.git","ssh_url":"git@github.com:KineticCafe/kinetic_cafe_error.git","clone_url":"https://github.com/KineticCafe/kinetic_cafe_error.git","svn_url":"https://github.com/KineticCafe/kinetic_cafe_error","homepage":null,"size":116,"stargazers_count":5,"watchers_count":5,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/pulls/15"},"html":{"href":"https://github.com/KineticCafe/kinetic_cafe_error/pull/15"},"issue":{"href":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/issues/15"},"comments":{"href":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/issues/15/comments"},"review_comments":{"href":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/pulls/15/comments"},"review_comment":{"href":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/pulls/15/commits"},"statuses":{"href":"https://api.github.com/repos/KineticCafe/kinetic_cafe_error/statuses/3a88c4a5b0c5b37a56f4be38beb6ef9e2a992356"}}}}
{"actor":{"display_login":"jmignac"}}