tmuxinator 0.6.4 → 0.6.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 78a605e6c1ca2f15a4e38232b48dfc576b3f0e8f
4
- data.tar.gz: 750b9013143c741b0cadeb9ddccef2c20ce28ecf
3
+ metadata.gz: 6d9d7fb728f65009f6058f0810d48d28bbea8d78
4
+ data.tar.gz: 428a7e368197fdad498e10ba1af3fd63d4bdabd3
5
5
  SHA512:
6
- metadata.gz: e24273e7128ff0fc956aa31f0f29e344e8930933b90f705b5ef36da0a10adf3ca109a5b1235899f87594b5b379210772bb836b93ee738b439f8df467c99acfdb
7
- data.tar.gz: 8ad475904be0e362572c7f3a8fd81a5bbd5e53f199b44ea931668c79897b16dd701ab180c44e26ae37ebba0a3f8d01397b1e5a65637842bad16ea2e4e4dd2dfb
6
+ metadata.gz: f8ac28cc11f7a1ec80ec1a832d67d7a786e98d13396dbef493b6e5ea003a48822c4a55a23dac74d7a204875232013ec10d279a6872079673ae9170da76e1f328
7
+ data.tar.gz: 7889d60c7f2071f6c267bec80c7d13e6bc734bc991e154c530c3b230a742452b1674110ad1cee6e455ec02ac1ca98565fbcef1dad9f70e42be370a7ab9a0f507
data/.gitignore CHANGED
@@ -16,3 +16,4 @@ spec/reports
16
16
  tmp
17
17
  db
18
18
  vendor/
19
+ tags
@@ -1,3 +1,14 @@
1
+ ## 0.6.5
2
+ - Change deprecation continue message from any key to just the enter key
3
+ - Dramatically clean up the readme to be clearer for new users
4
+ - Update the contributing guide with references to the GitHub styleguide and add examples of how to leave good commit messages
5
+ - Use Erubis to render the project sample and fix a bad binding reference
6
+ - Update the sample project to be much simpler
7
+ - Fix not working delete command #142
8
+ - Fix an error in the bash completion script
9
+ - Fix an issue where the wrong project path was being returned
10
+ - Fix an issue where command aliases were being ignored
11
+
1
12
  ## 0.6.4
2
13
  - Fixes broken backwards compatibility of multiple pre commands #129
3
14
  - Fixes tmuxinator ignoring project root when started from within a tmux session #132
@@ -19,6 +19,8 @@
19
19
  If you've gone the extra mile and have a patch that fixes the issue, you
20
20
  should submit a Pull Request!
21
21
 
