tmuxinator 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +17 -0
  3. data/.rspec +1 -1
  4. data/.travis.yml +5 -0
  5. data/CHANGELOG.md +36 -0
  6. data/CONTRIBUTING.md +29 -0
  7. data/Gemfile +4 -7
  8. data/{LICENSE.txt → LICENSE} +1 -1
  9. data/README.md +128 -118
  10. data/Rakefile +1 -72
  11. data/bin/mux +8 -3
  12. data/bin/tmuxinator +8 -3
  13. data/completion/tmuxinator.bash +18 -0
  14. data/completion/tmuxinator.zsh +20 -0
  15. data/lib/tmuxinator.rb +13 -7
  16. data/lib/tmuxinator/assets/sample.yml +24 -11
  17. data/lib/tmuxinator/assets/template.erb +47 -0
  18. data/lib/tmuxinator/cli.rb +121 -145
  19. data/lib/tmuxinator/config.rb +92 -0
  20. data/lib/tmuxinator/deprecations.rb +19 -0
  21. data/lib/tmuxinator/pane.rb +36 -0
  22. data/lib/tmuxinator/project.rb +142 -0
  23. data/lib/tmuxinator/util.rb +14 -0
  24. data/lib/tmuxinator/version.rb +3 -0
  25. data/lib/tmuxinator/window.rb +76 -0
  26. data/spec/factories/projects.rb +17 -0
  27. data/spec/fixtures/sample.deprecations.yml +35 -0
  28. data/spec/fixtures/sample.yml +35 -0
  29. data/spec/lib/tmuxinator/cli_spec.rb +230 -0
  30. data/spec/lib/tmuxinator/config_spec.rb +121 -0
  31. data/spec/lib/tmuxinator/pane_spec.rb +7 -0
  32. data/spec/lib/tmuxinator/project_spec.rb +209 -0
  33. data/spec/lib/tmuxinator/util_spec.rb +4 -0
  34. data/spec/lib/tmuxinator/window_spec.rb +62 -0
  35. data/spec/spec_helper.rb +28 -8
  36. data/tmuxinator.gemspec +47 -65
  37. metadata +186 -62
  38. data/.document +0 -5
  39. data/Gemfile.lock +0 -28
  40. data/TODO +0 -4
  41. data/VERSION +0 -1
  42. data/bin/tmuxinator_completion +0 -29
  43. data/lib/tmuxinator/assets/tmux_config.tmux +0 -37
  44. data/lib/tmuxinator/config_writer.rb +0 -104
  45. data/lib/tmuxinator/helper.rb +0 -19
  46. data/spec/tmuxinator_spec.rb +0 -54
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: c72488b63a209871431234e08cab3d8e4de46429
4
+ data.tar.gz: 32b983eff05dc7171872ad9d49f37e179e0e5baf
5
+ SHA512:
6
+ metadata.gz: c2e491f97e5ba428c3284a4afe19abca683fc10b41a560e10a747d44f81bf3ca8da1460705703445aff33aa8d70ec59ec0ab7214365f3541feb3f45f025daf6b
7
+ data.tar.gz: 12d830182076112c8e188f2a784433a117b993ee0fc523e9d2ce70063fef9576a554736a52fed0f1e45caeaac9396e6b128f590c9fac59f5c4432b83448af173
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ .coveralls.yml
7
+ Gemfile.lock
8
+ InstalledFiles
9
+ _yardoc
10
+ coverage
11
+ doc/
12
+ lib/bundler/man
13
+ pkg
14
+ rdoc
15
+ spec/reports
16
+ tmp
17
+ db
data/.rspec CHANGED
@@ -1 +1 @@
1
- --color
1
+ --color --format=nested
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ language: ruby
2
+ rvm:
3
+ - "1.9.3"
4
+ - "2.0.0"
5
+ script: bundle exec rspec spec
data/CHANGELOG.md ADDED
@@ -0,0 +1,36 @@
1
+ ## 0.6.0
2
+
3
+ - Rewrote core functionality with proper abstractions and unit tests
4
+ - Fixed outstanding bugs #72 #89 #90 #93 #101 #102 #103 #104 #109
5
+ - Switched to thor for command line argument parsing
6
+ - Switched to Erubis for more Rails like ERB
7
+ - Added simplecov for test coverage
8
+ - Added debug command line option to view generated shell commands
9
+ - Added commands and completion options for completion scripts
10
+ - Added `pre_window` option for running commands before all panes and windows
11
+ - Deprecated `rbenv` in favour of `pre_window`
12
+ - Deprecated `rvm` in favour of `pre_window`
13
+ - Deprecated `cli_args` in favour of `tmux_options`
14
+ - Deprecated `tabs` in favour of `windows`
15
+ - Dropped support for Ruby 1.9.2
16
+
17
+ ## 0.5.0
18
+ - Added optional socket name support (Thanks to Adam Walters)
19
+ - Added auto completion (Thanks to Jose Pablo Barrantes)
20
+
21
+ ## 0.4.0
22
+ - Does not crash if given an invalid yaml file format. report it and exit gracefully.
23
+ - Removed clunky scripts & shell aliases (Thanks to Dane O'Connor)
24
+ - Config files are now rendered JIT (Thanks to Dane O'Connor)
25
+ - Can now start sessions from cli (Thanks to Dane O'Connor)
26
+
27
+ ## 0.3.0
28
+ - Added pre command (Thanks to Ian Yang)
29
+ - Added multiple pre command (Thanks to Bjørn Arild Mæland)
30
+ - Using tmux set default-path for project root
31
+ - New aliases
32
+
33
+ ## 0.2.0
34
+ - Added pane support (Thanks to Aaron Spiegel)
35
+ - RVM support (Thanks to Jay Adkisoon)
36
+
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,29 @@
1
+ # Contributing
2
+
3
+ ## First
4
+
5
+ * Check if the issue you're going to submit isn't already submitted in
6
+ the [Issues](https://github.com/aziz/tmuxinator/issues) page.
7
+
8
+ ## Issues
9
+
10
+ * Submit a ticket for your issue, assuming one does not already exist.
11
+ * The issue must:
12
+ * Clearly describe the problem including steps to reproduce when it is a bug.
13
+ * Also include all the information you can to make it easier for us to reproduce it,
14
+ like OS version, gem versions, rbenv or rvm versions etc...
15
+ * Even better, provide a failing test case for it.
16
+
17
+ ## Pull Requests
18
+
19
+ If you've gone the extra mile and have a patch that fixes the issue, you
20
+ should submit a Pull Request!
21
+
22
+ * Fork the repo on Github.
23
+ * Create a topic branch from where you want to base your work.
24
+ * Add a test for your change. Only refactoring and documentation changes
25
+ require no new tests. If you are adding functionality or fixing a bug,
26
+ we need a test!
27
+ * Run _all_ the tests to assure nothine else was broken. We only take pull requests with passing tests.
28
+ * Check for unnecessary whitespace with `git diff --check` before committing.
29
+ * Push to your fork and submit a pull request.
data/Gemfile CHANGED
@@ -1,8 +1,5 @@
1
- source "http://rubygems.org"
1
+ source "https://rubygems.org"
2
2
 
3
- group :development do
4
- gem "rspec", "~> 2.6.0"
5
- gem "bundler", "~> 1.0.18"
6
- gem "jeweler", "~> 1.6.4"
7
- gem "rcov", "~> 0.9.10"
8
- end
3
+
4
+ # Specify your gem's dependencies in tmuxinator.gemspec
5
+ gemspec
@@ -1,4 +1,4 @@
1
- Copyright (c) 2010 Allen Bargi
1
+ Copyright (c) 2010-2012 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
@@ -1,4 +1,4 @@
1
- # Tmuxinator
1
+ # Tmuxinator [![Build Status](https://secure.travis-ci.org/aziz/tmuxinator.png)](http://travis-ci.org/aziz/tmuxinator?branch=master) [![Coverage Status](https://coveralls.io/repos/aziz/tmuxinator/badge.png)](https://coveralls.io/r/aziz/tmuxinator) [![Code Climate](https://codeclimate.com/github/aziz/tmuxinator.png)](https://codeclimate.com/github/aziz/tmuxinator) [![Dependency Status](https://gemnasium.com/aziz/tmuxinator.png)](https://gemnasium.com/aziz/tmuxinator)
2
2
 
3
3
  Create and manage tmux sessions easily.
4
4
 
@@ -6,170 +6,180 @@ Create and manage tmux sessions easily.
6
6
 
7
7
  ![Screenshot](http://f.cl.ly/items/3e3I1l1t3D2U472n1h0h/Screen%20shot%202010-12-10%20at%2010.59.17%20PM.png)
8
8
 
9
- ### Installation
9
+ ## Installation
10
10
 
11
- $ gem install tmuxinator
11
+ ``` bash
12
+ $ gem install tmuxinator
13
+ ```
12
14
 
13
- ### Editor and Shell
15
+ ## Editor and Shell
14
16
 
15
- tmuxinator uses your shell's default editor for opening files. If you're not sure what that is type:
17
+ tmuxinator uses your shell's default editor for opening files. If you're not
18
+ sure what that is type:
16
19
 
17
- $ echo $EDITOR
20
+ ``` bash
21
+ $ echo $EDITOR
22
+ ```
18
23
 
19
- For me that produces "mate -w"
20
- If you want to change your default editor simple put a line in ~/.bashrc that changes it. Mine looks like this:
24
+ For me that produces "vim" If you want to change your default editor simple
25
+ put a line in ~/.bashrc that changes it. Mine looks like this:
21
26
 
22
- export EDITOR='mate -w'
27
+ ``` bash
28
+ export EDITOR='vim'
29
+ ```
23
30
 
31
+ ## Completion
24
32
 
25
- ### Environment Integration
33
+ Download the appropriate completion file from the repo.
26
34
 
27
- Add this to your ~/.bashrc (or similar)
35
+ ### bash
28
36
 
29
- [[ -s $HOME/.tmuxinator/scripts/tmuxinator ]] && source $HOME/.tmuxinator/scripts/tmuxinator
37
+ Add the following to your `~/.bashrc`:
30
38
 
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.
39
+ source `which tmuxinator.zsh`
33
40
 
34
- ### Usage
41
+ ### zsh
35
42
 
36
- #### Create a project
43
+ Add the following to your `~/.zshrc`:
37
44
 
38
- $ tmuxinator new project_name
45
+ source `which tmuxinator.zsh`
39
46
 
40
- Create or edit your projects with this command, for editing you can also use `tmuxinator open project_name`. `new` aliased to `o`,`open` and `n`. Your default editor ($EDITOR) is used to open the file. If this is a new project you will see this default config:
47
+ ## Usage
41
48
 
42
- # ~/.tmuxinator/project_name.yml
43
- # you can make as many tabs as you wish...
49
+ ### Create a project
44
50
 
45
- project_name: Tmuxinator
46
- project_root: ~/code/rails_project
47
- socket_name: foo # Not needed. Remove to use default socket
48
- rvm: 1.9.2@rails_project
49
- pre: sudo /etc/rc.d/mysqld start
50
- tabs:
51
- - editor:
52
- layout: main-vertical
53
- panes:
54
- - vim
55
- - #empty, will just run plain bash
56
- - top
57
- - shell: git pull
58
- - database: rails db
59
- - server: rails s
60
- - logs: tail -f logs/development.log
61
- - console: rails c
62
- - capistrano:
63
- - server: ssh me@myhost
51
+ Create or edit your projects with:
64
52
 
53
+ ``` bash
54
+ $ tmuxinator new [project]
55
+ ```
65
56
 
66
- If a tab contains multiple commands, they will be 'joined' together with '&&'.
67
- If you want to have your own default config, place it into $HOME/.tmuxinator/default.yml
57
+ For editing you can also use `tmuxinator open [project]`. `new` is aliased to
58
+ `o`,`open` and `n`. Your default editor (`$EDITOR`) is used to open the file.
59
+ If this is a new project you will see this default config:
68
60
 
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.
61
+ ``` yaml
62
+ name: Tmuxinator
63
+ root: ~/Code/tmuxinator
64
+ socket_name: foo # Remove to use default socket
65
+ pre: sudo /etc/rc.d/mysqld start # Runs before everything
66
+ pre_window: rbenv shell 2.0.0-p247 # Runs in each tab and pane
67
+ tmux_options: -v -2 # Pass arguments to tmux
68
+ windows:
69
+ - editor:
70
+ layout: main-vertical
71
+ panes:
72
+ - vim
73
+ - #empty, will just run plain bash
74
+ - top
75
+ - shell: git pull
76
+ - database: rails db
77
+ - server: rails s
78
+ - logs: tail -f logs/development.log
79
+ - console: rails c
80
+ - capistrano:
81
+ - server: ssh me@myhost
82
+ ```
70
83
 
71
- ### Panes Support
72
- you can define your own panes inside a window likes this:
84
+ If a tab contains multiple commands, they will be joined together with `&&`.
85
+ If you want to have your own default config, place it into
86
+ `$HOME/.tmuxinator/default.yml`
73
87
 
74
- - window_with_panes
75
- layout: main-vertical
76
- panes:
77
- - vim
78
- - #empty, will just run plain bash
79
- - top
88
+ The `pre` command allows you to run anything before starting the tmux session.
89
+ Could be handy to make sure you database daemons are running. Multiple commands
90
+ can be specified, just like for tabs.
80
91
 
81
- ### Starting a project
92
+ ## Panes Support
82
93
 
83
- $ start_[project_name]
94
+ You can define your own panes inside a window likes this:
84
95
 
85
- ### Shorthand
96
+ ``` yaml
97
+ - window_with_panes
98
+ layout: main-vertical
99
+ panes:
100
+ - vim
101
+ - #empty, will just run plain bash
102
+ - top
103
+ ```
86
104
 
87
- You can also use this shorthand alias for tmuxinator
88
-
89
- $ mux [command/project_name]
90
-
91
- This will fire up tmux with all the tabs you configured.
92
-
93
- ### Other Commands
94
-
95
- $ tmuxinator copy existing_project new_project
96
-
97
- Copy an existing project. aliased to `c`
98
-
99
-
100
- $ tmuxinator list
105
+ The layout setting gets handed down to tmux directly, so you can choose from
106
+ one of [the five standard
107
+ layouts](http://manpages.ubuntu.com/manpages/precise/en/man1/tmux.1.html#contenttoc6)
108
+ or [specify your own](http://stackoverflow.com/a/9976282/183537).
101
109
 
102
- List all the projects you have configured. aliased to `l`
110
+ ## Starting a session
103
111
 
112
+ This will fire up tmux with all the tabs and panes you configured.
104
113
 
105
- $ tmuxinator delete project_name
114
+ ``` bash
115
+ $ tmuinxator start [project]
116
+ ```
106
117
 
107
- Remove a project
108
-
109
-
110
- $ tmuxinator implode
111
-
112
- Remove all tmuxinator configs, aliases and scripts. aliased to `i`
113
-
114
- $ tmuxinator doctor
115
-
116
- Examines your environment and identifies problems with your configuration
118
+ ## Shorthand
117
119
 
120
+ You can also use this shorthand alias for tmuxinator
118
121
 
119
- $ tmuxinator version
122
+ ``` bash
123
+ $ mux [command]
124
+ ```
120
125
 
121
- shows tmuxinator's version. aliased to `v`
126
+ ## Interpreter Managers & Environment Variables
122
127
 
128
+ To use tmuxinator with rbenv, RVM, NVM etc, use the `pre_tab` option.
123
129
 
124
- $ tmuxinator help
130
+ ```
131
+ pre_tab: rbenv shell 2.0.0-p247
132
+ ```
125
133
 
126
- shows tmuxinator's help. aliased to `h`
134
+ These commands will run before any pane or window.
127
135
 
128
- ### Questions? Comments? Feature Request?
136
+ ## Other Commands
129
137
 
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.
138
+ Copy an existing project. Aliased to `c` and `cp`
139
+ ``` bash
140
+ $ tmuxinator copy [existing] [new]
141
+ ```
132
142
 
133
- ### Contributors
143
+ List all the projects you have configured. Aliased to `l` and `ls`
134
144
 
135
- [See the full list of contributors](https://github.com/aziz/tmuxinator/contributors)
145
+ ``` bash
146
+ $ tmuxinator list
147
+ ```
136
148
 
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)
149
+ Remove a project. Aliased to `rm`
150
+ ``` bash
151
+ $ tmuxinator delete [project]
152
+ ```
141
153
 
142
- ####v. 0.4.0
143
- * Does not crash if given an invalid yaml file format. report it and exit gracefully.
144
- * Removed clunky scripts & shell aliases (Thanks to Dane O'Connor)
145
- * Config files are now rendered JIT (Thanks to Dane O'Connor)
146
- * Can now start sessions from cli (Thanks to Dane O'Connor)
154
+ Remove all tmuxinator configs, aliases and scripts. Aliased to `i`
155
+ ``` bash
156
+ $ tmuxinator implode
157
+ ```
147
158
 
148
- ####v. 0.3.0
149
- * Added pre command (Thanks to Ian Yang)
150
- * Added multiple pre command (Thanks to Bjørn Arild Mæland)
151
- * Using tmux set default-path for project root
152
- * New aliases
159
+ Examines your environment and identifies problems with your configuration
160
+ ``` bash
161
+ $ tmuxinator doctor
162
+ ```
153
163
 
154
- ####v. 0.2.0
155
- * added pane support (Thanks to Aaron Spiegel)
156
- * RVM support (Thanks to Jay Adkisoon)
164
+ Shows tmuxinator's help. Aliased to `h`
165
+ ``` bash
166
+ $ tmuxinator help
167
+ ```
157
168
 
158
- ### Inspiration and Thanks
169
+ Shows the shell commands that get executed for a project
170
+ ```bash
171
+ $ tmuxinator debug [project]
172
+ ```
159
173
 
160
- Inspired by Jon Druse's ([Screeninator](https://github.com/jondruse/screeninator)) and Arthur Chiu's ([Terminitor](http://github.com/achiu/terminitor))
174
+ Shows tmuxinator's version.
175
+ ``` bash
176
+ $ tmuxinator version
177
+ ```
161
178
 
162
- ### Contributing to tmuxinator
179
+ ## Contributing
163
180
 
164
- * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
165
- * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
166
- * Fork the project
167
- * Start a feature/bugfix branch
168
- * Commit and push until you are happy with your contribution
169
- * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
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.
181
+ To contribute, please read the [contributing guide](https://github.com/aziz/tmuxinator/blob/master/CONTRIBUTING.md).
172
182
 
173
- ### Copyright
183
+ ## Copyright
174
184
 
175
- Copyright (c) 2010--2011 Allen Bargi. See LICENSE.txt for further details.
185
+ Copyright (c) 2010-2013 Allen Bargi. See LICENSE for further details.
data/Rakefile CHANGED
@@ -1,72 +1 @@
1
- require 'rubygems'
2
- require 'bundler'
3
- begin
4
- Bundler.setup(:default, :development)
5
- rescue Bundler::BundlerError => e
6
- $stderr.puts e.message
7
- $stderr.puts "Run `bundle install` to install missing gems"
8
- exit e.status_code
9
- end
10
- require 'rake'
11
-
12
- require 'jeweler'
13
- Jeweler::Tasks.new do |gem|
14
- # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
15
- gem.name = "tmuxinator"
16
- gem.homepage = "http://github.com/aziz/tmuxinator"
17
- gem.license = "MIT"
18
- gem.summary = %Q{Create and manage complex tmux sessions easily.}
19
- gem.description = %Q{Create and manage complex tmux sessions easily.}
20
- gem.email = "allen.bargi@gmail.com"
21
- gem.authors = ["Allen Bargi"]
22
- gem.post_install_message = %{
23
- __________________________________________________________
24
- ..........................................................
25
-
26
- Thank you for installing tmuxinator
27
- Please be sure to to drop a line in your ~/.bashrc file, similar
28
- to RVM if you've used that before:
29
-
30
- [[ -s $HOME/.tmuxinator/scripts/tmuxinator ]] && source $HOME/.tmuxinator/scripts/tmuxinator
31
-
32
- also ensure that you've set these variables in your ENV:
33
-
34
- $EDITOR, $SHELL
35
-
36
- you can run `tmuxinator doctor` to make sure everything is set.
37
- happy tmuxing with tmuxinator!
38
-
39
- ..........................................................
40
- __________________________________________________________
41
-
42
- }
43
-
44
- # Include your dependencies below. Runtime dependencies are required when using your gem,
45
- # and development dependencies are only needed for development (ie running rake tasks, tests, etc)
46
- # gem.add_runtime_dependency 'jabber4r', '> 0.1'
47
- # gem.add_development_dependency 'rspec', '> 1.2.3'
48
- end
49
- Jeweler::RubygemsDotOrgTasks.new
50
-
51
- require 'rspec/core'
52
- require 'rspec/core/rake_task'
53
- RSpec::Core::RakeTask.new(:spec) do |spec|
54
- spec.pattern = FileList['spec/**/*_spec.rb']
55
- end
56
-
57
- RSpec::Core::RakeTask.new(:rcov) do |spec|
58
- spec.pattern = 'spec/**/*_spec.rb'
59
- spec.rcov = true
60
- end
61
-
62
- task :default => :spec
63
-
64
- require 'rake/rdoctask'
65
- Rake::RDocTask.new do |rdoc|
66
- version = File.exist?('VERSION') ? File.read('VERSION') : ""
67
-
68
- rdoc.rdoc_dir = 'rdoc'
69
- rdoc.title = "tmuxinator #{version}"
70
- rdoc.rdoc_files.include('README*')
71
- rdoc.rdoc_files.include('lib/**/*.rb')
72
- end
1
+ require "bundler/gem_tasks"