{"action":"created","comment":{"url":"https://api.github.com/repos/puppetlabs/r10k/pulls/comments/50917560","id":50917560,"diff_hunk":"@@ -186,22 +186,66 @@ def module_source_for_module(module_name, env_map)\n     def module_sources_for_environment(env_map)\n     end\n \n+    # Update local caches represented by the given by module_sources, a collection of module_source hashmaps.\n+    #\n+    # @param module_sources [Array<Hash>] An array of hashmaps each representing a single remote module source (as produced by {#module_sources_for_environment})\n+    # @param base_cachedir [String] Root of where r10k is caching things.\n+    # @return [true] Returns true on success, raises on failure.\n+    # @raise [RuntimeError] Something bad happened!\n+    def update_caches(module_sources, base_cachedir, opts = {})\n+      if module_sources.respond_to?(:each)\n+        module_sources.each do |module_source|\n+          update_cache(module_source, base_cachedir, opts)\n+        end\n+        return true\n+      else\n+        raise RuntimeError.new(\"module_sources must be a collection of source hashes.\")\n+      end\n+\n+    end\n     # Update local cache represented by the given module_source hashmap.\n     #\n     # @param module_source [Hash] A hashmap representing a single remote module source (as produced by {#module_sources_for_environment})\n+    # @param base_cachedir [String] Root of where r10k is caching things.\n     # @return [true] Returns true on success, raises on failure.\n-    # @raise [RuntimeError] Something bad happened!\n-    def update_cache(module_source)\n+    # @raise [UnresolvableError] Something bad happened!\n+    def update_cache(module_source, base_cachedir, opts = {})\n+      type = module_source[:type]\n+      source = module_source[:source]\n+\n+      raise UnresolvableError.new('module source type cannot be nil.') if type.nil?","path":"lib/r10k/api.rb","position":33,"original_position":33,"commit_id":"55765da78d1100549ef786623101a50fef74baad","original_commit_id":"55765da78d1100549ef786623101a50fef74baad","user":{"login":"scotje","id":9058,"avatar_url":"https://avatars.githubusercontent.com/u/9058?v=3","gravatar_id":"","url":"https://api.github.com/users/scotje","html_url":"https://github.com/scotje","followers_url":"https://api.github.com/users/scotje/followers","following_url":"https://api.github.com/users/scotje/following{/other_user}","gists_url":"https://api.github.com/users/scotje/gists{/gist_id}","starred_url":"https://api.github.com/users/scotje/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scotje/subscriptions","organizations_url":"https://api.github.com/users/scotje/orgs","repos_url":"https://api.github.com/users/scotje/repos","events_url":"https://api.github.com/users/scotje/events{/privacy}","received_events_url":"https://api.github.com/users/scotje/received_events","type":"User","site_admin":false},"body":"I think UnresolvableError should probably be reserved for the method(s) that specifically attempt envmap resolution","created_at":"2016-01-26T23:15:10Z","updated_at":"2016-01-26T23:15:10Z","html_url":"https://github.com/puppetlabs/r10k/pull/561#discussion_r50917560","pull_request_url":"https://api.github.com/repos/puppetlabs/r10k/pulls/561","_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/r10k/pulls/comments/50917560"},"html":{"href":"https://github.com/puppetlabs/r10k/pull/561#discussion_r50917560"},"pull_request":{"href":"https://api.github.com/repos/puppetlabs/r10k/pulls/561"}}},"pull_request":{"url":"https://api.github.com/repos/puppetlabs/r10k/pulls/561","id":57261637,"html_url":"https://github.com/puppetlabs/r10k/pull/561","diff_url":"https://github.com/puppetlabs/r10k/pull/561.diff","patch_url":"https://github.com/puppetlabs/r10k/pull/561.patch","issue_url":"https://api.github.com/repos/puppetlabs/r10k/issues/561","number":561,"state":"open","locked":false,"title":"(RK-191) implement cache update fns","user":{"login":"andersonmills","id":5975010,"avatar_url":"https://avatars.githubusercontent.com/u/5975010?v=3","gravatar_id":"","url":"https://api.github.com/users/andersonmills","html_url":"https://github.com/andersonmills","followers_url":"https://api.github.com/users/andersonmills/followers","following_url":"https://api.github.com/users/andersonmills/following{/other_user}","gists_url":"https://api.github.com/users/andersonmills/gists{/gist_id}","starred_url":"https://api.github.com/users/andersonmills/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andersonmills/subscriptions","organizations_url":"https://api.github.com/users/andersonmills/orgs","repos_url":"https://api.github.com/users/andersonmills/repos","events_url":"https://api.github.com/users/andersonmills/events{/privacy}","received_events_url":"https://api.github.com/users/andersonmills/received_events","type":"User","site_admin":false},"body":"This commit implements cache updating for modules from git repositories.","created_at":"2016-01-26T19:47:51Z","updated_at":"2016-01-26T23:15:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bb6e0199602fde07eec1c7ded0e3a720ba94e70f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/puppetlabs/r10k/pulls/561/commits","review_comments_url":"https://api.github.com/repos/puppetlabs/r10k/pulls/561/comments","review_comment_url":"https://api.github.com/repos/puppetlabs/r10k/pulls/comments{/number}","comments_url":"https://api.github.com/repos/puppetlabs/r10k/issues/561/comments","statuses_url":"https://api.github.com/repos/puppetlabs/r10k/statuses/55765da78d1100549ef786623101a50fef74baad","head":{"label":"andersonmills:task/r10k-api/RK-191-implement_cache_update_fns","ref":"task/r10k-api/RK-191-implement_cache_update_fns","sha":"55765da78d1100549ef786623101a50fef74baad","user":{"login":"andersonmills","id":5975010,"avatar_url":"https://avatars.githubusercontent.com/u/5975010?v=3","gravatar_id":"","url":"https://api.github.com/users/andersonmills","html_url":"https://github.com/andersonmills","followers_url":"https://api.github.com/users/andersonmills/followers","following_url":"https://api.github.com/users/andersonmills/following{/other_user}","gists_url":"https://api.github.com/users/andersonmills/gists{/gist_id}","starred_url":"https://api.github.com/users/andersonmills/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andersonmills/subscriptions","organizations_url":"https://api.github.com/users/andersonmills/orgs","repos_url":"https://api.github.com/users/andersonmills/repos","events_url":"https://api.github.com/users/andersonmills/events{/privacy}","received_events_url":"https://api.github.com/users/andersonmills/received_events","type":"User","site_admin":false},"repo":{"id":28876764,"name":"r10k","full_name":"andersonmills/r10k","owner":{"login":"andersonmills","id":5975010,"avatar_url":"https://avatars.githubusercontent.com/u/5975010?v=3","gravatar_id":"","url":"https://api.github.com/users/andersonmills","html_url":"https://github.com/andersonmills","followers_url":"https://api.github.com/users/andersonmills/followers","following_url":"https://api.github.com/users/andersonmills/following{/other_user}","gists_url":"https://api.github.com/users/andersonmills/gists{/gist_id}","starred_url":"https://api.github.com/users/andersonmills/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andersonmills/subscriptions","organizations_url":"https://api.github.com/users/andersonmills/orgs","repos_url":"https://api.github.com/users/andersonmills/repos","events_url":"https://api.github.com/users/andersonmills/events{/privacy}","received_events_url":"https://api.github.com/users/andersonmills/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/andersonmills/r10k","description":"Smarter Puppet deployment","fork":true,"url":"https://api.github.com/repos/andersonmills/r10k","forks_url":"https://api.github.com/repos/andersonmills/r10k/forks","keys_url":"https://api.github.com/repos/andersonmills/r10k/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andersonmills/r10k/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andersonmills/r10k/teams","hooks_url":"https://api.github.com/repos/andersonmills/r10k/hooks","issue_events_url":"https://api.github.com/repos/andersonmills/r10k/issues/events{/number}","events_url":"https://api.github.com/repos/andersonmills/r10k/events","assignees_url":"https://api.github.com/repos/andersonmills/r10k/assignees{/user}","branches_url":"https://api.github.com/repos/andersonmills/r10k/branches{/branch}","tags_url":"https://api.github.com/repos/andersonmills/r10k/tags","blobs_url":"https://api.github.com/repos/andersonmills/r10k/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andersonmills/r10k/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andersonmills/r10k/git/refs{/sha}","trees_url":"https://api.github.com/repos/andersonmills/r10k/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andersonmills/r10k/statuses/{sha}","languages_url":"https://api.github.com/repos/andersonmills/r10k/languages","stargazers_url":"https://api.github.com/repos/andersonmills/r10k/stargazers","contributors_url":"https://api.github.com/repos/andersonmills/r10k/contributors","subscribers_url":"https://api.github.com/repos/andersonmills/r10k/subscribers","subscription_url":"https://api.github.com/repos/andersonmills/r10k/subscription","commits_url":"https://api.github.com/repos/andersonmills/r10k/commits{/sha}","git_commits_url":"https://api.github.com/repos/andersonmills/r10k/git/commits{/sha}","comments_url":"https://api.github.com/repos/andersonmills/r10k/comments{/number}","issue_comment_url":"https://api.github.com/repos/andersonmills/r10k/issues/comments{/number}","contents_url":"https://api.github.com/repos/andersonmills/r10k/contents/{+path}","compare_url":"https://api.github.com/repos/andersonmills/r10k/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andersonmills/r10k/merges","archive_url":"https://api.github.com/repos/andersonmills/r10k/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andersonmills/r10k/downloads","issues_url":"https://api.github.com/repos/andersonmills/r10k/issues{/number}","pulls_url":"https://api.github.com/repos/andersonmills/r10k/pulls{/number}","milestones_url":"https://api.github.com/repos/andersonmills/r10k/milestones{/number}","notifications_url":"https://api.github.com/repos/andersonmills/r10k/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andersonmills/r10k/labels{/name}","releases_url":"https://api.github.com/repos/andersonmills/r10k/releases{/id}","deployments_url":"https://api.github.com/repos/andersonmills/r10k/deployments","created_at":"2015-01-06T18:23:00Z","updated_at":"2015-05-06T15:43:06Z","pushed_at":"2016-01-26T22:55:06Z","git_url":"git://github.com/andersonmills/r10k.git","ssh_url":"git@github.com:andersonmills/r10k.git","clone_url":"https://github.com/andersonmills/r10k.git","svn_url":"https://github.com/andersonmills/r10k","homepage":"","size":1787,"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":"puppetlabs:r10k-api","ref":"r10k-api","sha":"6cc1748a68cc4de2e4d6197d78bfa19862100db1","user":{"login":"puppetlabs","id":234268,"avatar_url":"https://avatars.githubusercontent.com/u/234268?v=3","gravatar_id":"","url":"https://api.github.com/users/puppetlabs","html_url":"https://github.com/puppetlabs","followers_url":"https://api.github.com/users/puppetlabs/followers","following_url":"https://api.github.com/users/puppetlabs/following{/other_user}","gists_url":"https://api.github.com/users/puppetlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/puppetlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puppetlabs/subscriptions","organizations_url":"https://api.github.com/users/puppetlabs/orgs","repos_url":"https://api.github.com/users/puppetlabs/repos","events_url":"https://api.github.com/users/puppetlabs/events{/privacy}","received_events_url":"https://api.github.com/users/puppetlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":7176141,"name":"r10k","full_name":"puppetlabs/r10k","owner":{"login":"puppetlabs","id":234268,"avatar_url":"https://avatars.githubusercontent.com/u/234268?v=3","gravatar_id":"","url":"https://api.github.com/users/puppetlabs","html_url":"https://github.com/puppetlabs","followers_url":"https://api.github.com/users/puppetlabs/followers","following_url":"https://api.github.com/users/puppetlabs/following{/other_user}","gists_url":"https://api.github.com/users/puppetlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/puppetlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puppetlabs/subscriptions","organizations_url":"https://api.github.com/users/puppetlabs/orgs","repos_url":"https://api.github.com/users/puppetlabs/repos","events_url":"https://api.github.com/users/puppetlabs/events{/privacy}","received_events_url":"https://api.github.com/users/puppetlabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/puppetlabs/r10k","description":"Smarter Puppet deployment","fork":false,"url":"https://api.github.com/repos/puppetlabs/r10k","forks_url":"https://api.github.com/repos/puppetlabs/r10k/forks","keys_url":"https://api.github.com/repos/puppetlabs/r10k/keys{/key_id}","collaborators_url":"https://api.github.com/repos/puppetlabs/r10k/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/puppetlabs/r10k/teams","hooks_url":"https://api.github.com/repos/puppetlabs/r10k/hooks","issue_events_url":"https://api.github.com/repos/puppetlabs/r10k/issues/events{/number}","events_url":"https://api.github.com/repos/puppetlabs/r10k/events","assignees_url":"https://api.github.com/repos/puppetlabs/r10k/assignees{/user}","branches_url":"https://api.github.com/repos/puppetlabs/r10k/branches{/branch}","tags_url":"https://api.github.com/repos/puppetlabs/r10k/tags","blobs_url":"https://api.github.com/repos/puppetlabs/r10k/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/puppetlabs/r10k/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/puppetlabs/r10k/git/refs{/sha}","trees_url":"https://api.github.com/repos/puppetlabs/r10k/git/trees{/sha}","statuses_url":"https://api.github.com/repos/puppetlabs/r10k/statuses/{sha}","languages_url":"https://api.github.com/repos/puppetlabs/r10k/languages","stargazers_url":"https://api.github.com/repos/puppetlabs/r10k/stargazers","contributors_url":"https://api.github.com/repos/puppetlabs/r10k/contributors","subscribers_url":"https://api.github.com/repos/puppetlabs/r10k/subscribers","subscription_url":"https://api.github.com/repos/puppetlabs/r10k/subscription","commits_url":"https://api.github.com/repos/puppetlabs/r10k/commits{/sha}","git_commits_url":"https://api.github.com/repos/puppetlabs/r10k/git/commits{/sha}","comments_url":"https://api.github.com/repos/puppetlabs/r10k/comments{/number}","issue_comment_url":"https://api.github.com/repos/puppetlabs/r10k/issues/comments{/number}","contents_url":"https://api.github.com/repos/puppetlabs/r10k/contents/{+path}","compare_url":"https://api.github.com/repos/puppetlabs/r10k/compare/{base}...{head}","merges_url":"https://api.github.com/repos/puppetlabs/r10k/merges","archive_url":"https://api.github.com/repos/puppetlabs/r10k/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/puppetlabs/r10k/downloads","issues_url":"https://api.github.com/repos/puppetlabs/r10k/issues{/number}","pulls_url":"https://api.github.com/repos/puppetlabs/r10k/pulls{/number}","milestones_url":"https://api.github.com/repos/puppetlabs/r10k/milestones{/number}","notifications_url":"https://api.github.com/repos/puppetlabs/r10k/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/puppetlabs/r10k/labels{/name}","releases_url":"https://api.github.com/repos/puppetlabs/r10k/releases{/id}","deployments_url":"https://api.github.com/repos/puppetlabs/r10k/deployments","created_at":"2012-12-15T05:19:38Z","updated_at":"2016-01-22T01:18:14Z","pushed_at":"2016-01-26T22:55:06Z","git_url":"git://github.com/puppetlabs/r10k.git","ssh_url":"git@github.com:puppetlabs/r10k.git","clone_url":"https://github.com/puppetlabs/r10k.git","svn_url":"https://github.com/puppetlabs/r10k","homepage":"","size":2036,"stargazers_count":516,"watchers_count":516,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":169,"mirror_url":null,"open_issues_count":51,"forks":169,"open_issues":51,"watchers":516,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/r10k/pulls/561"},"html":{"href":"https://github.com/puppetlabs/r10k/pull/561"},"issue":{"href":"https://api.github.com/repos/puppetlabs/r10k/issues/561"},"comments":{"href":"https://api.github.com/repos/puppetlabs/r10k/issues/561/comments"},"review_comments":{"href":"https://api.github.com/repos/puppetlabs/r10k/pulls/561/comments"},"review_comment":{"href":"https://api.github.com/repos/puppetlabs/r10k/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/puppetlabs/r10k/pulls/561/commits"},"statuses":{"href":"https://api.github.com/repos/puppetlabs/r10k/statuses/55765da78d1100549ef786623101a50fef74baad"}}}}