22
+ * Please follow the [GitHub Styleguide](https://github.com/styleguide/ruby) for
23
+ Ruby in both implementation and tests!
22
24
  * Fork the repo on Github.
23
25
  * Create a topic branch from where you want to base your work.
24
26
  * Add a test for your change. Only refactoring and documentation changes
@@ -26,4 +28,15 @@ should submit a Pull Request!
26
28
  we need a test!
27
29
  * Run _all_ the tests to assure nothine else was broken. We only take pull requests with passing tests.
28
30
  * Check for unnecessary whitespace with `git diff --check` before committing.
31
+ * Structure your commit messages like this:
32
+
33
+ ```
34
+ Summarize clearly in one line what the commit is about
35
+
36
+ Describe the problem the commit solves or the use
37
+ case for a new feature. Justify why you chose
38
+ the particular solution.
39
+ ```
40
+
41
+ * Use "fix", "add", "change" instead of "fixed", "added", "changed" in your commit messages.
29
42
  * Push to your fork and submit a pull request.
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2010-2012 Allen Bargi
1
+ Copyright (c) 2010-2013 Allen Bargi
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -4,183 +4,205 @@
4
4
 
5
5
  Create and manage tmux sessions easily.
6
6
 
7
- ### Example
8
-
9
- ![Screenshot](http://f.cl.ly/items/3e3I1l1t3D2U472n1h0h/Screen%20shot%202010-12-10%20at%2010.59.17%20PM.png)
7
+ ![Screenshot](https://f.cloud.github.com/assets/141213/916084/065fef7c-fe82-11e2-9c23-a9622c7d83c3.png)
10
8
 
11
9
  ## Installation
12
10
 
13
- ``` bash
14
- $ gem install tmuxinator
11
+ ```
12
+ gem install tmuxinator
15
13
  ```
16
14
 
17
15
  ## Editor and Shell
18
16
 
19
- tmuxinator uses your shell's default editor for opening files. If you're not
17
+ tmuxinator uses your shell's default editor for opening files. If you're not
20
18
  sure what that is type:
21
19
 
22
20
  ``` bash
23
- $ echo $EDITOR
21
+ echo $EDITOR
24
22
  ```
25
23
 
26
- For me that produces "vim" If you want to change your default editor simple
24
+ For me that produces "vim" If you want to change your default editor simply
27
25
  put a line in ~/.bashrc that changes it. Mine looks like this:
28
26
 
29
- ``` bash
27
+ ```
30
28
  export EDITOR='vim'
31
29
  ```
32
30
 
31
+ ## tmux
32
+
33
+ The recommended version of tmux to use is 1.8. You're mileage may vary for
34
+ earlier versions. Refer to the FAQ for any odd behaviour.
35
+
36
+ ### base-index
37
+
38
+ If you use a `base-index` other than the default, please be sure to also set the `pane-base-index`
39
+
40
+ ```
41
+ set-window-option -g pane-base-index 1
42
+ ```
43
+
33
44
  ## Completion
34
45
 
35
- Download the appropriate completion file from the repo.
46
+ Download the appropriate completion file from the repo and `source` the file.
47
+ The following are example where the completion file has been downloaded into
48
+ `~/.bin`.
36
49
 
37
50
  ### bash
38
51
 
39
52
  Add the following to your `~/.bashrc`:
40
53
 
41
- source `which tmuxinator.bash`
54
+ source ~/.bin/tmuxinator.bash
42
55
 
43
56
  ### zsh
44
57
 
45
58
  Add the following to your `~/.zshrc`:
46
59
 
47
- source `which tmuxinator.zsh`
60
+ source ~/.bin/tmuxinator.zsh
48
61
 
49
62
  ## Usage
50
63
 
64
+ A working knowledge of tmux is assumed. You should understand what window and
65
+ panes are in tmux. If not please consult the [man pages](http://manpages.ubuntu.com/manpages/precise/en/man1/tmux.1.html#contenttoc6) for tmux.
66
+
51
67
  ### Create a project
52
68
 
53
69
  Create or edit your projects with:
54
70
 
55
- ``` bash
56
- $ tmuxinator new [project]
71
+ ```
72
+ tmuxinator new [project]
57
73
  ```
58
74
 
59
75
  For editing you can also use `tmuxinator open [project]`. `new` is aliased to
60
76
  `o`,`open` and `n`. Your default editor (`$EDITOR`) is used to open the file.
61
77
  If this is a new project you will see this default config:
62
78
 
63
- ``` yaml
64
- name: Tmuxinator
65
- root: ~/Code/tmuxinator
66
- socket_name: foo # Remove to use default socket
67
- pre: sudo /etc/rc.d/mysqld start # Runs before everything
68
- pre_window: rbenv shell 2.0.0-p247 # Runs in each tab and pane
69
- tmux_options: -v -2 # Pass arguments to tmux
79
+ ```yaml
80
+ # ~/.tmuxinator/sample.yml
81
+
82
+ name: sample
83
+ root: ~/
84
+
85
+ # Optional. tmux socket
86
+ # socket_name: foo
87
+
88
+ # Runs before everything. Use it to start daemons etc.
89
+ # pre: sudo /etc/rc.d/mysqld start
90
+
91
+ # Runs in each window and pane before window/pane specific commands. Useful for setting up interpreter versions.
92
+ # pre_window: rbenv shell 2.0.0-p247
93
+
94
+ # Pass command line options to tmux. Useful for specifying a different tmux.conf.
95
+ # tmux_options: -f ~/.tmux.mac.conf
96
+
70
97
  windows:
71
98
  - editor:
72
99
  layout: main-vertical
73
100
  panes:
74
101
  - vim
75
- - #empty, will just run plain bash
76
- - top
77
- - shell: git pull
78
- - database: rails db
79
- - server: rails s
102
+ - guard
103
+ - server: bundle exec rails s
80
104
  - logs: tail -f logs/development.log
81
- - console: rails c
82
- - capistrano:
83
- - server: ssh me@myhost
84
105
  ```
85
106
 
86
- If a tab contains multiple commands, they will be joined together with `&&`.
87
- If you want to have your own default config, place it into
88
- `$HOME/.tmuxinator/default.yml`
107
+ ## Windows
89
108
 
90
- The `pre` command allows you to run anything before starting the tmux session.
91
- Could be handy to make sure you database daemons are running. Multiple commands
92
- can be specified, just like for tabs.
109
+ The windows option allows the specfication of any number of tmux windows. Each window is denoted by a YAML array entry, followed by a name
110
+ and command to be run.
111
+
112
+ ```
113
+ windows:
114
+ - editor: vim
115
+ ```
93
116
 
94
- ## Panes Support
117
+ ## Panes
95
118
 
96
- You can define your own panes inside a window likes this:
119
+ Panes are optional and are children of window entries, but unlike windows, they do not need a name. In the following example, the `editor` window has 2 panes, one running vim, the other guard.
97
120
 
98
- ``` yaml
99
- - window_with_panes
100
- layout: main-vertical
101
- panes:
102
- - vim
103
- - #empty, will just run plain bash
104
- - top
121
+ ```yaml
122
+ windows:
123
+ - editor:
124
+ layout: main-vertical
125
+ panes:
126
+ - vim
127
+ - guard
105
128
  ```
106
129
 
107
130
  The layout setting gets handed down to tmux directly, so you can choose from
108
- one of [the five standard
109
- layouts](http://manpages.ubuntu.com/manpages/precise/en/man1/tmux.1.html#contenttoc6)
131
+ one of [the five standard layouts](http://manpages.ubuntu.com/manpages/precise/en/man1/tmux.1.html#contenttoc6)
110
132
  or [specify your own](http://stackoverflow.com/a/9976282/183537).
111
133
 
112
- ## Starting a session
134
+ ## Interpreter Managers & Environment Variables
113
135
 
114
- This will fire up tmux with all the tabs and panes you configured.
136
+ To use tmuxinator with rbenv, RVM, NVM etc, use the `pre_window` option.
115
137
 
116
- ``` bash
117
- $ tmuxinator start [project]
138
+ ```
139
+ pre_window: rbenv shell 2.0.0-p247
118
140
  ```
119
141
 
120
- ## Shorthand
142
+ These command(s) will run before any subsequent commands in all panes and windows.
121
143
 
122
- You can also use this shorthand alias for tmuxinator
123
144
 
124
- ``` bash
125
- $ mux [command]
145
+ ## Starting a session
146
+
147
+ This will fire up tmux with all the tabs and panes you configured.
148
+
149
+ ```
150
+ tmuxinator start [project]
126
151
  ```
127
152
 
128
- ## Interpreter Managers & Environment Variables
153
+ ## Shorthand
129
154
 
130
- To use tmuxinator with rbenv, RVM, NVM etc, use the `pre_window` option.
155
+ An shorthand alias for tmuxinator can also be used.
131
156
 
132
157
  ```
133
- pre_window: rbenv shell 2.0.0-p247
158
+ mux [command]
134
159
  ```
135
160
 
136
- These commands will run before any pane or window.
137
-
138
161
  ## Other Commands
139
162
 
140
163
  Copy an existing project. Aliased to `c` and `cp`
141
- ``` bash
142
- $ tmuxinator copy [existing] [new]
164
+ ```
165
+ tmuxinator copy [existing] [new]
143
166
  ```
144
167
 
145
168
  List all the projects you have configured. Aliased to `l` and `ls`
146
-
147
- ``` bash
148
- $ tmuxinator list
169
+ ```
170
+ tmuxinator list
149
171
  ```
150
172
 
151
173
  Remove a project. Aliased to `rm`
152
- ``` bash
153
- $ tmuxinator delete [project]
174
+ ```
175
+ tmuxinator delete [project]
154
176
  ```
155
177
 
156
178
  Remove all tmuxinator configs, aliases and scripts. Aliased to `i`
157
- ``` bash
158
- $ tmuxinator implode
179
+ ```
180
+ tmuxinator implode
159
181
  ```
160
182
 
161
183
  Examines your environment and identifies problems with your configuration
162
- ``` bash
163
- $ tmuxinator doctor
184
+ ```
185
+ tmuxinator doctor
164
186
  ```
165
187
 
166
188
  Shows tmuxinator's help. Aliased to `h`
167
- ``` bash
168
- $ tmuxinator help
189
+ ```
190
+ tmuxinator help
169
191
  ```
170
192
 
171
193
  Shows the shell commands that get executed for a project
172
- ```bash
173
- $ tmuxinator debug [project]
194
+ ```
195
+ tmuxinator debug [project]
174
196
  ```
175
197
 
176
198
  Shows tmuxinator's version.
177
- ``` bash
178
- $ tmuxinator version
199
+ ```
200
+ tmuxinator version
179
201
  ```
180
202
 
181
203
  ## FAQ
182
204
 
183
- ### Window names are not displayed properly?
205
+ ### Window names are not displaying properly?
184
206
 
185
207
  Add `export DISABLE_AUTO_TITLE=true` to your `.zshrc` or `.bashrc`
186
208
 
data/bin/mux CHANGED
@@ -4,8 +4,14 @@ $: << File.expand_path("../../lib/", __FILE__)
4
4
  require "thor"
5
5
  require "tmuxinator"
6
6
 
7
- if ARGV.length == 1 && (ARGV & Tmuxinator::Cli.new.command_list).empty?
8
- Tmuxinator::Cli.new.start(ARGV[0])
7
+ if ARGV.length == 1
8
+ name = ARGV[0]
9
+
10
+ if Tmuxinator::Config.exists?(name)
11
+ Tmuxinator::Cli.new.start(name)
12
+ else
13
+ Tmuxinator::Cli.start
14
+ end
9
15
  else
10
16
  Tmuxinator::Cli.start
11
17
  end
@@ -4,8 +4,14 @@ $: << File.expand_path("../../lib/", __FILE__)
4
4
  require "thor"
5
5
  require "tmuxinator"
6
6
 
7
- if ARGV.length == 1 && (ARGV & Tmuxinator::Cli.new.command_list).empty?
8
- Tmuxinator::Cli.new.start(ARGV[0])
7
+ if ARGV.length == 1
8
+ name = ARGV[0]
9
+
10
+ if Tmuxinator::Config.exists?(name)
11
+ Tmuxinator::Cli.new.start(name)
12
+ else
13
+ Tmuxinator::Cli.start
14
+ end
9
15
  else
10
16
  Tmuxinator::Cli.start
11
17
  end
@@ -15,4 +15,4 @@ _tmuxinator() {
15
15
  fi
16
16
  }
17
17
 
18
- complete -F _tmuxinator -o tmuxinator mux
18
+ complete -F _tmuxinator tmuxinator mux
@@ -1,35 +1,25 @@
1
- # ~/.tmuxinator/<%= @name %>.yml
2
- # you can make as many tabs as you wish...
1
+ # ~/.tmuxinator/<%= name %>.yml
2
+
3
+ name: <%= name %>
4
+ root: ~/
5
+
6
+ # Optional tmux socket
7
+ # socket_name: foo
8
+
9
+ # Runs before everything. Use it to start daemons etc.
10
+ # pre: sudo /etc/rc.d/mysqld start
11
+
12
+ # Runs in each window and pane before window/pane specific commands. Useful for setting up interpreter versions.
13
+ # pre_window: rbenv shell 2.0.0-p247
14
+
15
+ # Pass command line options to tmux. Useful for specifying a different tmux.conf.
16
+ # tmux_options: -f ~/.tmux.mac.conf
3
17
 
4
- name: sample
5
- root: ~/test
6
- socket_name: foo # Remove to use default socket
7
- pre: sudo /etc/rc.d/mysqld start # Runs before everything
8
- pre_window: rbenv shell 2.0.0-p247 # Runs in each tab and pane
9
- tmux_options: -v -2 # Pass arguments to tmux
10
18
  windows:
11
19
  - editor:
12
- pre:
13
- - echo "I get run in each pane, before each pane command!"
14
- -
15
20
  layout: main-vertical
16
21
  panes:
17
22
  - vim
18
- - #empty, will just run plain bash
19
- - top
20
- - shell: git pull
21
- - guard:
22
- layout: tiled
23
- pre:
24
- - echo "I get run in each pane."
25
- - echo "Before each pane command!"
26
- panes:
27
- -
28
- - #empty, will just run plain bash
29
- -
30
- - database: bundle exec rails db
23
+ - guard
31
24
  - server: bundle exec rails s
32
- - logs: tail -f log/development.log
33
- - console: bundle exec rails c
34
- - capistrano:
35
- - server: ssh user@example.com
25
+ - logs: tail -f logs/development.log
@@ -36,7 +36,7 @@ module Tmuxinator
36
36
 
37
37
  unless Tmuxinator::Config.exists?(name)
38
38
  template = Tmuxinator::Config.default? ? Tmuxinator::Config.default : Tmuxinator::Config.sample
39
- erb = ERB.new(File.read(template)).result(binding)
39
+ erb = Erubis::Eruby.new(File.read(template)).result(binding)
40
40
  File.open(config, "w") { |f| f.write(erb) }
41
41
  end
42
42
 
@@ -52,7 +52,7 @@ module Tmuxinator
52
52
  if project.deprecations.any?
53
53
  project.deprecations.each { |deprecation| say deprecation, :red }
54
54
  puts
55
- print "Press any key to continue."
55
+ print "Press ENTER to continue."
56
56
  STDIN.getc
57
57
  end
58
58
 
@@ -92,9 +92,9 @@ module Tmuxinator
92
92
  map "rm" => :delete
93
93
 
94
94
  def delete(project)
95
- config = "#{Tmuxinator::Config.root}#{project}.yml"
95
+ if Tmuxinator::Config.exists?(project)
96
+ config = "#{Tmuxinator::Config.root}/#{project}.yml"
96
97
 
97
- if Tmuxinator::Config.exists?(config)
98
98
  if yes?("Are you sure you want to delete #{project}?", :red)
99
99
  FileUtils.rm(config)
100
100
  say "Deleted #{project}"
@@ -104,7 +104,7 @@ module Tmuxinator
104
104
  end
105
105
  end
106
106
 
107
- desc "implode", "Delets all tmuxinator projects"
107
+ desc "implode", "Deletes all tmuxinator projects"
108
108
  map "i" => :implode
109
109
 
110
110
  def implode
@@ -36,7 +36,7 @@ module Tmuxinator
36
36
 
37
37
  def project(name)
38
38
  projects = Dir.glob("#{root}/**/*.yml")
39
- project_file = projects.detect { |project| project =~ /#{name}.yml/ }
39
+ project_file = projects.detect { |project| project =~ /^#{name}.yml$/ }
40
40
  project_file || "#{root}/#{name}.yml"
41
41
  end
42
42
 
@@ -1,3 +1,3 @@
1
1
  module Tmuxinator
2
- VERSION = "0.6.4"
2
+ VERSION = "0.6.5"
3
3
  end
@@ -1,5 +1,4 @@
1
1
  # ~/.tmuxinator/sample.deprecations.yml
2
- # you can make as many tabs as you wish...
3
2
 
4
3
  project_name: sample
5
4
  project_root: ~/test
@@ -114,13 +114,13 @@ describe Tmuxinator::Config do
114
114
  Tmuxinator::Config.stub(:root => path)
115
115
  end
116
116
 
117
- context 'with project yml' do
117
+ context "with project yml" do
118
118
  it "gets the project as path to the yml file" do
119
119
  expect(Tmuxinator::Config.project("sample")).to eq "#{root}/sample.yml"
120
120
  end
121
121
  end
122
122
 
123
- context 'without project yml' do
123
+ context "without project yml" do
124
124
  it "gets the project as path to the yml file" do
125
125
  expect(Tmuxinator::Config.project("new-project")).to eq "#{root}/new-project.yml"
126
126
  end
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
4
+ version: 0.6.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Allen Bargi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-06 00:00:00.000000000 Z
11
+ date: 2013-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor