Create HTML files using RUBY

I cant try it for next few days, there is some issue with my computer.
How do you think the code can be made better.

Marnen Laibow-Koser wrote:

···

Krithika San wrote:

I am told to create static HTML page and asked to write something like
what Marnen has quoted. External library and CGI script are also not
required to use.
So let me try what Marnen has mentioned.

Could you tell me if I can do something like this

file_html = File.new("sample.html", "w+")
file_html.puts "<HTML><BODY BGCOLOR='green'>"
file_html.puts "<CENTER>This is a color</CENTER><br>"
file_html.puts "<CENTER><FONT COLOR='yellow'>This is
yellowww</FONT></CENTER>"
file_html.puts "</BODY></HTML>"
file_html.close()
system("start sample.html")

--
Posted via http://www.ruby-forum.com/\.

I don't think the OP said he couldn't use frameworks. I think he can't
use a *web* framework, probably because he wants something more
lightweight.

I second the HAML or ERb suggestion.

http://haml-lang.com/

David

···

On Nov 5, 1:39 am, Gregory Brown <gregory.t.br...@gmail.com> wrote:

On Thu, Nov 5, 2009 at 12:08 AM, Ken Bloom <kbl...@gmail.com> wrote:
> On Thu, 05 Nov 2009 12:31:43 +0900, Gregory Brown wrote:

>> But FWIW, Haml can easily be vendored, so you can probably sneak it in
>> just as easily.

>> -greg

> Umm only if you're allowed to use a framework that supports
> "vendoring" (whatever that is).

All it means is packaging someone elses source with yours and adding
it somewhere in the loadpath. No framework needed.

Krithika San wrote:

I cant try it for next few days, there is some issue with my computer.

Then try it here:
http://tryruby.sophrinix.com/

···

--
Posted via http://www.ruby-forum.com/\.