childprocess 0.6.1 → 0.6.2

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: cb43fc3ddc0c42605984500b3f073380238a8e16
4
- data.tar.gz: 1ceed15f2e82753c305ff77a9525a62df6c88bfc
3
+ metadata.gz: 573e0b0d60408f86b192aff074302d8eb93b23c7
4
+ data.tar.gz: 82f862132d5965c1ce89a5149c50117659434115
5
5
  SHA512:
6
- metadata.gz: 87623a410a97e76bed96a8b66c1c35387f0f0e5858ce77439aeb09b61609852d1efb45189e2b455b10471ed710a9e70a343ec618dfd65c3f3fa73e2b7a639d44
7
- data.tar.gz: cf64f680c7207e4a50ab0cd449f836363eeb83bab81f9f460b058e8774d3c09c9931de7c2079ae55bc7cba5c381f1b9d44a4a43a93aff80d0bcc192d75b90bb7
6
+ metadata.gz: cf46ed57aa6bc03bbeccdd4174b467086acab0652158495ab3fdecbe986c95dd5a79826ac223d3cb6af1e5de8987fa72ed6fb1087ddc431a62d2108924601e06
7
+ data.tar.gz: c3f394a000ef43ee311d93ea4406dd9a327beb7526e94214cb00777c43875a6042e69f8cdc19ec3fef28fe4e11271f56e8a72ff626ccfb407028a0254ffac67c
@@ -1,3 +1,7 @@
1
+ os:
2
+ - linux
3
+ - osx
4
+
1
5
  rvm:
2
6
  - 1.9.3
3
7
  - jruby
@@ -1,3 +1,8 @@
1
+ ### Version 0.6.2 / 2017-02-25
2
+
3
+ * Bug fix: Fixed a potentially broken edge case that could occur on older 32-bit OSX systems.
4
+
5
+
1
6
  ### Version 0.6.1 / 2017-01-22
2
7
 
3
8
  * Bug fix: Fixed a dependency that was accidentally declared as a runtime
data/Gemfile CHANGED
@@ -8,4 +8,8 @@ if RUBY_VERSION =~ /^1\./
8
8
  gem 'tins', '< 1.7' # The 'tins' gem requires Ruby 2.x on/after this version
9
9
  gem 'json', '< 2.0' # The 'json' gem drops pre-Ruby 2.x support on/after this version
10
10
  gem 'term-ansicolor', '< 1.4' # The 'term-ansicolor' gem requires Ruby 2.x on/after this version
11
+
12
+ if RbConfig::CONFIG['host_os'].downcase =~ /mswin|msys|mingw32/
13
+ gem 'ffi', '< 1.9.15' # The 'ffi' gem, for Windows, requires Ruby 2.x on/after this version
14
+ end
11
15
  end
