<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Oh and George, if you wan't to see the webrick restarting in action,
just run the app.<br>
<br>
(ab)<br>
<br>
Arne Brasseur schreef:
<blockquote cite="mid468D4208.2030106@arnebrasseur.net" type="cite">I'm
taking this on-list, I suppose nobody really minds.
<br>
<br>
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
<br>
<br>
raw/compiler/filter/elements.rb
<br>
<br>
# Try to use Controller::xxx
<br>
# gmosx, THINK: this looks a bit dangerous to me!
<br>
begin
<br>
# gmosx, FIXME: Class.by_name also returns top level
<br>
# classes, how can we fix this?
<br>
<br>
klass = constant("#{controller}::#{name}")
<br>
puts "Searching element #{name} as #{controller}::#{name} =>
#{klass}" # I added this
<br>
rescue
<br>
# drink it!
<br>
end
<br>
<br>
This outputs:
<br>
Searching element Menubar as Home::Controller::Menubar => Menubar
<br>
<br>
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...
<br>
<br>
<br>
(ab)
<br>
<br>
<br>
<hr size="4" width="90%"><br>
<table class="header-part1" border="0" cellpadding="0" cellspacing="0"
width="100%">
<tbody>
<tr>
<td>
<div class="headerdisplayname" style="display: inline;">Onderwerp:
</div>
About the Menubar collision (follow-up)</td>
</tr>
<tr>
<td>
<div class="headerdisplayname" style="display: inline;">Van: </div>
Jimmy Jazz <a class="moz-txt-link-rfc2396E" href="mailto:Jimmy.Jazz@gmx.net"><Jimmy.Jazz@gmx.net></a></td>
</tr>
<tr>
<td>
<div class="headerdisplayname" style="display: inline;">Datum: </div>
Wed, 04 Jul 2007 20:28:47 +0200</td>
</tr>
<tr>
<td>
<div class="headerdisplayname" style="display: inline;">Aan: </div>
Arne Brasseur <a class="moz-txt-link-rfc2396E" href="mailto:arne@arnebrasseur.net"><arne@arnebrasseur.net></a>, Jonathan Buch
<a class="moz-txt-link-rfc2396E" href="mailto:john@oxyliquit.de"><john@oxyliquit.de></a></td>
</tr>
</tbody>
</table>
<table class="header-part2" border="0" cellpadding="0" cellspacing="0"
width="100%">
<tbody>
<tr>
<td>
<div class="headerdisplayname" style="display: inline;">Aan: </div>
Arne Brasseur <a class="moz-txt-link-rfc2396E" href="mailto:arne@arnebrasseur.net"><arne@arnebrasseur.net></a>, Jonathan Buch
<a class="moz-txt-link-rfc2396E" href="mailto:john@oxyliquit.de"><john@oxyliquit.de></a></td>
</tr>
<tr>
<td>
<div class="headerdisplayname" style="display: inline;">CC: </div>
<a class="moz-txt-link-abbreviated" href="mailto:george.moschovitis@gmail.com">george.moschovitis@gmail.com</a></td>
</tr>
</tbody>
</table>
<br>
<tt>Hello devs,<br>
<br>
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 ;)<br>
<br>
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)<br>
<br>
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.<br>
<br>
Are both </tt><tt>classes Menubar in navigation.rb (a model) and
Menubar in skin.rb </tt><tt>(an element) belonging to the same
superclass that could explain the collision ? Why that choice was made ?<br>
</tt><tt><br>
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.<br>
<br>
# validate_length :title, :range => 2..128, :msg => 'argh'<br>
<br>
doesn't work. Nitro complains about a missing 'validations' method<br>
<br>
$ ../nitro/bin/nitro <br>
/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)<br>
from
/home/lilo/workspace/repo.nitroproject.org/script/lib/../../glue/lib/glue/validation.rb:432:in
`define_validation'<br>
from
/home/lilo/workspace/repo.nitroproject.org/script/lib/../../glue/lib/glue/validation.rb:298:in
`validate_length'<br>
from
/home/lilo/workspace/repo.nitroproject.org/script/lib/../../glue/lib/glue/validation.rb:297:in
`each'<br>
from
/home/lilo/workspace/repo.nitroproject.org/script/lib/../../glue/lib/glue/validation.rb:297:in
`validate_length'<br>
from ./app/model/navigation.rb:12<br>
from
/usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require'<br>
from
/usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'<br>
from app.rb:10<br>
<br>
<br>
and<br>
<br>
# is Orderable<br>
<br>
doesn't work either. Nitro complains this time about an undefined
method 'basename' that belongs to a standard ruby library.<br>
<br>
$ ../nitro/bin/nitro <br>
/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)<br>
from
/usr/lib64/ruby/gems/1.8/gems/facets-1.8.54/lib/facets/more/paramix.rb:94:in
`each'<br>
from
/usr/lib64/ruby/gems/1.8/gems/facets-1.8.54/lib/facets/more/paramix.rb:94:in
`is'<br>
from ./app/model/navigation.rb:29<br>
from
/usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require'<br>
from
/usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'<br>
from app.rb:10<br>
<br>
Thank you for you help,<br>
<br>
Jj<br>
</tt><br>
<div class="moz-signature">-- <br>
<div class="moz-signature">
<meta content="text/html;" http-equiv="Content-Type">
<pre class="moz-signature" cols="72"> |\ _,,,---,,_
ZZZzz /,`.-'`' -. ;-;;,_
|,4- ) )-,_. ,\ ( `'-'
'---''(_/--' `-'\_)
<big><font face="Comics">
</font></big></pre>
</div>
</div>
<div class="moz-signature">
<div align="left"><b><font face="Comic Sans MS"><br>
</font></b></div>
</div>
<pre wrap="">
<hr size="4" width="90%">
_______________________________________________
Nitro-general mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Nitro-general@rubyforge.org">Nitro-general@rubyforge.org</a>
<a class="moz-txt-link-freetext" href="http://rubyforge.org/mailman/listinfo/nitro-general">http://rubyforge.org/mailman/listinfo/nitro-general</a></pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
Arne Brasseur
<a class="moz-txt-link-freetext" href="http://www.arnebrasseur.net">http://www.arnebrasseur.net</a>
<a class="moz-txt-link-abbreviated" href="mailto:arne@arnebrasseur.net">arne@arnebrasseur.net</a></pre>
</body>
</html>