{"action":"created","comment":{"url":"https://api.github.com/repos/google/EarlGrey/pulls/comments/120449869","pull_request_review_id":42413738,"id":120449869,"diff_hunk":"@@ -14,34 +14,22 @@\n #  limitations under the License.\n \n # Usage:\n-# bundle install             # install required gems\n # bundle exec ruby render.rb # update cheatsheet png\n \n require_relative 'setup'\n \n-cheatsheet_dir = join(__dir__, *%w[.. .. docs cheatsheet])\n-cheatsheet_html = join(cheatsheet_dir, 'cheatsheet.html')\n-cheatsheet_png = join(cheatsheet_dir, 'cheatsheet.png')\n+# chrome 59 required!\n+\n+cheatsheet_dir  = join(__dir__, *%w[.. .. docs cheatsheet])\n+cheatsheet_html = join(cheatsheet_dir, 'cheatsheet.html').gsub(' ', '\\ ')\n+cheatsheet_png  = join(cheatsheet_dir, 'cheatsheet.png').gsub(' ', '\\ ')\n+cheatsheet_pdf  = join(cheatsheet_dir, 'cheatsheet.pdf').gsub(' ', '\\ ')\n assert_exists(cheatsheet_html, \"Cheatsheet HTML doesn't exist!\")\n assert_exists(cheatsheet_png, \"Cheatsheet PNG doesn't exist!\")\n+assert_exists(cheatsheet_pdf, \"Cheatsheet PDF doesn't exist!\")\n \n-web_driver = Selenium::WebDriver.for :chrome\n-\n-begin\n-  web_driver.get 'file://' + cheatsheet_html\n-\n-  eyes = Applitools::Eyes.new\n-  eyes.api_key = ' '\n-  eyes.scale_ratio = 0.5 # must be '0.5' to trigger the size_factor = 2 logic in fullpage_screenshot\n-  eyes_driver = eyes.open(driver: web_driver, app_name: ' ', test_name: ' ')\n-  eyes_browser = eyes_driver.browser\n-\n-  screenshot = eyes_browser.fullpage_screenshot\n+chrome = \"/Applications/Google\\\\ Chrome.app/Contents/MacOS/Google\\\\ Chrome\"\n+assert_exists(chrome, \"Chrome doesn't exist!\")\n \n-  # remove right hand scrollbars by cropping.\n-  crop_width = screenshot.width - 20\n-  screenshot.crop!(0, 0, crop_width, screenshot.height)\n-  screenshot.save(cheatsheet_png, :best_compression)\n-ensure\n-  web_driver.quit\n-end\n+# run_command \"#{chrome} --headless --disable-gpu --print-to-pdf=#{cheatsheet_pdf} file://#{cheatsheet_html}\"\n+run_command \"#{chrome} --headless --hide-scrollbars --disable-gpu --screenshot=#{cheatsheet_png} --window-size=1024,2550 file://#{cheatsheet_html}\"","path":"Scripts/cheatsheet/render.rb","position":44,"original_position":45,"commit_id":"f30a61e58909a6e1b0492646586a736d02c630bc","original_commit_id":"317101724f870419269009b3edf88df2c897eff8","user":{"login":"wuhao5","id":3249312,"avatar_url":"https://avatars3.githubusercontent.com/u/3249312?v=3","gravatar_id":"","url":"https://api.github.com/users/wuhao5","html_url":"https://github.com/wuhao5","followers_url":"https://api.github.com/users/wuhao5/followers","following_url":"https://api.github.com/users/wuhao5/following{/other_user}","gists_url":"https://api.github.com/users/wuhao5/gists{/gist_id}","starred_url":"https://api.github.com/users/wuhao5/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wuhao5/subscriptions","organizations_url":"https://api.github.com/users/wuhao5/orgs","repos_url":"https://api.github.com/users/wuhao5/repos","events_url":"https://api.github.com/users/wuhao5/events{/privacy}","received_events_url":"https://api.github.com/users/wuhao5/received_events","type":"User","site_admin":false},"body":"cool! I patched and tested it locally, worked for me!","created_at":"2017-06-06T18:56:34Z","updated_at":"2017-06-06T18:57:45Z","html_url":"https://github.com/google/EarlGrey/pull/529#discussion_r120449869","pull_request_url":"https://api.github.com/repos/google/EarlGrey/pulls/529","_links":{"self":{"href":"https://api.github.com/repos/google/EarlGrey/pulls/comments/120449869"},"html":{"href":"https://github.com/google/EarlGrey/pull/529#discussion_r120449869"},"pull_request":{"href":"https://api.github.com/repos/google/EarlGrey/pulls/529"}}},"pull_request":{"url":"https://api.github.com/repos/google/EarlGrey/pulls/529","id":124251915,"html_url":"https://github.com/google/EarlGrey/pull/529","diff_url":"https://github.com/google/EarlGrey/pull/529.diff","patch_url":"https://github.com/google/EarlGrey/pull/529.patch","issue_url":"https://api.github.com/repos/google/EarlGrey/issues/529","number":529,"state":"open","locked":false,"title":"Use Chrome 59 for PNG cheatsheet rendering","user":{"login":"bootstraponline","id":1173057,"avatar_url":"https://avatars3.githubusercontent.com/u/1173057?v=3","gravatar_id":"","url":"https://api.github.com/users/bootstraponline","html_url":"https://github.com/bootstraponline","followers_url":"https://api.github.com/users/bootstraponline/followers","following_url":"https://api.github.com/users/bootstraponline/following{/other_user}","gists_url":"https://api.github.com/users/bootstraponline/gists{/gist_id}","starred_url":"https://api.github.com/users/bootstraponline/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bootstraponline/subscriptions","organizations_url":"https://api.github.com/users/bootstraponline/orgs","repos_url":"https://api.github.com/users/bootstraponline/repos","events_url":"https://api.github.com/users/bootstraponline/events{/privacy}","received_events_url":"https://api.github.com/users/bootstraponline/received_events","type":"User","site_admin":false},"body":"- Zero dependencies to render a PNG now.\r\n- PDF rendering should work also however Chrome 59 doesn't capture the text. Seems like a bug.","created_at":"2017-06-06T17:59:46Z","updated_at":"2017-06-06T18:57:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"916d7921ec3862c8a4d7f78d391b4f3abd79652a","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/google/EarlGrey/pulls/529/commits","review_comments_url":"https://api.github.com/repos/google/EarlGrey/pulls/529/comments","review_comment_url":"https://api.github.com/repos/google/EarlGrey/pulls/comments{/number}","comments_url":"https://api.github.com/repos/google/EarlGrey/issues/529/comments","statuses_url":"https://api.github.com/repos/google/EarlGrey/statuses/f30a61e58909a6e1b0492646586a736d02c630bc","head":{"label":"bootstraponline:chrome_59","ref":"chrome_59","sha":"f30a61e58909a6e1b0492646586a736d02c630bc","user":{"login":"bootstraponline","id":1173057,"avatar_url":"https://avatars3.githubusercontent.com/u/1173057?v=3","gravatar_id":"","url":"https://api.github.com/users/bootstraponline","html_url":"https://github.com/bootstraponline","followers_url":"https://api.github.com/users/bootstraponline/followers","following_url":"https://api.github.com/users/bootstraponline/following{/other_user}","gists_url":"https://api.github.com/users/bootstraponline/gists{/gist_id}","starred_url":"https://api.github.com/users/bootstraponline/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bootstraponline/subscriptions","organizations_url":"https://api.github.com/users/bootstraponline/orgs","repos_url":"https://api.github.com/users/bootstraponline/repos","events_url":"https://api.github.com/users/bootstraponline/events{/privacy}","received_events_url":"https://api.github.com/users/bootstraponline/received_events","type":"User","site_admin":false},"repo":{"id":87250058,"name":"EarlGrey","full_name":"bootstraponline/EarlGrey","owner":{"login":"bootstraponline","id":1173057,"avatar_url":"https://avatars3.githubusercontent.com/u/1173057?v=3","gravatar_id":"","url":"https://api.github.com/users/bootstraponline","html_url":"https://github.com/bootstraponline","followers_url":"https://api.github.com/users/bootstraponline/followers","following_url":"https://api.github.com/users/bootstraponline/following{/other_user}","gists_url":"https://api.github.com/users/bootstraponline/gists{/gist_id}","starred_url":"https://api.github.com/users/bootstraponline/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bootstraponline/subscriptions","organizations_url":"https://api.github.com/users/bootstraponline/orgs","repos_url":"https://api.github.com/users/bootstraponline/repos","events_url":"https://api.github.com/users/bootstraponline/events{/privacy}","received_events_url":"https://api.github.com/users/bootstraponline/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bootstraponline/EarlGrey","description":":tea: iOS UI Automation Test Framework","fork":true,"url":"https://api.github.com/repos/bootstraponline/EarlGrey","forks_url":"https://api.github.com/repos/bootstraponline/EarlGrey/forks","keys_url":"https://api.github.com/repos/bootstraponline/EarlGrey/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bootstraponline/EarlGrey/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bootstraponline/EarlGrey/teams","hooks_url":"https://api.github.com/repos/bootstraponline/EarlGrey/hooks","issue_events_url":"https://api.github.com/repos/bootstraponline/EarlGrey/issues/events{/number}","events_url":"https://api.github.com/repos/bootstraponline/EarlGrey/events","assignees_url":"https://api.github.com/repos/bootstraponline/EarlGrey/assignees{/user}","branches_url":"https://api.github.com/repos/bootstraponline/EarlGrey/branches{/branch}","tags_url":"https://api.github.com/repos/bootstraponline/EarlGrey/tags","blobs_url":"https://api.github.com/repos/bootstraponline/EarlGrey/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bootstraponline/EarlGrey/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bootstraponline/EarlGrey/git/refs{/sha}","trees_url":"https://api.github.com/repos/bootstraponline/EarlGrey/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bootstraponline/EarlGrey/statuses/{sha}","languages_url":"https://api.github.com/repos/bootstraponline/EarlGrey/languages","stargazers_url":"https://api.github.com/repos/bootstraponline/EarlGrey/stargazers","contributors_url":"https://api.github.com/repos/bootstraponline/EarlGrey/contributors","subscribers_url":"https://api.github.com/repos/bootstraponline/EarlGrey/subscribers","subscription_url":"https://api.github.com/repos/bootstraponline/EarlGrey/subscription","commits_url":"https://api.github.com/repos/bootstraponline/EarlGrey/commits{/sha}","git_commits_url":"https://api.github.com/repos/bootstraponline/EarlGrey/git/commits{/sha}","comments_url":"https://api.github.com/repos/bootstraponline/EarlGrey/comments{/number}","issue_comment_url":"https://api.github.com/repos/bootstraponline/EarlGrey/issues/comments{/number}","contents_url":"https://api.github.com/repos/bootstraponline/EarlGrey/contents/{+path}","compare_url":"https://api.github.com/repos/bootstraponline/EarlGrey/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bootstraponline/EarlGrey/merges","archive_url":"https://api.github.com/repos/bootstraponline/EarlGrey/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bootstraponline/EarlGrey/downloads","issues_url":"https://api.github.com/repos/bootstraponline/EarlGrey/issues{/number}","pulls_url":"https://api.github.com/repos/bootstraponline/EarlGrey/pulls{/number}","milestones_url":"https://api.github.com/repos/bootstraponline/EarlGrey/milestones{/number}","notifications_url":"https://api.github.com/repos/bootstraponline/EarlGrey/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bootstraponline/EarlGrey/labels{/name}","releases_url":"https://api.github.com/repos/bootstraponline/EarlGrey/releases{/id}","deployments_url":"https://api.github.com/repos/bootstraponline/EarlGrey/deployments","created_at":"2017-04-05T00:59:11Z","updated_at":"2017-04-05T00:59:14Z","pushed_at":"2017-06-06T18:13:56Z","git_url":"git://github.com/bootstraponline/EarlGrey.git","ssh_url":"git@github.com:bootstraponline/EarlGrey.git","clone_url":"https://github.com/bootstraponline/EarlGrey.git","svn_url":"https://github.com/bootstraponline/EarlGrey","homepage":"http://google.github.io/EarlGrey/","size":33496,"stargazers_count":0,"watchers_count":0,"language":"Objective-C","has_issues":false,"has_projects":true,"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":"google:master","ref":"master","sha":"6aefa7e127206e39986399fe4abfa949007babb1","user":{"login":"google","id":1342004,"avatar_url":"https://avatars2.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":51094210,"name":"EarlGrey","full_name":"google/EarlGrey","owner":{"login":"google","id":1342004,"avatar_url":"https://avatars2.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/google/EarlGrey","description":":tea: iOS UI Automation Test Framework","fork":false,"url":"https://api.github.com/repos/google/EarlGrey","forks_url":"https://api.github.com/repos/google/EarlGrey/forks","keys_url":"https://api.github.com/repos/google/EarlGrey/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/EarlGrey/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/EarlGrey/teams","hooks_url":"https://api.github.com/repos/google/EarlGrey/hooks","issue_events_url":"https://api.github.com/repos/google/EarlGrey/issues/events{/number}","events_url":"https://api.github.com/repos/google/EarlGrey/events","assignees_url":"https://api.github.com/repos/google/EarlGrey/assignees{/user}","branches_url":"https://api.github.com/repos/google/EarlGrey/branches{/branch}","tags_url":"https://api.github.com/repos/google/EarlGrey/tags","blobs_url":"https://api.github.com/repos/google/EarlGrey/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/EarlGrey/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/EarlGrey/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/EarlGrey/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/EarlGrey/statuses/{sha}","languages_url":"https://api.github.com/repos/google/EarlGrey/languages","stargazers_url":"https://api.github.com/repos/google/EarlGrey/stargazers","contributors_url":"https://api.github.com/repos/google/EarlGrey/contributors","subscribers_url":"https://api.github.com/repos/google/EarlGrey/subscribers","subscription_url":"https://api.github.com/repos/google/EarlGrey/subscription","commits_url":"https://api.github.com/repos/google/EarlGrey/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/EarlGrey/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/EarlGrey/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/EarlGrey/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/EarlGrey/contents/{+path}","compare_url":"https://api.github.com/repos/google/EarlGrey/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/EarlGrey/merges","archive_url":"https://api.github.com/repos/google/EarlGrey/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/EarlGrey/downloads","issues_url":"https://api.github.com/repos/google/EarlGrey/issues{/number}","pulls_url":"https://api.github.com/repos/google/EarlGrey/pulls{/number}","milestones_url":"https://api.github.com/repos/google/EarlGrey/milestones{/number}","notifications_url":"https://api.github.com/repos/google/EarlGrey/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/EarlGrey/labels{/name}","releases_url":"https://api.github.com/repos/google/EarlGrey/releases{/id}","deployments_url":"https://api.github.com/repos/google/EarlGrey/deployments","created_at":"2016-02-04T17:55:29Z","updated_at":"2017-06-06T03:18:00Z","pushed_at":"2017-06-06T18:26:23Z","git_url":"git://github.com/google/EarlGrey.git","ssh_url":"git@github.com:google/EarlGrey.git","clone_url":"https://github.com/google/EarlGrey.git","svn_url":"https://github.com/google/EarlGrey","homepage":"http://google.github.io/EarlGrey/","size":34164,"stargazers_count":3666,"watchers_count":3666,"language":"Objective-C","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":true,"forks_count":427,"mirror_url":null,"open_issues_count":58,"forks":427,"open_issues":58,"watchers":3666,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/google/EarlGrey/pulls/529"},"html":{"href":"https://github.com/google/EarlGrey/pull/529"},"issue":{"href":"https://api.github.com/repos/google/EarlGrey/issues/529"},"comments":{"href":"https://api.github.com/repos/google/EarlGrey/issues/529/comments"},"review_comments":{"href":"https://api.github.com/repos/google/EarlGrey/pulls/529/comments"},"review_comment":{"href":"https://api.github.com/repos/google/EarlGrey/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/google/EarlGrey/pulls/529/commits"},"statuses":{"href":"https://api.github.com/repos/google/EarlGrey/statuses/f30a61e58909a6e1b0492646586a736d02c630bc"}}}}
{"actor":{"display_login":"wuhao5"}}