hiiro 0.1.158 → 0.1.159

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: 00d61f29ccdc547d37007e61e81488c54e366a574d8f5d95efef42eaeb234c2d
4
- data.tar.gz: cc2b2fa6c52956a5d780b07820d86350c1a585f6df05166378a420a22e391f8e
3
+ metadata.gz: 394980810fd90dc9fdd82383a671502fd78669690479d6b3e6ba0fb4ed6510fc
4
+ data.tar.gz: 189dffc8b1e175751572114424b7ce0078e6eae386aa3c3993ae0d0689c37733
5
5
  SHA512:
6
- metadata.gz: 1cdcd252caf0b31bd14eb765b66e92ff8ad892eb2d0613d7bb3e0f853d322a72797052cc25a7b2a543a0e3e1d90e525655ad9f91b2b40c865640b3c58fb0763a
7
- data.tar.gz: 162a5028c7e6e8ff3e24c91a9a5d6e442d7488440bc70d2f1021f0001ebfef287f0cb9ead32d5cc35e4884059fef0ccc7945b3330a269e78407d158ae892fed3
6
+ metadata.gz: 6cef595bf8648318ade523cd214a43d76960398543168803fe9a2cb2948dbe4d065e259a5de3aa5ebc60a2e703fa3de21e049b5c9c6295a3c3602c8a5f6524fd
7
+ data.tar.gz: '009cf0ef87a09777f322bba3868bd06197d1b8207f94e580fe7e63ed1437f2a5c965c35b66b7479f3fb819a0cf90dd64d9327f38fc76926053371c7a6b984b7f'
@@ -82,8 +82,8 @@ class Hiiro
82
82
  puts "Starting group '#{group[:name]}'..."
83
83
 
84
84
  # Create one window for the group, split panes for each service
85
- window_target = create_tmux_window(session, group[:name])
86
- first_pane_id = capture_pane_id(window_target)
85
+ window_target, first_pane_id = create_tmux_window(session, group[:name])
86
+ last_pane_id = first_pane_id
87
87
 
88
88
  members.each_with_index do |member, idx|
89
89
  member_name = member['name'] || member[:name]
@@ -95,7 +95,9 @@ class Hiiro
95
95
  if idx == 0
96
96
  pane_id = first_pane_id
97
97
  else
98
- pane_id = split_tmux_pane(window_target)
98
+ # Split from the last pane so each new pane is distinct
99
+ pane_id = split_tmux_pane(window_target, last_pane_id)
100
+ last_pane_id = pane_id
99
101
  end
100
102
 
101
103
  member_tmux_info = tmux_info.merge(
@@ -193,8 +195,7 @@ class Hiiro
193
195
 
194
196
  if session && !skip_window_creation
195
197
  # Create a new tmux window for this service
196
- window_target = create_tmux_window(session, svc_name)
197
- pane_id = capture_pane_id(window_target)
198
+ window_target, pane_id = create_tmux_window(session, svc_name)
198
199
  elsif session && skip_window_creation
199
200
  # Pane already created by start_group
200
201
  pane_id = tmux_info[:pane]
@@ -800,18 +801,15 @@ class Hiiro
800
801
  end
801
802
 
802
803
  def create_tmux_window(session, name)
803
- system('tmux', 'new-window', '-d', '-t', session, '-n', name)
804
- "#{session}:#{name}"
804
+ pane_id = `tmux new-window -d -t #{session} -n #{name} -P -F '\#{pane_id}'`.chomp
805
+ window_target = "#{session}:#{name}"
806
+ [window_target, pane_id]
805
807
  end
806
808
 
807
- def capture_pane_id(window_target)
808
- `tmux list-panes -t #{window_target} -F '\#{pane_id}'`.chomp.split("\n").last
809
- end
810
-
811
- def split_tmux_pane(window_target)
812
- system('tmux', 'split-window', '-d', '-t', window_target)
809
+ def split_tmux_pane(window_target, target_pane_id)
810
+ pane_id = `tmux split-window -d -t #{target_pane_id} -P -F '\#{pane_id}'`.chomp
813
811
  system('tmux', 'select-layout', '-t', window_target, 'even-vertical')
814
- `tmux list-panes -t #{window_target} -F '\#{pane_id}'`.chomp.split("\n").last
812
+ pane_id
815
813
  end
816
814
 
817
815
  def send_to_pane(pane_id, base_dir, script)
data/lib/hiiro/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Hiiro
2
- VERSION = "0.1.158"
2
+ VERSION = "0.1.159"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hiiro
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.158
4
+ version: 0.1.159
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joshua Toyota