{"action":"created","comment":{"url":"https://api.github.com/repos/Normation/ncf/pulls/comments/26667542","id":26667542,"diff_hunk":"@@ -0,0 +1,74 @@\n+#####################################################################################\n+# Copyright 2013 Normation SAS\n+#####################################################################################\n+#\n+# This program is free software: you can redistribute it and/or modify\n+# it under the terms of the GNU General Public License as published by\n+# the Free Software Foundation, Version 3.\n+#\n+# This program is distributed in the hope that it will be useful,\n+# but WITHOUT ANY WARRANTY; without even the implied warranty of\n+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n+# GNU General Public License for more details.\n+#\n+# You should have received a copy of the GNU General Public License\n+# along with this program.  If not, see <http://www.gnu.org/licenses/>.\n+#\n+#####################################################################################\n+\n+# @name File download\n+# @description Download a file if it does not exit, using curl with a fallback on wget\n+#\n+# @parameter source      URL to download from\n+# @parameter destination File destination\n+# \n+# @class_prefix file_download\n+# @class_parameter destination\n+# This bundle will define a class file_download_${destination}_{kept,repaired,not_ok,ok,reached}\n+\n+bundle agent file_download(source, destination)\n+{\n+\n+  vars:\n+\n+    curl_utility_present::\n+\n+      \"action_command\"            string => \"${unix_knowledge.utility[curl]} -s -L -o ${destination} ${source}\";","path":"tree/30_generic_methods/file_download.cf","position":36,"original_position":36,"commit_id":"807185aa70844dc3e48015e28d80e2c3cb978243","original_commit_id":"807185aa70844dc3e48015e28d80e2c3cb978243","user":{"login":"Kegeruneku","id":917886,"avatar_url":"https://avatars.githubusercontent.com/u/917886?v=3","gravatar_id":"","url":"https://api.github.com/users/Kegeruneku","html_url":"https://github.com/Kegeruneku","followers_url":"https://api.github.com/users/Kegeruneku/followers","following_url":"https://api.github.com/users/Kegeruneku/following{/other_user}","gists_url":"https://api.github.com/users/Kegeruneku/gists{/gist_id}","starred_url":"https://api.github.com/users/Kegeruneku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kegeruneku/subscriptions","organizations_url":"https://api.github.com/users/Kegeruneku/orgs","repos_url":"https://api.github.com/users/Kegeruneku/repos","events_url":"https://api.github.com/users/Kegeruneku/events{/privacy}","received_events_url":"https://api.github.com/users/Kegeruneku/received_events","type":"User","site_admin":false},"body":"For now yes, as there is no \"standard\" utility on Windows to download files like wget or curl. It can always be added later.","created_at":"2015-03-18T14:32:37Z","updated_at":"2015-03-18T14:32:37Z","html_url":"https://github.com/Normation/ncf/pull/182#discussion_r26667542","pull_request_url":"https://api.github.com/repos/Normation/ncf/pulls/182","_links":{"self":{"href":"https://api.github.com/repos/Normation/ncf/pulls/comments/26667542"},"html":{"href":"https://github.com/Normation/ncf/pull/182#discussion_r26667542"},"pull_request":{"href":"https://api.github.com/repos/Normation/ncf/pulls/182"}}},"pull_request":{"url":"https://api.github.com/repos/Normation/ncf/pulls/182","id":31426305,"html_url":"https://github.com/Normation/ncf/pull/182","diff_url":"https://github.com/Normation/ncf/pull/182.diff","patch_url":"https://github.com/Normation/ncf/pull/182.patch","issue_url":"https://api.github.com/repos/Normation/ncf/issues/182","number":182,"state":"open","locked":false,"title":"Fixes #6418: Add the file_download generic method","user":{"login":"Kegeruneku","id":917886,"avatar_url":"https://avatars.githubusercontent.com/u/917886?v=3","gravatar_id":"","url":"https://api.github.com/users/Kegeruneku","html_url":"https://github.com/Kegeruneku","followers_url":"https://api.github.com/users/Kegeruneku/followers","following_url":"https://api.github.com/users/Kegeruneku/following{/other_user}","gists_url":"https://api.github.com/users/Kegeruneku/gists{/gist_id}","starred_url":"https://api.github.com/users/Kegeruneku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kegeruneku/subscriptions","organizations_url":"https://api.github.com/users/Kegeruneku/orgs","repos_url":"https://api.github.com/users/Kegeruneku/repos","events_url":"https://api.github.com/users/Kegeruneku/events{/privacy}","received_events_url":"https://api.github.com/users/Kegeruneku/received_events","type":"User","site_admin":false},"body":"Ticket: http://www.rudder-project.org/redmine/issues/6418\r\n\r\nTo be merged in master","created_at":"2015-03-18T13:03:41Z","updated_at":"2015-03-18T14:32:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"85cecbb3c64c1aa15e5a71daf360e2180abb7424","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Normation/ncf/pulls/182/commits","review_comments_url":"https://api.github.com/repos/Normation/ncf/pulls/182/comments","review_comment_url":"https://api.github.com/repos/Normation/ncf/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Normation/ncf/issues/182/comments","statuses_url":"https://api.github.com/repos/Normation/ncf/statuses/807185aa70844dc3e48015e28d80e2c3cb978243","head":{"label":"Kegeruneku:ust_6417/dev/6418_add_file_download_generic_method","ref":"ust_6417/dev/6418_add_file_download_generic_method","sha":"807185aa70844dc3e48015e28d80e2c3cb978243","user":{"login":"Kegeruneku","id":917886,"avatar_url":"https://avatars.githubusercontent.com/u/917886?v=3","gravatar_id":"","url":"https://api.github.com/users/Kegeruneku","html_url":"https://github.com/Kegeruneku","followers_url":"https://api.github.com/users/Kegeruneku/followers","following_url":"https://api.github.com/users/Kegeruneku/following{/other_user}","gists_url":"https://api.github.com/users/Kegeruneku/gists{/gist_id}","starred_url":"https://api.github.com/users/Kegeruneku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kegeruneku/subscriptions","organizations_url":"https://api.github.com/users/Kegeruneku/orgs","repos_url":"https://api.github.com/users/Kegeruneku/repos","events_url":"https://api.github.com/users/Kegeruneku/events{/privacy}","received_events_url":"https://api.github.com/users/Kegeruneku/received_events","type":"User","site_admin":false},"repo":{"id":14903195,"name":"ncf","full_name":"Kegeruneku/ncf","owner":{"login":"Kegeruneku","id":917886,"avatar_url":"https://avatars.githubusercontent.com/u/917886?v=3","gravatar_id":"","url":"https://api.github.com/users/Kegeruneku","html_url":"https://github.com/Kegeruneku","followers_url":"https://api.github.com/users/Kegeruneku/followers","following_url":"https://api.github.com/users/Kegeruneku/following{/other_user}","gists_url":"https://api.github.com/users/Kegeruneku/gists{/gist_id}","starred_url":"https://api.github.com/users/Kegeruneku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kegeruneku/subscriptions","organizations_url":"https://api.github.com/users/Kegeruneku/orgs","repos_url":"https://api.github.com/users/Kegeruneku/repos","events_url":"https://api.github.com/users/Kegeruneku/events{/privacy}","received_events_url":"https://api.github.com/users/Kegeruneku/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Kegeruneku/ncf","description":"NCF is a CFEngine framework aimed at helping newcomers on CFEngine to be more quickly operationnal and old timers to spend less time focusing on low level details and have more time for fun things.","fork":true,"url":"https://api.github.com/repos/Kegeruneku/ncf","forks_url":"https://api.github.com/repos/Kegeruneku/ncf/forks","keys_url":"https://api.github.com/repos/Kegeruneku/ncf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Kegeruneku/ncf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Kegeruneku/ncf/teams","hooks_url":"https://api.github.com/repos/Kegeruneku/ncf/hooks","issue_events_url":"https://api.github.com/repos/Kegeruneku/ncf/issues/events{/number}","events_url":"https://api.github.com/repos/Kegeruneku/ncf/events","assignees_url":"https://api.github.com/repos/Kegeruneku/ncf/assignees{/user}","branches_url":"https://api.github.com/repos/Kegeruneku/ncf/branches{/branch}","tags_url":"https://api.github.com/repos/Kegeruneku/ncf/tags","blobs_url":"https://api.github.com/repos/Kegeruneku/ncf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Kegeruneku/ncf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Kegeruneku/ncf/git/refs{/sha}","trees_url":"https://api.github.com/repos/Kegeruneku/ncf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Kegeruneku/ncf/statuses/{sha}","languages_url":"https://api.github.com/repos/Kegeruneku/ncf/languages","stargazers_url":"https://api.github.com/repos/Kegeruneku/ncf/stargazers","contributors_url":"https://api.github.com/repos/Kegeruneku/ncf/contributors","subscribers_url":"https://api.github.com/repos/Kegeruneku/ncf/subscribers","subscription_url":"https://api.github.com/repos/Kegeruneku/ncf/subscription","commits_url":"https://api.github.com/repos/Kegeruneku/ncf/commits{/sha}","git_commits_url":"https://api.github.com/repos/Kegeruneku/ncf/git/commits{/sha}","comments_url":"https://api.github.com/repos/Kegeruneku/ncf/comments{/number}","issue_comment_url":"https://api.github.com/repos/Kegeruneku/ncf/issues/comments{/number}","contents_url":"https://api.github.com/repos/Kegeruneku/ncf/contents/{+path}","compare_url":"https://api.github.com/repos/Kegeruneku/ncf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Kegeruneku/ncf/merges","archive_url":"https://api.github.com/repos/Kegeruneku/ncf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Kegeruneku/ncf/downloads","issues_url":"https://api.github.com/repos/Kegeruneku/ncf/issues{/number}","pulls_url":"https://api.github.com/repos/Kegeruneku/ncf/pulls{/number}","milestones_url":"https://api.github.com/repos/Kegeruneku/ncf/milestones{/number}","notifications_url":"https://api.github.com/repos/Kegeruneku/ncf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Kegeruneku/ncf/labels{/name}","releases_url":"https://api.github.com/repos/Kegeruneku/ncf/releases{/id}","created_at":"2013-12-03T19:16:35Z","updated_at":"2015-01-27T16:09:50Z","pushed_at":"2015-03-18T13:02:34Z","git_url":"git://github.com/Kegeruneku/ncf.git","ssh_url":"git@github.com:Kegeruneku/ncf.git","clone_url":"https://github.com/Kegeruneku/ncf.git","svn_url":"https://github.com/Kegeruneku/ncf","homepage":"http://www.rudder-project.org/redmine/projects/ncf","size":2052,"stargazers_count":0,"watchers_count":0,"language":"CSS","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":"Normation:master","ref":"master","sha":"6176a6be68de2e4f5801d63d2629da8c97db4fdd","user":{"login":"Normation","id":695105,"avatar_url":"https://avatars.githubusercontent.com/u/695105?v=3","gravatar_id":"","url":"https://api.github.com/users/Normation","html_url":"https://github.com/Normation","followers_url":"https://api.github.com/users/Normation/followers","following_url":"https://api.github.com/users/Normation/following{/other_user}","gists_url":"https://api.github.com/users/Normation/gists{/gist_id}","starred_url":"https://api.github.com/users/Normation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Normation/subscriptions","organizations_url":"https://api.github.com/users/Normation/orgs","repos_url":"https://api.github.com/users/Normation/repos","events_url":"https://api.github.com/users/Normation/events{/privacy}","received_events_url":"https://api.github.com/users/Normation/received_events","type":"Organization","site_admin":false},"repo":{"id":12734168,"name":"ncf","full_name":"Normation/ncf","owner":{"login":"Normation","id":695105,"avatar_url":"https://avatars.githubusercontent.com/u/695105?v=3","gravatar_id":"","url":"https://api.github.com/users/Normation","html_url":"https://github.com/Normation","followers_url":"https://api.github.com/users/Normation/followers","following_url":"https://api.github.com/users/Normation/following{/other_user}","gists_url":"https://api.github.com/users/Normation/gists{/gist_id}","starred_url":"https://api.github.com/users/Normation/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Normation/subscriptions","organizations_url":"https://api.github.com/users/Normation/orgs","repos_url":"https://api.github.com/users/Normation/repos","events_url":"https://api.github.com/users/Normation/events{/privacy}","received_events_url":"https://api.github.com/users/Normation/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Normation/ncf","description":"ncf is a framework that runs in pure CFEngine language, to help structure your CFEngine policy and provide reusable, single purpose components distributed under the GPLv3 license.","fork":false,"url":"https://api.github.com/repos/Normation/ncf","forks_url":"https://api.github.com/repos/Normation/ncf/forks","keys_url":"https://api.github.com/repos/Normation/ncf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Normation/ncf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Normation/ncf/teams","hooks_url":"https://api.github.com/repos/Normation/ncf/hooks","issue_events_url":"https://api.github.com/repos/Normation/ncf/issues/events{/number}","events_url":"https://api.github.com/repos/Normation/ncf/events","assignees_url":"https://api.github.com/repos/Normation/ncf/assignees{/user}","branches_url":"https://api.github.com/repos/Normation/ncf/branches{/branch}","tags_url":"https://api.github.com/repos/Normation/ncf/tags","blobs_url":"https://api.github.com/repos/Normation/ncf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Normation/ncf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Normation/ncf/git/refs{/sha}","trees_url":"https://api.github.com/repos/Normation/ncf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Normation/ncf/statuses/{sha}","languages_url":"https://api.github.com/repos/Normation/ncf/languages","stargazers_url":"https://api.github.com/repos/Normation/ncf/stargazers","contributors_url":"https://api.github.com/repos/Normation/ncf/contributors","subscribers_url":"https://api.github.com/repos/Normation/ncf/subscribers","subscription_url":"https://api.github.com/repos/Normation/ncf/subscription","commits_url":"https://api.github.com/repos/Normation/ncf/commits{/sha}","git_commits_url":"https://api.github.com/repos/Normation/ncf/git/commits{/sha}","comments_url":"https://api.github.com/repos/Normation/ncf/comments{/number}","issue_comment_url":"https://api.github.com/repos/Normation/ncf/issues/comments{/number}","contents_url":"https://api.github.com/repos/Normation/ncf/contents/{+path}","compare_url":"https://api.github.com/repos/Normation/ncf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Normation/ncf/merges","archive_url":"https://api.github.com/repos/Normation/ncf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Normation/ncf/downloads","issues_url":"https://api.github.com/repos/Normation/ncf/issues{/number}","pulls_url":"https://api.github.com/repos/Normation/ncf/pulls{/number}","milestones_url":"https://api.github.com/repos/Normation/ncf/milestones{/number}","notifications_url":"https://api.github.com/repos/Normation/ncf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Normation/ncf/labels{/name}","releases_url":"https://api.github.com/repos/Normation/ncf/releases{/id}","created_at":"2013-09-10T16:02:33Z","updated_at":"2015-03-16T16:07:44Z","pushed_at":"2015-03-13T11:24:50Z","git_url":"git://github.com/Normation/ncf.git","ssh_url":"git@github.com:Normation/ncf.git","clone_url":"https://github.com/Normation/ncf.git","svn_url":"https://github.com/Normation/ncf","homepage":"http://www.ncf.io","size":4116,"stargazers_count":25,"watchers_count":25,"language":"CSS","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":19,"mirror_url":null,"open_issues_count":14,"forks":19,"open_issues":14,"watchers":25,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Normation/ncf/pulls/182"},"html":{"href":"https://github.com/Normation/ncf/pull/182"},"issue":{"href":"https://api.github.com/repos/Normation/ncf/issues/182"},"comments":{"href":"https://api.github.com/repos/Normation/ncf/issues/182/comments"},"review_comments":{"href":"https://api.github.com/repos/Normation/ncf/pulls/182/comments"},"review_comment":{"href":"https://api.github.com/repos/Normation/ncf/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Normation/ncf/pulls/182/commits"},"statuses":{"href":"https://api.github.com/repos/Normation/ncf/statuses/807185aa70844dc3e48015e28d80e2c3cb978243"}}}}