pmhack, podpreview, rcsync

I finally got to package some of my automation scripts as proper distributions and upload them to CPAN in the hope that somebody else may find them useful too.

pmhack

Usage:

pmhack Some::Module::Name

This app makes it easy to make a copy of an installed module from its original location in @INC to a directory where you can safely hack on it. In order to use it, you need to set an environment variable PERL5HACKLIB which points to a directory where modules will be copied. You also need to add the directory from PERL5HACKLIB to PERL5LIB, so that the new version of the module will be used instead of the original one. pmhack takes care of creating all necessary directories, copying the file and making it writable. On success it prints the path to the newly copied module, so you can do:

vim `pmhack Some::Module::Name`

podpreview

Usage:

podpreview path/to/pod/file

This app converts a file containing POD into html and launches a browser do display it. I wrote it primarily because I find it easier to spot errors or discrepancies in a POD document when viewing it as html. Now I can do the following in vim while editing a file:

:!podpreview %

rcsync

Usage:

rcsync profile1 profile2

This is an app I wrote to help me sync my configuration files across the different machines where I work (my office computer, my home computer and my laptop). For each configuration file, I create a template which contains the settings that will be common across all machines, and for any settings that are machine-specific, e.g. file paths, I use template variables. All templates are stored in a common directory, which I keep in sync via a free private git repo from Assembla. On each machine there is a ~/.rcsync configuration file that contains information about how each template should be deployed: the file where it should be written and the variables that it should be passed. These settings are organized in "profiles". Currently one profile corresponds to one configuration file, but this will change and in the future you will be able to sync multiple files and directories via a single profile (e.g. .vimrc and vim plugins via a "vim" profile). So for example, if I want to make a change to my local .vimrc, whose settings I have configured in a profile called "vim", I would make edit directly the template file and then run rcsync vim to deploy it. Afterwards when I am on a different machine I would run git pull on the templates directory and then rcsync vim to update my .vimrc there, or rcsync --all to apply updates to all profiles.

Posted in Modules
blog comments powered by Disqus