Details
-
Type:
Improvement
-
Status:
Resolved
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.6.2
-
Fix Version/s: JRuby 1.7.0.pre1
-
Component/s: Java Integration
-
Labels:None
-
Number of attachments :
Description
It would be useful if the object referenced by $CLASSPATH would accept arrays (or array-iod objects) via the "<<" operator. A typical use case would be:
$CLASSPATH << Dir.glob('some/directory/*.jar')
Something like this might work:
@JRubyMethod(name =
{"append", "<<"}, required = 1)
{ append(IRubyObject(elt)); }public IRubyObject append(IRubyObject obj) {
if (obj instanceof RubyArray) {
for (Object elt : (RubyArray)obj)
return this;
}
String ss = obj.convertToString().toString();
try {