{"action":"created","comment":{"url":"https://api.github.com/repos/opscode-cookbooks/chef-vault/pulls/comments/24040944","id":24040944,"diff_hunk":"@@ -20,28 +20,29 @@\n # limitations under the License.\n \n \n-class Chef\n-  class Recipe\n-    # This is a nice helper method for the Chef Recipe DSL so you can\n-    # write:\n-    #   chef_vault_item(\"secrets\", \"dbpassword\")\n-    # Instead of:\n-    #   ChefVault::Item.load(\"secrets\", \"dbpassword\")\n-    #\n-    # Falls back to normal data bag item loading if the item isn't actually a\n-    # vault item.\n-    def chef_vault_item(bag, item)\n-      begin\n-        require 'chef-vault'\n-      rescue LoadError\n-        Chef::Log.warn(\"Missing gem 'chef-vault', use recipe[chef-vault] to install it first.\")\n-      end\n+module ChefVaultItem\n+ # This is a nice helper method for the Chef Recipe DSL so you can\n+ # write:\n+ #   chef_vault_item(\"secrets\", \"dbpassword\")\n+ # Instead of:\n+ #   ChefVault::Item.load(\"secrets\", \"dbpassword\")\n+ #\n+ # Falls back to normal data bag item loading if the item isn't actually a\n+ # vault item.\n+ def chef_vault_item(bag, item)\n+   begin\n+     require 'chef-vault'\n+   rescue LoadError\n+     Chef::Log.warn(\"Missing gem 'chef-vault', use recipe[chef-vault] to install it first.\")\n+   end\n \n-      begin\n-        ChefVault::Item.load(bag, item)\n-      rescue ChefVault::Exceptions::KeysNotFound\n-        Chef::DataBagItem.load(bag, item)\n-      end\n-    end\n-  end\n+   begin\n+     ChefVault::Item.load(bag, item)\n+   rescue ChefVault::Exceptions::KeysNotFound","path":"libraries/chef_vault_item.rb","position":45,"original_position":45,"commit_id":"e13a7299307af6699f766ca30d55ec1650f5fa0b","original_commit_id":"e13a7299307af6699f766ca30d55ec1650f5fa0b","user":{"login":"martinisoft","id":724,"avatar_url":"https://avatars.githubusercontent.com/u/724?v=3","gravatar_id":"","url":"https://api.github.com/users/martinisoft","html_url":"https://github.com/martinisoft","followers_url":"https://api.github.com/users/martinisoft/followers","following_url":"https://api.github.com/users/martinisoft/following{/other_user}","gists_url":"https://api.github.com/users/martinisoft/gists{/gist_id}","starred_url":"https://api.github.com/users/martinisoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martinisoft/subscriptions","organizations_url":"https://api.github.com/users/martinisoft/orgs","repos_url":"https://api.github.com/users/martinisoft/repos","events_url":"https://api.github.com/users/martinisoft/events{/privacy}","received_events_url":"https://api.github.com/users/martinisoft/received_events","type":"User","site_admin":false},"body":"Think this line changes the current master version rescue which is:\r\n\r\n```ruby\r\nrescue ChefVault::Exceptions::KeysNotFound, ChefVault::Exceptions::SecretDecryption\r\n```","created_at":"2015-02-03T21:21:10Z","updated_at":"2015-02-03T21:21:10Z","html_url":"https://github.com/opscode-cookbooks/chef-vault/pull/4#discussion_r24040944","pull_request_url":"https://api.github.com/repos/opscode-cookbooks/chef-vault/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/opscode-cookbooks/chef-vault/pulls/comments/24040944"},"html":{"href":"https://github.com/opscode-cookbooks/chef-vault/pull/4#discussion_r24040944"},"pull_request":{"href":"https://api.github.com/repos/opscode-cookbooks/chef-vault/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/opscode-cookbooks/chef-vault/pulls/4","id":16202573,"html_url":"https://github.com/opscode-cookbooks/chef-vault/pull/4","diff_url":"https://github.com/opscode-cookbooks/chef-vault/pull/4.diff","patch_url":"https://github.com/opscode-cookbooks/chef-vault/pull/4.patch","issue_url":"https://api.github.com/repos/opscode-cookbooks/chef-vault/issues/4","number":4,"state":"open","locked":false,"title":"COOK-4672 - Update library so it can be used in other libraries","user":{"login":"spion06","id":1733718,"avatar_url":"https://avatars.githubusercontent.com/u/1733718?v=3","gravatar_id":"","url":"https://api.github.com/users/spion06","html_url":"https://github.com/spion06","followers_url":"https://api.github.com/users/spion06/followers","following_url":"https://api.github.com/users/spion06/following{/other_user}","gists_url":"https://api.github.com/users/spion06/gists{/gist_id}","starred_url":"https://api.github.com/users/spion06/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spion06/subscriptions","organizations_url":"https://api.github.com/users/spion06/orgs","repos_url":"https://api.github.com/users/spion06/repos","events_url":"https://api.github.com/users/spion06/events{/privacy}","received_events_url":"https://api.github.com/users/spion06/received_events","type":"User","site_admin":false},"body":"","created_at":"2014-05-22T05:58:23Z","updated_at":"2015-02-03T21:21:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"057b5aec3ec99d04101ad8714deedf09f04ab334","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/opscode-cookbooks/chef-vault/pulls/4/commits","review_comments_url":"https://api.github.com/repos/opscode-cookbooks/chef-vault/pulls/4/comments","review_comment_url":"https://api.github.com/repos/opscode-cookbooks/chef-vault/pulls/comments/{number}","comments_url":"https://api.github.com/repos/opscode-cookbooks/chef-vault/issues/4/comments","statuses_url":"https://api.github.com/repos/opscode-cookbooks/chef-vault/statuses/e13a7299307af6699f766ca30d55ec1650f5fa0b","head":{"label":"spion06:COOK-4672","ref":"COOK-4672","sha":"e13a7299307af6699f766ca30d55ec1650f5fa0b","user":{"login":"spion06","id":1733718,"avatar_url":"https://avatars.githubusercontent.com/u/1733718?v=3","gravatar_id":"","url":"https://api.github.com/users/spion06","html_url":"https://github.com/spion06","followers_url":"https://api.github.com/users/spion06/followers","following_url":"https://api.github.com/users/spion06/following{/other_user}","gists_url":"https://api.github.com/users/spion06/gists{/gist_id}","starred_url":"https://api.github.com/users/spion06/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spion06/subscriptions","organizations_url":"https://api.github.com/users/spion06/orgs","repos_url":"https://api.github.com/users/spion06/repos","events_url":"https://api.github.com/users/spion06/events{/privacy}","received_events_url":"https://api.github.com/users/spion06/received_events","type":"User","site_admin":false},"repo":{"id":20049017,"name":"chef-vault","full_name":"spion06/chef-vault","owner":{"login":"spion06","id":1733718,"avatar_url":"https://avatars.githubusercontent.com/u/1733718?v=3","gravatar_id":"","url":"https://api.github.com/users/spion06","html_url":"https://github.com/spion06","followers_url":"https://api.github.com/users/spion06/followers","following_url":"https://api.github.com/users/spion06/following{/other_user}","gists_url":"https://api.github.com/users/spion06/gists{/gist_id}","starred_url":"https://api.github.com/users/spion06/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spion06/subscriptions","organizations_url":"https://api.github.com/users/spion06/orgs","repos_url":"https://api.github.com/users/spion06/repos","events_url":"https://api.github.com/users/spion06/events{/privacy}","received_events_url":"https://api.github.com/users/spion06/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/spion06/chef-vault","description":"Development repository for Opscode's chef-vault cookbook","fork":true,"url":"https://api.github.com/repos/spion06/chef-vault","forks_url":"https://api.github.com/repos/spion06/chef-vault/forks","keys_url":"https://api.github.com/repos/spion06/chef-vault/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spion06/chef-vault/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spion06/chef-vault/teams","hooks_url":"https://api.github.com/repos/spion06/chef-vault/hooks","issue_events_url":"https://api.github.com/repos/spion06/chef-vault/issues/events{/number}","events_url":"https://api.github.com/repos/spion06/chef-vault/events","assignees_url":"https://api.github.com/repos/spion06/chef-vault/assignees{/user}","branches_url":"https://api.github.com/repos/spion06/chef-vault/branches{/branch}","tags_url":"https://api.github.com/repos/spion06/chef-vault/tags","blobs_url":"https://api.github.com/repos/spion06/chef-vault/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spion06/chef-vault/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spion06/chef-vault/git/refs{/sha}","trees_url":"https://api.github.com/repos/spion06/chef-vault/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spion06/chef-vault/statuses/{sha}","languages_url":"https://api.github.com/repos/spion06/chef-vault/languages","stargazers_url":"https://api.github.com/repos/spion06/chef-vault/stargazers","contributors_url":"https://api.github.com/repos/spion06/chef-vault/contributors","subscribers_url":"https://api.github.com/repos/spion06/chef-vault/subscribers","subscription_url":"https://api.github.com/repos/spion06/chef-vault/subscription","commits_url":"https://api.github.com/repos/spion06/chef-vault/commits{/sha}","git_commits_url":"https://api.github.com/repos/spion06/chef-vault/git/commits{/sha}","comments_url":"https://api.github.com/repos/spion06/chef-vault/comments{/number}","issue_comment_url":"https://api.github.com/repos/spion06/chef-vault/issues/comments/{number}","contents_url":"https://api.github.com/repos/spion06/chef-vault/contents/{+path}","compare_url":"https://api.github.com/repos/spion06/chef-vault/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spion06/chef-vault/merges","archive_url":"https://api.github.com/repos/spion06/chef-vault/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spion06/chef-vault/downloads","issues_url":"https://api.github.com/repos/spion06/chef-vault/issues{/number}","pulls_url":"https://api.github.com/repos/spion06/chef-vault/pulls{/number}","milestones_url":"https://api.github.com/repos/spion06/chef-vault/milestones{/number}","notifications_url":"https://api.github.com/repos/spion06/chef-vault/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spion06/chef-vault/labels{/name}","releases_url":"https://api.github.com/repos/spion06/chef-vault/releases{/id}","created_at":"2014-05-22T05:31:24Z","updated_at":"2014-05-22T06:02:47Z","pushed_at":"2014-09-16T02:25:47Z","git_url":"git://github.com/spion06/chef-vault.git","ssh_url":"git@github.com:spion06/chef-vault.git","clone_url":"https://github.com/spion06/chef-vault.git","svn_url":"https://github.com/spion06/chef-vault","homepage":"http://community.opscode.com/cookbooks/chef-vault","size":191,"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":"opscode-cookbooks:master","ref":"master","sha":"bb687ed83aa6157dfe027ec8a500bc35a4abf09e","user":{"login":"opscode-cookbooks","id":1537126,"avatar_url":"https://avatars.githubusercontent.com/u/1537126?v=3","gravatar_id":"","url":"https://api.github.com/users/opscode-cookbooks","html_url":"https://github.com/opscode-cookbooks","followers_url":"https://api.github.com/users/opscode-cookbooks/followers","following_url":"https://api.github.com/users/opscode-cookbooks/following{/other_user}","gists_url":"https://api.github.com/users/opscode-cookbooks/gists{/gist_id}","starred_url":"https://api.github.com/users/opscode-cookbooks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opscode-cookbooks/subscriptions","organizations_url":"https://api.github.com/users/opscode-cookbooks/orgs","repos_url":"https://api.github.com/users/opscode-cookbooks/repos","events_url":"https://api.github.com/users/opscode-cookbooks/events{/privacy}","received_events_url":"https://api.github.com/users/opscode-cookbooks/received_events","type":"Organization","site_admin":false},"repo":{"id":12742787,"name":"chef-vault","full_name":"opscode-cookbooks/chef-vault","owner":{"login":"opscode-cookbooks","id":1537126,"avatar_url":"https://avatars.githubusercontent.com/u/1537126?v=3","gravatar_id":"","url":"https://api.github.com/users/opscode-cookbooks","html_url":"https://github.com/opscode-cookbooks","followers_url":"https://api.github.com/users/opscode-cookbooks/followers","following_url":"https://api.github.com/users/opscode-cookbooks/following{/other_user}","gists_url":"https://api.github.com/users/opscode-cookbooks/gists{/gist_id}","starred_url":"https://api.github.com/users/opscode-cookbooks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opscode-cookbooks/subscriptions","organizations_url":"https://api.github.com/users/opscode-cookbooks/orgs","repos_url":"https://api.github.com/users/opscode-cookbooks/repos","events_url":"https://api.github.com/users/opscode-cookbooks/events{/privacy}","received_events_url":"https://api.github.com/users/opscode-cookbooks/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/opscode-cookbooks/chef-vault","description":"Development repository for Opscode's chef-vault cookbook","fork":false,"url":"https://api.github.com/repos/opscode-cookbooks/chef-vault","forks_url":"https://api.github.com/repos/opscode-cookbooks/chef-vault/forks","keys_url":"https://api.github.com/repos/opscode-cookbooks/chef-vault/keys{/key_id}","collaborators_url":"https://api.github.com/repos/opscode-cookbooks/chef-vault/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/opscode-cookbooks/chef-vault/teams","hooks_url":"https://api.github.com/repos/opscode-cookbooks/chef-vault/hooks","issue_events_url":"https://api.github.com/repos/opscode-cookbooks/chef-vault/issues/events{/number}","events_url":"https://api.github.com/repos/opscode-cookbooks/chef-vault/events","assignees_url":"https://api.github.com/repos/opscode-cookbooks/chef-vault/assignees{/user}","branches_url":"https://api.github.com/repos/opscode-cookbooks/chef-vault/branches{/branch}","tags_url":"https://api.github.com/repos/opscode-cookbooks/chef-vault/tags","blobs_url":"https://api.github.com/repos/opscode-cookbooks/chef-vault/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/opscode-cookbooks/chef-vault/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/opscode-cookbooks/chef-vault/git/refs{/sha}","trees_url":"https://api.github.com/repos/opscode-cookbooks/chef-vault/git/trees{/sha}","statuses_url":"https://api.github.com/repos/opscode-cookbooks/chef-vault/statuses/{sha}","languages_url":"https://api.github.com/repos/opscode-cookbooks/chef-vault/languages","stargazers_url":"https://api.github.com/repos/opscode-cookbooks/chef-vault/stargazers","contributors_url":"https://api.github.com/repos/opscode-cookbooks/chef-vault/contributors","subscribers_url":"https://api.github.com/repos/opscode-cookbooks/chef-vault/subscribers","subscription_url":"https://api.github.com/repos/opscode-cookbooks/chef-vault/subscription","commits_url":"https://api.github.com/repos/opscode-cookbooks/chef-vault/commits{/sha}","git_commits_url":"https://api.github.com/repos/opscode-cookbooks/chef-vault/git/commits{/sha}","comments_url":"https://api.github.com/repos/opscode-cookbooks/chef-vault/comments{/number}","issue_comment_url":"https://api.github.com/repos/opscode-cookbooks/chef-vault/issues/comments/{number}","contents_url":"https://api.github.com/repos/opscode-cookbooks/chef-vault/contents/{+path}","compare_url":"https://api.github.com/repos/opscode-cookbooks/chef-vault/compare/{base}...{head}","merges_url":"https://api.github.com/repos/opscode-cookbooks/chef-vault/merges","archive_url":"https://api.github.com/repos/opscode-cookbooks/chef-vault/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/opscode-cookbooks/chef-vault/downloads","issues_url":"https://api.github.com/repos/opscode-cookbooks/chef-vault/issues{/number}","pulls_url":"https://api.github.com/repos/opscode-cookbooks/chef-vault/pulls{/number}","milestones_url":"https://api.github.com/repos/opscode-cookbooks/chef-vault/milestones{/number}","notifications_url":"https://api.github.com/repos/opscode-cookbooks/chef-vault/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/opscode-cookbooks/chef-vault/labels{/name}","releases_url":"https://api.github.com/repos/opscode-cookbooks/chef-vault/releases{/id}","created_at":"2013-09-10T23:09:09Z","updated_at":"2014-11-21T21:40:18Z","pushed_at":"2014-09-25T21:04:15Z","git_url":"git://github.com/opscode-cookbooks/chef-vault.git","ssh_url":"git@github.com:opscode-cookbooks/chef-vault.git","clone_url":"https://github.com/opscode-cookbooks/chef-vault.git","svn_url":"https://github.com/opscode-cookbooks/chef-vault","homepage":"http://community.opscode.com/cookbooks/chef-vault","size":579,"stargazers_count":17,"watchers_count":17,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"open_issues_count":8,"forks":9,"open_issues":8,"watchers":17,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/opscode-cookbooks/chef-vault/pulls/4"},"html":{"href":"https://github.com/opscode-cookbooks/chef-vault/pull/4"},"issue":{"href":"https://api.github.com/repos/opscode-cookbooks/chef-vault/issues/4"},"comments":{"href":"https://api.github.com/repos/opscode-cookbooks/chef-vault/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/opscode-cookbooks/chef-vault/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/opscode-cookbooks/chef-vault/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/opscode-cookbooks/chef-vault/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/opscode-cookbooks/chef-vault/statuses/e13a7299307af6699f766ca30d55ec1650f5fa0b"}}}}