Friday, April 24, 2009

RDoc preview in Textmate

While working on writing some RDOC documentation within Textmate, Rein Henrichs and I ran into a problem. Textmate will give you previews if you use markdown, but not RDOC. Below is how to do it.

Create /usr/bin/rdoc2html:

#!/usr/bin/env ruby -rrdoc/markup/simple_markup -rrdoc/markup/simple_markup/to_html
input = ARGF ? ARGF.read : STDIN.read
print SM::SimpleMarkup.new.convert(input, SM::ToHtml.new)
Make the file executable:

sudo chmod +x /usr/bin/rdoc2html
In textmate, hit Cntrl-Option-Command-P. In the bottom left corner, click Show options. Click the Pipe text through checkbox and enter "/usr/bin/rdoc2html" in the text box.

Tuesday, April 21, 2009

GitHub set author/committer

I've been working with Git lately and more specifically GitHub. I noticed something odd one day. Where most commits have one author listed, these commits had both a author and a committer listed.

More specifically, the author field was the two members of the pair and the committer name was the workstation they were working on.

Example:

After playing around with it for a while, I figured out how to do it. Within a git project clone, run the following commands.

1) git config user.name = 'Workstation Perlwizard'
2) git config user.email = 'devs2@perlwizard.org'
3) export GIT_AUTHOR_NAME='Bob Smith and Betty Jones'
4) export GIT_AUTHOR_EMAIL='devs@perlwizard.org'

Both of the email addresses need to be addresses Github doesn't know about (i.e. not used to sign up for an account).

I could see using this while pairing with someone so you both get name credit for your commits.

Labels: , ,