Permalink
Browse files

added tmuxinator doctor and improved readme

  • Loading branch information...
1 parent 0ffe2e7 commit 03a43a08e99b4bbd2a6044d0e066a08946766e4c @aziz aziz committed Dec 12, 2010
Showing with 104 additions and 31 deletions.
  1. +39 −25 README.md
  2. +22 −0 Rakefile
  3. +21 −5 lib/tmuxinator/cli.rb
  4. +22 −1 tmuxinator.gemspec
View
@@ -9,48 +9,48 @@ Create and manage tmux sessions easily. Inspired by Jon Druse's ([Screeninator](
## Installation
-
$ gem install tmuxinator
-
+
Then follow the instructions. You just have to drop a line in your ~/.bashrc file, similar to RVM if you've used that before:
- if [[ -s $HOME/.tmuxinator/scripts/tmuxinator ]] ; then source $HOME/.tmuxinator/scripts/tmuxinator ; fi
+ [[ -s $HOME/.tmuxinator/scripts/tmuxinator ]] && source $HOME/.tmuxinator/scripts/tmuxinator
-## Editor
+## Editor and Shell
tmuxinator uses your shell's default editor for opening files. If you're not sure what that is type:
-
+
$ echo $EDITOR
-
-For me that produces "mate -w"
+
+For me that produces "mate -w"
If you want to change your default editor simple put a line in ~/.bashrc that changes it. Mine looks like this:
export EDITOR='mate -w'
+It also uses $SHELL variable. which is always set by your shell.
+
## Usage
-
+
### Create a project ###
-
+
$ tmuxinator open project_name
-
-Create or edit your projects with this command. Your default editor ($EDITOR) is used to open the file. If this is a new project you will see this default config:
+
+Create or edit your projects with this command. aliased to `o`. Your default editor ($EDITOR) is used to open the file. If this is a new project you will see this default config:
# ~/.tmuxinator/project_name.yml
# you can make as many tabs as you wish...
- escape: ``
project_name: tmuxinator
project_root: ~/code/rails_project
tabs:
- shell: git pull
- database: rails db
- console: rails c
- - logs:
+ - logs:
- cd logs
- tail -f development.log
- ssh: ssh me@myhost
-
+
If a tab contains multiple commands, they will be 'joined' together with '&&'.
@@ -60,18 +60,22 @@ If you want to have your own default config, place it into $HOME/.tmuxinator/def
## Starting a project
$ start_project_name
-
+
This will fire up tmux with all the tabs you configured.
### Limitations ###
-After you create a project, you will have to open a new shell window. This is because tmuxinator adds an alias to bash to open tmux with the project config.
+After you create a project, you will have to open a new shell window. This is because tmuxinator adds an
+alias to bash (or any other shell you use, like zsh) to open tmux with the project config. You can reload your shell rc file
+instead of openning a new window like this, for instance in bash you could do this:
+
+ $ source ~/.bashrc
## Other Commands
$ tmuxinator copy existing_project new_project
-Copy an existing project.
+Copy an existing project. aliased to `c`
$ tmuxinator update_scripts
@@ -80,24 +84,35 @@ Re-create the tmux scripts and aliases from the configs. Use this only if you ed
$ tmuxinator list
-
-List all the projects you have configured
+
+List all the projects you have configured. aliased to `l`
+
$ tmuxinator delete project_name
-
+
Remove a project
+
$ tmuxinator implode
-
-Remove all tmuxinator configs, aliases and scripts.
+Remove all tmuxinator configs, aliases and scripts. aliased to `i`
+
+
+ $ tmuxinator version
+
+shows tmuxinator's version. aliased to `v`
+
+
+ $ tmuxinator help
+
+shows tmuxinator's help. aliased to `h`
## Questions? Comments? Feature Request?
I would love to hear your feedback on this project! Send me a message!
## Contributing to tmuxinator
-
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
* Fork the project
@@ -108,5 +123,4 @@ I would love to hear your feedback on this project! Send me a message!
## Copyright
-Copyright (c) 2010 Allen Bargi. See LICENSE.txt for
-further details.
+Copyright (c) 2010 Allen Bargi. See LICENSE.txt for further details.
View
@@ -19,6 +19,28 @@ Jeweler::Tasks.new do |gem|
gem.description = %Q{Create and manage complex tmux sessions easily.}
gem.email = "allen.bargi@gmail.com"
gem.authors = ["Allen Bargi"]
+ gem.post_install_message = %{
+ __________________________________________________________
+ ..........................................................
+
+ Thank you for installing tmuxinator
+ Please be sure to to drop a line in your ~/.bashrc file, similar
+ to RVM if you've used that before:
+
+ [[ -s $HOME/.tmuxinator/scripts/tmuxinator ]] && source $HOME/.tmuxinator/scripts/tmuxinator
+
+ also ensure that you've set these variables in your ENV:
+
+ $EDITOR, $SHELL
+
+ you can run `tmuxinator doctor` to make sure everything is set.
+ happy tmuxing with tmuxinator!
+
+ ..........................................................
+ __________________________________________________________
+
+ }
+
# Include your dependencies below. Runtime dependencies are required when using your gem,
# and development dependencies are only needed for development (ie running rake tasks, tests, etc)
# gem.add_runtime_dependency 'jabber4r', '> 0.1'
View
@@ -16,7 +16,7 @@ def start(*args)
# print the usage string, this is a fall through method.
def usage
- puts <<"DOC"
+ puts %{
Usage: tmuxinator ACTION [Arg]
ACTOINS:
@@ -34,7 +34,7 @@ def usage
shows this help document
version
-DOC
+}
end
alias :help :usage
alias :h :usage
@@ -114,11 +114,11 @@ def list(*args)
alias :ls :list
def version
- system("cat #{File.dirname(__FILE__) + '/../../VERSION'}")
- puts
+ system("cat #{File.dirname(__FILE__) + '/../../VERSION'}")
+ puts
end
alias :v :version
-
+
def update_scripts
Dir["#{root_dir}*.tmux"].each {|p| FileUtils.rm(p) }
aliases = []
@@ -129,6 +129,22 @@ def update_scripts
Tmuxinator::ConfigWriter.write_aliases(aliases)
end
+ def doctor
+ print " cheking if tmux is installed ==> "
+ puts system("which tmux > /dev/null") ? "Yes" : "No"
+ print " cheking if $EDITOR is set ==> "
+ puts ENV['EDITOR'] ? "Yes" : "No"
+ print " cheking if $SHELL is set ==> "
+ puts ENV['SHELL'] ? "Yes" : "No"
+ puts %{
+ make sure you have this line in your ~/.bashrc file:
+
+ [[ -s $HOME/.tmuxinator/scripts/tmuxinator ]] && source $HOME/.tmuxinator/scripts/tmuxinator
+
+
+}
+ end
+
def method_missing(method, *args, &block)
puts "There's no command called #{method} in tmuxinator"
usage
View
@@ -9,7 +9,7 @@ Gem::Specification.new do |s|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Allen Bargi"]
- s.date = %q{2010-12-11}
+ s.date = %q{2010-12-12}
s.default_executable = %q{tmuxinator}
s.description = %q{Create and manage complex tmux sessions easily.}
s.email = %q{allen.bargi@gmail.com}
@@ -41,6 +41,27 @@ Gem::Specification.new do |s|
]
s.homepage = %q{http://github.com/aziz/tmuxinator}
s.licenses = ["MIT"]
+ s.post_install_message = %q{
+ __________________________________________________________
+ ..........................................................
+
+ Thank you for installing tmuxinator
+ Please be sure to to drop a line in your ~/.bashrc file, similar
+ to RVM if you've used that before:
+
+ [[ -s $HOME/.tmuxinator/scripts/tmuxinator ]] && source $HOME/.tmuxinator/scripts/tmuxinator
+
+ also ensure that you've set these variables in your ENV:
+
+ $EDITOR, $SHELL
+
+ you can run `tmuxinator doctor` to make sure everything is set.
+ happy tmuxing with tmuxinator!
+
+ ..........................................................
+ __________________________________________________________
+
+ }
s.require_paths = ["lib"]
s.rubygems_version = %q{1.3.7}
s.summary = %q{Create and manage complex tmux sessions easily.}

0 comments on commit 03a43a0

Please sign in to comment.