childprocess 0.1.7 → 0.1.8.pre

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,21 @@
1
+ ## MAC OS
2
+ .DS_Store
3
+
4
+ ## TEXTMATE
5
+ *.tmproj
6
+ tmtags
7
+
8
+ ## EMACS
9
+ *~
10
+ \#*
11
+ .\#*
12
+
13
+ ## VIM
14
+ *.swp
15
+
16
+ ## PROJECT::GENERAL
17
+ coverage
18
+ rdoc
19
+ pkg
20
+
21
+ ## PROJECT::SPECIFIC
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in child_process.gemspec
4
+ gemspec
data/Rakefile CHANGED
@@ -2,25 +2,8 @@ require 'rubygems'
2
2
  require 'rake'
3
3
  require 'tmpdir'
4
4
 
5
- begin
6
- require 'jeweler'
7
- Jeweler::Tasks.new do |gem|
8
- gem.name = "childprocess"
9
- gem.summary = %Q{Cross-platform ruby library for managing child processes.}
10
- gem.description = %Q{This gem aims at being a simple and reliable solution for controlling external programs running in the background on any Ruby / OS combination.}
11
- gem.email = "jari.bakken@gmail.com"
12
- gem.homepage = "http://github.com/jarib/childprocess"
13
- gem.authors = ["Jari Bakken"]
14
- gem.add_development_dependency "rspec", ">= 2.0.0"
15
- gem.add_development_dependency "yard", ">= 0"
16
-
17
- gem.add_dependency "ffi", "~> 0.6.3"
18
- # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
19
- end
20
- Jeweler::GemcutterTasks.new
21
- rescue LoadError
22
- puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
23
- end
5
+ require 'bundler'
6
+ Bundler::GemHelper.install_tasks
24
7
 
25
8
  require 'rspec/core/rake_task'
26
9
  RSpec::Core::RakeTask.new(:spec) do |spec|
@@ -37,7 +20,6 @@ RSpec::Core::RakeTask.new(:rcov) do |spec|
37
20
  spec.rcov_opts = %w[--exclude spec,ruby-debug,/Library/Ruby,.gem --include lib/childprocess]
38
21
  end
39
22
 
40
- task :spec => :check_dependencies
41
23
  task :default => :spec
42
24
 
43
25
  begin
@@ -60,7 +42,7 @@ task :jar => [:clean, :build] do
60
42
  gem_to_package = Dir['pkg/*.gem'].first
61
43
  gem_name = File.basename(gem_to_package, ".gem")
62
44
  p :gem_to_package => gem_to_package, :gem_name => gem_name
63
-
45
+
64
46
  sh "gem install -i #{tmpdir} #{gem_to_package} --ignore-dependencies --no-rdoc --no-ri"
65
47
  sh "jar cf childprocess.jar -C #{tmpdir}/gems/#{gem_name}/lib ."
66
48
  sh "jar tf childprocess.jar"
@@ -1,88 +1,27 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
1
  # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "childprocess/version"
5
4
 
6
5
  Gem::Specification.new do |s|
7
- s.name = %q{childprocess}
8
- s.version = "0.1.7"
9
-
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Jari Bakken"]
12
- s.date = %q{2011-02-12}
6
+ s.name = "childprocess"
7
+ s.version = ChildProcess::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["Jari Bakken"]
10
+ s.email = ["jari.bakken@gmail.com"]
11
+ s.homepage = "http://github.com/jarib/childprocess"
12
+ s.summary = %q{This gem aims at being a simple and reliable solution for controlling external programs running in the background on any Ruby / OS combination.}
13
13
  s.description = %q{This gem aims at being a simple and reliable solution for controlling external programs running in the background on any Ruby / OS combination.}
