New version of capistrano_colors released.

Just released a new version of capistrano_colors. This is a total rewrite from the last version. This post show some of the bigger changes.

The biggest/coolest changes:

  • You can write your own custom machers and colorize rows that’s special for you.
  • I found a pretty neat way of making capistrano_colors system wide.
  • You can hide rows that you do not care for

I do not want to bore you more so I’ll just skip to an example 😉

If you have not already, install capistrano_colors (v.0.5.0)

1
   sudo gem install capistrano_colors

The following commands can go into deploy.rb or ~/.caprc depending if you want cc for a single project or system wide.

1
2
3
4
5
6
7
8
9
10
   require 'capistrano_colors'

   capistrano_color_matchers = [
     { :match => /command finished/,       :color => :hide,      :prio => 10 },
     { :match => /executing command/,      :color => :blue,      :prio => 10, :attribute => :underscore },
     { :match => /^transaction: commit$/,  :color => :magenta,   :prio => 10, :attribute => :blink },
     { :match => /git/,                    :color => :white,     :prio => 20, :attribute => :reverse },
   ]

   colorize( capistrano_color_matchers )

The only mandatory options are :match, :colors and :prio.

A fast description of the options:

  • :match – A regular expression of the row to match.
  • :color – The color we want on the matching rows.
  • :prio – What prio should this rule have (higher = more prio)
  • :attribute – Special effect (:underline, :reverse, :blink)
  • :level – Specify if this matcher should be bound to some of capistranos log levels (info,debug,…)
  • A more detailed description can be found at http://github.com/stjernstrom/capistrano_colors/tree/master

    As this is a rewrite I would love some feedback.

    Thanks!

    Posted in gems, Programming, Projects, Rails, Ruby at January 4th, 2009. Trackback URI: trackback Tags: , , , , , Written by: 

    It's past my bedtime is using WP-Gravatar