tmuxinator 0.3.3 → 0.3.4

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 CHANGED
@@ -116,6 +116,10 @@ Remove a project
116
116
 
117
117
  Remove all tmuxinator configs, aliases and scripts. aliased to `i`
118
118
 
119
+ $ tmuxinator doctor
120
+
121
+ Examines your environment and identifies problems with your configuration
122
+
119
123
 
120
124
  $ tmuxinator version
121
125
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.3
1
+ 0.3.4
@@ -4,9 +4,8 @@ tmux start-server
4
4
  if ! $(tmux has-session -t <%=s @project_name %>); then
5
5
  cd <%= @project_root || "." %>
6
6
  <%= @pre.kind_of?(Array) ? @pre.join(" && ") : @pre %>
7
- tmux new-session -d -s <%=s @project_name %> -n <%=s @tabs[0].name %>
8
- tmux set default-path <%= @project_root %>
9
- tmux set-option base-index 1
7
+ env TMUX= tmux start-server \; set-option -g base-index 1 \; new-session -d -s <%=s @project_name %> -n <%=s @tabs[0].name %>
8
+ tmux set-option -t <%=s @project_name %> default-path <%= @project_root %>
10
9
 
11
10
  <% @tabs[1..-1].each_with_index do |tab, i| %>
12
11
  tmux new-window -t <%= window(i+2) %> -n <%=s tab.name %>
@@ -35,4 +34,4 @@ if [ -z $TMUX ]; then
35
34
  tmux -u attach-session -t <%=s @project_name %>
36
35
  else
37
36
  tmux -u switch-client -t <%=s @project_name %>
38
- fi
37
+ fi
@@ -26,10 +26,14 @@ module Tmuxinator
26
26
  copy source_project project file to a new project called new_project
27
27
  delete [project_name]
28
28
  deletes the project called project_name
29
+ update_scripts
30
+ re-create the tmux scripts and aliases from the configs
29
31
  implode
30
32
  deletes all existing projects!
31
33
  list [-v]
32
34
  list all existing projects
35
+ doctor
36
+ look for problems in your configuration
33
37
  help
34
38
  shows this help document
35
39
  version
@@ -47,30 +47,22 @@ module Tmuxinator
47
47
  @project_name = yaml["project_name"]
48
48
  @project_root = yaml["project_root"]
49
49
  @rvm = yaml["rvm"]
50
- @pre = yaml["pre"]
50
+ @pre = build_command(yaml["pre"])
51
51
  @tabs = []
52
52
 
53
53
  yaml["tabs"].each do |tab|
54
54
  t = OpenStruct.new
55
55
  t.name = tab.keys.first
56
56
  value = tab.values.first
57
+
57
58
  case value
58
- when Array
59
- value.unshift "rvm use #{@rvm}" if @rvm
60
- t.command = value.join(" && ")
61
- when String
62
- value = "rvm use #{@rvm} && #{value}" if @rvm
63
- t.command = value
64
59
  when Hash
65
60
  t.panes = (value["panes"] || ['']).map do |pane|
66
- if pane.is_a? Array
67
- pane.unshift! "rvm use #{@rvm}" if @rvm
68
- pane = pane.join(' && ')
69
- end
70
- pane = "rvm use #{@rvm} && #{pane}" if @rvm
71
- pane
61
+ build_command(pane)
72
62
  end
73
63
  t.layout = value["layout"]
64
+ else
65
+ t.command = build_command(value)
74
66
  end
75
67
  @tabs << t
76
68
  end
@@ -96,6 +88,15 @@ module Tmuxinator
96
88
  return '' unless cmd
97
89
  "tmux send-keys -t #{window(window_number)} #{s cmd} C-m"
98
90
  end
91
+
92
+ def build_command(value)
93
+ commands = [value].flatten.compact.reject { |c| c.strip.empty? }
94
+ if @rvm
95
+ commands.unshift "rvm use #{@rvm}"
96
+ end
97
+
98
+ commands.join ' && '
99
+ end
99
100
  end
100
101
 
101
102
  end
data/tmuxinator.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{tmuxinator}
8
- s.version = "0.3.3"
8
+ s.version = "0.3.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Allen Bargi"]
12
- s.date = %q{2011-05-24}
12
+ s.date = %q{2011-06-20}
13
13
  s.default_executable = %q{tmuxinator}
14
14
  s.description = %q{Create and manage complex tmux sessions easily.}
15
15
  s.email = %q{allen.bargi@gmail.com}
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: tmuxinator
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.3.3
5
+ version: 0.3.4
6
6
  platform: ruby
7
7
  authors:
8
8
  - Allen Bargi
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-05-24 00:00:00 +02:00
13
+ date: 2011-06-20 00:00:00 +02:00
14
14
  default_executable: tmuxinator
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -101,7 +101,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
101
101
  requirements:
102
102
  - - ">="
103
103
  - !ruby/object:Gem::Version
104
- hash: 4535080839714727474
104
+ hash: -2643811095432789154
105
105
  segments:
106
106
  - 0
107
107
  version: "0"