14
- s.email = %q{jari.bakken@gmail.com}
15
- s.extra_rdoc_files = [
16
- "LICENSE",
17
- "README.rdoc"
18
- ]
19
- s.files = [
20
- ".document",
21
- ".rspec",
22
- "LICENSE",
23
- "README.rdoc",
24
- "Rakefile",
25
- "VERSION",
26
- "childprocess.gemspec",
27
- "lib/childprocess.rb",
28
- "lib/childprocess/abstract_io.rb",
29
- "lib/childprocess/abstract_process.rb",
30
- "lib/childprocess/errors.rb",
31
- "lib/childprocess/ironruby.rb",
32
- "lib/childprocess/ironruby/process.rb",
33
- "lib/childprocess/jruby.rb",
34
- "lib/childprocess/jruby/io.rb",
35
- "lib/childprocess/jruby/process.rb",
36
- "lib/childprocess/jruby/redirector.rb",
37
- "lib/childprocess/unix.rb",
38
- "lib/childprocess/unix/io.rb",
39
- "lib/childprocess/unix/process.rb",
40
- "lib/childprocess/windows.rb",
41
- "lib/childprocess/windows/api.rb",
42
- "lib/childprocess/windows/constants.rb",
43
- "lib/childprocess/windows/functions.rb",
44
- "lib/childprocess/windows/handle.rb",
45
- "lib/childprocess/windows/io.rb",
46
- "lib/childprocess/windows/process.rb",
47
- "lib/childprocess/windows/structs.rb",
48
- "spec/abstract_io_spec.rb",
49
- "spec/childprocess_spec.rb",
50
- "spec/jruby_spec.rb",
51
- "spec/pid_behavior.rb",
52
- "spec/spec_helper.rb",
53
- "spec/unix_spec.rb",
54
- "spec/windows_spec.rb"
55
- ]
56
- s.homepage = %q{http://github.com/jarib/childprocess}
57
- s.require_paths = ["lib"]
58
- s.rubygems_version = %q{1.5.0}
59
- s.summary = %q{Cross-platform ruby library for managing child processes.}
60
- s.test_files = [
61
- "spec/abstract_io_spec.rb",
62
- "spec/childprocess_spec.rb",
63
- "spec/jruby_spec.rb",
64
- "spec/pid_behavior.rb",
65
- "spec/spec_helper.rb",
66
- "spec/unix_spec.rb",
67
- "spec/windows_spec.rb"
68
- ]
69
14
 
70
- if s.respond_to? :specification_version then
71
- s.specification_version = 3
15
+ s.rubyforge_project = "childprocess"
72
16
 
73
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
74
- s.add_development_dependency(%q<rspec>, [">= 2.0.0"])
75
- s.add_development_dependency(%q<yard>, [">= 0"])
76
- s.add_runtime_dependency(%q<ffi>, ["~> 0.6.3"])
77
- else
78
- s.add_dependency(%q<rspec>, [">= 2.0.0"])
79
- s.add_dependency(%q<yard>, [">= 0"])
80
- s.add_dependency(%q<ffi>, ["~> 0.6.3"])
81
- end
82
- else
83
- s.add_dependency(%q<rspec>, [">= 2.0.0"])
84
- s.add_dependency(%q<yard>, [">= 0"])
85
- s.add_dependency(%q<ffi>, ["~> 0.6.3"])
86
- end
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) }
20
+ s.require_paths = ["lib"]
21
+
22
+ s.add_development_dependency "rspec", [">= 2.0.0"]
23
+ s.add_development_dependency "yard", [">= 0"]
24
+ s.add_runtime_dependency "ffi", ["~> 1.0.6"]
87
25
  end
88
26
 
27
+
@@ -25,6 +25,7 @@ module ChildProcess
25
25
  @args = args
26
26
  @started = false
27
27
  @exit_code = nil
28
+ @io = nil
28
29
  @detach = false
29
30
  @duplex = false
30
31
  end
@@ -0,0 +1,3 @@
1
+ module ChildProcess
2
+ VERSION = "0.1.8.pre"
3
+ end
@@ -13,10 +13,9 @@ describe ChildProcess do
13
13
 
14
14
  it "knows if the process crashed" do
15
15
  process = exit_with(1).start
16
+ process.poll_for_exit(EXIT_TIMEOUT)
16
17
 
17
- within(EXIT_TIMEOUT) {
18
- process.should be_crashed
19
- }
18
+ process.should be_crashed
20
19
  end
21
20
 
22
21
  it "knows if the process didn't crash" do
