tmuxinator 0.6.11.pre → 0.6.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/completion/mux.fish +22 -0
- data/completion/tmuxinator.bash +24 -0
- data/completion/tmuxinator.fish +22 -0
- data/completion/tmuxinator.zsh +30 -0
- data/lib/tmuxinator/assets/sample.yml +6 -0
- data/lib/tmuxinator/assets/template.erb +37 -27
- data/lib/tmuxinator/cli.rb +6 -6
- data/lib/tmuxinator/config.rb +5 -5
- data/lib/tmuxinator/pane.rb +7 -3
- data/lib/tmuxinator/project.rb +26 -4
- data/lib/tmuxinator/version.rb +1 -1
- data/lib/tmuxinator/window.rb +3 -3
- data/spec/factories/projects.rb +16 -0
- data/spec/fixtures/noname.yml +6 -0
- data/spec/lib/tmuxinator/cli_spec.rb +24 -0
- data/spec/lib/tmuxinator/config_spec.rb +22 -0
- data/spec/lib/tmuxinator/project_spec.rb +23 -0
- data/spec/lib/tmuxinator/window_spec.rb +2 -3
- metadata +10 -102
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 38f09af10a658caa15c32d1abe77373cc9e2d960
|
4
|
+
data.tar.gz: 8a17b9b5cf0de202edb22ead61cd148462e4a8fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7fba40c695a6406361c67fc0275a2706577bce38b86e1b37d4a6311fac8957d9212aba70ca93c3b52150e7ec77a45cf52b2da030781f82fe2fa8c57dec694440
|
7
|
+
data.tar.gz: 6e39fbf6bcb98e0e7deac36693b931c1f1ff0fc024e7a6f0425bdb0c5345e2b59965511923ed8b37a0b2530604803dfc76a690d0da8463ed26e1201dc26b5db5
|
data/completion/mux.fish
ADDED
@@ -0,0 +1,22 @@
|
|
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
|
+
set __fish_tmuxinator_program_cmd (commandline -o)[1]
|
12
|
+
|
13
|
+
function __fish_tmuxinator_program
|
14
|
+
eval "$__fish_tmuxinator_program_cmd $argv"
|
15
|
+
end
|
16
|
+
|
17
|
+
complete -f -c $__fish_tmuxinator_program_cmd -a '(__fish_tmuxinator_program completions start)'
|
18
|
+
complete -f -c $__fish_tmuxinator_program_cmd -n '__fish_use_subcommand' -x -a "(__fish_tmuxinator_program commands)"
|
19
|
+
complete -f -c $__fish_tmuxinator_program_cmd -n '__fish_tmuxinator_using_command start' -a "(__fish_tmuxinator_program completions start)"
|
20
|
+
complete -f -c $__fish_tmuxinator_program_cmd -n '__fish_tmuxinator_using_command open' -a "(__fish_tmuxinator_program completions open)"
|
21
|
+
complete -f -c $__fish_tmuxinator_program_cmd -n '__fish_tmuxinator_using_command copy' -a "(__fish_tmuxinator_program completions copy)"
|
22
|
+
complete -f -c $__fish_tmuxinator_program_cmd -n '__fish_tmuxinator_using_command delete' -a "(__fish_tmuxinator_program completions delete)"
|
@@ -0,0 +1,24 @@
|
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
|
3
|
+
_tmuxinator() {
|
4
|
+
COMPREPLY=()
|
5
|
+
local word
|
6
|
+
word="${COMP_WORDS[COMP_CWORD]}"
|
7
|
+
|
8
|
+
if [ "$COMP_CWORD" -eq 1 ]; then
|
9
|
+
local commands="$(compgen -W "$(tmuxinator commands)" -- "$word")"
|
10
|
+
local projects="$(compgen -W "$(tmuxinator completions start)" -- "$word")"
|
11
|
+
|
12
|
+
COMPREPLY=( $commands $projects )
|
13
|
+
elif [ "$COMP_CWORD" -eq 2 ]; then
|
14
|
+
local words
|
15
|
+
words=("${COMP_WORDS[@]}")
|
16
|
+
unset words[0]
|
17
|
+
unset words[$COMP_CWORD]
|
18
|
+
local completions
|
19
|
+
completions=$(tmuxinator completions "${words[@]}")
|
20
|
+
COMPREPLY=( $(compgen -W "$completions" -- "$word") )
|
21
|
+
fi
|
22
|
+
}
|
23
|
+
|
24
|
+
complete -F _tmuxinator tmuxinator mux
|
@@ -0,0 +1,22 @@
|
|
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
|
+
set __fish_tmuxinator_program_cmd (commandline -o)[1]
|
12
|
+
|
13
|
+
function __fish_tmuxinator_program
|
14
|
+
eval "$__fish_tmuxinator_program_cmd $argv"
|
15
|
+
end
|
16
|
+
|
17
|
+
complete -f -c $__fish_tmuxinator_program_cmd -a '(__fish_tmuxinator_program completions start)'
|
18
|
+
complete -f -c $__fish_tmuxinator_program_cmd -n '__fish_use_subcommand' -x -a "(__fish_tmuxinator_program commands)"
|
19
|
+
complete -f -c $__fish_tmuxinator_program_cmd -n '__fish_tmuxinator_using_command start' -a "(__fish_tmuxinator_program completions start)"
|
20
|
+
complete -f -c $__fish_tmuxinator_program_cmd -n '__fish_tmuxinator_using_command open' -a "(__fish_tmuxinator_program completions open)"
|
21
|
+
complete -f -c $__fish_tmuxinator_program_cmd -n '__fish_tmuxinator_using_command copy' -a "(__fish_tmuxinator_program completions copy)"
|
22
|
+
complete -f -c $__fish_tmuxinator_program_cmd -n '__fish_tmuxinator_using_command delete' -a "(__fish_tmuxinator_program completions delete)"
|
@@ -0,0 +1,30 @@
|
|
1
|
+
#compdef tmuxinator mux
|
2
|
+
|
3
|
+
_tmuxinator() {
|
4
|
+
local commands projects
|
5
|
+
commands=(${(f)"$(tmuxinator commands zsh)"})
|
6
|
+
projects=(${(f)"$(tmuxinator completions start)"})
|
7
|
+
|
8
|
+
if (( CURRENT == 2 )); then
|
9
|
+
_describe -t commands "tmuxinator subcommands" commands
|
10
|
+
_describe -t projects "tmuxinator projects" projects
|
11
|
+
elif (( CURRENT == 3)); then
|
12
|
+
case $words[2] in
|
13
|
+
copy|debug|delete|open|start)
|
14
|
+
_arguments '*:projects:($projects)'
|
15
|
+
;;
|
16
|
+
esac
|
17
|
+
fi
|
18
|
+
|
19
|
+
return
|
20
|
+
}
|
21
|
+
|
22
|
+
_tmuxinator
|
23
|
+
|
24
|
+
# Local Variables:
|
25
|
+
# mode: Shell-Script
|
26
|
+
# sh-indentation: 2
|
27
|
+
# indent-tabs-mode: nil
|
28
|
+
# sh-basic-offset: 2
|
29
|
+
# End:
|
30
|
+
# vim: ft=zsh sw=2 ts=2 et
|
@@ -21,6 +21,12 @@ root: ~/
|
|
21
21
|
# Specifies (by name or index) which window will be selected on project startup. If not set, the first window is used.
|
22
22
|
# startup_window: logs
|
23
23
|
|
24
|
+
# Controls whether the tmux session should be attached to automatically. Defaults to true.
|
25
|
+
# attach: false
|
26
|
+
|
27
|
+
# Runs after everything. Use it to attach to tmux with custom options etc.
|
28
|
+
# post: tmux -CC attach -t <%= name %>
|
29
|
+
|
24
30
|
windows:
|
25
31
|
- editor:
|
26
32
|
layout: main-vertical
|
@@ -12,60 +12,70 @@ if [ "$?" -eq 1 ]; then
|
|
12
12
|
# Run pre command.
|
13
13
|
<%= pre %>
|
14
14
|
|
15
|
-
# Create the session and the first window.
|
16
|
-
|
17
|
-
TMUX= <%= tmux %> new-session -d -s <%= name %> -n <%= windows.first.name %> <%= Tmuxinator::Config.default_path_option %> <%= windows.first.root %>
|
18
|
-
<%- else -%>
|
15
|
+
# Create the session and the first window. Manually switch to root
|
16
|
+
# directory if required to support tmux < 1.9
|
19
17
|
TMUX= <%= tmux %> new-session -d -s <%= name %> -n <%= windows.first.name %>
|
20
|
-
|
18
|
+
<% if windows.first.root? %>
|
19
|
+
<%= windows.first.tmux_window_command_prefix %> <%= "cd #{windows.first.root}".shellescape %> C-m
|
20
|
+
<% end %>
|
21
21
|
|
22
|
-
|
22
|
+
<% if Tmuxinator::Config.version < 1.7 %>
|
23
23
|
# Set the default path for versions prior to 1.7
|
24
|
-
|
24
|
+
<% if root? %>
|
25
25
|
<%= tmux %> set-option -t <%= name %> <%= Tmuxinator::Config.default_path_option %> <%= root -%> 1>/dev/null
|
26
|
-
|
27
|
-
|
26
|
+
<% end %>
|
27
|
+
<% end %>
|
28
28
|
|
29
29
|
# Create other windows.
|
30
|
-
|
30
|
+
<% windows.drop(1).each do |window| %>
|
31
31
|
<%= window.tmux_new_window_command %>
|
32
|
-
|
32
|
+
<% end %>
|
33
33
|
|
34
|
-
|
34
|
+
<% windows.each do |window| %>
|
35
35
|
|
36
36
|
# Window "<%= window.name %>"
|
37
|
-
|
37
|
+
<% unless window.panes? %>
|
38
|
+
<% if window.project.pre_window %>
|
38
39
|
<%= window.tmux_pre_window_command %>
|
39
|
-
|
40
|
+
<% end %>
|
41
|
+
<% window.commands.each do |command| %>
|
40
42
|
<%= command %>
|
41
|
-
|
42
|
-
|
43
|
-
|
43
|
+
<% end %>
|
44
|
+
<% else %>
|
45
|
+
<% window.panes.each do |pane| %>
|
46
|
+
<% if pane.project.pre_window %>
|
44
47
|
<%= pane.tmux_pre_window_command %>
|
48
|
+
<% end %>
|
49
|
+
<% if pane.tab.pre %>
|
45
50
|
<%= pane.tmux_pre_command %>
|
46
|
-
|
47
|
-
|
51
|
+
<% end %>
|
52
|
+
<% if pane.multiple_commands? %>
|
53
|
+
<% pane.commands.each do |command| %>
|
48
54
|
<%= pane.tmux_main_command(command) %>
|
49
|
-
|
50
|
-
|
55
|
+
<% end %>
|
56
|
+
<% else %>
|
51
57
|
<%= pane.tmux_main_command(commands.first) %>
|
52
|
-
|
58
|
+
<% end %>
|
53
59
|
|
54
|
-
|
60
|
+
<% unless pane.last? %>
|
55
61
|
<%= pane.tmux_split_command %>
|
56
|
-
|
62
|
+
<% end %>
|
57
63
|
<%= window.tmux_layout_command %>
|
58
|
-
|
64
|
+
<% end %>
|
59
65
|
|
60
66
|
<%= window.tmux_select_first_pane %>
|
61
|
-
|
62
|
-
|
67
|
+
<% end %>
|
68
|
+
<% end %>
|
63
69
|
|
64
70
|
<%= tmux %> select-window -t <%= startup_window %>
|
65
71
|
fi
|
66
72
|
|
73
|
+
<%- if attach? -%>
|
67
74
|
if [ -z "$TMUX" ]; then
|
68
75
|
<%= tmux %> -u attach-session -t <%= name %>
|
69
76
|
else
|
70
77
|
<%= tmux %> -u switch-client -t <%= name %>
|
71
78
|
fi
|
79
|
+
<%- end -%>
|
80
|
+
|
81
|
+
<%= post %>
|
data/lib/tmuxinator/cli.rb
CHANGED
@@ -7,7 +7,7 @@ module Tmuxinator
|
|
7
7
|
completions: "Used for shell completion",
|
8
8
|
new: "Create a new project file and open it in your editor",
|
9
9
|
open: "Alias of new",
|
10
|
-
start: "Start a tmux session using a project's tmuxinator config",
|
10
|
+
start: "Start a tmux session using a project's tmuxinator config, with an optional [ALIAS] for project reuse",
|
11
11
|
debug: "Output the shell commands that are generated by tmuxinator",
|
12
12
|
copy: "Copy an existing project to a new project and open it in your editor",
|
13
13
|
delete: "Deletes given project",
|
@@ -61,11 +61,11 @@ module Tmuxinator
|
|
61
61
|
Kernel.system("$EDITOR #{config}") || doctor
|
62
62
|
end
|
63
63
|
|
64
|
-
desc "start [PROJECT]", COMMANDS[:start]
|
64
|
+
desc "start [PROJECT] [SESSION_NAME]", COMMANDS[:start]
|
65
65
|
map "s" => :start
|
66
66
|
|
67
|
-
def start(name)
|
68
|
-
project = Tmuxinator::Config.validate(name)
|
67
|
+
def start(name, custom_name = nil)
|
68
|
+
project = Tmuxinator::Config.validate(name, custom_name )
|
69
69
|
|
70
70
|
if project.deprecations.any?
|
71
71
|
project.deprecations.each { |deprecation| say deprecation, :red }
|
@@ -79,8 +79,8 @@ module Tmuxinator
|
|
79
79
|
|
80
80
|
desc "debug [PROJECT]", COMMANDS[:debug]
|
81
81
|
|
82
|
-
def debug(name)
|
83
|
-
project = Tmuxinator::Config.validate(name)
|
82
|
+
def debug(name, custom_name = nil)
|
83
|
+
project = Tmuxinator::Config.validate(name, custom_name )
|
84
84
|
puts project.render
|
85
85
|
end
|
86
86
|
|
data/lib/tmuxinator/config.rb
CHANGED
@@ -27,7 +27,7 @@ module Tmuxinator
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def default_path_option
|
30
|
-
version && version
|
30
|
+
version && version < 1.8 ? "default-path" : "-c"
|
31
31
|
end
|
32
32
|
|
33
33
|
def editor?
|
@@ -57,12 +57,12 @@ module Tmuxinator
|
|
57
57
|
end
|
58
58
|
|
59
59
|
def configs
|
60
|
-
Dir["#{Tmuxinator::Config.root}
|
61
|
-
|
60
|
+
Dir["#{Tmuxinator::Config.root}/**/*.yml"].sort.map do |path|
|
61
|
+
path.gsub("#{Tmuxinator::Config.root}/", "").gsub(".yml", "")
|
62
62
|
end
|
63
63
|
end
|
64
64
|
|
65
|
-
def validate(name)
|
65
|
+
def validate(name, custom_name = nil)
|
66
66
|
unless Tmuxinator::Config.exists?(name)
|
67
67
|
puts "Project #{name} doesn't exist."
|
68
68
|
exit!
|
@@ -77,7 +77,7 @@ module Tmuxinator
|
|
77
77
|
exit!
|
78
78
|
end
|
79
79
|
|
80
|
-
project = Tmuxinator::Project.new(yaml)
|
80
|
+
project = Tmuxinator::Project.new(yaml, custom_name)
|
81
81
|
|
82
82
|
unless project.windows?
|
83
83
|
puts "Your project file should include some windows."
|
data/lib/tmuxinator/pane.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module Tmuxinator
|
2
2
|
class Pane
|
3
|
-
attr_reader :commands, :project, :index, :
|
3
|
+
attr_reader :commands, :project, :index, :tab
|
4
4
|
|
5
5
|
def initialize(index, project, tab, *commands)
|
6
6
|
@commands = commands
|
@@ -14,11 +14,15 @@ module Tmuxinator
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def tmux_pre_command
|
17
|
-
|
17
|
+
return unless tab.pre
|
18
|
+
|
19
|
+
"#{project.tmux} send-keys -t #{tmux_window_and_pane_target} #{tab.pre.shellescape} C-m"
|
18
20
|
end
|
19
21
|
|
20
22
|
def tmux_pre_window_command
|
21
|
-
|
23
|
+
return unless project.pre_window
|
24
|
+
|
25
|
+
"#{project.tmux} send-keys -t #{tmux_window_and_pane_target} #{project.pre_window.shellescape} C-m"
|
22
26
|
end
|
23
27
|
|
24
28
|
def tmux_main_command(command)
|
data/lib/tmuxinator/project.rb
CHANGED
@@ -4,10 +4,11 @@ module Tmuxinator
|
|
4
4
|
include Tmuxinator::Deprecations
|
5
5
|
include Tmuxinator::WemuxSupport
|
6
6
|
|
7
|
-
attr_reader :yaml
|
7
|
+
attr_reader :yaml, :custom_name
|
8
8
|
|
9
|
-
def initialize(yaml)
|
9
|
+
def initialize(yaml, custom_name = nil)
|
10
10
|
@yaml = yaml
|
11
|
+
@custom_name = custom_name
|
11
12
|
load_wemux_overrides if wemux?
|
12
13
|
end
|
13
14
|
|
@@ -30,8 +31,8 @@ module Tmuxinator
|
|
30
31
|
end
|
31
32
|
|
32
33
|
def name
|
33
|
-
name = yaml["project_name"] || yaml["name"]
|
34
|
-
name.shellescape
|
34
|
+
name = custom_name || yaml["project_name"] || yaml["name"]
|
35
|
+
name.blank? ? nil : name.shellescape
|
35
36
|
end
|
36
37
|
|
37
38
|
def pre
|
@@ -55,6 +56,23 @@ module Tmuxinator
|
|
55
56
|
end
|
56
57
|
end
|
57
58
|
|
59
|
+
def attach
|
60
|
+
attach = true
|
61
|
+
if !yaml["attach"].nil?
|
62
|
+
attach = yaml["attach"]
|
63
|
+
end
|
64
|
+
attach
|
65
|
+
end
|
66
|
+
|
67
|
+
def post
|
68
|
+
post_config = yaml["post"]
|
69
|
+
if post_config.is_a?(Array)
|
70
|
+
post_config.join("; ")
|
71
|
+
else
|
72
|
+
post_config
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
58
76
|
def tmux
|
59
77
|
"#{tmux_command}#{tmux_options}#{socket}"
|
60
78
|
end
|
@@ -115,6 +133,10 @@ module Tmuxinator
|
|
115
133
|
!name.nil?
|
116
134
|
end
|
117
135
|
|
136
|
+
def attach?
|
137
|
+
!!attach
|
138
|
+
end
|
139
|
+
|
118
140
|
def window(i)
|
119
141
|
"#{name}:#{i}"
|
120
142
|
end
|
data/lib/tmuxinator/version.rb
CHANGED
data/lib/tmuxinator/window.rb
CHANGED
@@ -55,8 +55,6 @@ module Tmuxinator
|
|
55
55
|
@pre.join(" && ")
|
56
56
|
elsif @pre.is_a?(String)
|
57
57
|
@pre
|
58
|
-
else
|
59
|
-
""
|
60
58
|
end
|
61
59
|
end
|
62
60
|
|
@@ -73,7 +71,9 @@ module Tmuxinator
|
|
73
71
|
end
|
74
72
|
|
75
73
|
def tmux_pre_window_command
|
76
|
-
|
74
|
+
return unless project.pre_window
|
75
|
+
|
76
|
+
"#{project.tmux} send-keys -t #{tmux_window_target} #{project.pre_window.shellescape} C-m"
|
77
77
|
end
|
78
78
|
|
79
79
|
def tmux_window_command_prefix
|
data/spec/factories/projects.rb
CHANGED
@@ -7,6 +7,14 @@ FactoryGirl.define do
|
|
7
7
|
initialize_with { Tmuxinator::Project.new(file) }
|
8
8
|
end
|
9
9
|
|
10
|
+
factory :project_with_custom_name, :class => Tmuxinator::Project do
|
11
|
+
transient do
|
12
|
+
file { YAML.load(File.read("#{File.expand_path("spec/fixtures/sample.yml")}")) }
|
13
|
+
end
|
14
|
+
|
15
|
+
initialize_with { Tmuxinator::Project.new(file, "custom") }
|
16
|
+
end
|
17
|
+
|
10
18
|
factory :project_with_deprecations, :class => Tmuxinator::Project do
|
11
19
|
transient do
|
12
20
|
file { YAML.load(File.read("#{File.expand_path("spec/fixtures/sample.deprecations.yml")}")) }
|
@@ -22,4 +30,12 @@ FactoryGirl.define do
|
|
22
30
|
|
23
31
|
initialize_with { Tmuxinator::Project.new(file) }
|
24
32
|
end
|
33
|
+
|
34
|
+
factory :noname_project, :class => Tmuxinator::Project do
|
35
|
+
transient do
|
36
|
+
file { YAML.load(File.read("#{File.expand_path("spec/fixtures/noname.yml")}")) }
|
37
|
+
end
|
38
|
+
|
39
|
+
initialize_with { Tmuxinator::Project.new(file) }
|
40
|
+
end
|
25
41
|
end
|
@@ -71,6 +71,24 @@ describe Tmuxinator::Cli do
|
|
71
71
|
end
|
72
72
|
end
|
73
73
|
|
74
|
+
describe "#start(custom_name)" do
|
75
|
+
before do
|
76
|
+
ARGV.replace(["start", "foo", "bar"])
|
77
|
+
allow(Tmuxinator::Config).to receive_messages(:validate => project)
|
78
|
+
allow(Tmuxinator::Config).to receive_messages(:version => 1.9)
|
79
|
+
allow(Kernel).to receive(:exec)
|
80
|
+
end
|
81
|
+
|
82
|
+
context "no deprecations" do
|
83
|
+
let(:project) { FactoryGirl.build(:project) }
|
84
|
+
|
85
|
+
it "starts the project" do
|
86
|
+
expect(Kernel).to receive(:exec)
|
87
|
+
capture_io { cli.start }
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
74
92
|
describe "#new" do
|
75
93
|
let(:file) { StringIO.new }
|
76
94
|
|
@@ -142,6 +160,12 @@ describe Tmuxinator::Cli do
|
|
142
160
|
expect(project).to receive(:render)
|
143
161
|
capture_io { cli.start }
|
144
162
|
end
|
163
|
+
|
164
|
+
it "renders the project with custom session" do
|
165
|
+
ARGV.replace(["debug", "sample", "bar"])
|
166
|
+
expect(project).to receive(:render)
|
167
|
+
capture_io { cli.start }
|
168
|
+
end
|
145
169
|
end
|
146
170
|
|
147
171
|
describe "#delete" do
|
@@ -19,6 +19,28 @@ describe Tmuxinator::Config do
|
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
|
+
describe "#default_path_option" do
|
23
|
+
context ">= 1.8" do
|
24
|
+
before do
|
25
|
+
allow(Tmuxinator::Config).to receive(:version).and_return(1.8)
|
26
|
+
end
|
27
|
+
|
28
|
+
it "returns -c" do
|
29
|
+
expect(Tmuxinator::Config.default_path_option).to eq "-c"
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
context "< 1.8" do
|
34
|
+
before do
|
35
|
+
allow(Tmuxinator::Config).to receive(:version).and_return(1.7)
|
36
|
+
end
|
37
|
+
|
38
|
+
it "returns default-path" do
|
39
|
+
expect(Tmuxinator::Config.default_path_option).to eq "default-path"
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
22
44
|
describe "#default?" do
|
23
45
|
let(:root) { Tmuxinator::Config.root }
|
24
46
|
|
@@ -2,8 +2,10 @@ require "spec_helper"
|
|
2
2
|
|
3
3
|
describe Tmuxinator::Project do
|
4
4
|
let(:project) { FactoryGirl.build(:project) }
|
5
|
+
let(:project_with_custom_name) { FactoryGirl.build(:project_with_custom_name) }
|
5
6
|
let(:project_with_deprecations) { FactoryGirl.build(:project_with_deprecations) }
|
6
7
|
let(:wemux_project) { FactoryGirl.build(:wemux_project) }
|
8
|
+
let(:noname_project) { FactoryGirl.build(:noname_project) }
|
7
9
|
|
8
10
|
describe "#initialize" do
|
9
11
|
context "valid yaml" do
|
@@ -23,6 +25,15 @@ describe Tmuxinator::Project do
|
|
23
25
|
expect(wemux_project.render).to_not be_empty
|
24
26
|
end
|
25
27
|
end
|
28
|
+
|
29
|
+
context "custom name" do
|
30
|
+
it "renders the tmux config with custom name" do
|
31
|
+
rendered = project_with_custom_name.render
|
32
|
+
expect(rendered).to_not be_empty
|
33
|
+
expect(rendered).to include("custom")
|
34
|
+
expect(rendered).to_not include("sample")
|
35
|
+
end
|
36
|
+
end
|
26
37
|
end
|
27
38
|
|
28
39
|
describe "#windows" do
|
@@ -51,6 +62,12 @@ describe Tmuxinator::Project do
|
|
51
62
|
expect(project_with_deprecations.root).to include("test")
|
52
63
|
end
|
53
64
|
end
|
65
|
+
|
66
|
+
context "without root" do
|
67
|
+
it "doesn't throw an error" do
|
68
|
+
expect{noname_project.root}.to_not raise_error
|
69
|
+
end
|
70
|
+
end
|
54
71
|
end
|
55
72
|
|
56
73
|
describe "#name" do
|
@@ -71,6 +88,12 @@ describe Tmuxinator::Project do
|
|
71
88
|
expect(wemux_project.name).to eq "wemux"
|
72
89
|
end
|
73
90
|
end
|
91
|
+
|
92
|
+
context "without name" do
|
93
|
+
it "displays error message" do
|
94
|
+
expect{noname_project.name}.to_not raise_error
|
95
|
+
end
|
96
|
+
end
|
74
97
|
end
|
75
98
|
|
76
99
|
describe "#pre_window" do
|
@@ -115,14 +115,13 @@ describe Tmuxinator::Window do
|
|
115
115
|
end
|
116
116
|
end
|
117
117
|
|
118
|
-
|
119
118
|
context "pre is not present" do
|
120
119
|
before do
|
121
120
|
yaml["editor"].delete("pre")
|
122
121
|
end
|
123
122
|
|
124
|
-
it "returns
|
125
|
-
expect(window.pre).to
|
123
|
+
it "returns nil" do
|
124
|
+
expect(window.pre).to be_nil
|
126
125
|
end
|
127
126
|
end
|
128
127
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tmuxinator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.11
|
4
|
+
version: 0.6.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Allen Bargi
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-06-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thor
|
@@ -59,104 +59,6 @@ dependencies:
|
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '1.3'
|
62
|
-
- !ruby/object:Gem::Dependency
|
63
|
-
name: rspec
|
64
|
-
requirement: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - "~>"
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '3.1'
|
69
|
-
type: :development
|
70
|
-
prerelease: false
|
71
|
-
version_requirements: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - "~>"
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '3.1'
|
76
|
-
- !ruby/object:Gem::Dependency
|
77
|
-
name: simplecov
|
78
|
-
requirement: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - "~>"
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '0.9'
|
83
|
-
type: :development
|
84
|
-
prerelease: false
|
85
|
-
version_requirements: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - "~>"
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '0.9'
|
90
|
-
- !ruby/object:Gem::Dependency
|
91
|
-
name: coveralls
|
92
|
-
requirement: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - "~>"
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '0.7'
|
97
|
-
type: :development
|
98
|
-
prerelease: false
|
99
|
-
version_requirements: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - "~>"
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: '0.7'
|
104
|
-
- !ruby/object:Gem::Dependency
|
105
|
-
name: awesome_print
|
106
|
-
requirement: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - "~>"
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: '1.2'
|
111
|
-
type: :development
|
112
|
-
prerelease: false
|
113
|
-
version_requirements: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
115
|
-
- - "~>"
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: '1.2'
|
118
|
-
- !ruby/object:Gem::Dependency
|
119
|
-
name: pry
|
120
|
-
requirement: !ruby/object:Gem::Requirement
|
121
|
-
requirements:
|
122
|
-
- - "~>"
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
version: '0.10'
|
125
|
-
type: :development
|
126
|
-
prerelease: false
|
127
|
-
version_requirements: !ruby/object:Gem::Requirement
|
128
|
-
requirements:
|
129
|
-
- - "~>"
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
version: '0.10'
|
132
|
-
- !ruby/object:Gem::Dependency
|
133
|
-
name: pry-nav
|
134
|
-
requirement: !ruby/object:Gem::Requirement
|
135
|
-
requirements:
|
136
|
-
- - "~>"
|
137
|
-
- !ruby/object:Gem::Version
|
138
|
-
version: '0.2'
|
139
|
-
type: :development
|
140
|
-
prerelease: false
|
141
|
-
version_requirements: !ruby/object:Gem::Requirement
|
142
|
-
requirements:
|
143
|
-
- - "~>"
|
144
|
-
- !ruby/object:Gem::Version
|
145
|
-
version: '0.2'
|
146
|
-
- !ruby/object:Gem::Dependency
|
147
|
-
name: factory_girl
|
148
|
-
requirement: !ruby/object:Gem::Requirement
|
149
|
-
requirements:
|
150
|
-
- - "~>"
|
151
|
-
- !ruby/object:Gem::Version
|
152
|
-
version: '4.4'
|
153
|
-
type: :development
|
154
|
-
prerelease: false
|
155
|
-
version_requirements: !ruby/object:Gem::Requirement
|
156
|
-
requirements:
|
157
|
-
- - "~>"
|
158
|
-
- !ruby/object:Gem::Version
|
159
|
-
version: '4.4'
|
160
62
|
description: Create and manage complex tmux sessions easily.
|
161
63
|
email:
|
162
64
|
- allen.bargi@gmail.com
|
@@ -169,6 +71,10 @@ extra_rdoc_files: []
|
|
169
71
|
files:
|
170
72
|
- bin/mux
|
171
73
|
- bin/tmuxinator
|
74
|
+
- completion/mux.fish
|
75
|
+
- completion/tmuxinator.bash
|
76
|
+
- completion/tmuxinator.fish
|
77
|
+
- completion/tmuxinator.zsh
|
172
78
|
- lib/tmuxinator.rb
|
173
79
|
- lib/tmuxinator/assets/sample.yml
|
174
80
|
- lib/tmuxinator/assets/template.erb
|
@@ -183,6 +89,7 @@ files:
|
|
183
89
|
- lib/tmuxinator/wemux_support.rb
|
184
90
|
- lib/tmuxinator/window.rb
|
185
91
|
- spec/factories/projects.rb
|
92
|
+
- spec/fixtures/noname.yml
|
186
93
|
- spec/fixtures/sample.deprecations.yml
|
187
94
|
- spec/fixtures/sample.yml
|
188
95
|
- spec/fixtures/sample_wemux.yml
|
@@ -210,7 +117,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
210
117
|
requirements:
|
211
118
|
- - ">="
|
212
119
|
- !ruby/object:Gem::Version
|
213
|
-
version:
|
120
|
+
version: 1.9.3
|
214
121
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
215
122
|
requirements:
|
216
123
|
- - ">="
|
@@ -218,12 +125,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
218
125
|
version: 1.8.23
|
219
126
|
requirements: []
|
220
127
|
rubyforge_project:
|
221
|
-
rubygems_version: 2.
|
128
|
+
rubygems_version: 2.4.5
|
222
129
|
signing_key:
|
223
130
|
specification_version: 4
|
224
131
|
summary: Create and manage complex tmux sessions easily.
|
225
132
|
test_files:
|
226
133
|
- spec/factories/projects.rb
|
134
|
+
- spec/fixtures/noname.yml
|
227
135
|
- spec/fixtures/sample.deprecations.yml
|
228
136
|
- spec/fixtures/sample.yml
|
229
137
|
- spec/fixtures/sample_wemux.yml
|