Engine Yard Blog RSS Feed

- tab1:
- cd ~/foo/bar
- gitx
- tab2:
- mysql -u root)
- use test;
- show tables;
- tab3: echo "hello world"
- tab4: cd ~/baz/ && git pull
- tab5:
- cd ~/foo/project
- autotest

Some people might like using this syntax. If you are one of these people, you can enabled it by using $ terminitor edit foo --syntax yml. However, the newer Ruby DSL Syntax is much nicer and allows you to use it with a lot more complicated behavior such as window creation and setting up blocks that can be executed before loading a project.

A simple example that I think many people will find useful is starting up the server, tailing the log and opening the project up in their favorite text editor. Currently, my favorite text editor is Textmate, but I'm transitioning into the wonderful world of MacVim.

window do
  before { run 'cd ~/Projects/test' }

  tab "mate .", "passenger start"

  tab "tail -f log/passenger.3000.log"

  tab "open http://localhost:3000"
end

"But wait, Danish didn't you read Rails AntiPatterns?! You're supposed to have tests!" Yes, I know TDD is very important and I'm working on that. A good example of using Terminitor with tests is the Terminitor project itself. Another cool Terminitor feature is the ability to fetch Github Projects. One caveat is that you need to have the github-gem installed. All you have to do then is $ terminitor fetch achiu terminitor once the repo is cloned terminitor will automatically run the setup block that is in the Termfile for you.

# Terminitor Termfile

setup 'bundle install'

run 'watchr test.watchr'
tab "irb"
tab "open 'http://www.github.com/achiu/terminitor/issues'"

As you can see there is a watchr file that we run in one of our tabs so that every time we make a change to any of our files, the test corresponding with it will run and notify us if anything goes wrong.

Now that I've highlighted the features of Terminitor that I've found most useful, I suggest that you head over to the github page to check it out for yourself and figure out other things you can do with it to make your life easier.

One thing you might enjoy is Termfile, a new project on github that I created. This was inspired by gitignore, a project from Chris Wanstrath (aka defunkt). I know all of you Terminitor users out there have some really cool Termfiles that the rest of us can utilize. I know the rest of you will start creating some really useful ones. So, fork the Termfile project and add your Termfile in the appropriate directory so that others can find and use them for their projects too.


Tagged:

comments powered by Disqus