Teamocil Makes Your Life Better: Rails Edition
Warning: This post is very old. It may be out of date, and links in it may not work. Continue at your own risk.
I’ve never worked for a product company, and I have lots of personal projects. Because of this, I find myself jumping between different projects constantly. I manage this by keeping up to date Teamocil profiles for each project I work on, and using a development tools that fit completely inside of a tmux session (with the exception of my web browser, of course.)
There are lots of kinds of projects where your tools can’t all run inside of terminals. Because I work primarily on Rails projects, I get to live in my terminal most of the time.
Here’s an example Teamocil configuration for a simple Rails project.
name: Project Name
windows:
- name: editor
root: ~/Codes/project_name
focus: true
layout: even-vertical
panes:
- commands:
- clear && git status
focus: true
- name: server
root: ~/Codes/project_name
layout: even-vertical
panes:
- clear && bundle exec rails s -p 9876
- name: logs
root: ~/Codes/project_name
layout: even-vertical
panes:
- clear && tail -f log/test.log
- clear && tail -f log/development.log | grep -e "Started\|Rendered\|Completed\|Served"
- clear && tail -f log/development.log | grep -e "SQL\|CACHE"
This gives me a window for running my editor (Vim), a window with my rails server
, and
then a window where I can see vertical splits showing important info from the
logs.
Being able to monitor which SQL queries are being run, and the view lifecycle at glance comes in very handy when you’re debugging an unexpected bug in an application.
For added convenience, I have them on in a private gist, so that on new
machines I can run git clone git@gist.github.com:REDACTED.git ~/.teamocil
to
get my up to date profiles.
For projects that require additional processes for development (like webpack) it’s easy to add more windows or panes to handle those.
I provide technical leadership, risk assessment, project planning, training, and additional development to software teams. If you need help taking a project from idea through execution, get in touch.