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: f73cb6131e09
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: c1c9d1b79bfe
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Jul 4, 2016

  1. Copy the full SHA
    85e2306 View commit details
  2. Copy the full SHA
    c1c9d1b View commit details
Showing with 9 additions and 1 deletion.
  1. +1 −0 spec/truffle/tags/language/predefined_tags.txt
  2. +8 −1 truffle/src/main/java/org/jruby/truffle/language/loader/SourceLoader.java
1 change: 1 addition & 0 deletions spec/truffle/tags/language/predefined_tags.txt
Original file line number Diff line number Diff line change
@@ -6,3 +6,4 @@ slow:The predefined global constant ARGV contains Strings encoded in locale Enco
linux:Global variable $0 actually sets the program name
slow:Global variable $0 is the path given as the main script and the same as __FILE__
slow:Global variable $? is thread-local
fails:Global variable $0 is the path given as the main script and the same as __FILE__
Original file line number Diff line number Diff line change
@@ -42,10 +42,17 @@ public Source load(String canonicalPath) throws IOException {
return loadResource(canonicalPath);
} else {
final File file = new File(canonicalPath).getCanonicalFile();

if (!file.canRead()) {
throw new IOException("Can't read file " + canonicalPath);
}
return Source.newBuilder(file).name(file.getPath()).mimeType(RubyLanguage.MIME_TYPE).build();

if (canonicalPath.toLowerCase().endsWith(".su")) {
return Source.newBuilder(file).name(file.getPath()).build();
} else {
// We need to assume all other files are Ruby, so the file type detection isn't enough
return Source.newBuilder(file).name(file.getPath()).mimeType(RubyLanguage.MIME_TYPE).build();
}
}
}