Color Parser

M

Mary Dixon

Okay, people,

I know almost nothing about Ruby, unfortunately. But I do know that I want
my color parser to work for me. This is what I've been doing in the
terminal:

sawtooth:~ marydixon$ ruby /Users/marydixon/Documents/business\
docs/htmlcolors.rb

HTML Color Table Generator
version 0.0.1
by W. Kent Starr (C)2002 SpiderwomanWebDesign.com
-------------------------------------------------

File or directory to process: /Users/marydixon/Desktop/style.css
Name of output file [colortable.html]:
Title of color table [Color Table for /Users/marydixon/Desktop/style.css ]:
Page background color [white]:
Page foreground color [navy]:

Press [ENTER] to begin
/Users/marydixon/Documents/business docs/htmlcolors.rb:213:in `initialize':
No such file or directory - "/Users/marydixon/Desktop/style.css "
(Errno::ENOENT)
from /Users/marydixon/Documents/business docs/htmlcolors.rb:213:in
`new'
from /Users/marydixon/Documents/business docs/htmlcolors.rb:213:in
`scanFile'
from /Users/marydixon/Documents/business docs/htmlcolors.rb:294:in
`process'
from /Users/marydixon/Documents/business docs/htmlcolors.rb:376
sawtooth:~ marydixon$


As you can see, I get a short list of errors although it seems other things
about it work just fine. I'm trying to extract color codes from a HUGE style
sheet so I can easily make changes to it where I want to. But this color
parser is making it difficult and my lack of knowledge about why I get these
errors is out of my realm of expertise.

Eventually, I would like to create a GUI for this to make it happen a lot
slicker and return the work to the community. Any help with any of these
things would be more than appreciated especially in memory of the original
creator.

Thanks...

Mary Dixon
 
E

Esteban Manchado Velázquez

--YD3LsXFS42OYHhNZ
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Okay, people,
=20
I know almost nothing about Ruby, unfortunately. But I do know that I want
my color parser to work for me. This is what I've been doing in the
terminal:
=20
sawtooth:~ marydixon$ ruby /Users/marydixon/Documents/business\
docs/htmlcolors.rb=20
=20
HTML Color Table Generator
version 0.0.1
by W. Kent Starr (C)2002 SpiderwomanWebDesign.com
-------------------------------------------------
=20
File or directory to process: /Users/marydixon/Desktop/style.css
Name of output file [colortable.html]:
Title of color table [Color Table for /Users/marydixon/Desktop/style.css = ]:
Page background color [white]:
Page foreground color [navy]:
=20
Press [ENTER] to begin
/Users/marydixon/Documents/business docs/htmlcolors.rb:213:in `initialize= ':
No such file or directory - "/Users/marydixon/Desktop/style.css "
^^^

It seems you have a space after the filename. That's probably the probl=
em.
If it doesn't work after fixing that and you get stuck, please send (if
possible) the source code (or, at least, the relevant parts), so we can
examine and run it.
(Errno::ENOENT)
from /Users/marydixon/Documents/business docs/htmlcolors.rb:213:in
`new'
from /Users/marydixon/Documents/business docs/htmlcolors.rb:213:in
`scanFile'
from /Users/marydixon/Documents/business docs/htmlcolors.rb:294:in
`process'
from /Users/marydixon/Documents/business docs/htmlcolors.rb:376
sawtooth:~ marydixon$
As you can see, I get a short list of errors although it seems other thin= gs
about it work just fine.

Look carefully: it's just one error, but in the form of "stack trace".
This way, you get both the error (first line) and the calling chain.

Good luck. Regards,

--=20
Esteban Manchado Vel=E1zquez <[email protected]> - http://www.foton.es
EuropeSwPatentFree - http://EuropeSwPatentFree.hispalinux.es

--YD3LsXFS42OYHhNZ
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)

iD8DBQFBj/0xhYgK5b1UDsERAmxzAJ4jOfKfHVYaQIjvHHbxBNaPTqx8YwCfbLfv
nnxeIOiBpJ4aUAA1cAbA+PU=
=ocXE
-----END PGP SIGNATURE-----

--YD3LsXFS42OYHhNZ--
 
D

Dave Burt

Mary Dixon said:
/Users/marydixon/Documents/business docs/htmlcolors.rb:213:in
`initialize':
No such file or directory - "/Users/marydixon/Desktop/style.css "
(Errno::ENOENT)
from /Users/marydixon/Documents/business docs/htmlcolors.rb:213:in
`new'
from /Users/marydixon/Documents/business docs/htmlcolors.rb:213:in
`scanFile'
from /Users/marydixon/Documents/business docs/htmlcolors.rb:294:in
`process'
from /Users/marydixon/Documents/business docs/htmlcolors.rb:376
sawtooth:~ marydixon$


As you can see, I get a short list of errors although it seems other
things
about it work just fine. ...

As Esteban said, it's not a list of errors, it's one error and its "stack"
including all the methods and blocks that are currently executing.

The error itself, at the top, is Errno::ENOENT, aka "No such file or
directory".

I'd be guessing that you're doing something like:
File.new("/Users/marydixon/Desktop/style.css ")
on line 213. Watch your whitespace - .strip it, .chomp it.

Cheers,
Dave
 
M

Mary Dixon

Being totally ignorant of that sort of thing, I didn't really see the space
until it was pointed out to me. I removed that and had a working script! I
was so excited about it. The remaining problem now seems to be that once I
run it and it works, it puts the resulting HTML file in a place that I can't
always find too easily. I guess I kinda need to dig a bit more.

The source is on rubyforge.org, incidentally, and can be found here:
http://rubyforge.org/projects/colorparser/

There are further developments I'd like to see such as improved output and
perhaps a better way to get it to run and maybe someday a GUI.

Thanks everyone.....

Mary


Okay, people,

I know almost nothing about Ruby, unfortunately. But I do know that I want
my color parser to work for me. This is what I've been doing in the
terminal:

sawtooth:~ marydixon$ ruby /Users/marydixon/Documents/business\
docs/htmlcolors.rb

HTML Color Table Generator
version 0.0.1
by W. Kent Starr (C)2002 SpiderwomanWebDesign.com
-------------------------------------------------

File or directory to process: /Users/marydixon/Desktop/style.css
Name of output file [colortable.html]:
Title of color table [Color Table for /Users/marydixon/Desktop/style.css ]:
Page background color [white]:
Page foreground color [navy]:

Press [ENTER] to begin
/Users/marydixon/Documents/business docs/htmlcolors.rb:213:in `initialize':
No such file or directory - "/Users/marydixon/Desktop/style.css "
^^^

It seems you have a space after the filename. That's probably the problem.
If it doesn't work after fixing that and you get stuck, please send (if
possible) the source code (or, at least, the relevant parts), so we can
examine and run it.
(Errno::ENOENT)
from /Users/marydixon/Documents/business docs/htmlcolors.rb:213:in
`new'
from /Users/marydixon/Documents/business docs/htmlcolors.rb:213:in
`scanFile'
from /Users/marydixon/Documents/business docs/htmlcolors.rb:294:in
`process'
from /Users/marydixon/Documents/business docs/htmlcolors.rb:376
sawtooth:~ marydixon$
As you can see, I get a short list of errors although it seems other things
about it work just fine.

Look carefully: it's just one error, but in the form of "stack trace".
This way, you get both the error (first line) and the calling chain.

Good luck. Regards,
 

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,164
Messages
2,570,898
Members
47,439
Latest member
shasuze

Latest Threads

Top