Ruby in HTML

J

Jeff Miller

Hello,
I've been googling this, but with no concrete answers... Ruby 186-26 is
installed on my system - I was wondering if I could use Ruby in HTML
files that are just on my local machine. Thus far I've been
unsuccessful. I'd just like to do some reading of local files and
parsing then show it in the browser. Can I do this with Ruby? If so, any
suggestions as to how?

Thanks!
- Jeff Miller
 
T

Tim Pease

Hello,
I've been googling this, but with no concrete answers... Ruby 186-26
is
installed on my system - I was wondering if I could use Ruby in HTML
files that are just on my local machine. Thus far I've been
unsuccessful. I'd just like to do some reading of local files and
parsing then show it in the browser. Can I do this with Ruby? If so,
any
suggestions as to how?

Might you be looking for something like Webby?

<http://webby.rubyforge.org/>

It's a tool for generating HTML files from other text files containing
markup (textile, markdown, haml, or HTML with embedded Ruby). It
includes the Heel webserver for displaying local pages after they are
rendered. Read through the Webby tutorial and see if that meets your
needs.

Blessings,
TwP
 
P

Phillip Gawlowski

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jeff Miller wrote:
| Hello,
| I've been googling this, but with no concrete answers... Ruby 186-26 is
| installed on my system - I was wondering if I could use Ruby in HTML
| files that are just on my local machine. Thus far I've been
| unsuccessful. I'd just like to do some reading of local files and
| parsing then show it in the browser. Can I do this with Ruby? If so, any
| suggestions as to how?


Rails and Merb are probably the easiest way to get started.

Otherwise, look for ERb or eruby, and you might want to try your hand at
mod_ruby (which is ok to run one concurrent instance of Ruby, it might
get interesting with more than one).

- --
Phillip Gawlowski
Twitter: twitter.com/cynicalryan
Blog: http://justarubyist.blogspot.com

Write and test a big program in small pieces.
~ - The Elements of Programming Style (Kernighan & Plaugher)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkghWCgACgkQbtAgaoJTgL/xfgCfd8UQkeaBfEZUBicubpjZykQQ
rzUAoI2Izio17nx7eDjwjDGVDrv8VVbE
=wlJn
-----END PGP SIGNATURE-----
 
J

Jeremy Hinegardner

Hello,
I've been googling this, but with no concrete answers... Ruby 186-26 is
installed on my system - I was wondering if I could use Ruby in HTML
files that are just on my local machine. Thus far I've been
unsuccessful. I'd just like to do some reading of local files and
parsing then show it in the browser. Can I do this with Ruby? If so, any
suggestions as to how?

Do you mean use ruby to serve the local html files to your browser? This can be
accomplished with the 'heel' gem.

gem install heel

heel -r directory/to/html/files

If you mean parse the html files and extract information from them, you would
probably want to look at 'hpricot'. http://code.whytheluckystiff.net/hpricot/

enjoy,

-jeremy
 

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

Similar Threads


Members online

Forum statistics

Threads
473,781
Messages
2,569,615
Members
45,294
Latest member
LandonPigo

Latest Threads

Top