childprocess 0.2.7 → 0.2.8
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/childprocess/version.rb +1 -1
- data/lib/childprocess/windows/lib.rb +10 -13
- metadata +3 -3
data/lib/childprocess/version.rb
CHANGED
@@ -256,23 +256,20 @@ module ChildProcess
|
|
256
256
|
end
|
257
257
|
|
258
258
|
def handle_for(fd_or_io)
|
259
|
-
|
260
|
-
when IO
|
259
|
+
if fd_or_io.kind_of?(IO) || fd_or_io.respond_to?(:fileno)
|
261
260
|
handle = get_osfhandle(fd_or_io.fileno)
|
262
|
-
|
261
|
+
elsif fd_or_io.kind_of?(Fixnum)
|
263
262
|
handle = get_osfhandle(fd_or_io)
|
264
|
-
|
265
|
-
|
266
|
-
io = fd_or_io.to_io
|
267
|
-
|
268
|
-
unless io.kind_of?(IO)
|
269
|
-
raise TypeError, "expected #to_io to return an instance of IO"
|
270
|
-
end
|
263
|
+
elsif fd_or_io.respond_to?(:to_io)
|
264
|
+
io = fd_or_io.to_io
|
271
265
|
|
272
|
-
|
273
|
-
|
274
|
-
raise TypeError, "invalid type: #{fd_or_io.inspect}"
|
266
|
+
unless io.kind_of?(IO)
|
267
|
+
raise TypeError, "expected #to_io to return an instance of IO"
|
275
268
|
end
|
269
|
+
|
270
|
+
handle = get_osfhandle(io.fileno)
|
271
|
+
else
|
272
|
+
raise TypeError, "invalid type: #{fd_or_io.inspect}"
|
276
273
|
end
|
277
274
|
|
278
275
|
if handle == INVALID_HANDLE_VALUE
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: childprocess
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 7
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 8
|
10
|
+
version: 0.2.8
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jari Bakken
|