I have a question about UI.dialog and/or some general Ruby usage. I apologize for asking about Ruby stuff here, but this particular problem seems tied directly to the use of UI.dialog, although I'm pretty sure the issue is actually a Ruby one on my part (I've been fine Googling for other Ruby issues, but this one seems pretty niche).
Here's some stripped down code that works:
TextMate::UI.dialog(:nib => nib, :parameters => {}, :center => true) do |dialog| dialog.parameters = {'username' => "moo"} dialog.wait_for_input do |params| puts params["username"] end end
But then I go to try and actually use something with my params hash, like putting it into a variable declared earlier:
username = "" TextMate::UI.dialog(:nib => nib, :parameters => {}, :center => true) do |dialog| dialog.parameters = {'username' => "moo"} dialog.wait_for_input do |params| username = params["username"] end end puts username
Now I get a task that seems to hang, which when forced to quit will report the following error in Console:
TextMate[13634] *** -[NSMachPort handlePortMessage:]: dropping incoming DO message because the connection or ports are invalid
Really don't know what to do with this. Sorry, I'm not good enough at either TextMate's extra features, nor at Ruby. I'm sure this is just a combination of both of those deficiencies.
Thanks, Dru