ichannel 3.1.0 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog.txt CHANGED
@@ -1,4 +1,10 @@
1
- == HEAD
1
+ == v4.0.0
2
+ * Modify IChannel#empty?
3
+
4
+ It now returns true in case the underlying UNIXSocket being used as a
5
+ reader is closed.
6
+
7
+ == v3.1.0
2
8
  * Add IChannel#empty?.
3
9
 
4
10
  IChannel#empty? returns true when the channel is empty(nothing to read).
@@ -1,3 +1,3 @@
1
1
  class IChannel
2
- VERSION = "3.1.0"
2
+ VERSION = "4.0.0"
3
3
  end
data/lib/ichannel.rb CHANGED
@@ -129,6 +129,10 @@ class IChannel
129
129
  # Returns true if the channel is empty (nothing to read).
130
130
  #
131
131
  def empty?
132
- ! IO.select [@reader], nil, nil, 0.1
132
+ if @reader.closed?
133
+ true
134
+ else
135
+ ! IO.select [@reader], nil, nil, 0.1
136
+ end
133
137
  end
134
138
  end
@@ -54,4 +54,10 @@ class IChannelTest < Test::Unit::TestCase
54
54
  @channel.get
55
55
  assert @channel.empty?
56
56
  end
57
+
58
+ def test_empty_on_closed_channel
59
+ @channel.put %w(a)
60
+ @channel.close
61
+ assert @channel.empty?
62
+ end
57
63
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ichannel
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0
4
+ version: 4.0.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -45,7 +45,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
45
45
  version: '0'
46
46
  segments:
47
47
  - 0
48
- hash: 752004929419956183
48
+ hash: 1818717660868684885
49
49
  required_rubygems_version: !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
@@ -54,7 +54,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
54
54
  version: '0'
55
55
  segments:
56
56
  - 0
57
- hash: 752004929419956183
57
+ hash: 1818717660868684885
58
58
  requirements: []
59
59
  rubyforge_project:
60
60
  rubygems_version: 1.8.23