Ruby in HTML

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-forum.com/.

Might you be looking for something like Webby?

<http://webby.rubyforge.org/&gt;

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

···

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?

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)

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

···

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?

--

Jeremy Hinegardner jeremy@hinegardner.org