teamocil 0.3.8 → 0.3.9
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.
- data/README.md +10 -2
- data/lib/teamocil.rb +1 -1
- data/lib/teamocil/layout/window.rb +3 -1
- data/spec/fixtures/layouts.yml +1 -0
- data/spec/layout_spec.rb +6 -0
- metadata +4 -4
data/README.md
CHANGED
@@ -1,8 +1,7 @@
|
|
1
|
-
# Teamocil [](http://travis-ci.org/remiprev/teamocil)
|
1
|
+
# Teamocil [](http://travis-ci.org/remiprev/teamocil)
|
2
2
|
|
3
3
|
Teamocil is a simple tool used to automatically create sessions, windows and splits in [tmux](http://tmux.sourceforge.net/) with YAML files.
|
4
4
|
|
5
|
-
|
6
5
|
## Usage
|
7
6
|
|
8
7
|
```bash
|
@@ -52,6 +51,7 @@ If you are not using a top-level `session` key, then the first key of your layou
|
|
52
51
|
* `root` (the directory in which every split will be created)
|
53
52
|
* `filters` (a hash of `before` and `after` commands to run for each split)
|
54
53
|
* `clear` (whether or not to prepend a `clear` command before the `before` filters list)
|
54
|
+
* `layout` (a layout name or serialized string supported by `tmux`’s `select-layout` command)
|
55
55
|
* `splits` (an array of split items)
|
56
56
|
* `options` (a hash of tmux options, see `man tmux` for a list)
|
57
57
|
|
@@ -189,6 +189,14 @@ To get autocompletion when typing `teamocil <Tab>` in a zsh session, add this li
|
|
189
189
|
compctl -g '~/.teamocil/*(:t:r)' teamocil
|
190
190
|
```
|
191
191
|
|
192
|
+
### Bash autocompletion
|
193
|
+
|
194
|
+
To get autocompletion when typing `teamocil <Tab>` in a bash session, add this line to your `~/.bashrc` file:
|
195
|
+
|
196
|
+
```bash
|
197
|
+
complete -W "$(teamocil --list)" teamocil
|
198
|
+
```
|
199
|
+
|
192
200
|
### ERB support
|
193
201
|
|
194
202
|
You can use ERB in your layouts. For example, you can use an environment variable in a layout like so:
|
data/lib/teamocil.rb
CHANGED
@@ -3,7 +3,7 @@ module Teamocil
|
|
3
3
|
|
4
4
|
# This class represents a window within tmux
|
5
5
|
class Window
|
6
|
-
attr_reader :filters, :root, :splits, :options, :index, :name, :clear
|
6
|
+
attr_reader :filters, :root, :splits, :options, :index, :name, :clear, :layout
|
7
7
|
|
8
8
|
# Initialize a new tmux window
|
9
9
|
#
|
@@ -15,6 +15,7 @@ module Teamocil
|
|
15
15
|
@root = attrs["root"] || "."
|
16
16
|
@clear = attrs["clear"] == true ? "clear" : nil
|
17
17
|
@options = attrs["options"] || {}
|
18
|
+
@layout = attrs["layout"]
|
18
19
|
|
19
20
|
@splits = attrs["splits"] || []
|
20
21
|
raise Teamocil::Error::LayoutError.new("You must specify a `splits` key for every window.") if @splits.empty?
|
@@ -48,6 +49,7 @@ module Teamocil
|
|
48
49
|
commands << "tmux set-window-option #{option} #{value}"
|
49
50
|
end
|
50
51
|
|
52
|
+
commands << "tmux select-layout \"#{@layout}\"" if @layout
|
51
53
|
commands << "tmux select-pane -t #{@splits.map(&:focus).index(true) || 0}"
|
52
54
|
|
53
55
|
commands
|
data/spec/fixtures/layouts.yml
CHANGED
data/spec/layout_spec.rb
CHANGED
@@ -50,6 +50,12 @@ describe Teamocil::Layout do
|
|
50
50
|
session.windows[0].clear.should == "clear"
|
51
51
|
session.windows[1].clear.should be_nil
|
52
52
|
end # }}}
|
53
|
+
|
54
|
+
it "creates windows with layout option" do # {{{
|
55
|
+
session = @layout.compile!
|
56
|
+
session.windows[0].layout.should == "tiled"
|
57
|
+
session.windows[1].layout.should be_nil
|
58
|
+
end # }}}
|
53
59
|
end # }}}
|
54
60
|
|
55
61
|
describe "splits" do # {{{
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: teamocil
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.9
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-10-17 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -127,7 +127,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
127
127
|
version: '0'
|
128
128
|
segments:
|
129
129
|
- 0
|
130
|
-
hash: -
|
130
|
+
hash: -2208554246657691212
|
131
131
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
132
132
|
none: false
|
133
133
|
requirements:
|
@@ -136,7 +136,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
136
136
|
version: '0'
|
137
137
|
segments:
|
138
138
|
- 0
|
139
|
-
hash: -
|
139
|
+
hash: -2208554246657691212
|
140
140
|
requirements: []
|
141
141
|
rubyforge_project:
|
142
142
|
rubygems_version: 1.8.18
|