childprocess 0.1.8 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -15,8 +15,7 @@ Gem::Specification.new do |s|
15
15
  s.rubyforge_project = "childprocess"
16
16
 
17
17
  s.files = `git ls-files`.split("\n")
18
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
19
- s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
18
+ s.test_files = `git ls-files -- spec/*`.split("\n")
20
19
  s.require_paths = ["lib"]
21
20
 
22
21
  s.add_development_dependency "rspec", [">= 2.0.0"]
@@ -52,7 +52,7 @@ module ChildProcess
52
52
 
53
53
  def launch_process(&blk)
54
54
  pb = java.lang.ProcessBuilder.new(@args)
55
-
55
+ pb.directory(java.io.File.new(Dir.pwd))
56
56
  env = pb.environment
57
57
  ENV.each { |k,v| env.put(k, v) }
58
58
 
@@ -1,3 +1,3 @@
1
1
  module ChildProcess
2
- VERSION = "0.1.8"
2
+ VERSION = "0.1.9"
3
3
  end
@@ -136,4 +136,33 @@ describe ChildProcess do
136
136
  lambda { TCPServer.new("localhost", 4433).close }.should_not raise_error
137
137
  end
138
138
 
139
+ it "preserves Dir.pwd in the child" do
140
+ require 'pathname'
141
+ begin
142
+ path = nil
143
+ Tempfile.open("dir-spec") {|tf| path = tf.path }
144
+ path = Pathname.new(path).realpath.to_s
145
+ File.unlink(path)
146
+ Dir.mkdir(path)
147
+ Dir.chdir(path) do
148
+ process = ruby("puts Dir.pwd")
149
+ begin
150
+ out = Tempfile.new("dir-spec-out")
151
+
152
+ process.io.stdout = out
153
+ process.io.stderr = out
154
+
155
+ process.start
156
+ process.poll_for_exit(EXIT_TIMEOUT)
157
+
158
+ out.rewind
159
+ out.read.should == "#{path}\n"
160
+ ensure
161
+ out.close
162
+ end
163
+ end
164
+ ensure
165
+ Dir.rmdir(path) if File.exist?(path)
166
+ end
167
+ end
139
168
  end
metadata CHANGED
@@ -1,8 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: childprocess
3
3
  version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 0.1.8
4
+ hash: 9
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 1
9
+ - 9
10
+ version: 0.1.9
6
11
  platform: ruby
7
12
  authors:
8
13
  - Jari Bakken
@@ -10,7 +15,7 @@ autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
17
 
13
- date: 2011-03-21 00:00:00 +01:00
18
+ date: 2011-05-13 00:00:00 +02:00
14
19
  default_executable:
15
20
  dependencies:
16
21
  - !ruby/object:Gem::Dependency
@@ -21,6 +26,11 @@ dependencies:
21
26
  requirements:
22
27
  - - ">="
23
28
  - !ruby/object:Gem::Version
29
+ hash: 15
30
+ segments:
31
+ - 2
32
+ - 0
33
+ - 0
24
34
  version: 2.0.0
25
35
  type: :development
26
36
  version_requirements: *id001
@@ -32,6 +42,9 @@ dependencies:
32
42
  requirements:
33
43
  - - ">="
34
44
  - !ruby/object:Gem::Version
45
+ hash: 3
46
+ segments:
47
+ - 0
35
48
  version: "0"
36
49
  type: :development
37
50
  version_requirements: *id002
@@ -43,6 +56,11 @@ dependencies:
43
56
  requirements:
44
57
  - - ~>
45
58
  - !ruby/object:Gem::Version
59
+ hash: 27
60
+ segments:
61
+ - 1
62
+ - 0
63
+ - 6
46
64
  version: 1.0.6
47
65
  type: :runtime
48
66
  version_requirements: *id003
@@ -107,17 +125,23 @@ required_ruby_version: !ruby/object:Gem::Requirement
107
125
  requirements:
108
126
  - - ">="
109
127
  - !ruby/object:Gem::Version
128
+ hash: 3
129
+ segments:
130
+ - 0
110
131
  version: "0"
111
132
  required_rubygems_version: !ruby/object:Gem::Requirement
112
133
  none: false
113
134
  requirements:
114
135
  - - ">="
115
136
  - !ruby/object:Gem::Version
137
+ hash: 3
138
+ segments:
139
+ - 0
116
140
  version: "0"
117
141
  requirements: []
118
142
 
119
143
  rubyforge_project: childprocess
120
- rubygems_version: 1.5.2
144
+ rubygems_version: 1.3.7
121
145
  signing_key:
122
146
  specification_version: 3
123
147
  summary: This gem aims at being a simple and reliable solution for controlling external programs running in the background on any Ruby / OS combination.