[Nitro] [Fwd: About the Menubar collision (follow-up)]

Arne Brasseur arne at arnebrasseur.net
Thu Jul 5 15:19:48 EDT 2007


Oh and George, if you wan't to see the webrick restarting in action, 
just run the app.

(ab)

Arne Brasseur schreef:
> I'm taking this on-list, I suppose nobody really minds.
>
> I investigated your example a bit, the problem isn't with the <render 
> "menubar" />, it's with you Menubar og model. In fact this is 
> documented behaviour :P
>
> raw/compiler/filter/elements.rb
>
>      # Try to use Controller::xxx
>      # gmosx, THINK: this looks a bit dangerous to me!
>          begin
>        # gmosx, FIXME: Class.by_name also returns top level
>        # classes, how can we fix this?
>
>        klass = constant("#{controller}::#{name}")
>        puts "Searching element #{name} as #{controller}::#{name} => 
> #{klass}"      # I added this
>      rescue
>        # drink it!
>      end
>
> This outputs:
> Searching element Menubar as Home::Controller::Menubar => Menubar
>
> So this indeed returns the top-level class. The constant method is 
> from facets. It looks to me it doesn't work like one would suspect...
>
>
> (ab)
>
>
> ------------------------------------------------------------------------
>
> Onderwerp:
> About the Menubar collision (follow-up)
> Van:
> Jimmy Jazz <Jimmy.Jazz at gmx.net>
> Datum:
> Wed, 04 Jul 2007 20:28:47 +0200
> Aan:
> Arne Brasseur <arne at arnebrasseur.net>, Jonathan Buch <john at oxyliquit.de>
>
> Aan:
> Arne Brasseur <arne at arnebrasseur.net>, Jonathan Buch <john at oxyliquit.de>
> CC:
> george.moschovitis at gmail.com
>
>
> Hello devs,
>
> Sorry, I sent you the code directly without sending it to the mailing 
> list, but i don't know if it is allowed to send binary files to the 
> list (zip file). Anyway, it would be great to be able to send ruby 
> codes and examples to a ftp server available to the devs. Also, here 
> is an example of a "working" nitro project that will show you what 
> will happened and how i have proceed. I have certainly mishandled 
> nitro or ruby (ruby (as well nitro) is a new language/framework to me 
> :) but other people could certainly have the same feeling about how I 
> write it. Indeed, the fact that nitro hides a lot of the ruby 
> mechanism - we don't need explicitly initialize() or new() - make me 
> feel a bit uncomfortable especially because i'm in the learning stage ;)
>
> After running nitro, you will see (i hope) an orange menu bar to the 
> left (change the password and the name of the database to your 
> convenience)
>
> The files that end with a minus '-' are buggy. Just rename them and 
> they will show you the issue quite well. The "rendering" will just 
> disappear.
>
> Are both classes Menubar in navigation.rb (a model) and Menubar in 
> skin.rb (an element) belonging to the same superclass that could 
> explain the collision ? Why that choice was made ?
>
> There are two other problems i have discovered, but probably just 
> related to the fact that nitro doesn't find all the gem and ruby 
> codes. Uncomment them to see the errors.
>
> # validate_length :title, :range => 2..128, :msg => 'argh'
>
> doesn't work. Nitro complains about a missing 'validations' method
>
> $ ../nitro/bin/nitro
> /home/lilo/workspace/repo.nitroproject.org/script/lib/../../og/lib/og/model.rb:664:in 
> `method_missing': undefined local variable or method `validations' for 
> Navigation:Class (NameError)
>         from 
> /home/lilo/workspace/repo.nitroproject.org/script/lib/../../glue/lib/glue/validation.rb:432:in 
> `define_validation'
>         from 
> /home/lilo/workspace/repo.nitroproject.org/script/lib/../../glue/lib/glue/validation.rb:298:in 
> `validate_length'
>         from 
> /home/lilo/workspace/repo.nitroproject.org/script/lib/../../glue/lib/glue/validation.rb:297:in 
> `each'
>         from 
> /home/lilo/workspace/repo.nitroproject.org/script/lib/../../glue/lib/glue/validation.rb:297:in 
> `validate_length'
>         from ./app/model/navigation.rb:12
>         from 
> /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in 
> `gem_original_require'
>         from 
> /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
>         from app.rb:10
>
>
> and
>
> # is Orderable
>
> doesn't work either. Nitro complains this time about an undefined 
> method 'basename' that belongs to a standard ruby library.
>
> $ ../nitro/bin/nitro
> /usr/lib64/ruby/gems/1.8/gems/facets-1.8.54/lib/facets/more/paramix.rb:96:in 
> `is': undefined method `basename' for :Orderable:Symbol (NoMethodError)
>         from 
> /usr/lib64/ruby/gems/1.8/gems/facets-1.8.54/lib/facets/more/paramix.rb:94:in 
> `each'
>         from 
> /usr/lib64/ruby/gems/1.8/gems/facets-1.8.54/lib/facets/more/paramix.rb:94:in 
> `is'
>         from ./app/model/navigation.rb:29
>         from 
> /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in 
> `gem_original_require'
>         from 
> /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
>         from app.rb:10
>
> Thank you for you help,
>
> Jj
>
> -- 
>             |\      _,,,---,,_
>       ZZZzz /,`.-'`'    -.  ;-;;,_
>            |,4-  ) )-,_. ,\ (  `'-'
>           '---''(_/--'  `-'\_)
>
> *
> *
> ------------------------------------------------------------------------
>
> _______________________________________________
> Nitro-general mailing list
> Nitro-general at rubyforge.org
> http://rubyforge.org/mailman/listinfo/nitro-general


-- 
Arne Brasseur
http://www.arnebrasseur.net
arne at arnebrasseur.net

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/nitro-general/attachments/20070705/a155ec82/attachment.html 


More information about the Nitro-general mailing list