Forum: Ruby can't convert String into Integer

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
unknown (Guest)
on 2006-02-20 19:45
(Received via mailing list)
i have a hash like that :

@label_list={}

with only one key for the time being :

@label_list["BookmarksBar"]=[]

then, the value is an Array populated like that :

@label_list["BookmarksBar"] << folder.attributes["label"].gsub(/"(.*)"/,
'\1')

then, i want to use this hash-value by :

if !@label_list["BookmarksBar"].include?(label_) # <= line 143


this works a number of times (it's within an each loop) until label_ =
"files" where i get :

/Users/yvon/work/RubyCocoa/BookmarksMerge/build/Development/BookmarksMer
ge.app/Contents/Resources/Controller.rb:143:in `NSApplicationMain':
NSApplicationMain - RBException_TypeError - can't convert String into
Integer (OSX::OCException)


label_ are always strings...

i don't understand ))
David V. (Guest)
on 2006-02-21 04:48
(Received via mailing list)
DÅ?a Pondelok 20 Február 2006 18:43 Une bévue napísal:
> @label_list["BookmarksBar"] << folder.attributes["label"].gsub(/"(.*)"/,
> /Users/yvon/work/RubyCocoa/BookmarksMerge/build/Development/BookmarksMer
> ge.app/Contents/Resources/Controller.rb:143:in `NSApplicationMain':
> NSApplicationMain - RBException_TypeError - can't convert String into
> Integer (OSX::OCException)
>
>
> label_ are always strings...
>
> i don't understand ))

I can't reproduce this. Can you make a simple full code example where
this
happens? Otherwise, I'd blame a bug someplace else and a mysterious
off-by-one line count mishap.

David V.
Robert K. (Guest)
on 2006-02-21 11:56
(Received via mailing list)
"Une bévue" <removed_email_address@domain.invalid> wrote:
> @label_list["BookmarksBar"] <<
> folder.attributes["label"].gsub(/"(.*)"/, '\1')

This gsub is pretty useless as it will replace the string by itself.
What
are you trying to do here?

> NSApplicationMain - RBException_TypeError - can't convert String into
> Integer (OSX::OCException)
>
>
> label_ are always strings...
>
> i don't understand ))

Me too.  What libraries are you using?  If @label_list is a normal Hash
and
the entry is a normal Array, as your code snippets suggest, then I can't
see
how this error can occur.  Seems we need more information...

Kind regards

    robert
unknown (Guest)
on 2006-02-21 19:02
(Received via mailing list)
Quoting Robert K. <removed_email_address@domain.invalid>:
> > folder.attributes["label"].gsub(/"(.*)"/, '\1')
>
> This gsub is pretty useless as it will replace the string by itself.  What
> are you trying to do here?
>

It strips the double quotes.

David V.
Robert K. (Guest)
on 2006-02-21 20:00
(Received via mailing list)
<removed_email_address@domain.invalid> schrieb im Newsbeitrag
news:removed_email_address@domain.invalid...
Quoting Robert K. <removed_email_address@domain.invalid>:
> > folder.attributes["label"].gsub(/"(.*)"/, '\1')
>
> This gsub is pretty useless as it will replace the string by itself.  What
> are you trying to do here?

> It strips the double quotes.

Blind I am.  Gosh!  Thanks for clearing the fog from my brain.

    robert
unknown (Guest)
on 2006-02-21 20:49
(Received via mailing list)
Robert K. <removed_email_address@domain.invalid> wrote:

>
> Blind I am.  Gosh!  Thanks for clearing the fog from my brain.

;-)

in fact i want to synchronize safari and firfox bookmaks on the safari
side some of them are written :

"Swing"

the equivalent on firefox being written :

Swing

then, i wipe out the difference;;;
unknown (Guest)
on 2006-02-21 20:49
(Received via mailing list)
David V. <removed_email_address@domain.invalid> wrote:

> Otherwise, I'd blame a bug someplace else and a mysterious
> off-by-one line count mishap.

Right their was a big bugg of roughly 80 Kg :
the guy betwwen my chair and the computer ;-)

in fact the error wasn't directly coming from the line given by ruby ))
David V. (Guest)
on 2006-02-21 21:29
(Received via mailing list)
DÅ?a Utorok 21 Február 2006 19:48 Une bévue napísal:
> David V. <removed_email_address@domain.invalid> wrote:
> > Otherwise, I'd blame a bug someplace else and a mysterious
> > off-by-one line count mishap.
>
> Right their was a big bugg of roughly 80 Kg :
> the guy betwwen my chair and the computer ;-)
>

Those things are arguably the largest source of bugs in any software
development process. We should get rid of them one of these days and use
something more reliable.

Time to develop the Programmer 2.0 *cackle*.

This would arguably be funnier if them strange SW architect people
didn't try
to make UML executable over and over again. *fears for his cushy geek
career*

David V.
This topic is locked and can not be replied to.