@@ -3,10 +3,10 @@ require File.expand_path('../spec_helper', __FILE__)
3
3
  shared_examples_for "a platform that provides the child's pid" do
4
4
  it "knows the child's pid" do
5
5
  Tempfile.open("pid-spec") do |file|
6
- process = write_pid(file.path)
7
- process.start
6
+ process = write_pid(file.path).start
8
7
  process.poll_for_exit(10)
9
8
  file.rewind
9
+
10
10
  process.pid.should == file.read.chomp.to_i
11
11
  end
12
12
  end
@@ -2,11 +2,13 @@ require File.expand_path('../spec_helper', __FILE__)
2
2
  require "pid_behavior"
3
3
 
4
4
  if ChildProcess.windows?
5
+ describe ChildProcess::Windows::Process do
6
+ it_behaves_like "a platform that provides the child's pid"
7
+ end
8
+
5
9
  describe ChildProcess::Windows::IO do
6
10
  let(:io) { ChildProcess::Windows::IO.new }
7
11
 
8
- it_behaves_like "a platform that provides the child's pid"
9
-
10
12
  it "raises an ArgumentError if given IO does not respond to :fileno" do
11
13
  lambda { io.stdout = nil }.should raise_error(ArgumentError, /must have :fileno or :to_io/)
12
14
  end
metadata CHANGED
@@ -1,8 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: childprocess
3
3
  version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 0.1.7
4
+ prerelease: 6
5
+ version: 0.1.8.pre
6
6
  platform: ruby
7
7
  authors:
8
8
  - Jari Bakken
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-02-12 00:00:00 +01:00
13
+ date: 2011-03-03 00:00:00 +01:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -43,25 +43,26 @@ dependencies:
43
43
  requirements:
44
44
  - - ~>
45
45
  - !ruby/object:Gem::Version
46
- version: 0.6.3
46
+ version: 1.0.6
47
47
  type: :runtime
48
48
  version_requirements: *id003
49
49
  description: This gem aims at being a simple and reliable solution for controlling external programs running in the background on any Ruby / OS combination.
50
- email: jari.bakken@gmail.com
50
+ email:
51
+ - jari.bakken@gmail.com
51
52
  executables: []
52
53
 
53
54
  extensions: []
54
55
 
55
- extra_rdoc_files:
56
- - LICENSE
57
- - README.rdoc
56
+ extra_rdoc_files: []
57
+
58
58
  files:
59
59
  - .document
60
+ - .gitignore
60
61
  - .rspec
62
+ - Gemfile
61
63
  - LICENSE
62
64
  - README.rdoc
63
65
  - Rakefile
64
- - VERSION
65
66
  - childprocess.gemspec
66
67
  - lib/childprocess.rb
67
68
  - lib/childprocess/abstract_io.rb
@@ -76,6 +77,7 @@ files:
76
77
  - lib/childprocess/unix.rb
77
78
  - lib/childprocess/unix/io.rb
78
79
  - lib/childprocess/unix/process.rb
80
+ - lib/childprocess/version.rb
79
81
  - lib/childprocess/windows.rb
80
82
  - lib/childprocess/windows/api.rb
81
83
  - lib/childprocess/windows/constants.rb
@@ -109,16 +111,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
109
111
  required_rubygems_version: !ruby/object:Gem::Requirement
110
112
  none: false
111
113
  requirements:
112
- - - ">="
114
+ - - ">"
113
115
  - !ruby/object:Gem::Version
114
- version: "0"
116
+ version: 1.3.1
115
117
  requirements: []
116
118
 
117
- rubyforge_project:
118
- rubygems_version: 1.5.0
119
+ rubyforge_project: childprocess
120
+ rubygems_version: 1.5.2
119
121
  signing_key:
120
122
  specification_version: 3
121
- summary: Cross-platform ruby library for managing child processes.
123
+ summary: This gem aims at being a simple and reliable solution for controlling external programs running in the background on any Ruby / OS combination.
122
124
  test_files:
123
125
  - spec/abstract_io_spec.rb
124
126
  - spec/childprocess_spec.rb
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.1.7