if options.fetch :squash, true
result.shift && @lineno += 1 while (top = result[0]) && top.empty?
result.pop while (bot = result[-1]) && bot.empty?
end
block {
named :shout
on_context :paragraph
parse_content_as :simple
name_attributes 'vol'
process &-> (parent, reader, attrs) {
volume = ((attrs.delete 'vol') || 1).to_i
create_paragraph parent, (reader.lines.map {|line|
line.upcase.gsub /\.(?= |$)/, '!' * volume }), attrs
}
}
invokedynamic
jit.threshold=10
jit.logging=true
$ jruby -J-server bench.rb
JITCompiler: done jitting:Asciidoctor::Parser.store_attribute at ...lib/asciidoctor/parser.rb:2084 JITCompiler: done jitting:Asciidoctor::Parser.sanitize_attribute_name at ...lib/asciidoctor/parser.rb:2679
Shout out to JRuby, powering most of Travis CI for the better of three years now!
— Mathias Meyer (@roidrage) April 26, 2014
import org.jruby.embed.ScriptingContainer;
...
ScriptingContainer container = new ScriptingContainer();
container.runScriptlet("puts 'Hello from Ruby!'");
Hello from Ruby!
ScriptingContainer container = new ScriptingContainer();
container.put("message", "Hello from Ruby!");
container.runScriptlet("puts message");
Hello from Ruby!
ScriptingContainer container = new ScriptingContainer();
container.put("message", "Hello from Java with help from Ruby!");
IRubyObject result = container.runScriptlet("message.upcase");
System.out.println(result);
HELLO FROM JAVA WITH HELP FROM RUBY!
ScriptingContainer container = new ScriptingContainer();
Ruby runtime = container.getProvider().getRuntime();
String script = "require 'asciidoctor'\nAsciidoctor"
IRubyObject result = (IRubyObject) container.runScriptlet(script);
Asciidoctor asciidoctor = JavaEmbedUtils
.rubyToJava(runtime, result, Asciidoctor.class);
String html = asciidoctor.convert_file("sample.adoc");
gems/ specifications/ asciidoctor-1.5.0.gemspec gems/ asciidoctor-1.5.0/ lib/ asciidoctor.rb asciidoctor/
container.runScriptlet("require 'asciidoctor'")
$ \curl -sSL "https://get.rvm.io" > rvm-install.sh
bash rvm-install.sh -s latest
rvm install jruby
rvm use jruby
jruby --version
jruby 1.7.13 (1.9.3p392) 2014-06-24 43f133c
JRuby 9000 is starting to shape up. Finishing Ruby 2.1 features, wiring up the new JIT, big overhaul of encodings and IO. Preview soonish.
— Charles Nutter (@headius) July 6, 2014