how to read this

M

msoulier

I was recently looking to compute a sha1 hash in ruby, and l luckily
google turned up a quick example because I found the digest docs here
http://www.ruby-doc.org/stdlib/ very cryptic and difficult to read.

How am I to interpret what I see in the digest api docs? There's no
example, not even an obvious entry point. How do I look at that doc
and know what I need to "require" and then what classes I'll be using
to accomplish my task?

Luckily this dude and google to the rescue http://snippets.dzone.com/posts/show/83.

Mike
 
S

Sven Schott

[Note: parts of this message were removed to make it a legal post.]

I have usually found that either the base class or file usually have the
details for usage. I admit the digest class docs are a bit sparse but they
are there.

http://www.ruby-doc.org/stdlib/libdoc/digest/rdoc/classes/Digest/Class.html

It shows an example for both a string and a file. As for the require, I
usually just require the file or folder at the base of the list of files. In
this case it is 'digest'.
 
M

msoulier

I have usually found that either the base class or file usually have the
details for usage. I admit the digest class docs are a bit sparse but they
are there.

Yeah, sort of. No hard example for SHA1, but you can replace Class
with SHA1 and you're good I suppose.

I tried modifying the digest.rb file in my source tarball and re-
running "rdoc --ri" over the whole tree, and it did not capture my
rdoc at all. If I run "ri Digest" it finds nothing.

If I instead cd into the directory containing the digest.rb file and
run "rdoc --ri" then it gets picked up. I was hoping to submit a patch
with better docs, but I'm curious as to why my rdoc wasn't picked up
if I run it at the top level of the source tree. Any ideas?

make install-doc basically runs "rdoc --ri", and it didn't pick up my
changes either.

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,266
Messages
2,571,075
Members
48,772
Latest member
Backspace Studios

Latest Threads

Top