maestro_shell 0.0.12 → 0.0.13

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: cb4621860e28d309824a420fd140272b23fd43db
4
- data.tar.gz: 344e12b8ec1cc504dbd71498bd0038314136a247
3
+ metadata.gz: add94bfda2efcc465922fdd8362802d90c2a69bd
4
+ data.tar.gz: 5307a7c23ffd113b46050ac1736c15e0e4625188
5
5
  SHA512:
6
- metadata.gz: d804df5c04030454d597934afa694abded219bae93eabd51d8cb5c7ccd133d5be0baabe7cd604f1dfec51b02c09854d5c671f6910f473014cd270eb571e5b999
7
- data.tar.gz: e2288530e8d49bb984e0b7fcb8f2547f36a09f7ebf9ccd4e14c64ea191131009a51025cc181ed89d7093b9f2a7db0a8ba8380fcb088bc4541f54793c57019aad
6
+ metadata.gz: bdedd12799acc1ccd9191f6419df3581956c1d61ba1f5518277f35a09a04da7f52174605495a38f519fd091bb8c314e3c353b3e100a76f1291c07a30e74c6093
7
+ data.tar.gz: affb611f2827f41a06873ff1c8458dea6413d787c9eafdd4d991d7258b3e205e2d57c8da533d64496551a0ade1cd5116eb58c773ae65b12ec96197f8431768b0
data/lib/util/shell.rb CHANGED
@@ -26,7 +26,7 @@ module Maestro
26
26
  end
27
27
 
28
28
  # Utility variables
29
- IS_WINDOWS = RbConfig::CONFIG['host_os'] =~ /mswin/
29
+ IS_WINDOWS = ChildProcess.windows?
30
30
  SEPARATOR = IS_WINDOWS ? "\\" : "/"
31
31
  MOVE_COMMAND = IS_WINDOWS ? 'move' : 'mv'
32
32
  ENV_EXPORT_COMMAND = IS_WINDOWS ? 'set' : 'export'
@@ -78,10 +78,24 @@ module Maestro
78
78
  File.open(@output_file.path, 'a') do |out_file|
79
79
  r, w = IO.pipe
80
80
  ChildProcess.posix_spawn = true
81
- process = IS_WINDOWS ? ChildProcess.build(@command_line) : ChildProcess.build(BASH_EXECUTABLE, @command_line)
81
+ if IS_WINDOWS
82
+ if ChildProcess.jruby?
83
+ # Due to https://github.com/jarib/childprocess/issues/26, we
84
+ # must use a different implementation of ChildProcess on
85
+ # Windows + JRuby
86
+ process = ChildProcess::JRuby::Process.new([@command_line])
87
+ else
88
+ process = ChildProcess.build(@command_line)
89
+ end
90
+ else
91
+ process = ChildProcess.build(BASH_EXECUTABLE, @command_line)
92
+ end
82
93
  process.io.stdout = process.io.stderr = w
83
94
  process.start
84
- w.close
95
+ # On Windows, can't close the pipe until process has exited or you
96
+ # get an EOF, see
97
+ # https://github.com/jarib/childprocess/pull/22#issuecomment-3395687
98
+ w.close unless IS_WINDOWS
85
99
 
86
100
  potential_eof = false
87
101
  begin
@@ -113,6 +127,7 @@ module Maestro
113
127
 
114
128
  r.close
115
129
  process.wait unless process.exited?
130
+ w.close if IS_WINDOWS
116
131
  @exit_code = ExitCode.new(process.exit_code)
117
132
  end
118
133
 
data/lib/util/version.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module Maestro
2
2
  module Util
3
3
  class Shell
4
- VERSION = '0.0.12'
4
+ VERSION = '0.0.13'
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: maestro_shell
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Doug Henderson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-28 00:00:00.000000000 Z
11
+ date: 2014-04-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: childprocess
@@ -120,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
120
120
  version: '0'
121
121
  requirements: []
122
122
  rubyforge_project:
123
- rubygems_version: 2.0.3
123
+ rubygems_version: 2.2.2
124
124
  signing_key:
125
125
  specification_version: 4
126
126
  summary: Maestro Shell utility