{"action":"created","comment":{"url":"https://api.github.com/repos/Homebrew/homebrew/pulls/comments/48468048","id":48468048,"diff_hunk":"@@ -13,36 +12,58 @@ class Kibana < Formula\n     sha256 \"5d102f006b25dae70bd62c99d9787abe10111460bc2119e5e5ceb412d6335dae\" => :mountain_lion\n   end\n \n-  depends_on \"node\"\n+  resource \"node\" do\n+    url \"https://nodejs.org/dist/v0.12.7/node-v0.12.7.tar.gz\"\n+    sha256 \"b23d64df051c9c969b0c583f802d5d71de342e53067127a5061415be7e12f39d\"\n+  end\n \n   def install\n-    ENV.prepend_path \"PATH\", \"#{Formula[\"node\"].opt_libexec}/npm/bin\"\n+    resource(\"node\").stage buildpath/\"node\"\n+    cd buildpath/\"node\" do\n+      system \"./configure\", \"--prefix=#{libexec}/node\"\n+      system \"make\", \"install\"\n+    end\n \n-    system \"npm\", \"install\"\n-    system \"npm\", \"install\", \"grunt-cli\"\n-    system \"npm\", \"install\", \"bower\"\n-    system \"./node_modules/.bin/bower\", \"install\"\n-    system \"./node_modules/.bin/grunt\", \"build\", \"--force\"\n+    # do not download binary installs of Node.js\n+    inreplace buildpath/\"tasks/build/index.js\" do |s|\n+      s.gsub!(%r{('_build:downloadNodeBuilds:\\w+',)}, \"// \\\\1\")\n+    end\n \n-    dist_dir = buildpath/\"build/dist/kibana\"\n+    # do not build packages for other platforms\n+    inreplace buildpath/\"tasks/config/platforms.js\" do |s|\n+      s.gsub!(%r{('(linux-x64|linux-x86|windows)',?(?!;))}, \"// \\\\1\")\n+    end\n \n-    rm_f dist_dir/\"bin/*.bat\"\n+    # do not build zip package\n+    inreplace buildpath/\"tasks/build/archives.js\" do |s|\n+      s.gsub!(%r{(await exec\\('zip'.*)}, \"// \\\\1\")\n+    end\n \n-    prefix.install dist_dir/\"src\"\n-    (etc/\"kibana\").mkpath\n-    (var/\"lib/kibana/plugins\").mkpath\n+    ENV.prepend_path \"PATH\", prefix/\"libexec/node/bin\"\n+    system \"npm\", \"install\"\n+    system \"npm\", \"run\", \"build\"\n+    mkdir \"tar\"\n+    system \"tar\", \"--strip-components\", \"1\", \"-xf\", Dir[\"target/kibana-*-darwin-x64.tar.gz\"].first, \"-C\", \"tar\"\n \n-    (etc/\"kibana\").install dist_dir/\"config/kibana.yml\" unless (etc/\"kibana/kibana.yml\").exist?\n+    rm_f Dir[\"tar/bin/*.bat\"]\n+    [\"bin\", \"config\", \"node_modules\", \"optimize\", \"package.json\", \"src\", \"webpackShims\"].each do |s|\n+      prefix.install \"tar/#{s}\"\n+      end\n+  end\n \n-    # point to our node\n-    inreplace dist_dir/\"bin/kibana\" do |s|\n-      s.sub! /^NODE=.*$/, \"NODE=#{Formula[\"node\"].opt_bin}/node\"\n+  def post_install\n+    inreplace \"#{bin}/kibana\" do |s|\n+      s.sub!(%r{/node/bin/node}, \"/libexec/node/bin/node\")\n     end\n+    inreplace \"#{prefix}/config/kibana.yml\" do |s|\n+      s.sub!(%r{/var/run/kibana.pid}, \"/usr/local/var/run/kibana.pid\")\n+    end\n+    (etc/\"kibana\").install prefix/\"config/kibana.yml\" unless (etc/\"kibana/kibana.yml\").exist?","path":"Library/Formula/kibana.rb","position":null,"original_position":77,"commit_id":"49c146cf58c93b59675b5828e70bf35ecd7498ee","original_commit_id":"df33ce257f758f7ac60ddd50127a6111436dacb3","user":{"login":"mikemcquaid","id":125011,"avatar_url":"https://avatars.githubusercontent.com/u/125011?v=3","gravatar_id":"","url":"https://api.github.com/users/mikemcquaid","html_url":"https://github.com/mikemcquaid","followers_url":"https://api.github.com/users/mikemcquaid/followers","following_url":"https://api.github.com/users/mikemcquaid/following{/other_user}","gists_url":"https://api.github.com/users/mikemcquaid/gists{/gist_id}","starred_url":"https://api.github.com/users/mikemcquaid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikemcquaid/subscriptions","organizations_url":"https://api.github.com/users/mikemcquaid/orgs","repos_url":"https://api.github.com/users/mikemcquaid/repos","events_url":"https://api.github.com/users/mikemcquaid/events{/privacy}","received_events_url":"https://api.github.com/users/mikemcquaid/received_events","type":"User","site_admin":true},"body":"@jasontedor In handles rewriting and writing out a default version in a slightly cleverer/more consistent way so it's preferable, if you don't mind.","created_at":"2015-12-28T08:43:42Z","updated_at":"2015-12-28T08:43:42Z","html_url":"https://github.com/Homebrew/homebrew/pull/46593#discussion_r48468048","pull_request_url":"https://api.github.com/repos/Homebrew/homebrew/pulls/46593","_links":{"self":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/comments/48468048"},"html":{"href":"https://github.com/Homebrew/homebrew/pull/46593#discussion_r48468048"},"pull_request":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/46593"}}},"pull_request":{"url":"https://api.github.com/repos/Homebrew/homebrew/pulls/46593","id":52438949,"html_url":"https://github.com/Homebrew/homebrew/pull/46593","diff_url":"https://github.com/Homebrew/homebrew/pull/46593.diff","patch_url":"https://github.com/Homebrew/homebrew/pull/46593.patch","issue_url":"https://api.github.com/repos/Homebrew/homebrew/issues/46593","number":46593,"state":"open","locked":false,"title":"kibana-4.3.0","user":{"login":"jasontedor","id":4744941,"avatar_url":"https://avatars.githubusercontent.com/u/4744941?v=3","gravatar_id":"","url":"https://api.github.com/users/jasontedor","html_url":"https://github.com/jasontedor","followers_url":"https://api.github.com/users/jasontedor/followers","following_url":"https://api.github.com/users/jasontedor/following{/other_user}","gists_url":"https://api.github.com/users/jasontedor/gists{/gist_id}","starred_url":"https://api.github.com/users/jasontedor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasontedor/subscriptions","organizations_url":"https://api.github.com/users/jasontedor/orgs","repos_url":"https://api.github.com/users/jasontedor/repos","events_url":"https://api.github.com/users/jasontedor/events{/privacy}","received_events_url":"https://api.github.com/users/jasontedor/received_events","type":"User","site_admin":false},"body":"This pull request updates the Kibana formula from version 4.1.1 to version\r\n4.3.0, the latest stable version of Kibana as of 2015-11-24.\r\n\r\nRelates #46349","created_at":"2015-12-02T19:01:53Z","updated_at":"2015-12-28T08:43:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bdfa39c22792751ca0b7d0d086e2d6cabba95557","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Homebrew/homebrew/pulls/46593/commits","review_comments_url":"https://api.github.com/repos/Homebrew/homebrew/pulls/46593/comments","review_comment_url":"https://api.github.com/repos/Homebrew/homebrew/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Homebrew/homebrew/issues/46593/comments","statuses_url":"https://api.github.com/repos/Homebrew/homebrew/statuses/49c146cf58c93b59675b5828e70bf35ecd7498ee","head":{"label":"jasontedor:kibana-4.3.0","ref":"kibana-4.3.0","sha":"49c146cf58c93b59675b5828e70bf35ecd7498ee","user":{"login":"jasontedor","id":4744941,"avatar_url":"https://avatars.githubusercontent.com/u/4744941?v=3","gravatar_id":"","url":"https://api.github.com/users/jasontedor","html_url":"https://github.com/jasontedor","followers_url":"https://api.github.com/users/jasontedor/followers","following_url":"https://api.github.com/users/jasontedor/following{/other_user}","gists_url":"https://api.github.com/users/jasontedor/gists{/gist_id}","starred_url":"https://api.github.com/users/jasontedor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasontedor/subscriptions","organizations_url":"https://api.github.com/users/jasontedor/orgs","repos_url":"https://api.github.com/users/jasontedor/repos","events_url":"https://api.github.com/users/jasontedor/events{/privacy}","received_events_url":"https://api.github.com/users/jasontedor/received_events","type":"User","site_admin":false},"repo":{"id":45482878,"name":"homebrew","full_name":"jasontedor/homebrew","owner":{"login":"jasontedor","id":4744941,"avatar_url":"https://avatars.githubusercontent.com/u/4744941?v=3","gravatar_id":"","url":"https://api.github.com/users/jasontedor","html_url":"https://github.com/jasontedor","followers_url":"https://api.github.com/users/jasontedor/followers","following_url":"https://api.github.com/users/jasontedor/following{/other_user}","gists_url":"https://api.github.com/users/jasontedor/gists{/gist_id}","starred_url":"https://api.github.com/users/jasontedor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasontedor/subscriptions","organizations_url":"https://api.github.com/users/jasontedor/orgs","repos_url":"https://api.github.com/users/jasontedor/repos","events_url":"https://api.github.com/users/jasontedor/events{/privacy}","received_events_url":"https://api.github.com/users/jasontedor/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jasontedor/homebrew","description":":beer: The missing package manager for OS X.","fork":true,"url":"https://api.github.com/repos/jasontedor/homebrew","forks_url":"https://api.github.com/repos/jasontedor/homebrew/forks","keys_url":"https://api.github.com/repos/jasontedor/homebrew/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jasontedor/homebrew/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jasontedor/homebrew/teams","hooks_url":"https://api.github.com/repos/jasontedor/homebrew/hooks","issue_events_url":"https://api.github.com/repos/jasontedor/homebrew/issues/events{/number}","events_url":"https://api.github.com/repos/jasontedor/homebrew/events","assignees_url":"https://api.github.com/repos/jasontedor/homebrew/assignees{/user}","branches_url":"https://api.github.com/repos/jasontedor/homebrew/branches{/branch}","tags_url":"https://api.github.com/repos/jasontedor/homebrew/tags","blobs_url":"https://api.github.com/repos/jasontedor/homebrew/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jasontedor/homebrew/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jasontedor/homebrew/git/refs{/sha}","trees_url":"https://api.github.com/repos/jasontedor/homebrew/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jasontedor/homebrew/statuses/{sha}","languages_url":"https://api.github.com/repos/jasontedor/homebrew/languages","stargazers_url":"https://api.github.com/repos/jasontedor/homebrew/stargazers","contributors_url":"https://api.github.com/repos/jasontedor/homebrew/contributors","subscribers_url":"https://api.github.com/repos/jasontedor/homebrew/subscribers","subscription_url":"https://api.github.com/repos/jasontedor/homebrew/subscription","commits_url":"https://api.github.com/repos/jasontedor/homebrew/commits{/sha}","git_commits_url":"https://api.github.com/repos/jasontedor/homebrew/git/commits{/sha}","comments_url":"https://api.github.com/repos/jasontedor/homebrew/comments{/number}","issue_comment_url":"https://api.github.com/repos/jasontedor/homebrew/issues/comments{/number}","contents_url":"https://api.github.com/repos/jasontedor/homebrew/contents/{+path}","compare_url":"https://api.github.com/repos/jasontedor/homebrew/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jasontedor/homebrew/merges","archive_url":"https://api.github.com/repos/jasontedor/homebrew/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jasontedor/homebrew/downloads","issues_url":"https://api.github.com/repos/jasontedor/homebrew/issues{/number}","pulls_url":"https://api.github.com/repos/jasontedor/homebrew/pulls{/number}","milestones_url":"https://api.github.com/repos/jasontedor/homebrew/milestones{/number}","notifications_url":"https://api.github.com/repos/jasontedor/homebrew/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jasontedor/homebrew/labels{/name}","releases_url":"https://api.github.com/repos/jasontedor/homebrew/releases{/id}","created_at":"2015-11-03T17:21:56Z","updated_at":"2015-11-03T17:22:27Z","pushed_at":"2015-12-28T04:15:34Z","git_url":"git://github.com/jasontedor/homebrew.git","ssh_url":"git@github.com:jasontedor/homebrew.git","clone_url":"https://github.com/jasontedor/homebrew.git","svn_url":"https://github.com/jasontedor/homebrew","homepage":"http://brew.sh","size":63990,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":false,"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":"Homebrew:master","ref":"master","sha":"e3ef0bcf02e577082694622c893f5cffac83b2ca","user":{"login":"Homebrew","id":1503512,"avatar_url":"https://avatars.githubusercontent.com/u/1503512?v=3","gravatar_id":"","url":"https://api.github.com/users/Homebrew","html_url":"https://github.com/Homebrew","followers_url":"https://api.github.com/users/Homebrew/followers","following_url":"https://api.github.com/users/Homebrew/following{/other_user}","gists_url":"https://api.github.com/users/Homebrew/gists{/gist_id}","starred_url":"https://api.github.com/users/Homebrew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Homebrew/subscriptions","organizations_url":"https://api.github.com/users/Homebrew/orgs","repos_url":"https://api.github.com/users/Homebrew/repos","events_url":"https://api.github.com/users/Homebrew/events{/privacy}","received_events_url":"https://api.github.com/users/Homebrew/received_events","type":"Organization","site_admin":false},"repo":{"id":206084,"name":"homebrew","full_name":"Homebrew/homebrew","owner":{"login":"Homebrew","id":1503512,"avatar_url":"https://avatars.githubusercontent.com/u/1503512?v=3","gravatar_id":"","url":"https://api.github.com/users/Homebrew","html_url":"https://github.com/Homebrew","followers_url":"https://api.github.com/users/Homebrew/followers","following_url":"https://api.github.com/users/Homebrew/following{/other_user}","gists_url":"https://api.github.com/users/Homebrew/gists{/gist_id}","starred_url":"https://api.github.com/users/Homebrew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Homebrew/subscriptions","organizations_url":"https://api.github.com/users/Homebrew/orgs","repos_url":"https://api.github.com/users/Homebrew/repos","events_url":"https://api.github.com/users/Homebrew/events{/privacy}","received_events_url":"https://api.github.com/users/Homebrew/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Homebrew/homebrew","description":":beer: The missing package manager for OS X.","fork":false,"url":"https://api.github.com/repos/Homebrew/homebrew","forks_url":"https://api.github.com/repos/Homebrew/homebrew/forks","keys_url":"https://api.github.com/repos/Homebrew/homebrew/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Homebrew/homebrew/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Homebrew/homebrew/teams","hooks_url":"https://api.github.com/repos/Homebrew/homebrew/hooks","issue_events_url":"https://api.github.com/repos/Homebrew/homebrew/issues/events{/number}","events_url":"https://api.github.com/repos/Homebrew/homebrew/events","assignees_url":"https://api.github.com/repos/Homebrew/homebrew/assignees{/user}","branches_url":"https://api.github.com/repos/Homebrew/homebrew/branches{/branch}","tags_url":"https://api.github.com/repos/Homebrew/homebrew/tags","blobs_url":"https://api.github.com/repos/Homebrew/homebrew/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Homebrew/homebrew/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Homebrew/homebrew/git/refs{/sha}","trees_url":"https://api.github.com/repos/Homebrew/homebrew/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Homebrew/homebrew/statuses/{sha}","languages_url":"https://api.github.com/repos/Homebrew/homebrew/languages","stargazers_url":"https://api.github.com/repos/Homebrew/homebrew/stargazers","contributors_url":"https://api.github.com/repos/Homebrew/homebrew/contributors","subscribers_url":"https://api.github.com/repos/Homebrew/homebrew/subscribers","subscription_url":"https://api.github.com/repos/Homebrew/homebrew/subscription","commits_url":"https://api.github.com/repos/Homebrew/homebrew/commits{/sha}","git_commits_url":"https://api.github.com/repos/Homebrew/homebrew/git/commits{/sha}","comments_url":"https://api.github.com/repos/Homebrew/homebrew/comments{/number}","issue_comment_url":"https://api.github.com/repos/Homebrew/homebrew/issues/comments{/number}","contents_url":"https://api.github.com/repos/Homebrew/homebrew/contents/{+path}","compare_url":"https://api.github.com/repos/Homebrew/homebrew/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Homebrew/homebrew/merges","archive_url":"https://api.github.com/repos/Homebrew/homebrew/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Homebrew/homebrew/downloads","issues_url":"https://api.github.com/repos/Homebrew/homebrew/issues{/number}","pulls_url":"https://api.github.com/repos/Homebrew/homebrew/pulls{/number}","milestones_url":"https://api.github.com/repos/Homebrew/homebrew/milestones{/number}","notifications_url":"https://api.github.com/repos/Homebrew/homebrew/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Homebrew/homebrew/labels{/name}","releases_url":"https://api.github.com/repos/Homebrew/homebrew/releases{/id}","created_at":"2009-05-20T19:38:37Z","updated_at":"2015-12-28T07:50:44Z","pushed_at":"2015-12-28T07:55:58Z","git_url":"git://github.com/Homebrew/homebrew.git","ssh_url":"git@github.com:Homebrew/homebrew.git","clone_url":"https://github.com/Homebrew/homebrew.git","svn_url":"https://github.com/Homebrew/homebrew","homepage":"http://brew.sh","size":1406036,"stargazers_count":28130,"watchers_count":28130,"language":"Ruby","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":13919,"mirror_url":null,"open_issues_count":429,"forks":13919,"open_issues":429,"watchers":28130,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/46593"},"html":{"href":"https://github.com/Homebrew/homebrew/pull/46593"},"issue":{"href":"https://api.github.com/repos/Homebrew/homebrew/issues/46593"},"comments":{"href":"https://api.github.com/repos/Homebrew/homebrew/issues/46593/comments"},"review_comments":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/46593/comments"},"review_comment":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/46593/commits"},"statuses":{"href":"https://api.github.com/repos/Homebrew/homebrew/statuses/49c146cf58c93b59675b5828e70bf35ecd7498ee"}}}}