{"action":"created","comment":{"url":"https://api.github.com/repos/ev3dev/ev3dev.github.io/pulls/comments/48704978","id":48704978,"diff_hunk":"@@ -0,0 +1,59 @@\n+#!/usr/bin/env ruby\n+#\n+# publish.rb\n+#\n+# This script publishes the ev3dev website to the gh-pages branch of your\n+# personal fork. This allows you to share a preview of your changes with others.\n+#\n+# Usage: ./publish.rb <gh-user-name>\n+\n+require 'tmpdir'\n+\n+if ARGV.count != 1\n+    STDERR.puts \"Usage: ./publish.rb <gh-user-name>\"\n+    exit(1)\n+end\n+\n+Dir.mktmpdir do |tmp|\n+    FileUtils.cp_r \"_site/.\", tmp\n+    Dir.chdir tmp\n+    system \"git init\"\n+    git_url = \"git@github.com:#{ARGV[0]}/ev3dev.github.io.git\"\n+    system \"git remote add origin #{git_url}\"\n+\n+    # make sure the remote is reachable before continuing\n+    if not system \"git ls-remote #{git_url} HEAD\"\n+        STDERR.puts \"Repository: #{git_url}\"\n+        exit(1)\n+    end\n+\n+    # Fix up the files for publishing on gh-pages\n+\n+    # having cname sends you annoying email\n+    FileUtils.rm 'CNAME'\n+\n+    # prepend ev3dev.github.io to all root-relative urls\n+    system \"git add .\"\n+    file_names = `git ls-files | grep '.html$'`\n+    file_names.each_line do |file_name|\n+        file_name = file_name.strip\n+        text = File.read(file_name)\n+        # TODO: basename need to be different for travis build\n+        basename = \"/ev3dev.github.io\"\n+        new_contents = text.gsub(/(href|src)=\"\\//, \"\\\\1=\\\"#{basename}/\")\n+        File.open(file_name, \"w\") {|file| file.puts new_contents }\n+    end\n+\n+    # TODO: need to fixup javascripts/search.js\n+    # this line needs to be changed...\n+    # $.getJSON(\"/search-index.json\", function (e) {\n+\n+    # TODO: need to fixup search-index.json\n+    # line like this need to be changed...\n+    # \"href\": \"/news/2015/12/30/ev3dev-jessie-2015-12-30-release/\",\n+\n+    system \"git add .\"\n+    message = \"Site updated at #{Time.now.utc}\"\n+    system \"git commit -m #{message.inspect}\"\n+    system \"git push origin master:refs/heads/gh-pages --force\"","path":"publish.rb","position":58,"original_position":58,"commit_id":"1f2d1ed94f602c002d4c58fb3e38ace2002b1d1b","original_commit_id":"1f2d1ed94f602c002d4c58fb3e38ace2002b1d1b","user":{"login":"dlech","id":963645,"avatar_url":"https://avatars.githubusercontent.com/u/963645?v=3","gravatar_id":"","url":"https://api.github.com/users/dlech","html_url":"https://github.com/dlech","followers_url":"https://api.github.com/users/dlech/followers","following_url":"https://api.github.com/users/dlech/following{/other_user}","gists_url":"https://api.github.com/users/dlech/gists{/gist_id}","starred_url":"https://api.github.com/users/dlech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dlech/subscriptions","organizations_url":"https://api.github.com/users/dlech/orgs","repos_url":"https://api.github.com/users/dlech/repos","events_url":"https://api.github.com/users/dlech/events{/privacy}","received_events_url":"https://api.github.com/users/dlech/received_events","type":"User","site_admin":false},"body":"again, this is starting with a new empty git repository in a temporary directory. Assuming `master` is 100% safe unless there is a way to locally configure git to use another name for the default branch.","created_at":"2016-01-04T05:24:04Z","updated_at":"2016-01-04T05:24:04Z","html_url":"https://github.com/ev3dev/ev3dev.github.io/pull/91#discussion_r48704978","pull_request_url":"https://api.github.com/repos/ev3dev/ev3dev.github.io/pulls/91","_links":{"self":{"href":"https://api.github.com/repos/ev3dev/ev3dev.github.io/pulls/comments/48704978"},"html":{"href":"https://github.com/ev3dev/ev3dev.github.io/pull/91#discussion_r48704978"},"pull_request":{"href":"https://api.github.com/repos/ev3dev/ev3dev.github.io/pulls/91"}}},"pull_request":{"url":"https://api.github.com/repos/ev3dev/ev3dev.github.io/pulls/91","id":54942228,"html_url":"https://github.com/ev3dev/ev3dev.github.io/pull/91","diff_url":"https://github.com/ev3dev/ev3dev.github.io/pull/91.diff","patch_url":"https://github.com/ev3dev/ev3dev.github.io/pull/91.patch","issue_url":"https://api.github.com/repos/ev3dev/ev3dev.github.io/issues/91","number":91,"state":"open","locked":false,"title":"Get rid of {{ site.github.url }}","user":{"login":"dlech","id":963645,"avatar_url":"https://avatars.githubusercontent.com/u/963645?v=3","gravatar_id":"","url":"https://api.github.com/users/dlech","html_url":"https://github.com/dlech","followers_url":"https://api.github.com/users/dlech/followers","following_url":"https://api.github.com/users/dlech/following{/other_user}","gists_url":"https://api.github.com/users/dlech/gists{/gist_id}","starred_url":"https://api.github.com/users/dlech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dlech/subscriptions","organizations_url":"https://api.github.com/users/dlech/orgs","repos_url":"https://api.github.com/users/dlech/repos","events_url":"https://api.github.com/users/dlech/events{/privacy}","received_events_url":"https://api.github.com/users/dlech/received_events","type":"User","site_admin":false},"body":"* Also get rid of absolute links to http://www.ev3dev.org\r\n* Introduce publish.rb script to publish to personal gh-pages branch\r\n  (this was the whole reason for using site.github.url in the first place)\r\n\r\nFixes #90","created_at":"2016-01-04T04:14:56Z","updated_at":"2016-01-04T05:24:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b878ac71563e964d9f06314357b621200d7c79a9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ev3dev/ev3dev.github.io/pulls/91/commits","review_comments_url":"https://api.github.com/repos/ev3dev/ev3dev.github.io/pulls/91/comments","review_comment_url":"https://api.github.com/repos/ev3dev/ev3dev.github.io/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ev3dev/ev3dev.github.io/issues/91/comments","statuses_url":"https://api.github.com/repos/ev3dev/ev3dev.github.io/statuses/1f2d1ed94f602c002d4c58fb3e38ace2002b1d1b","head":{"label":"dlech:url-cleanup","ref":"url-cleanup","sha":"1f2d1ed94f602c002d4c58fb3e38ace2002b1d1b","user":{"login":"dlech","id":963645,"avatar_url":"https://avatars.githubusercontent.com/u/963645?v=3","gravatar_id":"","url":"https://api.github.com/users/dlech","html_url":"https://github.com/dlech","followers_url":"https://api.github.com/users/dlech/followers","following_url":"https://api.github.com/users/dlech/following{/other_user}","gists_url":"https://api.github.com/users/dlech/gists{/gist_id}","starred_url":"https://api.github.com/users/dlech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dlech/subscriptions","organizations_url":"https://api.github.com/users/dlech/orgs","repos_url":"https://api.github.com/users/dlech/repos","events_url":"https://api.github.com/users/dlech/events{/privacy}","received_events_url":"https://api.github.com/users/dlech/received_events","type":"User","site_admin":false},"repo":{"id":22278315,"name":"ev3dev.github.io","full_name":"dlech/ev3dev.github.io","owner":{"login":"dlech","id":963645,"avatar_url":"https://avatars.githubusercontent.com/u/963645?v=3","gravatar_id":"","url":"https://api.github.com/users/dlech","html_url":"https://github.com/dlech","followers_url":"https://api.github.com/users/dlech/followers","following_url":"https://api.github.com/users/dlech/following{/other_user}","gists_url":"https://api.github.com/users/dlech/gists{/gist_id}","starred_url":"https://api.github.com/users/dlech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dlech/subscriptions","organizations_url":"https://api.github.com/users/dlech/orgs","repos_url":"https://api.github.com/users/dlech/repos","events_url":"https://api.github.com/users/dlech/events{/privacy}","received_events_url":"https://api.github.com/users/dlech/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dlech/ev3dev.github.io","description":"pretty web page for ev3dev","fork":true,"url":"https://api.github.com/repos/dlech/ev3dev.github.io","forks_url":"https://api.github.com/repos/dlech/ev3dev.github.io/forks","keys_url":"https://api.github.com/repos/dlech/ev3dev.github.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dlech/ev3dev.github.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dlech/ev3dev.github.io/teams","hooks_url":"https://api.github.com/repos/dlech/ev3dev.github.io/hooks","issue_events_url":"https://api.github.com/repos/dlech/ev3dev.github.io/issues/events{/number}","events_url":"https://api.github.com/repos/dlech/ev3dev.github.io/events","assignees_url":"https://api.github.com/repos/dlech/ev3dev.github.io/assignees{/user}","branches_url":"https://api.github.com/repos/dlech/ev3dev.github.io/branches{/branch}","tags_url":"https://api.github.com/repos/dlech/ev3dev.github.io/tags","blobs_url":"https://api.github.com/repos/dlech/ev3dev.github.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dlech/ev3dev.github.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dlech/ev3dev.github.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/dlech/ev3dev.github.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dlech/ev3dev.github.io/statuses/{sha}","languages_url":"https://api.github.com/repos/dlech/ev3dev.github.io/languages","stargazers_url":"https://api.github.com/repos/dlech/ev3dev.github.io/stargazers","contributors_url":"https://api.github.com/repos/dlech/ev3dev.github.io/contributors","subscribers_url":"https://api.github.com/repos/dlech/ev3dev.github.io/subscribers","subscription_url":"https://api.github.com/repos/dlech/ev3dev.github.io/subscription","commits_url":"https://api.github.com/repos/dlech/ev3dev.github.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/dlech/ev3dev.github.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/dlech/ev3dev.github.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/dlech/ev3dev.github.io/issues/comments{/number}","contents_url":"https://api.github.com/repos/dlech/ev3dev.github.io/contents/{+path}","compare_url":"https://api.github.com/repos/dlech/ev3dev.github.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dlech/ev3dev.github.io/merges","archive_url":"https://api.github.com/repos/dlech/ev3dev.github.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dlech/ev3dev.github.io/downloads","issues_url":"https://api.github.com/repos/dlech/ev3dev.github.io/issues{/number}","pulls_url":"https://api.github.com/repos/dlech/ev3dev.github.io/pulls{/number}","milestones_url":"https://api.github.com/repos/dlech/ev3dev.github.io/milestones{/number}","notifications_url":"https://api.github.com/repos/dlech/ev3dev.github.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dlech/ev3dev.github.io/labels{/name}","releases_url":"https://api.github.com/repos/dlech/ev3dev.github.io/releases{/id}","created_at":"2014-07-26T04:21:42Z","updated_at":"2014-11-26T03:43:28Z","pushed_at":"2016-01-04T05:04:53Z","git_url":"git://github.com/dlech/ev3dev.github.io.git","ssh_url":"git@github.com:dlech/ev3dev.github.io.git","clone_url":"https://github.com/dlech/ev3dev.github.io.git","svn_url":"https://github.com/dlech/ev3dev.github.io","homepage":"http://www.ev3dev.org","size":33737,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ev3dev:master","ref":"master","sha":"2653a17fd122ed660b3563ddc8be00c4fccb9345","user":{"login":"ev3dev","id":6878323,"avatar_url":"https://avatars.githubusercontent.com/u/6878323?v=3","gravatar_id":"","url":"https://api.github.com/users/ev3dev","html_url":"https://github.com/ev3dev","followers_url":"https://api.github.com/users/ev3dev/followers","following_url":"https://api.github.com/users/ev3dev/following{/other_user}","gists_url":"https://api.github.com/users/ev3dev/gists{/gist_id}","starred_url":"https://api.github.com/users/ev3dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ev3dev/subscriptions","organizations_url":"https://api.github.com/users/ev3dev/orgs","repos_url":"https://api.github.com/users/ev3dev/repos","events_url":"https://api.github.com/users/ev3dev/events{/privacy}","received_events_url":"https://api.github.com/users/ev3dev/received_events","type":"Organization","site_admin":false},"repo":{"id":21779104,"name":"ev3dev.github.io","full_name":"ev3dev/ev3dev.github.io","owner":{"login":"ev3dev","id":6878323,"avatar_url":"https://avatars.githubusercontent.com/u/6878323?v=3","gravatar_id":"","url":"https://api.github.com/users/ev3dev","html_url":"https://github.com/ev3dev","followers_url":"https://api.github.com/users/ev3dev/followers","following_url":"https://api.github.com/users/ev3dev/following{/other_user}","gists_url":"https://api.github.com/users/ev3dev/gists{/gist_id}","starred_url":"https://api.github.com/users/ev3dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ev3dev/subscriptions","organizations_url":"https://api.github.com/users/ev3dev/orgs","repos_url":"https://api.github.com/users/ev3dev/repos","events_url":"https://api.github.com/users/ev3dev/events{/privacy}","received_events_url":"https://api.github.com/users/ev3dev/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ev3dev/ev3dev.github.io","description":"pretty web page for ev3dev","fork":false,"url":"https://api.github.com/repos/ev3dev/ev3dev.github.io","forks_url":"https://api.github.com/repos/ev3dev/ev3dev.github.io/forks","keys_url":"https://api.github.com/repos/ev3dev/ev3dev.github.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ev3dev/ev3dev.github.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ev3dev/ev3dev.github.io/teams","hooks_url":"https://api.github.com/repos/ev3dev/ev3dev.github.io/hooks","issue_events_url":"https://api.github.com/repos/ev3dev/ev3dev.github.io/issues/events{/number}","events_url":"https://api.github.com/repos/ev3dev/ev3dev.github.io/events","assignees_url":"https://api.github.com/repos/ev3dev/ev3dev.github.io/assignees{/user}","branches_url":"https://api.github.com/repos/ev3dev/ev3dev.github.io/branches{/branch}","tags_url":"https://api.github.com/repos/ev3dev/ev3dev.github.io/tags","blobs_url":"https://api.github.com/repos/ev3dev/ev3dev.github.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ev3dev/ev3dev.github.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ev3dev/ev3dev.github.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/ev3dev/ev3dev.github.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ev3dev/ev3dev.github.io/statuses/{sha}","languages_url":"https://api.github.com/repos/ev3dev/ev3dev.github.io/languages","stargazers_url":"https://api.github.com/repos/ev3dev/ev3dev.github.io/stargazers","contributors_url":"https://api.github.com/repos/ev3dev/ev3dev.github.io/contributors","subscribers_url":"https://api.github.com/repos/ev3dev/ev3dev.github.io/subscribers","subscription_url":"https://api.github.com/repos/ev3dev/ev3dev.github.io/subscription","commits_url":"https://api.github.com/repos/ev3dev/ev3dev.github.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/ev3dev/ev3dev.github.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/ev3dev/ev3dev.github.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/ev3dev/ev3dev.github.io/issues/comments{/number}","contents_url":"https://api.github.com/repos/ev3dev/ev3dev.github.io/contents/{+path}","compare_url":"https://api.github.com/repos/ev3dev/ev3dev.github.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ev3dev/ev3dev.github.io/merges","archive_url":"https://api.github.com/repos/ev3dev/ev3dev.github.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ev3dev/ev3dev.github.io/downloads","issues_url":"https://api.github.com/repos/ev3dev/ev3dev.github.io/issues{/number}","pulls_url":"https://api.github.com/repos/ev3dev/ev3dev.github.io/pulls{/number}","milestones_url":"https://api.github.com/repos/ev3dev/ev3dev.github.io/milestones{/number}","notifications_url":"https://api.github.com/repos/ev3dev/ev3dev.github.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ev3dev/ev3dev.github.io/labels{/name}","releases_url":"https://api.github.com/repos/ev3dev/ev3dev.github.io/releases{/id}","created_at":"2014-07-12T23:56:09Z","updated_at":"2015-12-22T23:00:03Z","pushed_at":"2016-01-04T05:04:17Z","git_url":"git://github.com/ev3dev/ev3dev.github.io.git","ssh_url":"git@github.com:ev3dev/ev3dev.github.io.git","clone_url":"https://github.com/ev3dev/ev3dev.github.io.git","svn_url":"https://github.com/ev3dev/ev3dev.github.io","homepage":"http://www.ev3dev.org","size":36707,"stargazers_count":4,"watchers_count":4,"language":"CSS","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":37,"mirror_url":null,"open_issues_count":5,"forks":37,"open_issues":5,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ev3dev/ev3dev.github.io/pulls/91"},"html":{"href":"https://github.com/ev3dev/ev3dev.github.io/pull/91"},"issue":{"href":"https://api.github.com/repos/ev3dev/ev3dev.github.io/issues/91"},"comments":{"href":"https://api.github.com/repos/ev3dev/ev3dev.github.io/issues/91/comments"},"review_comments":{"href":"https://api.github.com/repos/ev3dev/ev3dev.github.io/pulls/91/comments"},"review_comment":{"href":"https://api.github.com/repos/ev3dev/ev3dev.github.io/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ev3dev/ev3dev.github.io/pulls/91/commits"},"statuses":{"href":"https://api.github.com/repos/ev3dev/ev3dev.github.io/statuses/1f2d1ed94f602c002d4c58fb3e38ace2002b1d1b"}}}}