rubysh 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -74,7 +74,7 @@ class Rubysh::Subprocess
74
74
  begin
75
75
  ready_readers, ready_writers, _ = IO.select(potential_readers, potential_writers)
76
76
  rescue Errno::EINTR
77
- next
77
+ retry
78
78
  end
79
79
 
80
80
  ready_readers.each do |reader|
data/lib/rubysh/util.rb CHANGED
@@ -33,8 +33,19 @@ module Rubysh
33
33
  copy.close
34
34
  end
35
35
 
36
- res = original.fcntl(Fcntl::F_DUPFD, fildes2)
37
- Rubysh.assert(res == fildes2, "Tried to open #{fildes2} but ended up with #{res} instead", true)
36
+ # For some reason, Ruby 1.9 doesn't seem to let you close
37
+ # stdout/sterr. So if we didn't manage to close it above, then
38
+ # just use reopen. We could get rid of the close attempt above,
39
+ # but I'd rather leave this code as close to doing the same
40
+ # thing everywhere as possible.
41
+ begin
42
+ copy = io_without_autoclose(fildes2)
43
+ rescue Errno::EBADF
44
+ res = original.fcntl(Fcntl::F_DUPFD, fildes2)
45
+ Rubysh.assert(res == fildes2, "Tried to open #{fildes2} but ended up with #{res} instead", true)
46
+ else
47
+ copy.reopen(original)
48
+ end
38
49
  end
39
50
 
40
51
  def self.set_cloexec(file, enable=true)
@@ -1,3 +1,3 @@
1
1
  module Rubysh
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
metadata CHANGED
@@ -1,62 +1,55 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: rubysh
3
- version: !ruby/object:Gem::Version
4
- hash: 27
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.3
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 0
9
- - 2
10
- version: 0.0.2
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Greg Brockman
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2012-09-12 00:00:00 Z
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
12
+ date: 2012-10-17 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
21
15
  name: minitest
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
24
17
  none: false
25
- requirements:
26
- - - "="
27
- - !ruby/object:Gem::Version
28
- hash: 3
29
- segments:
30
- - 3
31
- - 1
32
- - 0
18
+ requirements:
19
+ - - '='
20
+ - !ruby/object:Gem::Version
33
21
  version: 3.1.0
34
22
  type: :development
35
- version_requirements: *id001
36
- - !ruby/object:Gem::Dependency
37
- name: mocha
38
23
  prerelease: false
39
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: !ruby/object:Gem::Requirement
40
25
  none: false
41
- requirements:
42
- - - ">="
43
- - !ruby/object:Gem::Version
44
- hash: 3
45
- segments:
46
- - 0
47
- version: "0"
26
+ requirements:
27
+ - - '='
28
+ - !ruby/object:Gem::Version
29
+ version: 3.1.0
30
+ - !ruby/object:Gem::Dependency
31
+ name: mocha
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
48
38
  type: :development
49
- version_requirements: *id002
50
- description: "Rubysh: Ruby subprocesses made easy"
51
- email:
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ description: ! 'Rubysh: Ruby subprocesses made easy'
47
+ email:
52
48
  - gdb@gregbrockman.com
53
49
  executables: []
54
-
55
50
  extensions: []
56
-
57
51
  extra_rdoc_files: []
58
-
59
- files:
52
+ files:
60
53
  - .gitignore
61
54
  - Gemfile
62
55
  - LICENSE
@@ -96,40 +89,34 @@ files:
96
89
  - test/unit/lib/rubysh/runner.rb
97
90
  - test/unit/lib/rubysh/subprocess.rb
98
91
  - test/unit/lib/rubysh/subprocess/parallel_io.rb
99
- homepage: ""
92
+ homepage: ''
100
93
  licenses: []
101
-
102
94
  post_install_message:
103
95
  rdoc_options: []
104
-
105
- require_paths:
96
+ require_paths:
106
97
  - lib
107
- required_ruby_version: !ruby/object:Gem::Requirement
98
+ required_ruby_version: !ruby/object:Gem::Requirement
108
99
  none: false
109
- requirements:
110
- - - ">="
111
- - !ruby/object:Gem::Version
112
- hash: 3
113
- segments:
114
- - 0
115
- version: "0"
116
- required_rubygems_version: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ! '>='
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ required_rubygems_version: !ruby/object:Gem::Requirement
117
105
  none: false
118
- requirements:
119
- - - ">="
120
- - !ruby/object:Gem::Version
121
- hash: 3
122
- segments:
123
- - 0
124
- version: "0"
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
125
110
  requirements: []
126
-
127
111
  rubyforge_project:
128
112
  rubygems_version: 1.8.24
129
113
  signing_key:
130
114
  specification_version: 3
131
- summary: "Rubysh makes shelling out easy with a __sh__-like syntax layer for Ruby: irb -r rubysh >> command = Rubysh('echo', 'hello-from-Rubysh') | Rubysh('grep', '--color', 'Rubysh') >> command.run hello-from-Rubysh => Rubysh::Runner: echo hello-from-Rubysh | grep --color Rubysh (exitstatus: 0)"
132
- test_files:
115
+ summary: ! 'Rubysh makes shelling out easy with a __sh__-like syntax layer for Ruby: irb
116
+ -r rubysh >> command = Rubysh(''echo'', ''hello-from-Rubysh'') | Rubysh(''grep'',
117
+ ''--color'', ''Rubysh'') >> command.run hello-from-Rubysh => Rubysh::Runner: echo
118
+ hello-from-Rubysh | grep --color Rubysh (exitstatus: 0)'
119
+ test_files:
133
120
  - test/_lib.rb
134
121
  - test/functional/_lib.rb
135
122
  - test/functional/lib/fd-lister