tmuxinator 0.6.6 → 0.6.7.pre
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.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/CHANGELOG.md +13 -0
- data/README.md +10 -4
- data/bin/mux +3 -1
- data/bin/tmuxinator +3 -1
- data/completion/tmuxinator.fish +16 -0
- data/lib/tmuxinator.rb +0 -1
- data/lib/tmuxinator/assets/sample.yml +1 -1
- data/lib/tmuxinator/assets/template.erb +4 -2
- data/lib/tmuxinator/cli.rb +2 -2
- data/lib/tmuxinator/config.rb +9 -1
- data/lib/tmuxinator/deprecations.rb +4 -4
- data/lib/tmuxinator/pane.rb +4 -4
- data/lib/tmuxinator/project.rb +40 -16
- data/lib/tmuxinator/version.rb +1 -1
- data/lib/tmuxinator/window.rb +11 -13
- data/spec/lib/tmuxinator/cli_spec.rb +1 -0
- data/spec/lib/tmuxinator/config_spec.rb +24 -0
- data/spec/lib/tmuxinator/project_spec.rb +18 -2
- data/spec/lib/tmuxinator/window_spec.rb +8 -2
- data/spec/spec_helper.rb +18 -0
- data/tmuxinator.gemspec +0 -1
- metadata +4 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a0870f5819d50ffe7fdb05a0ef0ff333595f3f1
|
4
|
+
data.tar.gz: 49da270a9f8d2e2273d807fb145a044a357c87fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4350985c58776967b0e7ea93f09bba9e4919a15329a83204fd4904c03867759d8ea123aabb93f7911515917efbb49beb38f01001df32e1f31d209b111ad75a4a
|
7
|
+
data.tar.gz: e718531175f294d6fac9a91b8c8d3b2ba6896841fa9f40cc49c99c6337a25e7fe923cd841a74b8f489548f1c14458e17d0cf8d516bc44aa6d0c3368ab7f3010a
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,16 @@
|
|
1
|
+
## 0.6.7
|
2
|
+
- Remove use of grep for base-index #171
|
3
|
+
- Fix bugs in `Tmuxinator::Config.default?` #169
|
4
|
+
- Fix path for Rails log in directory sample #177
|
5
|
+
- Add completions for fish shell #179
|
6
|
+
- Fix grammar in readme #184
|
7
|
+
- Make commands take precedence over project names #182
|
8
|
+
- Improve error messages when $EDITOR isn't set #186, #194
|
9
|
+
- Add confirmation to deletion prompt #197
|
10
|
+
- Fix broken badge references after organisation move
|
11
|
+
- Remove dependancy on ActiveSupport #199
|
12
|
+
- Fix compatability with tmux 1.9
|
13
|
+
|
1
14
|
## 0.6.6
|
2
15
|
- Fix a bug caused by not escaping the root path #145
|
3
16
|
- Fix bash completion with a single argument #148
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Tmuxinator
|
2
2
|
|
3
|
-
[](http://badge.fury.io/rb/tmuxinator) [](http://badge.fury.io/rb/tmuxinator) [](http://travis-ci.org/tmuxinator/tmuxinator?branch=master) [](https://coveralls.io/r/tmuxinator/tmuxinator) [](https://codeclimate.com/github/tmuxinator/tmuxinator) [](https://gemnasium.com/tmuxinator/tmuxinator)
|
4
4
|
|
5
5
|
Create and manage tmux sessions easily.
|
6
6
|
|
@@ -59,6 +59,12 @@ Add the following to your `~/.zshrc`:
|
|
59
59
|
|
60
60
|
source ~/.bin/tmuxinator.zsh
|
61
61
|
|
62
|
+
### fish
|
63
|
+
|
64
|
+
Move `tmuxinator.fish` to your `completions` folder:
|
65
|
+
|
66
|
+
cp ~/.bin/tmuxinator.fish ~/.config/completions/
|
67
|
+
|
62
68
|
## Usage
|
63
69
|
|
64
70
|
A working knowledge of tmux is assumed. You should understand what windows and
|
@@ -104,7 +110,7 @@ windows:
|
|
104
110
|
- vim
|
105
111
|
- guard
|
106
112
|
- server: bundle exec rails s
|
107
|
-
- logs: tail -f
|
113
|
+
- logs: tail -f log/development.log
|
108
114
|
```
|
109
115
|
|
110
116
|
## Windows
|
@@ -150,7 +156,7 @@ These command(s) will run before any subsequent commands in all panes and window
|
|
150
156
|
## Passing directly to send-keys
|
151
157
|
|
152
158
|
tmuxinator passes commands directly to send keys. This differs from simply chaining commands together using `&&` or `;`, in that
|
153
|
-
tmux will directly send the commands to shell as if you typed them in. This allows commands to be executed on a remote server over
|
159
|
+
tmux will directly send the commands to a shell as if you typed them in. This allows commands to be executed on a remote server over
|
154
160
|
SSH for example.
|
155
161
|
|
156
162
|
To support this both the window and pane options can take an array as an argument:
|
@@ -238,7 +244,7 @@ Add `export DISABLE_AUTO_TITLE=true` to your `.zshrc` or `.bashrc`
|
|
238
244
|
|
239
245
|
## Contributing
|
240
246
|
|
241
|
-
To contribute, please read the [contributing guide](https://github.com/
|
247
|
+
To contribute, please read the [contributing guide](https://github.com/tmuxinator/tmuxinator/blob/master/CONTRIBUTING.md).
|
242
248
|
|
243
249
|
## Copyright
|
244
250
|
|
data/bin/mux
CHANGED
@@ -7,7 +7,9 @@ require "tmuxinator"
|
|
7
7
|
if ARGV.length == 1
|
8
8
|
name = ARGV[0]
|
9
9
|
|
10
|
-
if Tmuxinator::
|
10
|
+
if Tmuxinator::Cli.new.command_list.include?(name)
|
11
|
+
Tmuxinator::Cli.start
|
12
|
+
elsif Tmuxinator::Config.exists?(name)
|
11
13
|
Tmuxinator::Cli.new.start(name)
|
12
14
|
else
|
13
15
|
Tmuxinator::Cli.start
|
data/bin/tmuxinator
CHANGED
@@ -7,7 +7,9 @@ require "tmuxinator"
|
|
7
7
|
if ARGV.length == 1
|
8
8
|
name = ARGV[0]
|
9
9
|
|
10
|
-
if Tmuxinator::
|
10
|
+
if Tmuxinator::Cli.new.command_list.include?(name)
|
11
|
+
Tmuxinator::Cli.start
|
12
|
+
elsif Tmuxinator::Config.exists?(name)
|
11
13
|
Tmuxinator::Cli.new.start(name)
|
12
14
|
else
|
13
15
|
Tmuxinator::Cli.start
|
@@ -0,0 +1,16 @@
|
|
1
|
+
function __fish_tmuxinator_using_command
|
2
|
+
set cmd (commandline -opc)
|
3
|
+
if [ (count $cmd) -gt 1 ]
|
4
|
+
if [ $argv[1] = $cmd[2] ]
|
5
|
+
return 0
|
6
|
+
end
|
7
|
+
end
|
8
|
+
return 1
|
9
|
+
end
|
10
|
+
|
11
|
+
complete -f -c tmuxinator -a '(tmuxinator completions start)'
|
12
|
+
complete -f -c tmuxinator -a '(tmuxinator commands)'
|
13
|
+
complete -f -c tmuxinator -n '__fish_tmuxinator_using_command start' -a '(tmuxinator completions start)'
|
14
|
+
complete -f -c tmuxinator -n '__fish_tmuxinator_using_command open' -a '(tmuxinator completions open)'
|
15
|
+
complete -f -c tmuxinator -n '__fish_tmuxinator_using_command copy' -a '(tmuxinator completions copy)'
|
16
|
+
complete -f -c tmuxinator -n '__fish_tmuxinator_using_command delete' -a '(tmuxinator completions delete)'
|
data/lib/tmuxinator.rb
CHANGED
@@ -10,8 +10,10 @@ if [ "$?" -eq 1 ]; then
|
|
10
10
|
# Create the session and the first window.
|
11
11
|
TMUX= <%= tmux %> new-session -d -s <%= name %> -n <%= windows.first.name %>
|
12
12
|
|
13
|
-
|
14
|
-
|
13
|
+
<%- if Tmuxinator::Config.version < 1.7 -%>
|
14
|
+
# Set the default path for versions prior to 1.7
|
15
|
+
<%= tmux %> set-option -t <%= name %> <%= Tmuxinator::Config.default_path_option %> <%= root.shellescape -%> 1>/dev/null
|
16
|
+
<%- end -%>
|
15
17
|
|
16
18
|
# Create other windows.
|
17
19
|
<%- windows.drop(1).each do |window| -%>
|
data/lib/tmuxinator/cli.rb
CHANGED
@@ -40,7 +40,7 @@ module Tmuxinator
|
|
40
40
|
File.open(config, "w") { |f| f.write(erb) }
|
41
41
|
end
|
42
42
|
|
43
|
-
Kernel.system("$EDITOR #{config}")
|
43
|
+
Kernel.system("$EDITOR #{config}") || doctor
|
44
44
|
end
|
45
45
|
|
46
46
|
desc "start [PROJECT]", "Start a tmux session using a project's tmuxinator config"
|
@@ -95,7 +95,7 @@ module Tmuxinator
|
|
95
95
|
if Tmuxinator::Config.exists?(project)
|
96
96
|
config = "#{Tmuxinator::Config.root}/#{project}.yml"
|
97
97
|
|
98
|
-
if yes?("Are you sure you want to delete #{project}?", :red)
|
98
|
+
if yes?("Are you sure you want to delete #{project}?(y/n)", :red)
|
99
99
|
FileUtils.rm(config)
|
100
100
|
say "Deleted #{project}"
|
101
101
|
end
|
data/lib/tmuxinator/config.rb
CHANGED
@@ -15,13 +15,21 @@ module Tmuxinator
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def default?
|
18
|
-
exists?(default)
|
18
|
+
exists?("default")
|
19
19
|
end
|
20
20
|
|
21
21
|
def installed?
|
22
22
|
Kernel.system("which tmux > /dev/null")
|
23
23
|
end
|
24
24
|
|
25
|
+
def version
|
26
|
+
`tmux -V`.split(" ")[1].to_f if installed?
|
27
|
+
end
|
28
|
+
|
29
|
+
def default_path_option
|
30
|
+
version && version < 1.7 ? "default-path" : "-c"
|
31
|
+
end
|
32
|
+
|
25
33
|
def editor?
|
26
34
|
!ENV["EDITOR"].nil? && !ENV["EDITOR"].empty?
|
27
35
|
end
|
@@ -1,19 +1,19 @@
|
|
1
1
|
module Tmuxinator
|
2
2
|
module Deprecations
|
3
3
|
def rvm?
|
4
|
-
yaml["rvm"]
|
4
|
+
yaml["rvm"]
|
5
5
|
end
|
6
6
|
|
7
7
|
def rbenv?
|
8
|
-
yaml["rbenv"]
|
8
|
+
yaml["rbenv"]
|
9
9
|
end
|
10
10
|
|
11
11
|
def pre_tab?
|
12
|
-
yaml["pre_tab"]
|
12
|
+
yaml["pre_tab"]
|
13
13
|
end
|
14
14
|
|
15
15
|
def cli_args?
|
16
|
-
yaml["cli_args"]
|
16
|
+
yaml["cli_args"]
|
17
17
|
end
|
18
18
|
end
|
19
19
|
end
|
data/lib/tmuxinator/pane.rb
CHANGED
@@ -14,15 +14,15 @@ module Tmuxinator
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def tmux_pre_command
|
17
|
-
tab.pre
|
17
|
+
tab.pre ? "#{project.tmux} send-keys -t #{tmux_window_and_pane_target} #{tab.pre.shellescape} C-m" : ""
|
18
18
|
end
|
19
19
|
|
20
20
|
def tmux_pre_window_command
|
21
|
-
project.pre_window
|
21
|
+
project.pre_window ? "#{project.tmux} send-keys -t #{tmux_window_and_pane_target} #{project.pre_window.shellescape} C-m" : ""
|
22
22
|
end
|
23
23
|
|
24
24
|
def tmux_main_command(command)
|
25
|
-
command
|
25
|
+
command ? "#{project.tmux} send-keys -t #{project.name}:#{tab.index + project.base_index}.#{index + tab.project.base_index} #{command.shellescape} C-m" : ""
|
26
26
|
end
|
27
27
|
|
28
28
|
def tmux_split_command
|
@@ -34,7 +34,7 @@ module Tmuxinator
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def multiple_commands?
|
37
|
-
commands
|
37
|
+
commands && commands.length > 0
|
38
38
|
end
|
39
39
|
end
|
40
40
|
end
|
data/lib/tmuxinator/project.rb
CHANGED
@@ -15,7 +15,7 @@ module Tmuxinator
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def windows
|
18
|
-
windows_yml = yaml["tabs"]
|
18
|
+
windows_yml = yaml["tabs"] || yaml["windows"]
|
19
19
|
|
20
20
|
@windows ||= windows_yml.map.with_index do |window_yml, index|
|
21
21
|
Tmuxinator::Window.new(window_yml, index, self)
|
@@ -23,11 +23,11 @@ module Tmuxinator
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def root
|
26
|
-
yaml["project_root"]
|
26
|
+
yaml["project_root"] || File.expand_path(yaml["root"])
|
27
27
|
end
|
28
28
|
|
29
29
|
def name
|
30
|
-
yaml["project_name"].
|
30
|
+
yaml["project_name"] && yaml["project_name"].shellescape || yaml["name"].shellescape
|
31
31
|
end
|
32
32
|
|
33
33
|
def pre
|
@@ -56,13 +56,13 @@ module Tmuxinator
|
|
56
56
|
end
|
57
57
|
|
58
58
|
def tmux_command
|
59
|
-
yaml["tmux_command"]
|
59
|
+
yaml["tmux_command"] || "tmux"
|
60
60
|
end
|
61
61
|
|
62
62
|
def socket
|
63
|
-
if socket_path
|
63
|
+
if socket_path
|
64
64
|
" -S #{socket_path}"
|
65
|
-
elsif socket_name
|
65
|
+
elsif socket_name
|
66
66
|
" -L #{socket_name}"
|
67
67
|
else
|
68
68
|
nil
|
@@ -88,11 +88,11 @@ module Tmuxinator
|
|
88
88
|
end
|
89
89
|
|
90
90
|
def base_index
|
91
|
-
get_pane_base_index
|
91
|
+
get_pane_base_index ? get_pane_base_index.to_i : get_base_index.to_i
|
92
92
|
end
|
93
93
|
|
94
94
|
def tmux_options?
|
95
|
-
yaml["tmux_options"]
|
95
|
+
yaml["tmux_options"]
|
96
96
|
end
|
97
97
|
|
98
98
|
def windows?
|
@@ -100,11 +100,11 @@ module Tmuxinator
|
|
100
100
|
end
|
101
101
|
|
102
102
|
def root?
|
103
|
-
root.
|
103
|
+
!root.nil?
|
104
104
|
end
|
105
105
|
|
106
106
|
def name?
|
107
|
-
name.
|
107
|
+
!name.nil?
|
108
108
|
end
|
109
109
|
|
110
110
|
def window(i)
|
@@ -112,7 +112,7 @@ module Tmuxinator
|
|
112
112
|
end
|
113
113
|
|
114
114
|
def send_pane_command(cmd, window_index, pane_index)
|
115
|
-
if cmd.
|
115
|
+
if cmd.empty?
|
116
116
|
""
|
117
117
|
else
|
118
118
|
"#{tmux} send-keys -t #{window(window_index)} #{cmd.shellescape} C-m"
|
@@ -120,7 +120,7 @@ module Tmuxinator
|
|
120
120
|
end
|
121
121
|
|
122
122
|
def send_keys(cmd, window_index)
|
123
|
-
if cmd.
|
123
|
+
if cmd.empty?
|
124
124
|
""
|
125
125
|
else
|
126
126
|
"#{tmux} send-keys -t #{window(window_index)} #{cmd.shellescape} C-m"
|
@@ -130,17 +130,41 @@ module Tmuxinator
|
|
130
130
|
def deprecations
|
131
131
|
deprecations = []
|
132
132
|
deprecations << "DEPRECATION: rbenv/rvm specific options have been replaced by the pre_tab option and will not be supported in 0.8.0." if yaml["rbenv"] || yaml["rvm"]
|
133
|
-
deprecations << "DEPRECATION: The tabs option has been replaced by the windows option and will not be supported in 0.8.0." if yaml["tabs"]
|
134
|
-
deprecations << "DEPRECATION: The cli_args option has been replaced by the tmux_options option and will not be supported in 0.8.0." if yaml["cli_args"]
|
133
|
+
deprecations << "DEPRECATION: The tabs option has been replaced by the windows option and will not be supported in 0.8.0." if yaml["tabs"]
|
134
|
+
deprecations << "DEPRECATION: The cli_args option has been replaced by the tmux_options option and will not be supported in 0.8.0." if yaml["cli_args"]
|
135
135
|
deprecations
|
136
136
|
end
|
137
137
|
|
138
138
|
def get_pane_base_index
|
139
|
-
|
139
|
+
tmux_config["pane-base-index"]
|
140
140
|
end
|
141
141
|
|
142
142
|
def get_base_index
|
143
|
-
|
143
|
+
tmux_config["base-index"]
|
144
|
+
end
|
145
|
+
|
146
|
+
def show_tmux_options
|
147
|
+
"#{tmux} start-server\\; show-option -g"
|
148
|
+
end
|
149
|
+
|
150
|
+
private
|
151
|
+
|
152
|
+
def tmux_config
|
153
|
+
@tmux_config ||= extract_tmux_config
|
154
|
+
end
|
155
|
+
|
156
|
+
def extract_tmux_config
|
157
|
+
options_hash = {}
|
158
|
+
|
159
|
+
options_string = `#{show_tmux_options}`
|
160
|
+
|
161
|
+
options_string.split("\n").map do |entry|
|
162
|
+
key, value = entry.split("\s")
|
163
|
+
options_hash[key] = value
|
164
|
+
options_hash
|
165
|
+
end
|
166
|
+
|
167
|
+
options_hash
|
144
168
|
end
|
145
169
|
end
|
146
170
|
end
|
data/lib/tmuxinator/version.rb
CHANGED
data/lib/tmuxinator/window.rb
CHANGED
@@ -5,7 +5,7 @@ module Tmuxinator
|
|
5
5
|
attr_reader :name, :panes, :layout, :commands, :index, :project
|
6
6
|
|
7
7
|
def initialize(window_yaml, index, project)
|
8
|
-
@name = window_yaml.keys.first.
|
8
|
+
@name = !window_yaml.keys.first.nil? ? window_yaml.keys.first.shellescape : nil
|
9
9
|
@panes = []
|
10
10
|
@layout = nil
|
11
11
|
@pre = nil
|
@@ -15,8 +15,8 @@ module Tmuxinator
|
|
15
15
|
value = window_yaml.values.first
|
16
16
|
|
17
17
|
if value.is_a?(Hash)
|
18
|
-
@layout = value["layout"]
|
19
|
-
@pre = value["pre"] if value["pre"]
|
18
|
+
@layout = value["layout"] ? value["layout"].shellescape : nil
|
19
|
+
@pre = value["pre"] if value["pre"]
|
20
20
|
|
21
21
|
@panes = build_panes(value["panes"])
|
22
22
|
else
|
@@ -39,9 +39,9 @@ module Tmuxinator
|
|
39
39
|
def build_commands(prefix, command_yml)
|
40
40
|
if command_yml.is_a?(Array)
|
41
41
|
command_yml.map do |command|
|
42
|
-
"#{tmux_window_command_prefix} #{command.shellescape} C-m" if command
|
42
|
+
"#{tmux_window_command_prefix} #{command.shellescape} C-m" if command
|
43
43
|
end.compact
|
44
|
-
elsif command_yml.
|
44
|
+
elsif command_yml.is_a?(String) && !command_yml.empty?
|
45
45
|
["#{tmux_window_command_prefix} #{command_yml.shellescape} C-m"]
|
46
46
|
else
|
47
47
|
[]
|
@@ -49,12 +49,10 @@ module Tmuxinator
|
|
49
49
|
end
|
50
50
|
|
51
51
|
def pre
|
52
|
-
if @pre.
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
@pre
|
57
|
-
end
|
52
|
+
if @pre.is_a?(Array)
|
53
|
+
@pre.join(" && ")
|
54
|
+
elsif @pre.is_a?(String)
|
55
|
+
@pre
|
58
56
|
else
|
59
57
|
""
|
60
58
|
end
|
@@ -69,7 +67,7 @@ module Tmuxinator
|
|
69
67
|
end
|
70
68
|
|
71
69
|
def tmux_pre_window_command
|
72
|
-
project.pre_window
|
70
|
+
project.pre_window ? "#{project.tmux} send-keys -t #{tmux_window_target} #{project.pre_window.shellescape} C-m" : ""
|
73
71
|
end
|
74
72
|
|
75
73
|
def tmux_window_command_prefix
|
@@ -77,7 +75,7 @@ module Tmuxinator
|
|
77
75
|
end
|
78
76
|
|
79
77
|
def tmux_new_window_command
|
80
|
-
"#{project.tmux} new-window
|
78
|
+
"#{project.tmux} new-window #{Tmuxinator::Config.default_path_option} #{File.expand_path(project.root).shellescape} -t #{tmux_window_target} -n #{name}"
|
81
79
|
end
|
82
80
|
|
83
81
|
def tmux_layout_command
|
@@ -19,6 +19,30 @@ describe Tmuxinator::Config do
|
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
|
+
describe "#default?" do
|
23
|
+
let(:root) { Tmuxinator::Config.root }
|
24
|
+
|
25
|
+
context "when the file exists" do
|
26
|
+
before do
|
27
|
+
File.stub(:exists?).with(Tmuxinator::Config.default) { true }
|
28
|
+
end
|
29
|
+
|
30
|
+
it "returns true" do
|
31
|
+
expect(Tmuxinator::Config.default?).to be_true
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
context "when the file doesn't exist" do
|
36
|
+
before do
|
37
|
+
File.stub(:exists?).with(Tmuxinator::Config.default) { false }
|
38
|
+
end
|
39
|
+
|
40
|
+
it "returns true" do
|
41
|
+
expect(Tmuxinator::Config.default?).to be_false
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
22
46
|
describe "#configs" do
|
23
47
|
before do
|
24
48
|
Dir.stub(:[] => ["test.yml"])
|
@@ -35,13 +35,13 @@ describe Tmuxinator::Project do
|
|
35
35
|
describe "#root" do
|
36
36
|
context "without deprecations" do
|
37
37
|
it "gets the root" do
|
38
|
-
expect(project.root).to
|
38
|
+
expect(project.root).to include("test")
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
42
42
|
context "with deprecations" do
|
43
43
|
it "still gets the root" do
|
44
|
-
expect(project_with_deprecations.root).to
|
44
|
+
expect(project_with_deprecations.root).to include("test")
|
45
45
|
end
|
46
46
|
end
|
47
47
|
end
|
@@ -153,6 +153,22 @@ describe Tmuxinator::Project do
|
|
153
153
|
end
|
154
154
|
end
|
155
155
|
|
156
|
+
describe "#get_pane_base_index" do
|
157
|
+
it "extracts the pane_base_index from tmux_options" do
|
158
|
+
project.stub(show_tmux_options: tmux_config(pane_base_index: 3))
|
159
|
+
|
160
|
+
expect(project.get_pane_base_index).to eq("3")
|
161
|
+
end
|
162
|
+
end
|
163
|
+
|
164
|
+
describe "#get_base_index" do
|
165
|
+
it "extracts the base index from options" do
|
166
|
+
project.stub(show_tmux_options: tmux_config(base_index: 1))
|
167
|
+
|
168
|
+
expect(project.get_base_index).to eq("1")
|
169
|
+
end
|
170
|
+
end
|
171
|
+
|
156
172
|
describe "#base_index" do
|
157
173
|
context "pane base index present" do
|
158
174
|
before do
|
@@ -140,8 +140,14 @@ describe Tmuxinator::Window do
|
|
140
140
|
)
|
141
141
|
end
|
142
142
|
|
143
|
-
|
144
|
-
|
143
|
+
context "tmux 1.6 and below" do
|
144
|
+
before do
|
145
|
+
Tmuxinator::Config.stub(:version => 1.6)
|
146
|
+
end
|
147
|
+
|
148
|
+
it "specifies root path by passing default-path to tmux" do
|
149
|
+
expect(window.tmux_new_window_command).to include("default-path /project/tmuxinator")
|
150
|
+
end
|
145
151
|
end
|
146
152
|
end
|
147
153
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -34,3 +34,21 @@ ensure
|
|
34
34
|
$stdout = orig_stdout
|
35
35
|
$stderr = orig_stderr
|
36
36
|
end
|
37
|
+
|
38
|
+
def tmux_config(options = {})
|
39
|
+
standard_options = [
|
40
|
+
"assume-paste-time 1",
|
41
|
+
"bell-action any",
|
42
|
+
"bell-on-alert off",
|
43
|
+
]
|
44
|
+
|
45
|
+
if base_index = options.fetch(:base_index) {1}
|
46
|
+
standard_options << "base-index #{base_index}"
|
47
|
+
end
|
48
|
+
|
49
|
+
if pane_base_index = options.fetch(:pane_base_index) {1}
|
50
|
+
standard_options << "pane-base-index #{pane_base_index}"
|
51
|
+
end
|
52
|
+
|
53
|
+
"echo '#{standard_options.join("\n")}'"
|
54
|
+
end
|
data/tmuxinator.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tmuxinator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.7.pre
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Allen Bargi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-02-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -24,20 +24,6 @@ dependencies:
|
|
24
24
|
- - '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 0.18.0
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: activesupport
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - '>='
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - '>='
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: erubis
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -185,6 +171,7 @@ files:
|
|
185
171
|
- bin/mux
|
186
172
|
- bin/tmuxinator
|
187
173
|
- completion/tmuxinator.bash
|
174
|
+
- completion/tmuxinator.fish
|
188
175
|
- completion/tmuxinator.zsh
|
189
176
|
- lib/tmuxinator.rb
|
190
177
|
- lib/tmuxinator/assets/sample.yml
|
@@ -233,7 +220,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
233
220
|
version: 1.8.23
|
234
221
|
requirements: []
|
235
222
|
rubyforge_project:
|
236
|
-
rubygems_version: 2.
|
223
|
+
rubygems_version: 2.2.2
|
237
224
|
signing_key:
|
238
225
|
specification_version: 4
|
239
226
|
summary: Create and manage complex tmux sessions easily.
|