teamocil 1.3 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/teamocil/tmux/window.rb +1 -2
- data/lib/teamocil/version.rb +1 -1
- data/spec/teamocil/tmux/pane_spec.rb +9 -8
- data/spec/teamocil/tmux/window_spec.rb +35 -35
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 39659727ca49fed006e44ed06c92c9cfe3d532ea
|
4
|
+
data.tar.gz: 37d68dd84e577bb9c9079b44de08ab09dc9fa1e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7325cdae58869e2b72d54f95094fffb1f2a1eba043a6c7318a5486054a3c2d8a91b6c53d1e66ecdaebd486432ffb281904fe5066c93b0ee03a0ef342dafc7212
|
7
|
+
data.tar.gz: 89688490d2f543ebb7a76f395a9e8fdff9ed52cf6fcffad3944ba8a220c8031b3be66be675eda3e1cd336d8ab3fe2cca6e61fc7c7b0f73c99aafc814454d07a3
|
data/lib/teamocil/tmux/window.rb
CHANGED
@@ -48,8 +48,7 @@ module Teamocil
|
|
48
48
|
|
49
49
|
# Set the focus on the right pane or the first one
|
50
50
|
focused_pane = panes.find(&:focus)
|
51
|
-
focused_index = focused_pane ? focused_pane.internal_index : Teamocil::Tmux::Pane.pane_base_index
|
52
|
-
focused_index = "#{name}.#{focused_index}"
|
51
|
+
focused_index = focused_pane ? focused_pane.internal_index : "#{name}.#{Teamocil::Tmux::Pane.pane_base_index}"
|
53
52
|
tmux << Teamocil::Command::SelectPane.new(index: focused_index)
|
54
53
|
end.flatten
|
55
54
|
end
|
data/lib/teamocil/version.rb
CHANGED
@@ -2,7 +2,7 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
RSpec.describe Teamocil::Tmux::Pane do
|
4
4
|
describe :as_tmux do
|
5
|
-
let(:pane) { Teamocil::Tmux::Pane.new(commands: commands, root: root, index: index, focus: focus, layout: layout) }
|
5
|
+
let(:pane) { Teamocil::Tmux::Pane.new(commands: commands, root: root, index: index, focus: focus, layout: layout, name: name) }
|
6
6
|
let(:as_tmux) { pane.as_tmux }
|
7
7
|
let(:pane_base_index) { Random.rand(0..100) }
|
8
8
|
|
@@ -15,15 +15,16 @@ RSpec.describe Teamocil::Tmux::Pane do
|
|
15
15
|
let(:root) { '/tmp' }
|
16
16
|
let(:layout) { 'tiled' }
|
17
17
|
let(:focus) { true }
|
18
|
+
let(:name) { 'sample_window' }
|
18
19
|
|
19
20
|
context 'for first pane' do
|
20
21
|
let(:index) { 0 }
|
21
22
|
|
22
23
|
it do
|
23
24
|
expect(as_tmux).to eql [
|
24
|
-
Teamocil::Command::SendKeysToPane.new(index: pane_base_index, keys: 'foo; bar'),
|
25
|
-
Teamocil::Command::SendKeysToPane.new(index: pane_base_index, keys: 'Enter'),
|
26
|
-
Teamocil::Command::SelectLayout.new(layout: layout)
|
25
|
+
Teamocil::Command::SendKeysToPane.new(index: "#{name}.#{pane_base_index}", keys: 'foo; bar'),
|
26
|
+
Teamocil::Command::SendKeysToPane.new(index: "#{name}.#{pane_base_index}", keys: 'Enter'),
|
27
|
+
Teamocil::Command::SelectLayout.new(layout: layout, name: name)
|
27
28
|
]
|
28
29
|
end
|
29
30
|
end
|
@@ -33,10 +34,10 @@ RSpec.describe Teamocil::Tmux::Pane do
|
|
33
34
|
|
34
35
|
it do
|
35
36
|
expect(as_tmux).to eql [
|
36
|
-
Teamocil::Command::SplitWindow.new(root: root),
|
37
|
-
Teamocil::Command::SendKeysToPane.new(index: pane_base_index + index, keys: 'foo; bar'),
|
38
|
-
Teamocil::Command::SendKeysToPane.new(index: pane_base_index + index, keys: 'Enter'),
|
39
|
-
Teamocil::Command::SelectLayout.new(layout: layout)
|
37
|
+
Teamocil::Command::SplitWindow.new(root: root, name: name),
|
38
|
+
Teamocil::Command::SendKeysToPane.new(index: "#{name}.#{pane_base_index + index}", keys: 'foo; bar'),
|
39
|
+
Teamocil::Command::SendKeysToPane.new(index: "#{name}.#{pane_base_index + index}", keys: 'Enter'),
|
40
|
+
Teamocil::Command::SelectLayout.new(layout: layout, name: name)
|
40
41
|
]
|
41
42
|
end
|
42
43
|
end
|
@@ -30,12 +30,12 @@ RSpec.describe Teamocil::Tmux::Window do
|
|
30
30
|
it do
|
31
31
|
expect(as_tmux).to eql [
|
32
32
|
Teamocil::Command::NewWindow.new(name: name),
|
33
|
-
Teamocil::Command::SendKeysToPane.new(index: pane_base_index, keys: 'foo; omg'),
|
34
|
-
Teamocil::Command::SendKeysToPane.new(index: pane_base_index, keys: 'Enter'),
|
35
|
-
Teamocil::Command::SplitWindow.new,
|
36
|
-
Teamocil::Command::SendKeysToPane.new(index: pane_base_index + 1, keys: 'bar'),
|
37
|
-
Teamocil::Command::SendKeysToPane.new(index: pane_base_index + 1, keys: 'Enter'),
|
38
|
-
Teamocil::Command::SelectPane.new(index: pane_base_index + 1)
|
33
|
+
Teamocil::Command::SendKeysToPane.new(index: "#{name}.#{pane_base_index}", keys: 'foo; omg'),
|
34
|
+
Teamocil::Command::SendKeysToPane.new(index: "#{name}.#{pane_base_index}", keys: 'Enter'),
|
35
|
+
Teamocil::Command::SplitWindow.new(name: name),
|
36
|
+
Teamocil::Command::SendKeysToPane.new(index: "#{name}.#{pane_base_index + 1}", keys: 'bar'),
|
37
|
+
Teamocil::Command::SendKeysToPane.new(index: "#{name}.#{pane_base_index + 1}", keys: 'Enter'),
|
38
|
+
Teamocil::Command::SelectPane.new(index: "#{name}.#{pane_base_index + 1}")
|
39
39
|
]
|
40
40
|
end
|
41
41
|
|
@@ -45,12 +45,12 @@ RSpec.describe Teamocil::Tmux::Window do
|
|
45
45
|
it do
|
46
46
|
expect(as_tmux).to eql [
|
47
47
|
Teamocil::Command::NewWindow.new(name: name, root: root),
|
48
|
-
Teamocil::Command::SendKeysToPane.new(index: pane_base_index, keys: 'foo; omg'),
|
49
|
-
Teamocil::Command::SendKeysToPane.new(index: pane_base_index, keys: 'Enter'),
|
50
|
-
Teamocil::Command::SplitWindow.new(root: root),
|
51
|
-
Teamocil::Command::SendKeysToPane.new(index: pane_base_index + 1, keys: 'bar'),
|
52
|
-
Teamocil::Command::SendKeysToPane.new(index: pane_base_index + 1, keys: 'Enter'),
|
53
|
-
Teamocil::Command::SelectPane.new(index: pane_base_index + 1)
|
48
|
+
Teamocil::Command::SendKeysToPane.new(index: "#{name}.#{pane_base_index}", keys: 'foo; omg'),
|
49
|
+
Teamocil::Command::SendKeysToPane.new(index: "#{name}.#{pane_base_index}", keys: 'Enter'),
|
50
|
+
Teamocil::Command::SplitWindow.new(name: name, root: root),
|
51
|
+
Teamocil::Command::SendKeysToPane.new(index: "#{name}.#{pane_base_index + 1}", keys: 'bar'),
|
52
|
+
Teamocil::Command::SendKeysToPane.new(index: "#{name}.#{pane_base_index + 1}", keys: 'Enter'),
|
53
|
+
Teamocil::Command::SelectPane.new(index: "#{name}.#{pane_base_index + 1}")
|
54
54
|
]
|
55
55
|
end
|
56
56
|
end
|
@@ -61,7 +61,7 @@ RSpec.describe Teamocil::Tmux::Window do
|
|
61
61
|
it do
|
62
62
|
expect(as_tmux).to eql [
|
63
63
|
Teamocil::Command::NewWindow.new(name: name, root: root),
|
64
|
-
Teamocil::Command::SelectPane.new(index: pane_base_index)
|
64
|
+
Teamocil::Command::SelectPane.new(index: "#{name}.#{pane_base_index}")
|
65
65
|
]
|
66
66
|
end
|
67
67
|
end
|
@@ -72,14 +72,14 @@ RSpec.describe Teamocil::Tmux::Window do
|
|
72
72
|
it do
|
73
73
|
expect(as_tmux).to eql [
|
74
74
|
Teamocil::Command::NewWindow.new(name: name),
|
75
|
-
Teamocil::Command::SendKeysToPane.new(index: pane_base_index, keys: 'foo; omg'),
|
76
|
-
Teamocil::Command::SendKeysToPane.new(index: pane_base_index, keys: 'Enter'),
|
77
|
-
Teamocil::Command::SelectLayout.new(layout: layout),
|
78
|
-
Teamocil::Command::SplitWindow.new,
|
79
|
-
Teamocil::Command::SendKeysToPane.new(index: pane_base_index + 1, keys: 'bar'),
|
80
|
-
Teamocil::Command::SendKeysToPane.new(index: pane_base_index + 1, keys: 'Enter'),
|
81
|
-
Teamocil::Command::SelectLayout.new(layout: layout),
|
82
|
-
Teamocil::Command::SelectPane.new(index: pane_base_index + 1)
|
75
|
+
Teamocil::Command::SendKeysToPane.new(index: "#{name}.#{pane_base_index}", keys: 'foo; omg'),
|
76
|
+
Teamocil::Command::SendKeysToPane.new(index: "#{name}.#{pane_base_index}", keys: 'Enter'),
|
77
|
+
Teamocil::Command::SelectLayout.new(layout: layout, name: name),
|
78
|
+
Teamocil::Command::SplitWindow.new(name: name),
|
79
|
+
Teamocil::Command::SendKeysToPane.new(index: "#{name}.#{pane_base_index + 1}", keys: 'bar'),
|
80
|
+
Teamocil::Command::SendKeysToPane.new(index: "#{name}.#{pane_base_index + 1}", keys: 'Enter'),
|
81
|
+
Teamocil::Command::SelectLayout.new(layout: layout, name: name),
|
82
|
+
Teamocil::Command::SelectPane.new(index: "#{name}.#{pane_base_index + 1}")
|
83
83
|
]
|
84
84
|
end
|
85
85
|
end
|
@@ -91,12 +91,12 @@ RSpec.describe Teamocil::Tmux::Window do
|
|
91
91
|
it do
|
92
92
|
expect(as_tmux).to eql [
|
93
93
|
Teamocil::Command::RenameWindow.new(name: name),
|
94
|
-
Teamocil::Command::SendKeysToPane.new(index: pane_base_index, keys: 'foo; omg'),
|
95
|
-
Teamocil::Command::SendKeysToPane.new(index: pane_base_index, keys: 'Enter'),
|
96
|
-
Teamocil::Command::SplitWindow.new,
|
97
|
-
Teamocil::Command::SendKeysToPane.new(index: pane_base_index + 1, keys: 'bar'),
|
98
|
-
Teamocil::Command::SendKeysToPane.new(index: pane_base_index + 1, keys: 'Enter'),
|
99
|
-
Teamocil::Command::SelectPane.new(index: pane_base_index + 1)
|
94
|
+
Teamocil::Command::SendKeysToPane.new(index: "#{name}.#{pane_base_index}", keys: 'foo; omg'),
|
95
|
+
Teamocil::Command::SendKeysToPane.new(index: "#{name}.#{pane_base_index}", keys: 'Enter'),
|
96
|
+
Teamocil::Command::SplitWindow.new(name: name),
|
97
|
+
Teamocil::Command::SendKeysToPane.new(index: "#{name}.#{pane_base_index + 1}", keys: 'bar'),
|
98
|
+
Teamocil::Command::SendKeysToPane.new(index: "#{name}.#{pane_base_index + 1}", keys: 'Enter'),
|
99
|
+
Teamocil::Command::SelectPane.new(index: "#{name}.#{pane_base_index + 1}")
|
100
100
|
]
|
101
101
|
end
|
102
102
|
end
|
@@ -107,15 +107,15 @@ RSpec.describe Teamocil::Tmux::Window do
|
|
107
107
|
|
108
108
|
it do
|
109
109
|
expect(as_tmux).to eql [
|
110
|
-
Teamocil::Command::SendKeysToPane.new(index: pane_base_index, keys: 'cd "/tmp"'),
|
111
|
-
Teamocil::Command::SendKeysToPane.new(index: pane_base_index, keys: 'Enter'),
|
110
|
+
Teamocil::Command::SendKeysToPane.new(index: "#{name}.#{pane_base_index}", keys: 'cd "/tmp"'),
|
111
|
+
Teamocil::Command::SendKeysToPane.new(index: "#{name}.#{pane_base_index}", keys: 'Enter'),
|
112
112
|
Teamocil::Command::RenameWindow.new(name: name),
|
113
|
-
Teamocil::Command::SendKeysToPane.new(index: pane_base_index, keys: 'foo; omg'),
|
114
|
-
Teamocil::Command::SendKeysToPane.new(index: pane_base_index, keys: 'Enter'),
|
115
|
-
Teamocil::Command::SplitWindow.new(root: root),
|
116
|
-
Teamocil::Command::SendKeysToPane.new(index: pane_base_index + 1, keys: 'bar'),
|
117
|
-
Teamocil::Command::SendKeysToPane.new(index: pane_base_index + 1, keys: 'Enter'),
|
118
|
-
Teamocil::Command::SelectPane.new(index: pane_base_index + 1)
|
113
|
+
Teamocil::Command::SendKeysToPane.new(index: "#{name}.#{pane_base_index}", keys: 'foo; omg'),
|
114
|
+
Teamocil::Command::SendKeysToPane.new(index: "#{name}.#{pane_base_index}", keys: 'Enter'),
|
115
|
+
Teamocil::Command::SplitWindow.new(name: name, root: root),
|
116
|
+
Teamocil::Command::SendKeysToPane.new(index: "#{name}.#{pane_base_index + 1}", keys: 'bar'),
|
117
|
+
Teamocil::Command::SendKeysToPane.new(index: "#{name}.#{pane_base_index + 1}", keys: 'Enter'),
|
118
|
+
Teamocil::Command::SelectPane.new(index: "#{name}.#{pane_base_index + 1}")
|
119
119
|
]
|
120
120
|
end
|
121
121
|
end
|