On Mon, 29 Sep 2008, Seth Thomas Rasmussen wrote:

> On Mon, Sep 29, 2008 at 7:33 PM, Hugh Sasse <[EMAIL PROTECTED]> wrote:
> >
> >
> > On Mon, 29 Sep 2008, Seth Thomas Rasmussen wrote:
> >
> >> Line 277 of lib/shoes/setup.rb is raising an error with the message:
> >>
> >>   undefined method 'contents' for (Shoes::App "Setting up for aglet.rb")
> >
> > Can't see anything in messages I've kept, and Google pleads ignorance
> > when fed that message.
> 
> So, it's this expression that is causing me problems again:
> 
>   @title, @status, @prog, = app.contents[-1].contents
> 
> Here is a paste from one of my messages about the first time I had a
> problem with this expression: http://gist.github.com/3713

OK, that's how your using it.  I'd have to look at the code to see this.
So I have a question now.  I sent _Why some patches and he's busy, and
they were just typos, so I don't know if they've got into his repo or
not.  How do I update my git repo to reflect his without doing a complete
pull?  I want to cover up my changes if hd didn't accept them, not merge.
Then I can look at current code.  
> 
> The first time, the problem I was seeing was that app.contents[-1] was
> returning nil, so the second contents() call was failing on a nil
> object.
> 
> Now, it appears that the app object does not respond to contents() at
> all for some reason.

later> Shoes.app :title => "This simple example works fine, though." do
later>   stack
later>   flow
later>   stack
later>   flow
later> 
later>   info contents.map { |x| x.inspect }.inspect
later> end
later> 

OK, well maybe in the first case the app had no contents.  That -1
looks like it is looking for the last thing added, but I don't have
the context to know why, or to work out what to test for.  I suspect
this contents method gets added dynamically, as this seems to be a
feature of _Why's programming style :-)  Also there is a question
of what to d with the three vars if in fact thee is no content.

  @title, @status, @prog = nil, nil, nil
  if (app.respond_to? :contents) and (app.contents[-1].respond_to? :contents)
    @title, @status, @prog, = app.contents[-1].contents
  end

may or may not be appropriate from my thinking so far.

        Hugh

Reply via email to