Colorizing console Ruby-script output

Posted by Dmytro Shteflyuk on under Ruby & Rails

Very often I have to implement console scripts (because of my laziness, for boring processes optimization). Many of them write some information to the output, show process status or display results of work. Anyway, it’s very wearisome action to read script output, and I want to highlight most important things: errors in red, successfully finished steps in green color, etc. And it is a case when ANSI escape sequences could help. They are supported by the most terminals, including VT100 (btw, Windows NT family console does not support it, but I will back to this issue later).

Read the rest of entry »

Encoding media files in Ruby using ffmpeg/mencoder with progress tracking

Posted by Dmytro Shteflyuk on under Ruby & Rails

In my current project I need to encode media files from any format to several predefined. Furthermore I need to track progress and show it for the customer. I don’t want to describe wich media formats I need and what troubles with converting (maybe it will be my future posts, if anybody interested), instead I will describe common idea how to implement encoder scripts and how to track progress.

Read the rest of entry »