teamocil 1.1 → 1.2
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 +4 -4
- data/README.md +31 -3
- data/lib/teamocil/tmux/pane.rb +2 -1
- data/lib/teamocil/tmux/window.rb +3 -3
- data/lib/teamocil/version.rb +1 -1
- data/spec/teamocil/tmux/pane_spec.rb +6 -3
- data/spec/teamocil/tmux/window_spec.rb +1 -0
- data/teamocil.gemspec +3 -3
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f1c86cb621b8cdae9e6c88da35691a7b609ed820
|
4
|
+
data.tar.gz: 23f172c3824cd34f2e1dcf87ae1e828005b0dd27
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b5692ccafb09e0eb382f39af977a976a73774fb57be39e906e55f8fe1aef6ba691c1a0f2a68c184bd273a9312a2e143fb8054d92cd6c3da16c1d0a3f4e20116
|
7
|
+
data.tar.gz: 05621fd704bbf8dcf9d3d4a5103a308bdc95086b23a3fcd2dcd92121d5af8524ec8e105ec3af0e283f1e75782169f9cb3625dff6905fc639da9373a8c528d42d
|
data/README.md
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
<img src="http://i.imgur.com/NX2eV2X.png" alt="Teamocil" />
|
4
4
|
</a>
|
5
5
|
<br />
|
6
|
-
Teamocil is a simple tool used to automatically create
|
6
|
+
Teamocil is a simple tool used to automatically create<br /> windows and panes in <a href="http://tmux.sourceforge.net">tmux</a> with YAML files.
|
7
7
|
<br /><br />
|
8
8
|
<a href="https://rubygems.org/gems/teamocil"><img src="http://img.shields.io/gem/v/teamocil.svg" /></a>
|
9
9
|
<a href="https://travis-ci.org/remiprev/teamocil"><img src="http://img.shields.io/travis/remiprev/teamocil.svg" /></a>
|
@@ -64,7 +64,7 @@ You *might* have to clean up your layout files after upgrading to 1.0. I’m
|
|
64
64
|
sorry about that. The documentation in `README.md` should help you find which
|
65
65
|
keys are now supported.
|
66
66
|
|
67
|
-
Feel free to fork the repository and add back as many features as you want :)
|
67
|
+
The [`0.4-stable` branch](https://github.com/remiprev/teamocil/tree/0.4-stable) is still available with the old code. Feel free to fork the repository and add back as many features as you want :)
|
68
68
|
|
69
69
|
## Configuration
|
70
70
|
|
@@ -156,7 +156,7 @@ windows:
|
|
156
156
|
|
157
157
|
```yaml
|
158
158
|
windows:
|
159
|
-
- name: sample-
|
159
|
+
- name: sample-four-panes
|
160
160
|
root: ~/Code/sample/www
|
161
161
|
layout: tiled
|
162
162
|
panes:
|
@@ -180,6 +180,34 @@ windows:
|
|
180
180
|
'------------------'------------------'
|
181
181
|
```
|
182
182
|
|
183
|
+
### Two pane window with focus in second pane
|
184
|
+
|
185
|
+
```yaml
|
186
|
+
windows:
|
187
|
+
- name: sample-two-panes
|
188
|
+
root: ~/Code/sample/www
|
189
|
+
layout: even-horizontal
|
190
|
+
panes:
|
191
|
+
- rails server
|
192
|
+
- commands:
|
193
|
+
- rails console
|
194
|
+
focus: true
|
195
|
+
```
|
196
|
+
|
197
|
+
```
|
198
|
+
.------------------.------------------.
|
199
|
+
| (0) | (1) <focus here> |
|
200
|
+
| | |
|
201
|
+
| | |
|
202
|
+
| | |
|
203
|
+
| | |
|
204
|
+
| | |
|
205
|
+
| | |
|
206
|
+
| | |
|
207
|
+
| | |
|
208
|
+
'------------------'------------------'
|
209
|
+
```
|
210
|
+
|
183
211
|
## Extras
|
184
212
|
|
185
213
|
### Zsh autocompletion
|
data/lib/teamocil/tmux/pane.rb
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
module Teamocil
|
2
2
|
module Tmux
|
3
|
-
class Pane < ClosedStruct.new(:index, :root, :commands, :focus)
|
3
|
+
class Pane < ClosedStruct.new(:index, :root, :commands, :focus, :layout)
|
4
4
|
def as_tmux
|
5
5
|
[].tap do |tmux|
|
6
6
|
tmux << Teamocil::Command::SplitWindow.new(root: root) unless first?
|
7
7
|
tmux << Teamocil::Command::SendKeysToPane.new(index: internal_index, keys: commands.join('; ')) if commands
|
8
8
|
tmux << Teamocil::Command::SendKeysToPane.new(index: internal_index, keys: 'Enter')
|
9
|
+
tmux << Teamocil::Command::SelectLayout.new(layout: layout) if layout
|
9
10
|
end
|
10
11
|
end
|
11
12
|
|
data/lib/teamocil/tmux/window.rb
CHANGED
@@ -18,6 +18,9 @@ module Teamocil
|
|
18
18
|
# Panes need know the window root directory
|
19
19
|
pane.merge! root: root
|
20
20
|
|
21
|
+
# Panes need know the window layout
|
22
|
+
pane.merge! layout: layout
|
23
|
+
|
21
24
|
Teamocil::Tmux::Pane.new(pane)
|
22
25
|
end
|
23
26
|
end
|
@@ -40,9 +43,6 @@ module Teamocil
|
|
40
43
|
# Execute all panes commands
|
41
44
|
tmux << panes.map(&:as_tmux).flatten
|
42
45
|
|
43
|
-
# Select the window layout
|
44
|
-
tmux << Teamocil::Command::SelectLayout.new(layout: layout) if layout
|
45
|
-
|
46
46
|
# Set the focus on the right pane or the first one
|
47
47
|
focused_pane = panes.find(&:focus)
|
48
48
|
focused_index = focused_pane ? focused_pane.internal_index : Teamocil::Tmux::Pane.pane_base_index
|
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) }
|
5
|
+
let(:pane) { Teamocil::Tmux::Pane.new(commands: commands, root: root, index: index, focus: focus, layout: layout) }
|
6
6
|
let(:as_tmux) { pane.as_tmux }
|
7
7
|
let(:pane_base_index) { Random.rand(0..100) }
|
8
8
|
|
@@ -13,6 +13,7 @@ RSpec.describe Teamocil::Tmux::Pane do
|
|
13
13
|
# Pane attributes
|
14
14
|
let(:commands) { %w(foo bar) }
|
15
15
|
let(:root) { '/tmp' }
|
16
|
+
let(:layout) { 'tiled' }
|
16
17
|
let(:focus) { true }
|
17
18
|
|
18
19
|
context 'for first pane' do
|
@@ -21,7 +22,8 @@ RSpec.describe Teamocil::Tmux::Pane do
|
|
21
22
|
it do
|
22
23
|
expect(as_tmux).to eql [
|
23
24
|
Teamocil::Command::SendKeysToPane.new(index: pane_base_index, keys: 'foo; bar'),
|
24
|
-
Teamocil::Command::SendKeysToPane.new(index: pane_base_index, keys: 'Enter')
|
25
|
+
Teamocil::Command::SendKeysToPane.new(index: pane_base_index, keys: 'Enter'),
|
26
|
+
Teamocil::Command::SelectLayout.new(layout: layout)
|
25
27
|
]
|
26
28
|
end
|
27
29
|
end
|
@@ -33,7 +35,8 @@ RSpec.describe Teamocil::Tmux::Pane do
|
|
33
35
|
expect(as_tmux).to eql [
|
34
36
|
Teamocil::Command::SplitWindow.new(root: root),
|
35
37
|
Teamocil::Command::SendKeysToPane.new(index: pane_base_index + index, keys: 'foo; bar'),
|
36
|
-
Teamocil::Command::SendKeysToPane.new(index: pane_base_index + index, keys: 'Enter')
|
38
|
+
Teamocil::Command::SendKeysToPane.new(index: pane_base_index + index, keys: 'Enter'),
|
39
|
+
Teamocil::Command::SelectLayout.new(layout: layout)
|
37
40
|
]
|
38
41
|
end
|
39
42
|
end
|
@@ -74,6 +74,7 @@ RSpec.describe Teamocil::Tmux::Window do
|
|
74
74
|
Teamocil::Command::NewWindow.new(name: name),
|
75
75
|
Teamocil::Command::SendKeysToPane.new(index: pane_base_index, keys: 'foo; omg'),
|
76
76
|
Teamocil::Command::SendKeysToPane.new(index: pane_base_index, keys: 'Enter'),
|
77
|
+
Teamocil::Command::SelectLayout.new(layout: layout),
|
77
78
|
Teamocil::Command::SplitWindow.new,
|
78
79
|
Teamocil::Command::SendKeysToPane.new(index: pane_base_index + 1, keys: 'bar'),
|
79
80
|
Teamocil::Command::SendKeysToPane.new(index: pane_base_index + 1, keys: 'Enter'),
|
data/teamocil.gemspec
CHANGED
@@ -10,10 +10,10 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.platform = Gem::Platform::RUBY
|
11
11
|
s.authors = 'Rémi Prévost'
|
12
12
|
s.email = 'remi@exomel.com'
|
13
|
-
s.homepage = 'http://
|
13
|
+
s.homepage = 'http://www.teamocil.com'
|
14
14
|
s.license = 'MIT'
|
15
|
-
s.
|
16
|
-
s.
|
15
|
+
s.description = 'Teamocil is a simple tool used to automatically create windows and panes in tmux with YAML files.'
|
16
|
+
s.summary = s.description
|
17
17
|
|
18
18
|
# Manifest
|
19
19
|
s.files = `git ls-files`.split("\n")
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: teamocil
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '1.
|
4
|
+
version: '1.2'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rémi Prévost
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-03-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -66,8 +66,8 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '3.0'
|
69
|
-
description: Teamocil
|
70
|
-
|
69
|
+
description: Teamocil is a simple tool used to automatically create windows and panes
|
70
|
+
in tmux with YAML files.
|
71
71
|
email: remi@exomel.com
|
72
72
|
executables:
|
73
73
|
- teamocil
|
@@ -115,7 +115,7 @@ files:
|
|
115
115
|
- spec/teamocil/tmux/session_spec.rb
|
116
116
|
- spec/teamocil/tmux/window_spec.rb
|
117
117
|
- teamocil.gemspec
|
118
|
-
homepage: http://
|
118
|
+
homepage: http://www.teamocil.com
|
119
119
|
licenses:
|
120
120
|
- MIT
|
121
121
|
metadata: {}
|
@@ -138,7 +138,8 @@ rubyforge_project:
|
|
138
138
|
rubygems_version: 2.2.2
|
139
139
|
signing_key:
|
140
140
|
specification_version: 4
|
141
|
-
summary:
|
141
|
+
summary: Teamocil is a simple tool used to automatically create windows and panes
|
142
|
+
in tmux with YAML files.
|
142
143
|
test_files:
|
143
144
|
- spec/spec_helper.rb
|
144
145
|
- spec/teamocil/cli_spec.rb
|