mux_tf 0.2.2 → 0.2.3

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
  SHA256:
3
- metadata.gz: 3a554f0039080c094e9fe4096cc2e93dc66c073de44d18581c10061b927e466c
4
- data.tar.gz: 8b6ec1f3746db1815c12f21dc62872843c20a59c811a5953e334bfb59fad6daf
3
+ metadata.gz: f957e5be5539e5df791dfb281c22125fd552952e83f1bdd8c9d7730b2877c23e
4
+ data.tar.gz: c72b478a9f3bae5074341f9430dc620ba87949d7191bcdc548e8c30eefa553f9
5
5
  SHA512:
6
- metadata.gz: 9868c26137825f6fdb09372488563d46cf51370d13decf64f456b5a6fd9c70073059a382640cf95e570291d91bdfc3d558018914193e8e00496877ecf556a91f
7
- data.tar.gz: 615146492ddd7462510b431a2b54976dd16d8b3e5c594c46fe61fefa7f8ab51217c87825cee5317a78769dfe0b27d2c85363b5e1ebfe0b951441b3aad171cad3
6
+ metadata.gz: e8c0b42e8a9470afe0f4c2ff0a5a86f724dd7c7c3a0e27b5f150f1afa3c75b4ddfc54cdf9073f163d7754c137728c63f7f905b33fcbd59793ff29040c795f8d0
7
+ data.tar.gz: bb6c0bde5705aa58d9c0c90d717fdf886ce78abafeed8202d0dfbfdef354b4f51114d22262e3dc3efb46d9ba4f56904a3cd142270f4b2605e908c1326316a294
@@ -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}:1", cmd: task[:cmd], cwd: task[:cwd]
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|
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MuxTf
4
- VERSION = '0.2.2'
4
+ VERSION = '0.2.3'
5
5
  end
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.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-23 00:00:00.000000000 Z
11
+ date: 2020-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport