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

Commits on Jan 19, 2015

  1. Copy the full SHA
    b77c233 View commit details
  2. Copy the full SHA
    2d033dc View commit details
Showing with 16 additions and 6 deletions.
  1. +13 −4 core/src/main/java/org/jruby/RubyIO.java
  2. +2 −2 ext/readline/pom.xml
  3. +1 −0 ext/readline/src/main/java/org/jruby/demo/readline/TextAreaReadline.java
17 changes: 13 additions & 4 deletions core/src/main/java/org/jruby/RubyIO.java
Original file line number Diff line number Diff line change
@@ -1766,14 +1766,23 @@ public RubyFixnum fsync(ThreadContext context) {
*/
@JRubyMethod(name = "sync=", required = 1)
public IRubyObject sync_set(IRubyObject sync) {
OpenFile fptr;
setSync(sync.isTrue());

RubyIO io = GetWriteIO();
fptr = io.getOpenFileChecked();
fptr.setSync(sync.isTrue());
return sync;
}

public void setSync(boolean sync) {
RubyIO io = GetWriteIO();
OpenFile fptr = io.getOpenFileChecked();
fptr.setSync(sync);
}

public boolean getSync() {
RubyIO io = GetWriteIO();
OpenFile fptr = io.getOpenFileChecked();
return fptr.isSync();
}

// rb_io_eof
@JRubyMethod(name = {"eof?", "eof"})
public RubyBoolean eof_p(ThreadContext context) {
4 changes: 2 additions & 2 deletions ext/readline/pom.xml
Original file line number Diff line number Diff line change
@@ -39,8 +39,8 @@
</dependency>
<dependency>
<groupId>org.jruby</groupId>
<artifactId>jruby</artifactId>
<version>1.7.11</version>
<artifactId>jruby-core</artifactId>
<version>9.0.0.0.pre1</version>
<scope>provided</scope>
</dependency>
</dependencies>
Original file line number Diff line number Diff line change
@@ -303,6 +303,7 @@ public void hookIntoRuntimeWithStreams(final Ruby runtime) {
runtime.getGlobalVariables().set("$stdin", in);

RubyIO out = new RubyIO(runtime, getOutputStream());
out.setSync(true);
runtime.getGlobalVariables().set("$stdout", out);
runtime.getGlobalVariables().set("$stderr", out);
}