teamocil 0.3.8 → 0.3.9

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,8 +1,7 @@
1
- # Teamocil [![Build Status](https://secure.travis-ci.org/remiprev/teamocil.png)](http://travis-ci.org/remiprev/teamocil)
1
+ # Teamocil [![Build Status](https://secure.travis-ci.org/remiprev/teamocil.png?branch=master)](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:
@@ -1,5 +1,5 @@
1
1
  module Teamocil
2
- VERSION = "0.3.8"
2
+ VERSION = "0.3.9"
3
3
  autoload :Layout, "teamocil/layout"
4
4
  autoload :CLI, "teamocil/cli"
5
5
  autoload :Error, "teamocil/error"
@@ -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
@@ -4,6 +4,7 @@ two-windows:
4
4
  - name: "foo"
5
5
  clear: true
6
6
  root: "/foo"
7
+ layout: "tiled"
7
8
  splits:
8
9
  - cmd: "echo 'foo'"
9
10
  - cmd: "echo 'foo again'"
@@ -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.8
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-08-27 00:00:00.000000000Z
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: -4311130867002785670
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: -4311130867002785670
139
+ hash: -2208554246657691212
140
140
  requirements: []
141
141
  rubyforge_project:
142
142
  rubygems_version: 1.8.18