Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: b69dd1b61952
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 02817a89e8c7
Choose a head ref
  • 3 commits
  • 3 files changed
  • 1 contributor

Commits on Jan 25, 2015

  1. [Truffle] Fixed File.expand_path on Windows when a path contains an a…

    …sterisk.
    
    Apparently Windows cannot canonicalize a path with an asterisk and will throw an exception.  JRuby's solution seems to handle that case just fine.
    nirvdrum committed Jan 25, 2015
    Copy the full SHA
    31e256e View commit details
  2. Copy the full SHA
    6168dfe View commit details
  3. Copy the full SHA
    02817a8 View commit details
12 changes: 9 additions & 3 deletions spec/truffle/truffle.mspec
Original file line number Diff line number Diff line change
@@ -4,6 +4,12 @@ class MSpecScript
ENV.key?('WINDIR') || ENV.key?('windir')
end

def self.path_separator
# This is going to be used in a regexp, so we need to escape the backslash character in the regexp as well,
# thus the double-escape here.
windows? ? "\\\\" : '/'
end

set :target, File.join(File.dirname(__FILE__), "spec-wrapper#{windows? ? '.bat' : ''}")

set :language, [
@@ -117,9 +123,9 @@ class MSpecScript
]

set :tags_patterns, [
[%r(^.*/language/), 'spec/truffle/tags/language/'],
[%r(^.*/core/), 'spec/truffle/tags/core/'],
[%r(^.*/rubysl/), 'spec/truffle/tags/rubysl/'],
[%r(^.*#{path_separator}language#{path_separator}), 'spec/truffle/tags/language/'],
[%r(^.*#{path_separator}core#{path_separator}), 'spec/truffle/tags/core/'],
[%r(^.*#{path_separator}rubysl#{path_separator}), 'spec/truffle/tags/rubysl/'],
[/_spec.rb$/, '_tags.txt']
]

Original file line number Diff line number Diff line change
@@ -135,14 +135,13 @@ private static RubyArray glob(final RubyContext context, String glob) {

String absoluteGlob;

if (!glob.startsWith("/")) {
if (!glob.startsWith("/") && !org.jruby.RubyFile.startsWithDriveLetterOnWindows(glob)) {
absoluteGlob = new File(".", glob).getAbsolutePath();
} else {
absoluteGlob = glob;
}

// Get the first star

final int firstStar = absoluteGlob.indexOf('*');
assert firstStar >= 0;

Original file line number Diff line number Diff line change
@@ -62,11 +62,7 @@ public static String expandPath(String fileName, String dir) {
* implementation, but it looks quite tied to their data structures.
*/

try {
return new File(dir, fileName).getCanonicalPath();
} catch (IOException e) {
throw new RuntimeException(e);
}
return org.jruby.RubyFile.canonicalize(new File(dir, fileName).getAbsolutePath());
}

public static RubyFile open(RubyContext context, String fileName, String mode) {