librelist archives

« back to archive

ask_open_file on Mac Snow leopard

ask_open_file on Mac Snow leopard

From:
Ed Howland
Date:
2010-08-29 @ 19:00
Hi,

If I try the ask_open_file example from the Holy Book of Shoes, it
works fine on my mac.
But if I call it within the context of a Shoes.app, it returns nil
(not the filename), and if the file is another shoes rb file, it runs
it.

How do I modify this behavior? Is this happening because of some file
association swicheroo?

Thanks,
Ed

Ed Howland
http://greenprogrammer.wordpress.com
http://twitter.com/ed_howland

Re: [shoes] ask_open_file on Mac Snow leopard

From:
Steve Klabnik
Date:
2010-08-29 @ 19:10
I just replied to you on ruby-talk, but for those of you here who
don't subscribe, for completeness:

This is... very strange. And certainly a bug. What platform are you
on, and are you using Policeman or Rasins? I couldn't recreate this on
OSX Policeman. Using these two scripts: http://gist.github.com/556579
, when I run test1, and open test2, the alert returns the text of
test2.

Linux packaging - a problem worth fixing?

From:
Cecil Coupe
Date:
2010-08-30 @ 03:02
Hi folks,

  I tracked down the source of an error in packaging scripts for Linux.
When  the packager downsloads the Shoes.run it unpacks it in to a temp
directory, adds the script to packaged, and then creates a new run file
by packing it all up. It doesn't work and I doubt it ever worked in any
version of shoes. The downloaded .run file has symbolic links
(libruby.so -> libruby-1.9.so but the unpacking code 'Minitar' doesn't
handle links. Says so in the comments and the comments are correct.
Minitar.rb is in the lib/shoes/ directory if you want to look. The
author hasn't updated his gem in a long time either. 

  There are other tar libraries that might do the right thing if used
instead of http://raa.ruby-lang.org/project/minitar/ but I got to
thinking, why bother? We've agreed linux support is a built-from-source
because of all the variability in Linux, but if you just happen to have
Ubuntu, you can "download shoes if needed" (it doesn't use Minitar to
expand the download).  I've got a commit to once again fix sh-install to
download from the actual honest to god site at
http://github.com/ccoupe/shoes/commit/53f6fb20c006736537b5dc01e2893f8b78c3963e

No pull request from me yet because I want to do some more GUI changes
to pack.rb that reflect the state of what can be done. I'd like to get a
bug fix release out there soon to replace the current Shoes.

--Cecil

Re: [shoes] ask_open_file on Mac Snow leopard

From:
Ed Howland
Date:
2010-08-30 @ 14:24
HI Steve,

Sorry about the duplicate post. I just discovered the shoes list.

Nope, running your code gets me the same behavior. I don't get the
alert, and the test2.rb runs as a shoes app. (I see the hello para in
a new window).

I also tried ashbb's two snippets and they worked fine. But if I wrap
ash's test1.rb ask_open_file in a keypress block, I get the same
errant results (app is run and the File.read() never executes. So it
seems tied to a keypress block.


Just FYI I am running the snow leopard build of Policeman on Mac OS/X
10.6 (64bit)

BTW [1] is the gist of my original  code with this problem (a
modification of _why's simple editor).

[1] http://gist.github.com/557449

Cheers,
Ed

Ed Howland
http://greenprogrammer.wordpress.com
http://twitter.com/ed_howland



On Sun, Aug 29, 2010 at 3:10 PM, Steve Klabnik <steve@steveklabnik.com> wrote:
> I just replied to you on ruby-talk, but for those of you here who
> don't subscribe, for completeness:
>
> This is... very strange. And certainly a bug. What platform are you
> on, and are you using Policeman or Rasins? I couldn't recreate this on
> OSX Policeman. Using these two scripts: http://gist.github.com/556579
> , when I run test1, and open test2, the alert returns the text of
> test2.
>

Re: [shoes] ask_open_file on Mac Snow leopard

From:
ashbb
Date:
2010-08-30 @ 15:16
Hi Ed,

Thank you for sharing your code.
I downloaded shedit.rb from the gist and run with Shoes 3 for Windows.
Then,
- key-press `ALT + o`
- select `shedit.rb`
- got this snapshot: http://www.rin-shun.com/tmp/shedit_snapshot.png

It seems to work just fine to me. Umm,... be a problem only in OSX?

Could anyone confirm this problem on OSX?

Sorry, I don't have a Mac. :(
ashbb

Re: [shoes] ask_open_file on Mac Snow leopard

From:
Ed Howland
Date:
2010-08-30 @ 17:42
Hi ashbb,

Wow! That is exactly the screen I hoped to get. Your test code worked
for me, but not once I embedded your File.read(ask_open_file) inside a
keypress block. So there is something there.

Steve, thanks for looking into this.

Also, I'm trying to build Policeman from the git repo but seem to
missing a C header
file :cairo-quartz.h


Cheers,
Ed

Ed Howland
http://greenprogrammer.wordpress.com
http://twitter.com/ed_howland



On Mon, Aug 30, 2010 at 11:16 AM, ashbb <ashbbb@gmail.com> wrote:
> Hi Ed,
>
> Thank you for sharing your code.
> I downloaded shedit.rb from the gist and run with Shoes 3 for Windows.
> Then,
> - key-press `ALT + o`
> - select `shedit.rb`
> - got this snapshot: http://www.rin-shun.com/tmp/shedit_snapshot.png
>
> It seems to work just fine to me. Umm,... be a problem only in OSX?
>
> Could anyone confirm this problem on OSX?
>
> Sorry, I don't have a Mac. :(
> ashbb
>

Re: [shoes] ask_open_file on Mac Snow leopard

From:
Steve Klabnik
Date:
2010-08-30 @ 18:04
> Also, I'm trying to build Policeman from the git repo but seem to
> missing a C header
> file :cairo-quartz.h

Ugh. Just a small warning, there be dragons when building on Snow
Leopard. This is one of the major discussion points with Shoes going
forward, the next major release is going to address what a total,
absolute bitch it is to compile Shoes.

Re: [shoes] ask_open_file on Mac Snow leopard

From:
Ed Howland
Date:
2010-08-30 @ 18:35
Thanks for the info, Steve. Looks like I'll hold off for now.

I'm going to go with a drop down menu approach (File -> Open) for now,
since I have an otherwise working Shoes executable.

Pleas let me know if I can be of any more help in tracking this down.
For instance, is it possible to start shoes in ruby-debug and step
through stuff?


Cheers,
Ed

Ed Howland
http://greenprogrammer.wordpress.com
http://twitter.com/ed_howland



On Mon, Aug 30, 2010 at 2:04 PM, Steve Klabnik <steve@steveklabnik.com> wrote:
>> Also, I'm trying to build Policeman from the git repo but seem to
>> missing a C header
>> file :cairo-quartz.h
>
> Ugh. Just a small warning, there be dragons when building on Snow
> Leopard. This is one of the major discussion points with Shoes going
> forward, the next major release is going to address what a total,
> absolute bitch it is to compile Shoes.
>

Re: [shoes] ask_open_file on Mac Snow leopard

From:
Steve Klabnik
Date:
2010-08-30 @ 18:48
> Pleas let me know if I can be of any more help in tracking this down.
> For instance, is it possible to start shoes in ruby-debug and step
> through stuff?

Shoes 3 uses ruby 1.9, so ruby-debug doesn't work anymore.

I'm not sure what else you can do, I'll get back to you tonight.

Re: [shoes] ask_open_file on Mac Snow leopard

From:
Ed Howland
Date:
2010-08-30 @ 19:47
Hey Steve,



On Mon, Aug 30, 2010 at 2:48 PM, Steve Klabnik <steve@steveklabnik.com> wrote:
>> Pleas let me know if I can be of any more help in tracking this down.
>> For instance, is it possible to start shoes in ruby-debug and step
>> through stuff?
>
> Shoes 3 uses ruby 1.9, so ruby-debug doesn't work anymore.
>
> I'm not sure what else you can do, I'll get back to you tonight.
>

I've been using ruby-debug19 pretty successfully.

Looking forward to tonight.

Cheers,
Ed

Ed Howland
http://greenprogrammer.wordpress.com
http://twitter.com/ed_howland

Re: [shoes] ask_open_file on Mac Snow leopard

From:
Steve Klabnik
Date:
2010-08-31 @ 12:46
Hey Ed. Sorry, it took till this morning.

... it works for me. Completely. I don't understand how this could be
possible. 10.6.4, 13" Macbook Pro, the generation before the newest. I
built the shoes you're using myself, on my own machine. I'm using the
same build.

Did ruby-debug help?

:/

Re: [shoes] ask_open_file on Mac Snow leopard

From:
Steve Klabnik
Date:
2010-08-30 @ 19:58
Cool! Then you can include it in your setup block:
http://wiki.github.com/shoes/shoes/clearing-up-the-whole-shoes-and-rubygems-deal

On Mon, Aug 30, 2010 at 3:47 PM, Ed Howland <ed.howland@gmail.com> wrote:
> Hey Steve,
>
>
>
> On Mon, Aug 30, 2010 at 2:48 PM, Steve Klabnik <steve@steveklabnik.com> wrote:
>>> Pleas let me know if I can be of any more help in tracking this down.
>>> For instance, is it possible to start shoes in ruby-debug and step
>>> through stuff?
>>
>> Shoes 3 uses ruby 1.9, so ruby-debug doesn't work anymore.
>>
>> I'm not sure what else you can do, I'll get back to you tonight.
>>
>
> I've been using ruby-debug19 pretty successfully.
>
> Looking forward to tonight.
>
> Cheers,
> Ed
>
> Ed Howland
> http://greenprogrammer.wordpress.com
> http://twitter.com/ed_howland
>

Re: [shoes] ask_open_file on Mac Snow leopard

From:
Devyn Cairns
Date:
2010-08-30 @ 22:17
Off topic, I like the last comment on that page; "This is *blasphomius*".
Made me laugh.

On Mon, Aug 30, 2010 at 12:58 PM, Steve Klabnik <steve@steveklabnik.com>wrote:

> Cool! Then you can include it in your setup block:
>
> http://wiki.github.com/shoes/shoes/clearing-up-the-whole-shoes-and-rubygems-deal
>
> On Mon, Aug 30, 2010 at 3:47 PM, Ed Howland <ed.howland@gmail.com> wrote:
> > Hey Steve,
> >
> >
> >
> > On Mon, Aug 30, 2010 at 2:48 PM, Steve Klabnik <steve@steveklabnik.com>
> wrote:
> >>> Pleas let me know if I can be of any more help in tracking this down.
> >>> For instance, is it possible to start shoes in ruby-debug and step
> >>> through stuff?
> >>
> >> Shoes 3 uses ruby 1.9, so ruby-debug doesn't work anymore.
> >>
> >> I'm not sure what else you can do, I'll get back to you tonight.
> >>
> >
> > I've been using ruby-debug19 pretty successfully.
> >
> > Looking forward to tonight.
> >
> > Cheers,
> > Ed
> >
> > Ed Howland
> > http://greenprogrammer.wordpress.com
> > http://twitter.com/ed_howland
> >
>



-- 
    ~devyn

Re: [shoes] ask_open_file on Mac Snow leopard

From:
Steve Klabnik
Date:
2010-08-30 @ 15:58
> Sorry about the duplicate post. I just discovered the shoes list.

No worries!

> Nope, running your code gets me the same behavior. I don't get the
> alert, and the test2.rb runs as a shoes app. (I see the hello para in
> a new window).

> Just FYI I am running the snow leopard build of Policeman on Mac OS/X
> 10.6 (64bit)

That's me too, exactly. Hmmm.

I'll give this another shot tonight, with your exact code.

Re: [shoes] ask_open_file on Mac Snow leopard

From:
ashbb
Date:
2010-08-30 @ 12:39
Hi Ed,

Sorry, I also couldn't recreate your problem with Shoes 3 on Windows 7.
The following two snnipets, test1.rb and test2.rb, are exactly the same
behavior.

  #test1.rb
  Shoes.app do
    filename = ask_open_file
    para File.read(filename)
  end

  #test2.rb
  filename = ask_open_file
  Shoes.app do
    para File.read(filename)
  end

Could you explain your problem in a little more detail?

ashbb