[Nitro] Facets 1.8

George Moschovitis george.moschovitis at gmail.com
Tue Jan 30 04:08:54 EST 2007


Ok, I agree with both your changes, so if you have a new version available
send it to me as a gem so I can check taht everything works ok and then you
can release it1

thanks,
-g.

On 1/30/07, transfire at gmail.com <transfire at gmail.com> wrote:
>
>
>
> On Jan 29, 12:25 pm, "George Moschovitis"
> <george.moschovi... at gmail.com> wrote:
> > Dear devs,
> >
> > with Tom's help I have succesfully converted Nitro to use the latest
> > annotations   from Facets 1.8 (and cleaned up the source code a bit in
> the
> > process).
> >
> > I would like to ask Tom to release my minor changes to ann_attr.rb
> (mainly
> > the ann_attr_callback, and the removed code) and the fixes in
> singular.rb as
> > Facets 1.8.1 so I can push my repository to the public darcs repository.
>
> okay. almost there. I see you removed serializable_attributes from
> facets ann_attr.rb. that's good b/c serialize annotation is specific
> to og, but the :class annotation is general, so I was thinking of
> having:
>
>   def classified_attributes
>     attributes.find_all do |a|
>       self.ann(a, :class)
>     end
>   end
>
> also (and more important) i'm not liking the the callback.
>
>   if Module.respond_to?(:ann_attr_callback)
>     Module.ann_attr_callback(self, klass, args)
>   end
>
> unless you see a reason it won't work, i think this would be better:
>
>   if respond_to?(:attr_callback)
>     attr_callback(self, args, harg)
>   end
>
> Example:
>
>   irb(main):012:0> class X
>   irb(main):013:1>   def self.attr_callback(*a); p *a; end
>   irb(main):014:1> end
>   => nil
>   irb(main):015:0> class X
>   irb(main):016:1>   attr :x, String, :doc => "hello"
>   irb(main):017:1> end
>   X
>   [:x]
>   {:class=>String, :doc=>"hello"}
>   => [:x]
>
> >From that you would just get the class via anno[:class] and instead of
> defining a univeral attr_callback as:
>
>   class Module
>     def self.attr_ann_callback
>       ...
>
> it would just be
>
>   class Module
>     def attr_callback
>       ...
>
> what do you think?
>
> T.
>
> _______________________________________________
> Nitro-general mailing list
> Nitro-general at rubyforge.org
> http://rubyforge.org/mailman/listinfo/nitro-general
>



-- 
http://blog.gmosx.com
http://cull.gr
http://www.joy.gr
http://nitroproject.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/nitro-general/attachments/20070130/904a9658/attachment.html 


More information about the Nitro-general mailing list