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

Commits on Apr 22, 2015

  1. [Truffle] seek primitive.

    chrisseaton committed Apr 22, 2015
    Copy the full SHA
    d699faf View commit details
  2. Copy the full SHA
    e2451e1 View commit details
  3. Copy the full SHA
    4bc75fc View commit details
6 changes: 6 additions & 0 deletions spec/truffle/tags/core/io/binread_tags.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
fails:IO.binread reads the contents of a file
fails:IO.binread reads the contents of a file up to a certain size when specified
fails:IO.binread reads the contents of a file from an offset of a specific size when specified
fails:IO.binread returns a String in ASCII-8BIT encoding
fails:IO.binread returns a String in ASCII-8BIT encoding regardless of Encoding.default_internal
fails:IO.binread raises an Errno::EINVAL when not passed a valid offset
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fails:ERB::DefMethod.def_erb_method define method to render eRuby file as an instance method of current module
Original file line number Diff line number Diff line change
@@ -166,4 +166,23 @@ public int close(VirtualFrame frame, RubyBasicObject io) {

}

@RubiniusPrimitive(name = "io_seek")
public static abstract class IOSeekPrimitiveNode extends RubiniusPrimitiveNode {

public IOSeekPrimitiveNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

public IOSeekPrimitiveNode(IOSeekPrimitiveNode prev) {
super(prev);
}

@Specialization
public int seek(VirtualFrame frame, RubyBasicObject io, int amount, int whence) {
final int fd = (int) rubyWithSelf(frame, io, "@descriptor");
return getContext().getPosix().lseek(fd, amount, whence);
}

}

}
10 changes: 10 additions & 0 deletions truffle/src/main/ruby/core/shims.rb
Original file line number Diff line number Diff line change
@@ -32,6 +32,12 @@ def set_encoding(external, internal)
$stdout = STDOUT
$stderr = STDERR

class << STDIN
def external_encoding
super || Encoding.default_external
end
end

if STDOUT.tty?
STDOUT.sync = true
end
@@ -194,3 +200,7 @@ module Errno

end

module Math
DomainError = Errno::EDOM
end