Instantly share code, notes, and snippets.

View gist:a2e858daa0a5f62f112de57684c3d1c3
# Shebangs are supported in Java 11, but only if:
# * You pass "--source 11" to a fully-qualifed `java` command.
# * The script does *not* end with .java.
[] ~/projects/jruby $ cat Blah.java
public class Blah {
public static void main(String[] args) {
return;
}
}
View .diff
diff --git a/lib/ruby/stdlib/tracer.rb b/lib/ruby/stdlib/tracer.rb
index faafd803f4..0dc6fa8f51 100644
--- a/lib/ruby/stdlib/tracer.rb
+++ b/lib/ruby/stdlib/tracer.rb
@@ -260,7 +260,7 @@ class Tracer
# "Kernel" == klass.to_s
# end
- def Tracer.add_filter(p = proc)
+ def Tracer.add_filter(&p)
View gist:deaf944f8447645b534507451be72a82
[] ~/projects/jruby $ jruby -e "def foo; 1.times { raise }; end; class Blah; [1].each { foo }; end"
RuntimeError: No current exception
foo at -e:1
foo at -e:1
Blah at -e:1
each at org/jruby/RubyArray.java:1792
<module:Blah> at -e:1
<main> at -e:1
[] ~/projects/jruby $ jruby -Xbacktrace.style=raw -e "def foo; 1.times { raise }; end; class Blah; [1].each { foo }; end"
View blah.md

This security release updates the native Windows "jruby" executables shipped in the bin directory. We received a report that several virus scanners will flag one of these executables, jrubyw.exe, as containing a virus. We scanned the systems used for building those executables, and were unable to find any evidence of infection, but as a precaution we have rebuilt those binaries on a known clean system for this release.

We have released JRuby 9.2.4.1 to address virus warnings about one of the Windows executables we ship. No other evidence of infection, but better safe than sorry!

View .diff
diff --git a/core/src/main/java/org/jruby/RubyEncoding.java b/core/src/main/java/org/jruby/RubyEncoding.java
index f327459c89..daa8b21acd 100755
--- a/core/src/main/java/org/jruby/RubyEncoding.java
+++ b/core/src/main/java/org/jruby/RubyEncoding.java
@@ -58,6 +58,8 @@ import org.jruby.util.StringSupport;
import org.jruby.util.io.EncodingUtils;
import org.jruby.util.unsafe.UnsafeHolder;
+import static org.jruby.util.io.ChannelHelper.clearBuffer;
+
View gist:a7e1e819555f53f892947795c12f7983
This file has been truncated, but you can view the full file.
Coverage may be inaccurate; set the "--debug" command line option, or do JRUBY_OPTS="--debug" or set the "debug.fullTrace=true" option in your .jrubyrc
/home/vagrant/.rbenv/versions/jruby-9.2.1.0-dev/lib/ruby/gems/shared/bundler/gems/simplecov-994dbff2780a/lib/simplecov.rb:53: warning: tracing (e.g. set_trace_func) will not capture all events without --debug flag
==> Loading config from ENV or use default
==> Running specs with JRuby version 9.2.1.0-SNAPSHOT
/home/vagrant/.rbenv/versions/jruby-9.2.1.0-dev/lib/ruby/gems/shared/bundler/gems/rails-abda6fc3e82b/activerecord/lib/active_record/connection_handling.rb:113: warning: shadowing outer local variable - role
/home/vagrant/.rbenv/versions/jruby-9.2.1.0-dev/lib/ruby/gems/shared/bundler/gems/ruby-plsql-914c46ab36d2/lib/plsql/jdbc_connection.rb:225: warning: constant ::Fixnum is deprecated
View gist:b46011747891bdce3664ad374ed3dac0
[] ~/projects/jruby $ pickjdk 6
New JDK: jdk1.8.0_181.jdk
[] ~/projects/jruby $ time jruby -e 1
real 0m2.013s
user 0m5.435s
sys 0m0.276s
[] ~/projects/jruby $ time jruby --dev -e 1
View gist:88ef499ffbf9ed86e6f74713ac0fafac
[--dev] ~/projects/jruby $ java -classpath lib/jruby.jar org.jruby.Main -e 'puts "hello"'
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.jruby.util.SecurityHelper (file:/Users/headius/projects/jruby/lib/jruby.jar) to field java.lang.reflect.Field.modifiers
WARNING: Please consider reporting this to the maintainers of org.jruby.util.SecurityHelper
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
hello
[--dev] ~/projects/jruby $ java --module-path lib/jruby.jar org.jruby.Main -e 'puts "hello"'
hello
View gist:329f9efe0655747df7ee2c08eacc6aff
travis_fold:start:worker_info
Worker information
hostname: 36a7f7d8-2f0f-412d-9cf7-fc88fdb52e28@1.production-1-worker-org-04-packet
version: v4.1.2 https://github.com/travis-ci/worker/tree/91246b057ccd93649046771f29221f839c19a7d3
instance: a9d24cf travisci/ci-garnet:packer-1512502276-986baf0 (via amqp)
startup: 1.164570249s
travis_fold:end:worker_info
travis_fold:start:system_info
Build system information
Build language: java
View gist:0a61a59fa925b268469be210fca5794b
$ jar --file=../jcodings/target/jcodings.jar --describe-module --release 11
releases: 9
org.jruby.jcodings jar:file:///Users/headius/projects/jnr-ffi/../jcodings/target/jcodings.jar/!META-INF/versions/9/module-info.class open
exports org.jcodings
exports org.jcodings.ascii
exports org.jcodings.constants
exports org.jcodings.exception
exports org.jcodings.specific
exports org.jcodings.spi