From george.moschovitis at gmail.com Wed Aug 1 02:52:10 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Wed, 1 Aug 2007 09:52:10 +0300 Subject: [Nitro] Facets SVN In-Reply-To: <1185914350.423367.174310@o61g2000hsh.googlegroups.com> References: <1185914350.423367.174310@o61g2000hsh.googlegroups.com> Message-ID: Hello Tom, I am on vacation these days (but I managed to find an internet connection) I will checkout the code now. -g. On 7/31/07, Trans wrote: > > Hi-- > > I just imported Facets into the Rubyforge subversion repository. You > should be able to get an anonymous checkout of the latest with: > > svn checkout svn://rubyforge.org/var/svn/facets/trunk facets/ > > Facets 2.0 is coming along nicely --still some things I'd like to get > cleaned up, but a release (beta?) is Real Soon Now(tm). > > Btw, if you are interested in becoming a honest to goodness ruby spit- > shining Facets developer, let me know. > > T. > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.me.gr http://phidz.com 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/20070801/07a52cb8/attachment.html From transfire at gmail.com Wed Aug 1 20:27:16 2007 From: transfire at gmail.com (Trans) Date: Thu, 02 Aug 2007 00:27:16 -0000 Subject: [Nitro] Facets SVN In-Reply-To: References: <1185914350.423367.174310@o61g2000hsh.googlegroups.com> Message-ID: <1186014436.314436.242460@w3g2000hsg.googlegroups.com> On Jul 31, 11:52 pm, "George Moschovitis" wrote: > Hello Tom, > > I am on vacation these days (but I managed to find an internet connection) > I will checkout the code now. good good. keep in mind that some of the old code is now in other projects. you can check out blow already - i've upload it's source too. i still have english to upload (of all the libs it probably needs the most work) and also nemo. by the way, for per-method requires, the new location is, facets_by_method/. for example, require 'facets_by_method/string/lchomp' i thought about keeping facets/core/ for backward compatibility, and maybe I really ought too. but it's a bit of a misnomer now, b/c core is actually what is in 'src/core/lib/facets/', which is defined by the fact that if you do, require 'facets' everything in there is automatically loaded. but maybe backward compatibility is better than exacting semantics/ organization. hmmm... t. From transfire at gmail.com Wed Aug 1 22:52:22 2007 From: transfire at gmail.com (Trans) Date: Thu, 02 Aug 2007 02:52:22 -0000 Subject: [Nitro] Facets SVN In-Reply-To: References: <1185914350.423367.174310@o61g2000hsh.googlegroups.com> Message-ID: <1186023142.090009.185480@19g2000hsx.googlegroups.com> On Jul 31, 11:52 pm, "George Moschovitis" wrote: > Hello Tom, > > I am on vacation these days (but I managed to find an internet connection) > I will checkout the code now. english code is now in svn repo as well. svn checkout svn://rubyforge.org/var/svn/english that just leaves nemo, and then we should have everything we need to move forward with nitro 5-0. t. From george.moschovitis at gmail.com Thu Aug 2 09:45:51 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Thu, 2 Aug 2007 16:45:51 +0300 Subject: [Nitro] Facets SVN In-Reply-To: <1186023142.090009.185480@19g2000hsx.googlegroups.com> References: <1185914350.423367.174310@o61g2000hsh.googlegroups.com> <1186023142.090009.185480@19g2000hsx.googlegroups.com> Message-ID: > > english code is now in svn repo as well. > > svn checkout svn://rubyforge.org/var/svn/english > > that just leaves nemo, and then we should have everything we need to > move forward with nitro 5-0. > nice, just came back from vacations, will have a couple of days before I leave again ;-) -g. -- http://www.me.gr http://phidz.com 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/20070802/c3255ecd/attachment.html From george.moschovitis at gmail.com Fri Aug 3 12:41:22 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Fri, 3 Aug 2007 19:41:22 +0300 Subject: [Nitro] Patches? Message-ID: Does anyone have any patches for inclusion in the main repo? Jonathan? -g. -- http://www.me.gr http://phidz.com 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/20070803/737ddddf/attachment-0001.html From john at oxyliquit.de Sat Aug 4 17:57:09 2007 From: john at oxyliquit.de (Jonathan Buch) Date: Sun, 05 Aug 2007 00:57:09 +0300 Subject: [Nitro] Patches? In-Reply-To: References: Message-ID: Hi, > Does anyone have any patches for inclusion in the main repo? Jonathan? no patches, I've been busy wrapping up my work here in Finland. I hoped to do some in the few days I had here (like 3 days off work) but it didn't turn out to happen. Jo PS: well, no patches wouldn't be true, I have tons of stuff I'd like to move to Og head, but that'll never happen before 0.50 as I want to see Og on solid testing ground before anything else. -- Feel the love http://pinkjuice.com/pics/ruby.png From john at oxyliquit.de Sat Aug 4 17:57:09 2007 From: john at oxyliquit.de (Jonathan Buch) Date: Sun, 05 Aug 2007 00:57:09 +0300 Subject: [Nitro] vacation time for me Message-ID: Hi, I'm leaving Finland tomorrow again, taking a break of probably a week where I'm offline. I can only recommend the finnish country, nice place to be, friendly people, very nice environment and it was a great time being an intern there. Anyway. Will probably be back in a week, if not, then know that I'm still in denmark or northern germany. At max I'll be off until the 20th this month. Take care! Jo -- Feel the love http://pinkjuice.com/pics/ruby.png From transfire at gmail.com Sat Aug 4 20:58:45 2007 From: transfire at gmail.com (Trans) Date: Sun, 05 Aug 2007 00:58:45 -0000 Subject: [Nitro] vacation time for me In-Reply-To: References: Message-ID: <1186275525.047011.159040@o61g2000hsh.googlegroups.com> On Aug 4, 2:57 pm, "Jonathan Buch" wrote: > Hi, > > I'm leaving Finland tomorrow again, taking a break of probably a > week where I'm offline. I can only recommend the finnish country, > nice place to be, friendly people, very nice environment and it > was a great time being an intern there. > > Anyway. Will probably be back in a week, if not, then know that > I'm still in denmark or northern germany. At max I'll be off > until the 20th this month. > > Take care! Enjoy. T. From george.moschovitis at gmail.com Thu Aug 9 08:58:23 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Thu, 9 Aug 2007 15:58:23 +0300 Subject: [Nitro] Preparing nitro 0.50 Message-ID: Dear devs, while waiting for Trans to make the finishing touches to facets 2 and during my vacations I am working on preparing Nitro for the upcoming 0.50 release. These days I am working a bit on tests. I changed slightly the directory structure, have a look in raw/test. To run the (existing) tests give: $ rake test:raw I am trying to fix some small bugs and annoyances along the way. If anyone has something to report, let me know. thanks, -g. -- http://www.me.gr http://phidz.com 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/20070809/b95c76a7/attachment.html From ravage at fragmentized.net Thu Aug 9 09:56:50 2007 From: ravage at fragmentized.net (Rui Miguel) Date: Thu, 9 Aug 2007 14:56:50 +0100 Subject: [Nitro] Preparing nitro 0.50 In-Reply-To: References: Message-ID: <0B49C90B-3CC0-4112-A13C-A674EB3C096A@fragmentized.net> Hello! First congrats on the great project! I'm having an issue. When an error occurs outside the root controller it renders a blank page instead of error info. One little question, is it possible to Model.find( :include => [model1, model2, model3] ) to use many joins? and is it possible to select just the fields one wants to see? Model.find(:select => [:field1, :field2] ) Thank you, Rui Miguel On Aug 9, 2007, at Aug 9 - 13:58, George Moschovitis wrote: > Dear devs, > > while waiting for Trans to make the finishing touches to facets 2 > and during my vacations I am working on preparing > Nitro for the upcoming 0.50 release. These days I am working a bit > on tests. I changed slightly the directory structure, > have a look in raw/test. To run the (existing) tests give: > > $ rake test:raw > > I am trying to fix some small bugs and annoyances along the way. If > anyone has something to report, let me know. > > thanks, > -g. > > -- > http://www.me.gr > http://phidz.com > http://blog.gmosx.com > http://cull.gr > http://www.joy.gr > http://nitroproject.org > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general -------------- next part -------------- A non-text attachment was scrubbed... Name: PGP.sig Type: application/pgp-signature Size: 186 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/nitro-general/attachments/20070809/9e6ced25/attachment.bin From george.moschovitis at gmail.com Thu Aug 9 12:54:50 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Thu, 9 Aug 2007 19:54:50 +0300 Subject: [Nitro] Preparing nitro 0.50 In-Reply-To: <0B49C90B-3CC0-4112-A13C-A674EB3C096A@fragmentized.net> References: <0B49C90B-3CC0-4112-A13C-A674EB3C096A@fragmentized.net> Message-ID: Welcome to the Nitro community! Which version are you using? Please checkout the repository version: darcs get http://repo.nitroproject.org for more info: http://www.nitroproject.org/repo One little question, is it possible to Model.find( :include => > [model1, model2, model3] ) to use many joins? > and is it possible to select just the fields one wants to see? > Model.find(:select => [:field1, :field2] ) I haven't used this functionality lately. This should work as you describe. A quick test revealed some bugs though. Gimme a day or so to fix them and post a patch. thanks, -g. -- http://www.me.gr http://phidz.com 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/20070809/a2ae674b/attachment.html From ravage at fragmentized.net Thu Aug 9 14:29:20 2007 From: ravage at fragmentized.net (Rui Miguel) Date: Thu, 9 Aug 2007 19:29:20 +0100 Subject: [Nitro] Preparing nitro 0.50 In-Reply-To: References: <0B49C90B-3CC0-4112-A13C-A674EB3C096A@fragmentized.net> Message-ID: <757F1661-56A4-4154-95BF-D1D7A47E3348@fragmentized.net> Thank you! I'm using repo version. Replicated the error using blog example, there you go: DEBUG: SELECT * FROM ogcategory WHERE oid='aaKYGmrQur3lI4abFYZQ-0' DEBUG: Rendering '/status_500' ERROR: Error while handling '/categories/view/aaKYGmrQur3lI4abFYZQ-0' ERROR: private method `render_action' called for # /Users/ravage/Desktop/Pendente/nitro-dev/script/lib/../../raw/lib/ raw/controller/publishable.rb:38:in `method_missing' /Users/ravage/Desktop/Pendente/nitro-dev/script/lib/../../raw/lib/ raw/controller/render.rb:82:in `render' /Users/ravage/Desktop/Pendente/nitro-dev/script/lib/../../raw/lib/ raw/controller/render.rb:237:in `handle_error' /Users/ravage/Desktop/Pendente/nitro-dev/script/lib/../../raw/lib/ raw/controller/render.rb:106:in `render_action' /Users/ravage/Desktop/Pendente/nitro-dev/script/lib/../../raw/lib/ raw/adapter.rb:69:in `send' /Users/ravage/Desktop/Pendente/nitro-dev/script/lib/../../raw/lib/ raw/adapter.rb:69:in `handle_context' /Users/ravage/Desktop/Pendente/nitro-dev/script/lib/../../raw/lib/ raw/adapter/webrick.rb:134:in `do_GET' I get no error page, just a blank. Hope it helps. @ this time i'm more a user than a contributer, Ruby is still a new world to me... but i hope to be able to help with some bits. Thanks, Rui Miguel On Aug 9, 2007, at Aug 9 - 17:54, George Moschovitis wrote: > Welcome to the Nitro community! > > Which version are you using? Please checkout the repository version: > > darcs get http://repo.nitroproject.org > > for more info: > > http://www.nitroproject.org/repo > > One little question, is it possible to Model.find( :include => > [model1, model2, model3] ) to use many joins? > and is it possible to select just the fields one wants to see? > Model.find(:select => [:field1, :field2] ) > > I haven't used this functionality lately. This should work as you > describe. A quick test revealed some bugs though. > Gimme a day or so to fix them and post a patch. > > thanks, > -g. > > > > > > -- > http://www.me.gr > http://phidz.com > http://blog.gmosx.com > http://cull.gr > http://www.joy.gr > http://nitroproject.org > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general -------------- next part -------------- A non-text attachment was scrubbed... Name: PGP.sig Type: application/pgp-signature Size: 186 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/nitro-general/attachments/20070809/0edbd6d1/attachment.bin From george.moschovitis at gmail.com Thu Aug 9 16:32:02 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Thu, 9 Aug 2007 23:32:02 +0300 Subject: [Nitro] Preparing nitro 0.50 In-Reply-To: <757F1661-56A4-4154-95BF-D1D7A47E3348@fragmentized.net> References: <0B49C90B-3CC0-4112-A13C-A674EB3C096A@fragmentized.net> <757F1661-56A4-4154-95BF-D1D7A47E3348@fragmentized.net> Message-ID: Ok, I think I have fixed this. Pull from the repo, try again and let me know if it works. btw, you uncovered a nasty design issue in the render implementation. I will have to provide a better fix. thanks, -g. -- http://www.me.gr http://phidz.com 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/20070809/c51c53d3/attachment.html From billk at cts.com Thu Aug 9 17:45:19 2007 From: billk at cts.com (Bill Kelly) Date: Thu, 9 Aug 2007 14:45:19 -0700 Subject: [Nitro] Preparing nitro 0.50 References: <0B49C90B-3CC0-4112-A13C-A674EB3C096A@fragmentized.net> Message-ID: <061701c7dace$94b35f90$6442a8c0@musicbox> From: George Moschovitis > > Welcome to the Nitro community! > > Which version are you using? Please checkout the repository version: > > darcs get http://repo.nitroproject.org Apologies for the newbie question, but what is the recommended way to try out the repo version, when I already have various nitro and og gems installed? After the darcs get, I have: /usr/src/repo.nitroproject.org/ _darcs/ examples/ glue/ nitro/ og/ rakefile rake_tasks/ raw/ script/ Do I need to install each of these projects, such as glue, og, raw, and nitro individually into lib/ruby/site_ruby/1.8/... ? Or is there an easier way to try out the repo version? (Maybe install it in a ~/lib/ruby directory and add that directory to RUBYOPT?) Just wondering how the experts do it. Thanks, Bill From ravage at fragmentized.net Thu Aug 9 17:48:30 2007 From: ravage at fragmentized.net (Rui Miguel) Date: Thu, 9 Aug 2007 22:48:30 +0100 Subject: [Nitro] Preparing nitro 0.50 In-Reply-To: References: <0B49C90B-3CC0-4112-A13C-A674EB3C096A@fragmentized.net> <757F1661-56A4-4154-95BF-D1D7A47E3348@fragmentized.net> Message-ID: <706D6A3D-2F60-4A29-8A98-72D191DE7113@fragmentized.net> All is working now! I'm using Nitro to develop a little application, so i'll be posting issues i find. I have been looking into the code and i find it sometimes fragmented, mainly form_helper, xhtml_helpers and javascript..., the ones i looked more. But i think these are issues to take care in the long run. looking forward for 0.50 :) Thanks for the fix, Rui Miguel On Aug 9, 2007, at Aug 9 - 21:32, George Moschovitis wrote: > Ok, I think I have fixed this. Pull from the repo, try again and > let me know if it works. > > btw, you uncovered a nasty design issue in the render > implementation. I will have to provide a better fix. > > thanks, > -g. > > > -- > http://www.me.gr > http://phidz.com > http://blog.gmosx.com > http://cull.gr > http://www.joy.gr > http://nitroproject.org > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general -------------- next part -------------- A non-text attachment was scrubbed... Name: PGP.sig Type: application/pgp-signature Size: 186 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/nitro-general/attachments/20070809/1c57b042/attachment.bin From ravage at fragmentized.net Thu Aug 9 17:58:02 2007 From: ravage at fragmentized.net (Rui Miguel) Date: Thu, 9 Aug 2007 22:58:02 +0100 Subject: [Nitro] Preparing nitro 0.50 In-Reply-To: <061701c7dace$94b35f90$6442a8c0@musicbox> References: <0B49C90B-3CC0-4112-A13C-A674EB3C096A@fragmentized.net> <061701c7dace$94b35f90$6442a8c0@musicbox> Message-ID: Check this http://www.arnebrasseur.net/2007/07/01/the-daily-nitro/en/ Hope it helps. Greets, Rui Miguel On Aug 9, 2007, at Aug 9 - 22:45, Bill Kelly wrote: > Apologies for the newbie question, but what is the recommended way to > try out the repo version, when I already have various nitro and og > gems installed? > > After the darcs get, I have: > > /usr/src/repo.nitroproject.org/ > > _darcs/ examples/ glue/ nitro/ og/ rakefile rake_tasks/ > raw/ script/ > > > Do I need to install each of these projects, such as glue, og, raw, > and nitro individually into lib/ruby/site_ruby/1.8/... ? > > Or is there an easier way to try out the repo version? (Maybe > install it in a ~/lib/ruby directory and add that directory to > RUBYOPT?) > > Just wondering how the experts do it. > > > Thanks, > > Bill > -------------- next part -------------- A non-text attachment was scrubbed... Name: PGP.sig Type: application/pgp-signature Size: 186 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/nitro-general/attachments/20070809/2e549e77/attachment.bin From billk at cts.com Thu Aug 9 20:29:23 2007 From: billk at cts.com (Bill Kelly) Date: Thu, 9 Aug 2007 17:29:23 -0700 Subject: [Nitro] Preparing nitro 0.50 References: <0B49C90B-3CC0-4112-A13C-A674EB3C096A@fragmentized.net><061701c7dace$94b35f90$6442a8c0@musicbox> Message-ID: <065601c7dae5$80a34c60$6442a8c0@musicbox> From: "Rui Miguel" > > Check this http://www.arnebrasseur.net/2007/07/01/the-daily-nitro/en/ > > Hope it helps. Thanks. Looks like the "-r glycerin" does the magic. Wow, my app doesn't run at all anymore. Has "property" been completely eliminated in favor of "attr_accessor" ? Looks like the "setting" method is gone, too.... Time to look at some running example code I guess. :) Regards, Bill From george.moschovitis at gmail.com Fri Aug 10 03:13:20 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Fri, 10 Aug 2007 10:13:20 +0300 Subject: [Nitro] Preparing nitro 0.50 In-Reply-To: <065601c7dae5$80a34c60$6442a8c0@musicbox> References: <0B49C90B-3CC0-4112-A13C-A674EB3C096A@fragmentized.net> <061701c7dace$94b35f90$6442a8c0@musicbox> <065601c7dae5$80a34c60$6442a8c0@musicbox> Message-ID: > > Wow, my app doesn't run at all anymore. There are many changes (for the better), have a look in the blog example. -g. -- http://www.me.gr http://phidz.com 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/20070810/c748ec95/attachment.html From arne at arnebrasseur.net Fri Aug 10 03:25:00 2007 From: arne at arnebrasseur.net (arne at arnebrasseur.net) Date: Fri, 10 Aug 2007 00:25:00 -0700 (PDT) Subject: [Nitro] Preparing nitro 0.50 In-Reply-To: <065601c7dae5$80a34c60$6442a8c0@musicbox> References: <0B49C90B-3CC0-4112-A13C-A674EB3C096A@fragmentized.net><061701c7dace$94b35f90$6442a8c0@musicbox> <065601c7dae5$80a34c60$6442a8c0@musicbox> Message-ID: <3917.81.245.185.237.1186730700.squirrel@webmail.arnebrasseur.net> > From: "Rui Miguel" >> >> Check this http://www.arnebrasseur.net/2007/07/01/the-daily-nitro/en/ >> >> Hope it helps. Regarding that article, if you have any issues (or suggestions) with it please report so I can improve it. > Has "property" been completely eliminated in favor of > "attr_accessor" ? AFAIK yes. The new trend in Nitro is to stick to standard Ruby idioms, so attr_accessor instead of property, include (or is) instead of helper. (George, Jonathan, any others like this? interesting for the release notes...) > Looks like the "setting" method is gone, too.... Much code still uses settings from facets, I suppose that's what you're looking for. Maybe it just isn't loaded where you are using it. > > Time to look at some running example code I guess. :) > There are quite a few breaking changes since 0.42. The blog example should be a good starting point. Good luck! (ab) From Reid.Thompson at ateb.com Fri Aug 10 09:32:28 2007 From: Reid.Thompson at ateb.com (Reid Thompson) Date: Fri, 10 Aug 2007 09:32:28 -0400 Subject: [Nitro] Preparing nitro 0.50 In-Reply-To: <3917.81.245.185.237.1186730700.squirrel@webmail.arnebrasseur.net> References: <0B49C90B-3CC0-4112-A13C-A674EB3C096A@fragmentized.net> <061701c7dace$94b35f90$6442a8c0@musicbox> <065601c7dae5$80a34c60$6442a8c0@musicbox> <3917.81.245.185.237.1186730700.squirrel@webmail.arnebrasseur.net> Message-ID: <1186752750.12191.5.camel@jhereg> > >> Check this http://www.arnebrasseur.net/2007/07/01/the-daily-nitro/en/ > >> > Regarding that article, if you have any issues (or suggestions) with it > please report so I can improve it. > rthompso at jhereg: ~/src/repo.nitroproject.org/examples/blog$ env|grep RUBY RUBYOPT=-r/home/rthompso/src/repo.nitroproject.org//script/lib/glycerin -rubygems rthompso at jhereg: ~/src/repo.nitroproject.org/examples/blog$ env|grep NITRO NITRO_REPO=/home/rthompso/src/repo.nitroproject.org/ rthompso at jhereg: ~/src/repo.nitroproject.org/examples/blog$ ./app.rb /home/rthompso/src/repo.nitroproject.org/script/lib/../../raw/lib/raw/view/table.rb:5: uninitialized constant Raw (NameError) from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' from /home/rthompso/src/repo.nitroproject.org/script/lib/../../nitro/lib/nitro/part/admin/controller.rb:4 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' from /home/rthompso/src/repo.nitroproject.org/script/lib/../../nitro/lib/nitro/part/admin.rb:3 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' from ./app.rb:8 From ravage at fragmentized.net Fri Aug 10 10:37:42 2007 From: ravage at fragmentized.net (Rui Miguel) Date: Fri, 10 Aug 2007 15:37:42 +0100 Subject: [Nitro] Preparing nitro 0.50 In-Reply-To: <1186752750.12191.5.camel@jhereg> References: <0B49C90B-3CC0-4112-A13C-A674EB3C096A@fragmentized.net> <061701c7dace$94b35f90$6442a8c0@musicbox> <065601c7dae5$80a34c60$6442a8c0@musicbox> <3917.81.245.185.237.1186730700.squirrel@webmail.arnebrasseur.net> <1186752750.12191.5.camel@jhereg> Message-ID: Care to share you app.rb? All is working @ this side. Did you change anything in the default example? Greets, Rui Miguel On Aug 10, 2007, at Aug 10 - 14:32, Reid Thompson wrote: > >>>> Check this http://www.arnebrasseur.net/2007/07/01/the-daily- >>>> nitro/en/ >>>> > >> Regarding that article, if you have any issues (or suggestions) >> with it >> please report so I can improve it. >> > > rthompso at jhereg: ~/src/repo.nitroproject.org/examples/blog$ env| > grep RUBY > RUBYOPT=-r/home/rthompso/src/repo.nitroproject.org//script/lib/ > glycerin -rubygems > > rthompso at jhereg: ~/src/repo.nitroproject.org/examples/blog$ env| > grep NITRO > NITRO_REPO=/home/rthompso/src/repo.nitroproject.org/ > > > rthompso at jhereg: ~/src/repo.nitroproject.org/examples/blog$ ./app.rb > /home/rthompso/src/repo.nitroproject.org/script/lib/../../raw/lib/ > raw/view/table.rb:5: uninitialized constant Raw (NameError) > from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: > 27:in `gem_original_require' > from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: > 27:in `require' > from /home/rthompso/src/repo.nitroproject.org/script/ > lib/../../nitro/lib/nitro/part/admin/controller.rb:4 > from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: > 27:in `gem_original_require' > from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: > 27:in `require' > from /home/rthompso/src/repo.nitroproject.org/script/ > lib/../../nitro/lib/nitro/part/admin.rb:3 > from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: > 27:in `gem_original_require' > from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: > 27:in `require' > from ./app.rb:8 > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general -------------- next part -------------- A non-text attachment was scrubbed... Name: PGP.sig Type: application/pgp-signature Size: 186 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/nitro-general/attachments/20070810/7c6aa077/attachment.bin From Reid.Thompson at ateb.com Fri Aug 10 10:47:33 2007 From: Reid.Thompson at ateb.com (Reid Thompson) Date: Fri, 10 Aug 2007 10:47:33 -0400 Subject: [Nitro] Preparing nitro 0.50 In-Reply-To: References: <0B49C90B-3CC0-4112-A13C-A674EB3C096A@fragmentized.net> <061701c7dace$94b35f90$6442a8c0@musicbox> <065601c7dae5$80a34c60$6442a8c0@musicbox> <3917.81.245.185.237.1186730700.squirrel@webmail.arnebrasseur.net> <1186752750.12191.5.camel@jhereg> Message-ID: <1186757255.27382.1.camel@jhereg> On Fri, 2007-08-10 at 15:37 +0100, Rui Miguel wrote: > Care to share you app.rb? > > All is working @ this side. Did you change anything in the default > example? > > Greets, > Rui Miguel > > On Aug 10, 2007, at Aug 10 - 14:32, Reid Thompson wrote: > > > > >>>> Check this http://www.arnebrasseur.net/2007/07/01/the-daily- > >>>> nitro/en/ > >>>> > > > >> Regarding that article, if you have any issues (or suggestions) > >> with it > >> please report so I can improve it. > >> > > > > rthompso at jhereg: ~/src/repo.nitroproject.org/examples/blog$ env| > > grep RUBY > > RUBYOPT=-r/home/rthompso/src/repo.nitroproject.org//script/lib/ > > glycerin -rubygems > > > > rthompso at jhereg: ~/src/repo.nitroproject.org/examples/blog$ env| > > grep NITRO > > NITRO_REPO=/home/rthompso/src/repo.nitroproject.org/ > > > > > > rthompso at jhereg: ~/src/repo.nitroproject.org/examples/blog$ ./app.rb > > /home/rthompso/src/repo.nitroproject.org/script/lib/../../raw/lib/ > > raw/view/table.rb:5: uninitialized constant Raw (NameError) > > from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: > > 27:in `gem_original_require' > > from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: > > 27:in `require' > > from /home/rthompso/src/repo.nitroproject.org/script/ > > lib/../../nitro/lib/nitro/part/admin/controller.rb:4 > > from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: > > 27:in `gem_original_require' > > from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: > > 27:in `require' > > from /home/rthompso/src/repo.nitroproject.org/script/ > > lib/../../nitro/lib/nitro/part/admin.rb:3 > > from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: > > 27:in `gem_original_require' > > from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: > > 27:in `require' > > from ./app.rb:8 > > _______________________________________________ > > Nitro-general mailing list > > Nitro-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/nitro-general > rthompso at jhereg: ~/src/repo.nitroproject.org$ darcs whatsnew { hunk ./examples/blog/app.rb 5 -require "nitro_and_og"; include Nitro +require '/home/rthompso/src/repo.nitroproject.org/script/lib/glycerin' +#require "nitro_and_og"; include Nitro hunk ./examples/blog/conf/debug.rb 2 - Raw::Caching.enabled = false $ - Raw::Template.strip_xml_comments = false $ + Raw::Caching.enabled = false + Raw::Template.strip_xml_comments = false hunk ./examples/blog/conf/debug.rb 10 - Og.create_schema = true $ + Og.create_schema = true hunk ./examples/blog/conf/debug.rb 15 - :adapter => :mysql, - :user => "root", - :password => ENV["DB_PASSWORD"], # SET your password here! - :evolve_schema => :full $ + :adapter => :postgresql, + :user => "rthompso", + :password => "", + :evolve_schema => :full hunk ./examples/blog/conf/debug.rb 39 - $ + hunk ./examples/blog/conf/debug.rb 44 - $ + } rthompso at jhereg: ~/src/repo.nitroproject.org$ From Reid.Thompson at ateb.com Fri Aug 10 10:50:15 2007 From: Reid.Thompson at ateb.com (Reid Thompson) Date: Fri, 10 Aug 2007 10:50:15 -0400 Subject: [Nitro] Preparing nitro 0.50 In-Reply-To: <1186757255.27382.1.camel@jhereg> References: <0B49C90B-3CC0-4112-A13C-A674EB3C096A@fragmentized.net> <061701c7dace$94b35f90$6442a8c0@musicbox> <065601c7dae5$80a34c60$6442a8c0@musicbox> <3917.81.245.185.237.1186730700.squirrel@webmail.arnebrasseur.net> <1186752750.12191.5.camel@jhereg> <1186757255.27382.1.camel@jhereg> Message-ID: <1186757417.27382.2.camel@jhereg> > > rthompso at jhereg: ~/src/repo.nitroproject.org$ darcs whatsnew > { > hunk ./examples/blog/app.rb 5 > -require "nitro_and_og"; include Nitro > +require '/home/rthompso/src/repo.nitroproject.org/script/lib/glycerin' > +#require "nitro_and_og"; include Nitro reverted this -- running ok now -- sorry for the noise From transfire at gmail.com Fri Aug 10 11:47:09 2007 From: transfire at gmail.com (Trans) Date: Fri, 10 Aug 2007 15:47:09 -0000 Subject: [Nitro] Preparing nitro 0.50 In-Reply-To: <065601c7dae5$80a34c60$6442a8c0@musicbox> References: <065601c7dae5$80a34c60$6442a8c0@musicbox> Message-ID: <1186760829.526328.119210@i38g2000prf.googlegroups.com> On Aug 9, 5:29 pm, "Bill Kelly" wrote: > From: "Rui Miguel" > > > > > Check thishttp://www.arnebrasseur.net/2007/07/01/the-daily-nitro/en/ > > > Hope it helps. > > Thanks. Looks like the "-r glycerin" does the magic. > > Wow, my app doesn't run at all anymore. > > Has "property" been completely eliminated in favor of > "attr_accessor" ? I'm surprised you didn't leave property as an alias of attr_accessor. I think that's a reasonable thing to do, since it's a simple thing, and will help backward compatibility (and remains available should you ever reconsider the attr_accessor decsision ;) T. From billk at cts.com Fri Aug 10 15:25:06 2007 From: billk at cts.com (Bill Kelly) Date: Fri, 10 Aug 2007 12:25:06 -0700 Subject: [Nitro] Preparing nitro 0.50 References: <065601c7dae5$80a34c60$6442a8c0@musicbox> <1186760829.526328.119210@i38g2000prf.googlegroups.com> Message-ID: <07ab01c7db84$28d85260$6442a8c0@musicbox> From: "Trans" > > On Aug 9, 5:29 pm, "Bill Kelly" wrote: >> From: "Rui Miguel" >> >> > Check thishttp://www.arnebrasseur.net/2007/07/01/the-daily-nitro/en/ >> >> > Hope it helps. >> >> Thanks. Looks like the "-r glycerin" does the magic. >> >> Wow, my app doesn't run at all anymore. >> >> Has "property" been completely eliminated in favor of >> "attr_accessor" ? > > I'm surprised you didn't leave property as an alias of attr_accessor. > I think that's a reasonable thing to do, since it's a simple thing, > and will help backward compatibility (and remains available should you > ever reconsider the attr_accessor decsision ;) Just to add my 2 cents... I would have preferred to continue to use "property", because overriding attr_accessor feels a little too magic to me; and I tend to regard my og-managed classes as distinct from "normal" ruby classes. To me, I don't think my og-managed classes become more readable by making their definitions harder to distinguish from normal ruby classes. I feel og-managed classes are really quite special, and require special treatment, so I kind of liked that property showed that they aren't really quite ordinary. But... just my opinion. :) Regards, Bill From george.moschovitis at gmail.com Fri Aug 10 17:52:53 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sat, 11 Aug 2007 00:52:53 +0300 Subject: [Nitro] Preparing nitro 0.50 In-Reply-To: <1186760829.526328.119210@i38g2000prf.googlegroups.com> References: <065601c7dae5$80a34c60$6442a8c0@musicbox> <1186760829.526328.119210@i38g2000prf.googlegroups.com> Message-ID: > > I'm surprised you didn't leave property as an alias of attr_accessor. > I think that's a reasonable thing to do, since it's a simple thing, > and will help backward compatibility (and remains available should you > ever reconsider the attr_accessor decsision ;) well, I will add this again ;-) -g. T. > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.me.gr http://phidz.com 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/20070811/0e871457/attachment.html From george.moschovitis at gmail.com Fri Aug 10 20:05:02 2007 From: george.moschovitis at gmail.com (george.moschovitis at gmail.com) Date: Sat, 11 Aug 2007 00:05:02 +0000 (UTC) Subject: [Nitro] =?utf-8?q?=5BNP=2EORG=5D_Nitro/Og_Fora_daily_digest?= Message-ID: <20070811000502.9E9668701@reizu.com> >From gmosx.myopenid.com Date: Fri Aug 10 10:02:06 UTC 2007 Subject: Remove template stack functionality? Message-ID: http://www.nitroproject.org/fora/posts/view/daetEUrYGr3jYMeJeZaaqU Dear devs, in the process of symplifying Nitro, I am considering removing the template stack functionality. I don't think anyone is using it (if you don't count the default error handler, which I would like to re-implement anyway). any objections? -g. >From gmosx.myopenid.com Date: Fri Aug 10 09:53:40 UTC 2007 Subject: Remove template stack functionality? Message-ID: http://www.nitroproject.org/fora/posts/view/csLqgYrYCr3ltneJeZaaqU Dear devs, in the process of symplifying Nitro, I am considering removing the template stack functionality. I don't think anyone is using it (if you don't count the default error handler, which I would like to reimplement anyway). any objections? -g. >From gmosx.myopenid.com Date: Fri Aug 10 09:53:28 UTC 2007 Subject: Remove template stack functionality? Message-ID: http://www.nitroproject.org/fora/posts/view/clGtKyrYCr3ktfeJeZaaqU Dear devs, in the process of symplifying Nitro, I am considering removing the template stack functionality. I don't think anyone is using it (if you don't count the default error handler, which I would like to reimplement anyway). any objections? -g. >From gmosx.myopenid.com Date: Fri Aug 10 09:53:25 UTC 2007 Subject: Remove template stack functionality? Message-ID: http://www.nitroproject.org/fora/posts/view/ckbHk2rYCr3jgDeJeZaaqU Dear devs, in the process of symplifying Nitro, I am considering removing the template stack functionality. I don't think anyone is using it (if you don't count the default error handler, which I would like to reimplement anyway). any objections? -g. -- This mail is automatically generated from the http://nitroproject.org/fora digest robot. It presents the discussions in the fora during the last 24 hours. Do not reply to this email. From james.britt at gmail.com Fri Aug 10 20:47:40 2007 From: james.britt at gmail.com (James Britt) Date: Fri, 10 Aug 2007 17:47:40 -0700 Subject: [Nitro] Preparing nitro 0.50 In-Reply-To: References: <065601c7dae5$80a34c60$6442a8c0@musicbox> <1186760829.526328.119210@i38g2000prf.googlegroups.com> Message-ID: <46BD072C.8020804@gmail.com> George Moschovitis wrote: > I'm surprised you didn't leave property as an alias of attr_accessor. > I think that's a reasonable thing to do, since it's a simple thing, > and will help backward compatibility (and remains available should you > ever reconsider the attr_accessor decsision ;) > > > well, I will add this again ;-) But please add deprecation warnings for it. What I like about Og is that you can code more or less plain Ruby and, with a few extra moves, get automagic persistence. -- James Britt "In physics the truth is rarely perfectly clear, and that is certainly universally the case in human affairs. Hence, what is not surrounded by uncertainty cannot be the truth." - R. Feynman From james.britt at gmail.com Fri Aug 10 20:49:30 2007 From: james.britt at gmail.com (James Britt) Date: Fri, 10 Aug 2007 17:49:30 -0700 Subject: [Nitro] [NP.ORG] Nitro/Og Fora daily digest In-Reply-To: <20070811000502.9E9668701@reizu.com> References: <20070811000502.9E9668701@reizu.com> Message-ID: <46BD079A.90405@gmail.com> george.moschovitis at gmail.com wrote: >>From gmosx.myopenid.com > Date: Fri Aug 10 10:02:06 UTC 2007 > Subject: Remove template stack functionality? > Message-ID: http://www.nitroproject.org/fora/posts/view/daetEUrYGr3jYMeJeZaaqU > > Dear devs, > > in the process of symplifying Nitro, I am considering removing the template stack functionality. I don't think anyone is using it (if you don't count the default error handler, which I would like to re-implement anyway). > > any objections? Well, first explain what it is. ;) I think I know, but I'm not sure, though I'm fairly certain that there are many sweet features in Og/Nitro/Raw that I've never made use of because of my ignorance. James From transfire at gmail.com Fri Aug 10 21:16:35 2007 From: transfire at gmail.com (Trans) Date: Sat, 11 Aug 2007 01:16:35 -0000 Subject: [Nitro] Preparing nitro 0.50 In-Reply-To: <46BD072C.8020804@gmail.com> References: <065601c7dae5$80a34c60$6442a8c0@musicbox> <1186760829.526328.119210@i38g2000prf.googlegroups.com> <46BD072C.8020804@gmail.com> Message-ID: <1186794995.359958.107900@w3g2000hsg.googlegroups.com> On Aug 10, 5:47 pm, James Britt wrote: > George Moschovitis wrote: > > I'm surprised you didn't leave property as an alias of attr_accessor. > > I think that's a reasonable thing to do, since it's a simple thing, > > and will help backward compatibility (and remains available should you > > ever reconsider the attr_accessor decsision ;) > > > well, I will add this again ;-) > > But please add deprecation warnings for it. Well, not unless it in fact will be deprecated. I don;t necessarily see anything wrong with supporting both. At the very least, it can always be an optional require. > What I like about Og is that you can code more or less plain Ruby and, > with a few extra moves, get automagic persistence. I agree. That is a benefit. But it's "not quite" b/c you still have to specify the persistence class. Eg. attr_accessor :x, String That "String" throws it off, so then is it really any better than using #property? I sometimes feel a little uncomfortable about the override of the attr methods. I guess one of the reasons is that Ara has his own lib that overrides them for defaults, like so: attr_accessor :x => "foo" Which seems pretty useful too. An you can generally infer the class from a default, but unfortunately not always. Obviously Ara's override scheme is more limited than annotations. We can do the same with: attr_accessor :x, :default => "foo" but, it's just an annotation and doesn't actually do what Ara's does (ie. prime @x with "foo"). Rather it provides Og with some persistence metadata. But what if we wanted both? Stuff like this has made me concerned about annotation conflicts. While it seems like annotations should have the potential to become a powerful general purpose tool, the potential of such conflicts may be a seriously limiting flaw. Can it be overcome? --some sort of annotations namespaces perhaps? Or am I just worrying over a mole hill? T. From transfire at gmail.com Fri Aug 10 21:34:17 2007 From: transfire at gmail.com (Trans) Date: Sat, 11 Aug 2007 01:34:17 -0000 Subject: [Nitro] CLI libs in Facets or not? Message-ID: <1186796057.657304.115590@g4g2000hsf.googlegroups.com> I'm am down to my final significant organizational decision for Facets 2.0 (Talk about your wild rides. I seriously doubt any code in the universe has been poked and prodded and shoved around as much a Facets' code has). The final question is whether to move the cli libs out to their own project. This includes ansicode.rb, command.rb, arguments.rb, progressbar.rb, and a few others. If I do keep them in Facets, I'm considering moving them to a CLI:: namespace and put them in a facets/cli/ subdir. On the other hand, and why this is a question, the CLI libs are probably some of the most useful/reusable code in the whole library. So maybe for that reason it merits a separate project? I'm not sure. I'm torn between the two choices. On one hand I like the idea of these libs being readily available from Facets --don't need to worry about installing something else, and so forth. On the other hand, I can see how they can stand out as it a strong library in its own right. What is the Glycerider take? T. From george.moschovitis at gmail.com Sat Aug 11 03:56:12 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sat, 11 Aug 2007 10:56:12 +0300 Subject: [Nitro] [NP.ORG] Nitro/Og Fora daily digest In-Reply-To: <46BD079A.90405@gmail.com> References: <20070811000502.9E9668701@reizu.com> <46BD079A.90405@gmail.com> Message-ID: > > Well, first explain what it is. ;) In Nitro we don't have a template_root (ie a directory where to look for templates) but a template_root stack. Ie there are multiple directories. If a template is not found in the top dir of the stack nitro walks the stack to find another template_root dir. The bottom template_root dir is the proto/template directory. The top dir may be app/template. Controllers in parts (nitro reusable pieces of functionality) can insert a local template in the stack. And generally you can manipulate this stack for special fx. This mechanism allows you to 'override' (or 'overload') templates. Lets say you want to change the default 50x error page template. Just put a template called status_500.htmlx in app/template (that goes before proto/template). But these days I am thinking that this complex mechanism is not really necessary. -g. -- http://www.me.gr http://phidz.com 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/20070811/4d18c010/attachment-0001.html From george.moschovitis at gmail.com Sat Aug 11 03:59:49 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sat, 11 Aug 2007 10:59:49 +0300 Subject: [Nitro] CLI libs in Facets or not? In-Reply-To: <1186796057.657304.115590@g4g2000hsf.googlegroups.com> References: <1186796057.657304.115590@g4g2000hsf.googlegroups.com> Message-ID: As I have previously said I preferred having just two projects: core/more but now that you have splitted facets in multiple, granular projects (for example) English, I think it is appropriate for the cli utils to have a separate project as well. -g. On 8/11/07, Trans wrote: > > I'm am down to my final significant organizational decision for Facets > 2.0 (Talk about your wild rides. I seriously doubt any code in the > universe has been poked and prodded and shoved around as much a > > What is the Glycerider take? > > T. > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.me.gr http://phidz.com 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/20070811/e46d631e/attachment.html From george.moschovitis at gmail.com Sat Aug 11 05:12:15 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sat, 11 Aug 2007 12:12:15 +0300 Subject: [Nitro] Preparing nitro 0.50 In-Reply-To: <1186794995.359958.107900@w3g2000hsg.googlegroups.com> References: <065601c7dae5$80a34c60$6442a8c0@musicbox> <1186760829.526328.119210@i38g2000prf.googlegroups.com> <46BD072C.8020804@gmail.com> <1186794995.359958.107900@w3g2000hsg.googlegroups.com> Message-ID: > > Well, not unless it in fact will be deprecated. I don;t necessarily > see anything wrong with supporting both. At the very least, it can > always be an optional require. > I ve just seen that Nitro 0.50.0 allows property as an alias to attr_accessor. -g. -- http://www.me.gr http://phidz.com 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/20070811/236a0674/attachment.html From george.moschovitis at gmail.com Sat Aug 11 05:57:40 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sat, 11 Aug 2007 12:57:40 +0300 Subject: [Nitro] Preparing nitro 0.50 In-Reply-To: <0B49C90B-3CC0-4112-A13C-A674EB3C096A@fragmentized.net> References: <0B49C90B-3CC0-4112-A13C-A674EB3C096A@fragmentized.net> Message-ID: > > and is it possible to select just the fields one wants to see? > Model.find(:select => [:field1, :field2] ) > I just fixed this in the repo so it IS possible. -g. -- http://www.me.gr http://phidz.com 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/20070811/53c0a4b5/attachment.html From transfire at gmail.com Sat Aug 11 09:15:05 2007 From: transfire at gmail.com (Trans) Date: Sat, 11 Aug 2007 13:15:05 -0000 Subject: [Nitro] CLI libs in Facets or not? In-Reply-To: References: <1186796057.657304.115590@g4g2000hsf.googlegroups.com> Message-ID: <1186838105.863911.22600@b79g2000hse.googlegroups.com> On Aug 11, 12:59 am, "George Moschovitis" wrote: > As I have previously said I preferred having just two projects: > > core/more Yes, to be sure I've come ''-this close to doing exactly that with Facets. I seem endlessly torn between one project, two projects and the 50+ little mini-projects approach. All have merits and downsides. The mini-project approach, for instance, allows for selective usage of the many more libraries (eg. if you just want annotations you just install annotations), but it's a nightmare in version control if you want to use a bunch of libraries at once, as is Nitro/Og's case, so I ultimately decided against it. However I did see where some parts of Facets stood out as beyond what one might expect from a supplement to Ruby's core and standard libs. It's those libs I moved to their own projects, namely Stick, English and Blow. Yes, in some respects it would be nice to have everything under the Helios in one install (gem install it_all ;), but in reality we have to draw some lines. I think these three outcrops are a good compromise. Of course, I have still been tempted to divide what remains between core/more projects, Such a divide does have some organizational benefits to us developers, and offers a little more choice to the end- users. And I've considered a variety of naming schemes for this: 'facets_core', 'facets_more' with a 'facets' meta-package, or just 'core', 'more' and 'facets' as you suggest, or (what I was leaning toward most recently) just two packages, 'facets' and 'ultrafacets', since the later depends on the former. These later options has some nice merits. But ultimately I've never been quite persuaded to return to the nano/mega jaunt (as cool as those names were ;), and give up on the single install and version number. Maybe ultimately this split should happen (Facets 3.0? ;), but for now I think the off-shoot projects are enough of a compromise. Having said that though, I just want you to knwo, that I can totally see why you favor core/more. 'core' and 'more' no doubt fit nicely with rest of Nitro's names. And if Facets were only Nitro's "Glue", I'd take that route. But Facets is also it's own project too (which is actually a benefit to Nitro) and so I'm more inclined to keeping 'facets' in the package names. Sorry to get a little long winded on this. I just wanted you to understand my thought processes on the matter. > but now that you have split facets in multiple, granular projects > (for example) English, I think it is appropriate for the cli utils to > have a separate project as well. Okay, cool. That's what I was thinking too. "Clio" right? :) My only hesitation has been in considering: if I were making Ruby's standard library (the Modus Operandi question of Facets), what would I make sure to put in it? CLI libs are definitely on that list. T. From george.moschovitis at gmail.com Sat Aug 11 09:35:55 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sat, 11 Aug 2007 16:35:55 +0300 Subject: [Nitro] CLI libs in Facets or not? In-Reply-To: <1186838105.863911.22600@b79g2000hse.googlegroups.com> References: <1186796057.657304.115590@g4g2000hsf.googlegroups.com> <1186838105.863911.22600@b79g2000hse.googlegroups.com> Message-ID: > > Okay, cool. That's what I was thinking too. "Clio" right? :) My only Clio is ok ;-) I am still waiting to see the rest of the projects in svn. -g. -- http://www.me.gr http://phidz.com 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/20070811/fca1be53/attachment.html From ravage at fragmentized.net Sat Aug 11 23:05:44 2007 From: ravage at fragmentized.net (Rui Miguel) Date: Sun, 12 Aug 2007 04:05:44 +0100 Subject: [Nitro] Regarding :include and :select and some SQL questions Message-ID: Hello! Attached is included some Og tests which fail using these functionalities together. Hope i'm not doing anything wrong and appreciate correction if i am. :select is very sensible and should be taken to attention if it gets included in Nitro because when used with :include doesn't work. Implementation should be thought carefully. When using :select with :include it's necessary to know, to which model a field refers, which should be described when passing the :select argument to avoid ambiguity. The current code breaks when passing two fields to :select. I changed it a bit so it would work when passing two or more parameters, that's when i add the field ambiguity issue described above. Regarding :include, would it be possible to change SQL generation into "LEFT JOIN table2 ON table1.field = table2.field? Regarding Model.select, should this work, Model.select("select nome from ogaluno where turma_oid not in (select oid from ogturma)"), returning only field "nome"? or how should it behave? Just curious. Or a more simple one like Model.select("SELECT * FROM oguser"). Regards, Rui Miguel -------------- next part -------------- A non-text attachment was scrubbed... Name: og_tests.patch Type: application/octet-stream Size: 55723 bytes Desc: not available Url : http://rubyforge.org/pipermail/nitro-general/attachments/20070812/54c7e8b5/attachment-0001.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: PGP.sig Type: application/pgp-signature Size: 186 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/nitro-general/attachments/20070812/54c7e8b5/attachment-0001.bin From george.moschovitis at gmail.com Sun Aug 12 04:33:33 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sun, 12 Aug 2007 11:33:33 +0300 Subject: [Nitro] Regarding :include and :select and some SQL questions In-Reply-To: References: Message-ID: > > The current code breaks when passing two fields to :select. I fixed this yesterday, have you pulled the latest code? Anw, I will try your code. -g. -- http://www.me.gr http://phidz.com 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/20070812/3a546510/attachment.html From george.moschovitis at gmail.com Sun Aug 12 06:40:47 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sun, 12 Aug 2007 13:40:47 +0300 Subject: [Nitro] Repository Gems Message-ID: Dear devs, I just added some gems generated for the repository code to the site: http://www.nitroproject.org/repo/gems Can you please download, test them and report any bugs? thanks, George -- http://www.me.gr http://phidz.com 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/20070812/639df725/attachment.html From ravage at fragmentized.net Sun Aug 12 07:58:16 2007 From: ravage at fragmentized.net (Rui Miguel) Date: Sun, 12 Aug 2007 12:58:16 +0100 Subject: [Nitro] Repository Gems In-Reply-To: References: Message-ID: <90258E1B-EA69-4944-8183-4D14B1A1A0A3@fragmentized.net> Hello! It complains about gen versions: eflow:~/Desktop/Inbox ravage$ sudo gem install nitro-0.50.0.gem ERROR: While executing gem ... (RuntimeError) Error instaling nitro-0.50.0.gem: nitro requires gen = 0.50.0 Regards, Rui Miguel On Aug 12, 2007, at Aug 12 - 11:40, George Moschovitis wrote: > Dear devs, > > I just added some gems generated for the repository code to the site: > > http://www.nitroproject.org/repo/gems > > Can you please download, test them and report any bugs? > > thanks, > George > > -- > http://www.me.gr > http://phidz.com > http://blog.gmosx.com > http://cull.gr > http://www.joy.gr > http://nitroproject.org > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general -------------- next part -------------- A non-text attachment was scrubbed... Name: PGP.sig Type: application/pgp-signature Size: 186 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/nitro-general/attachments/20070812/408701dd/attachment.bin From george.moschovitis at gmail.com Sun Aug 12 08:09:22 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sun, 12 Aug 2007 15:09:22 +0300 Subject: [Nitro] Repository Gems In-Reply-To: <90258E1B-EA69-4944-8183-4D14B1A1A0A3@fragmentized.net> References: <90258E1B-EA69-4944-8183-4D14B1A1A0A3@fragmentized.net> Message-ID: Fixed this, please try again. -g. On 8/12/07, Rui Miguel wrote: > > Hello! > > It complains about gen versions: > > eflow:~/Desktop/Inbox ravage$ sudo gem install nitro-0.50.0.gem > ERROR: While executing gem ... (RuntimeError) > Error instaling nitro-0.50.0.gem: > nitro requires gen = 0.50.0 > > Regards, > Rui Miguel > > On Aug 12, 2007, at Aug 12 - 11:40, George Moschovitis wrote: > > > Dear devs, > > > > I just added some gems generated for the repository code to the site: > > > > http://www.nitroproject.org/repo/gems > > > > Can you please download, test them and report any bugs? > > > > thanks, > > George > > > > -- > > http://www.me.gr > > http://phidz.com > > http://blog.gmosx.com > > http://cull.gr > > http://www.joy.gr > > http://nitroproject.org > > _______________________________________________ > > Nitro-general mailing list > > Nitro-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/nitro-general > > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > > -- http://www.me.gr http://phidz.com 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/20070812/27db3c67/attachment.html From ravage at fragmentized.net Sun Aug 12 08:15:54 2007 From: ravage at fragmentized.net (Rui Miguel) Date: Sun, 12 Aug 2007 13:15:54 +0100 Subject: [Nitro] Repository Gems In-Reply-To: References: <90258E1B-EA69-4944-8183-4D14B1A1A0A3@fragmentized.net> Message-ID: <813B4AFD-9D86-41AD-9EFC-BD57B04B9BBF@fragmentized.net> Working as intended ;) thanks, Rui Miguel On Aug 12, 2007, at Aug 12 - 13:09, George Moschovitis wrote: > Fixed this, please try again. > > -g. > > On 8/12/07, Rui Miguel wrote: Hello! > > It complains about gen versions: > > eflow:~/Desktop/Inbox ravage$ sudo gem install nitro-0.50.0.gem > ERROR: While executing gem ... (RuntimeError) > Error instaling nitro-0.50.0.gem: > nitro requires gen = 0.50.0 > > Regards, > Rui Miguel > > On Aug 12, 2007, at Aug 12 - 11:40, George Moschovitis wrote: > > > Dear devs, > > > > I just added some gems generated for the repository code to the > site: > > > > http://www.nitroproject.org/repo/gems > > > > Can you please download, test them and report any bugs? > > > > thanks, > > George > > > > -- > > http://www.me.gr > > http://phidz.com > > http://blog.gmosx.com > > http://cull.gr > > http://www.joy.gr > > http://nitroproject.org > > _______________________________________________ > > Nitro-general mailing list > > Nitro-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/nitro-general > > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > > > > > -- > http://www.me.gr > http://phidz.com > http://blog.gmosx.com > http://cull.gr > http://www.joy.gr > http://nitroproject.org > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general -------------- next part -------------- A non-text attachment was scrubbed... Name: PGP.sig Type: application/pgp-signature Size: 186 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/nitro-general/attachments/20070812/aadaf7c8/attachment.bin From george.moschovitis at gmail.com Sun Aug 12 08:20:41 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sun, 12 Aug 2007 15:20:41 +0300 Subject: [Nitro] Repository Gems In-Reply-To: <813B4AFD-9D86-41AD-9EFC-BD57B04B9BBF@fragmentized.net> References: <90258E1B-EA69-4944-8183-4D14B1A1A0A3@fragmentized.net> <813B4AFD-9D86-41AD-9EFC-BD57B04B9BBF@fragmentized.net> Message-ID: > > Working as intended ;) Great... Is this easier than using darcs/glycerin.rb ? -g. -- http://www.me.gr http://phidz.com 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/20070812/c4ae5c17/attachment.html From ravage at fragmentized.net Sun Aug 12 08:28:32 2007 From: ravage at fragmentized.net (Rui Miguel) Date: Sun, 12 Aug 2007 13:28:32 +0100 Subject: [Nitro] Repository Gems In-Reply-To: References: <90258E1B-EA69-4944-8183-4D14B1A1A0A3@fragmentized.net> <813B4AFD-9D86-41AD-9EFC-BD57B04B9BBF@fragmentized.net> Message-ID: <0285658E-0BCE-4724-814C-81BC095F7C8E@fragmentized.net> I personally prefer a darcs pull and setting RUBYOPTS (arne's blog) also requiring darcs/glycerin ain't so bad, if one is following development branch. IMHO i'd go for darcs pull and setting environment. But this gems are awesome for someone who doesn't want to mess with darcs et al. Regards, Rui Miguel On Aug 12, 2007, at Aug 12 - 13:20, George Moschovitis wrote: > Working as intended ;) > > Great... Is this easier than using darcs/glycerin.rb ? > > -g. > > > > > -- > http://www.me.gr > http://phidz.com > http://blog.gmosx.com > http://cull.gr > http://www.joy.gr > http://nitroproject.org > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general -------------- next part -------------- A non-text attachment was scrubbed... Name: PGP.sig Type: application/pgp-signature Size: 186 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/nitro-general/attachments/20070812/af4a7e21/attachment.bin From ravage at fragmentized.net Sun Aug 12 09:41:48 2007 From: ravage at fragmentized.net (Rui Miguel) Date: Sun, 12 Aug 2007 14:41:48 +0100 Subject: [Nitro] Regarding :include and :select and some SQL questions In-Reply-To: References: Message-ID: Hello! Somehow i missed your reply to this issue... Did the Og tests sent passed on your side? Thanks, Rui Miguel On Aug 12, 2007, at Aug 12 - 04:05, Rui Miguel wrote: > Hello! > > Attached is included some Og tests which fail using these > functionalities together. Hope i'm not doing anything wrong and > appreciate correction if i am. > > :select is very sensible and should be taken to attention if it > gets included in Nitro because when used with :include doesn't work. > > Implementation should be thought carefully. When using :select > with :include it's necessary to know, to which model a field > refers, which should be described when passing the :select argument > to avoid ambiguity. > > The current code breaks when passing two fields to :select. > I changed it a bit so it would work when passing two or more > parameters, that's when i add the field ambiguity issue described > above. > > Regarding :include, would it be possible to change SQL generation > into "LEFT JOIN table2 ON table1.field = table2.field? > > Regarding Model.select, should this work, > Model.select("select nome from ogaluno where turma_oid not in > (select oid from ogturma)"), returning only field "nome"? or how > should it behave? Just curious. Or a more simple one like > Model.select("SELECT * FROM oguser"). > > > Regards, > Rui Miguel > > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general -------------- next part -------------- A non-text attachment was scrubbed... Name: PGP.sig Type: application/pgp-signature Size: 186 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/nitro-general/attachments/20070812/fa1bc043/attachment-0001.bin From george.moschovitis at gmail.com Mon Aug 13 04:25:53 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Mon, 13 Aug 2007 11:25:53 +0300 Subject: [Nitro] Og table prefix Message-ID: Dear devs, I am thinking about droping the 'og' prefix from model tables by default (the setting will stay). From what I see you can have safe table names by using backtick (`) in mysql and double quotes (") in Postgresql. What do you thinkg? -g. -- http://www.me.gr http://phidz.com 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/20070813/24962cc6/attachment.html From john at oxyliquit.de Mon Aug 13 06:13:50 2007 From: john at oxyliquit.de (Jonathan Buch) Date: Mon, 13 Aug 2007 12:13:50 +0200 Subject: [Nitro] Og table prefix In-Reply-To: References: Message-ID: Hi, > I am thinking about droping the 'og' prefix from model tables by default > (the setting will stay). From what I see you can have safe table names by > using backtick (`) in mysql and double quotes (") in Postgresql. What do you > think? I happen to like the prefix, as I often use psql and it's tab trigger to autocomplete table names. Having the 'og' prefix makes things easier for me. As you (if you don't do more low level db stuff) never really specify the table name at all, they could be hashes instead of good sounding names. ;) That said, I just see no real benefit other than 'looks slightly better from the outside' and vote against. Jo -- Feel the love http://pinkjuice.com/pics/ruby.png From ravage at fragmentized.net Mon Aug 13 07:54:46 2007 From: ravage at fragmentized.net (Rui Miguel) Date: Mon, 13 Aug 2007 12:54:46 +0100 Subject: [Nitro] Og table prefix In-Reply-To: References: Message-ID: <7F82BE22-2427-4DF5-BB4D-E8238EAF1260@fragmentized.net> Hello, I like the default also, and think it's safer and more intuitive for databases with managed and unmanaged tables all together. Rui Miguel On Aug 13, 2007, at Aug 13 - 11:13, Jonathan Buch wrote: > Hi, > >> I am thinking about droping the 'og' prefix from model tables by >> default >> (the setting will stay). From what I see you can have safe table >> names by >> using backtick (`) in mysql and double quotes (") in Postgresql. >> What do you >> think? > > I happen to like the prefix, as I often use psql and it's tab > trigger to > autocomplete table names. Having the 'og' prefix makes things > easier for me. > As you (if you don't do more low level db stuff) never really > specify the > table name at all, they could be hashes instead of good sounding > names. ;) > > That said, I just see no real benefit other than 'looks slightly > better from > the outside' and vote against. > > Jo > > -- > Feel the love > http://pinkjuice.com/pics/ruby.png > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general -------------- next part -------------- A non-text attachment was scrubbed... Name: PGP.sig Type: application/pgp-signature Size: 186 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/nitro-general/attachments/20070813/5c29da56/attachment.bin From Reid.Thompson at ateb.com Mon Aug 13 08:09:03 2007 From: Reid.Thompson at ateb.com (Reid Thompson) Date: Mon, 13 Aug 2007 08:09:03 -0400 Subject: [Nitro] Og table prefix In-Reply-To: <7F82BE22-2427-4DF5-BB4D-E8238EAF1260@fragmentized.net> References: <7F82BE22-2427-4DF5-BB4D-E8238EAF1260@fragmentized.net> Message-ID: <1187006945.9453.4.camel@jhereg> On Mon, 2007-08-13 at 12:54 +0100, Rui Miguel wrote: > Hello, > > I like the default also, and think it's safer and more intuitive for > databases with managed and unmanaged tables all together. > > Rui Miguel > > On Aug 13, 2007, at Aug 13 - 11:13, Jonathan Buch wrote: > > > Hi, > > > >> I am thinking about droping the 'og' prefix from model tables by > >> default > >> (the setting will stay). From what I see you can have safe table > >> names by > >> using backtick (`) in mysql and double quotes (") in Postgresql. > >> What do you > >> think? > > > > I happen to like the prefix, as I often use psql and it's tab > > trigger to > > autocomplete table names. Having the 'og' prefix makes things > > easier for me. > > As you (if you don't do more low level db stuff) never really > > specify the > > table name at all, they could be hashes instead of good sounding > > names. ;) > > > > That said, I just see no real benefit other than 'looks slightly > > better from > > the outside' and vote against. > > > > Jo my .02 $, keep it as is, but make it easy for users to be aware that Og.table_prefix = '' will generate the tables w/o the 'og' prefix. From arne at arnebrasseur.net Mon Aug 13 09:20:05 2007 From: arne at arnebrasseur.net (arne at arnebrasseur.net) Date: Mon, 13 Aug 2007 06:20:05 -0700 (PDT) Subject: [Nitro] Og table prefix In-Reply-To: <1187006945.9453.4.camel@jhereg> References: <7F82BE22-2427-4DF5-BB4D-E8238EAF1260@fragmentized.net> <1187006945.9453.4.camel@jhereg> Message-ID: <3338.81.245.171.88.1187011205.squirrel@webmail.arnebrasseur.net> > On Mon, 2007-08-13 at 12:54 +0100, Rui Miguel wrote: >> Hello, >> >> I like the default also, and think it's safer and more intuitive for >> databases with managed and unmanaged tables all together. >> >> > That said, I just see no real benefit other than 'looks slightly >> > better from >> > the outside' and vote against. >> > >> > Jo > > my .02 $, keep it as is, but make it easy for users to be aware that > Og.table_prefix = '' will generate the tables w/o the 'og' prefix. +1 for keeping the prefix. I see no compelling argument to change the existing behavior. (ab) From george.moschovitis at gmail.com Mon Aug 13 12:16:34 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Mon, 13 Aug 2007 19:16:34 +0300 Subject: [Nitro] Og table prefix In-Reply-To: <3338.81.245.171.88.1187011205.squirrel@webmail.arnebrasseur.net> References: <7F82BE22-2427-4DF5-BB4D-E8238EAF1260@fragmentized.net> <1187006945.9453.4.camel@jhereg> <3338.81.245.171.88.1187011205.squirrel@webmail.arnebrasseur.net> Message-ID: Ok, I will leave the default prefix but I will still 'escape' the table name (with backticks and/or quotes). In my personal projects I plan to remove the prefix though. thanks for the remarks, -g. On 8/13/07, arne at arnebrasseur.net wrote: > > > On Mon, 2007-08-13 at 12:54 +0100, Rui Miguel wrote: > >> Hello, > >> > >> I like the default also, and think it's safer and more intuitive for > >> databases with managed and unmanaged tables all together. > >> > >> > That said, I just see no real benefit other than 'looks slightly > >> > better from > >> > the outside' and vote against. > >> > > >> > Jo > > > > my .02 $, keep it as is, but make it easy for users to be aware that > > Og.table_prefix = '' will generate the tables w/o the 'og' prefix. > > +1 for keeping the prefix. I see no compelling argument to change the > existing behavior. > > (ab) > > > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.me.gr http://phidz.com 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/20070813/04d32457/attachment.html From george.moschovitis at gmail.com Mon Aug 13 12:18:00 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Mon, 13 Aug 2007 19:18:00 +0300 Subject: [Nitro] Vacations Message-ID: Dear devs, I will probably be offline for the next few days (but still, working on Nitro ;-)) -g. -- http://www.me.gr http://phidz.com 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/20070813/9dd8e7ad/attachment.html From george.moschovitis at gmail.com Mon Aug 13 20:05:01 2007 From: george.moschovitis at gmail.com (george.moschovitis at gmail.com) Date: Tue, 14 Aug 2007 00:05:01 +0000 (UTC) Subject: [Nitro] =?utf-8?q?=5BNP=2EORG=5D_Nitro/Og_Fora_daily_digest?= Message-ID: <20070814000501.9D5748700@reizu.com> >From gmosx.myopenid.com Date: Mon Aug 13 08:24:48 UTC 2007 Subject: Drop the default og prefix from tables Message-ID: http://www.nitroproject.org/fora/posts/view/cN2wV8sxyr3k-VeJeZaaqU Dear devs, I am thinking about droping the 'og' prefix from model tables by default (the setting will stay). From what I see you can have safe table names by using backtick (`) in mysql and double quotes (") in Postgresql. What do you thinkg? -g. >From gmosx.myopenid.com Date: Mon Aug 13 08:27:54 UTC 2007 Subject: Unicodechars in facets Message-ID: http://www.nitroproject.org/fora/posts/view/aw9PtIsxCr3k-VeJeZaaqU Tom, have you seen the unicode-chars gem ? http://rubyforge.org/projects/unicodechars/ I think it would be a great inclusion in facets or something. I am not sure if this is up-to-date with the latest rails code. -g. -- This mail is automatically generated from the http://nitroproject.org/fora digest robot. It presents the discussions in the fora during the last 24 hours. Do not reply to this email. From billk at cts.com Wed Aug 15 20:34:24 2007 From: billk at cts.com (Bill Kelly) Date: Wed, 15 Aug 2007 17:34:24 -0700 Subject: [Nitro] Glue::Template.root Message-ID: <00c801c7df9d$3241a190$6442a8c0@musicbox> Greetings and Salutations, I have an older Nitro app with a line like: Glue::Template.root = 'template' I tried Raw::Template.root, but no-go. What's the correct way to set the template directory with the repository version of Nitro? Thanks! Bill From weather at speakeasy.net Thu Aug 16 02:24:56 2007 From: weather at speakeasy.net (Matthew B Gardner) Date: Thu, 16 Aug 2007 02:24:56 -0400 Subject: [Nitro] Problem with Og post method Message-ID: <200708160224.56992.weather@speakeasy.net> Hello, I'm struggling a little with using the post method. I have two classes, Root and Account < Root, and I can't get post to work inside of the Root class. However, it does work in the Account class. When I try to utilize the method in Root, I get: `method_missing': undefined method `post' for Root:Class (NoMethodError) I'm using post with the following arguments: post :to_world, :on => [:og_read], where to_world is a Root method The only difference between the two classes, with regards to Og, is that Account is Timestamped and requires glue/timestamped (though I got the same errors in Root when I added the same data). Although post seems to work fine in Account, I did get the same NoMethodError for Account two or three times in a row, though I haven't been able to duplicate it. It happened right after I removed my original post method attempt from Root and returned it to Account. I'd of course like to figure this issue out, if possible, but the purpose is trying to test whether or not I can place the post method in Root and have Account#og_read call to_world. This is probably easier to answer? Thank you for any help, Matt From arne at arnebrasseur.net Thu Aug 16 03:39:35 2007 From: arne at arnebrasseur.net (arne at arnebrasseur.net) Date: Thu, 16 Aug 2007 00:39:35 -0700 (PDT) Subject: [Nitro] Glue::Template.root In-Reply-To: <00c801c7df9d$3241a190$6442a8c0@musicbox> References: <00c801c7df9d$3241a190$6442a8c0@musicbox> Message-ID: <1383.81.245.180.77.1187249975.squirrel@webmail.arnebrasseur.net> > What's the correct way to set the template directory with the > repository version of Nitro? Raw::Template.root_dir = '...' (ab) From arne at arnebrasseur.net Thu Aug 16 03:48:52 2007 From: arne at arnebrasseur.net (arne at arnebrasseur.net) Date: Thu, 16 Aug 2007 00:48:52 -0700 (PDT) Subject: [Nitro] Problem with Og post method In-Reply-To: <200708160224.56992.weather@speakeasy.net> References: <200708160224.56992.weather@speakeasy.net> Message-ID: <1437.81.245.180.77.1187250532.squirrel@webmail.arnebrasseur.net> Hi Matt, Jonathan or George will probably have to answer this one, but just a guess : where in the class definition did you make the call to post? Og does some magic with the class, but only after it found out that the class has to be managed by Og. Presumably the aspect methods are available after that. I can't test this where I'm now, and I'm no Og expert, but I'm thinking that # this might not work class Something post .... attr_accessor :name, String end # this might work class Something attr_accessor :name, String post .... end (ab) > Hello, I'm struggling a little with using the post method. I have two > classes, > Root and Account < Root, and I can't get post to work inside of the Root > class. However, it does work in the Account class. When I try to utilize > the > method in Root, I get: > > `method_missing': undefined method `post' for Root:Class (NoMethodError) > > I'm using post with the following arguments: > > post :to_world, :on => [:og_read], where to_world is a Root method > > The only difference between the two classes, with regards to Og, is that > Account is Timestamped and requires glue/timestamped (though I got the > same > errors in Root when I added the same data). Although post seems to work > fine > in Account, I did get the same NoMethodError for Account two or three > times > in a row, though I haven't been able to duplicate it. It happened right > after > I removed my original post method attempt from Root and returned it to > Account. > > I'd of course like to figure this issue out, if possible, but the purpose > is > trying to test whether or not I can place the post method in Root and have > Account#og_read call to_world. This is probably easier to answer? > > Thank you for any help, > Matt > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > From billk at cts.com Thu Aug 16 04:05:52 2007 From: billk at cts.com (Bill Kelly) Date: Thu, 16 Aug 2007 01:05:52 -0700 Subject: [Nitro] Glue::Template.root References: <00c801c7df9d$3241a190$6442a8c0@musicbox> <1383.81.245.180.77.1187249975.squirrel@webmail.arnebrasseur.net> Message-ID: <001601c7dfdc$43ea82b0$6442a8c0@musicbox> From: > >> What's the correct way to set the template directory with the >> repository version of Nitro? > > Raw::Template.root_dir = '...' Thanks! Sorry about my newbie questions. Regards, Bill From arne at arnebrasseur.net Thu Aug 16 14:22:58 2007 From: arne at arnebrasseur.net (Arne Brasseur) Date: Thu, 16 Aug 2007 20:22:58 +0200 Subject: [Nitro] Glue::Template.root In-Reply-To: <001601c7dfdc$43ea82b0$6442a8c0@musicbox> References: <00c801c7df9d$3241a190$6442a8c0@musicbox> <1383.81.245.180.77.1187249975.squirrel@webmail.arnebrasseur.net> <001601c7dfdc$43ea82b0$6442a8c0@musicbox> Message-ID: <46C49602.5020801@arnebrasseur.net> Bill Kelly schreef: > Thanks! > > Sorry about my newbie questions. > Better to ask and look dumb for five minutes then not ask and stay dumb forever (or something) :) (ab) From billk at cts.com Thu Aug 16 15:08:31 2007 From: billk at cts.com (Bill Kelly) Date: Thu, 16 Aug 2007 12:08:31 -0700 Subject: [Nitro] confused about app.dispatcher.root Message-ID: <00fb01c7e038$d63f6de0$6442a8c0@musicbox> Hi again, I'm encountering an error trying to fetch the index page on my site. Essentially I have: class StoreController < Nitro::Controller def index @time = Time.now redirect 'catalog' end # ... end app = Application.new app.dispatcher.root = StoreController ...the error I'm getting is: DEBUG: Rendering '/status_500' ERROR: Error while handling StoreController#index(status_500) ERROR: wrong number of arguments (1 for 0) But when I looked at the blog and hello examples in the repository, neither of their index methods accepted any arguments. Then I noticed the blog actually sets app.dispatcher.root to its Post *model* class, and the controller is defined at Post::Controller. So am I doing the wrong thing by setting app.dispatcher.root directly to my controller? Thanks, Bill From mvyver at gmail.com Thu Aug 16 22:49:15 2007 From: mvyver at gmail.com (Mark Van De Vyver) Date: Fri, 17 Aug 2007 12:49:15 +1000 Subject: [Nitro] OG vs Active Record Message-ID: <389c43e40708161949u2781f25x11d916169056f82f@mail.gmail.com> Hi, Thanks for all the effort that has gone into making Nitro/OG available. I'm relatively new to Ruby and am trying to decide between diving into ActiveRecord and OG.... I'd appreciate any advice. The useage case/scenario is: Single 'amateur' developer, large numbers of databases, large databases (10'sGB/table, 10's tables/DB), multiple ruby scripts accessing the dbserver directly (no web interface - at this stage.) I understand that this is a little like asking a parent if their child is beautiful, but was hoping for some frank feedback on the following. 1) Am I right that OG largely overcomes the issues discussed in this (long) AR thread (I summarize a key issue below): http://rubyurl.com/xWb and here: http://aralbalkan.com/764 A summary of a key AR issue (for me) is: Whether its in migrations or in the DB schema, I have to specify all the columns as well as their lengths and unique constraints to have the database created. Then I have to specify the validates_* rules in the model to match. Finally I have to keep both of them in sync over time. Why not do it all inside the model and have that set up all the validates_* rules in a single step? 2) Has anyone compared the performance of AR vs OG. The following thread about AR's cpu useage, surprised me: http://rubyurl.com/vFz I see the same performance on my system (script attached). Has anyone run this test under OG? 3) How well is MySQL supported (bearing in mind that OG is at 0.5), or is most development done with Postgresql? On MySQL, how about the MyISAM and Memory Engine/tables? Thanks for any insights. Regards Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: ar_bench.rb Type: application/x-ruby Size: 2951 bytes Desc: not available Url : http://rubyforge.org/pipermail/nitro-general/attachments/20070817/10a4e812/attachment.bin From mvyver at gmail.com Fri Aug 17 03:50:55 2007 From: mvyver at gmail.com (Mark Van De Vyver) Date: Fri, 17 Aug 2007 17:50:55 +1000 Subject: [Nitro] nitro 0.50.0 dev gem RunTimeError Message-ID: <389c43e40708170050p1b1cee8dybf200bf846a43e83@mail.gmail.com> Hi, While I will probably spend the time to get to know Darcs it is great to have the source packages as a gem. Unfortunately I ran into the following 'RunTimeError'. laptop:/tmp # gem install nitro --install-dir /tmp --include-dependencies ERROR: While executing gem ... (RuntimeError) Error instaling nitro: nitro requires og = 0.50.0 laptop:/tmp # ls *.gem glue-0.50.0.gem nitro-0.50.0.gem og-0.50.0.gem raw-0.50.0.gem I see the same error if I run: gem install nitro --version 0.50.0 --install-dir /tmp --include-dependencies Regards Mark From mvyver at gmail.com Fri Aug 17 13:43:20 2007 From: mvyver at gmail.com (Mark Van De Vyver) Date: Sat, 18 Aug 2007 03:43:20 +1000 Subject: [Nitro] Repository Gems Message-ID: <389c43e40708171043w7124fe1euc4a64231e7aa34f@mail.gmail.com> Hi, This thread started before I joined, so apologies if this thread is now disjoint. Like Rui Miguel I ran into several 'RunTimeError's complaining about required versions. To install nitro I used the following sequence (the nitro repository gems were installed in /tmp): # gem install RedCloth --include-dependencies # gem install ruby-breakpoint --include-dependencies # gem install glue --install-dir /tmp # gem install og --install-dir /tmp # gem install raw --install-dir /tmp # gem install nitro --install-dir /tmp Thanks for the repository gems - useful to dip your toe into the water without tackling Darcs. Regards Mark From weather at speakeasy.net Fri Aug 17 15:59:42 2007 From: weather at speakeasy.net (Matthew B Gardner) Date: Fri, 17 Aug 2007 15:59:42 -0400 Subject: [Nitro] The has_one/belongs_to relationship Message-ID: <200708171559.43013.weather@speakeasy.net> Hello, I've tried rather hard to figure this relationship out, but I just can't get it to work correctly on the has_one end. I have some classes that utilize the has_many/belongs_to relationship, and those work fine. The two classes are: class Account has_one :character, Character end class Character belongs_to :account, Account end When I initialize Character, I assign the passed account to its account variable, and the relationship is established (and saved properly to the database). When I try to assign the created character to Account#character, however, it treats the character variable as a local variable. For instance, in Account: character = Character.create msg.capitalize, self save! Checking character outside of that method returns nil, and the character_oid database field is NULL. I tried using self.character and experienced the same results. Both classes include the Og::EntityMixin module, and both relationships are defined after I define my properties. I really appreciate any help with this -- let me know if I need to post more information. Thanks, Matt From arne at arnebrasseur.net Sat Aug 18 04:13:30 2007 From: arne at arnebrasseur.net (Arne Brasseur) Date: Sat, 18 Aug 2007 10:13:30 +0200 Subject: [Nitro] confused about app.dispatcher.root In-Reply-To: <00fb01c7e038$d63f6de0$6442a8c0@musicbox> References: <00fb01c7e038$d63f6de0$6442a8c0@musicbox> Message-ID: <46C6AA2A.8070609@arnebrasseur.net> Bill Kelly schreef: > Hi again, > > I'm encountering an error trying to fetch the index page on > my site. Essentially I have: > > class StoreController < Nitro::Controller > > def index > @time = Time.now > redirect 'catalog' > end > > # ... > > end > > app = Application.new > app.dispatcher.root = StoreController > > > ...the error I'm getting is: > > > DEBUG: Rendering '/status_500' > ERROR: Error while handling StoreController#index(status_500) > ERROR: wrong number of arguments (1 for 0) > Can you show us your catalog method? Does it take arguments? What's the URL you're loading? > Then I noticed the blog actually sets app.dispatcher.root to > its Post *model* class, and the controller is defined at > Post::Controller. > That's an alternative way of structuring your app. It's perfectly fine to just use the controller itself. > So am I doing the wrong thing by setting app.dispatcher.root > directly to my controller? > Certainly not. (ab) -- Arne Brasseur http://www.arnebrasseur.net arne at arnebrasseur.net From arne at arnebrasseur.net Sat Aug 18 04:14:57 2007 From: arne at arnebrasseur.net (Arne Brasseur) Date: Sat, 18 Aug 2007 10:14:57 +0200 Subject: [Nitro] nitro 0.50.0 dev gem RunTimeError In-Reply-To: <389c43e40708170050p1b1cee8dybf200bf846a43e83@mail.gmail.com> References: <389c43e40708170050p1b1cee8dybf200bf846a43e83@mail.gmail.com> Message-ID: <46C6AA81.7040104@arnebrasseur.net> Mark Van De Vyver schreef: > Hi, > While I will probably spend the time to get to know Darcs it is great > to have the source packages as a gem. Unfortunately I ran into the > following 'RunTimeError'. > > laptop:/tmp # gem install nitro --install-dir /tmp --include-dependencies > ERROR: While executing gem ... (RuntimeError) > Error instaling nitro: > nitro requires og = 0.50.0 > I never installed gems from the local disk, looks like it has a hard time finding the other gems. Try installing og first. (ab) -- Arne Brasseur http://www.arnebrasseur.net arne at arnebrasseur.net From arne at arnebrasseur.net Sat Aug 18 04:27:05 2007 From: arne at arnebrasseur.net (Arne Brasseur) Date: Sat, 18 Aug 2007 10:27:05 +0200 Subject: [Nitro] The has_one/belongs_to relationship In-Reply-To: <200708171559.43013.weather@speakeasy.net> References: <200708171559.43013.weather@speakeasy.net> Message-ID: <46C6AD59.1090304@arnebrasseur.net> Matthew B Gardner schreef: > Hello, I've tried rather hard to figure this relationship out, but I just > can't get it to work correctly on the has_one end. I have some classes that > utilize the has_many/belongs_to relationship, and those work fine. > > The two classes are: > > class Account > has_one :character, Character > end > > class Character > belongs_to :account, Account > end > > When I initialize Character, I assign the passed account to its account > variable, and the relationship is established (and saved properly to the > database). When I try to assign the created character to Account#character, > however, it treats the character variable as a local variable. For instance, > in Account: > > character = Character.create msg.capitalize, self > save! > > Checking character outside of that method returns nil, and the character_oid > database field is NULL. I tried using self.character and experienced the same > results. > I would love to help you but I don't know much about Og though. The lead developer George is currently on vacations, he should be back in a few days. If you don't get an answer by then please ask again. The other Og guy Jonathan just finished his job in Finland, I imagine he's also taking a break. I notice some new blood on the mailing list, welcome to Nitro! Please hang on if it takes a while to get your questions answered and issues solved. Things move slow around here sometimes. On the other hand I have spoken to George recently and he's planning to devote more time to Nitro, in fact he's working on it right now while on vacations. My contract ends in a week, from September on I will be studying abroad. That should also give me more time for Nitro. Please keep sending any stories of success or failure. If you have a small app that exhibits a problem, feel free to just send the whole app. We'll analyze it together, should be educational for all. (ab) -- Arne Brasseur http://www.arnebrasseur.net arne at arnebrasseur.net From john at oxyliquit.de Sat Aug 18 04:47:45 2007 From: john at oxyliquit.de (Jonathan Buch) Date: Sat, 18 Aug 2007 10:47:45 +0200 Subject: [Nitro] The has_one/belongs_to relationship In-Reply-To: <200708171559.43013.weather@speakeasy.net> References: <200708171559.43013.weather@speakeasy.net> Message-ID: Hi, > When I try to assign the created character to Account#character, > however, it treats the character variable as a local variable. For instance, > in Account: >character = Character.create msg.capitalize, self > save! I assume this is within a method in the Account# scope? > Checking character outside of that method returns nil, and the character_oid > database field is NULL. I tried using self.character and experienced the same > results. the Account#character= method is defined by Og and handles the rel saving. self.character = Character.create() p @character, @character_oid # save! update(:only => [:character_oid]) # slight optimization I'm quite sure that this doesn't treat the character as the local variable. If you tried that before without success, I'm not sure what else can be wrong, could you try that once more? Jo -- Feel the love http://pinkjuice.com/pics/ruby.png From john at oxyliquit.de Sat Aug 18 04:47:46 2007 From: john at oxyliquit.de (Jonathan Buch) Date: Sat, 18 Aug 2007 10:47:46 +0200 Subject: [Nitro] Repository Gems In-Reply-To: <389c43e40708171043w7124fe1euc4a64231e7aa34f@mail.gmail.com> References: <389c43e40708171043w7124fe1euc4a64231e7aa34f@mail.gmail.com> Message-ID: Hi, > This thread started before I joined, so apologies if this thread is > now disjoint. > Like Rui Miguel I ran into several 'RunTimeError's complaining about > required versions. thank you for reporting, I'm sure George will figure out whats wrong. Btw, George, didn't we say we wanted to relase an 0.49 first? I'm still for that, as to make some kinda 'release candidate' so we can make a bugfix release out of 0.50 and not have to support a buggy release until the next one. Jo -- Feel the love http://pinkjuice.com/pics/ruby.png From john at oxyliquit.de Sat Aug 18 04:47:46 2007 From: john at oxyliquit.de (Jonathan Buch) Date: Sat, 18 Aug 2007 10:47:46 +0200 Subject: [Nitro] confused about app.dispatcher.root In-Reply-To: <00fb01c7e038$d63f6de0$6442a8c0@musicbox> References: <00fb01c7e038$d63f6de0$6442a8c0@musicbox> Message-ID: Hi, [can't say much about the error, I think we talked on irc about that.] My uneducated guess would be that the status_500 is either a standard method on the controller or a template in the proto folder. Maybe they have just been forgotten, George? > Then I noticed the blog actually sets app.dispatcher.root to > its Post *model* class, and the controller is defined at > Post::Controller. > > So am I doing the wrong thing by setting app.dispatcher.root > directly to my controller? When using a model for the .dispatcher.root the controller has to be `MyModel::Controller`. The dispatcher will find it automatically then. (What it _could_ also do, is make the 'MyModel#link_to()' work correctly when used... Could be only my mind, I think though someone on IRC recently metioned something like this.) Other than that, passing a controller is perfectly ok here. (should be at least, everything else is a bug) Jo -- Feel the love http://pinkjuice.com/pics/ruby.png From arne at arnebrasseur.net Sat Aug 18 05:20:04 2007 From: arne at arnebrasseur.net (Arne Brasseur) Date: Sat, 18 Aug 2007 11:20:04 +0200 Subject: [Nitro] The has_one/belongs_to relationship In-Reply-To: References: <200708171559.43013.weather@speakeasy.net> Message-ID: <46C6B9C4.6060908@arnebrasseur.net> Jonathan Buch schreef: > Jo > He's back! ^_^ -- Arne Brasseur http://www.arnebrasseur.net arne at arnebrasseur.net From george.moschovitis at gmail.com Sat Aug 18 05:46:04 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sat, 18 Aug 2007 12:46:04 +0300 Subject: [Nitro] Back from vacations... Message-ID: Dear devs, I am back from (short) vacations. I will try to go over the posts of the last 5 days... regards, George. -- http://www.me.gr http://phidz.com 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/20070818/25a5e22c/attachment.html From george.moschovitis at gmail.com Sat Aug 18 11:26:40 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sat, 18 Aug 2007 18:26:40 +0300 Subject: [Nitro] Problem with Og post method In-Reply-To: <200708160224.56992.weather@speakeasy.net> References: <200708160224.56992.weather@speakeasy.net> Message-ID: Please provide a simple example (small source file) that demonstrated the problem. -g. On 8/16/07, Matthew B Gardner wrote: > > Hello, I'm struggling a little with using the post method. I have two > classes, > Root and Account < Root, and I can't get post to work inside of the Root > class. However, it does work in the Account class. When I try to utilize > the > method in Root, I get: > > `method_missing': undefined method `post' for Root:Class (NoMethodError) > > I'm using post with the following arguments: > > post :to_world, :on => [:og_read], where to_world is a Root method > > The only difference between the two classes, with regards to Og, is that > Account is Timestamped and requires glue/timestamped (though I got the > same > errors in Root when I added the same data). Although post seems to work > fine > in Account, I did get the same NoMethodError for Account two or three > times > in a row, though I haven't been able to duplicate it. It happened right > after > I removed my original post method attempt from Root and returned it to > Account. > > I'd of course like to figure this issue out, if possible, but the purpose > is > trying to test whether or not I can place the post method in Root and have > Account#og_read call to_world. This is probably easier to answer? > > Thank you for any help, > Matt > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.me.gr http://phidz.com 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/20070818/88271cc3/attachment.html From george.moschovitis at gmail.com Sat Aug 18 11:30:47 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sat, 18 Aug 2007 18:30:47 +0300 Subject: [Nitro] nitro 0.50.0 dev gem RunTimeError In-Reply-To: <389c43e40708170050p1b1cee8dybf200bf846a43e83@mail.gmail.com> References: <389c43e40708170050p1b1cee8dybf200bf846a43e83@mail.gmail.com> Message-ID: You have to install them in order... glue, og, raw, nitro -g. On 8/17/07, Mark Van De Vyver wrote: > > Hi, > While I will probably spend the time to get to know Darcs it is great > to have the source packages as a gem. Unfortunately I ran into the > following 'RunTimeError'. > > laptop:/tmp # gem install nitro --install-dir /tmp --include-dependencies > ERROR: While executing gem ... (RuntimeError) > Error instaling nitro: > nitro requires og = 0.50.0 > > laptop:/tmp # ls *.gem > glue-0.50.0.gem nitro-0.50.0.gem og-0.50.0.gem raw-0.50.0.gem > > > I see the same error if I run: > gem install nitro --version 0.50.0 --install-dir /tmp > --include-dependencies > > > Regards > Mark > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.me.gr http://phidz.com 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/20070818/b53f5415/attachment.html From george.moschovitis at gmail.com Sat Aug 18 11:36:29 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sat, 18 Aug 2007 18:36:29 +0300 Subject: [Nitro] confused about app.dispatcher.root In-Reply-To: <00fb01c7e038$d63f6de0$6442a8c0@musicbox> References: <00fb01c7e038$d63f6de0$6442a8c0@musicbox> Message-ID: > > class StoreController < Nitro::Controller no need to extend Nitro::Controller (in fact there is no Nitro::Controller class, it is Raw::Controller now) def index > @time = Time.now > redirect 'catalog' where is catalog defined? end > > # ... > > end > > app = Application.new > app.dispatcher.root = StoreController app.start ??? ...the error I'm getting is: > > > DEBUG: Rendering '/status_500' > ERROR: Error while handling StoreController#index(status_500) > ERROR: wrong number of arguments (1 for 0) please show as the error BEFORE 'Rendering /status_500'. So am I doing the wrong thing by setting app.dispatcher.root > directly to my controller? > you are doing this right. -g. -- http://www.me.gr http://phidz.com 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/20070818/a57c7eff/attachment-0001.html From george.moschovitis at gmail.com Sat Aug 18 11:39:28 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sat, 18 Aug 2007 18:39:28 +0300 Subject: [Nitro] Repository Gems In-Reply-To: <389c43e40708171043w7124fe1euc4a64231e7aa34f@mail.gmail.com> References: <389c43e40708171043w7124fe1euc4a64231e7aa34f@mail.gmail.com> Message-ID: Thanks for this email. Btw, this reminded me to remove the ruby-breakpoint dependency. -g. On 8/17/07, Mark Van De Vyver wrote: > > Hi, > This thread started before I joined, so apologies if this thread is > now disjoint. > Like Rui Miguel I ran into several 'RunTimeError's complaining about > required versions. To install nitro I used the following sequence > (the nitro repository gems were installed in /tmp): > > # gem install RedCloth --include-dependencies > > # gem install ruby-breakpoint --include-dependencies > > # gem install glue --install-dir /tmp > > # gem install og --install-dir /tmp > > # gem install raw --install-dir /tmp > > # gem install nitro --install-dir /tmp > > Thanks for the repository gems - useful to dip your toe into the water > without tackling Darcs. > > Regards > Mark > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.me.gr http://phidz.com 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/20070818/3b58386a/attachment.html From weather at speakeasy.net Sat Aug 18 11:59:06 2007 From: weather at speakeasy.net (Matthew B Gardner) Date: Sat, 18 Aug 2007 11:59:06 -0400 Subject: [Nitro] The has_one/belongs_to relationship Message-ID: <200708181159.06393.weather@speakeasy.net> Thank you for the response -- it's still not working, so I'll post the output from the additions you suggested. > When I try to assign the created character to Account#character, > however, it treats the character variable as a local variable. For instance, >> in Account: >>character = Character.create msg.capitalize, self >> save! >I assume this is within a method in the Account# scope? Yes, this is in an Account method. >> Checking character outside of that method returns nil, and the character_oid >> database field is NULL. I tried using self.character and experienced the same >> results. >the Account#character= method is defined by Og and handles the rel saving. >self.character = Character.create() >p @character, @character_oid ># save! >update(:only => [:character_oid]) # slight optimization p @character #=> nil p @character_oid #=> 5 update(:only => [:character_oid]) # slight optimization #=> 07-08-18 11:42:07 [ERROR] (Account) Account#update unknown message - {:only=>[:character_oid]} Despite the error message, it does setup its @character_oid in the database, but you can see that @character is still nil. Also, the corresponding Character isn't loaded and attached when the Account object is loaded from the database -- my has_many/belongs_to relationship does this (and rather beautifully, I might add) -- should I expect the same from this relationship? Thank you for any assistance you can offer, Matt From weather at speakeasy.net Sat Aug 18 12:05:32 2007 From: weather at speakeasy.net (Matthew B Gardner) Date: Sat, 18 Aug 2007 12:05:32 -0400 Subject: [Nitro] Problem with Og post method In-Reply-To: References: <200708160224.56992.weather@speakeasy.net> Message-ID: <200708181205.32571.weather@speakeasy.net> $:.unshift "lib" if !$:.include? "lib" # note that og and og/relation have already been required in another file class Root include Og::EntityMixin property :name, VarChar(100) def initialize name @name = name @dirty = false @remove = false to_world end def to_world world.objects << self # world is a public method end def dirty? @dirty end def dirty! @dirty = true end def clean! @dirty = false end def remove! @remove = true end def remove? @remove end post :to_world, :on => [:og_read] end Please let me know if more info is required. Thanks for any help, Matt On Saturday 18 August 2007 11:26, George Moschovitis wrote: > Please provide a simple example (small source file) that demonstrated the > problem. > > -g. > > On 8/16/07, Matthew B Gardner wrote: > > Hello, I'm struggling a little with using the post method. I have two > > classes, > > Root and Account < Root, and I can't get post to work inside of the Root > > class. However, it does work in the Account class. When I try to utilize > > the > > method in Root, I get: > > > > `method_missing': undefined method `post' for Root:Class (NoMethodError) > > > > I'm using post with the following arguments: > > > > post :to_world, :on => [:og_read], where to_world is a Root method > > > > The only difference between the two classes, with regards to Og, is that > > Account is Timestamped and requires glue/timestamped (though I got the > > same > > errors in Root when I added the same data). Although post seems to work > > fine > > in Account, I did get the same NoMethodError for Account two or three > > times > > in a row, though I haven't been able to duplicate it. It happened right > > after > > I removed my original post method attempt from Root and returned it to > > Account. > > > > I'd of course like to figure this issue out, if possible, but the purpose > > is > > trying to test whether or not I can place the post method in Root and > > have Account#og_read call to_world. This is probably easier to answer? > > > > Thank you for any help, > > Matt > > _______________________________________________ > > Nitro-general mailing list > > Nitro-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/nitro-general From john at oxyliquit.de Sat Aug 18 16:19:07 2007 From: john at oxyliquit.de (Jonathan Buch) Date: Sat, 18 Aug 2007 22:19:07 +0200 Subject: [Nitro] Back from vacations... In-Reply-To: References: Message-ID: Hi, > Dear devs, and dear users too, I love users. ;) > I am back from (short) vacations. I will try to go over the posts of the > last 5 days... ayy, me will be back (kind of) tomorrow, at least at home again. Evil Uni stuff starts a day after though *huff* Jo From john at oxyliquit.de Sat Aug 18 16:19:14 2007 From: john at oxyliquit.de (Jonathan Buch) Date: Sat, 18 Aug 2007 22:19:14 +0200 Subject: [Nitro] The has_one/belongs_to relationship In-Reply-To: <46C6B9C4.6060908@arnebrasseur.net> References: <200708171559.43013.weather@speakeasy.net> <46C6B9C4.6060908@arnebrasseur.net> Message-ID: Hi, > Jonathan Buch schreef: >> Jo >> > He's back! ^_^ not fully, still wrong part of germany, getting slowly closer to home though. ;) Jo -- Feel the love http://pinkjuice.com/pics/ruby.png From john at oxyliquit.de Sat Aug 18 16:19:14 2007 From: john at oxyliquit.de (Jonathan Buch) Date: Sat, 18 Aug 2007 22:19:14 +0200 Subject: [Nitro] The has_one/belongs_to relationship In-Reply-To: <200708181159.06393.weather@speakeasy.net> References: <200708181159.06393.weather@speakeasy.net> Message-ID: Hi, >> self.character = Character.create() >> p @character, @character_oid >> # save! >> update(:only => [:character_oid]) # slight optimization > > p @character #=> nil > p @character_oid #=> 5 > update(:only => [:character_oid]) # slight optimization #=> 07-08-18 11:42:07 > [ERROR] (Account) Account#update unknown message - {:only=>[:character_oid]} totally unexplainable to me, I always use update(). George, any recent work from you on this (don't have a clean repo from you readily accessable here). > Despite the error message, it does setup its @character_oid in the database, > but you can see that @character is still nil. Also, the corresponding > Character isn't loaded and attached when the Account object is loaded from > the database -- my has_many/belongs_to relationship does this (and rather > beautifully, I might add) -- should I expect the same from this relationship? Ahh... I see in the code that @character does not get set when applying, only when you call .character then. Though I think you're doing that. (since calling .character right after applying is kind of useless, as you already had the character (when putting it in), but ... might be kind of misleading performance wise that it pulls the object from db right after adding it.) So yes, it does the 'correct thing' here (debatable). Calling self.character right after that instead of @character must pull it from the db and everything works normally. That the object is saved in @character is more of a 'implementation detail' anyway... Pulling one object from the db (the account in this case) does not preload the character. When calling account.character it must get it though. (The has_many doesn't preload either, that'd be crazy ^^;) So, please tell if self.character does not return the character, that'd be a major bug. > Thank you for any assistance you can offer, I allways hope to be of help. :) Jo -- Feel the love http://pinkjuice.com/pics/ruby.png From john at oxyliquit.de Sat Aug 18 16:24:42 2007 From: john at oxyliquit.de (Jonathan Buch) Date: Sat, 18 Aug 2007 22:24:42 +0200 Subject: [Nitro] Problem with Og post method In-Reply-To: <200708181205.32571.weather@speakeasy.net> References: <200708160224.56992.weather@speakeasy.net> <200708181205.32571.weather@speakeasy.net> Message-ID: Hi, > # note that og and og/relation have already been required in another file Only Og has to be required, og/relation and aspects (post/pre stuff) gets required within Og. In fact Timestamped relies on aspects. og/model/timestamped.rb for an example for aspects. Oh, but it's not pre/post it's before/after there. Could you try using these method names? (I know next to nothing about aspects, so I'm not really able to help there) Jo -- Feel the love http://pinkjuice.com/pics/ruby.png From weather at speakeasy.net Sat Aug 18 17:36:13 2007 From: weather at speakeasy.net (Matthew B Gardner) Date: Sat, 18 Aug 2007 17:36:13 -0400 Subject: [Nitro] The has_one/belongs_to relationship In-Reply-To: References: <200708181159.06393.weather@speakeasy.net> Message-ID: <200708181736.13354.weather@speakeasy.net> I think I'm working my way through it and it seems to be working correctly itself, for the most part. I do have some questions... > > p @character #=> nil > > p @character_oid #=> 5 > > update(:only => [:character_oid]) # slight optimization #=> 07-08-18 > > 11:42:07 [ERROR] (Account) Account#update unknown message - > > {:only=>[:character_oid]} > > totally unexplainable to me, I always use update(). George, any recent > work from you on this (don't have a clean repo from you readily accessable > here). > > > Despite the error message, it does setup its @character_oid in the > > database, but you can see that @character is still nil. Also, the > > corresponding Character isn't loaded and attached when the Account object > > is loaded from the database -- my has_many/belongs_to relationship does > > this (and rather beautifully, I might add) -- should I expect the same > > from this relationship? > > Ahh... I see in the code that @character does not get set when applying, > only when you call .character then. Though I think you're doing that. > (since calling .character right after applying is kind of useless, as you > already had the character (when putting it in), but ... might be kind of > misleading performance wise that it pulls the object from db right after > adding it.) > > So yes, it does the 'correct thing' here (debatable). Calling > self.character right after that instead of @character must pull it from the > db and everything works normally. That the object is saved in @character > is more of a 'implementation detail' anyway... > Is Character#account_oid not saved until I call Account#update? I can't say for sure, but I think the field was NULL in the db after Character#create, but was then set in the db after Account#update. Just trying to clarify how this works. > Pulling one object from the db (the account in this case) does not preload > the character. When calling account.character it must get it though. > (The has_many doesn't preload either, that'd be crazy ^^;) > I may have misspoken -- what I meant is that the has_many objects were loaded and attached when I loaded the object they belong to. The Character object is now also loading and attaching when I load the corresponding Account object. I'm assuming, from what you said, that this loading and attachment happens during Og#allocate? > So, please tell if self.character does not return the character, that'd be > a major bug. > As far as I can tell, it's working -- no bug squashing needed on this front. I'm still feeling this relationship out though -- I'm actually curious about why I can refer to Character#account by "account", but Account#character only by self.character and why it treats "character" as a local variable (but not "account" in the Character class). Thanks again for the help -- I'll keep you posted (pardon the pun) on any further difficulties. -Matt From weather at speakeasy.net Sat Aug 18 18:03:45 2007 From: weather at speakeasy.net (Matthew B Gardner) Date: Sat, 18 Aug 2007 18:03:45 -0400 Subject: [Nitro] The has_one/belongs_to relationship In-Reply-To: References: <200708181159.06393.weather@speakeasy.net> Message-ID: <200708181803.45176.weather@speakeasy.net> I may have spoken a little prematurely on this -- I am encountering a problem. When I call Character#create, or when a Character object is loaded (via it's corresponding Account being loaded), it's creating it's own account. To illustrate, this is what's happening: a1 = Account.new a1.character = Character.create self a1.equal?(a1.character.account) #=> false The same thing is happening when loaded from the database, so the account is pointing to the character, but the character is pointing to a different account (an account with the same attributes, but a different identity). I'm assuming I'm doing this to myself, here is how I'm initializing Character: class Account has_one :character, Character def foo self.character = Character.create msg.capitalize, self update(:only => [:character_oid]) # slight optimization end end class Character belongs_to :account, Account def initialize name, acc super(name) self.account = acc end end Let me know if that isn't enough information, or if it's unclear. Thanks for any help (getting closer!), Matt From weather at speakeasy.net Sat Aug 18 20:13:09 2007 From: weather at speakeasy.net (Matthew B Gardner) Date: Sat, 18 Aug 2007 20:13:09 -0400 Subject: [Nitro] Problem with Og post method In-Reply-To: References: <200708160224.56992.weather@speakeasy.net> Message-ID: <200708182013.09226.weather@speakeasy.net> Jonathan made a reply that I didn't receive, so I'm replying to this message again to keep it in the same thread. He suggested that I use after() instead of post(). I had actually already tried that and again received a NoMethodError. On Saturday 18 August 2007 11:26, George Moschovitis wrote: > Please provide a simple example (small source file) that demonstrated the > problem. > > -g. > > On 8/16/07, Matthew B Gardner wrote: > > Hello, I'm struggling a little with using the post method. I have two > > classes, > > Root and Account < Root, and I can't get post to work inside of the Root > > class. However, it does work in the Account class. When I try to utilize > > the > > method in Root, I get: > > > > `method_missing': undefined method `post' for Root:Class (NoMethodError) > > > > I'm using post with the following arguments: > > > > post :to_world, :on => [:og_read], where to_world is a Root method > > > > The only difference between the two classes, with regards to Og, is that > > Account is Timestamped and requires glue/timestamped (though I got the > > same > > errors in Root when I added the same data). Although post seems to work > > fine > > in Account, I did get the same NoMethodError for Account two or three > > times > > in a row, though I haven't been able to duplicate it. It happened right > > after > > I removed my original post method attempt from Root and returned it to > > Account. > > > > I'd of course like to figure this issue out, if possible, but the purpose > > is > > trying to test whether or not I can place the post method in Root and > > have Account#og_read call to_world. This is probably easier to answer? > > > > Thank you for any help, > > Matt > > _______________________________________________ > > Nitro-general mailing list > > Nitro-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/nitro-general From mvyver at gmail.com Sun Aug 19 00:59:38 2007 From: mvyver at gmail.com (Mark Van De Vyver) Date: Sun, 19 Aug 2007 14:59:38 +1000 Subject: [Nitro] Nitro>>Developers Center page: some errors Message-ID: <389c43e40708182159w5b31fec4r9e7264febc6720ec@mail.gmail.com> Hi, After some reading around I've decided OG will be a worth a shot over AR..... I encountered some problems working from the page: http://www.nitroproject.org/dev Details follow: A) Under Get Started, the ink behind "The Core developers forum" to http://www.nitroproject.org/fora/view/6 delivers and error page: Internal Server Error Path: /fora/view/6 Reload this page. Go to the referer or the home page. Powered by Nitro version 0.50.0 B) The 'fora' link under 'Get Started' seems to be OK, however when I click on "Post new topic" I get the openid sign-in page. Providing my openID yields the following page: Server Error in '/' Application. Object reference not set to an instance of an object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.NullReferenceException: Object reference not set to an instance of an object. Source Error: Line 67: if (State.Session.LastRequest.IsAnySimpleRegistrationFieldsRequestedOrRequired) Line 68: { Line 69: int? profileid = trust.RetrieveProfile(Context.User.Identity.Name, State.Session.LastRequest.TrustRoot); Line 70: Line 71: if (profileid.HasValue) Source File: e:\Inetpub\openid\login.aspx.cs Line: 69 Stack Trace: [NullReferenceException: Object reference not set to an instance of an object.] org.openid.User.DataUser.GetUserId(String username) in C:\Documents and Settings\steven\My Documents\Visual Studio 2005\Projects\Org\orglib\User\DataUser.cs:175 org.openid.Trust.ProfileTrust.RetrieveProfile(String username, String requestURL) in C:\Documents and Settings\steven\My Documents\Visual Studio 2005\Projects\Org\orglib\Trust\ProfileTrust.cs:94 login.AutoShareData() in e:\Inetpub\openid\login.aspx.cs:69 login.Page_Load(Object sender, EventArgs e) in e:\Inetpub\openid\login.aspx.cs:29 System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +34 System.Web.UI.Control.OnLoad(EventArgs e) +99 System.Web.UI.Control.LoadRecursive() +47 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1061 Version Information: Microsoft .NET Framework Version:2.0.50727.832; ASP.NET Version:2.0.50727.832 Hope this helps. Mark From weather at speakeasy.net Sun Aug 19 01:46:25 2007 From: weather at speakeasy.net (Matthew B Gardner) Date: Sun, 19 Aug 2007 01:46:25 -0400 Subject: [Nitro] Problem with Og post method In-Reply-To: <200708182013.09226.weather@speakeasy.net> References: <200708160224.56992.weather@speakeasy.net> <200708182013.09226.weather@speakeasy.net> Message-ID: <200708190146.25964.weather@speakeasy.net> I should also note that I have several classes that utilize the pre/post methods fine -- it's just the Root class that doesn't seem to like it. On Saturday 18 August 2007 20:13, Matthew B Gardner wrote: > Jonathan made a reply that I didn't receive, so I'm replying to this > message again to keep it in the same thread. He suggested that I use > after() instead of post(). I had actually already tried that and again > received a > NoMethodError. > > On Saturday 18 August 2007 11:26, George Moschovitis wrote: > > Please provide a simple example (small source file) that demonstrated the > > problem. > > > > -g. > > > > On 8/16/07, Matthew B Gardner wrote: > > > Hello, I'm struggling a little with using the post method. I have two > > > classes, > > > Root and Account < Root, and I can't get post to work inside of the > > > Root class. However, it does work in the Account class. When I try to > > > utilize the > > > method in Root, I get: > > > > > > `method_missing': undefined method `post' for Root:Class > > > (NoMethodError) > > > > > > I'm using post with the following arguments: > > > > > > post :to_world, :on => [:og_read], where to_world is a Root method > > > > > > The only difference between the two classes, with regards to Og, is > > > that Account is Timestamped and requires glue/timestamped (though I got > > > the same > > > errors in Root when I added the same data). Although post seems to work > > > fine > > > in Account, I did get the same NoMethodError for Account two or three > > > times > > > in a row, though I haven't been able to duplicate it. It happened right > > > after > > > I removed my original post method attempt from Root and returned it to > > > Account. > > > > > > I'd of course like to figure this issue out, if possible, but the > > > purpose is > > > trying to test whether or not I can place the post method in Root and > > > have Account#og_read call to_world. This is probably easier to answer? > > > > > > Thank you for any help, > > > Matt > > > _______________________________________________ > > > Nitro-general mailing list > > > Nitro-general at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/nitro-general > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general From george.moschovitis at gmail.com Sun Aug 19 03:03:54 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sun, 19 Aug 2007 10:03:54 +0300 Subject: [Nitro] OG vs Active Record In-Reply-To: <389c43e40708161949u2781f25x11d916169056f82f@mail.gmail.com> References: <389c43e40708161949u2781f25x11d916169056f82f@mail.gmail.com> Message-ID: > > The useage case/scenario is: Single 'amateur' developer, large > numbers of databases, large databases (10'sGB/table, 10's tables/DB), > multiple ruby scripts accessing the dbserver directly (no web > interface - at this stage.) I don't see any Og related issue here. This has to do with the actual RDBMS used. 1) Am I right that OG largely overcomes the issues discussed in this > (long) AR thread (I summarize a key issue below): > http://rubyurl.com/xWb > and here: > http://aralbalkan.com/764 I would say yes. I see the same performance on my system (script attached). Has anyone > run this test under OG? Not me 3) How well is MySQL supported (bearing in mind that OG is at 0.5), or > is most development done with Postgresql? On MySQL, how about the > MyISAM and Memory Engine/tables? I am the main developer and I use MySQL. regards, George. -- http://www.me.gr http://phidz.com 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/20070819/d31e0617/attachment.html From george.moschovitis at gmail.com Sun Aug 19 03:11:01 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sun, 19 Aug 2007 10:11:01 +0300 Subject: [Nitro] Nitro>>Developers Center page: some errors In-Reply-To: <389c43e40708182159w5b31fec4r9e7264febc6720ec@mail.gmail.com> References: <389c43e40708182159w5b31fec4r9e7264febc6720ec@mail.gmail.com> Message-ID: > > A) Under Get Started, the ink behind "The Core developers forum" to > http://www.nitroproject.org/fora/view/6 > delivers and error page: will fix. > B) The 'fora' link under 'Get Started' seems to be OK, however when I > click on "Post new topic" I get the openid sign-in page. Providing my > openID yields the following page: > > Server Error in '/' Application. > Object reference not set to an instance of an object. > Description: An unhandled exception occurred during the execution of > the current web request. Please review the stack trace for more > information about the error and where it originated in the code. > > Exception Details: System.NullReferenceException: Object reference not > set to an instance of an object. > > Source Error: > > Line 67: if > ( > State.Session.LastRequest.IsAnySimpleRegistrationFieldsRequestedOrRequired > ) > Line 68: { > Line 69: int? profileid = > trust.RetrieveProfile(Context.User.Identity.Name, > State.Session.LastRequest.TrustRoot); > Line 70: > Line 71: if (profileid.HasValue) > > > Source File: e:\Inetpub\openid\login.aspx.cs Line: 69 > > Stack Trace: > > [NullReferenceException: Object reference not set to an instance of an > object.] > org.openid.User.DataUser.GetUserId(String username) in C:\Documents > and Settings\steven\My Documents\Visual Studio > 2005\Projects\Org\orglib\User\DataUser.cs:175 > org.openid.Trust.ProfileTrust.RetrieveProfile(String username, > String requestURL) in C:\Documents and Settings\steven\My > Documents\Visual Studio > 2005\Projects\Org\orglib\Trust\ProfileTrust.cs:94 > login.AutoShareData() in e:\Inetpub\openid\login.aspx.cs:69 > login.Page_Load(Object sender, EventArgs e) in > e:\Inetpub\openid\login.aspx.cs:29 > System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, > Object o, Object t, EventArgs e) +15 > System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object > sender, EventArgs e) +34 > System.Web.UI.Control.OnLoad(EventArgs e) +99 > System.Web.UI.Control.LoadRecursive() +47 > System.Web.UI.Page.ProcessRequestMain(Boolean > includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) > +1061 > > > Version Information: Microsoft .NET Framework Version:2.0.50727.832; > ASP.NET Version:2.0.50727.832 Microsoft.NET ?? This looks like an error in your openid provider. -g. -- http://www.me.gr http://phidz.com 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/20070819/74c39cd3/attachment.html From george.moschovitis at gmail.com Sun Aug 19 03:31:21 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sun, 19 Aug 2007 10:31:21 +0300 Subject: [Nitro] Problem with Og post method In-Reply-To: <200708181205.32571.weather@speakeasy.net> References: <200708160224.56992.weather@speakeasy.net> <200708181205.32571.weather@speakeasy.net> Message-ID: The following works as expected in the Repository version of Og. If you have further questions please let me know. require "og" class Root attr_accessor :name, Og::VarChar(100) after :og_read, :call => :to_world # more verbose (and less efficient) alternative # after :og_read do # to_world() # end def initialize(name = nil) @name = name @dirty = false @remove = false to_world end def to_world puts "----- POST ASPECT CALLED -----" end def dirty? @dirty end def dirty! @dirty = true end def clean! @dirty = false end def remove! @remove = true end def remove? @remove end end Og.start( :name => "test", :adapter => :mysql, :user => "root", :password => ",sql51e", :destroy => true, :evolve_schema => :full ) # At the moment this is needed. Hopefuly will not be needed in # the final release. Aspects.setup r = Root.create_with :name => "George", :dirty => true r0 = Root.all.first -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/nitro-general/attachments/20070819/461fd832/attachment.html From george.moschovitis at gmail.com Sun Aug 19 03:32:08 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sun, 19 Aug 2007 10:32:08 +0300 Subject: [Nitro] Problem with Og post method In-Reply-To: References: <200708160224.56992.weather@speakeasy.net> <200708181205.32571.weather@speakeasy.net> Message-ID: btw, you can still use post instead of after, property instead of attr_accessor etc etc... -g. -- http://www.me.gr http://phidz.com 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/20070819/e321be34/attachment.html From george.moschovitis at gmail.com Sun Aug 19 03:34:53 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sun, 19 Aug 2007 10:34:53 +0300 Subject: [Nitro] OG vs Active Record In-Reply-To: References: <389c43e40708161949u2781f25x11d916169056f82f@mail.gmail.com> Message-ID: > > I see the same performance on my system (script attached). Has anyone > > run this test under OG? > > > Not me > Og *may* be faster because it uses custom, precompiled serializers/deserializers for each managed class. -g. -- http://www.me.gr http://phidz.com 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/20070819/ae4b3689/attachment-0001.html From weather at speakeasy.net Sun Aug 19 03:53:04 2007 From: weather at speakeasy.net (Matthew B Gardner) Date: Sun, 19 Aug 2007 03:53:04 -0400 Subject: [Nitro] Problem with Og post method In-Reply-To: References: <200708160224.56992.weather@speakeasy.net> <200708181205.32571.weather@speakeasy.net> Message-ID: <200708190353.05044.weather@speakeasy.net> Hello - On Sunday 19 August 2007 03:31, George Moschovitis wrote: > The following works as expected in the Repository version of Og. If you > have further questions please let me > know. > > > require "og" > > class Root > attr_accessor :name, Og::VarChar(100) > > after :og_read, :call => :to_world > > # more verbose (and less efficient) alternative > # after :og_read do > # to_world() > # end > > def initialize(name = nil) > @name = name > @dirty = false > @remove = false > > to_world > end > > def to_world > puts "----- POST ASPECT CALLED -----" > end > > def dirty? > @dirty > end > > def dirty! > @dirty = true > end > > def clean! > @dirty = false > end > > def remove! > @remove = true > end > > def remove? > @remove > end > end > > Og.start( > > :name => "test", > :adapter => :mysql, > :user => "root", > :password => ",sql51e", > :destroy => true, > :evolve_schema => :full > > ) > > # At the moment this is needed. Hopefuly will not be needed in > # the final release. > > Aspects.setup > > > r = Root.create_with :name => "George", :dirty => true > r0 = Root.all.first Prior to requiring the Root file, require 'og' Aspects.setup #=> ./lib/engine/cyclone.rb:9: undefined method `setup' for Aspects:Module (NoMethodError) Using og (0.41.0) This help at all? Thanks again for all the assistance, Matt From george.moschovitis at gmail.com Sun Aug 19 04:58:18 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sun, 19 Aug 2007 11:58:18 +0300 Subject: [Nitro] Problem with Og post method In-Reply-To: <200708190353.05044.weather@speakeasy.net> References: <200708160224.56992.weather@speakeasy.net> <200708181205.32571.weather@speakeasy.net> <200708190353.05044.weather@speakeasy.net> Message-ID: Please, get the latest version (either from darcs or from the repository gems: http://www.nitroproject.org/repo/gems 0.41.0 is about a year old and I cannot easily help you. thanks, George. On 8/19/07, Matthew B Gardner wrote: > > Hello - > > On Sunday 19 August 2007 03:31, George Moschovitis wrote: > > The following works as expected in the Repository version of Og. If you > > have further questions please let me > > know. > > > > > > require "og" > > > > class Root > > attr_accessor :name, Og::VarChar(100) > > > > after :og_read, :call => :to_world > > > > # more verbose (and less efficient) alternative > > # after :og_read do > > # to_world() > > # end > > > > def initialize(name = nil) > > @name = name > > @dirty = false > > @remove = false > > > > to_world > > end > > > > def to_world > > puts "----- POST ASPECT CALLED -----" > > end > > > > def dirty? > > @dirty > > end > > > > def dirty! > > @dirty = true > > end > > > > def clean! > > @dirty = false > > end > > > > def remove! > > @remove = true > > end > > > > def remove? > > @remove > > end > > end > > > > Og.start( > > > > :name => "test", > > :adapter => :mysql, > > :user => "root", > > :password => ",sql51e", > > :destroy => true, > > :evolve_schema => :full > > > > ) > > > > # At the moment this is needed. Hopefuly will not be needed in > > # the final release. > > > > Aspects.setup > > > > > > r = Root.create_with :name => "George", :dirty => true > > r0 = Root.all.first > > Prior to requiring the Root file, > > require 'og' > Aspects.setup #=> ./lib/engine/cyclone.rb:9: undefined method `setup' for > Aspects:Module (NoMethodError) > > Using og (0.41.0) > > This help at all? > > Thanks again for all the assistance, > Matt > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.me.gr http://phidz.com 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/20070819/4bf4c839/attachment.html From mvyver at gmail.com Sun Aug 19 08:22:50 2007 From: mvyver at gmail.com (Mark Van De Vyver) Date: Sun, 19 Aug 2007 22:22:50 +1000 Subject: [Nitro] Nitro>>Developers Center page: some errors In-Reply-To: References: <389c43e40708182159w5b31fec4r9e7264febc6720ec@mail.gmail.com> Message-ID: <389c43e40708190522s40a8cf74oa0c223dd475e4c8@mail.gmail.com> Hi George, Thanks for the reply > > Version Information: Microsoft .NET Framework Version:2.0.50727.832; > > ASP.NET Version:2.0.50727.832 > > > Microsoft.NET ?? This looks like an error in your openid provider. This si probably off-topic: I'm new to openID, the provider I used was http://www.openid.org/start.aspx This was the one linked to in the openid text in the phrase: 'If you don't have an OpenID you can grab one here' on the page http://www.nitroproject.org/users/signin# I'll take this up with that sites' admin/author. I assume that either of www.myopenid.com or www.lifejournal.com are known to be good? Is one 'better'? Regards Mark > > -g. > > -- > http://www.me.gr > http://phidz.com > http://blog.gmosx.com > http://cull.gr > http://www.joy.gr > http://nitroproject.org From transfire at gmail.com Sun Aug 19 13:59:08 2007 From: transfire at gmail.com (Trans) Date: Sun, 19 Aug 2007 17:59:08 -0000 Subject: [Nitro] OG vs Active Record In-Reply-To: <389c43e40708161949u2781f25x11d916169056f82f@mail.gmail.com> References: <389c43e40708161949u2781f25x11d916169056f82f@mail.gmail.com> Message-ID: <1187546348.768139.237450@k79g2000hse.googlegroups.com> On Aug 16, 7:49 pm, "Mark Van De Vyver" wrote: > Hi, > Thanks for all the effort that has gone into making Nitro/OG available. > > I'm relatively new to Ruby and am trying to decide between diving into > ActiveRecord and OG.... I'd appreciate any advice. > The useage case/scenario is: Single 'amateur' developer, large > numbers of databases, large databases (10'sGB/table, 10's tables/DB), > multiple ruby scripts accessing the dbserver directly (no web > interface - at this stage.) > > I understand that this is a little like asking a parent if their child > is beautiful, but was hoping for some frank feedback on the following. > > 1) Am I right that OG largely overcomes the issues discussed in this > (long) AR thread (I summarize a key issue below):http://rubyurl.com/xWb > and here:http://aralbalkan.com/764 > > A summary of a key AR issue (for me) is: > > Whether its in migrations or in the DB schema, I have to specify all > the columns as well as their lengths and unique constraints to have > the database created. Then I have to specify the validates_* rules > in the model to match. Finally I have to keep both of them in sync > over time. > Why not do it all inside the model and have that set up all the > validates_* rules in a single step? > > > 2) Has anyone compared the performance of AR vs OG. The following > thread about AR's cpu useage, surprised me:http://rubyurl.com/vFz > > I see the same performance on my system (script attached). Has anyone > run this test under OG? > > 3) How well is MySQL supported (bearing in mind that OG is at 0.5), or > is most development done with Postgresql? On MySQL, how about the > MyISAM and Memory Engine/tables? Objectively speaking. I would say Og is a better choice for ORM if you are specifically NOT doing Rails development, but really it's a matter of preference. The ActiveRecord model requires you to create the Database first and foremost, Og starts with the model. While ActiveRecord has model <-> db sync issues to manage, it's not usually that bad. It's elaborate migration system helps a good bit. With Og it's a lot easier, but you still have to deal with migrations, but they aren't critical to functionality as with ARs and Og helps to make it simple enough. However, FYI, there is a solution that makes ActiveRecord easier to use by more intelligently using DB metadata: http://magicmodels.rubyforge.org/. So there are options. I'm sure you know this too, but just in case there was any doubt: While Og is part of Nitro, it can be used completely independently. I've actually been trying to convince George to free Og form the Nitro repo for a while now! ;-) Finally I should mention, if speed is your number one criteria, you may want to look as DBI too. DBI is a straight forward adapter system which simply allows you to work with the database directly in SQL. No "magic" conveniences, but also no meta-code to slow anything down. T. From john at oxyliquit.de Sun Aug 19 14:42:10 2007 From: john at oxyliquit.de (Jonathan Buch) Date: Sun, 19 Aug 2007 20:42:10 +0200 Subject: [Nitro] The has_one/belongs_to relationship In-Reply-To: <200708181736.13354.weather@speakeasy.net> References: <200708181159.06393.weather@speakeasy.net> <200708181736.13354.weather@speakeasy.net> Message-ID: Hi, > Is Character#account_oid not saved until I call Account#update? I can't say > for sure, but I think the field was NULL in the db after Character#create, > but was then set in the db after Account#update. Just trying to clarify how > this works. Ah, no, nothing gets 'autosaved' just by setting something (would be quite inefficient, saving 10 values in a row would mean 10 queries, unacceptable). By doing a .save or .update you then send changes to the DB. > I may have misspoken -- what I meant is that the has_many objects were loaded > and attached when I loaded the object they belong to. The Character object is > now also loading and attaching when I load the corresponding Account object. > I'm assuming, from what you said, that this loading and attachment happens > during Og#allocate? Ah yes, 'loaded and attached', that'd be a good description on what it does. :) On the internals... well, that always depends on how the object is loaded. `MyModel[oid]` for example would only make a SELECT and hand it over to `read_one()` (sql.rb) which then creates a new object (MyModel.allocate, which only, if you didn't know that, prevents ruby from calling the `initialize()`). The newly allocated object then is filled by `read_row()`, which just sets instance variables (one for each field) on that object. Conceptually pretty simple I think. :) > As far as I can tell, it's working -- no bug squashing needed on this front. Good good. :) > I'm still feeling this relationship out though -- I'm actually curious about > why I can refer to Character#account by "account", but Account#character only > by self.character and why it treats "character" as a local variable (but > not "account" in the Character class). Well... simple Ruby: class A attr_accessor :a def set(o) a = o # this will set an instance variable self.a = o # this will use `def a=()` which gets created by attr_acc end end A.new.set 'foo' A.new.a = 'foo' # will do the same The same applies for both Character and Account, not sure how your exact code looks like of course. Hope that helps, Jo -- Feel the love http://pinkjuice.com/pics/ruby.png From john at oxyliquit.de Sun Aug 19 14:42:08 2007 From: john at oxyliquit.de (Jonathan Buch) Date: Sun, 19 Aug 2007 20:42:08 +0200 Subject: [Nitro] OG vs Active Record In-Reply-To: <389c43e40708161949u2781f25x11d916169056f82f@mail.gmail.com> References: <389c43e40708161949u2781f25x11d916169056f82f@mail.gmail.com> Message-ID: Hi, > I'm relatively new to Ruby and am trying to decide between diving into > ActiveRecord and OG.... I'd appreciate any advice. > The useage case/scenario is: Single 'amateur' developer, large > numbers of databases, large databases (10'sGB/table, 10's tables/DB), > multiple ruby scripts accessing the dbserver directly (no web > interface - at this stage.) Multi-database is not as thoroughly tested as single, but the number (and also the sizes of the tables) do not make Og slow. It's just how much you need to transfer between Og/DB. On startup time, if you stay below a 100 tables, it'll still be quite ok on a halfway capable computer. There are a few tweaks you can do, but doing them means your app and db design is 'finished'. > I understand that this is a little like asking a parent if their child > is beautiful, but was hoping for some frank feedback on the following. > > 1) Am I right that OG largely overcomes the issues discussed in this > (long) AR thread (I summarize a key issue below): > http://rubyurl.com/xWb Yes, by using Og basically _all_ your information is in the model file. Even the DB layout is there (which is what differenciates Og from AR). > and here: > http://aralbalkan.com/764 Yep, this is exactly what Og does. :) > A summary of a key AR issue (for me) is: > > Whether its in migrations or in the DB schema, I have to specify all > the columns as well as their lengths and unique constraints to have > the database created. Then I have to specify the validates_* rules > in the model to match. Finally I have to keep both of them in sync > over time. > Why not do it all inside the model and have that set up all the > validates_* rules in a single step? > This certainly could be done and it has been asked for already on irc some year ago. I wasn't too sure about that back then, and I still hesitate on that. We could make it an option, `Og.auto_validations` which then does the trick.... G? Personally, I wouldn't use it largly because I tend to see some of the validations as useless and time consuming (`uniq` for example, which is again done on DB level, where it actually belongs to. Some of the validations like 'belongs_to' (meaning it shouldn't exist when the 'main' object disappears) can only be done via certain DBs (like psql) with foreign key constraints..... There's just so much stuff the DB does better, that's what I think, anyway. :P). Anyway, like I said, the idea isn't all too bad, I'm just not sure if it's worth it, as the models/validations don't get changed so often (I draw stuff on real paper before doing DB work :P). > 2) Has anyone compared the performance of AR vs OG. The following > thread about AR's cpu useage, surprised me: > http://rubyurl.com/vFz > > I see the same performance on my system (script attached). Has anyone > run this test under OG? I'd love if you could adapt (I haven't had a look at it yet) that script and run it on Og? I would think that the performance of AR and Og could be quite comparable. (Though, I could be horribly wrong, when I started with Nitro I thought we were slower than rails, which turned out quite a wrong assumption ;)) But, I think you'll see the same 'behaviour' with Og and MySQL. MySQL is just too old, too optimized and there's too much movement behind it for Og to really stress it. At least that's my guess. ;) > 3) How well is MySQL supported (bearing in mind that OG is at 0.5), or > is most development done with Postgresql? On MySQL, how about the > MyISAM and Memory Engine/tables? Og is at 0.50, so about 50 revisions (actually I think more like 35 public ones..), not the version number '0.5'. MySQL is (and always has been) actually the 'premier' DB used by the head maintainer. It's just always those weird other people like me who just use PostgreSQL. ;) (Which means, that I optimize Og for my psql usage, only run the specs with it etc, which means that sometimes the psql part is better supported than the mysql/sqlite one). In-memory SQLite is actually quite nicely supported, and I know one from IRC who used it to speed up Og quite a bit (synchronizing the mem with a real backend now and then). I know nothing about MySQL memory engines, so can't comment. Hope that helps, Jo -- Feel the love http://pinkjuice.com/pics/ruby.png From john at oxyliquit.de Sun Aug 19 14:42:11 2007 From: john at oxyliquit.de (Jonathan Buch) Date: Sun, 19 Aug 2007 20:42:11 +0200 Subject: [Nitro] The has_one/belongs_to relationship In-Reply-To: <200708181803.45176.weather@speakeasy.net> References: <200708181159.06393.weather@speakeasy.net> <200708181803.45176.weather@speakeasy.net> Message-ID: Hi, > I may have spoken a little prematurely on this -- I am encountering a problem. > When I call Character#create, or when a Character object is loaded (via it's > corresponding Account being loaded), it's creating it's own account. To > illustrate, this is what's happening: > > a1 = Account.new > a1.character = Character.create self > a1.equal?(a1.character.account) #=> false > > The same thing is happening when loaded from the database, so the account is > pointing to the character, but the character is pointing to a different > account (an account with the same attributes, but a different identity). Yes, a different 'identity', but not 'equality', depending on which method is called. ;) Ruby knows .eql? .equal? .== .=== .equal? is for testing if the object ids are the same, which they are not in this case. a1 == a1.character.account # true Og overrides ==() to react on the primary key of that model. > I'm assuming I'm doing this to myself, here is how I'm initializing Character: Looks all good. :) > Let me know if that isn't enough information, or if it's unclear. > Thanks for any help (getting closer!), You're welcome. :) Jo -- Feel the love http://pinkjuice.com/pics/ruby.png From weather at speakeasy.net Sun Aug 19 16:42:31 2007 From: weather at speakeasy.net (Matthew B Gardner) Date: Sun, 19 Aug 2007 16:42:31 -0400 Subject: [Nitro] Problem with Og post method In-Reply-To: References: <200708160224.56992.weather@speakeasy.net> <200708190353.05044.weather@speakeasy.net> Message-ID: <200708191642.31292.weather@speakeasy.net> Hello - On Sunday 19 August 2007 04:58, George Moschovitis wrote: > Please, > > get the latest version (either from darcs or from the repository gems: > http://www.nitroproject.org/repo/gems > > 0.41.0 is about a year old and I cannot easily help you. > > thanks, > George. > Sorry about that -- I've now upgraded to 0.50.0 for both glue and og. class Root property :name, VarChar(100) after :og_read, :call => :to_world def initialize name = "_error" @name = name @dirty = false @remove = false end def to_world p "--WE GOT HERE--" world.objects << self end ... end Aspects.setup -end of file- Root#to_world is never getting called -- I tried placing the call in my Account < Root class, but that didn't work either. Thanks again for the help, Matt From weather at speakeasy.net Sun Aug 19 16:57:32 2007 From: weather at speakeasy.net (Matthew B Gardner) Date: Sun, 19 Aug 2007 16:57:32 -0400 Subject: [Nitro] The has_one/belongs_to relationship In-Reply-To: References: <200708181159.06393.weather@speakeasy.net> <200708181803.45176.weather@speakeasy.net> Message-ID: <200708191657.32254.weather@speakeasy.net> Hello - >On Sunday 19 August 2007 14:42, Jonathan Buch wrote: > Hi, > > > I may have spoken a little prematurely on this -- I am encountering a > > problem. When I call Character#create, or when a Character object is > > loaded (via it's corresponding Account being loaded), it's creating it's > > own account. To illustrate, this is what's happening: > > > > a1 = Account.new > > a1.character = Character.create self > > a1.equal?(a1.character.account) #=> false > > > > The same thing is happening when loaded from the database, so the account > > is pointing to the character, but the character is pointing to a > > different account (an account with the same attributes, but a different > > identity). > > Yes, a different 'identity', but not 'equality', depending on which method > is called. ;) > Ruby knows .eql? .equal? .== .=== > .equal? is for testing if the object ids are the same, which they are not > in this case. > Well, my issue is that I need my Account object to reference my Character object and my Character object to refer back to that same Account object. I assumed that the relationship would work like this: load Account load Account#character_oid Account <-> Character But, it's doing this, I think: load Account load Account#character load Character#account Account -> Character -> Account (different instance) Is this how it works then, or did I perhaps implement something incorrectly? Since it's just a one_on_one relationship, I can always reference the Account myself in the Character class, but I was trying to be Ogish and have it load and attach itself. However, it's essential that the created objects reference eachother -- do I need to do the loading myself then (Character.find_by_account_oid(Account#oid), where Character#account_oid is a field created and set by me)? > Og overrides ==() to react on the primary key of that model. > Oh, this probably explains some unexpected results from Array#delete(self) in my Character class -- I assumed it was Og-related, but good to know for sure and why. Thanks again, Matt From weather at speakeasy.net Sun Aug 19 17:24:17 2007 From: weather at speakeasy.net (Matthew B Gardner) Date: Sun, 19 Aug 2007 17:24:17 -0400 Subject: [Nitro] Problem with Og post method In-Reply-To: <200708191642.31292.weather@speakeasy.net> References: <200708160224.56992.weather@speakeasy.net> <200708191642.31292.weather@speakeasy.net> Message-ID: <200708191724.17450.weather@speakeasy.net> Hopefully this catches any repliers before responding to my previous post -- I got this working. I realized (from the example -- thanks again George) that I need to call Aspects.setup inside my program after Og.setup and it looks to be working fine. Thanks again, Matt On Sunday 19 August 2007 16:42, Matthew B Gardner wrote: > Hello - > > On Sunday 19 August 2007 04:58, George Moschovitis wrote: > > Please, > > > > get the latest version (either from darcs or from the repository gems: > > http://www.nitroproject.org/repo/gems > > > > 0.41.0 is about a year old and I cannot easily help you. > > > > thanks, > > George. > > Sorry about that -- I've now upgraded to 0.50.0 for both glue and og. > > class Root > > property :name, VarChar(100) > > after :og_read, :call => :to_world > > def initialize name = "_error" > @name = name > @dirty = false > @remove = false > end > > def to_world > p "--WE GOT HERE--" > world.objects << self > end > > ... > end > > Aspects.setup > -end of file- > > > Root#to_world is never getting called -- I tried placing the call in my > Account < Root class, but that didn't work either. > > Thanks again for the help, > Matt > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general From george.moschovitis at gmail.com Sun Aug 19 17:40:18 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Mon, 20 Aug 2007 00:40:18 +0300 Subject: [Nitro] Problem with Og post method In-Reply-To: <200708191724.17450.weather@speakeasy.net> References: <200708160224.56992.weather@speakeasy.net> <200708191642.31292.weather@speakeasy.net> <200708191724.17450.weather@speakeasy.net> Message-ID: > > got this working. I realized (from the example -- thanks again George) > that I > need to call Aspects.setup inside my program after Og.setup and it looks > to > be working fine. > Great :) Hopefully, we will find some time to work together with Tom to finalize the aspects design so that Aspects.setup is no longer needed. -g. -- http://www.me.gr http://phidz.com 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/20070820/89a74c42/attachment.html From george.moschovitis at gmail.com Sun Aug 19 17:43:31 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Mon, 20 Aug 2007 00:43:31 +0300 Subject: [Nitro] OG vs Active Record In-Reply-To: References: <389c43e40708161949u2781f25x11d916169056f82f@mail.gmail.com> Message-ID: > > This certainly could be done and it has been asked for already on irc > some year ago. I wasn't too sure about that back then, and I still > hesitate on that. We could make it an option, `Og.auto_validations` > which then does the trick.... G? > I don't understand what you mean here, can you elaborate? -g. -- http://www.me.gr http://phidz.com 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/20070820/0067fea6/attachment.html From weather at speakeasy.net Sun Aug 19 19:10:43 2007 From: weather at speakeasy.net (Matthew B Gardner) Date: Sun, 19 Aug 2007 19:10:43 -0400 Subject: [Nitro] Og create method Message-ID: <200708191910.43128.weather@speakeasy.net> I'm getting a database error when using Class#create -- this is an example of the error: ERROR: DB error Duplicate entry '6' for key 1, [INSERT INTO ogcharacter (`oid`, `aliases`, `name`, `account_oid`) VALUES (6, '--- []\n\n', 'Tester', 4)] The code is: self.character = Character.create msg.capitalize, self This problem doesn't occur if I use: self.character = Character.new msg.capitalize, self self.character.save! I'm guessing that the first code is trying to insert itself twice? Am I doing something wrong w/ #create? Thanks for any help, Matt From weather at speakeasy.net Mon Aug 20 01:00:37 2007 From: weather at speakeasy.net (Matthew B Gardner) Date: Mon, 20 Aug 2007 01:00:37 -0400 Subject: [Nitro] Og create method In-Reply-To: <200708191910.43128.weather@speakeasy.net> References: <200708191910.43128.weather@speakeasy.net> Message-ID: <200708200100.37353.weather@speakeasy.net> Hello - On Sunday 19 August 2007 19:10, Matthew B Gardner wrote: > I'm getting a database error when using Class#create -- this is an example > of the error: > > ERROR: DB error Duplicate entry '6' for key 1, [INSERT INTO ogcharacter > (`oid`, `aliases`, `name`, `account_oid`) VALUES (6, '--- []\n\n', > 'Tester', 4)] > > The code is: > > self.character = Character.create msg.capitalize, self > > This problem doesn't occur if I use: > > self.character = Character.new msg.capitalize, self > self.character.save! > > I'm guessing that the first code is trying to insert itself twice? Am I > doing something wrong w/ #create? > > Thanks for any help, > Matt It seems to be that line calling #create, mixed with this initialization: belongs_to :account, Account class Character def initialize(name = nil, acc = nil) super(name) self.account = acc # this is what's producing the error end end Hopefully that helps. -Matt From george.moschovitis at gmail.com Mon Aug 20 01:11:39 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Mon, 20 Aug 2007 08:11:39 +0300 Subject: [Nitro] Repository Gems In-Reply-To: References: <389c43e40708171043w7124fe1euc4a64231e7aa34f@mail.gmail.com> Message-ID: > > Btw, George, didn't we say we wanted to relase an 0.49 first? I'm still > for that, as to make some kinda 'release candidate' so we can make a > bugfix release out of 0.50 and not have to support a buggy release > until the next one. > I say lets release 0.50 as is and we can release a bugfix release as 0.51.0 What do you think? -g. -- http://www.me.gr http://phidz.com 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/20070820/203c2eab/attachment.html From john at oxyliquit.de Mon Aug 20 06:52:08 2007 From: john at oxyliquit.de (Jonathan Buch) Date: Mon, 20 Aug 2007 12:52:08 +0200 Subject: [Nitro] The has_one/belongs_to relationship In-Reply-To: <200708191657.32254.weather@speakeasy.net> References: <200708181159.06393.weather@speakeasy.net> <200708181803.45176.weather@speakeasy.net> <200708191657.32254.weather@speakeasy.net> Message-ID: Hi, > Well, my issue is that I need my Account object to reference my Character > object and my Character object to refer back to that same Account object. I > assumed that the relationship would work like this: >load Account > load Account#character_oid > Account <-> Character >But, it's doing this, I think: > load Account > load Account#character > load Character#account > Account -> Character -> Account (different instance) >>> a1 = Account.new >>> a1.character = Character.create self >>> a1.equal?(a1.character.account) #=> false This sums it up I guess, you call a1.character.account so it is "Account[25] -> Character[17] -> Account[25]". Where the first and last are the 'same' object, but not identical. The identify of objects is (imo) mostly irrelevant and hard to 'get to' anyway. When Og wanted to keep the identity for identical (meaning same primary key) elements, it'd really have to jump through hoops. It has several other problems then too, like having to keep track of every single loaded element (this 'cache' has to be cleaned, when?), making Og non-thread- safe (you always work on the identical copy, if you change it in one thread it gets changed for all), and the implementation would just be so complex and would make Og even slower. Og theoretically would be able to save the Account in the Character right after saving (which I asked George about) which would then point to the identical object as the Account. > Is this how it works then, or did I perhaps implement something incorrectly? > Since it's just a one_on_one relationship, I can always reference the Account > myself in the Character class, but I was trying to be Ogish and have it load > and attach itself. However, it's essential that the created objects reference > eachother -- do I need to do the loading myself then > (Character.find_by_account_oid(Account#oid), where Character#account_oid is a > field created and set by me)? Well, why would you want to do that by yourself, if Og does it already? When you load it yourself, the object_id you will get will differ in the exact same way. But, to answer your question: yes, that's how it works. a1 = Account.create c1 = Character.create a1.character = c1 a1.save c1.blah # do other stuff I do this, so if I need the same character in the same scope again, I just make it to a local variable, that is imo nicer to read, makes shorter code and even is more efficient. > However, it's essential that the created objects reference eachother They do, just not to the object with the same object_id, is that really a problem? >> Og overrides ==() to react on the primary key of that model. >> >Oh, this probably explains some unexpected results from Array#delete(self) in > my Character class -- I assumed it was Og-related, but good to know for sure > and why. Glad it cleared some things up. :) Jo -- Feel the love http://pinkjuice.com/pics/ruby.png From john at oxyliquit.de Mon Aug 20 06:52:05 2007 From: john at oxyliquit.de (Jonathan Buch) Date: Mon, 20 Aug 2007 12:52:05 +0200 Subject: [Nitro] OG vs Active Record In-Reply-To: References: <389c43e40708161949u2781f25x11d916169056f82f@mail.gmail.com> Message-ID: On Sun, 19 Aug 2007 23:43:31 +0200, George Moschovitis wrote: >> >> This certainly could be done and it has been asked for already on irc >> some year ago. I wasn't too sure about that back then, and I still >> hesitate on that. We could make it an option, `Og.auto_validations` >> which then does the trick.... G? >> > > I don't understand what you mean here, can you elaborate? Og.auto_validations = true class User attr_accessor :name, String, :uniq => true end This would then automatically create a `validate_unique :name`. Similar with other annotations then, :primary_key would do that too.. It could just 'walk' through some filter in the enchanting, which just reacts on certain annotations and autocreates validations.. Just an idea though. :) Jo -- Feel the love http://pinkjuice.com/pics/ruby.png From john at oxyliquit.de Mon Aug 20 06:52:07 2007 From: john at oxyliquit.de (Jonathan Buch) Date: Mon, 20 Aug 2007 12:52:07 +0200 Subject: [Nitro] Repository Gems In-Reply-To: References: <389c43e40708171043w7124fe1euc4a64231e7aa34f@mail.gmail.com> Message-ID: Hi, > I say lets release 0.50 as is and we can release a bugfix release as 0.51.0 > What do you think? what made you change your mind. :) Jo -- Feel the love http://pinkjuice.com/pics/ruby.png From john at oxyliquit.de Mon Aug 20 06:52:08 2007 From: john at oxyliquit.de (Jonathan Buch) Date: Mon, 20 Aug 2007 12:52:08 +0200 Subject: [Nitro] Og create method In-Reply-To: <200708200100.37353.weather@speakeasy.net> References: <200708191910.43128.weather@speakeasy.net> <200708200100.37353.weather@speakeasy.net> Message-ID: Hi, > It seems to be that line calling #create, mixed with this initialization: > > belongs_to :account, Account > > class Character > def initialize(name = nil, acc = nil) > super(name) > self.account = acc # this is what's producing the error > end > end ahhh yes, you actually can't do this exactly. This is setting a relation. Setting a relation means (DB wise) that there must already be objects present too relate to (meaning the character must have a primary key already which also will go into acc.character_oid. Now, this is the point where I'm supposed to make a suggestion on how else to do this. ;) class Account has_one Character end class Character belongs_to Account def initilize(name) super(name) end end a1 = Account.new c1 = (a1.character = Character.new) With the current Og autosaving scheme, this will create 2 objects refering to each other and saved to the DB already. (If not, then the current official 'og/relation/refers_to.rb' differs from mine in that account). Hope that helps, Jo -- Feel the love http://pinkjuice.com/pics/ruby.png From george.moschovitis at gmail.com Mon Aug 20 07:10:29 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Mon, 20 Aug 2007 14:10:29 +0300 Subject: [Nitro] Repository Gems In-Reply-To: References: <389c43e40708171043w7124fe1euc4a64231e7aa34f@mail.gmail.com> Message-ID: > > what made you change your mind. :) 0.50.0 better denotes the tons of new features (and changes) i think. 0.5xcould be a new series of development. -g. Jo > > -- > Feel the love > http://pinkjuice.com/pics/ruby.png > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.me.gr http://phidz.com 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/20070820/c9ecc720/attachment.html From weather at speakeasy.net Mon Aug 20 08:59:40 2007 From: weather at speakeasy.net (Matthew B Gardner) Date: Mon, 20 Aug 2007 08:59:40 -0400 Subject: [Nitro] The has_one/belongs_to relationship In-Reply-To: References: <200708181159.06393.weather@speakeasy.net> <200708191657.32254.weather@speakeasy.net> Message-ID: <200708200859.40255.weather@speakeasy.net> Hello - >On Monday 20 August 2007 06:52, Jonathan Buch wrote: > Hi, > > > Well, my issue is that I need my Account object to reference my Character > > object and my Character object to refer back to that same Account object. > > I assumed that the relationship would work like this: > >load Account > > load Account#character_oid > > Account <-> Character > >But, it's doing this, I think: > > load Account > > load Account#character > > load Character#account > > Account -> Character -> Account (different instance) > > > >>> a1 = Account.new > >>> a1.character = Character.create self > >>> a1.equal?(a1.character.account) #=> false > > This sums it up I guess, you call a1.character.account so it is > "Account[25] -> Character[17] -> Account[25]". Where the first and last > are the 'same' object, but not identical. > > The identify of objects is (imo) mostly irrelevant and hard to 'get to' > anyway. When Og wanted to keep the identity for identical (meaning same > primary key) elements, it'd really have to jump through hoops. It has > several other problems then too, like having to keep track of every single > loaded element (this 'cache' has to be cleaned, when?), making Og > non-thread- safe (you always work on the identical copy, if you change it > in one thread it gets changed for all), and the implementation would just > be so complex and would make Og even slower. > > Og theoretically would be able to save the Account in the Character right > after saving (which I asked George about) which would then point to the > identical object as the Account. > > > Is this how it works then, or did I perhaps implement something > > incorrectly? Since it's just a one_on_one relationship, I can always > > reference the Account myself in the Character class, but I was trying to > > be Ogish and have it load and attach itself. However, it's essential that > > the created objects reference eachother -- do I need to do the loading > > myself then > > (Character.find_by_account_oid(Account#oid), where Character#account_oid > > is a field created and set by me)? > > Well, why would you want to do that by yourself, if Og does it already? > When you load it yourself, the object_id you will get will differ in the > exact same way. > > But, to answer your question: yes, that's how it works. > > a1 = Account.create > c1 = Character.create > a1.character = c1 > a1.save > c1.blah # do other stuff > > I do this, so if I need the same character in the same scope again, I just > make it to a local variable, that is imo nicer to read, makes shorter code > and even is more efficient. > > > However, it's essential that the created objects reference eachother > > They do, just not to the object with the same object_id, is that really > a problem? > Well, my project is a text-based game in Ruby (a MUD, if you're familiar) -- each connection has a <-> reference to an Account object. So, I need the Character object to reference the same Account instance that references it -- what's happening is that user input is being sent to the Character (connection->account->character), but output from the Character is being sent to an account with a non-existent connection (character->account->nil). I just got rid of the relationship and now keep track of the Account a Character belongs to using the method I wrote above, which seems to work fine. > >> Og overrides ==() to react on the primary key of that model. > > > >Oh, this probably explains some unexpected results from Array#delete(self) > > in my Character class -- I assumed it was Og-related, but good to know > > for sure and why. > > Glad it cleared some things up. :) > > Jo Thanks so much for the help -- I do have one more question, when you get the time. I have a Node class that has_many comments (which belong_to a Node) -- when I load the Node table, it loads the nodes and loads and attaches the comments (which I still find really cool, btw) -- that's all that's happening there, correct? What I mean is, the comments aren't also loading their respective Nodes, as the Character was loading its Account, are they? Just wanted to double check that I don't have a bunch of extra Node instances running around. Thanks again -- I really appreciate all the help you and George have offered. -Matt From weather at speakeasy.net Mon Aug 20 09:23:32 2007 From: weather at speakeasy.net (Matthew B Gardner) Date: Mon, 20 Aug 2007 09:23:32 -0400 Subject: [Nitro] The has_one/belongs_to relationship In-Reply-To: <200708200859.40255.weather@speakeasy.net> References: <200708181159.06393.weather@speakeasy.net> <200708200859.40255.weather@speakeasy.net> Message-ID: <200708200923.32484.weather@speakeasy.net> > Thanks so much for the help -- I do have one more question, when you get > the time. I have a Node class that has_many comments (which belong_to a > Node) -- when I load the Node table, it loads the nodes and loads and > attaches the comments (which I still find really cool, btw) -- that's all > that's happening there, correct? What I mean is, the comments aren't also > loading their respective Nodes, as the Character was loading its Account, > are they? Just wanted to double check that I don't have a bunch of extra > Node instances running around. Just ran a test and it looks like they are running around (or maybe they're running around b/c the test included referencing comment->node). At any rate, it looks like relationships may not be a great idea for my project. From rob at robmela.com Mon Aug 20 13:15:56 2007 From: rob at robmela.com (Robert Mela) Date: Mon, 20 Aug 2007 13:15:56 -0400 Subject: [Nitro] OG vs Active Record In-Reply-To: References: <389c43e40708161949u2781f25x11d916169056f82f@mail.gmail.com> Message-ID: <46C9CC4C.6070702@robmela.com> I'm finding an inherent trap in ORMs. Consider the case where a Country has Provice/Region/State, and each of those has Cities Processing all cities in a country in the old days was a three-way join with control-break processing. One query, one result set. ORMs have some inherent traps which are only partially solved by preload. In the simplest case a preload two-levels deep can have the same efficiency as a single query with control-break processing. For example countries.each do |c| c.provinces.each do |p| p.cities.each do |c| end end end Without using preload, 100 countries of 100 provincies of 100 cities would result in 1 fetch of 100 countries. For each country, one fetch of 100 provinces. That's 100 fetches. For each province, one fetch of 100 cities. We've now got 10,000 fetches. That's 10,000 round-trips to the database. With preloads, of course, it's a single round trip. Unfortunately, preloads don't work when there's a lot of application logic. For example: countries.each do |c| c.roundish_provinces_with_lots_of_lakes.each do |p| p.cities_with_more_than_ten_macdonalds.eac do |c| .... end end end There is no way to tie a preload to this. If "roundish_provinces_with_lots_of_lakes" involves addtional joines, and so does "cities_with_more_than_ten_macdonalds" requires a lookup into a MacDonald's count table for each entry, you could be looking at thousands of round-trips to the database with no opportunity for precaching or preload. If you want speed you need to be very careful about how you use ORMs with large datasets. I recently found an ActiveRecord retrieval that made 8 thousand individual database calls totally 4 megabytes of generated SQL. All calls were to the same, self-referential table. The table only has 6,000 rows... I wound up yanking acts_as_tree and a homegrown acts_as_hierarchy, fetching the entire table at once -- all 6,000 rows -- and building my own non-Object Oriented tree inside the Model. Fetching 6,000 rows across a network *and* building the internal tree structure takes 3 milliseconds. Navigating the structure is microseconds. Before that the operation took anywhere from 10 seconds to two minutes.... I've been thinking about that experience and realized that, as systems get large, it makes a lot of sense to have the models be as simple as possible -- doing little more than enforcing simple constraints -- and have most business and application logic at the controller level. If that's not possible, then there needs to be a ModelLogic layer... MVC becomes MMVC... which despite initial appearances does not parse as a Roman Numeral. Jonathan Buch wrote: > Hi, > > >> I'm relatively new to Ruby and am trying to decide between diving into >> ActiveRecord and OG.... I'd appreciate any advice. >> The useage case/scenario is: Single 'amateur' developer, large >> numbers of databases, large databases (10'sGB/table, 10's tables/DB), >> multiple ruby scripts accessing the dbserver directly (no web >> interface - at this stage.) >> > > Multi-database is not as thoroughly tested as single, but the number > (and also the sizes of the tables) do not make Og slow. It's just how > much you need to transfer between Og/DB. > On startup time, if you stay below a 100 tables, it'll still be quite > ok on a halfway capable computer. There are a few tweaks you can do, > but doing them means your app and db design is 'finished'. > > >> I understand that this is a little like asking a parent if their child >> is beautiful, but was hoping for some frank feedback on the following. >> >> 1) Am I right that OG largely overcomes the issues discussed in this >> (long) AR thread (I summarize a key issue below): >> http://rubyurl.com/xWb >> > > Yes, by using Og basically _all_ your information is in the model file. > Even the DB layout is there (which is what differenciates Og from AR). > > >> and here: >> http://aralbalkan.com/764 >> > > Yep, this is exactly what Og does. :) > > >> A summary of a key AR issue (for me) is: >> >> Whether its in migrations or in the DB schema, I have to specify all >> the columns as well as their lengths and unique constraints to have >> the database created. Then I have to specify the validates_* rules >> in the model to match. Finally I have to keep both of them in sync >> over time. >> Why not do it all inside the model and have that set up all the >> validates_* rules in a single step? >> >> > > This certainly could be done and it has been asked for already on irc > some year ago. I wasn't too sure about that back then, and I still > hesitate on that. We could make it an option, `Og.auto_validations` > which then does the trick.... G? > > Personally, I wouldn't use it largly because I tend to see some of the > validations as useless and time consuming (`uniq` for example, which is > again done on DB level, where it actually belongs to. > Some of the validations like 'belongs_to' (meaning it shouldn't exist > when the 'main' object disappears) can only be done via certain DBs > (like psql) with foreign key constraints..... There's just so much > stuff the DB does better, that's what I think, anyway. :P). > > Anyway, like I said, the idea isn't all too bad, I'm just not sure > if it's worth it, as the models/validations don't get changed so > often (I draw stuff on real paper before doing DB work :P). > > >> 2) Has anyone compared the performance of AR vs OG. The following >> thread about AR's cpu useage, surprised me: >> http://rubyurl.com/vFz >> >> I see the same performance on my system (script attached). Has anyone >> run this test under OG? >> > > I'd love if you could adapt (I haven't had a look at it yet) that script > and run it on Og? > > I would think that the performance of AR and Og could be quite comparable. > (Though, I could be horribly wrong, when I started with Nitro I thought > we were slower than rails, which turned out quite a wrong assumption ;)) > > But, I think you'll see the same 'behaviour' with Og and MySQL. MySQL > is just too old, too optimized and there's too much movement behind it > for Og to really stress it. At least that's my guess. ;) > > >> 3) How well is MySQL supported (bearing in mind that OG is at 0.5), or >> is most development done with Postgresql? On MySQL, how about the >> MyISAM and Memory Engine/tables? >> > > Og is at 0.50, so about 50 revisions (actually I think more like 35 > public ones..), not the version number '0.5'. > > MySQL is (and always has been) actually the 'premier' DB used by the head > maintainer. It's just always those weird other people like me who just > use PostgreSQL. ;) (Which means, that I optimize Og for my psql usage, > only run the specs with it etc, which means that sometimes the psql part > is better supported than the mysql/sqlite one). > In-memory SQLite is actually quite nicely supported, and I know one from > IRC who used it to speed up Og quite a bit (synchronizing the mem with > a real backend now and then). > I know nothing about MySQL memory engines, so can't comment. > > Hope that helps, > > Jo > > -------------- next part -------------- A non-text attachment was scrubbed... Name: rob.vcf Type: text/x-vcard Size: 116 bytes Desc: not available Url : http://rubyforge.org/pipermail/nitro-general/attachments/20070820/2d608371/attachment.vcf From billk at cts.com Mon Aug 20 14:16:15 2007 From: billk at cts.com (Bill Kelly) Date: Mon, 20 Aug 2007 11:16:15 -0700 Subject: [Nitro] OG vs Active Record References: <389c43e40708161949u2781f25x11d916169056f82f@mail.gmail.com> <46C9CC4C.6070702@robmela.com> Message-ID: <023001c7e356$3293d430$6442a8c0@musicbox> From: "Robert Mela" > > If you want speed you need to be very careful about how you use ORMs > with large datasets. > > I recently found an ActiveRecord retrieval that made 8 thousand > individual database calls totally 4 megabytes of generated SQL. All > calls were to the same, self-referential table. When I've run into issues like this with Og, I've just written a custom SQL query. This particular example doesn't exactly parallel your problem, but it does show using refers_to to keep the data normalized; and shows how to ask Og for particular table names and such needed to construct the custom query: class IPHost property :ip, String, :unique => true property :hostname, String end class Playername property :playername, String, :unique => true end class Servername property :servername, String, :unique => true end class SuicidesAllTime property :method, String # ex: mg, cg, trap, phalanx, lava, squished, cratered, drowned property :date, Date property :count, Integer refers_to :servername, Servername refers_to :victim, Playername def self.top_suicides_list(victim_name_str, method_str, servername_str, date=Date.today, limit=10) date = get_insert_date(date) __total__ = STATS_TOTAL_NAME @playername_total ||= Playername.find_or_create_by_playername(__total__) @servername_total ||= Servername.find_or_create_by_servername(__total__) date_str = "#{date.year}-#{date.month}-#{date.mday}" if victim_name_str.nil? victim = nil elsif victim_name_str == __total__ victim = @playername_total else victim = PlayerSeen.find_closest_playername(victim_name_str) return [] unless victim end if servername_str.nil? servername = nil elsif servername_str == __total__ servername = @servername_total else servername = Servername.find_by_servername(servername_str) return [] unless servername end ptotal = @playername_total stotal = @servername_total sql = "SELECT P1.playername AS victim, " + "FRAG.method, SV.servername AS server, FRAG.count " + "FROM #{self.table} FRAG, #{Playername.table} P1, " + "#{Servername.table} SV " + "WHERE " + (victim ? "FRAG.victim_oid = #{victim.oid}" : "FRAG.victim_oid <> #{ptotal.oid}") + " AND " + (servername ? "FRAG.servername_oid = #{servername.oid}" : "FRAG.servername_oid <> #{stotal.oid}") + " AND " + (method_str ? "FRAG.method = '#{method_str}'" : "FRAG.method <> '#{__total__}'") + " AND FRAG.date = '#{date_str}' " + "AND P1.oid = FRAG.victim_oid " + "AND SV.oid = FRAG.servername_oid " + "ORDER BY FRAG.count DESC" sql << " LIMIT #{limit}" if limit res = ogstore.query(sql) rows = [] res.each_row {|row,dummy| rows << row} rows end # ... end Dunno if this is useful to anyone; but so far it's been possible for me to use Og to do most of the work, and just write custom queries as I need them. Regards, Bill From transfire at gmail.com Mon Aug 20 14:41:38 2007 From: transfire at gmail.com (Trans) Date: Mon, 20 Aug 2007 18:41:38 -0000 Subject: [Nitro] OG vs Active Record In-Reply-To: <46C9CC4C.6070702@robmela.com> References: <389c43e40708161949u2781f25x11d916169056f82f@mail.gmail.com> <46C9CC4C.6070702@robmela.com> Message-ID: <1187635298.554791.248090@w3g2000hsg.googlegroups.com> Nice post Robert. Thanks for the interesting analysis. From rob at robmela.com Mon Aug 20 16:07:03 2007 From: rob at robmela.com (Robert Mela) Date: Mon, 20 Aug 2007 16:07:03 -0400 Subject: [Nitro] OG vs Active Record In-Reply-To: <023001c7e356$3293d430$6442a8c0@musicbox> References: <389c43e40708161949u2781f25x11d916169056f82f@mail.gmail.com> <46C9CC4C.6070702@robmela.com> <023001c7e356$3293d430$6442a8c0@musicbox> Message-ID: <46C9F467.1020107@robmela.com> That's a very good approach and I'm considering it for some situations if I can ever unravel the business logic that's stretched across several models. In other cases I would perform per-class selects into hashes or arrays and loop through them at the controller level. Separating the logic makes it a lot more transparent, since often times much of the logic only applies in a particular area, and there's little sense in generalizing it by embedding it in the model. It's all OK, and it's a tough call as to where it should be done. What I would love is an ORM that could cache records locally, perhaps indexed in memory on certain criteria, so that it would query the local cache based on criteria rather than generating round-trip SQL. ActiveRecord has a :cacheable option somewhere, but it caches using the SQL query string as a key. The cache is useless if you need to retrieve the same objects as part of a different query. For tables of just a few thousand records a local, in-memory cache would be fantastic. Nitro is much better suited to that than Rails because you only need one in-process cache can be read by many concurrent threads. Bill Kelly wrote: > > def self.top_suicides_list(victim_name_str, method_str, servername_str, date=Date.today, limit=10) > date = get_insert_date(date) > __total__ = STATS_TOTAL_NAME > > @playername_total ||= Playername.find_or_create_by_playername(__total__) > @servername_total ||= Servername.find_or_create_by_servername(__total__) > date_str = "#{date.year}-#{date.month}-#{date.mday}" > > if victim_name_str.nil? > victim = nil > elsif victim_name_str == __total__ > victim = @playername_total > else > victim = PlayerSeen.find_closest_playername(victim_name_str) > return [] unless victim > end > > if servername_str.nil? > servername = nil > elsif servername_str == __total__ > servername = @servername_total > else > servername = Servername.find_by_servername(servername_str) > return [] unless servername > end > > ptotal = @playername_total > stotal = @servername_total > > sql = > "SELECT P1.playername AS victim, " + > "FRAG.method, SV.servername AS server, FRAG.count " + > "FROM #{self.table} FRAG, #{Playername.table} P1, " + > "#{Servername.table} SV " + > "WHERE " + > (victim ? "FRAG.victim_oid = #{victim.oid}" : "FRAG.victim_oid <> #{ptotal.oid}") + > " AND " + (servername ? "FRAG.servername_oid = #{servername.oid}" : "FRAG.servername_oid <> #{stotal.oid}") + > " AND " + (method_str ? "FRAG.method = '#{method_str}'" : "FRAG.method <> '#{__total__}'") + > " AND FRAG.date = '#{date_str}' " + > "AND P1.oid = FRAG.victim_oid " + > "AND SV.oid = FRAG.servername_oid " + > "ORDER BY FRAG.count DESC" > sql << " LIMIT #{limit}" if limit > res = ogstore.query(sql) > rows = [] > res.each_row {|row,dummy| rows << row} > rows > end > > -------------- next part -------------- A non-text attachment was scrubbed... Name: rob.vcf Type: text/x-vcard Size: 116 bytes Desc: not available Url : http://rubyforge.org/pipermail/nitro-general/attachments/20070820/df47bd18/attachment.vcf From john at oxyliquit.de Mon Aug 20 20:07:09 2007 From: john at oxyliquit.de (Jonathan Buch) Date: Tue, 21 Aug 2007 02:07:09 +0200 Subject: [Nitro] OG vs Active Record In-Reply-To: <46C9CC4C.6070702@robmela.com> References: <389c43e40708161949u2781f25x11d916169056f82f@mail.gmail.com> <46C9CC4C.6070702@robmela.com> Message-ID: Hi, > If you want speed you need to be very careful about how you use > ORMs with large datasets. true words. :P > I recently found an ActiveRecord retrieval that made 8 thousand > individual database calls totally 4 megabytes of generated SQL. > All calls were to the same, self-referential table. >The table only has 6,000 rows... Sounds like someone is trying to fetch a tree recursively. ;) > I've been thinking about that experience and realized that, as > systems get large, it makes a lot of sense to have the models be > as simple as possible -- doing little more than enforcing simple > constraints -- and have most business and application logic at > the controller level. > If that's not possible, then there needs to be a ModelLogic > layer... MVC becomes MMVC... which despite initial appearances > does not parse as a Roman Numeral. This is how I like to do that stuff, it comes more natural to me than to put everything except cooking coffee into the models. I like my models clean, with a modest amount of convenience functions. I for example cringe when I have to move controller stuff down into the model for convenience' sake and HTML inside the models make me want to cry for my mommie. Acually (from long discussions) I'd crank that up to MMMVC, the new M is for ModelPresentationLogic. Templating is such a hard problem.... Btw, on the matter of 8 thousand queries, let me once more present my (almost) infamous age old tip on oxyliquit: http://www.oxyliquit.de/tip/31 End is, don't redo something the DB does better anyway. Jo PS: ltree (a indexed tree implentation for psql) and Og work together beautifully (with a few enhancements). -- Feel the love http://pinkjuice.com/pics/ruby.png From john at oxyliquit.de Mon Aug 20 20:07:11 2007 From: john at oxyliquit.de (Jonathan Buch) Date: Tue, 21 Aug 2007 02:07:11 +0200 Subject: [Nitro] OG vs Active Record In-Reply-To: <023001c7e356$3293d430$6442a8c0@musicbox> References: <389c43e40708161949u2781f25x11d916169056f82f@mail.gmail.com> <46C9CC4C.6070702@robmela.com> <023001c7e356$3293d430$6442a8c0@musicbox> Message-ID: Hi, > Dunno if this is useful to anyone; but so far it's been possible for > me to use Og to do most of the work, and just write custom queries as > I need them. you're correct in that you need custom queries sometimes, but that is quite horrible there within the model. ;) May I say that VIEWs are really useful? Please, also consider my Tip on http://www.oxyliquit.de/tip/31 , life can only go better. :P I agree on that it only 'moves' the problem, but... I think it's just a whole lot cleaner. Jo -- Feel the love http://pinkjuice.com/pics/ruby.png From john at oxyliquit.de Mon Aug 20 20:07:11 2007 From: john at oxyliquit.de (Jonathan Buch) Date: Tue, 21 Aug 2007 02:07:11 +0200 Subject: [Nitro] The has_one/belongs_to relationship In-Reply-To: <200708200923.32484.weather@speakeasy.net> References: <200708181159.06393.weather@speakeasy.net> <200708200859.40255.weather@speakeasy.net> <200708200923.32484.weather@speakeasy.net> Message-ID: Hi, >> Thanks so much for the help -- I do have one more question, when you get >> the time. I have a Node class that has_many comments (which belong_to a >> Node) -- when I load the Node table, it loads the nodes and loads and >> attaches the comments (which I still find really cool, btw) -- that's all >> that's happening there, correct? >> What I mean is, the comments aren't also >> loading their respective Nodes, as the Character was loading its Account, >> are they? Just wanted to double check that I don't have a bunch of extra >> Node instances running around. Yes, that's all there is to it. When you don't call .node you won't have extra node copies around. > Just ran a test and it looks like they are running around (or maybe they're > running around b/c the test included referencing comment->node). At any rate, > it looks like relationships may not be a great idea for my project. class Node has_many Comment end class Comment belongs_to Node end n = Node.new n.comments << Comment.create n.comments << Comment.create c1 = n.comments.first c2 = n.comments.last n # original node c1.node # node copy #2 c2.node # node copy #3 You now have 3 copies of the original node lying about. Unecessarily. Relationships _are_ a good idea, think about normalizing of databases. :) It's really just about being a little careful on where the objects come from, use available local or instance variables to store object you are reusing, don't do unnecessary methods calls (which .node is). What Og can't do is update every relationship object and set the referral to the parent object to the identical (object_id) object. Hope that helps, Jo -- Feel the love http://pinkjuice.com/pics/ruby.png From weather at speakeasy.net Mon Aug 20 20:21:48 2007 From: weather at speakeasy.net (Matthew B Gardner) Date: Mon, 20 Aug 2007 20:21:48 -0400 Subject: [Nitro] The has_one/belongs_to relationship In-Reply-To: <200708200923.32484.weather@speakeasy.net> References: <200708181159.06393.weather@speakeasy.net> <200708200859.40255.weather@speakeasy.net> <200708200923.32484.weather@speakeasy.net> Message-ID: <200708202021.48593.weather@speakeasy.net> On Monday 20 August 2007 09:23, Matthew B Gardner wrote: > > Thanks so much for the help -- I do have one more question, when you get > > the time. I have a Node class that has_many comments (which belong_to a > > Node) -- when I load the Node table, it loads the nodes and loads and > > attaches the comments (which I still find really cool, btw) -- that's all > > that's happening there, correct? What I mean is, the comments aren't also > > loading their respective Nodes, as the Character was loading its Account, > > are they? Just wanted to double check that I don't have a bunch of extra > > Node instances running around. > > Just ran a test and it looks like they are running around (or maybe they're > running around b/c the test included referencing comment->node). At any > rate, it looks like relationships may not be a great idea for my project. Just wanted to acknowledge that the comments were loading their respective nodes when I referenced Comment#node -- so I'll just avoid doing that (I was only doing it to test). This thread has definitely helped me understand better how Og works with my objects -- thanks to both George and Jonathan for the help and explanations. From billk at cts.com Mon Aug 20 23:12:28 2007 From: billk at cts.com (Bill Kelly) Date: Mon, 20 Aug 2007 20:12:28 -0700 Subject: [Nitro] confused about app.dispatcher.root References: <00fb01c7e038$d63f6de0$6442a8c0@musicbox> Message-ID: <033001c7e3a1$1b07e310$6442a8c0@musicbox> From: George Moschovitis > > > class StoreController < Nitro::Controller > > no need to extend Nitro::Controller (in fact there is no Nitro::Controller > class, it is Raw::Controller now) Ah, OK thanks. > > ...the error I'm getting is: > > > > > > DEBUG: Rendering '/status_500' > > ERROR: Error while handling StoreController#index(status_500) > > ERROR: wrong number of arguments (1 for 0) > > please show as the error BEFORE 'Rendering /status_500'. That was the first error printed in the logfile. The error that happened before, was actually printed after. :) Turned out my old model code was doing ogstore.transaction where now the ogstore must be omitted. Thanks, Bill From billk at cts.com Tue Aug 21 00:17:28 2007 From: billk at cts.com (Bill Kelly) Date: Mon, 20 Aug 2007 21:17:28 -0700 Subject: [Nitro] OG vs Active Record References: <389c43e40708161949u2781f25x11d916169056f82f@mail.gmail.com> <46C9CC4C.6070702@robmela.com><023001c7e356$3293d430$6442a8c0@musicbox> Message-ID: <033e01c7e3aa$301d71d0$6442a8c0@musicbox> From: "Jonathan Buch" > >> Dunno if this is useful to anyone; but so far it's been possible for >> me to use Og to do most of the work, and just write custom queries as >> I need them. > > you're correct in that you need custom queries sometimes, but that is > quite horrible there within the model. ;) If you thought that was ugly, you should have seen the "optimized" queries. > May I say that VIEWs are really useful? Please, also consider my Tip > on http://www.oxyliquit.de/tip/31 , life can only go better. :P > > I agree on that it only 'moves' the problem, but... I think it's > just a whole lot cleaner. Thanks for the tip. I had considered using VIEWs at one point, but it's nice to see an example. Ultimately, despite my best attempts at optimizing my queries, I was not to achieve enough performance, once the tables started getting millions of rows. (I studied postgresql's analysis; it was using the indexes when it should have been.) Many of my queries started out as being very simple statements in Og... just a few lines of ruby. Some of them grew to 50 or 100 lines for the fastest versions I came up with. I got about an order of magnitude speedup over Og... but it still wasn't enough. Grisly details: http://rubyurl.com/XsB Regards, Bill From george.moschovitis at gmail.com Tue Aug 21 01:34:14 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Tue, 21 Aug 2007 08:34:14 +0300 Subject: [Nitro] The has_one/belongs_to relationship In-Reply-To: <200708202021.48593.weather@speakeasy.net> References: <200708181159.06393.weather@speakeasy.net> <200708200859.40255.weather@speakeasy.net> <200708200923.32484.weather@speakeasy.net> <200708202021.48593.weather@speakeasy.net> Message-ID: > > This thread has definitely helped me understand > better how Og works with my objects -- thanks to both George and Jonathan > for > the help and explanations. > np. -- http://www.me.gr http://phidz.com 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/20070821/bdd197ce/attachment.html From weather at speakeasy.net Tue Aug 21 01:40:48 2007 From: weather at speakeasy.net (Matthew B Gardner) Date: Tue, 21 Aug 2007 01:40:48 -0400 Subject: [Nitro] Aspects after method Message-ID: <200708210140.49252.weather@speakeasy.net> Just a simple question -- I'm trying to get my class to call foo after both og_read and initialize and I tried the following: after [:og_read, :initialize], :call => :foo It's calling foo on og_read, but not on initialize. The class, at least for my purposes at the moment, is being created via og_create -- I tried replacing initialize with that and achieved the same results. Any suggestions? Thanks, Matt From weather at speakeasy.net Tue Aug 21 07:06:17 2007 From: weather at speakeasy.net (Matthew B Gardner) Date: Tue, 21 Aug 2007 07:06:17 -0400 Subject: [Nitro] update() conflict Message-ID: <200708210706.17327.weather@speakeasy.net> One of my classes uses a Publisher module that defines an update() method, making it so I can't use the Og update(). I've tried defining an og_update method by Og::SqlStore.update() and some others, but that's not working. I'm coming from C, so I'm not entirely sure if that's the correct syntax, and I can't tell from the Og docs which class the update() method available belongs to. Is it something this easy and I just need a different syntax, or do I need to utilize a more complicated solution? Thanks for any help, Matt From george.moschovitis at gmail.com Tue Aug 21 08:20:22 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Tue, 21 Aug 2007 15:20:22 +0300 Subject: [Nitro] Aspects after method In-Reply-To: <200708210140.49252.weather@speakeasy.net> References: <200708210140.49252.weather@speakeasy.net> Message-ID: Let me investigate this and get back to you. -g. On 8/21/07, Matthew B Gardner wrote: > > Just a simple question -- I'm trying to get my class to call foo after > both > og_read and initialize and I tried the following: > > after [:og_read, :initialize], :call => :foo > > It's calling foo on og_read, but not on initialize. The class, at least > for my > purposes at the moment, is being created via og_create -- I tried > replacing > initialize with that and achieved the same results. Any suggestions? > > Thanks, > Matt > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.me.gr http://phidz.com 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/20070821/c9e0a508/attachment.html From george.moschovitis at gmail.com Tue Aug 21 08:21:42 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Tue, 21 Aug 2007 15:21:42 +0300 Subject: [Nitro] update() conflict In-Reply-To: <200708210706.17327.weather@speakeasy.net> References: <200708210706.17327.weather@speakeasy.net> Message-ID: you have to define an alias in lib/og/model.rb -g. On 8/21/07, Matthew B Gardner wrote: > > One of my classes uses a Publisher module that defines an update() method, > making it so I can't use the Og update(). I've tried defining an og_update > method by Og::SqlStore.update() and some others, but that's not working. > I'm > coming from C, so I'm not entirely sure if that's the correct syntax, and > I > can't tell from the Og docs which class the update() method available > belongs > to. Is it something this easy and I just need a different syntax, or do I > need to utilize a more complicated solution? > > Thanks for any help, > Matt > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.me.gr http://phidz.com 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/20070821/9158ab0d/attachment.html From john at oxyliquit.de Tue Aug 21 08:46:07 2007 From: john at oxyliquit.de (Jonathan Buch) Date: Tue, 21 Aug 2007 14:46:07 +0200 Subject: [Nitro] The has_one/belongs_to relationship In-Reply-To: <200708202021.48593.weather@speakeasy.net> References: <200708181159.06393.weather@speakeasy.net> <200708200859.40255.weather@speakeasy.net> <200708200923.32484.weather@speakeasy.net> <200708202021.48593.weather@speakeasy.net> Message-ID: Hi, > Just wanted to acknowledge that the comments were loading their respective > nodes when I referenced Comment#node -- so I'll just avoid doing that (I was > only doing it to test). This thread has definitely helped me understand > better how Og works with my objects -- thanks to both George and Jonathan for > the help and explanations. you're very welcome. :) In fact, that really gave a boost to the ML-post- count. ^____^ So, also thank you. :) Jo -- Feel the love http://pinkjuice.com/pics/ruby.png From rob at robmela.com Tue Aug 21 22:12:56 2007 From: rob at robmela.com (Robert Mela) Date: Tue, 21 Aug 2007 22:12:56 -0400 Subject: [Nitro] OG vs Active Record In-Reply-To: References: <389c43e40708161949u2781f25x11d916169056f82f@mail.gmail.com> <46C9CC4C.6070702@robmela.com> Message-ID: <46CB9BA8.5030702@robmela.com> Jonathan Buch wrote: > Sounds like someone is trying to fetch a tree recursively. ;) > > I hope whoever implements an acts_as_tree for Og has the hindsight and foresight to implement a cached tree structure option -- perhaps with update timestamps to allow simple, fast, partial cache refresh. -------------- next part -------------- A non-text attachment was scrubbed... Name: rob.vcf Type: text/x-vcard Size: 116 bytes Desc: not available Url : http://rubyforge.org/pipermail/nitro-general/attachments/20070821/13251df3/attachment.vcf From george.moschovitis at gmail.com Wed Aug 22 01:38:13 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Wed, 22 Aug 2007 08:38:13 +0300 Subject: [Nitro] OG vs Active Record In-Reply-To: <46CB9BA8.5030702@robmela.com> References: <389c43e40708161949u2781f25x11d916169056f82f@mail.gmail.com> <46C9CC4C.6070702@robmela.com> <46CB9BA8.5030702@robmela.com> Message-ID: > > I hope whoever implements an acts_as_tree for Og has the hindsight and > foresight to implement a cached tree structure option -- perhaps with > update timestamps to allow simple, fast, partial cache refresh. > I am attaching an Og Mixin I use for hierarchical queries in my projects. I think this greatly demonstrates the power of Og when encapsulating complex patterns. Consider this example when reviewing Og vs AvtiveRecord. I think this generates fairly optimized queries and caching is not needed. -g. -- http://www.me.gr http://phidz.com 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/20070822/5000ff6d/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: nested_intervals.rb Type: application/x-ruby Size: 4552 bytes Desc: not available Url : http://rubyforge.org/pipermail/nitro-general/attachments/20070822/5000ff6d/attachment.bin From john at oxyliquit.de Wed Aug 22 10:18:28 2007 From: john at oxyliquit.de (Jonathan Buch) Date: Wed, 22 Aug 2007 16:18:28 +0200 Subject: [Nitro] OG vs Active Record In-Reply-To: References: <389c43e40708161949u2781f25x11d916169056f82f@mail.gmail.com> <46C9CC4C.6070702@robmela.com> <46CB9BA8.5030702@robmela.com> Message-ID: Hi, >> I hope whoever implements an acts_as_tree for Og has the hindsight and >> foresight to implement a cached tree structure option -- perhaps with >> update timestamps to allow simple, fast, partial cache refresh. Og standard has a hierarchical (Nested Sets), which generates a tree out of a model comparable to acts_as_tree (I think). Why I dumped it: complexity. There is no way you can update such a structure (same with Nested Intervals) by hand, moving children to a new parent is hell and inserting is 6 queries (in the case of Og) instead of 1 and still can fail when using multithreading. > I am attaching an Og Mixin I use for hierarchical queries in my projects. I > think this greatly demonstrates the power of Og when encapsulating complex > patterns. Consider this example when reviewing Og vs AvtiveRecord. > > I think this generates fairly optimized queries and caching is not needed. Same as Nested Sets, Nested Intervals are hell with inserting/updating. They additionally have a limitation on the depth/size of the tree. While this is ok for small sets of data, bigger ones it rules out. Again, the pure complexity makes it very much impractical to do stuff 'by hand'. Updating here is quicker than with NestedSets it seems, although right now the code from G looks like it'd also use ~4 queries (only a quick glance, haven't looked at actual queries). Nontheless, both, and NestedIntervals in particular, are incredibly interesting and very nice for many usecases. On the topic of caching, caching is a hard problem.... I'm now more for caching the end result and not a single query (which is Georges' stance as well I think). Jo -- Feel the love http://pinkjuice.com/pics/ruby.png From mvyver at gmail.com Wed Aug 22 21:16:36 2007 From: mvyver at gmail.com (Mark Van De Vyver) Date: Thu, 23 Aug 2007 11:16:36 +1000 Subject: [Nitro] OG vs Active Record In-Reply-To: <46C9CC4C.6070702@robmela.com> References: <389c43e40708161949u2781f25x11d916169056f82f@mail.gmail.com> <46C9CC4C.6070702@robmela.com> Message-ID: <389c43e40708221816t5821a92cwc34a6c554bbe0f44@mail.gmail.com> Hi Robert, Thanks for the additional insights. On 8/21/07, Robert Mela wrote: > I'm finding an inherent trap in ORMs. I'm wondering if these types of issues are inherenit to ORM's or specific to how sophisticated an ORM is with the SQL it constructs? I'm not an SQL or Ruby guru, but if this is inherent to ORMs then it makes me think that it can't be overcome by more sophisticated use of SQL. > If you want speed you need to be very careful about how you use ORMs > with large datasets. Thanks for the heads-up - this is closer to my use-case. > I recently found an ActiveRecord retrieval that made 8 thousand > individual database calls totally 4 megabytes of generated SQL. All > calls were to the same, self-referential table. > > The table only has 6,000 rows... > > I wound up yanking acts_as_tree and a homegrown acts_as_hierarchy, > fetching the entire table at once -- all 6,000 rows -- and building my > own non-Object Oriented tree inside the Model. Fetching 6,000 rows > across a network *and* building the internal tree structure takes 3 > milliseconds. Navigating the structure is microseconds. Before that > the operation took anywhere from 10 seconds to two minutes.... > > I've been thinking about that experience and realized that, as systems > get large, it makes a lot of sense to have the models be as simple as > possible -- doing little more than enforcing simple constraints -- and > have most business and application logic at the controller level. Thanks Mark > If that's not possible, then there needs to be a ModelLogic layer... MVC > becomes MMVC... which despite initial appearances does not parse as a > Roman Numeral. > > > > > Jonathan Buch wrote: > > Hi, > > > > > >> I'm relatively new to Ruby and am trying to decide between diving into > >> ActiveRecord and OG.... I'd appreciate any advice. > >> The useage case/scenario is: Single 'amateur' developer, large > >> numbers of databases, large databases (10'sGB/table, 10's tables/DB), > >> multiple ruby scripts accessing the dbserver directly (no web > >> interface - at this stage.) > >> > > > > Multi-database is not as thoroughly tested as single, but the number > > (and also the sizes of the tables) do not make Og slow. It's just how > > much you need to transfer between Og/DB. > > On startup time, if you stay below a 100 tables, it'll still be quite > > ok on a halfway capable computer. There are a few tweaks you can do, > > but doing them means your app and db design is 'finished'. > > > > > >> I understand that this is a little like asking a parent if their child > >> is beautiful, but was hoping for some frank feedback on the following. > >> > >> 1) Am I right that OG largely overcomes the issues discussed in this > >> (long) AR thread (I summarize a key issue below): > >> http://rubyurl.com/xWb > >> > > > > Yes, by using Og basically _all_ your information is in the model file. > > Even the DB layout is there (which is what differenciates Og from AR). > > > > > >> and here: > >> http://aralbalkan.com/764 > >> > > > > Yep, this is exactly what Og does. :) > > > > > >> A summary of a key AR issue (for me) is: > >> > >> Whether its in migrations or in the DB schema, I have to specify all > >> the columns as well as their lengths and unique constraints to have > >> the database created. Then I have to specify the validates_* rules > >> in the model to match. Finally I have to keep both of them in sync > >> over time. > >> Why not do it all inside the model and have that set up all the > >> validates_* rules in a single step? > >> > >> > > > > This certainly could be done and it has been asked for already on irc > > some year ago. I wasn't too sure about that back then, and I still > > hesitate on that. We could make it an option, `Og.auto_validations` > > which then does the trick.... G? > > > > Personally, I wouldn't use it largly because I tend to see some of the > > validations as useless and time consuming (`uniq` for example, which is > > again done on DB level, where it actually belongs to. > > Some of the validations like 'belongs_to' (meaning it shouldn't exist > > when the 'main' object disappears) can only be done via certain DBs > > (like psql) with foreign key constraints..... There's just so much > > stuff the DB does better, that's what I think, anyway. :P). > > > > Anyway, like I said, the idea isn't all too bad, I'm just not sure > > if it's worth it, as the models/validations don't get changed so > > often (I draw stuff on real paper before doing DB work :P). > > > > > >> 2) Has anyone compared the performance of AR vs OG. The following > >> thread about AR's cpu useage, surprised me: > >> http://rubyurl.com/vFz > >> > >> I see the same performance on my system (script attached). Has anyone > >> run this test under OG? > >> > > > > I'd love if you could adapt (I haven't had a look at it yet) that script > > and run it on Og? > > > > I would think that the performance of AR and Og could be quite comparable. > > (Though, I could be horribly wrong, when I started with Nitro I thought > > we were slower than rails, which turned out quite a wrong assumption ;)) > > > > But, I think you'll see the same 'behaviour' with Og and MySQL. MySQL > > is just too old, too optimized and there's too much movement behind it > > for Og to really stress it. At least that's my guess. ;) > > > > > >> 3) How well is MySQL supported (bearing in mind that OG is at 0.5), or > >> is most development done with Postgresql? On MySQL, how about the > >> MyISAM and Memory Engine/tables? > >> > > > > Og is at 0.50, so about 50 revisions (actually I think more like 35 > > public ones..), not the version number '0.5'. > > > > MySQL is (and always has been) actually the 'premier' DB used by the head > > maintainer. It's just always those weird other people like me who just > > use PostgreSQL. ;) (Which means, that I optimize Og for my psql usage, > > only run the specs with it etc, which means that sometimes the psql part > > is better supported than the mysql/sqlite one). > > In-memory SQLite is actually quite nicely supported, and I know one from > > IRC who used it to speed up Og quite a bit (synchronizing the mem with > > a real backend now and then). > > I know nothing about MySQL memory engines, so can't comment. > > > > Hope that helps, > > > > Jo > > > > > > > From mvyver at gmail.com Wed Aug 22 21:42:44 2007 From: mvyver at gmail.com (Mark Van De Vyver) Date: Thu, 23 Aug 2007 11:42:44 +1000 Subject: [Nitro] OG vs Active Record In-Reply-To: References: <389c43e40708161949u2781f25x11d916169056f82f@mail.gmail.com> <46C9CC4C.6070702@robmela.com> <023001c7e356$3293d430$6442a8c0@musicbox> Message-ID: <389c43e40708221842h3ba11f04yd2249d12e6e8563a@mail.gmail.com> Hi Jo, > > Dunno if this is useful to anyone; but so far it's been possible for > > me to use Og to do most of the work, and just write custom queries as > > I need them. Is my understanding of the OG<->db relationship way off the mark to observe that how much custom code is required will depend on how sophisticated OG is in generating/processing SQL? This of course is a function of how much development is done. Or is there something about mapping objects to db's that means it'll never be possible to (efficiently) do the more sophisticated things? > you're correct in that you need custom queries sometimes, but that is > quite horrible there within the model. ;) > > May I say that VIEWs are really useful? Please, also consider my Tip > on http://www.oxyliquit.de/tip/31 , life can only go better. :P Thanks for pointing out your tip. I've a question about defining an object that OG recognizes as a view rather than a table, I'll post in another thread since it starts to get off topic. > I agree on that it only 'moves' the problem, but... I think it's > just a whole lot cleaner. If OG could recognise a 'view' object then it'd all be back in the model? Cheers Mark > Jo > > -- > Feel the love > http://pinkjuice.com/pics/ruby.png > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > From rob at robmela.com Thu Aug 23 11:49:27 2007 From: rob at robmela.com (Robert Mela) Date: Thu, 23 Aug 2007 11:49:27 -0400 Subject: [Nitro] OG vs Active Record In-Reply-To: References: <389c43e40708161949u2781f25x11d916169056f82f@mail.gmail.com> <46C9CC4C.6070702@robmela.com> <46CB9BA8.5030702@robmela.com> Message-ID: <46CDAC87.8020201@robmela.com> I can appreciate the convinience of using adjacencies. But there are as you suggest other criteria. Where I work there's a tree of about 38,000 nodes changing a few times a day. The amount of hand-editing that goes on is near nil, though the simplicity of adjacencies has been useful in debugging. The simplicity of adjacencies is a much larger factor if your tree is small and there are good reasons to take the short-cut of manual edits or manual generation. The broadest solution would be maintaining the adjacency list *alongside* the nested set. Simply add a parent_id field to each node. You can hand-insert a node, and run a script to have the system place it in the nested set. Alternatively, you can have a utility script that regenerates the adjacency list after an insert. Jonathan Buch wrote: > Same as Nested Sets, Nested Intervals are hell with inserting/updating. They > additionally have a limitation on the depth/size of the tree. While this is > ok for small sets of data, bigger ones it rules out. > Again, the pure complexity makes it very much impractical to do stuff > 'by hand'. Updating here is quicker than with NestedSets it seems, although > right now the code from G looks like it'd also use ~4 queries (only a quick > glance, haven't looked at actual queries). > > Nontheless, both, and NestedIntervals in particular, are incredibly > interesting and very nice for many usecases. > > On the topic of caching, caching is a hard problem.... I'm now more for > caching the end result and not a single query (which is Georges' stance as > well I think). > > Jo > > -------------- next part -------------- A non-text attachment was scrubbed... Name: rob.vcf Type: text/x-vcard Size: 116 bytes Desc: not available Url : http://rubyforge.org/pipermail/nitro-general/attachments/20070823/5c88df7d/attachment.vcf From john at oxyliquit.de Thu Aug 23 12:22:39 2007 From: john at oxyliquit.de (Jonathan Buch) Date: Thu, 23 Aug 2007 18:22:39 +0200 Subject: [Nitro] OG vs Active Record In-Reply-To: <389c43e40708221842h3ba11f04yd2249d12e6e8563a@mail.gmail.com> References: <389c43e40708161949u2781f25x11d916169056f82f@mail.gmail.com> <46C9CC4C.6070702@robmela.com> <023001c7e356$3293d430$6442a8c0@musicbox> <389c43e40708221842h3ba11f04yd2249d12e6e8563a@mail.gmail.com> Message-ID: Hi, > Is my understanding of the OG<->db relationship way off the mark to > observe that how much custom code is required will depend on how > sophisticated OG is in generating/processing SQL? This of course is a > function of how much development is done. I tend to see the 'write custom queries' as an optimization. When I need more speed, optimization is done. > Or is there something about mapping objects to db's that means it'll > never be possible to (efficiently) do the more sophisticated things? Well, the ORM can't go around 'guessing' your intentions. There must be a clever way to tell the ORM what exactly you need. Best is, for one purpose only 1 query, not 250. The way on how to 'specify your needs' varies of course. I'm sure someone very clever will come up with a way to create a 'auto vew creator' using a special DSL and thus make it much more comfortable to 'specify your needs'. "I want this, then please join that table, add some information from "that, aggregrate some information and finally do some calculations "based on the results in a subquery." For more sophisticated SQL there is just more information needed, and where does that information come from if not from the programmer. Anyway, that is my reason to write my VIEWs myself instead of letting some machine do horribly hacked together queries. >> you're correct in that you need custom queries sometimes, but that is >> quite horrible there within the model. ;) >> >> May I say that VIEWs are really useful? Please, also consider my Tip >> on http://www.oxyliquit.de/tip/31 , life can only go better. :P > > Thanks for pointing out your tip. > I've a question about defining an object that OG recognizes as a view > rather than a table, I'll post in another thread since it starts to > get off topic. Og doesn't recognize views at all, it doesn't think that far atm. Idea: class MyUserView is Og::VIEW(MyUser) att_accessor :a, :b, String set_view <<-SQL SELECT foo.a,blah.b FROM foo, blah SQL end MyUserView.all >> I agree on that it only 'moves' the problem, but... I think it's >> just a whole lot cleaner. > > If OG could recognise a 'view' object then it'd all be back in the model? MyUserView.view_source # => MyUser I have a slightly similar implementation here (which I shared with someone on IRC already who implemented it more like my current idea) which I needed for work. It has a few glitches (and thus I won't push to Og main), but it's actually very simple to implement, like 4 lines added. It also autogenerates the view itself (unlike my earlier tip where you have to do that yourself). But, coupling a VIEW to another object is sometimes not that clever. Views might be completely detached, not having to do much with the original purpose of the used models.... *hrm* Sorry for the unhelpfulness of this post, it's really just ideas blabbered out loud. Jo -- Feel the love http://pinkjuice.com/pics/ruby.png From mvyver at gmail.com Thu Aug 23 19:42:57 2007 From: mvyver at gmail.com (Mark Van De Vyver) Date: Fri, 24 Aug 2007 09:42:57 +1000 Subject: [Nitro] OG vs Active Record In-Reply-To: References: <389c43e40708161949u2781f25x11d916169056f82f@mail.gmail.com> <46C9CC4C.6070702@robmela.com> <023001c7e356$3293d430$6442a8c0@musicbox> <389c43e40708221842h3ba11f04yd2249d12e6e8563a@mail.gmail.com> Message-ID: <389c43e40708231642n162cbfc9k114630093b0ea81c@mail.gmail.com> Hi, > > Is my understanding of the OG<->db relationship way off the mark to > > observe that how much custom code is required will depend on how > > sophisticated OG is in generating/processing SQL? This of course is a > > function of how much development is done. > > I tend to see the 'write custom queries' as an optimization. When I > need more speed, optimization is done. Definitely. I've only dealt with a one simple type of directed graph, some recent reading makes me think that SQL can be mapped quite well (but not always perfectly/optimally) to OO concepts, then I saw the OG::NestedSets, which I don't understand but am satisfied that OGs approach makes it a bandwagon worth jumping on :) > > Or is there something about mapping objects to db's that means it'll > > never be possible to (efficiently) do the more sophisticated things? > > Well, the ORM can't go around 'guessing' your intentions. There must > be a clever way to tell the ORM what exactly you need. Best is, for > one purpose only 1 query, not 250. Sure, by adopting some conventions the chances that OG 'gets it right' are better. Correct? - I'm assuming Nitro/OG adopt the preference for convention over configuration? > The way on how to 'specify your needs' varies of course. I'm sure > someone very clever will come up with a way to create a 'auto vew > creator' using a special DSL and thus make it much more comfortable > to 'specify your needs'. > > "I want this, then please join that table, add some information from > "that, aggregrate some information and finally do some calculations > "based on the results in a subquery." > > For more sophisticated SQL there is just more information needed, and > where does that information come from if not from the programmer. I may be wrong but my current understanding is that OG could eventually 'acquire' some of that information from the database/or OGs managed objects and their inter-relations. It wouldn't always be optimal, but it could get quite sophisticated - right? < snip > > Sorry for the unhelpfulness of this post, it's really just ideas blabbered > out loud. No, this has been very helpful. I'll think a bout views a little more. Thanks Mark > Jo > > -- > Feel the love > http://pinkjuice.com/pics/ruby.png > From george.moschovitis at gmail.com Fri Aug 24 03:05:28 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Fri, 24 Aug 2007 10:05:28 +0300 Subject: [Nitro] OG vs Active Record In-Reply-To: References: <389c43e40708161949u2781f25x11d916169056f82f@mail.gmail.com> <46C9CC4C.6070702@robmela.com> <023001c7e356$3293d430$6442a8c0@musicbox> <389c43e40708221842h3ba11f04yd2249d12e6e8563a@mail.gmail.com> Message-ID: > > I have a slightly similar implementation here (which I shared with someone > on IRC already who implemented it more like my current idea) which I > needed > for work. > It has a few glitches (and thus I won't push to Og main), but it's > actually > very simple to implement, like 4 lines added. It also autogenerates the > view itself (unlike my earlier tip where you have to do that yourself). > I would like to see the code you are using. -g. -- http://www.me.gr http://phidz.com 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/20070824/e71b5ca7/attachment.html From george.moschovitis at gmail.com Fri Aug 24 03:43:49 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Fri, 24 Aug 2007 10:43:49 +0300 Subject: [Nitro] Nitro Message-ID: Out of couriosity... is anyone using (or plans to use) Nitro? Or are you all just interested in Og? thanks, -g. -- http://www.me.gr http://phidz.com 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/20070824/25ea265c/attachment-0001.html From arne at arnebrasseur.net Fri Aug 24 04:07:59 2007 From: arne at arnebrasseur.net (arne at arnebrasseur.net) Date: Fri, 24 Aug 2007 01:07:59 -0700 (PDT) Subject: [Nitro] Nitro In-Reply-To: References: Message-ID: <3387.208.97.187.133.1187942879.squirrel@webmail.arnebrasseur.net> > Out of couriosity... > > is anyone using (or plans to use) Nitro? Or are you all just interested in > Og? I'm very interested in Nitro. I have at least one project boiling inside my head that I want to work at the coming year. (ab) > thanks, > -g. > > -- > http://www.me.gr > http://phidz.com > http://blog.gmosx.com > http://cull.gr > http://www.joy.gr > http://nitroproject.org > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general From ravage at fragmentized.net Fri Aug 24 06:27:44 2007 From: ravage at fragmentized.net (Rui Miguel) Date: Fri, 24 Aug 2007 11:27:44 +0100 Subject: [Nitro] Nitro In-Reply-To: <3387.208.97.187.133.1187942879.squirrel@webmail.arnebrasseur.net> References: <3387.208.97.187.133.1187942879.squirrel@webmail.arnebrasseur.net> Message-ID: <0A508BFC-DDC5-47CD-B0FE-701266E2C45C@fragmentized.net> Also interested in Nitro and trying to use it on a project, more to come i'm sure as i get more confortable with it. Intranet stuff mostly. Regards, Rui Miguel On Aug 24, 2007, at Aug 24 - 09:07, arne at arnebrasseur.net wrote: >> Out of couriosity... >> >> is anyone using (or plans to use) Nitro? Or are you all just >> interested in >> Og? > > I'm very interested in Nitro. I have at least one project boiling > inside > my head that I want to work at the coming year. > > (ab) > >> thanks, >> -g. >> >> -- >> http://www.me.gr >> http://phidz.com >> http://blog.gmosx.com >> http://cull.gr >> http://www.joy.gr >> http://nitroproject.org >> _______________________________________________ >> Nitro-general mailing list >> Nitro-general at rubyforge.org >> http://rubyforge.org/mailman/listinfo/nitro-general > > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general -------------- next part -------------- A non-text attachment was scrubbed... Name: PGP.sig Type: application/pgp-signature Size: 186 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/nitro-general/attachments/20070824/46b2fa21/attachment.bin From weather at speakeasy.net Fri Aug 24 07:05:16 2007 From: weather at speakeasy.net (Matthew B Gardner) Date: Fri, 24 Aug 2007 07:05:16 -0400 Subject: [Nitro] Nitro In-Reply-To: References: Message-ID: <200708240705.16630.weather@speakeasy.net> I've been pondering using it for the web-portion of my project, but I'm curious about two things mostly: how does it compare with Rails (if that's a reasonable question to address), and what's the state of the documentation -- just the rdocs? -Matt On Friday 24 August 2007 03:43, George Moschovitis wrote: > Out of couriosity... > > is anyone using (or plans to use) Nitro? Or are you all just interested in > Og? > > thanks, > -g. From george.moschovitis at gmail.com Fri Aug 24 08:26:13 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Fri, 24 Aug 2007 15:26:13 +0300 Subject: [Nitro] Og save Message-ID: Dear devs, Please note that the implementation of the og save method in the repository version is changed from earlier versions. Ie it now uses Exceptions instead of the return value to notify possible (verification) problems. The change is quite old but I will add some comments in the code to make it more visible (even I have forgotten about it ;-)). regards, -g. -- http://www.me.gr http://phidz.com 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/20070824/fa07cad6/attachment.html From billk at cts.com Fri Aug 24 10:56:24 2007 From: billk at cts.com (Bill Kelly) Date: Fri, 24 Aug 2007 07:56:24 -0700 Subject: [Nitro] Nitro References: Message-ID: <042901c7e65e$f1665bc0$6442a8c0@musicbox> From: George Moschovitis > > Out of couriosity... > > is anyone using (or plans to use) Nitro? Or are you all just interested in Og? I'm using Nitro for an online store. I also use Og separately from Nitro. P.S. thank you for Nitro and Og. :) Regards, Bill From transfire at gmail.com Fri Aug 24 11:29:21 2007 From: transfire at gmail.com (Trans) Date: Fri, 24 Aug 2007 15:29:21 -0000 Subject: [Nitro] Aspects Message-ID: <1187969361.601995.195500@q5g2000prf.googlegroups.com> Hi-- I having a look at the aspects.rb code today. I understand there are some issues with the code. I'd like to review it's functionality and the issues involved with it. Concerning basic design, the objective is of course to create pre, post and around advice for methods. Now that's easy enough if methods already exist, basically: alias _methodname, methodname def methodname ... _methodname ... end The difficulty comes when the methods do not already exist. For instance, if we want to encapsulate a set of advice for reuse --which technically is what an aspect is. It is further complicated when we consider that methods can be dynamically added to a class/module after an aspect is applied. So those are the basic issues that make general implementation quite difficult. I've been thinking of implementing this on top of cut.rb. Cuts already basically handles this stuff, so it should be easy to build aspects.rb with it. However I'm not confident in the overall robustness of cut.rb. Among other things it overrides Module#included and Class#method_added, so I expect corner cases to arise where these methods have been overridden elsewhere. I'm sure it could be improved, but it's not easy --it's complex meta-programming. So I've been thinking about how to build a better implementation of cut.rb using delegation instead of dynamic methods. That implementation would easily be more robust, but in this case, I'm not sure about performance characteristics since it would be heavily reliant on method_missing. (Basically imagine every method call being routed via method_missing). OTOH. maybe a whole different approach is in order. Thoughts? T. From transfire at gmail.com Fri Aug 24 11:30:16 2007 From: transfire at gmail.com (Trans) Date: Fri, 24 Aug 2007 15:30:16 -0000 Subject: [Nitro] Nitro In-Reply-To: References: Message-ID: <1187969416.113329.140600@z24g2000prh.googlegroups.com> On Aug 24, 12:43 am, "George Moschovitis" wrote: > Out of couriosity... > > is anyone using (or plans to use) Nitro? Or are you all just interested in > Og? What spurred that question? T. From Reid.Thompson at ateb.com Fri Aug 24 13:38:20 2007 From: Reid.Thompson at ateb.com (Reid Thompson) Date: Fri, 24 Aug 2007 13:38:20 -0400 Subject: [Nitro] Nitro In-Reply-To: References: Message-ID: <1187977103.6443.7.camel@jhereg> On Fri, 2007-08-24 at 10:43 +0300, George Moschovitis wrote: > Out of couriosity... > > is anyone using (or plans to use) Nitro? Or are you all just > interested in Og? > > thanks, > -g. I'd like to use nitro -- I've just had a hard time getting started due to lack of time and documentation/tutorials ( lack of time could be offset by docs/tutorials ) From john at oxyliquit.de Fri Aug 24 14:00:39 2007 From: john at oxyliquit.de (Jonathan Buch) Date: Fri, 24 Aug 2007 20:00:39 +0200 Subject: [Nitro] OG vs Active Record In-Reply-To: References: <389c43e40708161949u2781f25x11d916169056f82f@mail.gmail.com> <46C9CC4C.6070702@robmela.com> <023001c7e356$3293d430$6442a8c0@musicbox> <389c43e40708221842h3ba11f04yd2249d12e6e8563a@mail.gmail.com> Message-ID: Hi, > I would like to see the code you are using. the meat of all it is: sql.rb: def og_create_schema(store) return unless Og.create_schema if self.class.const_defined?(:OG_SCHEMA) store.create_custom_schema(self.class.const_get(:OG_SCHEMA)) else unless self.class.schema_inheritance_child? store.create_table(self.class) store.create_table_indices(self.class) store.create_table_joins(self.class) end store.evolve_schema(self.class) end end This can already be used like this: class MyUserView attr_accessor :a, String OG_SCHEMA = <<-SQL CREATE VIEW ogmyuserview AS SELECT a FROM foo SQL end Another bit is quite necessary though: manager.rb: def manage_classes(*args) # ... classes = classes.sort_by {|x| x.const_defined?(:OG_SCHEMA) ? 1 : 0 } classes.each { |c| manage(c) } end Which moves the enchanting of 'custom' classes to the back because they might depend on other tables which have to be created/evolved first. (might fail due to interdependencies between views, this is one of the 'glitches') That's basically it, my very own auto-view-creator by adding 5 lines. :P Jo -- Feel the love http://pinkjuice.com/pics/ruby.png From john at oxyliquit.de Fri Aug 24 14:00:39 2007 From: john at oxyliquit.de (Jonathan Buch) Date: Fri, 24 Aug 2007 20:00:39 +0200 Subject: [Nitro] OG vs Active Record In-Reply-To: <46CDAC87.8020201@robmela.com> References: <389c43e40708161949u2781f25x11d916169056f82f@mail.gmail.com> <46C9CC4C.6070702@robmela.com> <46CB9BA8.5030702@robmela.com> <46CDAC87.8020201@robmela.com> Message-ID: Hi, > I can appreciate the convinience of using adjacencies. But > there are as you suggest other criteria. I never said I'd be using adjacency lists. ;) Right now I'm more on the track on materialized path, which (with help from postgres) has really good performance for all operations I need and at the same time is conceptually easy. > Where I work there's a tree of about 38,000 nodes changing a > few times a day. The amount of hand-editing that goes on is > near nil, though the simplicity of adjacencies has been useful > in debugging. Yeah, debugging, good example. Although an extensive test suite covering all that might be enough of a safety net for relations and can provide good enough information when stuff goes wrong... > The simplicity of adjacencies is a much larger factor if your > tree is small and there are good reasons to take the short-cut > of manual edits or manual generation. >The broadest solution would be maintaining the adjacency list > *alongside* the nested set. Simply add a parent_id field to > each node. You can hand-insert a node, and run a script to > have the system place it in the nested set. I think the NestedSets implementation within Og has the parent saved too. That could be a starting place for someone who wants to investigate on that further. > Alternatively, you can have a utility script that regenerates > the adjacency list after an insert. I heard some professionals use that two layer approach. They insert/update only the adjacency list, which is quite quick for some operations. Then they just regenerate a nested-sets table with the new information for fast selects. Too bad I don't have too much experience yet with real life high-performance stuff with huge databases. Thanks Robert for also replying here. :) Jo -- Feel the love http://pinkjuice.com/pics/ruby.png From john at oxyliquit.de Fri Aug 24 14:00:40 2007 From: john at oxyliquit.de (Jonathan Buch) Date: Fri, 24 Aug 2007 20:00:40 +0200 Subject: [Nitro] Nitro In-Reply-To: <200708240705.16630.weather@speakeasy.net> References: <200708240705.16630.weather@speakeasy.net> Message-ID: Hi, > I've been pondering using it for the web-portion of my project, but I'm > curious about two things mostly: how does it compare with Rails (if that's a > reasonable question to address), and what's the state of the documentation -- > just the rdocs? the state of documentation is... just the rdocs I guess. :) Well, that is if you don't count oxyliquit, which is only ever as good as people want it to be. :P But, there have been benchmarks showing a clear speed advantage of Nitro over Rails. Kirk Haines for example did one, classifying us somewhere in the middle of IOWA and Rails (where IOWA of course shines, Kirk does a lot of things for speed and memory usage there which Nitro doesn't). Jo -- Feel the love http://pinkjuice.com/pics/ruby.png From john at oxyliquit.de Fri Aug 24 14:00:40 2007 From: john at oxyliquit.de (Jonathan Buch) Date: Fri, 24 Aug 2007 20:00:40 +0200 Subject: [Nitro] Nitro In-Reply-To: References: Message-ID: Hi, > Out of couriosity... > > is anyone using (or plans to use) Nitro? Or are you all just interested in > Og? tough question. I guess the question comes from the recent discussions evolving around Og? I love that the Nitro ML is picking up a little steam right now. And any exposure of Og makes Nitro more appealing. As for me, some of the recent features I don't really use (REST) and I moved (also due to my recent internship) to something else which happens to fit my mind slightly better. It 'evolved' and is quite close to the nitro way and smells as good as Nitro. What can I say. :) Jo -- Feel the love http://pinkjuice.com/pics/ruby.png From john at oxyliquit.de Fri Aug 24 14:00:40 2007 From: john at oxyliquit.de (Jonathan Buch) Date: Fri, 24 Aug 2007 20:00:40 +0200 Subject: [Nitro] Og save In-Reply-To: References: Message-ID: Hi, > Please note that the implementation of the og save method in the repository > version is changed from earlier versions. Ie it now uses Exceptions instead > of the return value to notify possible (verification) problems. The change > is quite old but I will add some comments in the code to make it more > visible (even I have forgotten about it ;-)). I'm not really that fond of that change, as I see the occurance of a validation error as not something exceptional but as an 'expected' route and thus see a exception as overkill. begin obj.save rescue Og::ValidationError # do stuff end if !obj.save # do stuff end Of course I also read the discussion where that change stems from, and I agree that it might confuse some people who do `obj.save` and nothing happens in the db.... Just my piece of mind, Jo -- Feel the love http://pinkjuice.com/pics/ruby.png From george.moschovitis at gmail.com Fri Aug 24 14:04:32 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Fri, 24 Aug 2007 21:04:32 +0300 Subject: [Nitro] Nitro In-Reply-To: <1187969416.113329.140600@z24g2000prh.googlegroups.com> References: <1187969416.113329.140600@z24g2000prh.googlegroups.com> Message-ID: > > What spurred that question? I will use Nitro as the underlying platform for some important projects. As it is hard to find good Ruby developers in Greece (and almost impossible to find Nitro developers ;-)) I was wondering if anyone is using (or is planning to use) Nitro professionally. I may even have some small outsourcing jobs at a later date. So it would be nice to know that there *are* some people that will be actively working with Nitro this year (I most certainly will be much more active!) regards, George. T. > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.me.gr http://phidz.com 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/20070824/ea45430c/attachment.html From george.moschovitis at gmail.com Fri Aug 24 14:06:46 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Fri, 24 Aug 2007 21:06:46 +0300 Subject: [Nitro] Nitro In-Reply-To: References: Message-ID: > > the nitro way and smells as good as Nitro. > But this smells to me like the situation with Compiz + Beryl: unnecessary duplication of efforts. -g. -- http://www.me.gr http://phidz.com 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/20070824/b7ff4126/attachment.html From rob at robmela.com Fri Aug 24 16:41:40 2007 From: rob at robmela.com (Robert Mela) Date: Fri, 24 Aug 2007 16:41:40 -0400 Subject: [Nitro] Nitro In-Reply-To: References: Message-ID: <46CF4284.5040808@robmela.com> Nitro. It's just that databases are a pain in the neck and require more discussion ;) George Moschovitis wrote: > Out of couriosity... > > is anyone using (or plans to use) Nitro? Or are you all just > interested in Og? > > thanks, > -g. > > -- > http://www.me.gr > http://phidz.com > http://blog.gmosx.com > http://cull.gr > http://www.joy.gr > http://nitroproject.org > ------------------------------------------------------------------------ > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general -------------- next part -------------- A non-text attachment was scrubbed... Name: rob.vcf Type: text/x-vcard Size: 116 bytes Desc: not available Url : http://rubyforge.org/pipermail/nitro-general/attachments/20070824/21a1fc05/attachment.vcf From rob at robmela.com Fri Aug 24 16:45:44 2007 From: rob at robmela.com (Robert Mela) Date: Fri, 24 Aug 2007 16:45:44 -0400 Subject: [Nitro] Nitro In-Reply-To: <3387.208.97.187.133.1187942879.squirrel@webmail.arnebrasseur.net> References: <3387.208.97.187.133.1187942879.squirrel@webmail.arnebrasseur.net> Message-ID: <46CF4378.9020902@robmela.com> At this point I would not choose Rails for a new project. I would only choose Nitro. I too have several projects, at least one of which will be implemented. Nitro will be the framework. I'm also willing to evangelize. I live in Boston and there's a decent sized community using Rails. I'd like to give a presentation and demo of Nitro to a couple of local Ruby users groups, probably in early November, once one of my projects has some traction. arne at arnebrasseur.net wrote: >> Out of couriosity... >> >> is anyone using (or plans to use) Nitro? Or are you all just interested in >> Og? >> > > I'm very interested in Nitro. I have at least one project boiling inside > my head that I want to work at the coming year. > > (ab) > > >> thanks, >> -g. >> >> -- >> http://www.me.gr >> http://phidz.com >> http://blog.gmosx.com >> http://cull.gr >> http://www.joy.gr >> http://nitroproject.org >> _______________________________________________ >> Nitro-general mailing list >> Nitro-general at rubyforge.org >> http://rubyforge.org/mailman/listinfo/nitro-general >> > > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: rob.vcf Type: text/x-vcard Size: 116 bytes Desc: not available Url : http://rubyforge.org/pipermail/nitro-general/attachments/20070824/be3a18e4/attachment.vcf From rob at robmela.com Fri Aug 24 17:01:40 2007 From: rob at robmela.com (Robert Mela) Date: Fri, 24 Aug 2007 17:01:40 -0400 Subject: [Nitro] Nitro on rubyforge Message-ID: <46CF4734.2080307@robmela.com> 1) Sorry if I missed this -- but are the 0.50 gems ready? They're not on rubyforge 2) Seems the developer list on rubyforge ( http://rubyforge.org/project/memberlist.php?group_id=418 ) is out of date. One of the things I look at when considering technologies for a project is the size and viability of the development community around it. I'm sure many people include that criterium in their decision making. -------------- next part -------------- A non-text attachment was scrubbed... Name: rob.vcf Type: text/x-vcard Size: 116 bytes Desc: not available Url : http://rubyforge.org/pipermail/nitro-general/attachments/20070824/5d86485c/attachment.vcf From jan.provaznik at solnet.cz Fri Aug 24 17:25:44 2007 From: jan.provaznik at solnet.cz (=?UTF-8?Q?Jan_Provazn=C3=ADk?=) Date: Fri, 24 Aug 2007 23:25:44 +0200 Subject: [Nitro] Nitro In-Reply-To: References: Message-ID: George Moschovitis: > Out of couriosity... > > is anyone using (or plans to use) Nitro? Or are you all just interested in > Og? > > thanks, > -g. > Yes. We are moving our product (WebIS - enterprise groupware, currently running on +-150 servers, tens-hundreds users per server) on Nitro framework. Currently, I'm (quite successfully) testing WebIS with Nitro pre0.50, but for the present it doesn't use much of Nitro power yet (because of compatibility with older WebIS version). I will send some small patches soon - pre0.50 is currently hardcoded to use CookieSession, and also some of session classes (e.g. raw/context/session/file.rb) are not prepared for 0.50, but that are oddments. Regards, Jenik. From george.moschovitis at gmail.com Sat Aug 25 02:36:17 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sat, 25 Aug 2007 09:36:17 +0300 Subject: [Nitro] Nitro on rubyforge In-Reply-To: <46CF4734.2080307@robmela.com> References: <46CF4734.2080307@robmela.com> Message-ID: On 8/25/07, Robert Mela wrote: > > 1) Sorry if I missed this -- but are the 0.50 gems ready? They're not > on rubyforge nope, you can find experimental gems here: http://www.nitroproject.org/repo/gems I will automate the process of generating there glycerin gems. 2) Seems the developer list on rubyforge ( > http://rubyforge.org/project/memberlist.php?group_id=418 ) is out of > date. One of the things I look at when considering technologies for a > project is the size and viability of the development community around > it. I'm sure many people include that criterium in their decision making. we use this mailing list not the developer list. We should probably make this clearer though. -g. _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > > -- http://www.me.gr http://phidz.com 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/20070825/5e3d5e0f/attachment-0001.html From george.moschovitis at gmail.com Sat Aug 25 02:38:00 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sat, 25 Aug 2007 09:38:00 +0300 Subject: [Nitro] Nitro In-Reply-To: References: Message-ID: > > I will send some small patches soon - pre0.50 is currently hardcoded to > use CookieSession, and also some of session classes (e.g. > raw/context/session/file.rb) are not prepared for 0.50, but that are > oddments. Excellent, I will love to get some patches or even comments/remarks/suggestions about Nitro too, not just Og. thank you, George. Regards, Jenik. > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.me.gr http://phidz.com 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/20070825/fb435f34/attachment.html From george.moschovitis at gmail.com Sat Aug 25 02:39:18 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sat, 25 Aug 2007 09:39:18 +0300 Subject: [Nitro] Nitro In-Reply-To: <46CF4378.9020902@robmela.com> References: <3387.208.97.187.133.1187942879.squirrel@webmail.arnebrasseur.net> <46CF4378.9020902@robmela.com> Message-ID: > > I'm also willing to evangelize. I live in Boston and there's a decent > sized community using Rails. I'd like to give a presentation and > demo of Nitro to a couple of local Ruby users groups, probably in early > November, once one of my projects has some traction. That sounds great. Perhaps you could add some Nitro related posts to your blog or something in the mean time. Let's make Nitro more widely known! -g. http://www.me.gr http://phidz.com 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/20070825/beed31c0/attachment.html From dan at tastapod.com Sat Aug 25 07:38:09 2007 From: dan at tastapod.com (Dan North) Date: Sat, 25 Aug 2007 12:38:09 +0100 Subject: [Nitro] Nitro In-Reply-To: References: Message-ID: <46D014A1.1020808@tastapod.com> I've said this before and I still stand by it: I /get/ nitro. It works the way I want to work. Rails just doesn't. I want to start small and grow into an application. For instance, I don't want to even think about the database until I have a feature that requires persistence. I can't even /start/ a rails app without a fully-configured mysql or sqlite data store. That's just dumb. The thing that really won me over was the little movies on the original nitro site, where you start with a single class that is the entire app and break out the model and view as you need to (and not before). Then the view code got cleaner, and cleaner, until there wasn't even any ruby in it. Just some very intuitive html-ish tags. Lovely! I'm not writing ruby web apps in anger right now (I'm stuck in investment banking Java land) but I can guarantee that when I do, I'll be using nitro to do it. Keep up the great work George, Dan George Moschovitis wrote: > Out of couriosity... > > is anyone using (or plans to use) Nitro? Or are you all just > interested in Og? > > thanks, > -g. > > -- > http://www.me.gr > http://phidz.com > http://blog.gmosx.com > http://cull.gr > http://www.joy.gr > http://nitroproject.org > ------------------------------------------------------------------------ > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/nitro-general/attachments/20070825/66b8f294/attachment.html From george.moschovitis at gmail.com Sat Aug 25 14:01:16 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sat, 25 Aug 2007 21:01:16 +0300 Subject: [Nitro] Aspects In-Reply-To: <1187969361.601995.195500@q5g2000prf.googlegroups.com> References: <1187969361.601995.195500@q5g2000prf.googlegroups.com> Message-ID: > > The difficulty comes when the methods do not already exist. yeap, this is the problem. My version (included in the repository code) handles this my using a mandatory call to Aspects.setup after all dynamic methods are defined. But I think there are still some bugs (for example on bug reported earlier in this week). I tried to use the version from facets but I had some problems. Tomorrow I will review my version and the code from facets, and I will be in better position to help you with this. > method_missing. (Basically imagine every method call being routed via > method_missing). this sounds *awfull* to me! Thoughts? more thoughts (hopefully) tomorrow. -g. -- http://www.me.gr http://phidz.com 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/20070825/20b00749/attachment.html From george.moschovitis at gmail.com Sat Aug 25 14:03:55 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sat, 25 Aug 2007 21:03:55 +0300 Subject: [Nitro] Nitro In-Reply-To: <46D014A1.1020808@tastapod.com> References: <46D014A1.1020808@tastapod.com> Message-ID: > > I've said this before and I still stand by it: I *get* nitro. It works the > way I want to work. Rails just doesn't. I want to start small and grow into > an ..Keep up the great work George, > Dan > Thank you, this is very encouraging. I am kind of putting my ass in the line by using Nitro on such important projects and it is nice to hear that other people are planning to use it and (hopefully) help to make it as robust as possible. thanks, George. -- http://www.me.gr http://phidz.com 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/20070825/2e11c215/attachment.html From transfire at gmail.com Sat Aug 25 15:55:54 2007 From: transfire at gmail.com (Trans) Date: Sat, 25 Aug 2007 19:55:54 -0000 Subject: [Nitro] Aspects In-Reply-To: References: <1187969361.601995.195500@q5g2000prf.googlegroups.com> Message-ID: <1188071754.562666.319290@r34g2000hsd.googlegroups.com> On Aug 25, 11:01 am, "George Moschovitis" wrote: > > The difficulty comes when the methods do not already exist. > > yeap, this is the problem. My version (included in the repository code) > handles this > my using a mandatory call to Aspects.setup after all dynamic methods are > defined. > But I think there are still some bugs (for example on bug reported earlier > in this week). You're using this for Og models, right? Are you using it for Nitro controllers too? Anywhere else? I don't 100% understand the design btw. Could you explain what :on, :where, :only, :except, and :join options do? > I tried to use the version from facets but I had some problems. Tomorrow I > will review > my version and the code from facets, and I will be in better position to > help you with this. > > > method_missing. (Basically imagine every method call being routed via > > method_missing). > > this sounds *awfull* to me! He he. Well, it's not *that* bad! The nice things is that it's 100% dynamic. No fuss with included or method_added, which can be easy to break. In any case, for the time being it's probably best just to fix and improve your lib. It doesn't needs to be an all or nothing affair. I think there's room for both approaches in the library. I can add mine as a separate lib, and over time we can see how they fair/work together/cross-pollinate/etc. I have to go now, but let compare notes tomorrow. T. From transfire at gmail.com Sat Aug 25 22:04:23 2007 From: transfire at gmail.com (Trans) Date: Sun, 26 Aug 2007 02:04:23 -0000 Subject: [Nitro] Aspects In-Reply-To: <1188071754.562666.319290@r34g2000hsd.googlegroups.com> References: <1187969361.601995.195500@q5g2000prf.googlegroups.com> <1188071754.562666.319290@r34g2000hsd.googlegroups.com> Message-ID: <1188093863.651665.98980@r34g2000hsd.googlegroups.com> On Aug 25, 12:55 pm, Trans wrote: > On Aug 25, 11:01 am, "George Moschovitis" > > wrote: > > > The difficulty comes when the methods do not already exist. > > > yeap, this is the problem. My version (included in the repository code) > > handles this > > my using a mandatory call to Aspects.setup after all dynamic methods are > > defined. > > But I think there are still some bugs (for example on bug reported earlier > > in this week). > > You're using this for Og models, right? Are you using it for Nitro > controllers too? Anywhere else? > > I don't 100% understand the design btw. Could you explain > what :on, :where, :only, :except, and :join options do? > > > I tried to use the version from facets but I had some problems. Tomorrow I > > will review > > my version and the code from facets, and I will be in better position to > > help you with this. > > > > method_missing. (Basically imagine every method call being routed via > > > method_missing). > > > this sounds *awfull* to me! > > He he. Well, it's not *that* bad! The nice things is that it's 100% > dynamic. No fuss with included or method_added, which can be easy to > break. > > In any case, for the time being it's probably best just to fix and > improve your lib. It doesn't needs to be an all or nothing affair. I > think there's room for both approaches in the library. I can add mine > as a separate lib, and over time we can see how they fair/work > together/cross-pollinate/etc. > > I have to go now, but let compare notes tomorrow. I thought about this some more and I think you are right that dynamic dispatch, as I suggested it, is too inefficient in itself. But I realized that it would be possible to add an advice cache, and trigger the appropriate parts of the cache be recalculated when certain changes occur (method added, aspect added, etc). So then it would be quite efficient, in fact it amounts effectively that same basic design as yours. There's also another part of this. I have a joinpoint model I really like, which is completely flexible. I'd like to use that, and then layer your pre, post, around methods on top of that. I pretty confident that would be a great design. And the we can have one lib that satisfies us both. T. From mvyver at gmail.com Sun Aug 26 02:41:55 2007 From: mvyver at gmail.com (Mark Van De Vyver) Date: Sun, 26 Aug 2007 16:41:55 +1000 Subject: [Nitro] OG vs some other ORM packages Message-ID: <389c43e40708252341r1c3f7870y6e587bbb8a353913@mail.gmail.com> Hi, I'd appreciate any comments on my understanding of the approaches used to implement ORM, and whether my understanding of which Ruby packages do what is correct. Also, please shout if I've missed some relevant package(s). What would be really interesting is for anyone familiar enough with a package to say: "Their approach to XYZ is great/bad". For example: I think the OG approach of using graph theoretic concepts to 'map' Ruby objects to dbs is 'great' and offers enormous amounts of head room, this might be enhanced by exploiting the Gratr package.... ;) I wanted to see what approaches different packages took and see if any had any really 'neat' ideas. In some cases I've shown in parentheses somethings I found interesting (+) from a very superficial look at the packages. The list of Ruby packages I looked at came from the links below. Not all of these packages are listed by me, so I may have missed some important one(s). http://rubyforge.org/softwaremap/trove_list.php?form_cat=66&page=5 http://raa.ruby-lang.org/cat.rhtml?category_major=Library;category_minor=Database It seems that two ORM approaches are to: - "Wrap" Ruby objects around existing database elements - "Map" Ruby objects to databases elements. Often it seems that 'Map' is the term used to describe both approaches. Anyway: Wrapper: ======= ActiveRecord Momomoto (PostgreSQL, +InformationSchema, +stored procedures) Kansas (DBI) sequel Mapper: ======= Lafcadio Vapor (postgresql only) ObjectDB (dbi) odba (dbi) sqlyzer (dbi) sop (dbi) Mapper and wrapper: ================= OG Lafcadio (?) Misc/Uncertain: ============= tapkit Merbs' DataMapper sqldsl Ruby/OpenBase dbdiff Enum Column Plugin For Rails sql-serialize ActiveSearch Rural ActiveRecord::Extensions SqlStatement Visualize Models Regards Mark From william.full.moon at gmail.com Sun Aug 26 06:04:28 2007 From: william.full.moon at gmail.com (* William) Date: Sun, 26 Aug 2007 20:04:28 +1000 Subject: [Nitro] Nitro In-Reply-To: References: <46D014A1.1020808@tastapod.com> Message-ID: <008001c7e7c8$80951d80$0401a8c0@ghostgum> Ditto dan's comment _____ From: nitro-general-bounces at rubyforge.org [mailto:nitro-general-bounces at rubyforge.org] On Behalf Of George Moschovitis Sent: Sunday, 26 August 2007 04:04 To: General discussion about Nitro Subject: Re: [Nitro] Nitro Importance: Low I've said this before and I still stand by it: I get nitro. It works the way I want to work. Rails just doesn't. I want to start small and grow into an ..Keep up the great work George, Dan Thank you, this is very encouraging. I am kind of putting my ass in the line by using Nitro on such important projects and it is nice to hear that other people are planning to use it and (hopefully) help to make it as robust as possible. thanks, George. -- HYPERLINK "http://www.me.gr"http://www.me.gr HYPERLINK "http://phidz.com"http://phidz.com HYPERLINK "http://blog.gmosx.com"http://blog.gmosx.com HYPERLINK "http://cull.gr"http://cull.gr HYPERLINK "http://www.joy.gr"http://www.joy.gr HYPERLINK "http://nitroproject.org"http://nitroproject.org No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.484 / Virus Database: 269.12.8/973 - Release Date: 25-Aug-2007 17:00 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/nitro-general/attachments/20070826/51a396f0/attachment.html From wyhaines at gmail.com Sun Aug 26 10:12:02 2007 From: wyhaines at gmail.com (Kirk Haines) Date: Sun, 26 Aug 2007 07:12:02 -0700 Subject: [Nitro] OG vs some other ORM packages In-Reply-To: <389c43e40708252341r1c3f7870y6e587bbb8a353913@mail.gmail.com> References: <389c43e40708252341r1c3f7870y6e587bbb8a353913@mail.gmail.com> Message-ID: On 8/25/07, Mark Van De Vyver wrote: > Kansas (DBI) Kansas is my baby. It's been around for a long time and is basically quite stable. It uses DBI for the underlying db connectivity instead of reinventing the wheel there. It takes the approach of creating Ruby classes that correspond to database tables, and it tries to be fairly lightweight. The code is not particularly large. It uses Ruby syntax to describe queries: sodiums = dbh.select(:Chemicals) {|c| c.name =~ '%sodium%'} critical_issues = dbh.select(:Roofs) {|r| r.sort_by(r.severity => 'DESC'); r.severity > 3} It has transaction support that is not dependent on the database layer. Queries can return results in normal ruby types such as an Array or Hash instead of the db-coupled Kansas result types. The db-coupled objects can also be marked as read-only, so that changes to them do not get propagated back to the db. It supports creating relationships between tables, for conveniences like: school = dbh.select(:Schools) {|s| s.name = school_we_are_looking_for }.first school_cyanides = school.inventory.select {|i| i.name =~ /cyanide/} art_inventory = school.departments.select {|d| d.name == 'Art'}.chemicals That's a basic high level view. I have used it on dozens and dozens of sites over the years, and it just works. I have a small community of users, and insufficient documentation, but it is in daily, active use, if not daily, active development. Kirk Haines From john at oxyliquit.de Sun Aug 26 20:20:09 2007 From: john at oxyliquit.de (Jonathan Buch) Date: Mon, 27 Aug 2007 02:20:09 +0200 Subject: [Nitro] Nitro In-Reply-To: References: Message-ID: Hi, >> the nitro way and smells as good as Nitro. >> > But this smells to me like the situation with Compiz + Beryl: unnecessary > duplication of efforts. Ah no, imo it has enough differences to have a reason to exist. Nitro was allways a little more.. 'opaque' to me opposed to Og, also because Og produced more problems and so needed more code reading. ;) Hackability is a big plus for me, I have commit rights to the public repo, structure is a little less opaque, some things are way more modular (like pluggable Logger classes/caches/cache backends), it's smaller, the test/spec-suite is always green (there's even a tutorial which gets tested by RSpec, that gets geek points). There's stuff which is impractical/impossible with it, like streaming data. Caching is a little lacking too. If one wanted that, REST is not included, feature wise it only has stuff which the current users care about (which are very few) and there's no support for any ORM. Nitro is feature wise still on top. In fact, I use the FormHelper from Nitro to power Og, even within my current projects. So, I still wholeheartedly recommend Nitro to anyone I meet, it always depends on what you need. I would recommend Rails to someone who is searching for something which has most business backing and IOWA to someone caring about the highest speed. Hope that helps explaining my state of mind. :) Jo -- Feel the love http://pinkjuice.com/pics/ruby.png From george.moschovitis at gmail.com Mon Aug 27 11:29:53 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Mon, 27 Aug 2007 18:29:53 +0300 Subject: [Nitro] Nitro In-Reply-To: References: Message-ID: > > structure is a little less opaque, some things are way more modular > (like pluggable Logger classes/caches/cache backends), Nitro is totally modular in this respect too... but anw, I get your point. -g. -- http://www.me.gr http://phidz.com 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/20070827/903c662e/attachment.html From transfire at gmail.com Mon Aug 27 11:31:20 2007 From: transfire at gmail.com (Trans) Date: Mon, 27 Aug 2007 15:31:20 -0000 Subject: [Nitro] Aspects In-Reply-To: <1188093863.651665.98980@r34g2000hsd.googlegroups.com> References: <1187969361.601995.195500@q5g2000prf.googlegroups.com> <1188071754.562666.319290@r34g2000hsd.googlegroups.com> <1188093863.651665.98980@r34g2000hsd.googlegroups.com> Message-ID: <1188228680.122408.39990@19g2000hsx.googlegroups.com> On Aug 25, 7:04 pm, Trans wrote: > On Aug 25, 12:55 pm, Trans wrote: > > > > > On Aug 25, 11:01 am, "George Moschovitis" > > > wrote: > > > > The difficulty comes when the methods do not already exist. > > > > yeap, this is the problem. My version (included in the repository code) > > > handles this > > > my using a mandatory call to Aspects.setup after all dynamic methods are > > > defined. > > > But I think there are still some bugs (for example on bug reported earlier > > > in this week). > > > You're using this for Og models, right? Are you using it for Nitro > > controllers too? Anywhere else? > > > I don't 100% understand the design btw. Could you explain > > what :on, :where, :only, :except, and :join options do? > > > > I tried to use the version from facets but I had some problems. Tomorrow I > > > will review > > > my version and the code from facets, and I will be in better position to > > > help you with this. > > > > > method_missing. (Basically imagine every method call being routed via > > > > method_missing). > > > > this sounds *awfull* to me! > > > He he. Well, it's not *that* bad! The nice things is that it's 100% > > dynamic. No fuss with included or method_added, which can be easy to > > break. > > > In any case, for the time being it's probably best just to fix and > > improve your lib. It doesn't needs to be an all or nothing affair. I > > think there's room for both approaches in the library. I can add mine > > as a separate lib, and over time we can see how they fair/work > > together/cross-pollinate/etc. > > > I have to go now, but let compare notes tomorrow. > > I thought about this some more and I think you are right that dynamic > dispatch, as I suggested it, is too inefficient in itself. But I > realized that it would be possible to add an advice cache, and trigger > the appropriate parts of the cache be recalculated when certain > changes occur (method added, aspect added, etc). So then it would be > quite efficient, in fact it amounts effectively that same basic design > as yours. > > There's also another part of this. I have a joinpoint model I really > like, which is completely flexible. I'd like to use that, and then > layer your pre, post, around methods on top of that. I pretty > confident that would be a great design. And the we can have one lib > that satisfies us both. Reconsidered. My cut based AOP is looking good. But I think pre, post and around method filters don't need to be strapped to such a "major" AOP system. So I'd like to focus on your lib. Do you have any time to work on this today, George? T. From james.britt at gmail.com Mon Aug 27 13:45:49 2007 From: james.britt at gmail.com (James Britt) Date: Mon, 27 Aug 2007 10:45:49 -0700 Subject: [Nitro] Nitro In-Reply-To: References: Message-ID: <46D30DCD.6080509@gmail.com> George Moschovitis wrote: > Out of couriosity... > > is anyone using (or plans to use) Nitro? Or are you all just interested > in Og? Ruby-doc.org is still powered by Nitro. I'm slowly planning a re-do to fix assorted annoyances. I'll probably want to use 0.50 for it. I'd really like to change who the API docs are served up, something that allows better searching and commenting and cleaner presentation of core and stdlib and mixins while not making folks know in advance ht to look for. -- James Britt http://www.rubyaz.org - Hacking in the Desert http://www.jamesbritt.com - Playing with Better Toys From billk at cts.com Mon Aug 27 14:46:59 2007 From: billk at cts.com (Bill Kelly) Date: Mon, 27 Aug 2007 11:46:59 -0700 Subject: [Nitro] Latest darcs pull gives errors on postgresql Message-ID: <038801c7e8da$a714eef0$6442a8c0@musicbox> Hi, After doing a darcs pull, my Nitro app now gets the following error: DEBUG: SELECT nextval('"ogproduct"_oid_seq') ERROR: DB error ERROR: invalid name syntax , [SELECT nextval('"ogproduct"_oid_seq')] It's happening in: og/lib/og/adapter/postgresql.rb def insert(klass, inserts) next_oid = nil if !inserts[klass.primary_key] || inserts[klass.primary_key] == "NULL" if seq = klass.ann(klass.primary_key, :sequence) # ^^^^^^^^^^^^^^^^ seq looks like `"ogproduct"_oid_seq'` here next_oid = Integer(query("SELECT nextval('#{seq}')").first_value) inserts[klass.primary_key] = write_attr(next_oid, :class => Integer) end end super return next_oid end I saw a patch related to table name quoting, so I guess this is related? Regards, Bill From george.moschovitis at gmail.com Mon Aug 27 15:39:15 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Mon, 27 Aug 2007 22:39:15 +0300 Subject: [Nitro] Aspects In-Reply-To: <1188228680.122408.39990@19g2000hsx.googlegroups.com> References: <1187969361.601995.195500@q5g2000prf.googlegroups.com> <1188071754.562666.319290@r34g2000hsd.googlegroups.com> <1188093863.651665.98980@r34g2000hsd.googlegroups.com> <1188228680.122408.39990@19g2000hsx.googlegroups.com> Message-ID: > > So I'd like to focus on your lib. Do you have any time to > work on this today, George? I can find some time. You want to start from the code in glue/aspects.rb ?? -g. -- http://www.me.gr http://phidz.com 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/20070827/b299c47a/attachment.html From george.moschovitis at gmail.com Mon Aug 27 15:40:03 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Mon, 27 Aug 2007 22:40:03 +0300 Subject: [Nitro] Latest darcs pull gives errors on postgresql In-Reply-To: <038801c7e8da$a714eef0$6442a8c0@musicbox> References: <038801c7e8da$a714eef0$6442a8c0@musicbox> Message-ID: > > I saw a patch related to table name quoting, so I guess this > is related? > Yeap, this is related. Jonathan, is it possible that you have a look at this? -g. -- http://www.me.gr http://phidz.com 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/20070827/92e43722/attachment-0001.html From transfire at gmail.com Mon Aug 27 15:49:51 2007 From: transfire at gmail.com (Trans) Date: Mon, 27 Aug 2007 19:49:51 -0000 Subject: [Nitro] Aspects In-Reply-To: References: <1187969361.601995.195500@q5g2000prf.googlegroups.com> <1188071754.562666.319290@r34g2000hsd.googlegroups.com> <1188093863.651665.98980@r34g2000hsd.googlegroups.com> <1188228680.122408.39990@19g2000hsx.googlegroups.com> Message-ID: <1188244191.623248.112470@57g2000hsv.googlegroups.com> On Aug 27, 12:39 pm, "George Moschovitis" wrote: > > So I'd like to focus on your lib. Do you have any time to > > work on this today, George? > > I can find some time. You want to start from the code in glue/aspects.rb ?? Okay. I'll have a look. t. From transfire at gmail.com Mon Aug 27 17:27:23 2007 From: transfire at gmail.com (Trans) Date: Mon, 27 Aug 2007 21:27:23 -0000 Subject: [Nitro] Aspects In-Reply-To: References: <1187969361.601995.195500@q5g2000prf.googlegroups.com> <1188071754.562666.319290@r34g2000hsd.googlegroups.com> <1188093863.651665.98980@r34g2000hsd.googlegroups.com> <1188228680.122408.39990@19g2000hsx.googlegroups.com> Message-ID: <1188250043.795585.43290@o80g2000hse.googlegroups.com> On Aug 27, 12:39 pm, "George Moschovitis" wrote: > > So I'd like to focus on your lib. Do you have any time to > > work on this today, George? > > I can find some time. You want to start from the code in glue/aspects.rb ?? I took a look at the code. Good thing is that it's very neatly written and easy to understand. Koodos there. On the downside though this implementation is a less efficient. For one thing, iteration over all of ObjectSpace should never be needed. I don't mind keeping it in there as a just in case fallback, but nothing more. But the main thing is that, wrapping by means of instance_method(name).bind(self).call is very slow. Also, as you surely know, it's too static and won't catch some dynamic class changes. I'd suggest instead of using the bind technique, that we just define special name:original, name:before, name:after and name:around methods (literally). Which look something like: alias name:original, name def name(args) name:before(args) name:original(args) name:after(args) end def name:before(args) advices_before[name].each do |advice| advice.call(args) end end def name:after(args) advices_after[name].each do |advice| advice.call(args) end end The around advice is little more difficult (or we can just use a before and an after together?). Doing it that way, we can update advice, on a per method basis, and not worry about re-wrapping methods, and whatnot. Sound good? Shall I implement? T. From billk at cts.com Mon Aug 27 18:25:34 2007 From: billk at cts.com (Bill Kelly) Date: Mon, 27 Aug 2007 15:25:34 -0700 Subject: [Nitro] Latest darcs pull gives errors on postgresql References: <038801c7e8da$a714eef0$6442a8c0@musicbox> Message-ID: <006a01c7e8f9$2fcfd980$6442a8c0@musicbox> From: George Moschovitis > > > I saw a patch related to table name quoting, so I guess this > > is related? > > Yeap, this is related. Jonathan, is it possible that you have a look at this? For what it's worth, I was able to kludge around the problem by adding the following line to #enchant in og/lib/og/adapter/postgresql.rb: def enchant(klass, manager) super pk = klass.primary_key seq = "#{klass::OGTABLE}_#{pk}_seq" seq.tr!('"', '') ####### <-- ADDED THIS LINE to strip quotes on table name pkann = klass.ann(pk) unless pkann[:sequence] if pkann[:sql] =~ /SERIAL/i klass.ann(pk, {:sequence => seq}) else klass.ann(pk, {:sequence => false}) end end end Regards, Bill From george.moschovitis at gmail.com Tue Aug 28 01:28:03 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Tue, 28 Aug 2007 08:28:03 +0300 Subject: [Nitro] Aspects In-Reply-To: <1188250043.795585.43290@o80g2000hse.googlegroups.com> References: <1187969361.601995.195500@q5g2000prf.googlegroups.com> <1188071754.562666.319290@r34g2000hsd.googlegroups.com> <1188093863.651665.98980@r34g2000hsd.googlegroups.com> <1188228680.122408.39990@19g2000hsx.googlegroups.com> <1188250043.795585.43290@o80g2000hse.googlegroups.com> Message-ID: >From a quick look, your suggestion seems easy to understand, I cannot see any problem either. I agree with removing the ObjectSpace traversal (I hear it has problems with JRuby as well) The around advice is little more difficult (or we can just use a > before and an after together?). using before/after together is difficult to pass state from before to after. Sound good? Shall I implement? yeap, when you have something ready, post to this list, and I will review and make suggestions and/or improvements. thanks, -g. -- http://www.me.gr http://phidz.com 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/20070828/59c0f1d3/attachment.html From george.moschovitis at gmail.com Tue Aug 28 01:28:35 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Tue, 28 Aug 2007 08:28:35 +0300 Subject: [Nitro] Aspects In-Reply-To: References: <1187969361.601995.195500@q5g2000prf.googlegroups.com> <1188071754.562666.319290@r34g2000hsd.googlegroups.com> <1188093863.651665.98980@r34g2000hsd.googlegroups.com> <1188228680.122408.39990@19g2000hsx.googlegroups.com> <1188250043.795585.43290@o80g2000hse.googlegroups.com> Message-ID: Btw, how will we handle wrapping of dynamically generated methods? -g. On 8/28/07, George Moschovitis wrote: > > > From a quick look, your suggestion seems easy to understand, I cannot see > any problem either. I agree with removing the ObjectSpace traversal (I hear > it has problems with JRuby as well) > > The around advice is little more difficult (or we can just use a > > before and an after together?). > > > using before/after together is difficult to pass state from before to > after. > > > Sound good? Shall I implement? > > > yeap, when you have something ready, post to this list, and I will review > and make suggestions and/or improvements. > > thanks, > -g. > > > > -- > http://www.me.gr > http://phidz.com > http://blog.gmosx.com > http://cull.gr > http://www.joy.gr > http://nitroproject.org > -- http://www.me.gr http://phidz.com 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/20070828/c21b34ab/attachment.html From mvyver at gmail.com Tue Aug 28 02:50:29 2007 From: mvyver at gmail.com (Mark Van De Vyver) Date: Tue, 28 Aug 2007 16:50:29 +1000 Subject: [Nitro] OG and ruby-dbi Message-ID: <389c43e40708272350v10a060e8k7f6f9df886c45eec@mail.gmail.com> Hi, As a exercise in 'cutting-my-teeth', I thought to try and implement a DBI adapter for OG. Googling the nitro mail-list archive showed one previous question about this and it didn't suggest that this is 'impossible'/fraught with difficulty - is this still the case? Of course this may be redundant, but my main goal is to get to know OG/Ruby/ORM etc. I noticed the test folder in OG is relatively sparse, and I was intending to try and use R-spec as I went along.... I'll be looking at how other projects have used DBI (and have already seen some tips), but I'd appreciate an opportunity to ask questions/get advice. A couple of questions. Which is the most active/preferred communication forum, the mail-list or the freenode irc channel? (I'm in Sydney,Oz so that might rule irc out, but I have ome flexibility in my work hours) Any objections/gotchas to using R-spec to do the specs/BDD with OG? I'd appreciate any assistance/advice :) Regards Mark From transfire at gmail.com Tue Aug 28 11:26:27 2007 From: transfire at gmail.com (Trans) Date: Tue, 28 Aug 2007 15:26:27 -0000 Subject: [Nitro] Aspects In-Reply-To: References: <1187969361.601995.195500@q5g2000prf.googlegroups.com> <1188071754.562666.319290@r34g2000hsd.googlegroups.com> <1188093863.651665.98980@r34g2000hsd.googlegroups.com> <1188228680.122408.39990@19g2000hsx.googlegroups.com> <1188250043.795585.43290@o80g2000hse.googlegroups.com> Message-ID: <1188314787.091049.162930@w3g2000hsg.googlegroups.com> On Aug 27, 10:28 pm, "George Moschovitis" wrote: > Btw, how will we handle wrapping of dynamically generated methods? Nice thing about this design is that we don't need to do any re- wrapping, so we can easily trigger off the method_added callback and generate the advice specific to the added method without difficulty. We will also need to watch the included callback too btw -- ideally we would generate the advice based solely on the methods defined in the module. And very cool, if we want we can define method_added such that it is advised too, basically: def method_added(m) send(:"method_added:before", m) send(:"method_added:original", m) send(:"method_added:after", m) end One would never have to worry about overwriting someone else method_added (and forgetting to call super), if they just used advice for it instead. T. From transfire at gmail.com Tue Aug 28 14:26:27 2007 From: transfire at gmail.com (Trans) Date: Tue, 28 Aug 2007 18:26:27 -0000 Subject: [Nitro] Aspects In-Reply-To: References: <1187969361.601995.195500@q5g2000prf.googlegroups.com> <1188071754.562666.319290@r34g2000hsd.googlegroups.com> <1188093863.651665.98980@r34g2000hsd.googlegroups.com> <1188228680.122408.39990@19g2000hsx.googlegroups.com> <1188250043.795585.43290@o80g2000hse.googlegroups.com> Message-ID: <1188325587.907262.313400@k79g2000hse.googlegroups.com> What should this do? class X before :x do print "BEFORE:" end def x puts "x" end end X.new.x #=> BEFORE:x class Y < X def x puts "y" end end Y.new.x #=> ? Should it be 'BEFORE:y' or just 'y' b/c Y#x overrides everything in X? T. From dan at tastapod.com Tue Aug 28 16:06:52 2007 From: dan at tastapod.com (Dan North) Date: Tue, 28 Aug 2007 21:06:52 +0100 Subject: [Nitro] OG and ruby-dbi In-Reply-To: <389c43e40708272350v10a060e8k7f6f9df886c45eec@mail.gmail.com> References: <389c43e40708272350v10a060e8k7f6f9df886c45eec@mail.gmail.com> Message-ID: <46D4805C.4000902@tastapod.com> Hi Mark. I'm a committer on rspec, and I'll be happy to help you to use rspec to describe nitro/og behaviour (either via this list or directly). Also, the rspec community itself is very helpful and responsive (mail lists at http://rubyforge.org/mail/?group_id=797). Cheers, Dan Mark Van De Vyver wrote: > Hi, > As a exercise in 'cutting-my-teeth', I thought to try and implement a > DBI adapter for OG. Googling the nitro mail-list archive showed one > previous question about this and it didn't suggest that this is > 'impossible'/fraught with difficulty - is this still the case? > Of course this may be redundant, but my main goal is to get to know > OG/Ruby/ORM etc. > > I noticed the test folder in OG is relatively sparse, and I was > intending to try and use R-spec as I went along.... > > I'll be looking at how other projects have used DBI (and have already > seen some tips), but I'd appreciate an opportunity to ask > questions/get advice. > > A couple of questions. > Which is the most active/preferred communication forum, the mail-list > or the freenode irc channel? (I'm in Sydney,Oz so that might rule irc > out, but I have ome flexibility in my work hours) > Any objections/gotchas to using R-spec to do the specs/BDD with OG? > > I'd appreciate any assistance/advice :) > > Regards > Mark > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > From john at oxyliquit.de Tue Aug 28 17:49:39 2007 From: john at oxyliquit.de (Jonathan Buch) Date: Tue, 28 Aug 2007 23:49:39 +0200 Subject: [Nitro] OG and ruby-dbi In-Reply-To: <389c43e40708272350v10a060e8k7f6f9df886c45eec@mail.gmail.com> References: <389c43e40708272350v10a060e8k7f6f9df886c45eec@mail.gmail.com> Message-ID: Hi, > As a exercise in 'cutting-my-teeth', I thought to try and implement a > DBI adapter for OG. Googling the nitro mail-list archive showed one > previous question about this and it didn't suggest that this is > 'impossible'/fraught with difficulty - is this still the case? > Of course this may be redundant, but my main goal is to get to know > OG/Ruby/ORM etc. a worthy goal, nice. ^_^ It is quite doable, and without that much effort actually, the 'needed' interface is quite easy. Best would be to look inside either the Postgresql or Oracle adapters, those have the most 'overrides'. > I noticed the test folder in OG is relatively sparse, and I was > intending to try and use R-spec as I went along.... The test folder should even be non-existant. The spec/ folder is the new 'home'. :) Do `rake test og` inside the nitro project dir to test the og rspecs. > I'll be looking at how other projects have used DBI (and have already > seen some tips), but I'd appreciate an opportunity to ask > questions/get advice. Sure, I'll sure try to help if you run into troubles implementing that. Don't hesitate to ask. :) > A couple of questions. > Which is the most active/preferred communication forum, the mail-list > or the freenode irc channel? (I'm in Sydney,Oz so that might rule irc > out, but I have ome flexibility in my work hours) Both? If I'm present on IRC, this might be faster and thus preferred, but the ML is good of course. :) I'm 'Kashia' or 'Jo[work]' on IRC btw. > Any objections/gotchas to using R-spec to do the specs/BDD with OG? Just have a look inside one or two other specs for og, it's quite easy to use. Though, some specs are still failing, haven't gotten around to fix all of them yet. > I'd appreciate any assistance/advice :) Like I said, as a startingpoint I'd see the oracle/psql adapters. I would love the specs to be fixed... but a well. If you could run it once with mysql/psql and see what fails there, you should still be able to use the testsuite for validation purposes. Jo -- Feel the love http://pinkjuice.com/pics/ruby.png From john at oxyliquit.de Tue Aug 28 17:49:38 2007 From: john at oxyliquit.de (Jonathan Buch) Date: Tue, 28 Aug 2007 23:49:38 +0200 Subject: [Nitro] Latest darcs pull gives errors on postgresql In-Reply-To: <006a01c7e8f9$2fcfd980$6442a8c0@musicbox> References: <038801c7e8da$a714eef0$6442a8c0@musicbox> <006a01c7e8f9$2fcfd980$6442a8c0@musicbox> Message-ID: Hi, >> > I saw a patch related to table name quoting, so I guess this >> > is related? >> >> Yeap, this is related. Jonathan, is it possible that you have a look at this? I haven't looked at the quoting at all, so I'd have to read the whole lot first. > For what it's worth, I was able to kludge around the problem by adding > the following line to #enchant in og/lib/og/adapter/postgresql.rb: > > seq.tr!('"', '') ####### <-- ADDED THIS LINE to strip quotes on table name This is smelly. :/ Is it assured that the klass::OGTABLE _always_ has quotes G? If yes, just do klass::OGTABLE[1,-2] and not the .tr! Would be great if you could make a patch for that, thanks! Jo -- Feel the love http://pinkjuice.com/pics/ruby.png From john at oxyliquit.de Tue Aug 28 17:49:40 2007 From: john at oxyliquit.de (Jonathan Buch) Date: Tue, 28 Aug 2007 23:49:40 +0200 Subject: [Nitro] OG and ruby-dbi In-Reply-To: <46D4805C.4000902@tastapod.com> References: <389c43e40708272350v10a060e8k7f6f9df886c45eec@mail.gmail.com> <46D4805C.4000902@tastapod.com> Message-ID: Hi, > I'm a committer on rspec, and I'll be happy to help you to use rspec to > describe nitro/og behaviour (either via this list or directly). > > Also, the rspec community itself is very helpful and responsive (mail > lists at http://rubyforge.org/mail/?group_id=797). this is interesting. :D If I could give you a little task which might look a little daunting at first? I once wrote this humongous parameter handling Unit::Test for Nitro (which is sadly still incomplete though. :P) This should be converted to RSpec, but I used special/custom Test::Unit 'assertions' to make life easier there. Now my question, could you have a look inside that one and say if one could convert these assertions to valid and 'true to' rspec? If you could provide a 'buffer' so to speak, I could then just convert that huge file using your 'facilities'. :) Would be sweet if you'd be up for that, no pressure though. :) Jo -- Feel the love http://pinkjuice.com/pics/ruby.png From john at oxyliquit.de Tue Aug 28 17:49:41 2007 From: john at oxyliquit.de (Jonathan Buch) Date: Tue, 28 Aug 2007 23:49:41 +0200 Subject: [Nitro] Nitro In-Reply-To: References: Message-ID: Hi, >> structure is a little less opaque, some things are way more modular >> (like pluggable Logger classes/caches/cache backends), > > Nitro is totally modular in this respect too... > > but anw, I get your point. yes, modular, but very different. :) Jo -- Feel the love http://pinkjuice.com/pics/ruby.png From dan at tastapod.com Tue Aug 28 18:34:18 2007 From: dan at tastapod.com (Dan North) Date: Tue, 28 Aug 2007 23:34:18 +0100 Subject: [Nitro] OG and ruby-dbi In-Reply-To: References: <389c43e40708272350v10a060e8k7f6f9df886c45eec@mail.gmail.com> <46D4805C.4000902@tastapod.com> Message-ID: <46D4A2EA.1090907@tastapod.com> I'd prefer to answer specific questions to be honest, because I'm a bit swamped at the moment. Can you post fragments of the humungous testcase and I can see if I can help? Cheers, Dan Jonathan Buch wrote: > Hi, > > >> I'm a committer on rspec, and I'll be happy to help you to use rspec to >> describe nitro/og behaviour (either via this list or directly). >> >> Also, the rspec community itself is very helpful and responsive (mail >> lists at http://rubyforge.org/mail/?group_id=797). >> > > this is interesting. :D > > If I could give you a little task which might look a little daunting at > first? > I once wrote this humongous parameter handling Unit::Test for Nitro > (which is sadly still incomplete though. :P) This should be converted > to RSpec, but I used special/custom Test::Unit 'assertions' to make > life easier there. > Now my question, could you have a look inside that one and say if one > could convert these assertions to valid and 'true to' rspec? > If you could provide a 'buffer' so to speak, I could then just convert > that huge file using your 'facilities'. :) > > Would be sweet if you'd be up for that, no pressure though. :) > > Jo > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/nitro-general/attachments/20070828/3f3804d6/attachment.html From billk at cts.com Tue Aug 28 19:24:44 2007 From: billk at cts.com (Bill Kelly) Date: Tue, 28 Aug 2007 16:24:44 -0700 Subject: [Nitro] Latest darcs pull gives errors on postgresql References: <038801c7e8da$a714eef0$6442a8c0@musicbox><006a01c7e8f9$2fcfd980$6442a8c0@musicbox> Message-ID: <028401c7e9ca$9e43af50$6442a8c0@musicbox> From: "Jonathan Buch" > >>> > I saw a patch related to table name quoting, so I guess this >>> > is related? >>> >>> Yeap, this is related. Jonathan, is it possible that you have a look at this? > > I haven't looked at the quoting at all, so I'd have to read the whole > lot first. > >> For what it's worth, I was able to kludge around the problem by adding >> the following line to #enchant in og/lib/og/adapter/postgresql.rb: >> >> seq.tr!('"', '') ####### <-- ADDED THIS LINE to strip quotes on table name > > This is smelly. :/ Duh :) That's why I didn't submit it in patch/diff form. ;) By "for what it's worth", i meant, on the chance that it may help to illustrate a particular point in the code where the issue manifested. Regards, Bill From mvyver at gmail.com Tue Aug 28 19:39:56 2007 From: mvyver at gmail.com (Mark Van De Vyver) Date: Wed, 29 Aug 2007 09:39:56 +1000 Subject: [Nitro] OG and ruby-dbi In-Reply-To: <46D4805C.4000902@tastapod.com> References: <389c43e40708272350v10a060e8k7f6f9df886c45eec@mail.gmail.com> <46D4805C.4000902@tastapod.com> Message-ID: <389c43e40708281639h5ff09fd0r7a1902818e16fe30@mail.gmail.com> Hi Dan, > > I'm a committer on rspec, and I'll be happy to help you to use rspec to > describe nitro/og behaviour (either via this list or directly). > > Also, the rspec community itself is very helpful and responsive (mail > lists at http://rubyforge.org/mail/?group_id=797). Thanks for the kind offer, no doubt I'll take you up on it at some point. On irc I'm hedge-hog Cheers Mark > Cheers, > Dan > > Mark Van De Vyver wrote: > > Hi, > > As a exercise in 'cutting-my-teeth', I thought to try and implement a > > DBI adapter for OG. Googling the nitro mail-list archive showed one > > previous question about this and it didn't suggest that this is > > 'impossible'/fraught with difficulty - is this still the case? > > Of course this may be redundant, but my main goal is to get to know > > OG/Ruby/ORM etc. > > > > I noticed the test folder in OG is relatively sparse, and I was > > intending to try and use R-spec as I went along.... > > > > I'll be looking at how other projects have used DBI (and have already > > seen some tips), but I'd appreciate an opportunity to ask > > questions/get advice. > > > > A couple of questions. > > Which is the most active/preferred communication forum, the mail-list > > or the freenode irc channel? (I'm in Sydney,Oz so that might rule irc > > out, but I have ome flexibility in my work hours) > > Any objections/gotchas to using R-spec to do the specs/BDD with OG? > > > > I'd appreciate any assistance/advice :) > > > > Regards > > Mark > > _______________________________________________ > > Nitro-general mailing list > > Nitro-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/nitro-general > > > > From billk at cts.com Tue Aug 28 20:05:03 2007 From: billk at cts.com (Bill Kelly) Date: Tue, 28 Aug 2007 17:05:03 -0700 Subject: [Nitro] Latest darcs pull gives errors on postgresql References: <038801c7e8da$a714eef0$6442a8c0@musicbox><006a01c7e8f9$2fcfd980$6442a8c0@musicbox> <028401c7e9ca$9e43af50$6442a8c0@musicbox> Message-ID: <02a501c7e9d0$3fe54d50$6442a8c0@musicbox> From: "Bill Kelly" > > From: "Jonathan Buch" >> >>>> > I saw a patch related to table name quoting, so I guess this >>>> > is related? >>>> >>>> Yeap, this is related. Jonathan, is it possible that you have a look at this? >> >> I haven't looked at the quoting at all, so I'd have to read the whole >> lot first. >> >>> For what it's worth, I was able to kludge around the problem by adding >>> the following line to #enchant in og/lib/og/adapter/postgresql.rb: >>> >>> seq.tr!('"', '') ####### <-- ADDED THIS LINE to strip quotes on table name >> >> This is smelly. :/ > > Duh :) > > > That's why I didn't submit it in patch/diff form. ;) > > > By "for what it's worth", i meant, on the chance that it may help > to illustrate a particular point in the code where the issue > manifested. Sorry, didn't mean to get defensive. O:-) Regards, Bill From john at oxyliquit.de Tue Aug 28 21:11:23 2007 From: john at oxyliquit.de (Jonathan Buch) Date: Wed, 29 Aug 2007 03:11:23 +0200 Subject: [Nitro] Latest darcs pull gives errors on postgresql In-Reply-To: <028401c7e9ca$9e43af50$6442a8c0@musicbox> References: <038801c7e8da$a714eef0$6442a8c0@musicbox> <006a01c7e8f9$2fcfd980$6442a8c0@musicbox> <028401c7e9ca$9e43af50$6442a8c0@musicbox> Message-ID: Hi, >> This is smelly. :/ > > Duh :) > > That's why I didn't submit it in patch/diff form. ;) > > > By "for what it's worth", i meant, on the chance that it may help > to illustrate a particular point in the code where the issue > manifested. ah of course, my full 'train of thought' went somhow along these lines: huh... yes, problem, how fix, hrm, yes worked around, works, hrm, smells awful, how can do better, ask for specifics, present preliminary slightly less smelly alternative. My posting is a little 'impulsive' sometimes, I will however apologize if I realize I offended someone gravely. ;) Jo -- Feel the love http://pinkjuice.com/pics/ruby.png From john at oxyliquit.de Tue Aug 28 21:11:21 2007 From: john at oxyliquit.de (Jonathan Buch) Date: Wed, 29 Aug 2007 03:11:21 +0200 Subject: [Nitro] OG and ruby-dbi In-Reply-To: <46D4A2EA.1090907@tastapod.com> References: <389c43e40708272350v10a060e8k7f6f9df886c45eec@mail.gmail.com> <46D4805C.4000902@tastapod.com> <46D4A2EA.1090907@tastapod.com> Message-ID: Hi, > I'd prefer to answer specific questions to be honest, because I'm a bit > swamped at the moment. Can you post fragments of the humungous testcase > and I can see if I can help? ah of course, sorry. :) Example assertion: def assert_request_good(url, value, message = nil) result = handle_request(url, value) message = build_message(message, " returned error. \nResult: ?\nInstead of: ?", url, result, value) assert_block message do if result =~ /error/ false else cmp(value, eval(result)) end end end Example usage: def test_mixed tests = { '/single/foo?first=one&second=two' => { :action => :single, :params => {'first' => 'one', 'second' => 'two'}, :arguments => ['foo'] } } tests.each do |url, value| assert_request_good url, value end end That's basically it, it's a huge amount of tests, all using the assert_request_good / assert_request_bad methods. Now those would somehow have to be 'specified' or removed, depending on how that stuff would be best handled by RSpec. I hope that is more 'answerable'. :) Jo -- Feel the love http://pinkjuice.com/pics/ruby.png From billk at cts.com Tue Aug 28 23:20:35 2007 From: billk at cts.com (Bill Kelly) Date: Tue, 28 Aug 2007 20:20:35 -0700 Subject: [Nitro] Latest darcs pull gives errors on postgresql References: <038801c7e8da$a714eef0$6442a8c0@musicbox><006a01c7e8f9$2fcfd980$6442a8c0@musicbox><028401c7e9ca$9e43af50$6442a8c0@musicbox> Message-ID: <02f701c7e9eb$90a35c80$6442a8c0@musicbox> From: "Jonathan Buch" > > My posting is a little 'impulsive' sometimes, I will however apologize > if I realize I offended someone gravely. ;) :D Regards, Bill From george.moschovitis at gmail.com Wed Aug 29 00:23:40 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Wed, 29 Aug 2007 07:23:40 +0300 Subject: [Nitro] Aspects In-Reply-To: <1188325587.907262.313400@k79g2000hse.googlegroups.com> References: <1187969361.601995.195500@q5g2000prf.googlegroups.com> <1188071754.562666.319290@r34g2000hsd.googlegroups.com> <1188093863.651665.98980@r34g2000hsd.googlegroups.com> <1188228680.122408.39990@19g2000hsx.googlegroups.com> <1188250043.795585.43290@o80g2000hse.googlegroups.com> <1188325587.907262.313400@k79g2000hse.googlegroups.com> Message-ID: > > > Should it be 'BEFORE:y' or just 'y' b/c Y#x overrides everything in X? > I would say 'BEFORE:y' but I am not really sure. Which is easier to implement? -g. -- http://www.me.gr http://phidz.com 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/20070829/f0d397f5/attachment.html From mvyver at gmail.com Wed Aug 29 00:27:37 2007 From: mvyver at gmail.com (Mark Van De Vyver) Date: Wed, 29 Aug 2007 14:27:37 +1000 Subject: [Nitro] OG and ruby-dbi In-Reply-To: References: <389c43e40708272350v10a060e8k7f6f9df886c45eec@mail.gmail.com> Message-ID: <389c43e40708282127n3381f33l3e66d8b9c377f81f@mail.gmail.com> OK. Apologies in advance for the newbie issues. Here we go.... > The test folder should even be non-existant. The spec/ folder is the > new 'home'. :) > Do `rake test og` inside the nitro project dir to test the og rspecs. >From the following it may be that 'systemu' might be a required package - maybe not? Anyway, I can't get the rake test og to run. I've set up as described here: http://www.arnebrasseur.net/2007/07/01/the-daily-nitro/en/ # echo ${RUBYOPT} -r/usr/src/nitro-repo/script/lib/glycerin -rubygems # pushd /usr/src/nitro-repo/ /usr/src/nitro-repo ~ mv-laptop:/usr/src/nitro-repo # rake test og (in /usr/src/nitro-repo) Please install systemu for better-looking results rake aborted! Don't know how to build task 'test' (See full trace by running task with --trace) # rake --trace test og (in /usr/src/nitro-repo) Please install systemu for better-looking results rake aborted! Don't know how to build task 'test' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1472:in `[]' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `each' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in `standard_exception_handling' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1733:in `top_level' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1711:in `run' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in `standard_exception_handling' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1708:in `run' /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/bin/rake:7 /usr/bin/rake:16:in `load' /usr/bin/rake:16 Cheers MV > > I'll be looking at how other projects have used DBI (and have already > > seen some tips), but I'd appreciate an opportunity to ask > > questions/get advice. > > Sure, I'll sure try to help if you run into troubles implementing that. > Don't hesitate to ask. :) > > > A couple of questions. > > Which is the most active/preferred communication forum, the mail-list > > or the freenode irc channel? (I'm in Sydney,Oz so that might rule irc > > out, but I have ome flexibility in my work hours) > > Both? If I'm present on IRC, this might be faster and thus preferred, > but the ML is good of course. :) > I'm 'Kashia' or 'Jo[work]' on IRC btw. > > > Any objections/gotchas to using R-spec to do the specs/BDD with OG? > > Just have a look inside one or two other specs for og, it's quite easy > to use. Though, some specs are still failing, haven't gotten around to > fix all of them yet. > > > I'd appreciate any assistance/advice :) > > Like I said, as a startingpoint I'd see the oracle/psql adapters. I > would love the specs to be fixed... but a well. If you could run it > once with mysql/psql and see what fails there, you should still be > able to use the testsuite for validation purposes. > > Jo > > -- > Feel the love > http://pinkjuice.com/pics/ruby.png > From mvyver at gmail.com Wed Aug 29 01:36:07 2007 From: mvyver at gmail.com (Mark Van De Vyver) Date: Wed, 29 Aug 2007 15:36:07 +1000 Subject: [Nitro] OG and ruby-dbi In-Reply-To: <389c43e40708282127n3381f33l3e66d8b9c377f81f@mail.gmail.com> References: <389c43e40708272350v10a060e8k7f6f9df886c45eec@mail.gmail.com> <389c43e40708282127n3381f33l3e66d8b9c377f81f@mail.gmail.com> Message-ID: <389c43e40708282236l23a66afelc5652f86a3bb96a3@mail.gmail.com> Ok, got it: # rake test:og (in /usr/src/nitro-repo) Running sql... [ 1 specs - all passed ] 1 examples, 0 failures No failing examples, let's add some tests! :) On 8/29/07, Mark Van De Vyver wrote: > OK. Apologies in advance for the newbie issues. Here we go.... > > > The test folder should even be non-existant. The spec/ folder is the > > new 'home'. :) > > Do `rake test og` inside the nitro project dir to test the og rspecs. > > From the following it may be that 'systemu' might be a required > package - maybe not? > Anyway, I can't get the rake test og to run. > > I've set up as described here: > http://www.arnebrasseur.net/2007/07/01/the-daily-nitro/en/ > > # echo ${RUBYOPT} > -r/usr/src/nitro-repo/script/lib/glycerin -rubygems > > # pushd /usr/src/nitro-repo/ > /usr/src/nitro-repo ~ > mv-laptop:/usr/src/nitro-repo # rake test og > (in /usr/src/nitro-repo) > Please install systemu for better-looking results > rake aborted! > Don't know how to build task 'test' > > (See full trace by running task with --trace) > > # rake --trace test og > (in /usr/src/nitro-repo) > Please install systemu for better-looking results > rake aborted! > Don't know how to build task 'test' > /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1472:in `[]' > /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `top_level' > /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `each' > /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `top_level' > /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in > `standard_exception_handling' > /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1733:in `top_level' > /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1711:in `run' > /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in > `standard_exception_handling' > /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1708:in `run' > /usr/lib/ruby/gems/1.8/gems/rake-0.7.3/bin/rake:7 > /usr/bin/rake:16:in `load' > /usr/bin/rake:16 > > > Cheers > MV > > > > I'll be looking at how other projects have used DBI (and have already > > > seen some tips), but I'd appreciate an opportunity to ask > > > questions/get advice. > > > > Sure, I'll sure try to help if you run into troubles implementing that. > > Don't hesitate to ask. :) > > > > > A couple of questions. > > > Which is the most active/preferred communication forum, the mail-list > > > or the freenode irc channel? (I'm in Sydney,Oz so that might rule irc > > > out, but I have ome flexibility in my work hours) > > > > Both? If I'm present on IRC, this might be faster and thus preferred, > > but the ML is good of course. :) > > I'm 'Kashia' or 'Jo[work]' on IRC btw. > > > > > Any objections/gotchas to using R-spec to do the specs/BDD with OG? > > > > Just have a look inside one or two other specs for og, it's quite easy > > to use. Though, some specs are still failing, haven't gotten around to > > fix all of them yet. > > > > > I'd appreciate any assistance/advice :) > > > > Like I said, as a startingpoint I'd see the oracle/psql adapters. I > > would love the specs to be fixed... but a well. If you could run it > > once with mysql/psql and see what fails there, you should still be > > able to use the testsuite for validation purposes. > > > > Jo > > > > -- > > Feel the love > > http://pinkjuice.com/pics/ruby.png > > > From william.full.moon at gmail.com Wed Aug 29 02:19:12 2007 From: william.full.moon at gmail.com (* William) Date: Wed, 29 Aug 2007 16:19:12 +1000 Subject: [Nitro] Nitro In-Reply-To: References: Message-ID: <9e03c3c60708282319i17741d0cv6f8e96f27d71fca@mail.gmail.com> Hmmm ... Honestly I don't "believe" that modular it the distinguishing factor. Clear and Concise would be better terms. Lots of things can be "modular" with no functional benefit. Discrete and easy to understand would not require "modules". It is just nicer to package things in units (or containers). I think we see this a lot, a "buzz word" makes a statement and we tend to make it a description. Really, it is a label for a string of attributes that fit-well-with modular (or the particular buzz word). *grin* On 29/08/07, Jonathan Buch wrote: > > Hi, > > >> structure is a little less opaque, some things are way more modular > >> (like pluggable Logger classes/caches/cache backends), > > > > Nitro is totally modular in this respect too... > > > > but anw, I get your point. > > yes, modular, but very different. :) > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/nitro-general/attachments/20070829/e1e94e63/attachment.html From mvyver at gmail.com Wed Aug 29 04:28:58 2007 From: mvyver at gmail.com (Mark Van De Vyver) Date: Wed, 29 Aug 2007 18:28:58 +1000 Subject: [Nitro] OG and DBI: driver option name Message-ID: <389c43e40708290128t6261c48ajdf839c703403d87@mail.gmail.com> Hi, I'd appreciate any suggestions/comments on the following issue. In OG, adapters are specializations of a SQL store. DBI supports many database drivers. I suppose my issue is the blurring/overlap of adapters and drivers. So is DBI the adapter, or is DBIMySQL to be the adapter. A problem with the later approach is there will be as many DbiAdapter classes as dbi supports.... 13 from a current count. If I use a class DbiAdapter then it's initialize method would need to handle which 'flavor'/'backend'/'driver' (anyone suggest a 'correct' term to use) of dbi. This could not come from the current options[:adapter], because that should be 'dbi': That is in Adapter.for_name(:dbi) This suggests an additional option is needed if DBI is used. Any suggestion to improve on using :dbi_driver? Cheers Mark From george.moschovitis at gmail.com Wed Aug 29 08:49:13 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Wed, 29 Aug 2007 15:49:13 +0300 Subject: [Nitro] OG and DBI: driver option name In-Reply-To: <389c43e40708290128t6261c48ajdf839c703403d87@mail.gmail.com> References: <389c43e40708290128t6261c48ajdf839c703403d87@mail.gmail.com> Message-ID: > > So is DBI the adapter, or is DBIMySQL to be the adapter. A problem > with the later approach is there will be as many DbiAdapter > classes as dbi supports.... 13 from a current count. I would say that DBI is the adapter (a specialization of SQL store). However this specific adapter will be able to handle multiple rdbms. suggestion to improve on using :dbi_driver? > I think :dbi_driver is ok as a parameter name: Og.start( :name => "myapp", :adapter => :dbi, :dbi_driver => :mysql, :user => "root", :evolve_schema => :full # true ) -g. -- http://www.me.gr http://phidz.com 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/20070829/99e2dcec/attachment.html From transfire at gmail.com Wed Aug 29 08:56:40 2007 From: transfire at gmail.com (Trans) Date: Wed, 29 Aug 2007 12:56:40 -0000 Subject: [Nitro] Aspects In-Reply-To: References: <1187969361.601995.195500@q5g2000prf.googlegroups.com> <1188071754.562666.319290@r34g2000hsd.googlegroups.com> <1188093863.651665.98980@r34g2000hsd.googlegroups.com> <1188228680.122408.39990@19g2000hsx.googlegroups.com> <1188250043.795585.43290@o80g2000hse.googlegroups.com> <1188325587.907262.313400@k79g2000hse.googlegroups.com> Message-ID: <1188392200.409137.173050@g4g2000hsf.googlegroups.com> On Aug 28, 9:23 pm, "George Moschovitis" wrote: > > Should it be 'BEFORE:y' or just 'y' b/c Y#x overrides everything in X? > > I would say 'BEFORE:y' but I am not really sure. Which is easier to > implement? The later is easier. The difficulty with the 'BEFORE:y' is if #super is called. The method in class Y runs the advice and then the method in the superclass runs it again. So to do it, I have to figure out a way for it to only run once. T. From george.moschovitis at gmail.com Wed Aug 29 10:14:24 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Wed, 29 Aug 2007 17:14:24 +0300 Subject: [Nitro] Aspects In-Reply-To: <1188392200.409137.173050@g4g2000hsf.googlegroups.com> References: <1187969361.601995.195500@q5g2000prf.googlegroups.com> <1188093863.651665.98980@r34g2000hsd.googlegroups.com> <1188228680.122408.39990@19g2000hsx.googlegroups.com> <1188250043.795585.43290@o80g2000hse.googlegroups.com> <1188325587.907262.313400@k79g2000hse.googlegroups.com> <1188392200.409137.173050@g4g2000hsf.googlegroups.com> Message-ID: Lets go for the later then... -g. On 8/29/07, Trans wrote: > > > > On Aug 28, 9:23 pm, "George Moschovitis" > wrote: > > > Should it be 'BEFORE:y' or just 'y' b/c Y#x overrides everything in X? > > > > I would say 'BEFORE:y' but I am not really sure. Which is easier to > > implement? > > The later is easier. The difficulty with the 'BEFORE:y' is if #super > is called. The method in class Y runs the advice and then the method > in the superclass runs it again. So to do it, I have to figure out a > way for it to only run once. > > T. > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.me.gr http://phidz.com 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/20070829/7dfd81b9/attachment.html From transfire at gmail.com Wed Aug 29 13:28:48 2007 From: transfire at gmail.com (Trans) Date: Wed, 29 Aug 2007 17:28:48 -0000 Subject: [Nitro] Aspects In-Reply-To: References: <1187969361.601995.195500@q5g2000prf.googlegroups.com> <1188093863.651665.98980@r34g2000hsd.googlegroups.com> <1188228680.122408.39990@19g2000hsx.googlegroups.com> <1188250043.795585.43290@o80g2000hse.googlegroups.com> <1188325587.907262.313400@k79g2000hse.googlegroups.com> <1188392200.409137.173050@g4g2000hsf.googlegroups.com> Message-ID: <1188408528.318463.192760@r34g2000hsd.googlegroups.com> On Aug 29, 7:14 am, "George Moschovitis" wrote: > Lets go for the later then... I got it to work either way. So lets decide based on what is the most desirable behavior. Consider carefully the difference. BEFORE:Y#x Y#x BEFORE:X#x X#x AFTER:X#x AFTER:Y#x vs. BEFORE:Y#x BEFORE:X#x Y#x X#x AFTER:X#x AFTER:Y#x The 1st is analogous to sub-classing, so it's perhaps the most obvious. However, is what Matz seems to have in mind for his :before and :after decorators which are modeled after CLOS. See http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/85464. T. From billk at cts.com Wed Aug 29 20:14:37 2007 From: billk at cts.com (Bill Kelly) Date: Wed, 29 Aug 2007 17:14:37 -0700 Subject: [Nitro] changing SessionStore Message-ID: <048901c7ea9a$c09dd1e0$6442a8c0@musicbox> Hi, I was thinking of trying the MemorySessionStore, but I noticed nitro/lib/nitro/application.rb unconditionally sets: @session_store = Raw::CookieSessionStore.new in Application#start. If I wanted to try the MemorySessionStore, at what point should I initialize app.session_store ? Thanks, Bill From billk at cts.com Wed Aug 29 21:34:34 2007 From: billk at cts.com (Bill Kelly) Date: Wed, 29 Aug 2007 18:34:34 -0700 Subject: [Nitro] vcr_record, vcr_playback Message-ID: <07f701c7eaa5$eba570e0$6442a8c0@musicbox> Hi, I'm interested in trying the vcr_record and vcr_playback routines in raw/lib/raw/adapter/webrick/vcr.rb. I remember some previous mention of these, but nothing turned up in my google, oxyliquit, or mailing list archives searches. Could anyone provide a small example? Thanks, Bill From george.moschovitis at gmail.com Thu Aug 30 01:08:22 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Thu, 30 Aug 2007 08:08:22 +0300 Subject: [Nitro] vcr_record, vcr_playback In-Reply-To: <07f701c7eaa5$eba570e0$6442a8c0@musicbox> References: <07f701c7eaa5$eba570e0$6442a8c0@musicbox> Message-ID: Bill, let me verify that this functionality works in the repo version and I will get back to you later today. -g. On 8/30/07, Bill Kelly wrote: > > Hi, > > I'm interested in trying the vcr_record and vcr_playback > routines in raw/lib/raw/adapter/webrick/vcr.rb. > > I remember some previous mention of these, but nothing > turned up in my google, oxyliquit, or mailing list > archives searches. > > Could anyone provide a small example? > > > Thanks, > > Bill > > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.me.gr http://phidz.com 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/20070830/b6bd936d/attachment.html From billk at cts.com Thu Aug 30 02:13:24 2007 From: billk at cts.com (Bill Kelly) Date: Wed, 29 Aug 2007 23:13:24 -0700 Subject: [Nitro] Testing the whole website with GET/POST Message-ID: <367301c7eacc$df9b18a0$6442a8c0@musicbox> Hi, Including techniques such as vcr_record / vcr_playback, I was wondering if anyone might be able to share tips for testing a site "externally"... ? For instance, I have a Nitro/Og site that has a reasonable amount of tests at the model level. But I don't have anything testing it yet from the "submit forms" level. I'd kind of like to be able to exercise the site logic from the point of view of a "browser". Anyone have any tips on that? (Or alternative approaches?) Thx! Bill From mvyver at gmail.com Thu Aug 30 02:55:34 2007 From: mvyver at gmail.com (Mark Van De Vyver) Date: Thu, 30 Aug 2007 16:55:34 +1000 Subject: [Nitro] OG: Model#instance_attribute_set silently updates Model#new instances using WHERE oid=NULL Message-ID: <389c43e40708292355n435a9d5ck882e2b3148c7e06f@mail.gmail.com> Hi, I've been working through some examples and came across the following behavior. I'm posting this here since there is an error page instead of the ticket system at: http://www.nitroproject.org/tickets Without the '$DBG = true' setting there would be no hint that the last statement was unsuccessful. I'm not sure if an exception should be thrown, or the record should just be saved (when saved? -> nil) before updating. HTH Mark #----------------------------- require 'rubygems' require 'og' # Full debug information. $DBG = true mysql_config = { :name => 'test', :store => 'mysql', :user => 'root', :password => '', :destroy=>false } # keeping it simple class SimplerMember attr_accessor :first_name, :last_name, :address1, :city, :state, :email, String end # define some data. FIXTURE = { :first_name => 'Fred', :last_name => 'Flintstone', :address1 => '123 High St.', :city => 'Reykjavik', :state => 'Michigan', :email => 'fred at flintstone.com' } # Initialize Og. mysql = Og.connect(mysql_config) # This will INSERT an empty row, then make an UPDATE for each # attribute/field using WHERE oid= simmem_rec = SimplerMember.create FIXTURE.each { |key, value| simmem_rec.instance_attribute_set("#{key}", value) } #This does an UPDATE for each field using WHERE oid=NULL simmem_rec = SimplerMember.new FIXTURE.each { |key, value| simmem_rec.instance_attribute_set("#{key}", value) } #----------------------------- From george.moschovitis at gmail.com Thu Aug 30 03:59:16 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Thu, 30 Aug 2007 10:59:16 +0300 Subject: [Nitro] vcr_record, vcr_playback In-Reply-To: References: <07f701c7eaa5$eba570e0$6442a8c0@musicbox> Message-ID: Bill, I added the missing flags --record / --playback, to be used like this: nitro --record session.rec nitro --playback session.rec however it does not work, i get the following error: /usr/lib/ruby/1.8/yaml/rubytypes.rb:6:in `to_yaml': can't dump anonymous class Class (TypeError) I think the problem are the IO/File objects in the Webrick request/response classes. Dunno how this used to work. If anyone can have a look at raw/adapter/webrick/vcr.rb and offer some help, I would appreciate it. -g. On 8/30/07, George Moschovitis wrote: > > Bill, > > let me verify that this functionality works in the repo version and I will > get back to you later today. > > -g. > > On 8/30/07, Bill Kelly < billk at cts.com> wrote: > > > > Hi, > > > > I'm interested in trying the vcr_record and vcr_playback > > routines in raw/lib/raw/adapter/webrick/vcr.rb. > > > > I remember some previous mention of these, but nothing > > turned up in my google, oxyliquit, or mailing list > > archives searches. > > > > Could anyone provide a small example? > > > > > > Thanks, > > > > Bill > > > > > > _______________________________________________ > > Nitro-general mailing list > > Nitro-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/nitro-general > > > > > > -- > http://www.me.gr > http://phidz.com > http://blog.gmosx.com > http://cull.gr > http://www.joy.gr > http://nitroproject.org -- http://www.me.gr http://phidz.com 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/20070830/df8aacc7/attachment.html From george.moschovitis at gmail.com Thu Aug 30 04:01:43 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Thu, 30 Aug 2007 11:01:43 +0300 Subject: [Nitro] Testing the whole website with GET/POST In-Reply-To: <367301c7eacc$df9b18a0$6442a8c0@musicbox> References: <367301c7eacc$df9b18a0$6442a8c0@musicbox> Message-ID: A quick tip: have a look at raw/adapter/script.rb this is used when running nitro --console. You could use this infrastructure in test scripts. This is similar to Rail's integration testing. I plan on working on improved testing utilities real soon. hope tjhis helps, -g. On 8/30/07, Bill Kelly wrote: > > Hi, > > Including techniques such as vcr_record / vcr_playback, I was > wondering if anyone might be able to share tips for testing > a site "externally"... ? > > For instance, I have a Nitro/Og site that has a reasonable > amount of tests at the model level. But I don't have anything > testing it yet from the "submit forms" level. > > I'd kind of like to be able to exercise the site logic from > the point of view of a "browser". > > > Anyone have any tips on that? (Or alternative approaches?) > > > Thx! > > Bill > > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.me.gr http://phidz.com 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/20070830/602e1401/attachment-0001.html From george.moschovitis at gmail.com Thu Aug 30 04:05:16 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Thu, 30 Aug 2007 11:05:16 +0300 Subject: [Nitro] OG: Model#instance_attribute_set silently updates Model#new instances using WHERE oid=NULL In-Reply-To: <389c43e40708292355n435a9d5ck882e2b3148c7e06f@mail.gmail.com> References: <389c43e40708292355n435a9d5ck882e2b3148c7e06f@mail.gmail.com> Message-ID: thansk for the report, I will investigate this issue later today. -g. On 8/30/07, Mark Van De Vyver wrote: > > Hi, > I've been working through some examples and came across the following > behavior. > I'm posting this here since there is an error page instead of the > ticket system at: > http://www.nitroproject.org/tickets > > Without the '$DBG = true' setting there would be no hint that the last > statement was unsuccessful. > I'm not sure if an exception should be thrown, or the record should > just be saved (when saved? -> nil) before updating. > > HTH > Mark > > #----------------------------- > require 'rubygems' > require 'og' > > # Full debug information. > $DBG = true > > mysql_config = { > :name => 'test', > :store => 'mysql', > :user => 'root', > :password => '', > :destroy=>false > } > > # keeping it simple > class SimplerMember > attr_accessor :first_name, :last_name, :address1, :city, :state, > :email, String > end > > # define some data. > FIXTURE = { :first_name => 'Fred', :last_name => 'Flintstone', > :address1 => '123 High St.', :city => 'Reykjavik', > :state => 'Michigan', :email => 'fred at flintstone.com' } > > # Initialize Og. > mysql = Og.connect(mysql_config) > > # This will INSERT an empty row, then make an UPDATE for each > # attribute/field using WHERE oid= > simmem_rec = SimplerMember.create > FIXTURE.each { |key, value| > simmem_rec.instance_attribute_set("#{key}", value) } > > #This does an UPDATE for each field using WHERE oid=NULL > simmem_rec = SimplerMember.new > FIXTURE.each { |key, value| > simmem_rec.instance_attribute_set("#{key}", value) } > > #----------------------------- > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.me.gr http://phidz.com 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/20070830/899e211d/attachment.html From mvyver at gmail.com Thu Aug 30 04:10:55 2007 From: mvyver at gmail.com (Mark Van De Vyver) Date: Thu, 30 Aug 2007 18:10:55 +1000 Subject: [Nitro] OG: Model#instance_attribute_set silently updates Model#new instances using WHERE oid=NULL In-Reply-To: References: <389c43e40708292355n435a9d5ck882e2b3148c7e06f@mail.gmail.com> Message-ID: <389c43e40708300110w28ccf68bw1f07d940ab672945@mail.gmail.com> Hi George, Thank you and the other developers! - the more I see of Og the more I'm impressed by it. Related to that example: Using irb: ## Works mysql.store.save( Member.new(FIXTURE) ) ## Fails # mysql.store.insert( Member.new(FIXTURE) ) ArgumentError: wrong number of arguments (1 for 2) from (irb):113:in `insert' from (irb):113 from :0 In the ri documents it seems just one argument is required: Og::Store#insert insert(obj) Insert an object in the store. HTH Mark On 8/30/07, George Moschovitis wrote: > thansk for the report, I will investigate this issue later today. > > -g. > > > On 8/30/07, Mark Van De Vyver wrote: > > > > Hi, > > I've been working through some examples and came across the following > behavior. > > I'm posting this here since there is an error page instead of the > > ticket system at: > > http://www.nitroproject.org/tickets > > > > Without the '$DBG = true' setting there would be no hint that the last > > statement was unsuccessful. > > I'm not sure if an exception should be thrown, or the record should > > just be saved (when saved? -> nil) before updating. > > > > HTH > > Mark > > > > #----------------------------- > > require 'rubygems' > > require 'og' > > > > # Full debug information. > > $DBG = true > > > > mysql_config = { > > :name => 'test', > > :store => 'mysql', > > :user => 'root', > > :password => '', > > :destroy=>false > > } > > > > # keeping it simple > > class SimplerMember > > attr_accessor :first_name, :last_name, :address1, :city, :state, > > :email, String > > end > > > > # define some data. > > FIXTURE = { :first_name => 'Fred', :last_name => 'Flintstone', > > :address1 => '123 High St.', :city => 'Reykjavik', > > :state => 'Michigan', :email => ' fred at flintstone.com' } > > > > # Initialize Og. > > mysql = Og.connect(mysql_config) > > > > # This will INSERT an empty row, then make an UPDATE for each > > # attribute/field using WHERE oid= > > simmem_rec = SimplerMember.create > > FIXTURE.each { |key, value| > > simmem_rec.instance_attribute_set("#{key}", value) } > > > > #This does an UPDATE for each field using WHERE oid=NULL > > simmem_rec = SimplerMember.new > > FIXTURE.each { |key, value| > > simmem_rec.instance_attribute_set("#{key}", value) } > > > > #----------------------------- > > _______________________________________________ > > Nitro-general mailing list > > Nitro-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/nitro-general > > > > > > -- > http://www.me.gr > http://phidz.com > http://blog.gmosx.com > http://cull.gr > http://www.joy.gr > http://nitroproject.org From john at oxyliquit.de Thu Aug 30 04:54:12 2007 From: john at oxyliquit.de (Jonathan Buch) Date: Thu, 30 Aug 2007 10:54:12 +0200 Subject: [Nitro] OG and ruby-dbi In-Reply-To: <389c43e40708282236l23a66afelc5652f86a3bb96a3@mail.gmail.com> References: <389c43e40708272350v10a060e8k7f6f9df886c45eec@mail.gmail.com> <389c43e40708282127n3381f33l3e66d8b9c377f81f@mail.gmail.com> <389c43e40708282236l23a66afelc5652f86a3bb96a3@mail.gmail.com> Message-ID: Hi, > Ok, got it: > > # rake test:og > (in /usr/src/nitro-repo) > Running sql... [ 1 specs - all passed ] > 1 examples, 0 failures > > No failing examples, let's add some tests! ...... there should be dozens of specs... not only one. GEORGE? [Create initial testing infrastructure in og, nitro, glue. George Moschovitis **20070810075936] { move ./rakefile ./Rakefile adddir ./glue/.old_test move ./glue/spec ./glue/.old_test/spec ... Please care to explain? Jo -- Feel the love http://pinkjuice.com/pics/ruby.png From george.moschovitis at gmail.com Thu Aug 30 05:55:36 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Thu, 30 Aug 2007 12:55:36 +0300 Subject: [Nitro] OG and ruby-dbi In-Reply-To: References: <389c43e40708272350v10a060e8k7f6f9df886c45eec@mail.gmail.com> <389c43e40708282127n3381f33l3e66d8b9c377f81f@mail.gmail.com> <389c43e40708282236l23a66afelc5652f86a3bb96a3@mail.gmail.com> Message-ID: Don't worry, they are in a hidden directory .old_tests. I will copy them. -g. On 8/30/07, Jonathan Buch wrote: > > Hi, > > > Ok, got it: > > > > # rake test:og > > (in /usr/src/nitro-repo) > > Running sql... [ 1 specs - all passed ] > > 1 examples, 0 failures > > > > No failing examples, let's add some tests! > > ...... there should be dozens of specs... not only one. > > GEORGE? > > [Create initial testing infrastructure in og, nitro, glue. > George Moschovitis **20070810075936] { > move ./rakefile ./Rakefile > adddir ./glue/.old_test > move ./glue/spec ./glue/.old_test/spec > > ... > > Please care to explain? > > Jo > > -- > Feel the love > http://pinkjuice.com/pics/ruby.png > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.me.gr http://phidz.com 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/20070830/4941cfac/attachment.html From george.moschovitis at gmail.com Thu Aug 30 07:36:58 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Thu, 30 Aug 2007 14:36:58 +0300 Subject: [Nitro] Aspects In-Reply-To: <1188408528.318463.192760@r34g2000hsd.googlegroups.com> References: <1187969361.601995.195500@q5g2000prf.googlegroups.com> <1188250043.795585.43290@o80g2000hse.googlegroups.com> <1188325587.907262.313400@k79g2000hse.googlegroups.com> <1188392200.409137.173050@g4g2000hsf.googlegroups.com> <1188408528.318463.192760@r34g2000hsd.googlegroups.com> Message-ID: I find the second solution more natural (what matz descibes in the provided link) more natural. This is the behaviour I would expect. But, even the first solution may be ok in 90% of the cases. Unless theres is a considerable performance/complexity penalty, lets go for the second solution. Then we can switch to the official solution when Ruby 1.9 is finally released. regards, -g. On 8/29/07, Trans wrote: > > > > On Aug 29, 7:14 am, "George Moschovitis" > wrote: > > Lets go for the later then... > > I got it to work either way. So lets decide based on what is the most > desirable behavior. > > Consider carefully the difference. > > BEFORE:Y#x > Y#x > BEFORE:X#x > X#x > AFTER:X#x > AFTER:Y#x > > vs. > > BEFORE:Y#x > BEFORE:X#x > Y#x > X#x > AFTER:X#x > AFTER:Y#x > > The 1st is analogous to sub-classing, so it's perhaps the most > obvious. However, is what Matz seems to have in mind for his :before > and :after decorators which are modeled after CLOS. See > http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/85464. > > T. > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.me.gr http://phidz.com 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/20070830/2d1ea2bf/attachment.html From mvyver at gmail.com Thu Aug 30 08:21:13 2007 From: mvyver at gmail.com (Mark Van De Vyver) Date: Thu, 30 Aug 2007 22:21:13 +1000 Subject: [Nitro] OG/Ruby/MySQLAdapter create performance Message-ID: <389c43e40708300521w70d0d841reae16a87c995b462@mail.gmail.com> Hi, Following up on my earlier post (which contained the AR benchmark code and reference), I've 'converted/ported' the AR benchmark code. My main purpose was to checkout the different OG ways of creating records - the times are an interesting bonus. The previous post: http://rubyurl.com/w27 A couple of points. I'm a Ruby newbie, so there are probably some clangers in here that make the results meaningless - please let me know if there is anything that should be changed. I've only looked at ways that OG provides to create data records. I'd like to convert this into an './examples/og_create_examples.rb' and write a spec for each example of these creates - time permitting, so please post any interesting 'ways to create' (in addition the the following specific request). I suppose it'd be useful to have a benchmark/example/spec for each or C.R.U.D..... In the commented out section you'll see some AR code that creates using SQL. Can someone provide/point me to how this would be done in OG. On my machine OG and AR where 'about' the same. Using the hash initialized model the cleanest/simplest OG create syntax was the fastest - but this might be improved on? Cheers Mark -------------- next part -------------- A non-text attachment was scrubbed... Name: og_create_benchmark.rb Type: application/x-ruby Size: 10053 bytes Desc: not available Url : http://rubyforge.org/pipermail/nitro-general/attachments/20070830/751f25ab/attachment-0001.bin From billk at cts.com Thu Aug 30 21:28:43 2007 From: billk at cts.com (Bill Kelly) Date: Thu, 30 Aug 2007 18:28:43 -0700 Subject: [Nitro] Testing the whole website with GET/POST References: <367301c7eacc$df9b18a0$6442a8c0@musicbox> Message-ID: <009401c7eb6e$4535c470$6442a8c0@musicbox> From: George Moschovitis > > A quick tip: > > have a look at raw/adapter/script.rb > > this is used when running nitro --console. You could use this > infrastructure in test scripts. This is similar to Rail's integration > testing. I plan on working on improved testing utilities real soon. Hi George, The script adapter looks useful. However, it looks like it may not be handling the session cookie for me as I request subsequent links. I use session to store a single value, the order_id. But the order_id is coming out nil each successive page I fetch. I presume this is because the ScriptAdaptor get/post methods are probably not doing automatic cookie handling the way a browser would. I see that the Raw::Context returned by a get() contains cookie data in @response_cookies. However, I'm guessing that will be server->browser cookie data, rather than browser->server cookie data. Is there a recommended approach for dealing with session cookies via the ScriptAdapter? Regards, Bill From george.moschovitis at gmail.com Fri Aug 31 03:44:57 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Fri, 31 Aug 2007 10:44:57 +0300 Subject: [Nitro] Testing the whole website with GET/POST In-Reply-To: <009401c7eb6e$4535c470$6442a8c0@musicbox> References: <367301c7eacc$df9b18a0$6442a8c0@musicbox> <009401c7eb6e$4535c470$6442a8c0@musicbox> Message-ID: > > Is there a recommended approach for dealing with session > cookies via the ScriptAdapter? > I will have to revisit this. It is quite possible that I will work on this over this weekend, and I may have some good news for you early next week. -g. -- http://www.me.gr http://phidz.com 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/20070831/f5a22770/attachment.html From mvyver at gmail.com Fri Aug 31 03:50:14 2007 From: mvyver at gmail.com (Mark Van De Vyver) Date: Fri, 31 Aug 2007 17:50:14 +1000 Subject: [Nitro] OG and DBI: Oxyliquit draft tip Message-ID: <389c43e40708310050o2adfb056s75ab532208934166@mail.gmail.com> Hi, To use DBI there is some work that needs to be done to install the drivers. I thought to make a Oxyliquit tip about this - I'd appreciate feedback on the script below. The draft below prepares for sqlite, mysql and odbc. It'd be useful to know if it is possible to change DBNAME (used twice) to install postgres , Oracle, any other drivers? Before placing anything on Oxyliquit it would be useful to confirm which distributions the following 'script' succeeds on - the location of the odbc library might be an issue if it is not in /usr/lib.... other issues? I've tested the following on openSUSE 10.2 My understanding is that DBI and ruby-ODBC are packaged in windows one-click installer - can some one confirm that? TIA Mark #-- start-bash ---------------------------- su DBNAME=mysql ODBCVER=0.9995 DBIVER=0.1.1 pushd /tmp wget http://ch-werner.de/rubyodbc/ruby-odbc-${ODBCVER}.tar.gz tar -xvf ruby-odbc-${ODBCVER}.tar.gz pushd ruby-odbc-${ODBCVER} ruby extconf.rb --enable-dlopen make make install #Installation of utf8 version: ruby -Cutf8 extconf.rb --enable-dlopen make -C utf8 make -C utf8 install popd gem install ${DBNAME} sqlite wget http://rubyforge.org/frs/download.php/12368/dbi-${DBIVER}.tar.gz tar -xvf dbi-${DBIVER}.tar.gz pushd ruby-dbi ruby setup.rb config --with=dbi,dbd_sqlite,dbd_odbc,dbd_${DBNAME} ruby setup.rb install popd popd #-- end-bash ---------------------------- From mvyver at gmail.com Fri Aug 31 05:32:36 2007 From: mvyver at gmail.com (Mark Van De Vyver) Date: Fri, 31 Aug 2007 19:32:36 +1000 Subject: [Nitro] Nitro repo web page darcs instructions: Clarification suggestion. Message-ID: <389c43e40708310232hdabdc8el8b80b4261a2a3935@mail.gmail.com> On the nitro repo web site page: http://www.nitroproject.org/repo The current advice/hint is: # darcs pull You can go on and implemented your changes (while following the project's coding conventions). Make sure that your change does not break the the test cases. When you are ready with your changes it is time to create your patch bundle. Give: # darcs send -o bundle In fact this should be: # darcs pull You can go on and implemented your changes (while following the project's coding conventions). Make sure that your change does not break the the test cases. When you are ready with your changes it is time to create your patch bundle. Then, in case you have added files or directories run: # darcs add * -r In all cases you must then run (and answer when prompted): # darcs record # darcs send -o bundle This now should be enough to allow anyone to send a quick patch without banging their head on a darcs wall. HTH Mark From mvyver at gmail.com Fri Aug 31 08:09:08 2007 From: mvyver at gmail.com (Mark Van De Vyver) Date: Fri, 31 Aug 2007 22:09:08 +1000 Subject: [Nitro] OG vs some other ORM packages In-Reply-To: References: <389c43e40708252341r1c3f7870y6e587bbb8a353913@mail.gmail.com> Message-ID: <389c43e40708310509ocf9769bi9e43116d876101a2@mail.gmail.com> Hi Kirk, On 8/27/07, Kirk Haines wrote: > On 8/25/07, Mark Van De Vyver wrote: > > > Kansas (DBI) > > Kansas is my baby. It's been around for a long time and is basically > quite stable. It uses DBI for the underlying db connectivity instead > of reinventing the wheel there. I've some questions about DBI and notice you're also listed as one of its developers/maintainers, as well as the force behind DBI2! Q1) Is there a definitive list of the DBD 'names' that are used to make up DBIs' dsn? On my system I have (/usr/lib/ruby/site_ruby/1.8/DBD/*) Mysql, ODBC, but that is just 2/13 :) I'd like to provide some documentation that is concrete for 'newbies', i.e. if you've installed the ruby driver for db X, then to connect to OG via the DBI adapter you should provide :dbi_driver => 'Xdrv' when connecting to OG - the DBD (0.2.2 draft) documentation indicates this 'name' maybe case sensitive....? Q2) Looking at DBIs project pages on Ruby-forge, there seem to be many open bugs and patches, have all these really not been fixed/applied in the latest release (August 12, 2006)? Appreciate any light you can shed. Regards Mark > It takes the approach of creating Ruby classes that correspond to > database tables, and it tries to be fairly lightweight. The code is > not particularly large. > > It uses Ruby syntax to describe queries: > > sodiums = dbh.select(:Chemicals) {|c| c.name =~ '%sodium%'} > critical_issues = dbh.select(:Roofs) {|r| r.sort_by(r.severity => > 'DESC'); r.severity > 3} > > It has transaction support that is not dependent on the database > layer. Queries can return results in normal ruby types such as an > Array or Hash instead of the db-coupled Kansas result types. The > db-coupled objects can also be marked as read-only, so that changes to > them do not get propagated back to the db. It supports creating > relationships between tables, for conveniences like: > > school = dbh.select(:Schools) {|s| s.name = school_we_are_looking_for }.first > school_cyanides = school.inventory.select {|i| i.name =~ /cyanide/} > art_inventory = school.departments.select {|d| d.name == 'Art'}.chemicals > > That's a basic high level view. I have used it on dozens and dozens > of sites over the years, and it just works. I have a small community > of users, and insufficient documentation, but it is in daily, active > use, if not daily, active development. > > > Kirk Haines > From transfire at gmail.com Fri Aug 31 11:19:56 2007 From: transfire at gmail.com (Trans) Date: Fri, 31 Aug 2007 15:19:56 -0000 Subject: [Nitro] Aspects In-Reply-To: References: <1187969361.601995.195500@q5g2000prf.googlegroups.com> <1188250043.795585.43290@o80g2000hse.googlegroups.com> <1188325587.907262.313400@k79g2000hse.googlegroups.com> <1188392200.409137.173050@g4g2000hsf.googlegroups.com> <1188408528.318463.192760@r34g2000hsd.googlegroups.com> Message-ID: <1188573596.260866.58190@19g2000hsx.googlegroups.com> On Aug 30, 4:36 am, "George Moschovitis" wrote: > I find the second solution more natural (what matz descibes in the provided > link) more natural. > This is the behaviour I would expect. But, even the first solution may be ok > in 90% of the cases. > Unless theres is a considerable performance/complexity penalty, lets go for > the second solution. Then we can switch to the official solution when Ruby > 1.9 is finally released. Okay, I have a good working solution for before and after advice. Unfortunately, around advice are a real beatch. The problem is with defining a special method (#super) inside the around advice's binding (the advice is a Proc object). The idea being that one can just do: around :x do |*args| ... super ... end Unfortunately I can't find a way to do this. And the only other solution seems to be to pass in the "target": around :x do |target, *args| ... target.super ... end But I don't like that --it's fine for a major aop framework, but not for these light-weight advice wraps (at least IMHO). T :( From george.moschovitis at gmail.com Fri Aug 31 12:40:10 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Fri, 31 Aug 2007 19:40:10 +0300 Subject: [Nitro] Aspects In-Reply-To: <1188573596.260866.58190@19g2000hsx.googlegroups.com> References: <1187969361.601995.195500@q5g2000prf.googlegroups.com> <1188325587.907262.313400@k79g2000hse.googlegroups.com> <1188392200.409137.173050@g4g2000hsf.googlegroups.com> <1188408528.318463.192760@r34g2000hsd.googlegroups.com> <1188573596.260866.58190@19g2000hsx.googlegroups.com> Message-ID: > > around :x do |target, *args| > ... > target.super > ... > end > I don't find this too ugly. As long as the performance is "right". It seems to be faster than the 'non-target' version. W/o source code I cannot offer further advices (no pun intended). -g. -- http://www.me.gr http://phidz.com 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/20070831/ddf15843/attachment.html From george.moschovitis at gmail.com Fri Aug 31 12:41:41 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Fri, 31 Aug 2007 19:41:41 +0300 Subject: [Nitro] Nitro repo web page darcs instructions: Clarification suggestion. In-Reply-To: <389c43e40708310232hdabdc8el8b80b4261a2a3935@mail.gmail.com> References: <389c43e40708310232hdabdc8el8b80b4261a2a3935@mail.gmail.com> Message-ID: Ok, thanks, I will update the text accordingly. -g. On 8/31/07, Mark Van De Vyver wrote: > > On the nitro repo web site page: > http://www.nitroproject.org/repo > > The current advice/hint is: > > > # darcs pull > > You can go on and implemented your changes (while following the > project's coding conventions). Make sure that your change does not > break the the test cases. When you are ready with your changes it is > time to create your patch bundle. Give: > > # darcs send -o bundle > > > > In fact this should be: > > > # darcs pull > > You can go on and implemented your changes (while following the > project's coding conventions). Make sure that your change does not > break the the test cases. When you are ready with your changes it is > time to create your patch bundle. Then, in case you have added files > or directories run: > > # darcs add * -r > > In all cases you must then run (and answer when prompted): > > # darcs record > # darcs send -o bundle > > > This now should be enough to allow anyone to send a quick patch > without banging their head on a darcs wall. > > HTH > Mark > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.me.gr http://phidz.com 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/20070831/39fa0574/attachment.html From john at oxyliquit.de Fri Aug 31 16:37:59 2007 From: john at oxyliquit.de (Jonathan Buch) Date: Fri, 31 Aug 2007 22:37:59 +0200 Subject: [Nitro] OG and ruby-dbi In-Reply-To: References: <389c43e40708272350v10a060e8k7f6f9df886c45eec@mail.gmail.com> <389c43e40708282127n3381f33l3e66d8b9c377f81f@mail.gmail.com> <389c43e40708282236l23a66afelc5652f86a3bb96a3@mail.gmail.com> Message-ID: Hi, > Don't worry, they are in a hidden directory .old_tests. I will copy them. I know, I only questioned the act itself. What was wrong with the structure built by Arne that this calls for such a movement? Jo -- Feel the love http://pinkjuice.com/pics/ruby.png From john at oxyliquit.de Fri Aug 31 16:38:02 2007 From: john at oxyliquit.de (Jonathan Buch) Date: Fri, 31 Aug 2007 22:38:02 +0200 Subject: [Nitro] Testing the whole website with GET/POST In-Reply-To: <367301c7eacc$df9b18a0$6442a8c0@musicbox> References: <367301c7eacc$df9b18a0$6442a8c0@musicbox> Message-ID: Hi, > Including techniques such as vcr_record / vcr_playback, I was > wondering if anyone might be able to share tips for testing > a site "externally"... ? > > I'd kind of like to be able to exercise the site logic from > the point of view of a "browser". > > Anyone have any tips on that? (Or alternative approaches?) I use a slightly alternative approach. For external tests I have recently used WWW::Mechanize. It's really good at 'emulating' a browser. Testing like that makes you work on your actual html output to produce good easy html, so it can be easily screen- scraped. I really liked it, it doesn't take too much work to recreate a 'browser visit'. Another benefit is, it makes sure your app also works with '1.0' type browsers, not having javascript. ;) Downsides, not sure yet, I've once run into a testcase which mysteriously failed due to whatever, where a real browser didn't react that way, there was no special behaviour there, unsure how that could happen. You might want to play with it. Jo -- Feel the love http://pinkjuice.com/pics/ruby.png From john at oxyliquit.de Fri Aug 31 16:38:06 2007 From: john at oxyliquit.de (Jonathan Buch) Date: Fri, 31 Aug 2007 22:38:06 +0200 Subject: [Nitro] Nitro In-Reply-To: <9e03c3c60708282319i17741d0cv6f8e96f27d71fca@mail.gmail.com> References: <9e03c3c60708282319i17741d0cv6f8e96f27d71fca@mail.gmail.com> Message-ID: Hi, > Honestly I don't "believe" that modular it the distinguishing factor. Clear > and Concise would be better terms. > > Lots of things can be "modular" with no functional benefit. I can certainly agree to this. > Discrete and easy to understand would not require "modules". It is just > nicer to package things in units (or containers). > > I think we see this a lot, a "buzz word" makes a statement and we tend to > make it a description. Really, it is a label for a string of attributes > that fit-well-with modular (or the particular buzz word). Let me explain how the Ramaze logging looks like: loggers: Informer, LogHub, Analogger, Syslog, Growl (and one I forgot) where all of them adhere to a certain interface. these all can be set as the main logger, for example: * Ramaze::Global.logger = Informer.new * .. = LogHub.new(Informer.new, Growl.new) Maybe you're right in that this might be better described as 'clear' instead of modular. Me being a non-native, I might have a mis-conception on if that is really 'modules' or not, or if it even classifies as 'modular'. Do I misuse the word if I use it for 'single pieces can be ripped out and completely replaced by something else'? Maybe it's just allways been abused or I'm just generally confused. ;) Jo -- Feel the love http://pinkjuice.com/pics/ruby.png From billk at cts.com Fri Aug 31 16:50:34 2007 From: billk at cts.com (Bill Kelly) Date: Fri, 31 Aug 2007 13:50:34 -0700 Subject: [Nitro] Testing the whole website with GET/POST References: <367301c7eacc$df9b18a0$6442a8c0@musicbox> Message-ID: <037301c7ec10$93ba9920$6442a8c0@musicbox> From: "Jonathan Buch" > >> Including techniques such as vcr_record / vcr_playback, I was >> wondering if anyone might be able to share tips for testing >> a site "externally"... ? >> >> I'd kind of like to be able to exercise the site logic from >> the point of view of a "browser". >> >> Anyone have any tips on that? (Or alternative approaches?) > > I use a slightly alternative approach. For external tests I > have recently used WWW::Mechanize. It's really good at 'emulating' > a browser. Testing like that makes you work on your actual > html output to produce good easy html, so it can be easily screen- > scraped. > I really liked it, it doesn't take too much work to recreate a > 'browser visit'. Another benefit is, it makes sure your app also > works with '1.0' type browsers, not having javascript. ;) > > Downsides, not sure yet, I've once run into a testcase which > mysteriously failed due to whatever, where a real browser > didn't react that way, there was no special behaviour there, > unsure how that could happen. > > You might want to play with it. Cool, thanks, good to hear. Indeed, I just installed WWW:Mechanize last night, and was impressed that when I fetched the home page for my site, it did all the cookie handling, and followed the redirects, and wound up exactly at the page it should have. Regards, Bill From george.moschovitis at gmail.com Fri Aug 31 18:24:59 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sat, 1 Sep 2007 01:24:59 +0300 Subject: [Nitro] Testing the whole website with GET/POST In-Reply-To: References: <367301c7eacc$df9b18a0$6442a8c0@musicbox> Message-ID: > > I use a slightly alternative approach. For external tests I > have recently used WWW::Mechanize. It's really good at 'emulating' > a browser. Testing like that makes you work on your actual > html output to produce good easy html, so it can be easily screen- > scraped. > Very good idea! I will try this as well. This would be a greate candidate for an oxyliquid tip. -g. -- http://www.me.gr http://phidz.com 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/20070901/e98b30ab/attachment.html From transfire at gmail.com Fri Aug 31 20:15:49 2007 From: transfire at gmail.com (Trans) Date: Sat, 01 Sep 2007 00:15:49 -0000 Subject: [Nitro] Aspects In-Reply-To: References: <1187969361.601995.195500@q5g2000prf.googlegroups.com> <1188325587.907262.313400@k79g2000hse.googlegroups.com> <1188392200.409137.173050@g4g2000hsf.googlegroups.com> <1188408528.318463.192760@r34g2000hsd.googlegroups.com> <1188573596.260866.58190@19g2000hsx.googlegroups.com> Message-ID: <1188605749.319240.254470@o80g2000hse.googlegroups.com> On Aug 31, 9:40 am, "George Moschovitis" wrote: > > around :x do |target, *args| > > ... > > target.super > > ... > > end > > I don't find this too ugly. As long as the performance is "right". It seems > to be faster than the 'non-target' version. > W/o source code I cannot offer further advices (no pun intended). I wish there was another way, but I can't seem to find one, so I just went ahead with the target solution. What irks me about it though is 1) it's not compatible with Matz version, 2) one starts to expect target to offer more meta-information, like method name, arity, __LINE__, binding, etc. and 3) then you think before and after advice should passed the target object too. That's why I say it makes more sense for a full-blown AOP deal, but not so much for a light-weight advice solution. Well, Maybe I'll give in and just supply a full-blown taget to all of them. In the mean time here the solution as it currently stands (I'll attach it my next post). T. From transfire at gmail.com Fri Aug 31 20:24:43 2007 From: transfire at gmail.com (TRANS) Date: Fri, 31 Aug 2007 17:24:43 -0700 Subject: [Nitro] advice.rb Message-ID: <4b6f054f0708311724n35b8ba91r42323cc630d86aa7@mail.gmail.com> It's called it advice.rb (though maybe it should be renamed advisable.rb) and you can find it in the current SVN repo. I changed the name from aspects.rb b/c a) the Aspect/Aspects classes are no longer needed and b) the name clashes with the class now in aop.rb --which is a full-blown heavy-wieght cuts-based AOP solution (work in progress). For advice.rb to work you also need 1stclassmethod.rb and unboundmethod/arguments. I've attached them, but it may be easier just to pull down the SVN repo. T. -------------- next part -------------- A non-text attachment was scrubbed... Name: advice.rb Type: application/x-ruby Size: 3248 bytes Desc: not available Url : http://rubyforge.org/pipermail/nitro-general/attachments/20070831/e4024133/attachment.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: arguments.rb Type: application/x-ruby Size: 365 bytes Desc: not available Url : http://rubyforge.org/pipermail/nitro-general/attachments/20070831/e4024133/attachment-0001.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: 1stclassmethod.rb Type: application/x-ruby Size: 3537 bytes Desc: not available Url : http://rubyforge.org/pipermail/nitro-general/attachments/20070831/e4024133/attachment-0002.bin