teamocil 0.3.5 → 0.3.6
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 +5 -5
- data/lib/teamocil.rb +1 -1
- data/lib/teamocil/cli.rb +1 -1
- data/spec/cli_spec.rb +10 -0
- data/spec/fixtures/.my-fancy-layouts-directory/sample-3.yml +10 -0
- metadata +6 -4
data/README.md
CHANGED
@@ -1,8 +1,7 @@
|
|
1
|
-
# 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
|
-
[](http://travis-ci.org/remiprev/teamocil)
|
6
5
|
|
7
6
|
## Usage
|
8
7
|
|
@@ -16,14 +15,15 @@ $ teamocil sample
|
|
16
15
|
|
17
16
|
## Options
|
18
17
|
|
19
|
-
* `--here` opens the session in the current window,
|
18
|
+
* `--here` opens the session in the current window, do not create an empty first window.
|
20
19
|
* `--layout` takes a custom file path to a YAML layout file.
|
21
20
|
* `--edit` opens the layout file (whether or not `--layout` is used) with `$EDITOR`.
|
22
|
-
* `--list` lists all available layouts
|
21
|
+
* `--list` lists all available layouts in `./.teamocil` or `$TEAMOCIL_PATH`.
|
22
|
+
* `--show` show the layout content instead of executing it.
|
23
23
|
|
24
24
|
## Layout file structure
|
25
25
|
|
26
|
-
A layout file is a single YAML file located in `~/.teamocil` (eg. `~/.teamocil/my-project.yml`).
|
26
|
+
A layout file is a single YAML file located in `~/.teamocil` or `$TEAMOCIL_PATH` (eg. `~/.teamocil/my-project.yml`).
|
27
27
|
|
28
28
|
### Session
|
29
29
|
|
data/lib/teamocil.rb
CHANGED
data/lib/teamocil/cli.rb
CHANGED
@@ -13,7 +13,7 @@ module Teamocil
|
|
13
13
|
# @param env [Hash] the environment variables hash (usually `ENV`).
|
14
14
|
def initialize(argv, env) # {{{
|
15
15
|
parse_options! argv
|
16
|
-
layout_path = File.join("#{env["HOME"]}", ".teamocil")
|
16
|
+
layout_path = env["TEAMOCIL_PATH"] || File.join("#{env["HOME"]}", ".teamocil")
|
17
17
|
|
18
18
|
if @options.include?(:list)
|
19
19
|
@layouts = get_layouts(layout_path)
|
data/spec/cli_spec.rb
CHANGED
@@ -62,6 +62,16 @@ describe Teamocil::CLI do
|
|
62
62
|
Teamocil::CLI.new(["--show", "sample"], @fake_env)
|
63
63
|
end # }}}
|
64
64
|
|
65
|
+
it "looks only in the $TEAMOCIL_PATH environment variable for layouts" do # {{{
|
66
|
+
@fake_env = { "TMUX" => 1, "HOME" => File.join(File.dirname(__FILE__), "fixtures"), "TEAMOCIL_PATH" => File.join(File.dirname(__FILE__), "fixtures/.my-fancy-layouts-directory") }
|
67
|
+
|
68
|
+
@cli = Teamocil::CLI.new(["sample-3"], @fake_env)
|
69
|
+
@cli.layout.session.name.should == "sample-3"
|
70
|
+
|
71
|
+
lambda { @cli = Teamocil::CLI.new(["sample"], @fake_env) }.should raise_error SystemExit
|
72
|
+
Teamocil::CLI.messages.should include("There is no file \"#{@fake_env["TEAMOCIL_PATH"]}/sample.yml\"")
|
73
|
+
end # }}}
|
74
|
+
|
65
75
|
end
|
66
76
|
|
67
77
|
end
|
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.6
|
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-06-14 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -102,6 +102,7 @@ files:
|
|
102
102
|
- lib/teamocil/layout/split.rb
|
103
103
|
- lib/teamocil/layout/window.rb
|
104
104
|
- spec/cli_spec.rb
|
105
|
+
- spec/fixtures/.my-fancy-layouts-directory/sample-3.yml
|
105
106
|
- spec/fixtures/.teamocil/sample-2.yml
|
106
107
|
- spec/fixtures/.teamocil/sample.yml
|
107
108
|
- spec/fixtures/layouts.yml
|
@@ -124,7 +125,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
124
125
|
version: '0'
|
125
126
|
segments:
|
126
127
|
- 0
|
127
|
-
hash:
|
128
|
+
hash: -4479356697983791717
|
128
129
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
129
130
|
none: false
|
130
131
|
requirements:
|
@@ -133,7 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
133
134
|
version: '0'
|
134
135
|
segments:
|
135
136
|
- 0
|
136
|
-
hash:
|
137
|
+
hash: -4479356697983791717
|
137
138
|
requirements: []
|
138
139
|
rubyforge_project:
|
139
140
|
rubygems_version: 1.8.18
|
@@ -142,6 +143,7 @@ specification_version: 3
|
|
142
143
|
summary: Easy window and split layouts for tmux
|
143
144
|
test_files:
|
144
145
|
- spec/cli_spec.rb
|
146
|
+
- spec/fixtures/.my-fancy-layouts-directory/sample-3.yml
|
145
147
|
- spec/fixtures/.teamocil/sample-2.yml
|
146
148
|
- spec/fixtures/.teamocil/sample.yml
|
147
149
|
- spec/fixtures/layouts.yml
|