Permalink
Browse files

For JRUBY-5942: Error compiling coffeescript as part of the asset pip…

…elien

* Ignore hash args for "options" to IO.popen in 1.6.4.
* Fix to actually observe options in 1.6.5.
  • Loading branch information...
1 parent ce7c4e1 commit e293abf0deb2009e5e04c12b27f683dbde493319 @headius headius committed Aug 17, 2011
Showing with 10 additions and 0 deletions.
  1. +10 −0 src/org/jruby/RubyIO.java
View
10 src/org/jruby/RubyIO.java
@@ -3614,7 +3614,17 @@ public Ruby19POpen(Ruby runtime, IRubyObject[] args) {
public static IRubyObject popen19(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block block) {
Ruby runtime = context.getRuntime();
int mode;
+ // yes, I know it's not used. See JRUBY-5942
+ RubyHash options = null;
+ // for 1.9 mode, strip off the trailing options hash, if there
+ if (args.length > 1 && args[args.length - 1] instanceof RubyHash) {
+ options = (RubyHash)args[args.length - 1];
+ IRubyObject[] newArgs = new IRubyObject[args.length - 1];
+ System.arraycopy(args, 0, newArgs, 0, args.length - 1);
+ args = newArgs;
+ }
+
Ruby19POpen r19Popen = new Ruby19POpen(runtime, args);
if ("-".equals(r19Popen.cmd.toString())) {

0 comments on commit e293abf

Please sign in to comment.