data/README.md CHANGED
@@ -7,6 +7,7 @@ The code originated in the [selenium-webdriver](https://rubygems.org/gems/seleni
7
7
  a standalone library.
8
8
 
9
9
  [![Build Status](https://secure.travis-ci.org/enkessler/childprocess.png)](http://travis-ci.org/enkessler/childprocess)
10
+ [![Build status](https://ci.appveyor.com/api/projects/status/fn2snbcd7kku5myk/branch/dev?svg=true)](https://ci.appveyor.com/project/enkessler/childprocess/branch/dev)
10
11
  [![Gem Version](https://badge.fury.io/rb/childprocess.png)](http://badge.fury.io/rb/childprocess)
11
12
  [![Code Climate](https://codeclimate.com/github/enkessler/childprocess.png)](https://codeclimate.com/github/enkessler/childprocess)
12
13
  [![Coverage Status](https://coveralls.io/repos/enkessler/childprocess/badge.png?branch=master)](https://coveralls.io/r/enkessler/childprocess?branch=master)
@@ -0,0 +1,43 @@
1
+ version: '1.0.{build}'
2
+
3
+ environment:
4
+ matrix:
5
+ - CHILDPROCESS_POSIX_SPAWN: true
6
+ CHILDPROCESS_UNSET: should-be-unset
7
+ RUBY_VERSION: 193-x64
8
+ - CHILDPROCESS_POSIX_SPAWN: false
9
+ CHILDPROCESS_UNSET: should-be-unset
10
+ RUBY_VERSION: 193-x64
11
+ - CHILDPROCESS_POSIX_SPAWN: true
12
+ CHILDPROCESS_UNSET: should-be-unset
13
+ RUBY_VERSION: 200-x64
14
+ - CHILDPROCESS_POSIX_SPAWN: false
15
+ CHILDPROCESS_UNSET: should-be-unset
16
+ RUBY_VERSION: 200-x64
17
+ - CHILDPROCESS_POSIX_SPAWN: true
18
+ CHILDPROCESS_UNSET: should-be-unset
19
+ RUBY_VERSION: 21-x64
20
+ - CHILDPROCESS_POSIX_SPAWN: false
21
+ CHILDPROCESS_UNSET: should-be-unset
22
+ RUBY_VERSION: 21-x64
23
+ - CHILDPROCESS_POSIX_SPAWN: true
24
+ CHILDPROCESS_UNSET: should-be-unset
25
+ RUBY_VERSION: 22-x64
26
+ - CHILDPROCESS_POSIX_SPAWN: false
27
+ CHILDPROCESS_UNSET: should-be-unset
28
+ RUBY_VERSION: 22-x64
29
+
30
+
31
+ install:
32
+ - set PATH=C:\Ruby%RUBY_VERSION%\bin;%PATH%
33
+ - bundle install
34
+
35
+ build: off
36
+
37
+ before_test:
38
+ - ruby -v
39
+ - gem -v
40
+ - bundle -v
41
+
42
+ test_script:
43
+ - bundle exec rake
@@ -116,14 +116,8 @@ module ChildProcess
116
116
  host_cpu = RbConfig::CONFIG['host_cpu'].downcase
117
117
  case host_cpu
118
118
  when /i[3456]86/
119
-
120
- # Ruby 2.4 unifies Bignum and Fixnum into Integer. Also, I've heard that Darwin no
121
- # longer has this issue, so on newer Ruby/Darwin combos this check shouldn't be
122
- # needed anyway. Leaving it here for older combinations, however.
123
-
124
- # Check for Ruby older version of Ruby
125
- if (RUBY_VERSION =~ /^[123]\./) && (os == :macosx) && (0xfee1deadbeef.is_a?(Fixnum))
126
- # Darwin always reports i686, even when running in 64bit mod
119
+ if workaround_older_macosx_misreported_cpu?
120
+ # Workaround case: older 64-bit Darwin Rubies misreported as i686
127
121
  "x86_64"
128
122
  else
129
123
  "i386"
@@ -174,6 +168,21 @@ module ChildProcess
174
168
  end
175
169
  end
176
170
 
171
+ # Workaround: detect the situation that an older Darwin Ruby is actually
172
+ # 64-bit, but is misreporting cpu as i686, which would imply 32-bit.
173
+ #
174
+ # @return [Boolean] `true` if:
175
+ # (a) on Mac OS X
176
+ # (b) actually running in 64-bit mode
177
+ def workaround_older_macosx_misreported_cpu?
178
+ os == :macosx && is_64_bit?
179
+ end
180
+
181
+ # @return [Boolean] `true` if this Ruby represents `1` in 64 bits (8 bytes).
182
+ def is_64_bit?
183
+ 1.size == 8
184
+ end
185
+
177
186
  end # class << self
178
187
  end # ChildProcess
179
188
 
@@ -1,3 +1,3 @@
1
1
  module ChildProcess
2
- VERSION = '0.6.1'
2
+ VERSION = '0.6.2'
3
3
  end
@@ -0,0 +1,86 @@
1
+ require File.expand_path('../spec_helper', __FILE__)
2
+
3
+ # Q: Should platform detection concern be extracted from ChildProcess?
4
+ describe ChildProcess do
5
+
6
+ describe ".arch" do
7
+ subject { described_class.arch }
8
+
9
+ before(:each) { described_class.instance_variable_set(:@arch, nil) }
10
+
11
+ after(:each) { described_class.instance_variable_set(:@arch, nil) }
12
+
13
+ shared_examples 'expected_arch_for_host_cpu' do |host_cpu, expected_arch|
14
+ context "when host_cpu is '#{host_cpu}'" do
15
+ before :each do
16
+ allow(RbConfig::CONFIG).
17
+ to receive(:[]).
18
+ with('host_cpu').
19
+ and_return(expected_arch)
20
+ end
21
+
22
+ it { is_expected.to eq expected_arch }
23
+ end
24
+ end
25
+
26
+ # Normal cases: not macosx - depends only on host_cpu
27
+ context "when os is *not* 'macosx'" do
28
+ before :each do
29
+ allow(described_class).to receive(:os).and_return(:not_macosx)
30
+ end
31
+
32
+ [
33
+ { host_cpu: 'i386', expected_arch: 'i386' },
34
+ { host_cpu: 'i486', expected_arch: 'i386' },
35
+ { host_cpu: 'i586', expected_arch: 'i386' },
36
+ { host_cpu: 'i686', expected_arch: 'i386' },
37
+ { host_cpu: 'amd64', expected_arch: 'x86_64' },
38
+ { host_cpu: 'x86_64', expected_arch: 'x86_64' },
39
+ { host_cpu: 'ppc', expected_arch: 'powerpc' },
40
+ { host_cpu: 'powerpc', expected_arch: 'powerpc' },
41
+ { host_cpu: 'unknown', expected_arch: 'unknown' },
42
+ ].each do |args|
43
+ include_context 'expected_arch_for_host_cpu', args.values
44
+ end
45
+ end
46
+
47
+ # Special cases: macosx - when host_cpu is i686, have to re-check
48
+ context "when os is 'macosx'" do
49
+ before :each do
50
+ allow(described_class).to receive(:os).and_return(:macosx)
51
+ end
52
+
53
+ context "when host_cpu is 'i686' " do
54
+ shared_examples 'expected_arch_on_macosx_i686' do |is_64, expected_arch|
55
+ context "when Ruby is #{is_64 ? 64 : 32}-bit" do
56
+ before :each do
57
+ allow(described_class).
58
+ to receive(:is_64_bit?).
59
+ and_return(is_64)
60
+ end
61
+
62
+ include_context 'expected_arch_for_host_cpu', 'i686', expected_arch
63
+ end
64
+ end
65
+
66
+ [
67
+ { is_64: true, expected_arch: 'x86_64' },
68
+ { is_64: false, expected_arch: 'i386' }
69
+ ].each do |args|
70
+ include_context 'expected_arch_on_macosx_i686', args.values
71
+ end
72
+ end
73
+
74
+ [
75
+ { host_cpu: 'amd64', expected_arch: 'x86_64' },
76
+ { host_cpu: 'x86_64', expected_arch: 'x86_64' },
77
+ { host_cpu: 'ppc', expected_arch: 'powerpc' },
78
+ { host_cpu: 'powerpc', expected_arch: 'powerpc' },
79
+ { host_cpu: 'unknown', expected_arch: 'unknown' },
80
+ ].each do |args|
81
+ include_context 'expected_arch_for_host_cpu', args.values
82
+ end
83
+ end
84
+ end
85
+
86
+ 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.6.1
4
+ version: 0.6.2
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-01-23 00:00:00.000000000 Z
12
+ date: 2017-02-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ffi
@@ -104,6 +104,7 @@ files:
104
104
  - LICENSE
105
105
  - README.md
106
106
  - Rakefile
107
+ - appveyor.yml
107
108
  - childprocess.gemspec
108
109
  - lib/childprocess.rb
109
110
  - lib/childprocess/abstract_io.rb
@@ -137,6 +138,7 @@ files:
137
138
  - spec/io_spec.rb
138
139
  - spec/jruby_spec.rb
139
140
  - spec/pid_behavior.rb
141
+ - spec/platform_detection_spec.rb
140
142
  - spec/spec_helper.rb
141
143
  - spec/unix_spec.rb
142
144
  - spec/windows_spec.rb
@@ -160,7 +162,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
160
162
  version: '0'
161
163
  requirements: []
162
164
  rubyforge_project: childprocess
163
- rubygems_version: 2.6.7
165
+ rubygems_version: 2.5.2
164
166
  signing_key:
165
167
  specification_version: 4
166
168
  summary: A simple and reliable solution for controlling external programs running
@@ -171,6 +173,7 @@ test_files:
171
173
  - spec/io_spec.rb
172
174
  - spec/jruby_spec.rb
173
175
  - spec/pid_behavior.rb
176
+ - spec/platform_detection_spec.rb
174
177
  - spec/spec_helper.rb
175
178
  - spec/unix_spec.rb
176
179
  - spec/windows_spec.rb