On Wed, 22 Oct 2008, Mike Richards wrote:

> Sorry, I made a mistake. I am using the class ::String. otherwise it
> doesn't work at all. my bad. this is the code im struggling with.
> 
> http://pastie.org/298077

It's only 22 lines.  Is there some reason you can't include it
in the email to save us having to go to another site?

Furthermore, the accessibility of that site is insufficient:
if I get the text big enough to read comfortably, it bleeds off
the right hand side of the box with no scrollbar to overcome that,
unless I scroll down far enough to see the scrollbar, so I then
have to scroll back up to read the rest of the line. 

You probably want CGI.escape instead of self.gsub(/ /,"%20").

I'd suggest you don't use open to get the string, but use Shoes's
download to get it instead, maybe to a file created with TempFile,
though the shoes manual says you can get a string back with the
finish event.

[_Why, I think there should be an example of using the finish
event in the manual.  Maybe its in the examples dir, I've not
looked specifically]

I'm not familiar enough with the innards of open-uri to know what
it does to the classes in resolv-replace, but that is going to get
hit for each DNS access, and it clearly has something to do with
caching results going by the reported symptoms.

        HTH
        Hugh

> 
> On Wed, Oct 22, 2008 at 10:11 AM, Mike Richards <[EMAIL PROTECTED]> wrote:
> > Hi Everyone,
> >
> > I'm building a little test app here that validates a given URL. I made
> > a method outside of Shoes.app and it works fine, but when I try using
> > that method inside Shoes.app, I get some very strange behavior. Most
> > of the time it will give me this error in console:
> >
> > Error in /Applications/Shoes.app/Contents/MacOS/ruby/lib/resolv-replace.rb
> > line 19
> > Connection refused - connect(2)
> >
> > But if I wait about 10 minutes or so, and try it again. it will work
> > once, and then I must wait again another 10 minutes for it to work. I
> > don't see anything relative from when it works and when it doesn't. so
> > this is puzzling to me. I tried putting the method in class ::String
> > (instead of just class String), and i also tried using just a method
> > (no open class method), Same thing.
> >
> > Here is the code: http://pastie.org/298055
> >
> > Thanks in advance.
> >
> 

Reply via email to