childprocess 0.7.0 → 0.8.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 489236aacb3714c55ea91562be7530b61d3bd573
4
- data.tar.gz: 5c1c4576e85e5887b35a9ce472cec901f01d7e90
3
+ metadata.gz: fc6ebd5fca28a63f0cc66f1694f31961aa8dbd59
4
+ data.tar.gz: 0a3a042ae2fa14dc9b70446553f296cedd4990f4
5
5
  SHA512:
6
- metadata.gz: af337f4fbb1e151c787810d63cbbb2d0f16d3631dea31579f2b2d11b4a04228e2b1f423272d19f7f1d33fffc580138363f9f8b4e033ea2e37852c659dc7b4013
7
- data.tar.gz: c7b80f7b7e1879da50e54a81250f03aa6358f488539cf1ee7d8fe18d6f9e70911dcead16a2bed0e149a92f7b8aac26c86e4f49dbb0afc66a2d736e2783be7300
6
+ metadata.gz: 721fae3f6625d89823fcc87fbc2188d611cb4b0f120b26a7bd4ddc2c421d4791dc608dbfe90275a312a920d3620ec377e463d01a6b118bb3f2cf938230cd4f65
7
+ data.tar.gz: 1a1f9e46433a97dc71e2937c6270f775d0c82db387daea194011eb83befde3e96912b83adbb472efbe03a381b7ac8a41e9009546c7157083f93c78738eeab6d6
data/.gitignore CHANGED
@@ -13,6 +13,9 @@ tmtags
13
13
  ## VIM
14
14
  *.swp
15
15
 
