On May 21, 2008, at 4:51 PM, Anka Anka wrote:

> How to generate apache password  with ruby? I have to generate from  
> ruby
> code the same password like htpasswd2 -m make. In other words: from  
> ruby
> on rails application I have to generate a password, which will be used
> not only for login, but also to generate apache config files (e.g.
> password files for subversion) - so the password must be exactly the
> same.
> Can someone help me?
> Sorry for my english...

the webrick library, which is included with ruby, has tools for  
generating and manipulating htpasswd files - the docs are slim but the  
code is quite easy to read

start with

   webrick/httpauth/htpasswd.rb

cheers.

a @ http://codeforpeople.com/
--
we can deny everything, except that we have the possibility of being  
better. simply reflect on that.
h.h. the 14th dalai lama