Skip to content
Permalink
Browse files
Merge with jruby-1_7
  • Loading branch information
enebo committed Dec 3, 2014
2 parents 254c148 + 2c6af6d commit 84bc5231439045e28b177fecd538d454e218194e
@@ -66,10 +66,15 @@ public IRubyObject append(ThreadContext context, IRubyObject obj) {
paths = context.runtime.newArray(obj).toJavaArray();
}

boolean is1_8 = context.getRuntime().is1_8();
for (IRubyObject path: paths) {
String ss = path.convertToString().toString();
try {
URL url = getURL(ss);
URL url = getURL(path.convertToString().toString());
if (url.getProtocol().equals("file")) {
path = is1_8 ? RubyFile.expand_path(context, null, new IRubyObject[]{ path })
: RubyFile.expand_path19(context, null, new IRubyObject[]{ path });
url = getURL(path.convertToString().toString());
}
getRuntime().getJRubyClassLoader().addURL(url);
} catch (MalformedURLException mue) {
throw getRuntime().newArgumentError(mue.getLocalizedMessage());
@@ -31,6 +31,7 @@
***** END LICENSE BLOCK *****/
package org.jruby.ast;

import org.jcodings.Encoding;
import org.jruby.ast.types.ILiteralNode;
import org.jruby.ast.visitor.NodeVisitor;
import org.jruby.lexer.yacc.ISourcePosition;
@@ -44,6 +45,10 @@ public DXStrNode(ISourcePosition position, DStrNode node) {
super(position);
addAll(node);
}

public DXStrNode(ISourcePosition position, Encoding encoding) {
super(position, encoding);
}

public DXStrNode(ISourcePosition position) {
super(position);
Empty file.
@@ -4,15 +4,14 @@
describe "<<" do
it "accepts an object" do
$CLASSPATH << "file"
$CLASSPATH.to_a.include?("file:file").should == true
$CLASSPATH.to_a.include?("file:#{File.expand_path('file')}").should == true
end

it "accepts an array" do
Dir.chdir(File.join(File.dirname(__FILE__), '..', '..', '..', 'lib')) do
$CLASSPATH << Dir.glob("*.jar")
($CLASSPATH.to_a.include?("file:jruby.jar") ||
$CLASSPATH.to_a.include?("file:jruby-complete.jar") ).should == true
($CLASSPATH.to_a.include?("file:#{File.expand_path('jruby.jar')}")).should == true
end
end
end
end
end
@@ -0,0 +1,20 @@
require 'rspec'
require 'fileutils'

describe 'GH-2264: Illegal hex characters in escape pattern' do
let(:dir_name) { 'test_dir!' }
let(:file_name) { 'test_file%' }

before :each do
FileUtils.mkdir(dir_name)
FileUtils.touch("#{dir_name}/#{file_name}")
end

after :each do
FileUtils.rm_r(dir_name) if Dir.exist?(dir_name)
end

it 'can glob directories' do
Dir.glob("#{dir_name}/**/*").size.should eq 1
end
end

0 comments on commit 84bc523

Please sign in to comment.