16
+ ## RubyMine
17
+ .idea/*
18
+
16
19
  ## PROJECT::GENERAL
17
20
  coverage
18
21
  rdoc
@@ -4,21 +4,33 @@ os:
4
4
 
5
5
  rvm:
6
6
  - 1.9.3
7
- - jruby
7
+ - jruby-9.1.9.0
8
8
  - rbx-3
9
9
  - 2.0.0
10
10
  - 2.1
11
11
  - 2.2
12
- - 2.3.3
12
+ - 2.3.5
13
13
  - 2.4.0
14
14
  - ruby-head
15
- sudo: false
15
+
16
+ sudo: true # Necessary to fix JRuby
17
+
16
18
  cache: bundler
19
+
20
+ before_install:
21
+ - "echo 'gem: --no-document' > ~/.gemrc"
22
+ - gem update --system
23
+ - gem install bundler # Necessary to fix 1.9.3
24
+
17
25
  env:
18
- - CHILDPROCESS_POSIX_SPAWN=true CHILDPROCESS_UNSET=should-be-unset
19
- - CHILDPROCESS_POSIX_SPAWN=false CHILDPROCESS_UNSET=should-be-unset
26
+ global:
27
+ matrix:
28
+ - CHILDPROCESS_POSIX_SPAWN=true CHILDPROCESS_UNSET=should-be-unset
29
+ - CHILDPROCESS_POSIX_SPAWN=false CHILDPROCESS_UNSET=should-be-unset
30
+
20
31
  matrix:
21
32
  allow_failures:
22
33
  - rvm: rbx-3
34
+ - rvm: jruby-9.1.9.0
23
35
  - rvm: ruby-head
24
- env: "CHILDPROCESS_POSIX_SPAWN=true"
36
+ - env: "CHILDPROCESS_POSIX_SPAWN=true"
@@ -1,3 +1,13 @@
1
+ ### Version 0.8.0 / 2017-09-23
2
+
3
+ * Added a method for determining whether or nto a process had been started.
4
+
5
+
6
+ ### Version 0.7.1 / 2017-06-26
7
+
8
+ * Fixed a noisy uninitialized variable warning
9
+
10
+
1
11
  ### Version 0.7.0 / 2017-05-07
2
12
 
3
13
  * Debugging information now uses a Logger, which can be configured.
data/README.md CHANGED
@@ -6,11 +6,11 @@ external programs running in the background on any Ruby / OS combination.
6
6
  The code originated in the [selenium-webdriver](https://rubygems.org/gems/selenium-webdriver) gem, but should prove useful as
7
7
  a standalone library.
8
8
 
9
- [![Build Status](https://secure.travis-ci.org/enkessler/childprocess.png)](http://travis-ci.org/enkessler/childprocess)
9
+ [![Build Status](https://secure.travis-ci.org/enkessler/childprocess.svg)](http://travis-ci.org/enkessler/childprocess)
10
10
  [![Build status](https://ci.appveyor.com/api/projects/status/fn2snbcd7kku5myk/branch/dev?svg=true)](https://ci.appveyor.com/project/enkessler/childprocess/branch/dev)
11
- [![Gem Version](https://badge.fury.io/rb/childprocess.png)](http://badge.fury.io/rb/childprocess)
12
- [![Code Climate](https://codeclimate.com/github/enkessler/childprocess.png)](https://codeclimate.com/github/enkessler/childprocess)
13
- [![Coverage Status](https://coveralls.io/repos/enkessler/childprocess/badge.png?branch=master)](https://coveralls.io/r/enkessler/childprocess?branch=master)
11
+ [![Gem Version](https://badge.fury.io/rb/childprocess.svg)](http://badge.fury.io/rb/childprocess)
12
+ [![Code Climate](https://codeclimate.com/github/enkessler/childprocess.svg)](https://codeclimate.com/github/enkessler/childprocess)
13
+ [![Coverage Status](https://coveralls.io/repos/enkessler/childprocess/badge.svg?branch=master)](https://coveralls.io/r/enkessler/childprocess?branch=master)
14
14
 
15
15
  # Usage
16
16
 
@@ -178,11 +178,14 @@ How the process is launched and killed depends on the platform:
178
178
 
179
179
  # Note on Patches/Pull Requests
180
180
 
181
- * Fork the project.
182
- * Make your feature addition or bug fix.
183
- * Add tests for it. This is important so I don't break it in a future version unintentionally.
184
- * Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
185
- * Send me a pull request. Bonus points for topic branches.
181
+ 1. Fork it
182
+ 2. Create your feature branch (off of the development branch)
183
+ `git checkout -b my-new-feature dev`
184
+ 3. Commit your changes
185
+ `git commit -am 'Add some feature'`
186
+ 4. Push to the branch
187
+ `git push origin my-new-feature`
188
+ 5. Create new Pull Request
186
189
 
187
190
  # Copyright
188
191
 
@@ -31,7 +31,7 @@ module ChildProcess
31
31
  alias_method :build, :new
32
32
 
33
33
  def logger
34
- return @logger if @logger
34
+ return @logger if defined?(@logger) and @logger
35
35
 
36
36
  @logger = Logger.new($stderr)
37
37
  @logger.level = $DEBUG ? Logger::DEBUG : Logger::INFO
@@ -24,7 +24,6 @@ module ChildProcess
24
24
  #
25
25
  attr_accessor :cwd
26
26
 
27
- #
28
27
  #
29
28
  # Set this to true to make the child process the leader of a new process group
30
29
  #
@@ -115,6 +114,16 @@ module ChildProcess
115
114
  raise SubclassResponsibility, "exited?"
116
115
  end
117
116
 
117
+ #
118
+ # Has the process started?
119
+ #
120
+ # @return [Boolean]
121
+ #
122
+
123
+ def started?
124
+ @started
125
+ end
126
+
118
127
  #
119
128
  # Is this process running?
120
129
  #
@@ -159,10 +168,6 @@ module ChildProcess
159
168
  raise SubclassResponsibility, "launch_process"
160
169
  end
161
170
 
162
- def started?
163
- @started
164
- end
165
-
166
171
  def detach?
167
172
  @detach
168
173
  end
@@ -1,3 +1,3 @@
1
1
  module ChildProcess
2
- VERSION = '0.7.0'
2
+ VERSION = '0.8.0'
3
3
  end
@@ -352,7 +352,6 @@ describe ChildProcess do
352
352
 
353
353
  let(:logger) { Logger.new($stdout) }
354
354
 
355
-
356
355
  it "logs to configured logger" do
357
356
  cap = capture_std { generate_log_messages }
358
357
 
@@ -364,4 +363,29 @@ describe ChildProcess do
364
363
 
365
364
  end
366
365
 
366
+ describe '#started?' do
367
+ subject { process.started? }
368
+
369
+ context 'when not started' do
370
+ let(:process) { sleeping_ruby(1) }
371
+
372
+ it { is_expected.to be false }
373
+ end
374
+
375
+ context 'when started' do
376
+ let(:process) { sleeping_ruby(1).start }
377
+
378
+ it { is_expected.to be true }
379
+ end
380
+
381
+ context 'when finished' do
382
+ before(:each) { process.wait }
383
+
384
+ let(:process) { sleeping_ruby(0).start }
385
+
386
+ it { is_expected.to be true }
387
+ end
388
+
389
+ end
390
+
367
391
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: childprocess
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jari Bakken
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-05-08 00:00:00.000000000 Z
12
+ date: 2017-09-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ffi