tmuxinator 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,17 +1,16 @@
1
1
  # Tmuxinator
2
2
 
3
- Create and manage tmux sessions easily. Inspired by Jon Druse's ([Screeninator](https://github.com/jondruse/screeninator)) and Arthur Chiu's ([Terminitor](http://github.com/achiu/terminitor))
3
+ Create and manage tmux sessions easily.
4
4
 
5
- ## Example
5
+ ### Example
6
6
 
7
- ![Sample](http://f.cl.ly/items/3e3I1l1t3D2U472n1h0h/Screen%20shot%202010-12-10%20at%2010.59.17%20PM.png)
7
+ ![Screenshot](http://f.cl.ly/items/3e3I1l1t3D2U472n1h0h/Screen%20shot%202010-12-10%20at%2010.59.17%20PM.png)
8
8
 
9
-
10
- ## Installation
9
+ ### Installation
11
10
 
12
11
  $ gem install tmuxinator
13
12
 
14
- ## Editor and Shell
13
+ ### Editor and Shell
15
14
 
16
15
  tmuxinator uses your shell's default editor for opening files. If you're not sure what that is type:
17
16
 
@@ -22,16 +21,19 @@ If you want to change your default editor simple put a line in ~/.bashrc that ch
22
21
 
23
22
  export EDITOR='mate -w'
24
23
 
25
- ## Environment Integration
24
+
25
+ ### Environment Integration
26
26
 
27
27
  Add this to your ~/.bashrc (or similar)
28
28
 
29
- [[ -s $HOME/.tmuxinator/scripts/tmuxinator ]] && source $HOME/.tmuxinator/scripts/tmuxinator
29
+ [[ -s $HOME/.tmuxinator/scripts/tmuxinator ]] && source $HOME/.tmuxinator/scripts/tmuxinator
30
30
 
31
- ## Usage
31
+ For command line completion you can source the `tmuxinator_completion` file, which is in the same directory as
32
+ `tmuxinator` binary file. That will auto-complete `tmuxinator` commands, plus your `.yml` config files.
32
33
 
34
+ ### Usage
33
35
 
34
- ### Create a project ###
36
+ #### Create a project
35
37
 
36
38
  $ tmuxinator new project_name
37
39
 
@@ -42,6 +44,7 @@ Create or edit your projects with this command, for editing you can also use `tm
42
44
 
43
45
  project_name: Tmuxinator
44
46
  project_root: ~/code/rails_project
47
+ socket_name: foo # Not needed. Remove to use default socket
45
48
  rvm: 1.9.2@rails_project
46
49
  pre: sudo /etc/rc.d/mysqld start
47
50
  tabs:
@@ -65,7 +68,7 @@ If you want to have your own default config, place it into $HOME/.tmuxinator/def
65
68
 
66
69
  The `pre` command allows you to run anything before starting the tmux session. Could be handy to make sure you database daemons are running. Multiple commands can be specified, just like for tabs.
67
70
 
68
- ## Panes Support
71
+ ### Panes Support
69
72
  you can define your own panes inside a window likes this:
70
73
 
71
74
  - window_with_panes
@@ -75,20 +78,19 @@ you can define your own panes inside a window likes this:
75
78
  - #empty, will just run plain bash
76
79
  - top
77
80
 
78
-
79
- ## Starting a project
81
+ ### Starting a project
80
82
 
81
83
  $ start_[project_name]
82
84
 
83
- ## Shorthand
85
+ ### Shorthand
84
86
 
85
- You can also use this shorthand alias for tmuxinator
87
+ You can also use this shorthand alias for tmuxinator
86
88
 
87
89
  $ mux [command/project_name]
88
90
 
89
91
  This will fire up tmux with all the tabs you configured.
90
92
 
91
- ## Other Commands
93
+ ### Other Commands
92
94
 
93
95
  $ tmuxinator copy existing_project new_project
94
96
 
@@ -109,7 +111,7 @@ Remove a project
109
111
 
110
112
  Remove all tmuxinator configs, aliases and scripts. aliased to `i`
111
113
 
112
- $ tmuxinator doctor
114
+ $ tmuxinator doctor
113
115
 
114
116
  Examines your environment and identifies problems with your configuration
115
117
 
@@ -123,41 +125,41 @@ shows tmuxinator's version. aliased to `v`
123
125
 
124
126
  shows tmuxinator's help. aliased to `h`
125
127
 
126
- ## Questions? Comments? Feature Request?
128
+ ### Questions? Comments? Feature Request?
127
129
 
128
- I would love to hear your feedback on this project! Send me a message!
130
+ I would love to hear your feedback on this project! head over to [issues](https://github.com/aziz/tmuxinator/issues)
131
+ section and make a ticket.
129
132
 
130
- ## Contributors:
133
+ ### Contributors
131
134
 
132
- * [Aaron Spiegel](https://github.com/spiegela)
133
- * [Jay Adkisson](https://github.com/jayferd)
134
- * [Chris Lerum](https://github.com/chrislerum)
135
- * [David Bolton](https://github.com/lightningdb)
136
- * [Thibault Duplessis](https://github.com/ornicar)
137
- * [Ian Yang](https://github.com/doitian)
138
- * [Bjørn Arild Mæland](https://github.com/bmaland)
139
- * [Dane O'Connor](https://github.com/thedeeno)
140
- * [Eric Marden](https://github.com/xentek)
135
+ [See the full list of contributors](https://github.com/aziz/tmuxinator/contributors)
141
136
 
137
+ ### History
138
+ #### v. 0.5.0
139
+ * Added optional socket name support (Thanks to Adam Walters)
140
+ * Added auto completion (Thanks to Jose Pablo Barrantes)
142
141
 
143
- ## History
144
- ###v. 0.4.0
142
+ ####v. 0.4.0
145
143
  * Does not crash if given an invalid yaml file format. report it and exit gracefully.
146
144
  * Removed clunky scripts & shell aliases (Thanks to Dane O'Connor)
147
145
  * Config files are now rendered JIT (Thanks to Dane O'Connor)
148
146
  * Can now start sessions from cli (Thanks to Dane O'Connor)
149
147
 
150
- ###v. 0.3.0
148
+ ####v. 0.3.0
151
149
  * Added pre command (Thanks to Ian Yang)
152
150
  * Added multiple pre command (Thanks to Bjørn Arild Mæland)
153
151
  * Using tmux set default-path for project root
154
152
  * New aliases
155
153
 
156
- ###v. 0.2.0
154
+ ####v. 0.2.0
157
155
  * added pane support (Thanks to Aaron Spiegel)
158
156
  * RVM support (Thanks to Jay Adkisoon)
159
157
 
160
- ## Contributing to tmuxinator
158
+ ### Inspiration and Thanks
159
+
160
+ Inspired by Jon Druse's ([Screeninator](https://github.com/jondruse/screeninator)) and Arthur Chiu's ([Terminitor](http://github.com/achiu/terminitor))
161
+
162
+ ### Contributing to tmuxinator
161
163
 
162
164
  * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
163
165
  * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
@@ -165,8 +167,9 @@ I would love to hear your feedback on this project! Send me a message!
165
167
  * Start a feature/bugfix branch
166
168
  * Commit and push until you are happy with your contribution
167
169
  * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
168
- * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
170
+ * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is
171
+ otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
169
172
 
170
- ## Copyright
173
+ ### Copyright
171
174
 
172
- Copyright (c) 2010 Allen Bargi. See LICENSE.txt for further details.
175
+ Copyright (c) 2010--2011 Allen Bargi. See LICENSE.txt for further details.
data/TODO CHANGED
@@ -0,0 +1,4 @@
1
+ - no need to create .tmuxinator
2
+ - Adding support for specifying global tmux options https://github.com/jbettcher/tmuxinator/commit/6f2cf2ec67ff018e1d629e4eae6421287e190086
3
+ - release the iterminator version of this
4
+ - flush the issues
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.0
1
+ 0.5.0
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # Tmuxinator command line completion.
4
+
5
+ have=$(command -v tmuxinator)
6
+
7
+ test -n "$have" &&
8
+ _tmuxinator_commands_complete()
9
+ {
10
+ COMPREPLY=()
11
+ if [ $COMP_CWORD = 1 ]; then
12
+ local commands="open copy delete update_scripts implode list doctor help version"
13
+ COMPREPLY=(`compgen -W "$commands" -- $2`)
14
+ fi
15
+ return 0
16
+ }
17
+
18
+ _tmuxinator_open_complete()
19
+ {
20
+ COMPREPLY=()
21
+ if [ $COMP_CWORD = 1 ]; then
22
+ local configs=`find ~/.tmuxinator/ -name *.yml | cut -d/ -f5 | sed s:.yml::g`
23
+ COMPREPLY=(`compgen -W "$configs" -- $2`)
24
+ fi
25
+ return 0
26
+ }
27
+
28
+ complete -F _tmuxinator_commands_complete -o default tmuxinator mux
29
+ complete -F _tmuxinator_open_complete -o default muxo
@@ -3,6 +3,7 @@
3
3
 
4
4
  project_name: Tmuxinator
5
5
  project_root: ~/code/rails_project
6
+ socket_name: foo # Not needed. Remove to use default socket
6
7
  rvm: 1.9.2@rails_project
7
8
  pre: sudo /etc/rc.d/mysqld start
8
9
  tabs:
@@ -1,14 +1,14 @@
1
1
  #!<%= ENV['SHELL'] || '/bin/bash' %>
2
- tmux start-server
2
+ tmux <%= socket %> start-server
3
3
 
4
- if ! $(tmux has-session -t <%=s @project_name %>); then
4
+ if ! $(tmux <%= socket %> has-session -t <%=s @project_name %>); then
5
5
  cd <%= @project_root || "." %>
6
6
  <%= @pre.kind_of?(Array) ? @pre.join(" && ") : @pre %>
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 %>
7
+ env TMUX= tmux <%= socket %> start-server \; set-option -g base-index 1 \; new-session -d -s <%=s @project_name %> -n <%=s @tabs[0].name %>
8
+ tmux <%= socket %> set-option -t <%=s @project_name %> default-path <%= @project_root %>
9
9
 
10
10
  <% @tabs[1..-1].each_with_index do |tab, i| %>
11
- tmux new-window -t <%= window(i+2) %> -n <%=s tab.name %>
11
+ tmux <%= socket %> new-window -t <%= window(i+2) %> -n <%=s tab.name %>
12
12
  <% end %>
13
13
 
14
14
  # set up tabs and panes
@@ -19,19 +19,19 @@ tmux new-window -t <%= window(i+2) %> -n <%=s tab.name %>
19
19
  <% elsif tab.panes %>
20
20
  <%= send_keys(tab.panes.shift, i+1) %>
21
21
  <% tab.panes.each do |pane| %>
22
- tmux splitw -t <%= window(i+1) %>
22
+ tmux <%= socket %> splitw -t <%= window(i+1) %>
23
23
  <%= send_keys(pane, i+1) %>
24
24
  <% end %>
25
- tmux select-layout -t <%= window(i+1) %> <%=s tab.layout %>
25
+ tmux <%= socket %> select-layout -t <%= window(i+1) %> <%=s tab.layout %>
26
26
  <% end %>
27
27
  <% end %>
28
28
 
29
- tmux select-window -t <%= window(1) %>
29
+ tmux <%= socket %> select-window -t <%= window(1) %>
30
30
 
31
31
  fi
32
32
 
33
33
  if [ -z $TMUX ]; then
34
- tmux -u attach-session -t <%=s @project_name %>
34
+ tmux <%= socket %> -u attach-session -t <%=s @project_name %>
35
35
  else
36
- tmux -u switch-client -t <%=s @project_name %>
37
- fi
36
+ tmux <%= socket %> -u switch-client -t <%=s @project_name %>
37
+ fi
@@ -35,11 +35,11 @@ module Tmuxinator
35
35
  list [-v]
36
36
  list all existing projects
37
37
  doctor
38
- look for problems in your configuration
38
+ look for problems in your configuration
39
39
  help
40
40
  shows this help document
41
41
  version
42
-
42
+ shows tmuxinator version number
43
43
  }
44
44
  end
45
45
  alias :help :usage
@@ -52,7 +52,7 @@ module Tmuxinator
52
52
  @name = args.shift
53
53
  config_path = "#{root_dir}#{@name}.yml"
54
54
  unless File.exists?(config_path)
55
- template = File.exists?(user_config) ? user_config : "#{File.dirname(__FILE__)}/assets/sample.yml"
55
+ template = File.exists?(user_config) ? user_config : sample_config
56
56
  erb = ERB.new(File.read(template)).result(binding)
57
57
  tmp = File.open(config_path, 'w') {|f| f.write(erb) }
58
58
  end
@@ -155,6 +155,8 @@ module Tmuxinator
155
155
  private #==============================
156
156
 
157
157
  def root_dir
158
+ # create ~/.tmuxinator directory if it doesn't exist
159
+ Dir.mkdir("#{ENV["HOME"]}/.tmuxinator/") unless File.directory?(File.expand_path("~/.tmuxinator"))
158
160
  "#{ENV["HOME"]}/.tmuxinator/"
159
161
  end
160
162
 
@@ -28,10 +28,14 @@ module Tmuxinator
28
28
  "#{root_dir}#{file_name}.tmux" if file_name
29
29
  end
30
30
 
31
+ def socket
32
+ "-L #{@socket_name}" if @socket_name
33
+ end
34
+
31
35
  private
32
36
 
33
37
  def root_dir
34
- "#{ENV["HOME"]}/.tmuxinator/"
38
+ "$HOME/.tmuxinator/"
35
39
  end
36
40
 
37
41
  def process_config!
@@ -50,6 +54,7 @@ module Tmuxinator
50
54
  @rvm = yaml["rvm"]
51
55
  @pre = build_command(yaml["pre"])
52
56
  @tabs = []
57
+ @socket_name = yaml['socket_name']
53
58
 
54
59
  yaml["tabs"].each do |tab|
55
60
  t = OpenStruct.new
@@ -83,7 +88,7 @@ module Tmuxinator
83
88
 
84
89
  def send_keys cmd, window_number
85
90
  return '' unless cmd
86
- "tmux send-keys -t #{window(window_number)} #{s cmd} C-m"
91
+ "tmux #{socket} send-keys -t #{window(window_number)} #{s cmd} C-m"
87
92
  end
88
93
 
89
94
  def build_command(value)
@@ -9,6 +9,7 @@ describe Tmuxinator::ConfigWriter do
9
9
  its(:tabs){ should be_nil }
10
10
  its(:config_path){ should be_nil }
11
11
  its(:pre){ should be_nil }
12
+ its(:socket){ should be_nil }
12
13
  end
13
14
 
14
15
  context "While Defining the filename on init" do
@@ -29,6 +30,7 @@ describe Tmuxinator::ConfigWriter do
29
30
  its(:rvm){ should eql '1.9.2@rails_project' }
30
31
  its(:tabs){ should be_an Array }
31
32
  its(:pre){ should eql 'rvm use 1.9.2@rails_project && sudo /etc/rc.d/mysqld start' }
33
+ its(:socket){ should eql '-L foo' }
32
34
 
33
35
  let(:first_tab){ subject.tabs[0] }
34
36
 
@@ -5,14 +5,14 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "tmuxinator"
8
- s.version = "0.4.0"
8
+ s.version = "0.5.0"
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 = "2011-09-15"
12
+ s.date = "2011-10-10"
13
13
  s.description = "Create and manage complex tmux sessions easily."
14
14
  s.email = "allen.bargi@gmail.com"
15
- s.executables = ["mux", "tmuxinator"]
15
+ s.executables = ["mux", "tmuxinator", "tmuxinator_completion"]
16
16
  s.extra_rdoc_files = [
17
17
  "LICENSE.txt",
18
18
  "README.md",
@@ -29,6 +29,7 @@ Gem::Specification.new do |s|
29
29
  "VERSION",
30
30
  "bin/mux",
31
31
  "bin/tmuxinator",
32
+ "bin/tmuxinator_completion",
32
33
  "lib/tmuxinator.rb",
33
34
  "lib/tmuxinator/assets/sample.yml",
34
35
  "lib/tmuxinator/assets/tmux_config.tmux",
@@ -43,7 +44,7 @@ Gem::Specification.new do |s|
43
44
  s.licenses = ["MIT"]
44
45
  s.post_install_message = "\n __________________________________________________________\n ..........................................................\n\n Thank you for installing tmuxinator\n Please be sure to to drop a line in your ~/.bashrc file, similar \n to RVM if you've used that before:\n\n [[ -s $HOME/.tmuxinator/scripts/tmuxinator ]] && source $HOME/.tmuxinator/scripts/tmuxinator\n \n also ensure that you've set these variables in your ENV:\n \n $EDITOR, $SHELL\n \n you can run `tmuxinator doctor` to make sure everything is set.\n happy tmuxing with tmuxinator!\n\n ..........................................................\n __________________________________________________________\n \n "
45
46
  s.require_paths = ["lib"]
46
- s.rubygems_version = "1.8.10"
47
+ s.rubygems_version = "1.8.11"
47
48
  s.summary = "Create and manage complex tmux sessions easily."
48
49
 
49
50
  if s.respond_to? :specification_version then
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.4.0
4
+ version: 0.5.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-09-15 00:00:00.000000000Z
12
+ date: 2011-10-10 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &70303485891940 !ruby/object:Gem::Requirement
16
+ requirement: &70349397703380 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 2.6.0
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70303485891940
24
+ version_requirements: *70349397703380
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: bundler
27
- requirement: &70303485890000 !ruby/object:Gem::Requirement
27
+ requirement: &70349397702580 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 1.0.18
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70303485890000
35
+ version_requirements: *70349397702580
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: jeweler
38
- requirement: &70303485888060 !ruby/object:Gem::Requirement
38
+ requirement: &70349397701780 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 1.6.4
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70303485888060
46
+ version_requirements: *70349397701780
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rcov
49
- requirement: &70303485886260 !ruby/object:Gem::Requirement
49
+ requirement: &70349397701040 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,12 +54,13 @@ dependencies:
54
54
  version: 0.9.10
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70303485886260
57
+ version_requirements: *70349397701040
58
58
  description: Create and manage complex tmux sessions easily.
59
59
  email: allen.bargi@gmail.com
60
60
  executables:
61
61
  - mux
62
62
  - tmuxinator
63
+ - tmuxinator_completion
63
64
  extensions: []
64
65
  extra_rdoc_files:
65
66
  - LICENSE.txt
@@ -76,6 +77,7 @@ files:
76
77
  - VERSION
77
78
  - bin/mux
78
79
  - bin/tmuxinator
80
+ - bin/tmuxinator_completion
79
81
  - lib/tmuxinator.rb
80
82
  - lib/tmuxinator/assets/sample.yml
81
83
  - lib/tmuxinator/assets/tmux_config.tmux
@@ -108,7 +110,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
108
110
  version: '0'
109
111
  segments:
110
112
  - 0
111
- hash: -3765836133335404318
113
+ hash: -770502179952499709
112
114
  required_rubygems_version: !ruby/object:Gem::Requirement
113
115
  none: false
114
116
  requirements:
@@ -117,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
117
119
  version: '0'
118
120
  requirements: []
119
121
  rubyforge_project:
120
- rubygems_version: 1.8.10
122
+ rubygems_version: 1.8.11
121
123
  signing_key:
122
124
  specification_version: 3
123
125
  summary: Create and manage complex tmux sessions easily.