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: a28a8e1211996e36c03df35752494e098a5e0cce
4
- data.tar.gz: 338f1d8ad70d88df8a8f94579acf8943799a7592
3
+ metadata.gz: 810f48b33e8a353e0cb2c2722a1d152cfec63c59
4
+ data.tar.gz: 6360e93394bdfe74145c628b5b5f741c3a5c7cc8
5
5
  SHA512:
6
- metadata.gz: 7e4f0a8b6ba5c8ff73990732b70d97313b9529377470e3d6a3549065c3cd5cd99cd0e10bae80bd6336063cb6c047d6c1656f37613b55a1463f2c04a08c8e1990
7
- data.tar.gz: 3893950157ba0128fbd23797de78df31854ed851cd7d0f3c935999bbe173161a136d6c961f25e3e0c8da04836084e62cee6aa6319da894e15e28df092ec65dc1
6
+ metadata.gz: 8534810ee7f2b9e348af0a123fdf8c57d3ff4552958570c87ef8d7fde4bae8ce35143b958b17aae743278b9f6eb4c20a3991f224e3f31831754e6a98b48c04fc
7
+ data.tar.gz: 761c4ef392c0e64104d0f206d17c36c453ab5908d39ac7e0e40a8cd429861f63c1bec3783515cbdcc9f383c52e8485a70f3545d7da5c787cb9592331c74e6d46
@@ -13,5 +13,10 @@ else
13
13
  require "jruby_stdin_channel/jruby_stdin_channel.jar"
14
14
  end
15
15
 
16
+ module StdinChannel
17
+ class ClosedChannelError < StandardError
18
+ end
19
+ end
20
+
16
21
  require "stdin_channel"
17
22
  require "jruby_stdin_channel/version"
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module StdinChannel
4
- VERSION = "0.1.0"
4
+ VERSION = "0.2.0"
5
5
  end
@@ -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
  }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jruby-stdin-channel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: java
6
6
  authors:
7
7
  - Colin Surprenant