teamocil 0.3.6 → 0.3.7

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -185,6 +185,18 @@ To get autocompletion when typing `teamocil <Tab>` in a zsh session, add this li
185
185
  compctl -g '~/.teamocil/*(:t:r)' teamocil
186
186
  ```
187
187
 
188
+ ### ERB Support
189
+
190
+ You can use ERB in your config files. For example, you can use an environment variable in your config like so:
191
+
192
+ ```yaml
193
+ windows:
194
+ - name: "erb-example"
195
+ root: <%= ENV['MY_PROJECT_ROOT'] %>
196
+ splits:
197
+ - cmd: "pwd"
198
+ ```
199
+
188
200
  ## Todo list
189
201
 
190
202
  * Making sure the layout is valid before executing it (ie. throw exceptions).
data/lib/teamocil.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Teamocil
2
- VERSION = "0.3.6"
2
+ VERSION = "0.3.7"
3
3
  autoload :Layout, "teamocil/layout"
4
4
  autoload :CLI, "teamocil/cli"
5
5
  end
data/lib/teamocil/cli.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require 'optparse'
2
2
  require 'fileutils'
3
+ require 'erb'
3
4
 
4
5
  module Teamocil
5
6
  # This class handles interaction with the `tmux` utility.
@@ -32,7 +33,9 @@ module Teamocil
32
33
  bail "There is no file \"#{file}\"" unless File.exists?(file)
33
34
  bail "You must be in a tmux session to use teamocil" unless env["TMUX"]
34
35
 
35
- @layout = Teamocil::Layout.new(YAML.load_file(file), @options)
36
+ yaml = ERB.new(File.read(file)).result
37
+
38
+ @layout = Teamocil::Layout.new(YAML.load(yaml), @options)
36
39
  @layout.compile!
37
40
  @layout.execute_commands(@layout.generate_commands)
38
41
  end
@@ -2,7 +2,7 @@ session:
2
2
  name: sample
3
3
  root: ~
4
4
  windows:
5
- - name: "foo"
5
+ - name: <%= "foo" %>
6
6
  splits:
7
7
  - cmd: "pwd"
8
8
  - name: "bar"
data/teamocil.gemspec CHANGED
@@ -10,7 +10,8 @@ spec = 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://github.com/remiprev/teamocil"
13
+ s.homepage = "http://remiprev.github.com/teamocil"
14
+ s.license = "MIT"
14
15
  s.summary = "Easy window and split layouts for tmux"
15
16
  s.description = "Teamocil helps you set up window and splits layouts for tmux using YAML configuration files."
16
17
 
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.6
4
+ version: 0.3.7
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-06-14 00:00:00.000000000Z
12
+ date: 2012-06-29 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -111,8 +111,9 @@ files:
111
111
  - spec/mock/layout.rb
112
112
  - spec/spec_helper.rb
113
113
  - teamocil.gemspec
114
- homepage: http://github.com/remiprev/teamocil
115
- licenses: []
114
+ homepage: http://remiprev.github.com/teamocil
115
+ licenses:
116
+ - MIT
116
117
  post_install_message:
117
118
  rdoc_options: []
118
119
  require_paths:
@@ -125,7 +126,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
125
126
  version: '0'
126
127
  segments:
127
128
  - 0
128
- hash: -4479356697983791717
129
+ hash: 2721488511741570961
129
130
  required_rubygems_version: !ruby/object:Gem::Requirement
130
131
  none: false
131
132
  requirements:
@@ -134,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
134
135
  version: '0'
135
136
  segments:
136
137
  - 0
137
- hash: -4479356697983791717
138
+ hash: 2721488511741570961
138
139
  requirements: []
139
140
  rubyforge_project:
140
141
  rubygems_version: 1.8.18