rubysh 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/lib/rubysh/util.rb CHANGED
@@ -10,12 +10,18 @@ module Rubysh
10
10
  end
11
11
  end
12
12
 
13
- # Leaks memory (needed to avoid Ruby 1.8's IO autoclose behavior),
14
- # and so you should only use it right before execing.
13
+ # Leaks memory in 1.8 (needed to avoid Ruby 1.8's IO autoclose
14
+ # behavior), and so you should only use it in pre-1.9 right before
15
+ # execing.
15
16
  def self.io_without_autoclose(fd_num)
16
17
  fd_num = to_fileno(fd_num)
17
18
  io = IO.new(fd_num)
18
- hold(io)
19
+
20
+ if io.respond_to?(:autoclose)
21
+ io.autoclose = false
22
+ else
23
+ hold(io)
24
+ end
19
25
  io
20
26
  end
21
27
 
@@ -1,3 +1,3 @@
1
1
  module Rubysh
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubysh
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-12-21 00:00:00.000000000 Z
12
+ date: 2013-12-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -140,7 +140,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
140
140
  version: '0'
141
141
  segments:
142
142
  - 0
143
- hash: -581086549830271190
143
+ hash: 2837385941821063747
144
144
  required_rubygems_version: !ruby/object:Gem::Requirement
145
145
  none: false
146
146
  requirements:
@@ -149,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
149
149
  version: '0'
150
150
  segments:
151
151
  - 0
152
- hash: -581086549830271190
152
+ hash: 2837385941821063747
153
153
  requirements: []
154
154
  rubyforge_project:
155
155
  rubygems_version: 1.8.23