masamune 0.18.7 → 0.18.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/masamune/commands/shell.rb +35 -6
- data/lib/masamune/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4998b7e77e19d79c880eee83917f6f16f764e6b3
|
4
|
+
data.tar.gz: 1b4a618c2981277813c470b8340b8e606767fd29
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 630c9fe4a18665a88bc836b5f52930cbe6d3ceca3d4c30b26e9b2be51629383e8bf3b35fe56f96c3f947e444d0cea3b3014ceda3ab77afc095872d2fbf704127
|
7
|
+
data.tar.gz: d926af20492b4c945058d5e6be69d1ea998977f5d1fe13a7e2b29134152cb829dc1dfea56e634ac77bcfffc188e3c084fcb46322f1fae3190355e6bdae4a0383
|
@@ -47,8 +47,14 @@ module Masamune::Commands
|
|
47
47
|
around_execute do
|
48
48
|
pid = Process.fork
|
49
49
|
if pid
|
50
|
-
|
51
|
-
|
50
|
+
Signal.trap('INT') {} # Ensure SIGINT is handled by child process exec
|
51
|
+
if opts.fetch(:detach, true)
|
52
|
+
detach do
|
53
|
+
Process.waitpid(pid)
|
54
|
+
end
|
55
|
+
else
|
56
|
+
Process.waitpid(pid)
|
57
|
+
end
|
52
58
|
exit
|
53
59
|
else
|
54
60
|
exec(command_env, *command_args)
|
@@ -143,7 +149,6 @@ module Masamune::Commands
|
|
143
149
|
|
144
150
|
[t_stderr, t_stdout, t_stdin].compact.each(&:join)
|
145
151
|
logger.debug("status: #{t_stdin.value}")
|
146
|
-
`stty sane -F /dev/tty` if RUBY_PLATFORM =~ /linux/
|
147
152
|
t_stdin.value
|
148
153
|
end
|
149
154
|
end
|
@@ -191,9 +196,33 @@ module Masamune::Commands
|
|
191
196
|
end
|
192
197
|
|
193
198
|
def detach
|
194
|
-
|
195
|
-
|
196
|
-
|
199
|
+
old_stdin = $stdin.dup
|
200
|
+
new_stdin = File.open('/dev/null', 'r')
|
201
|
+
$stdin.reopen(new_stdin)
|
202
|
+
new_stdin.close
|
203
|
+
|
204
|
+
old_stdout = $stdout.dup
|
205
|
+
new_stdout = File.open('/dev/null', 'w+')
|
206
|
+
$stdout.reopen(new_stdout)
|
207
|
+
new_stdout.close
|
208
|
+
|
209
|
+
old_stderr = $stderr.dup
|
210
|
+
new_stderr = File.open('/dev/null', 'w+')
|
211
|
+
$stderr.reopen(new_stderr)
|
212
|
+
new_stderr.close
|
213
|
+
|
214
|
+
yield
|
215
|
+
ensure
|
216
|
+
$stdin.reopen(old_stdin)
|
217
|
+
old_stdin.close
|
218
|
+
|
219
|
+
$stdout.reopen(old_stdout)
|
220
|
+
old_stdout.close
|
221
|
+
|
222
|
+
$stderr.reopen(old_stderr)
|
223
|
+
old_stderr.close
|
224
|
+
|
225
|
+
`stty sane -F /dev/tty` if RUBY_PLATFORM =~ /linux/
|
197
226
|
end
|
198
227
|
|
199
228
|
def command_info
|
data/lib/masamune/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: masamune
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.18.
|
4
|
+
version: 0.18.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Andrews
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-11-
|
11
|
+
date: 2016-11-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|