{"action":"created","issue":{"url":"https://api.github.com/repos/asciidoctor/asciidoctorj/issues/301","labels_url":"https://api.github.com/repos/asciidoctor/asciidoctorj/issues/301/labels{/name}","comments_url":"https://api.github.com/repos/asciidoctor/asciidoctorj/issues/301/comments","events_url":"https://api.github.com/repos/asciidoctor/asciidoctorj/issues/301/events","html_url":"https://github.com/asciidoctor/asciidoctorj/pull/301","id":75009913,"number":301,"title":"Remove JRuby runtime context","user":{"login":"robertpanzer","id":1163662,"avatar_url":"https://avatars.githubusercontent.com/u/1163662?v=3","gravatar_id":"","url":"https://api.github.com/users/robertpanzer","html_url":"https://github.com/robertpanzer","followers_url":"https://api.github.com/users/robertpanzer/followers","following_url":"https://api.github.com/users/robertpanzer/following{/other_user}","gists_url":"https://api.github.com/users/robertpanzer/gists{/gist_id}","starred_url":"https://api.github.com/users/robertpanzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robertpanzer/subscriptions","organizations_url":"https://api.github.com/users/robertpanzer/orgs","repos_url":"https://api.github.com/users/robertpanzer/repos","events_url":"https://api.github.com/users/robertpanzer/events{/privacy}","received_events_url":"https://api.github.com/users/robertpanzer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-05-10T21:51:01Z","updated_at":"2015-05-17T06:22:24Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/asciidoctor/asciidoctorj/pulls/301","html_url":"https://github.com/asciidoctor/asciidoctorj/pull/301","diff_url":"https://github.com/asciidoctor/asciidoctorj/pull/301.diff","patch_url":"https://github.com/asciidoctor/asciidoctorj/pull/301.patch"},"body":"The current code uses one shared Ruby instance in the extensions that can be different from the Ruby runtime where Asciidoctor Ruby runs in.\r\nThis might lead to problems.\r\n\r\nPlease review in particular the changes to the Processor class extensively.\r\nI changed the signature from the config methods from Map<Object, Object> to Map<String, Object>.\r\nIMO that makes sense because a consumer of AsciidoctorJ should not have to hassle with RubySymbols etc.\r\n\r\nWhen a Processor creates a new node, the Ruby runtime is taken from the given parent node. \r\nI think this is a valid assumption.\r\n\r\nI only have the feeling that I am now shooting myself in the foot if we want to factor out an API module.\r\nThere have to be some modifications done to the Processor class.\r\n(This only applies to the setConfig() method, adapting the createBlock() methods is quite simple via a service implementation.)"},"comment":{"url":"https://api.github.com/repos/asciidoctor/asciidoctorj/issues/comments/102755214","html_url":"https://github.com/asciidoctor/asciidoctorj/pull/301#issuecomment-102755214","issue_url":"https://api.github.com/repos/asciidoctor/asciidoctorj/issues/301","id":102755214,"user":{"login":"robertpanzer","id":1163662,"avatar_url":"https://avatars.githubusercontent.com/u/1163662?v=3","gravatar_id":"","url":"https://api.github.com/users/robertpanzer","html_url":"https://github.com/robertpanzer","followers_url":"https://api.github.com/users/robertpanzer/followers","following_url":"https://api.github.com/users/robertpanzer/following{/other_user}","gists_url":"https://api.github.com/users/robertpanzer/gists{/gist_id}","starred_url":"https://api.github.com/users/robertpanzer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robertpanzer/subscriptions","organizations_url":"https://api.github.com/users/robertpanzer/orgs","repos_url":"https://api.github.com/users/robertpanzer/repos","events_url":"https://api.github.com/users/robertpanzer/events{/privacy}","received_events_url":"https://api.github.com/users/robertpanzer/received_events","type":"User","site_admin":false},"created_at":"2015-05-17T06:22:24Z","updated_at":"2015-05-17T06:22:24Z","body":"Another way to stay with Asciidoctor.Factory for creating instances could be like this:\r\n\r\nWe add an interface `RuntimeOptions` and a method `Asciidoctor.Factory.create(RuntimeOptions options)`. \r\n\r\nThe JRuby impl would bring an implementation of this interface so you could say:\r\n\r\n```java\r\nRuby rubyRuntime = ...\r\nAsciidoctor.Factory.create(JRubyOptions.options().runtime(rubyRuntime))\r\n```\r\n\r\nAnother impl could simply bring a class `NashornOptions` and that could also be a way to choose an impl if you have multiple impls on the classpath. \r\n\r\nRWhat do you think about this?\r\n\r\nI will reactivate the class JRubyRuntimeContext with the aforementioned get(Asciidoctor) method and adapt the Readme if you're ok with that in this PR. \r\n"}}