spielbash 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f2ed0eaabd98f95be89e69d8da0bfa557090f3b1
|
4
|
+
data.tar.gz: cee9b6dd3231c2a2dac196558c0c259511259f91
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 01ae477361331c97b80b691f2ad9278cdb3863b70eeb8b1c902ce8672f3a10fccd2331ac844082e6f80d16669a4a6645dbfc88741fb2e86641f7a9e582243437
|
7
|
+
data.tar.gz: 79a2c47f82b5b706c3776ced33e74a3d2005b5af12640ee4136a8e05e7780981512afb33614fd6941005bd81322951c87ad622023ad77527385e329acfdccd9c
|
@@ -26,10 +26,7 @@ module Spielbash
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def close_session
|
29
|
-
send_key("exit")
|
30
|
-
send_key('C-m')
|
31
|
-
|
32
|
-
wait
|
29
|
+
send_key("exit C-m")
|
33
30
|
end
|
34
31
|
|
35
32
|
# This will wait for tmux session pid to not have any child processes
|
@@ -47,7 +44,7 @@ module Spielbash
|
|
47
44
|
|
48
45
|
def send_key(key, count=1)
|
49
46
|
key = 'Space' if key == ' '
|
50
|
-
execute_tmux_with("send-keys -t #{name} -N #{count} #{key}")
|
47
|
+
execute_tmux_with("send-keys -t #{name} -N #{count} #{key}", true)
|
51
48
|
end
|
52
49
|
|
53
50
|
def start_recording
|
@@ -60,7 +57,7 @@ module Spielbash
|
|
60
57
|
private
|
61
58
|
|
62
59
|
def exec_wait_check_cmd(pid)
|
63
|
-
if
|
60
|
+
if is_real_environment
|
64
61
|
execute_with('pgrep', "-P #{pid}", true)
|
65
62
|
else
|
66
63
|
cmd = context.wait_check_cmd.split
|
@@ -78,7 +75,7 @@ module Spielbash
|
|
78
75
|
end
|
79
76
|
|
80
77
|
def execute_with_exactly(cmd, wait, io_inherit, leader, *arguments)
|
81
|
-
raise "Please install #{cmd}" if which(cmd).nil?
|
78
|
+
raise "Please install #{cmd}" if is_real_environment && which(cmd).nil?
|
82
79
|
|
83
80
|
process = ChildProcess.build(cmd, *arguments)
|
84
81
|
process.leader = leader
|
@@ -98,6 +95,10 @@ module Spielbash
|
|
98
95
|
process
|
99
96
|
end
|
100
97
|
|
98
|
+
def is_real_environment
|
99
|
+
context.wait_check_cmd.nil?
|
100
|
+
end
|
101
|
+
|
101
102
|
def output(file)
|
102
103
|
file.rewind
|
103
104
|
out = file.read
|
data/lib/spielbash/version.rb
CHANGED
data/lib/spielbash/view/cli.rb
CHANGED
@@ -10,8 +10,27 @@ module Spielbash
|
|
10
10
|
desc 'Be verbose'
|
11
11
|
switch [:v, :verbose]
|
12
12
|
|
13
|
-
#
|
14
|
-
#
|
13
|
+
# Cross-platform way of finding an executable in the $PATH.
|
14
|
+
#
|
15
|
+
# which('ruby') #=> /usr/bin/ruby
|
16
|
+
def which(cmd)
|
17
|
+
exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : ['']
|
18
|
+
ENV['PATH'].split(File::PATH_SEPARATOR).each do |path|
|
19
|
+
exts.each {|ext|
|
20
|
+
exe = File.join(path, "#{cmd}#{ext}")
|
21
|
+
return true if File.executable?(exe) && !File.directory?(exe)
|
22
|
+
}
|
23
|
+
end
|
24
|
+
false
|
25
|
+
end
|
26
|
+
|
27
|
+
pre do |global_options, command, options, args|
|
28
|
+
help_now!('pgrep is not installed!') unless which('pgrep')
|
29
|
+
help_now!('docker is not installed!') unless which('docker')
|
30
|
+
help_now!('tmux is not installed!') unless which('tmux')
|
31
|
+
help_now!('resize is not installed!') unless which('resize')
|
32
|
+
help_now!('asciinema is not installed!') unless which('asciinema')
|
33
|
+
end
|
15
34
|
|
16
35
|
desc 'Create a recording'
|
17
36
|
command :record do |c|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spielbash
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anton Malinskiy
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04-
|
11
|
+
date: 2018-04-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gli
|