{"action":"created","issue":{"url":"https://api.github.com/repos/asciidoctor/asciidoctorj/issues/340","labels_url":"https://api.github.com/repos/asciidoctor/asciidoctorj/issues/340/labels{/name}","comments_url":"https://api.github.com/repos/asciidoctor/asciidoctorj/issues/340/comments","events_url":"https://api.github.com/repos/asciidoctor/asciidoctorj/issues/340/events","html_url":"https://github.com/asciidoctor/asciidoctorj/pull/340","id":89543173,"number":340,"title":"Use only one way to initialize a Ruby instance","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":"closed","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-06-19T11:39:46Z","updated_at":"2015-06-23T19:54:46Z","closed_at":"2015-06-21T07:26:32Z","pull_request":{"url":"https://api.github.com/repos/asciidoctor/asciidoctorj/pulls/340","html_url":"https://github.com/asciidoctor/asciidoctorj/pull/340","diff_url":"https://github.com/asciidoctor/asciidoctorj/pull/340.diff","patch_url":"https://github.com/asciidoctor/asciidoctorj/pull/340.patch"},"body":"This PR solves #339 \r\nInstead of getting the Ruby instance from ScriptingContainer when passing a ClassLoader it is now always created via `JavaEmbedUtils.initialize()` and the classloader is passed to `RubyInstanceConfig.setLoader()`.\r\n\r\nPersonally I'd prefer to remove the factory method with a classloader completely, but we have to keep it because the ant plugin uses it, so I had to keep this method.\r\nI think this way to initialize an Asciidoctor instance could be removed because:\r\n\r\n1. Passing a classloader is equivalent to passing load paths (see https://github.com/jruby/jruby/wiki/ClasspathAndLoadPath#classpath-and-load-path-unification )\r\n2. A new `RubyInstanceConfig` initially uses the current TCCL as classloader until it is reset (by `Asciidoctor.Factory.create(ClassLoader)` atm). So instead of passing the classloader to the factory method the ant plugin could also set the TCCL before creation of the instance and reset it afterwards again. "},"comment":{"url":"https://api.github.com/repos/asciidoctor/asciidoctorj/issues/comments/114623337","html_url":"https://github.com/asciidoctor/asciidoctorj/pull/340#issuecomment-114623337","issue_url":"https://api.github.com/repos/asciidoctor/asciidoctorj/issues/340","id":114623337,"user":{"login":"binout","id":1451016,"avatar_url":"https://avatars.githubusercontent.com/u/1451016?v=3","gravatar_id":"","url":"https://api.github.com/users/binout","html_url":"https://github.com/binout","followers_url":"https://api.github.com/users/binout/followers","following_url":"https://api.github.com/users/binout/following{/other_user}","gists_url":"https://api.github.com/users/binout/gists{/gist_id}","starred_url":"https://api.github.com/users/binout/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/binout/subscriptions","organizations_url":"https://api.github.com/users/binout/orgs","repos_url":"https://api.github.com/users/binout/repos","events_url":"https://api.github.com/users/binout/events{/privacy}","received_events_url":"https://api.github.com/users/binout/received_events","type":"User","site_admin":false},"created_at":"2015-06-23T19:54:46Z","updated_at":"2015-06-23T19:54:46Z","body":"In fact, in Ant task, the create method with classloader is needed.... But the tests doesn't show it... \r\nIf you try a 'real' build.xml, you will have the following error : \r\n/Users/benoit/Coding/asciidoctor-ant-examples/build.xml:26: org.jruby.exceptions.RaiseException: (LoadError) no such file to load -- jruby/java\r\n\r\nI will investigate for 1.6.0 to use other create methods with paths."}}