I just released a plugin that adds presenters to rails. We have been using it internally, so I would love to get some external feedback. Please let me know what you think: http://simply_presentable.richcollins.net/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
The example app is asking for a password, perhaps you need to enable public access to: http://richcollins.net/svn/simply_presentable_example On 1/6/07, Rich Collins <richcollins@gmail.com> wrote:> > I just released a plugin that adds presenters to rails. We have been > using it internally, so I would love to get some external feedback. > Please let me know what you think: > > http://simply_presentable.richcollins.net/ > > > >-- Cheers Koz --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Crap I thought I did - sorry I''ll fix it On Jan 5, 2007, at 7:53 PM, Michael Koziarski wrote:> > The example app is asking for a password, perhaps you need to enable > public access to: > > http://richcollins.net/svn/simply_presentable_example > > On 1/6/07, Rich Collins <richcollins@gmail.com> wrote: >> >> I just released a plugin that adds presenters to rails. We have been >> using it internally, so I would love to get some external feedback. >> Please let me know what you think: >> >> http://simply_presentable.richcollins.net/ >> >> > >> > > > -- > Cheers > > Koz > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Ah the example. I haven''t put it up yet so I removed it from the README. Thanks for the catch. On Jan 5, 2007, at 7:53 PM, Michael Koziarski wrote:> > The example app is asking for a password, perhaps you need to enable > public access to: > > http://richcollins.net/svn/simply_presentable_example > > On 1/6/07, Rich Collins <richcollins@gmail.com> wrote: >> >> I just released a plugin that adds presenters to rails. We have been >> using it internally, so I would love to get some external feedback. >> Please let me know what you think: >> >> http://simply_presentable.richcollins.net/ >> >> > >> > > > -- > Cheers > > Koz > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
Rich, Looks like an interesting start, although better usage examples would help. I hope you don''t mind a bit of constructive criticism: I think the use of the bang on present is wrong. (present!) It''s an inappropriate use of the idiom, especially considering you have a non-bang version _aliased_ to it. Maybe it''s just me, but when I see a big mistake like that in someone''s code it immediately raises red flags about what other problems might be lurking in the codebase. I recommend you drop the bang version of the method. Cheers, Obie On 1/5/07, Rich Collins <richcollins@gmail.com> wrote:> > I just released a plugin that adds presenters to rails. We have been > using it internally, so I would love to get some external feedback. > Please let me know what you think: > > http://simply_presentable.richcollins.net/ > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
I used the bang because the present method is doing something somewhat dangerous - adding methods and instance variables to the AR object that might clobber existing methods and attributes. The bang at the end of a message is often used when the message will modify the receiver instead of returning a new object (sort!). I think it is appropriate to use bang in this case as well since the argument is being modified. I''m not sure that it is a requirement that bang methods always have a safe counterpart. The alias is just there for backward compatibility. The method originally did not have a bang. The non-bang version of the method is used frequently in the project I extracted the plugin from. I should refactor our code and remove the non-bang methods. I''ll remove the alias and commit the change. On Jan 6, 2007, at 8:49 AM, Obie Fernandez wrote:> > Rich, > > Looks like an interesting start, although better usage examples > would help. > > I hope you don''t mind a bit of constructive criticism: I think the use > of the bang on present is wrong. (present!) It''s an inappropriate use > of the idiom, especially considering you have a non-bang version > _aliased_ to it. > Maybe it''s just me, but when I see a big mistake like that in > someone''s code it immediately raises red flags about what other > problems might be lurking in the codebase. I recommend you drop the > bang version of the method. > Cheers, > Obie > > On 1/5/07, Rich Collins <richcollins@gmail.com> wrote: >> >> I just released a plugin that adds presenters to rails. We have been >> using it internally, so I would love to get some external feedback. >> Please let me know what you think: >> >> http://simply_presentable.richcollins.net/ >> >> > >> > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
> I used the bang because the present method is doing something > somewhat dangerous - adding methods and instance variables to the AR > object that might clobber existing methods and attributes.Why not return a proxy, instead of modifying the instance? it''s way less likely to break anything, and probably faster to boot :). -- Cheers Koz --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---
I use SingleForwardable (http://ruby-doc.org/core/classes/ SingleForwardable.html), a type of proxy that defines methods and sets instance variables (AFAIK). On Jan 6, 2007, at 2:20 PM, Michael Koziarski wrote:> >> I used the bang because the present method is doing something >> somewhat dangerous - adding methods and instance variables to the AR >> object that might clobber existing methods and attributes. > > Why not return a proxy, instead of modifying the instance? it''s way > less likely to break anything, and probably faster to boot :). > > > > > -- > Cheers > > Koz > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---