teamocil 0.1.8 → 0.1.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.mkd CHANGED
@@ -1,4 +1,4 @@
1
- ## Introduction
1
+ # Teamocil
2
2
 
3
3
  Teamocil is a tool used to automatically create sessions, windows and splits in `tmux` with Ruby and YAML. Like [tmuxinator](https://github.com/aziz/tmuxinator), but with splits, not just windows.
4
4
 
@@ -12,7 +12,7 @@ Teamocil is a tool used to automatically create sessions, windows and splits in
12
12
 
13
13
  ## Options
14
14
 
15
- * `--here` opens the session from the current window, it doesn’t create an empty first window.
15
+ * `--here` opens the session in the current window, it doesn’t create an empty first window.
16
16
  * `--layout` takes a custom file path to a YAML layout file.
17
17
  * `--edit` opens the layout file (whether or not `--layout` is used) with `$EDITOR`.
18
18
 
@@ -33,6 +33,7 @@ Teamocil is a tool used to automatically create sessions, windows and splits in
33
33
  width: 50
34
34
  - cmd: memcached -p 11211 -vv
35
35
  height: 25
36
+ target: bottom-right
36
37
 
37
38
  Running `$ teamocil sample` will rename the session to `sample-session` and create a new window named `sample-window` with a layout like this:
38
39
 
@@ -48,6 +49,21 @@ Running `$ teamocil sample` will rename the session to `sample-session` and crea
48
49
  | | |
49
50
  '------------------'------------------'
50
51
 
52
+ ## Extras
53
+
54
+ ### Zsh autocompletion
55
+
56
+ To get autocompletion when typing `teamocil <Tab>` in a zsh session, add this line to your `~/.zshrc` file:
57
+
58
+ compctl -g '~/.teamocil/*(:t:r)' teamocil
59
+
51
60
  ## Contributors
52
61
 
62
+ Feel free to contribute and submit pull requests!
63
+
53
64
  * Samuel Garneau ([garno](https://github.com/garno))
65
+ * Jimmy Bourassa ([jbourassa](https://github.com/jbourassa))
66
+
67
+ ## License
68
+
69
+ Teamocil is © 2011 Rémi Prévost and may be freely distributed under the [LITL license](http://litl.info/). See the `LICENSE` file.
data/bin/teamocil CHANGED
@@ -1,15 +1,13 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- def bail(msg)
4
- puts msg
5
- exit(1)
6
- end
3
+ def bail(msg); puts msg; exit(1); end
7
4
 
8
5
  $:.unshift File.join(File.dirname(__FILE__), *%w[.. lib])
9
6
 
10
7
  require 'yaml'
11
8
  require 'teamocil'
12
9
  require 'optparse'
10
+ require 'fileutils'
13
11
 
14
12
  bail "You must be in a tmux session to use teamocil" unless ENV["TMUX"]
15
13
 
@@ -40,11 +38,11 @@ else
40
38
  file = File.join("#{ENV["HOME"]}/.teamocil", "#{ARGV[0]}.yml")
41
39
  end
42
40
 
43
- bail "There is no file \"#{file}\"" unless File.exists?(file)
44
-
45
41
  if options[:edit]
42
+ FileUtils.touch file unless File.exists?(file)
46
43
  system("$EDITOR \"#{file}\"")
47
44
  else
45
+ bail "There is no file \"#{file}\"" unless File.exists?(file)
48
46
  layout = Teamocil::Layout.new(file, options)
49
47
  layout.to_tmux
50
48
  end
data/lib/teamocil.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Teamocil
2
- VERSION = '0.1.8'
2
+ VERSION = '0.1.9'
3
3
  autoload :Layout, "teamocil/layout"
4
4
  end
@@ -34,14 +34,14 @@ module Teamocil
34
34
  window["splits"].each_with_index do |split, index|
35
35
  unless index == 0
36
36
  if split.include?("width")
37
- output << "tmux split-window -h -p #{split["width"]}"
37
+ cmd = "tmux split-window -h -p #{split["width"]}"
38
+ elsif split.include?("height")
39
+ cmd = "tmux split-window -p #{split["height"]}"
38
40
  else
39
- if split.include?("height")
40
- output << "tmux split-window -p #{split["height"]}"
41
- else
42
- output << "tmux split-window"
43
- end
41
+ cmd = "tmux split-window"
44
42
  end
43
+ cmd << " -t #{split["target"]}" if split.include?("target")
44
+ output << cmd
45
45
  end
46
46
 
47
47
  # Support single command splits, but treat it as an array nevertheless
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: teamocil
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 9
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 8
10
- version: 0.1.8
9
+ - 9
10
+ version: 0.1.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - "R\xC3\xA9mi Pr\xC3\xA9vost"
@@ -15,8 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-07-20 00:00:00 -04:00
19
- default_executable:
18
+ date: 2011-09-25 00:00:00 Z
20
19
  dependencies: []
21
20
 
22
21
  description: Teamocil helps you set up window and splits layouts for tmux using YAML configuration files.
@@ -33,7 +32,6 @@ files:
33
32
  - README.mkd
34
33
  - LICENSE
35
34
  - bin/teamocil
36
- has_rdoc: true
37
35
  homepage: http://github.com/remiprev/teamocil
38
36
  licenses: []
39
37
 
@@ -63,7 +61,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
63
61
  requirements: []
64
62
 
65
63
  rubyforge_project:
66
- rubygems_version: 1.3.9.2
64
+ rubygems_version: 1.8.6
67
65
  signing_key:
68
66
  specification_version: 3
69
67
  summary: Easy window and split layouts for tmux