{"action":"closed","number":1354,"pull_request":{"url":"https://api.github.com/repos/asciidoctor/asciidoctor/pulls/1354","id":36086842,"html_url":"https://github.com/asciidoctor/asciidoctor/pull/1354","diff_url":"https://github.com/asciidoctor/asciidoctor/pull/1354.diff","patch_url":"https://github.com/asciidoctor/asciidoctor/pull/1354.patch","issue_url":"https://api.github.com/repos/asciidoctor/asciidoctor/issues/1354","number":1354,"state":"closed","locked":false,"title":"Allow to read assets when running in Opal","user":{"login":"Mogztter","id":333276,"avatar_url":"https://avatars.githubusercontent.com/u/333276?v=3","gravatar_id":"","url":"https://api.github.com/users/Mogztter","html_url":"https://github.com/Mogztter","followers_url":"https://api.github.com/users/Mogztter/followers","following_url":"https://api.github.com/users/Mogztter/following{/other_user}","gists_url":"https://api.github.com/users/Mogztter/gists{/gist_id}","starred_url":"https://api.github.com/users/Mogztter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mogztter/subscriptions","organizations_url":"https://api.github.com/users/Mogztter/orgs","repos_url":"https://api.github.com/users/Mogztter/repos","events_url":"https://api.github.com/users/Mogztter/events{/privacy}","received_events_url":"https://api.github.com/users/Mogztter/received_events","type":"User","site_admin":false},"body":"See https://github.com/asciidoctor/asciidoctor-extensions-lab/pull/32#issuecomment-98092816\r\n\r\nAbsolute paths starting with `file://` were considered as relative path (in safe mode) and an exception was thrown:\r\n```\r\nSecurityError : asciidoctor: FAILED: : Failed to parse source, Jail is not an absolute path: file:///workspace/asciidoctor-extensions-lab/lib/chart-block-macro\r\n```\r\n\r\nIn unsafe mode, the method `read_asset` was using `IO.read` (with no equivalent when running in Opal). AFAIK `::IO.read` and `::File.read` are equivalent so I replaced the first one with the latter.\r\n\r\nFinally the method `readable` was undefined when running in Opal so I added the method in `opal_ext/file.rb`. I didn't know how to implement the method in a JavaScript environment so for now the method always returns `true` (until we decide how to implement `file?` and `readable?`)\r\n\r\nWith these changes I can load CSV files with the chart macro (in the Chrome extension!): `chart::sample.csv[line,800,300]`\r\n\r\n","created_at":"2015-05-23T12:19:25Z","updated_at":"2015-10-14T18:23:47Z","closed_at":"2015-10-14T18:23:47Z","merged_at":"2015-10-14T18:23:47Z","merge_commit_sha":"afd6762ea785992b5523cc09fda13e33d6b5b9d2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/asciidoctor/asciidoctor/pulls/1354/commits","review_comments_url":"https://api.github.com/repos/asciidoctor/asciidoctor/pulls/1354/comments","review_comment_url":"https://api.github.com/repos/asciidoctor/asciidoctor/pulls/comments{/number}","comments_url":"https://api.github.com/repos/asciidoctor/asciidoctor/issues/1354/comments","statuses_url":"https://api.github.com/repos/asciidoctor/asciidoctor/statuses/2e4aa2e96580cc18f035e3d863d6e31d6baa193b","head":{"label":"Mogztter:local-file","ref":"local-file","sha":"2e4aa2e96580cc18f035e3d863d6e31d6baa193b","user":{"login":"Mogztter","id":333276,"avatar_url":"https://avatars.githubusercontent.com/u/333276?v=3","gravatar_id":"","url":"https://api.github.com/users/Mogztter","html_url":"https://github.com/Mogztter","followers_url":"https://api.github.com/users/Mogztter/followers","following_url":"https://api.github.com/users/Mogztter/following{/other_user}","gists_url":"https://api.github.com/users/Mogztter/gists{/gist_id}","starred_url":"https://api.github.com/users/Mogztter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mogztter/subscriptions","organizations_url":"https://api.github.com/users/Mogztter/orgs","repos_url":"https://api.github.com/users/Mogztter/repos","events_url":"https://api.github.com/users/Mogztter/events{/privacy}","received_events_url":"https://api.github.com/users/Mogztter/received_events","type":"User","site_admin":false},"repo":{"id":9997577,"name":"asciidoctor","full_name":"Mogztter/asciidoctor","owner":{"login":"Mogztter","id":333276,"avatar_url":"https://avatars.githubusercontent.com/u/333276?v=3","gravatar_id":"","url":"https://api.github.com/users/Mogztter","html_url":"https://github.com/Mogztter","followers_url":"https://api.github.com/users/Mogztter/followers","following_url":"https://api.github.com/users/Mogztter/following{/other_user}","gists_url":"https://api.github.com/users/Mogztter/gists{/gist_id}","starred_url":"https://api.github.com/users/Mogztter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mogztter/subscriptions","organizations_url":"https://api.github.com/users/Mogztter/orgs","repos_url":"https://api.github.com/users/Mogztter/repos","events_url":"https://api.github.com/users/Mogztter/events{/privacy}","received_events_url":"https://api.github.com/users/Mogztter/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Mogztter/asciidoctor","description":"An open source Ruby processor for converting AsciiDoc source files or strings into HTML 5, DocBook 4.5 and other formats.","fork":true,"url":"https://api.github.com/repos/Mogztter/asciidoctor","forks_url":"https://api.github.com/repos/Mogztter/asciidoctor/forks","keys_url":"https://api.github.com/repos/Mogztter/asciidoctor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Mogztter/asciidoctor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Mogztter/asciidoctor/teams","hooks_url":"https://api.github.com/repos/Mogztter/asciidoctor/hooks","issue_events_url":"https://api.github.com/repos/Mogztter/asciidoctor/issues/events{/number}","events_url":"https://api.github.com/repos/Mogztter/asciidoctor/events","assignees_url":"https://api.github.com/repos/Mogztter/asciidoctor/assignees{/user}","branches_url":"https://api.github.com/repos/Mogztter/asciidoctor/branches{/branch}","tags_url":"https://api.github.com/repos/Mogztter/asciidoctor/tags","blobs_url":"https://api.github.com/repos/Mogztter/asciidoctor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Mogztter/asciidoctor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Mogztter/asciidoctor/git/refs{/sha}","trees_url":"https://api.github.com/repos/Mogztter/asciidoctor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Mogztter/asciidoctor/statuses/{sha}","languages_url":"https://api.github.com/repos/Mogztter/asciidoctor/languages","stargazers_url":"https://api.github.com/repos/Mogztter/asciidoctor/stargazers","contributors_url":"https://api.github.com/repos/Mogztter/asciidoctor/contributors","subscribers_url":"https://api.github.com/repos/Mogztter/asciidoctor/subscribers","subscription_url":"https://api.github.com/repos/Mogztter/asciidoctor/subscription","commits_url":"https://api.github.com/repos/Mogztter/asciidoctor/commits{/sha}","git_commits_url":"https://api.github.com/repos/Mogztter/asciidoctor/git/commits{/sha}","comments_url":"https://api.github.com/repos/Mogztter/asciidoctor/comments{/number}","issue_comment_url":"https://api.github.com/repos/Mogztter/asciidoctor/issues/comments{/number}","contents_url":"https://api.github.com/repos/Mogztter/asciidoctor/contents/{+path}","compare_url":"https://api.github.com/repos/Mogztter/asciidoctor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Mogztter/asciidoctor/merges","archive_url":"https://api.github.com/repos/Mogztter/asciidoctor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Mogztter/asciidoctor/downloads","issues_url":"https://api.github.com/repos/Mogztter/asciidoctor/issues{/number}","pulls_url":"https://api.github.com/repos/Mogztter/asciidoctor/pulls{/number}","milestones_url":"https://api.github.com/repos/Mogztter/asciidoctor/milestones{/number}","notifications_url":"https://api.github.com/repos/Mogztter/asciidoctor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Mogztter/asciidoctor/labels{/name}","releases_url":"https://api.github.com/repos/Mogztter/asciidoctor/releases{/id}","created_at":"2013-05-11T09:31:51Z","updated_at":"2014-12-12T21:00:26Z","pushed_at":"2015-10-14T11:15:44Z","git_url":"git://github.com/Mogztter/asciidoctor.git","ssh_url":"git@github.com:Mogztter/asciidoctor.git","clone_url":"https://github.com/Mogztter/asciidoctor.git","svn_url":"https://github.com/Mogztter/asciidoctor","homepage":"http://asciidoctor.org","size":7482,"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":"asciidoctor:master","ref":"master","sha":"78f7073f1741331dc713f081bdd787d926b29bf6","user":{"login":"asciidoctor","id":3137042,"avatar_url":"https://avatars.githubusercontent.com/u/3137042?v=3","gravatar_id":"","url":"https://api.github.com/users/asciidoctor","html_url":"https://github.com/asciidoctor","followers_url":"https://api.github.com/users/asciidoctor/followers","following_url":"https://api.github.com/users/asciidoctor/following{/other_user}","gists_url":"https://api.github.com/users/asciidoctor/gists{/gist_id}","starred_url":"https://api.github.com/users/asciidoctor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asciidoctor/subscriptions","organizations_url":"https://api.github.com/users/asciidoctor/orgs","repos_url":"https://api.github.com/users/asciidoctor/repos","events_url":"https://api.github.com/users/asciidoctor/events{/privacy}","received_events_url":"https://api.github.com/users/asciidoctor/received_events","type":"Organization","site_admin":false},"repo":{"id":4523235,"name":"asciidoctor","full_name":"asciidoctor/asciidoctor","owner":{"login":"asciidoctor","id":3137042,"avatar_url":"https://avatars.githubusercontent.com/u/3137042?v=3","gravatar_id":"","url":"https://api.github.com/users/asciidoctor","html_url":"https://github.com/asciidoctor","followers_url":"https://api.github.com/users/asciidoctor/followers","following_url":"https://api.github.com/users/asciidoctor/following{/other_user}","gists_url":"https://api.github.com/users/asciidoctor/gists{/gist_id}","starred_url":"https://api.github.com/users/asciidoctor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asciidoctor/subscriptions","organizations_url":"https://api.github.com/users/asciidoctor/orgs","repos_url":"https://api.github.com/users/asciidoctor/repos","events_url":"https://api.github.com/users/asciidoctor/events{/privacy}","received_events_url":"https://api.github.com/users/asciidoctor/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/asciidoctor/asciidoctor","description":":gem: A fast, open source text processor and publishing toolchain, written in Ruby, for converting AsciiDoc content to HTML5, DocBook 5 (or 4.5) and other formats.","fork":false,"url":"https://api.github.com/repos/asciidoctor/asciidoctor","forks_url":"https://api.github.com/repos/asciidoctor/asciidoctor/forks","keys_url":"https://api.github.com/repos/asciidoctor/asciidoctor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/asciidoctor/asciidoctor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/asciidoctor/asciidoctor/teams","hooks_url":"https://api.github.com/repos/asciidoctor/asciidoctor/hooks","issue_events_url":"https://api.github.com/repos/asciidoctor/asciidoctor/issues/events{/number}","events_url":"https://api.github.com/repos/asciidoctor/asciidoctor/events","assignees_url":"https://api.github.com/repos/asciidoctor/asciidoctor/assignees{/user}","branches_url":"https://api.github.com/repos/asciidoctor/asciidoctor/branches{/branch}","tags_url":"https://api.github.com/repos/asciidoctor/asciidoctor/tags","blobs_url":"https://api.github.com/repos/asciidoctor/asciidoctor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/asciidoctor/asciidoctor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/asciidoctor/asciidoctor/git/refs{/sha}","trees_url":"https://api.github.com/repos/asciidoctor/asciidoctor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/asciidoctor/asciidoctor/statuses/{sha}","languages_url":"https://api.github.com/repos/asciidoctor/asciidoctor/languages","stargazers_url":"https://api.github.com/repos/asciidoctor/asciidoctor/stargazers","contributors_url":"https://api.github.com/repos/asciidoctor/asciidoctor/contributors","subscribers_url":"https://api.github.com/repos/asciidoctor/asciidoctor/subscribers","subscription_url":"https://api.github.com/repos/asciidoctor/asciidoctor/subscription","commits_url":"https://api.github.com/repos/asciidoctor/asciidoctor/commits{/sha}","git_commits_url":"https://api.github.com/repos/asciidoctor/asciidoctor/git/commits{/sha}","comments_url":"https://api.github.com/repos/asciidoctor/asciidoctor/comments{/number}","issue_comment_url":"https://api.github.com/repos/asciidoctor/asciidoctor/issues/comments{/number}","contents_url":"https://api.github.com/repos/asciidoctor/asciidoctor/contents/{+path}","compare_url":"https://api.github.com/repos/asciidoctor/asciidoctor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/asciidoctor/asciidoctor/merges","archive_url":"https://api.github.com/repos/asciidoctor/asciidoctor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/asciidoctor/asciidoctor/downloads","issues_url":"https://api.github.com/repos/asciidoctor/asciidoctor/issues{/number}","pulls_url":"https://api.github.com/repos/asciidoctor/asciidoctor/pulls{/number}","milestones_url":"https://api.github.com/repos/asciidoctor/asciidoctor/milestones{/number}","notifications_url":"https://api.github.com/repos/asciidoctor/asciidoctor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/asciidoctor/asciidoctor/labels{/name}","releases_url":"https://api.github.com/repos/asciidoctor/asciidoctor/releases{/id}","created_at":"2012-06-01T19:09:20Z","updated_at":"2015-10-14T12:12:27Z","pushed_at":"2015-10-14T18:23:47Z","git_url":"git://github.com/asciidoctor/asciidoctor.git","ssh_url":"git@github.com:asciidoctor/asciidoctor.git","clone_url":"https://github.com/asciidoctor/asciidoctor.git","svn_url":"https://github.com/asciidoctor/asciidoctor","homepage":"http://asciidoctor.org","size":12218,"stargazers_count":705,"watchers_count":705,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":164,"mirror_url":null,"open_issues_count":349,"forks":164,"open_issues":349,"watchers":705,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/asciidoctor/asciidoctor/pulls/1354"},"html":{"href":"https://github.com/asciidoctor/asciidoctor/pull/1354"},"issue":{"href":"https://api.github.com/repos/asciidoctor/asciidoctor/issues/1354"},"comments":{"href":"https://api.github.com/repos/asciidoctor/asciidoctor/issues/1354/comments"},"review_comments":{"href":"https://api.github.com/repos/asciidoctor/asciidoctor/pulls/1354/comments"},"review_comment":{"href":"https://api.github.com/repos/asciidoctor/asciidoctor/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/asciidoctor/asciidoctor/pulls/1354/commits"},"statuses":{"href":"https://api.github.com/repos/asciidoctor/asciidoctor/statuses/2e4aa2e96580cc18f035e3d863d6e31d6baa193b"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"mojavelinux","id":79351,"avatar_url":"https://avatars.githubusercontent.com/u/79351?v=3","gravatar_id":"","url":"https://api.github.com/users/mojavelinux","html_url":"https://github.com/mojavelinux","followers_url":"https://api.github.com/users/mojavelinux/followers","following_url":"https://api.github.com/users/mojavelinux/following{/other_user}","gists_url":"https://api.github.com/users/mojavelinux/gists{/gist_id}","starred_url":"https://api.github.com/users/mojavelinux/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mojavelinux/subscriptions","organizations_url":"https://api.github.com/users/mojavelinux/orgs","repos_url":"https://api.github.com/users/mojavelinux/repos","events_url":"https://api.github.com/users/mojavelinux/events{/privacy}","received_events_url":"https://api.github.com/users/mojavelinux/received_events","type":"User","site_admin":false},"comments":14,"review_comments":1,"commits":1,"additions":13,"deletions":0,"changed_files":1}}