Deb Lewis
2006-Jun-13 01:03 UTC
[Masterview-devel] Test case: analyzer breaks on template that parser handles
Configuration: new, empty rails app w/ masterview installed in vendor/plugins from my working copy, with new initializer hooked up, but no changes to parser.rb or analyzer.rb from current trunk. Three lines changed in template_spec.rb to convert old MasterView::TemplateSrcRelativePath const refs and hardwired ''app/views'' to new TemplateSrcDirPath constant. Create a single very simple template in app/masterview templates dir and verify that MV detects and parses it into app/views. Attached. Go to masterview Admin controller -> list page does a TemplateSpec.scan on the templates src dir, breaks in Analyzer.end_element with nil value for stack.last at line 196 (if @depth == @stack.last.depth) It''s dying on the <title> element the document <head>, according to trace dumps that I added. Not going to pursue this further right this instant, but this doesn''t look like a Win32 platform issue. Probably just needs extra stack.empty? check per below (just adding that did fix this simple case). Anyway, explains why the admin controller breaks when I try to run it, my templates all have <title> elements in their headers. if ! @stack.empty? && @depth == @stack.last.depth p.s. if you activate the admin controller in a new empty rails app it''s really bogus looking - assumes stylesheets that aren''t there. I think these are guys that get dropped in from running your other generator, which at this point I haven''t done in this new app and it''s a legit use case that one might not do so. A to-do for the cleanup list, not critical for the moment. ~ Deb MasterView::Analyzer.start_document MasterView::Analyzer.start_element ...uri: http://www.w3.org/1999/xhtml ...<html> ...attributes: lang, xml:lang, xmlns ... at depth=0 ... at stack=[0 entries] on entry ... at stack=[0 entries] after processing entry MasterView::Analyzer.start_element ...<head> ... at depth=1 ... at stack=[0 entries] on entry ... at stack=[0 entries] after processing entry MasterView::Analyzer.start_element ...<title> ... at depth=2 ... at stack=[0 entries] on entry ... at stack=[0 entries] after processing entry MasterView::Analyzer.end_element ...</title> ...qname=title ... at stack=[0 entries] on entry ERROR: You have a nil object when you didn''t expect it! The error occured while evaluating nil.depth -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/masterview-devel/attachments/20060612/bd8a81d2/attachment-0001.html
Jeff Barczewski
2006-Jun-14 00:22 UTC
[Masterview-devel] Test case: analyzer breaks on template that parser handles
That''s a good point about the admin page not looking good without the stylesheets, we should account for the fact that not everyone is going to run the generator. Probably include a different stylesheet or embed some minor style. I can take a look at the template scan, I have mainly tested on files that came out of the generator so maybe on something simpler that doesn''t have as many mv:generates, maybe we are getting into an empty list situation that we weren''t with the generator created files. On 6/12/06, Deb Lewis <djlewis at acm.org> wrote:> > Configuration: new, empty rails app w/ masterview installed in > vendor/plugins from my working copy, with new initializer hooked up, but > no > changes to parser.rb or analyzer.rb from current trunk. Three lines > changed > in template_spec.rb to convert old MasterView::TemplateSrcRelativePath > const > refs and hardwired ''app/views'' to new TemplateSrcDirPath constant. > > Create a single very simple template in app/masterview templates dir and > verify that MV detects and parses it into app/views. Attached. > > Go to masterview Admin controller -> list page does a TemplateSpec.scan on > the templates src dir, breaks in Analyzer.end_element with nil value for > stack.last at line 196 (if @depth == @stack.last.depth) > > It''s dying on the <title> element the document <head>, according to trace > dumps that I added. > > Not going to pursue this further right this instant, but this doesn''t look > like a Win32 platform issue. Probably just needs extra stack.empty? check > per below (just adding that did fix this simple case). Anyway, explains > why > the admin controller breaks when I try to run it, my templates all have > <title> elements in their headers. > > if ! @stack.empty? && @depth == @stack.last.depth > > p.s. if you activate the admin controller in a new empty rails app it''s > really bogus looking - assumes stylesheets that aren''t there. I think > these > are guys that get dropped in from running your other generator, which at > this point I haven''t done in this new app and it''s a legit use case that > one > might not do so. A to-do for the cleanup list, not critical for the > moment. > > ~ Deb > > MasterView::Analyzer.start_document > > MasterView::Analyzer.start_element > ...uri: http://www.w3.org/1999/xhtml > ...<html> > ...attributes: lang, xml:lang, xmlns > ... at depth=0 > ... at stack=[0 entries] on entry > ... at stack=[0 entries] after processing entry > > MasterView::Analyzer.start_element > ...<head> > ... at depth=1 > ... at stack=[0 entries] on entry > ... at stack=[0 entries] after processing entry > > MasterView::Analyzer.start_element > ...<title> > ... at depth=2 > ... at stack=[0 entries] on entry > ... at stack=[0 entries] after processing entry > > MasterView::Analyzer.end_element > ...</title> > ...qname=title > ... at stack=[0 entries] on entry > > ERROR: > You have a nil object when you didn''t expect it! > The error occured while evaluating nil.depth > > > _______________________________________________ > Masterview-devel mailing list > Masterview-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/masterview-devel > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/masterview-devel/attachments/20060613/cd195832/attachment.htm
Deb Lewis
2006-Jun-14 01:08 UTC
[Masterview-devel] Test case: analyzer breaks on template that parser handles
suggest we chase both of those problems (<title> parsing in analyzer, admin controller stylesheets) after getting current round of code stuff settled and integrated (your file i/o, my initializer stuff), then catch up on loose ends and polish work items. I''m starting to have trouble juggling changes between various dev and test copies, would like to get things integrated onto trunk before I accidently wipe out something useful. [not trying to push you, just observing] I starting running build tasks last night to test the various install flavors, but got bogged down poking around the rake file exploring and then hitting problem with building zip''s for some of the packages (probably easy to fix, likely just something diff about your system or *nix that I need to update on my system). Will try to get back into that tonight. Rakefile change notes: there''s a couple build tasks that need doc/stylesheets/*.* added to their flie specs; some other tweaking on the syntax check/LOC/mvparse of examples guys. Nothing earthshaking. If it''s ok with you, I''d like to factor out the prereqs and installation instructions section of the current docs into a separate doc/installation.html and then beef up the instructions to better explain the flavors of packages available and when to pick which. I know on my first install experience I gave up trying to figure out which of the downloads to use and just grabbed the include-everything bundle. Not a problem for experience rail-ers, I think, but sort of befuddling to newbies. My goal is for this stuff to *look* polished when a potential user arrives to browse the docs, easy to figure out whether it runs on their system (platform version, prereqs, etc), and really easy for someone new to rails or mv to get going. Doesn''t matter how glorious the package is if people thnk it looks half-baked or they can''t get off the ground easily. ~ Deb _____ From: Jeff Barczewski [mailto:jeff.barczewski at gmail.com] Sent: Tuesday, June 13, 2006 5:22 PM To: djlewis at acm.org; masterview-devel at rubyforge.org Subject: Re: [Masterview-devel] Test case: analyzer breaks on template that parser handles That''s a good point about the admin page not looking good without the stylesheets, we should account for the fact that not everyone is going to run the generator. Probably include a different stylesheet or embed some minor style. I can take a look at the template scan, I have mainly tested on files that came out of the generator so maybe on something simpler that doesn''t have as many mv:generates, maybe we are getting into an empty list situation that we weren''t with the generator created files. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/masterview-devel/attachments/20060613/550b77b1/attachment.htm
Jeff Barczewski
2006-Jun-14 16:26 UTC
[Masterview-devel] Test case: analyzer breaks on template that parser handles
Yes, I agree. I am trying to get the code released asap. I fully agree about it looking polished, that makes a huge difference in whether people will actually look into something. On 6/13/06, Deb Lewis <djlewis at acm.org> wrote:> > suggest we chase both of those problems (<title> parsing in analyzer, > admin controller stylesheets) after getting current round of code stuff > settled and integrated (your file i/o, my initializer stuff), then catch up > on loose ends and polish work items. I''m starting to have trouble juggling > changes between various dev and test copies, would like to get things > integrated onto trunk before I accidently wipe out something useful. > > [not trying to push you, just observing] > > I starting running build tasks last night to test the various install > flavors, but got bogged down poking around the rake file exploring and then > hitting problem with building zip''s for some of the packages (probably easy > to fix, likely just something diff about your system or *nix that I need to > update on my system). Will try to get back into that tonight. > > Rakefile change notes: there''s a couple build tasks that need > doc/stylesheets/*.* added to their flie specs; some other tweaking on the > syntax check/LOC/mvparse of examples guys. Nothing earthshaking. > > If it''s ok with you, I''d like to factor out the prereqs and installation > instructions section of the current docs into a separate > doc/installation.html and then beef up the instructions to better explain > the flavors of packages available and when to pick which. I know on my > first install experience I gave up trying to figure out which of the > downloads to use and just grabbed the include-everything bundle. Not a > problem for experience rail-ers, I think, but sort of befuddling to newbies. > > My goal is for this stuff to *look* polished when a potential user arrives > to browse the docs, easy to figure out whether it runs on their system > (platform version, prereqs, etc), and really easy for someone new to rails > or mv to get going. Doesn''t matter how glorious the package is if people > thnk it looks half-baked or they can''t get off the ground easily. > > ~ Deb >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/masterview-devel/attachments/20060614/a3ece1de/attachment-0001.htm
Jeff Barczewski
2006-Jun-15 15:58 UTC
[Masterview-devel] Test case: analyzer breaks on template that parser handles
With my commit earlier today, I believe that both of these issues are resolved. 1) Empty/simple template analyzer stack.last nil bug 2) MasterView Admin controller didn'' t have stylesheets if generator was not run so output was plain and unstyled. On 6/12/06, Deb Lewis <djlewis at acm.org> wrote:> > Configuration: new, empty rails app w/ masterview installed in > vendor/plugins from my working copy, with new initializer hooked up, but > no > changes to parser.rb or analyzer.rb from current trunk. Three lines > changed > in template_spec.rb to convert old MasterView::TemplateSrcRelativePath > const > refs and hardwired ''app/views'' to new TemplateSrcDirPath constant. > > Create a single very simple template in app/masterview templates dir and > verify that MV detects and parses it into app/views. Attached. > > Go to masterview Admin controller -> list page does a TemplateSpec.scan on > the templates src dir, breaks in Analyzer.end_element with nil value for > stack.last at line 196 (if @depth == @stack.last.depth) > > It''s dying on the <title> element the document <head>, according to trace > dumps that I added. > > Not going to pursue this further right this instant, but this doesn''t look > like a Win32 platform issue. Probably just needs extra stack.empty? check > per below (just adding that did fix this simple case). Anyway, explains > why > the admin controller breaks when I try to run it, my templates all have > <title> elements in their headers. > > if ! @stack.empty? && @depth == @stack.last.depth > > p.s. if you activate the admin controller in a new empty rails app it''s > really bogus looking - assumes stylesheets that aren''t there. I think > these > are guys that get dropped in from running your other generator, which at > this point I haven''t done in this new app and it''s a legit use case that > one > might not do so. A to-do for the cleanup list, not critical for the > moment. > > ~ Deb > > MasterView::Analyzer.start_document > > MasterView::Analyzer.start_element > ...uri: http://www.w3.org/1999/xhtml > ...<html> > ...attributes: lang, xml:lang, xmlns > ... at depth=0 > ... at stack=[0 entries] on entry > ... at stack=[0 entries] after processing entry > > MasterView::Analyzer.start_element > ...<head> > ... at depth=1 > ... at stack=[0 entries] on entry > ... at stack=[0 entries] after processing entry > > MasterView::Analyzer.start_element > ...<title> > ... at depth=2 > ... at stack=[0 entries] on entry > ... at stack=[0 entries] after processing entry > > MasterView::Analyzer.end_element > ...</title> > ...qname=title > ... at stack=[0 entries] on entry > > ERROR: > You have a nil object when you didn''t expect it! > The error occured while evaluating nil.depth > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/masterview-devel/attachments/20060615/b87ff268/attachment.htm