jruby-stdin-channel 0.1.0-java → 0.2.0-java
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 810f48b33e8a353e0cb2c2722a1d152cfec63c59
|
4
|
+
data.tar.gz: 6360e93394bdfe74145c628b5b5f741c3a5c7cc8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8534810ee7f2b9e348af0a123fdf8c57d3ff4552958570c87ef8d7fde4bae8ce35143b958b17aae743278b9f6eb4c20a3991f224e3f31831754e6a98b48c04fc
|
7
|
+
data.tar.gz: 761c4ef392c0e64104d0f206d17c36c453ab5908d39ac7e0e40a8cd429861f63c1bec3783515cbdcc9f383c52e8485a70f3545d7da5c787cb9592331c74e6d46
|
Binary file
|
@@ -3,6 +3,7 @@ package com.jrubystdinchannel;
|
|
3
3
|
import java.io.*;
|
4
4
|
import java.lang.reflect.Field;
|
5
5
|
import java.nio.ByteBuffer;
|
6
|
+
import java.nio.channels.ClosedChannelException;
|
6
7
|
import java.nio.channels.FileChannel;
|
7
8
|
|
8
9
|
import org.jruby.Ruby;
|
@@ -14,7 +15,6 @@ import org.jruby.RubyString;
|
|
14
15
|
import org.jruby.exceptions.RaiseException;
|
15
16
|
import org.jruby.anno.JRubyClass;
|
16
17
|
import org.jruby.anno.JRubyMethod;
|
17
|
-
import org.jruby.javasupport.JavaObject;
|
18
18
|
import org.jruby.runtime.ObjectAllocator;
|
19
19
|
import org.jruby.runtime.ThreadContext;
|
20
20
|
import org.jruby.runtime.builtin.IRubyObject;
|
@@ -95,6 +95,8 @@ public class StdinChannelLibrary implements Library {
|
|
95
95
|
|
96
96
|
try {
|
97
97
|
n = this.channel.read(data);
|
98
|
+
} catch (ClosedChannelException e) {
|
99
|
+
throw context.runtime.newRaiseException(getRuntime().getModule("StdinChannel").getClass("ClosedChannelError"), "stdin channel closed");
|
98
100
|
} catch (IOException e) {
|
99
101
|
throw context.runtime.newIOErrorFromException(e);
|
100
102
|
}
|