windows_backport_process_spawn 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/README ADDED
File without changes
data/Rakefile ADDED
@@ -0,0 +1,13 @@
1
+
2
+ require 'jeweler'
3
+ Jeweler::Tasks.new do |gemspec|
4
+ s = gemspec
5
+ gemspec.name = "windows_backport_process_spawn"
6
+ gemspec.summary = "Process.spawn for 1.8.6"
7
+ gemspec.email = "rogerdpack@gmail.com"
8
+ gemspec.homepage = "http://github.com/rdp"
9
+ gemspec.authors = ["Roger Pack"]
10
+ s.add_development_dependency 'sane'
11
+ s.add_development_dependency 'rspec'
12
+
13
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.0
@@ -0,0 +1,18 @@
1
+ if RUBY_VERSION < '1.9.2'
2
+ require 'win32/process'
3
+ module Process
4
+ def self.spawn command, args = {}
5
+ options = {:app_name => command}
6
+ startup_info = {}
7
+ if args[:out]
8
+ startup_info[:stdout] = File.open(args[:out], 'w') # it only accepts descriptors
9
+ end
10
+ options[:startup_info] = startup_info
11
+ a = Process.create options
12
+ a.process_id
13
+
14
+ end
15
+ end
16
+
17
+
18
+ end
@@ -0,0 +1,21 @@
1
+ require 'spec/autorun'
2
+ require 'sane'
3
+ require_rel '../lib/windows_backport_process_spawn'
4
+ require 'fileutils'
5
+
6
+ describe "process spawn" do
7
+
8
+ it "should give me a pid" do
9
+ a = Process.spawn 'cmd /c "echo 3"'
10
+ a.should be_a Fixnum
11
+ end
12
+
13
+ it "should allow for out" do
14
+ FileUtils.rm 'out' if File.exist?('out')
15
+ Process.spawn 'ls', :out => 'out'
16
+ sleep 0.05
17
+ assert File.exist?('out')
18
+ assert File.read('out').length > 0
19
+ end
20
+
21
+ end
metadata ADDED
@@ -0,0 +1,78 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: windows_backport_process_spawn
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Roger Pack
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-12-30 00:00:00 -07:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: sane
17
+ type: :development
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: "0"
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: rspec
27
+ type: :development
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: "0"
34
+ version:
35
+ description:
36
+ email: rogerdpack@gmail.com
37
+ executables: []
38
+
39
+ extensions: []
40
+
41
+ extra_rdoc_files:
42
+ - README
43
+ files:
44
+ - README
45
+ - Rakefile
46
+ - VERSION
47
+ - lib/windows_backport_process_spawn.rb
48
+ - spec/spec.windows_backport_process_spawn.rb
49
+ has_rdoc: true
50
+ homepage: http://github.com/rdp
51
+ licenses: []
52
+
53
+ post_install_message:
54
+ rdoc_options:
55
+ - --charset=UTF-8
56
+ require_paths:
57
+ - lib
58
+ required_ruby_version: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: "0"
63
+ version:
64
+ required_rubygems_version: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: "0"
69
+ version:
70
+ requirements: []
71
+
72
+ rubyforge_project:
73
+ rubygems_version: 1.3.5
74
+ signing_key:
75
+ specification_version: 3
76
+ summary: Process.spawn for 1.8.6
77
+ test_files:
78
+ - spec/spec.windows_backport_process_spawn.rb