[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Ruby in HTML

Jeff Miller

5/7/2008 2:13:00 AM

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
--
Posted via http://www.ruby-....

3 Answers

Tim Pease

5/7/2008 3:36:00 AM

0

On May 6, 2008, at 8:12 PM, 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?
>

Might you be looking for something like Webby?

<http://webby.rubyforg...

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

Phillip Gawlowski

5/7/2008 7:20:00 AM

0

-----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.bl...

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....

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

Jeremy Hinegardner

5/8/2008 5:12:00 AM

0

On Wed, May 07, 2008 at 11:12:56AM +0900, 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?

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.ne...

enjoy,

-jeremy

--
========================================================================
Jeremy Hinegardner jeremy@hinegardner.org