mux_tf 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mux_tf/cli/mux.rb +3 -1
- data/lib/mux_tf/tmux.rb +7 -0
- data/lib/mux_tf/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f957e5be5539e5df791dfb281c22125fd552952e83f1bdd8c9d7730b2877c23e
|
4
|
+
data.tar.gz: c72b478a9f3bae5074341f9430dc620ba87949d7191bcdc548e8c30eefa553f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e8c0b42e8a9470afe0f4c2ff0a5a86f724dd7c7c3a0e27b5f150f1afa3c75b4ddfc54cdf9073f163d7754c137728c63f7f905b33fcbd59793ff29040c795f8d0
|
7
|
+
data.tar.gz: bb6c0bde5705aa58d9c0c90d717fdf886ce78abafeed8202d0dfbfdef354b4f51114d22262e3dc3efb46d9ba4f56904a3cd142270f4b2605e908c1326316a294
|
data/lib/mux_tf/cli/mux.rb
CHANGED
@@ -46,10 +46,12 @@ module MuxTf
|
|
46
46
|
|
47
47
|
Tmux.set 'mouse', 'on'
|
48
48
|
|
49
|
+
window_id = Tmux.list_windows.first[:id]
|
50
|
+
|
49
51
|
unless tasks.empty?
|
50
52
|
tasks.each do |task|
|
51
53
|
log "launching task: #{task[:name]} ...", depth: 2
|
52
|
-
Tmux.split_window :horizontal, "#{project}
|
54
|
+
Tmux.split_window :horizontal, "#{project}:#{window_id}", cmd: task[:cmd], cwd: task[:cwd]
|
53
55
|
Tmux.select_pane task[:name]
|
54
56
|
Tmux.tile!
|
55
57
|
task[:commands]&.each do |cmd|
|
data/lib/mux_tf/tmux.rb
CHANGED
@@ -21,6 +21,13 @@ module MuxTf
|
|
21
21
|
panes.find { |pane| pane[:name] == name }
|
22
22
|
end
|
23
23
|
|
24
|
+
def list_windows
|
25
|
+
`tmux list-windows -F "\#{window_id},\#{window_index},\#{window_name}"`.strip.split("\n").map do |row|
|
26
|
+
x = row.split(',')
|
27
|
+
{ id: x[0], index: x[1], name: x[2] }
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
24
31
|
def new_session(name)
|
25
32
|
tmux %(new-session -s #{name.inspect} -d)
|
26
33
|
end
|
data/lib/mux_tf/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mux_tf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Banasik
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-06-
|
11
|
+
date: 2020-06-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|