From george.moschovitis at gmail.com Thu Sep 1 04:06:17 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Thu, 1 Sep 2005 11:06:17 +0300 Subject: [Nitro] Nano & Mega In-Reply-To: <4b6f054f050831182819d6978e@mail.gmail.com> References: <4b6f054f050831182819d6978e@mail.gmail.com> Message-ID: what is the bug? I didn't understand... -g. On 9/1/05, TRANS wrote: > On 8/31/05, Jeff Wood wrote: > > So, I remember seeing some errors in the mailing list about nano &| mega > > having problems with nitro... > > > > Do they work? or What's the issue? > > One bug in Nano that was trouble for windows users, but it has been > fixed. There was also one in the new realease of Nitro which will > ceratinly be fixed by tomorrow afternoon as well. > > T. > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From george.moschovitis at gmail.com Thu Sep 1 04:20:11 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Thu, 1 Sep 2005 11:20:11 +0300 Subject: [Nitro] [ANN] Nitro Flare 0.3.0 Message-ID: Hello everyone Flare is a Blog engine powered by Nitro and Og. The aim of this project is to provide a canonical example of using Nitro to build a real world Web application. However, more features are planned for the near future. == Features * Supports RedCloth for markup. * Partial support for MetaWeblog, Blogger, Moveable Type API's * RSS feeds. * Trackbacks. * Powered by Og, can be backed up by a RDBM system or an in-memory/filesystem store. * Output caching for excellent performance. * Search. You can see an older version of this blog here: http://www.gmosx.com have fun, George Moschovitis -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From epiperak at softlab.ece.ntua.gr Thu Sep 1 04:57:45 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Thu, 1 Sep 2005 11:57:45 +0300 (EEST) Subject: [Nitro] @request Message-ID: in the skin.rb I want to make smartheaders, so I check the @request to see the path, and based on that I add a second navigation bar... but the @reqest is nil...? and @parent_action_name does not work. Any ideas? Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From george.moschovitis at gmail.com Thu Sep 1 05:29:25 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Thu, 1 Sep 2005 12:29:25 +0300 Subject: [Nitro] @request In-Reply-To: References: Message-ID: @request is != nil (btw you can also use request or context they are synonyms). -g. On 9/1/05, Emmanuel Piperakis wrote: > in the skin.rb I want to make smartheaders, so I check the @request to see > the path, and based on that I add a second navigation bar... > > but the @reqest is nil...? and @parent_action_name does not work. Any > ideas? > > Emmanouil Piperakis (epiperak at cs.ntua.gr) > {To explore is Human, to Create is Devine, > To teach is Primal, to Rule is Sin} > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From epiperak at softlab.ece.ntua.gr Thu Sep 1 05:37:02 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Thu, 1 Sep 2005 12:37:02 +0300 (EEST) Subject: [Nitro] @request In-Reply-To: References: Message-ID: Well, it says nil to me, :-/// And what should I use? @request.path? > @request is != nil > > (btw you can also use request or context they are synonyms). > > -g. > > On 9/1/05, Emmanuel Piperakis wrote: >> in the skin.rb I want to make smartheaders, so I check the @request to see >> the path, and based on that I add a second navigation bar... >> >> but the @reqest is nil...? and @parent_action_name does not work. Any >> ideas? >> >> Emmanouil Piperakis (epiperak at cs.ntua.gr) >> {To explore is Human, to Create is Devine, >> To teach is Primal, to Rule is Sin} >> _______________________________________________ >> Nitro-general mailing list >> Nitro-general at rubyforge.org >> http://rubyforge.org/mailman/listinfo/nitro-general >> > > > -- > http://www.gmosx.com > http://www.navel.gr > http://www.nitrohq.com > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From george.moschovitis at gmail.com Thu Sep 1 06:09:23 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Thu, 1 Sep 2005 13:09:23 +0300 Subject: [Nitro] @request In-Reply-To: References: Message-ID: There must be some other error in your code... I would say: request.path -g. On 9/1/05, Emmanuel Piperakis wrote: > Well, it says nil to me, :-/// > And what should I use? @request.path? > > > > @request is != nil > > > > (btw you can also use request or context they are synonyms). > > > > -g. > > > > On 9/1/05, Emmanuel Piperakis wrote: > >> in the skin.rb I want to make smartheaders, so I check the @request to see > >> the path, and based on that I add a second navigation bar... > >> > >> but the @reqest is nil...? and @parent_action_name does not work. Any > >> ideas? > >> > >> Emmanouil Piperakis (epiperak at cs.ntua.gr) > >> {To explore is Human, to Create is Devine, > >> To teach is Primal, to Rule is Sin} > >> _______________________________________________ > >> Nitro-general mailing list > >> Nitro-general at rubyforge.org > >> http://rubyforge.org/mailman/listinfo/nitro-general > >> > > > > > > -- > > http://www.gmosx.com > > http://www.navel.gr > > http://www.nitrohq.com > > > > _______________________________________________ > > Nitro-general mailing list > > Nitro-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/nitro-general > > > > Emmanouil Piperakis (epiperak at cs.ntua.gr) > {To explore is Human, to Create is Devine, > To teach is Primal, to Rule is Sin} > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From transfire at gmail.com Thu Sep 1 07:22:56 2005 From: transfire at gmail.com (TRANS) Date: Thu, 1 Sep 2005 07:22:56 -0400 Subject: [Nitro] Nano & Mega In-Reply-To: References: <4b6f054f050831182819d6978e@mail.gmail.com> Message-ID: <4b6f054f0509010422279b7946@mail.gmail.com> On 9/1/05, George Moschovitis wrote: > what is the bug? I didn't understand... ####/snip/#### /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:21:in `require__': no such file to load -- nano/dir/recurse (LoadError) from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:21:in `require' from /usr/lib/ruby/gems/1.8/gems/nitro-0.23.0/bin/nitrogen:6 from /usr/bin/nitrogen:18 ####/snap/#### 'recurse' needs to be '%3A%3Arecurse' T. From transfire at gmail.com Thu Sep 1 07:24:29 2005 From: transfire at gmail.com (TRANS) Date: Thu, 1 Sep 2005 07:24:29 -0400 Subject: [Nitro] [ANN] Nitro Flare 0.3.0 In-Reply-To: References: Message-ID: <4b6f054f05090104244c45a3d3@mail.gmail.com> Awesome work George! From george.moschovitis at gmail.com Thu Sep 1 08:46:39 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Thu, 1 Sep 2005 15:46:39 +0300 Subject: [Nitro] Nano & Mega In-Reply-To: <4b6f054f0509010422279b7946@mail.gmail.com> References: <4b6f054f050831182819d6978e@mail.gmail.com> <4b6f054f0509010422279b7946@mail.gmail.com> Message-ID: Oooh that '::' thing :( Btw, I dont consider this an important bug. nitrogen just copies the the proto directory to create a fresh new application. You can do the same with a simple cp/copy. I think it is better to wait untill next week to get some more bug fixes before releasing a 0.23.1 release. Anyone has any objection? regards, George. On 9/1/05, TRANS wrote: > On 9/1/05, George Moschovitis wrote: > > > what is the bug? I didn't understand... > > ####/snip/#### > /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:21:in > `require__': no such file to load -- nano/dir/recurse (LoadError) > from > /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:21:in `require' > from /usr/lib/ruby/gems/1.8/gems/nitro-0.23.0/bin/nitrogen:6 > from /usr/bin/nitrogen:18 > ####/snap/#### > > 'recurse' needs to be '%3A%3Arecurse' > > T. > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From george.moschovitis at gmail.com Thu Sep 1 08:48:31 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Thu, 1 Sep 2005 15:48:31 +0300 Subject: [Nitro] [ANN] Nitro Flare 0.3.0 In-Reply-To: <4b6f054f05090104244c45a3d3@mail.gmail.com> References: <4b6f054f05090104244c45a3d3@mail.gmail.com> Message-ID: heh, let's not congratulate each other :) But I do think this code serves as a nice example of using Nitro, it is quite clean. regards, George. On 9/1/05, TRANS wrote: > Awesome work George! > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From Walter at mwsewall.com Thu Sep 1 09:32:18 2005 From: Walter at mwsewall.com (Walter) Date: Thu, 1 Sep 2005 09:32:18 -0400 Subject: [Nitro] Nitro/OG examples that show recommended ...... Message-ID: <9DB53D616B4D5B47B8353ACBF155C6B70CDFE2@mwsewall.com> I am new to Nitro/OG and am looking for examples that show the recommended way of doing : 1.) Passing data to/from controller variables/form fields. I am assuming there are predefined "controls" that can take the form data and validate it against certain constraints, automatically convert the data to the desired format, and if there is an error automatically populate the appropriate error list that can be used to send the page back to the same page with error messages. (similar to what Rails does with validation errors for an AR object). Ideally this would also work with non OG managed classes as well???? 2.) Is there a recommended directory layout for views/controllers. If I have 3 controllers and they all have an index.xhtml page, is there a recommend place to put these different files. 3.) An example of OG using compound primary keys, especially with belongs_to, or other relations, especially when dealing with a legacy database via an ODBC driver. 4.) An example of OG using sub-objects i.e. Person is an OG managed class and it has an Address(line1, line2, city, st, zip). So you could have Person.find_something[0].address.city. Is this even possible with OG Overall it looks very promising, I would like to make sure I wrap my ahead around the Nitro/OG concepts the way they were intended. Something that puts it all together would be great. Don't get me wrong, the couple of blog examples are great, but it would be nice to see more real world examples. Is there anything I can be directed to, to see something like this? Thanks, Walt -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.344 / Virus Database: 267.10.17/85 - Release Date: 8/30/2005 From james_b at neurogami.com Thu Sep 1 10:14:56 2005 From: james_b at neurogami.com (James Britt) Date: Thu, 01 Sep 2005 07:14:56 -0700 Subject: [Nitro] [ANN] Nitro Flare 0.3.0 In-Reply-To: References: Message-ID: <43170CE0.7010901@neurogami.com> George Moschovitis wrote: > Hello everyone > > Flare is a Blog engine powered by Nitro and Og. The aim of > this project is to provide a canonical example of using Nitro > to build a real world Web application. Where can this be downloaded? James -- http://www.ruby-doc.org - The Ruby Documentation Site http://www.rubyxml.com - News, Articles, and Listings for Ruby & XML http://www.rubystuff.com - The Ruby Store for Ruby Stuff http://www.jamesbritt.com - Playing with Better Toys From zimba.tm at gmail.com Thu Sep 1 10:18:04 2005 From: zimba.tm at gmail.com (zimba-tm) Date: Thu, 1 Sep 2005 16:18:04 +0200 Subject: [Nitro] [ANN] Nitro Flare 0.3.0 In-Reply-To: <43170CE0.7010901@neurogami.com> References: <43170CE0.7010901@neurogami.com> Message-ID: <3ff63f9b050901071835427b3c@mail.gmail.com> Look in nitro's rubyforge project : http://rubyforge.org/projects/nitro/ On 01/09/05, James Britt wrote: > George Moschovitis wrote: > > Hello everyone > > > > Flare is a Blog engine powered by Nitro and Og. The aim of > > this project is to provide a canonical example of using Nitro > > to build a real world Web application. > > Where can this be downloaded? > > James > > -- > > http://www.ruby-doc.org - The Ruby Documentation Site > http://www.rubyxml.com - News, Articles, and Listings for Ruby & XML > http://www.rubystuff.com - The Ruby Store for Ruby Stuff > http://www.jamesbritt.com - Playing with Better Toys > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- Cheers, zimba http://zimba.oree.ch From james_b at neurogami.com Thu Sep 1 12:01:08 2005 From: james_b at neurogami.com (James Britt) Date: Thu, 01 Sep 2005 09:01:08 -0700 Subject: [Nitro] [ANN] Nitro Flare 0.3.0 In-Reply-To: <3ff63f9b050901071835427b3c@mail.gmail.com> References: <43170CE0.7010901@neurogami.com> <3ff63f9b050901071835427b3c@mail.gmail.com> Message-ID: <431725C4.1020605@neurogami.com> zimba-tm wrote: > Look in nitro's rubyforge project : > http://rubyforge.org/projects/nitro/ Ah, thanks. I really believe that if I procrastinate long enough, other people will write the hard parts of my myriad stalled projects, and I can then just wire up parts to get what I want. James -- http://www.ruby-doc.org - The Ruby Documentation Site http://www.rubyxml.com - News, Articles, and Listings for Ruby & XML http://www.rubystuff.com - The Ruby Store for Ruby Stuff http://www.jamesbritt.com - Playing with Better Toys From zimba.tm at gmail.com Thu Sep 1 12:10:16 2005 From: zimba.tm at gmail.com (zimba-tm) Date: Thu, 1 Sep 2005 18:10:16 +0200 Subject: [Nitro] [ANN] Nitro Flare 0.3.0 In-Reply-To: <431725C4.1020605@neurogami.com> References: <43170CE0.7010901@neurogami.com> <3ff63f9b050901071835427b3c@mail.gmail.com> <431725C4.1020605@neurogami.com> Message-ID: <3ff63f9b0509010910496cddc6@mail.gmail.com> On 01/09/05, James Britt wrote: > zimba-tm wrote: > > Look in nitro's rubyforge project : > > http://rubyforge.org/projects/nitro/ > > Ah, thanks. NP > > I really believe that if I procrastinate long enough, other people will > write the hard parts of my myriad stalled projects, and I can then just > wire up parts to get what I want. And what is what you want ? A webliki ? > James > > -- > > http://www.ruby-doc.org - The Ruby Documentation Site > http://www.rubyxml.com - News, Articles, and Listings for Ruby & XML > http://www.rubystuff.com - The Ruby Store for Ruby Stuff > http://www.jamesbritt.com - Playing with Better Toys > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- Cheers, zimba http://zimba.oree.ch From tim at keow.org Thu Sep 1 13:31:31 2005 From: tim at keow.org (Tim Larson) Date: Thu, 1 Sep 2005 18:31:31 +0100 Subject: [Nitro] [ANN] Nitro Flare 0.3.0 In-Reply-To: References: Message-ID: <20050901173131.GB828@localhost> On Thu, Sep 01, 2005 at 11:20:11AM +0300, George Moschovitis wrote: > Flare is a Blog engine powered by Nitro and Og. The aim of > this project is to provide a canonical example of using Nitro > to build a real world Web application. Hi George, others :) Flare looks really neat, but I have a problem... I can add an article from the /admin interface, and it shows up in the admin list, but not in the main / page. I get this error on the console: DEBUG: Rendering '/articles'. DEBUG: Compiling action 'BlogController#articles' DEBUG: Compiling template 'BlogController: template/articles.xhtml' ERROR: Error while handling '/articles'. ERROR: undefined method `to_href' for nil:NilClass On the other hand, adding a category via the /admin interface does work for me :) --Tim Larson From rainhead at gmail.com Thu Sep 1 14:14:25 2005 From: rainhead at gmail.com (Peter Abrahamsen) Date: Thu, 1 Sep 2005 11:14:25 -0700 Subject: [Nitro] Documentation (was: Nitro/OG examples that show recommended...) In-Reply-To: <9DB53D616B4D5B47B8353ACBF155C6B70CDFE2@mwsewall.com> References: <9DB53D616B4D5B47B8353ACBF155C6B70CDFE2@mwsewall.com> Message-ID: <5F3CA0EA-ED76-4D2B-821F-10779EA1DC26@gmail.com> I would expand on this to say that, IMHO, Nitro+Og+... s in desperate need of good documentation. The rdoc and walkthroughs are valuable, but they don't replace real documentation. Real documentation would have a bunch of best practices for all common tasks, as well as listings of all the tools you have in different contexts. Some of this could be built into the rdoc, but there ought to be several starting points outside of the source code or module structure. It's been frustrating trying to learn how things work browsing either the source or the rdoc modules list. I can only find the information I'm looking for once I understand how the code works and is laid out, and even then it's spread out between too many files and modules. I don't think I should have to do that. The constant stream of good, new features is impressive, but I think that some excellent documentation would do a lot to bring more people on to the project. Maybe that's where you're heading already, maybe you're waiting for the API to settle more before 1.0, I don't know. I feel like it'll be some time before I understand Nitro well enough to write best practices or reference docs, but maybe there's something I can do to help. Let me know. P On Sep 1, 2005, at 6:32 AM, Walter wrote: > I am new to Nitro/OG and am looking for examples that show the > recommended way of doing : > > 1.) Passing data to/from controller variables/form fields. > I am assuming there are predefined "controls" that can take the > form data and validate it against certain constraints, > automatically convert the data to the desired format, and if there > is an error automatically populate the appropriate error list that > can be used to send the page back to the same page with error > messages. (similar to what Rails does with validation errors for an > AR object). > Ideally this would also work with non OG managed classes as well???? > > 2.) Is there a recommended directory layout for views/controllers. > If I have 3 controllers and they all have an index.xhtml page, is > there a recommend place to put these different files. > > 3.) An example of OG using compound primary keys, especially with > belongs_to, or other relations, especially when dealing with a > legacy database via an ODBC driver. > > 4.) An example of OG using sub-objects i.e. Person is an OG managed > class and it has an Address(line1, line2, city, st, zip). So you > could have Person.find_something[0].address.city. Is this even > possible with OG > > > Overall it looks very promising, I would like to make sure I wrap > my ahead around the Nitro/OG concepts the way they were intended. > Something that puts it all together would be great. Don't get me > wrong, the couple of blog examples are great, but it would be nice > to see more real world examples. Is there anything I can be > directed to, to see something like this? > > > Thanks, > > > Walt > > -- > No virus found in this outgoing message. > Checked by AVG Anti-Virus. > Version: 7.0.344 / Virus Database: 267.10.17/85 - Release Date: > 8/30/2005 > > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > From james_b at neurogami.com Thu Sep 1 14:45:30 2005 From: james_b at neurogami.com (James Britt) Date: Thu, 01 Sep 2005 11:45:30 -0700 Subject: [Nitro] Documentation In-Reply-To: <5F3CA0EA-ED76-4D2B-821F-10779EA1DC26@gmail.com> References: <9DB53D616B4D5B47B8353ACBF155C6B70CDFE2@mwsewall.com> <5F3CA0EA-ED76-4D2B-821F-10779EA1DC26@gmail.com> Message-ID: <43174C4A.7060804@neurogami.com> Peter Abrahamsen wrote: > I would expand on this to say that, IMHO, Nitro+Og+... s in desperate > need of good documentation. The rdoc and walkthroughs are valuable, but > they don't replace real documentation. Real documentation would have a > bunch of best practices for all common tasks, as well as listings of > all the tools you have in different contexts. Some of this could be > built into the rdoc, but there ought to be several starting points > outside of the source code or module structure. > Good docs are a weak point for many, of not most, OSS applications and libs. For various reasons, those most familiar with the code tend to spend more time writing code than docs. > It's been frustrating trying to learn how things work browsing either > the source or the rdoc modules list. I can only find the information > I'm looking for once I understand how the code works and is laid out, > and even then it's spread out between too many files and modules. I > don't think I should have to do that. > Ideally, no. For the time being, yes. But people are working on changing that. > The constant stream of good, new features is impressive, but I think > that some excellent documentation would do a lot to bring more people > on to the project. Maybe that's where you're heading already, maybe > you're waiting for the API to settle more before 1.0, I don't know. I had started on Nitro: Step-by-step some months ago, then put it on hod while the API was setting down. Now I just need to find enough time to go back and get it done. > > I feel like it'll be some time before I understand Nitro well enough to > write best practices or reference docs, but maybe there's something I > can do to help. Let me know. > I think, if nothing else, it might be handy to track what are the common uses cases and scenarios people want to know about, so that people can get up and running on the more common jobs. James -- http://www.ruby-doc.org - The Ruby Documentation Site http://www.rubyxml.com - News, Articles, and Listings for Ruby & XML http://www.rubystuff.com - The Ruby Store for Ruby Stuff http://www.jamesbritt.com - Playing with Better Toys From tim at keow.org Thu Sep 1 17:05:11 2005 From: tim at keow.org (Tim Larson) Date: Thu, 1 Sep 2005 22:05:11 +0100 Subject: [Nitro] [ANN] Nitro Flare 0.3.0 In-Reply-To: <20050901173131.GB828@localhost> References: <20050901173131.GB828@localhost> Message-ID: <20050901210511.GD828@localhost> On Thu, Sep 01, 2005 at 06:31:31PM +0100, Tim Larson wrote: > On Thu, Sep 01, 2005 at 11:20:11AM +0300, George Moschovitis wrote: > > Flare is a Blog engine powered by Nitro and Og. The aim of > > this project is to provide a canonical example of using Nitro > > to build a real world Web application. > > Hi George, others :) > > Flare looks really neat, but I have a problem... > I can add an article from the /admin interface, > and it shows up in the admin list, but not in > the main / page. I get this error on the console: > DEBUG: Rendering '/articles'. > DEBUG: Compiling action 'BlogController#articles' > DEBUG: Compiling template 'BlogController: > template/articles.xhtml' > ERROR: Error while handling '/articles'. > ERROR: undefined method `to_href' for nil:NilClass > On the other hand, adding a category via the > /admin interface does work for me :) This is caused by the category being nil, which is in turn caused by the 'fill' method not setting the category, because of this error: #> --Tim Larson From tim at keow.org Thu Sep 1 21:15:04 2005 From: tim at keow.org (Tim Larson) Date: Fri, 2 Sep 2005 02:15:04 +0100 Subject: [Nitro] cannot reach nitrohq.com Message-ID: <20050902011504.GE828@localhost> Hey George, just an FYI: I cannot load http://www.nitrohq.com since sometime earlier today. For confirmation that it is not a local problem, kvasir on #nitro also could not load the site. --Tim Larson From epiperak at softlab.ece.ntua.gr Thu Sep 1 21:23:59 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Fri, 2 Sep 2005 04:23:59 +0300 (EEST) Subject: [Nitro] [ANN] Nitro Flare 0.3.0 In-Reply-To: <431725C4.1020605@neurogami.com> References: <43170CE0.7010901@neurogami.com> <3ff63f9b050901071835427b3c@mail.gmail.com> <431725C4.1020605@neurogami.com> Message-ID: > zimba-tm wrote: >> Look in nitro's rubyforge project : >> http://rubyforge.org/projects/nitro/ > > Ah, thanks. > > I really believe that if I procrastinate long enough, other people will write > the hard parts of my myriad stalled projects, and I can then just wire up > parts to get what I want. > Same here James... George is doing it for me! ;-) > > James > > -- > > http://www.ruby-doc.org - The Ruby Documentation Site > http://www.rubyxml.com - News, Articles, and Listings for Ruby & XML > http://www.rubystuff.com - The Ruby Store for Ruby Stuff > http://www.jamesbritt.com - Playing with Better Toys > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From epiperak at softlab.ece.ntua.gr Thu Sep 1 21:29:03 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Fri, 2 Sep 2005 04:29:03 +0300 (EEST) Subject: [Nitro] cannot reach nitrohq.com In-Reply-To: <20050902011504.GE828@localhost> References: <20050902011504.GE828@localhost> Message-ID: > Hey George, just an FYI: > I cannot load http://www.nitrohq.com since sometime earlier > today. For confirmation that it is not a local problem, > kvasir on #nitro also could not load the site. Same here... Maybe we need a mirror... I have a good line at home (100mbit fiber) and a machine available... George? Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From epiperak at softlab.ece.ntua.gr Thu Sep 1 23:32:06 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Fri, 2 Sep 2005 06:32:06 +0300 (EEST) Subject: [Nitro] in the skin.rb Message-ID: is it possible to put code like this? def render %~ #{doctype} #{head}
#{header} #{mainnav} #{if @request != nil} #{if @request.path.chop == 'projects' then secnav_projects end} #{if @request.path.chop == 'bgroups' then secnav_bgroups end} #{if @request.path.chop == 'reports' then secnav_reports end} #{end}
#{content}
#{footer}
#{rendering_errors} ~ end I want depending on the fist navigation menu choice to display a second navigation menu... There must a be a smarter way to do this... Any help? Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From reid.thompson at ateb.com Fri Sep 2 00:49:34 2005 From: reid.thompson at ateb.com (Reid Thompson) Date: Fri, 02 Sep 2005 00:49:34 -0400 Subject: [Nitro] [ANN] Nitro Flare 0.3.0 In-Reply-To: <20050901210511.GD828@localhost> References: <20050901173131.GB828@localhost> <20050901210511.GD828@localhost> Message-ID: <4317D9DE.1060009@ateb.com> Tim Larson wrote: >On Thu, Sep 01, 2005 at 06:31:31PM +0100, Tim Larson wrote: > > >>On Thu, Sep 01, 2005 at 11:20:11AM +0300, George Moschovitis wrote: >> >> >>>Flare is a Blog engine powered by Nitro and Og. The aim of >>>this project is to provide a canonical example of using Nitro >>>to build a real world Web application. >>> >>> >>Hi George, others :) >> >>Flare looks really neat, but I have a problem... >>I can add an article from the /admin interface, >>and it shows up in the admin list, but not in >>the main / page. I get this error on the console: >> DEBUG: Rendering '/articles'. >> DEBUG: Compiling action 'BlogController#articles' >> DEBUG: Compiling template 'BlogController: >> template/articles.xhtml' >> ERROR: Error while handling '/articles'. >> ERROR: undefined method `to_href' for nil:NilClass >>On the other hand, adding a category via the >>/admin interface does work for me :) >> >> > >This is caused by the category being nil, which is in turn >caused by the 'fill' method not setting the category, because >of this error: > # for #> > >--Tim Larson >_______________________________________________ >Nitro-general mailing list >Nitro-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/nitro-general > > tim -- changing lib/nitro/mixin/form.rb to def belongs_to_tag(obj, rel, options) entities = rel.target_class.all labels = entities.map { |e| e.to_s } values = entities.map { |e| e.oid } element( label(rel.name), %{ } ) end will get the category_oid populated for the article --- just have to determine what the real fix is now From epiperak at softlab.ece.ntua.gr Fri Sep 2 02:52:41 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Fri, 2 Sep 2005 09:52:41 +0300 (EEST) Subject: [Nitro] in the skin.rb In-Reply-To: References: Message-ID: Just found the problem... I had to escape # to get request! \#{request.path.chop} in the skin.rb gives me what I was searching for... > is it possible to put code like this? > > def render > %~ > #{doctype} > > #{head} > >
> #{header} > #{mainnav} > #{if @request != nil} > #{if @request.path.chop == 'projects' then secnav_projects > end} > #{if @request.path.chop == 'bgroups' then secnav_bgroups end} > #{if @request.path.chop == 'reports' then secnav_reports end} > #{end} >
> #{content} >
> #{footer} >
> #{rendering_errors} > > > ~ > end > > I want depending on the fist navigation menu choice to display a second > navigation menu... There must a be a smarter way to do this... Any help? > > Emmanouil Piperakis (epiperak at cs.ntua.gr) > {To explore is Human, to Create is Devine, > To teach is Primal, to Rule is Sin} > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From epiperak at softlab.ece.ntua.gr Fri Sep 2 03:28:26 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Fri, 2 Sep 2005 10:28:26 +0300 (EEST) Subject: [Nitro] in the skin.rb In-Reply-To: References: Message-ID: Just in case somebody has the same problem in the future... In the skin.rb -------------------- def projects %~ ~ end def render %~ #{doctype} #{head}
#{header} #{mainnav} #{projects} #{bgroups} #{reports}
#{content}
#{footer}
#{rendering_errors} ~ end > Just found the problem... > I had to escape # to get request! > \#{request.path.chop} in the skin.rb gives me what I was searching for... > > >> is it possible to put code like this? >> >> def render >> %~ >> #{doctype} >> >> #{head} >> >>
>> #{header} >> #{mainnav} >> #{if @request != nil} >> #{if @request.path.chop == 'projects' then secnav_projects >> end} >> #{if @request.path.chop == 'bgroups' then secnav_bgroups end} >> #{if @request.path.chop == 'reports' then secnav_reports end} >> #{end} >>
>> #{content} >>
>> #{footer} >>
>> #{rendering_errors} >> >> >> ~ >> end >> >> I want depending on the fist navigation menu choice to display a second >> navigation menu... There must a be a smarter way to do this... Any help? >> >> Emmanouil Piperakis (epiperak at cs.ntua.gr) >> {To explore is Human, to Create is Devine, >> To teach is Primal, to Rule is Sin} >> _______________________________________________ >> Nitro-general mailing list >> Nitro-general at rubyforge.org >> http://rubyforge.org/mailman/listinfo/nitro-general >> > > Emmanouil Piperakis (epiperak at cs.ntua.gr) > {To explore is Human, to Create is Devine, > To teach is Primal, to Rule is Sin} > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From george.moschovitis at gmail.com Fri Sep 2 05:09:57 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Fri, 2 Sep 2005 12:09:57 +0300 Subject: [Nitro] Server problem for nitrohq.com Message-ID: Dear devs, saddly the server hosting www.nitrohq.com has hardware problems :( The site may be down for several days :( regards, George. -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From george.moschovitis at gmail.com Fri Sep 2 05:11:38 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Fri, 2 Sep 2005 12:11:38 +0300 Subject: [Nitro] Nitro/OG examples that show recommended ...... In-Reply-To: <9DB53D616B4D5B47B8353ACBF155C6B70CDFE2@mwsewall.com> References: <9DB53D616B4D5B47B8353ACBF155C6B70CDFE2@mwsewall.com> Message-ID: > Overall it looks very promising, I would like to make sure I wrap my ahead around the Nitro/OG concepts the way they were intended. Something that puts it all together would be great. Don't get me wrong, the couple of blog examples are great, but it would be nice to see more real world examples. Is there anything I can be directed to, to see something like this? Have you tried the Flare and Spark examples? The feature: - templates - elements - xmlrpc apis - incoming email handling - many to many relations - tagging - search and more. The source code is quite clean too. -g. -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From epiperak at softlab.ece.ntua.gr Fri Sep 2 05:12:42 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Fri, 2 Sep 2005 12:12:42 +0300 (EEST) Subject: [Nitro] Server problem for nitrohq.com In-Reply-To: References: Message-ID: Can we use a mirror? > Dear devs, > > saddly the server hosting www.nitrohq.com has hardware problems :( > The site may be down for several days :( > > regards, > George. > > -- > http://www.gmosx.com > http://www.navel.gr > http://www.nitrohq.com > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From george.moschovitis at gmail.com Fri Sep 2 05:15:28 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Fri, 2 Sep 2005 12:15:28 +0300 Subject: [Nitro] Nitro/OG examples that show recommended ...... In-Reply-To: <9DB53D616B4D5B47B8353ACBF155C6B70CDFE2@mwsewall.com> References: <9DB53D616B4D5B47B8353ACBF155C6B70CDFE2@mwsewall.com> Message-ID: > 1.) Passing data to/from controller variables/form fields. > I am assuming there are predefined "controls" that can take the form data and validate it against certain constraints, automatically convert the data to the desired format, and if there is an error automatically populate the appropriate error list that can be used to send the page back to the same page with error messages. (similar to what Rails does with validation errors for an AR object). yeap, this works almost exactly like AR validation. Have a look at lib/glue/valdation.rb > Ideally this would also work with non OG managed classes as well???? Yeap, unlike AR this works on non managed classes. > 2.) Is there a recommended directory layout for views/controllers. If I have 3 controllers and they all have an index.xhtml page, is there a recommend place to put these different files. Nitro, unlike Rails does not force a directory structure. But If you like it, you can use the structure of Flare. > 3.) An example of OG using compound primary keys, especially with belongs_to, or other relations, especially when dealing with a legacy database via an ODBC driver. have a look at: test/og/tc_reverse.rb > 4.) An example of OG using sub-objects i.e. Person is an OG managed class and it has an Address(line1, line2, city, st, zip). So you could have Person.find_something[0].address.city. Is this even possible with OG of course, it works just how you describe this :) regards, George. -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From george.moschovitis at gmail.com Fri Sep 2 05:20:19 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Fri, 2 Sep 2005 12:20:19 +0300 Subject: [Nitro] [ANN] Nitro Flare 0.3.0 In-Reply-To: <20050901173131.GB828@localhost> References: <20050901173131.GB828@localhost> Message-ID: Oh, the admin thing is experimental. You have to be careful and fill all Article properties. I would suggest that tou use a Moveable Type client like BloGTK instead. -g. On 9/1/05, Tim Larson wrote: > On Thu, Sep 01, 2005 at 11:20:11AM +0300, George Moschovitis wrote: > > Flare is a Blog engine powered by Nitro and Og. The aim of > > this project is to provide a canonical example of using Nitro > > to build a real world Web application. > > Hi George, others :) > > Flare looks really neat, but I have a problem... > I can add an article from the /admin interface, > and it shows up in the admin list, but not in > the main / page. I get this error on the console: > DEBUG: Rendering '/articles'. > DEBUG: Compiling action 'BlogController#articles' > DEBUG: Compiling template 'BlogController: > template/articles.xhtml' > ERROR: Error while handling '/articles'. > ERROR: undefined method `to_href' for nil:NilClass > On the other hand, adding a category via the > /admin interface does work for me :) > > --Tim Larson > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From george.moschovitis at gmail.com Fri Sep 2 05:21:21 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Fri, 2 Sep 2005 12:21:21 +0300 Subject: [Nitro] [ANN] Nitro Flare 0.3.0 In-Reply-To: <4317D9DE.1060009@ateb.com> References: <20050901173131.GB828@localhost> <20050901210511.GD828@localhost> <4317D9DE.1060009@ateb.com> Message-ID: hmmm... > >This is caused by the category being nil, which is in turn > >caused by the 'fill' method not setting the category, because > >of this error: > > # > for #> -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From george.moschovitis at gmail.com Fri Sep 2 05:23:15 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Fri, 2 Sep 2005 12:23:15 +0300 Subject: [Nitro] in the skin.rb In-Reply-To: References: Message-ID: Exactly :-) Elements are evaluated at compile time (so there is practicaly no performance penalty). This in an example of Nitro's scalable design. Constant time algorithms are used whenever possible. regards, George. On 9/2/05, Emmanuel Piperakis wrote: > Just found the problem... > I had to escape # to get request! > \#{request.path.chop} in the skin.rb gives me what I was searching for... > > > > is it possible to put code like this? > > > > def render > > %~ > > #{doctype} > > > > #{head} > > > >
> > #{header} > > #{mainnav} > > #{if @request != nil} > > #{if @request.path.chop == 'projects' then secnav_projects > > end} > > #{if @request.path.chop == 'bgroups' then secnav_bgroups end} > > #{if @request.path.chop == 'reports' then secnav_reports end} > > #{end} > >
> > #{content} > >
> > #{footer} > >
> > #{rendering_errors} > > > > > > ~ > > end > > > > I want depending on the fist navigation menu choice to display a second > > navigation menu... There must a be a smarter way to do this... Any help? > > > > Emmanouil Piperakis (epiperak at cs.ntua.gr) > > {To explore is Human, to Create is Devine, > > To teach is Primal, to Rule is Sin} > > _______________________________________________ > > Nitro-general mailing list > > Nitro-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/nitro-general > > > > Emmanouil Piperakis (epiperak at cs.ntua.gr) > {To explore is Human, to Create is Devine, > To teach is Primal, to Rule is Sin} > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From george.moschovitis at gmail.com Fri Sep 2 05:23:31 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Fri, 2 Sep 2005 12:23:31 +0300 Subject: [Nitro] Server problem for nitrohq.com In-Reply-To: References: Message-ID: Saddly no :( -g. On 9/2/05, Emmanuel Piperakis wrote: > Can we use a mirror? > > > Dear devs, > > > > saddly the server hosting www.nitrohq.com has hardware problems :( > > The site may be down for several days :( > > > > regards, > > George. > > > > -- > > http://www.gmosx.com > > http://www.navel.gr > > http://www.nitrohq.com > > > > _______________________________________________ > > Nitro-general mailing list > > Nitro-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/nitro-general > > > > Emmanouil Piperakis (epiperak at cs.ntua.gr) > {To explore is Human, to Create is Devine, > To teach is Primal, to Rule is Sin} > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From george.moschovitis at gmail.com Fri Sep 2 05:50:36 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Fri, 2 Sep 2005 12:50:36 +0300 Subject: [Nitro] Nitrohq.com backup Message-ID: Dear devs, is it possible that someone has a backup of the nitrohq.com pages? If so please email me privately. regards, George. -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From george.moschovitis at gmail.com Fri Sep 2 06:22:08 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Fri, 2 Sep 2005 13:22:08 +0300 Subject: [Nitro] Nitrohq.com Message-ID: Dear devs, I added a temporary redirect to www.rubyforge.org/projects/nitro. Thanks to Kostas Nasis who stepped in to provide this temporary solution. George. -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From george.moschovitis at gmail.com Fri Sep 2 07:34:25 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Fri, 2 Sep 2005 14:34:25 +0300 Subject: [Nitro] Documentation In-Reply-To: <43174C4A.7060804@neurogami.com> References: <9DB53D616B4D5B47B8353ACBF155C6B70CDFE2@mwsewall.com> <5F3CA0EA-ED76-4D2B-821F-10779EA1DC26@gmail.com> <43174C4A.7060804@neurogami.com> Message-ID: Peter, James, all, I can understand your frustration with the documentation issues but you have to understand that this is project can't be an 'one man show'. Of course things could be better, but there is a tutorial, there is a small FAQ, there are many, high quality examples, there is this mailing list, an IRC channel, etc. This is much more than what was available when Rails was initially released, and yet many people were able to contribute more to the Rails project. On the other hand, take the example of people like James, Michael, Matt, Guillaume, Deb, Tasos, Aleksi, Tom and others that have taken the time to go through the code and send patches, write some docs, answer questions in the mailing list or even send Nitro logos. Hey, we even got some PayPal donations. The simple truth is that *this project needs more help from the Community*. If you like this project you should consider contributing more. In a perfect world I (and other developers of Navel, the company behind Nitro) would work all the day on Nitro, write documentation, polish the web site, etc. Instead, we have to work on client's projects to make a living. Perhaps we could arrange for a fund (similar to the Rails Logo fund) in order to build better documentation or add more features. Perhaps we could arrange for a PayPal account were people interested in this project could donate small amounts? Or perhaps everyone in this list would try to contribute some time and code to make this project better. It would be encouraging for me and other contributors to see some real world sites using this technology. Or see some articles on Nitro on blogs. Or at least be more patient, and trust that we *do plan* on providing quality documentation along with a quality platform. We just need time and your help! In the meantime, give it a try, it is not THAT hard to use Nitro/Og as it is now. And if you have questions ask on this list. George -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From citizen428 at gentoo.org Fri Sep 2 07:49:37 2005 From: citizen428 at gentoo.org (Michael Kohl) Date: Fri, 2 Sep 2005 13:49:37 +0200 Subject: [Nitro] Documentation In-Reply-To: References: <9DB53D616B4D5B47B8353ACBF155C6B70CDFE2@mwsewall.com> <5F3CA0EA-ED76-4D2B-821F-10779EA1DC26@gmail.com> <43174C4A.7060804@neurogami.com> Message-ID: <20050902134937.279e98cf@localhost> On Fri, 2 Sep 2005 14:34:25 +0300 George Moschovitis wrote: > this is project can't be an 'one man show'. Nor should it be, because that would be ignoring one of the greatest things of free software! > The simple truth is that *this project needs more help from the > Community*. It's funny that you write this, because when I read through this thread, my idea was to start a "Nitro documentation project". I'll start a seperate thread for this to not mix things up though. > Or see some articles on Nitro on blogs. I've blogged a little about Nitro here: http://citizen428.net/archives/206-Nitro-powered.html The good thing is that my posts from the Gentoo category get syndicated to Planet Gentoo (http://planet.gentoo.org), which has quite a lot of readers. > We just need time and your help! See above. The great thing about free software is that you can fix stuff yourself! :) Cheers, Michael -- web at citizen428.net citizen428 at gentoo.org http://citizen428.net/ http://dev.gentoo.org/~citizen428/ GnuPG key: 0x90CA09E3/4D21 916E DBCE 72B8 CDC5 BD87 DE2D 91A2 90CA 09E3 From george.moschovitis at gmail.com Fri Sep 2 07:54:53 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Fri, 2 Sep 2005 14:54:53 +0300 Subject: [Nitro] Documentation In-Reply-To: <20050902134937.279e98cf@localhost> References: <9DB53D616B4D5B47B8353ACBF155C6B70CDFE2@mwsewall.com> <5F3CA0EA-ED76-4D2B-821F-10779EA1DC26@gmail.com> <43174C4A.7060804@neurogami.com> <20050902134937.279e98cf@localhost> Message-ID: > Nor should it be, because that would be ignoring one of the greatest > things of free software! aggreed :) this is the reason we started the project originally :) > It's funny that you write this, because when I read through this > thread, my idea was to start a "Nitro documentation project". I'll > start a seperate thread for this to not mix things up though. waiting for your post :) > > We just need time and your help! > See above. The great thing about free software is that you can fix > stuff yourself! :) agreed again :) This for example what Guill does and in the process sends in useful patches all the time. It would be great if more people followed his example. -g. -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From citizen428 at gentoo.org Fri Sep 2 08:10:00 2005 From: citizen428 at gentoo.org (Michael Kohl) Date: Fri, 2 Sep 2005 14:10:00 +0200 Subject: [Nitro] Nitro Documentation Project (NDP) Message-ID: <20050902141000.4f299d25@localhost> Ok, I've been thinking about this since subscribed to this list, because quite a lot of mails deal with the perceived lack of documentation. That's why I propose the formation of a Nitro Documentation Project (NDP) *in the community*, so George and the other people can focus on writing Nitro instead on writing docs. This doesn't mean that the NDP won't work closely with them though. So, what is this thread for? ---------------------------- 1. To get a feeling how many people would be interested in participating in this project. The good thing on writing docs is that nearly everyone can help by e.g. proof reading, translations etc. Even people with heavy time constraints can usually find some minutes/week to proof read some stuff or write a sentence here or there. 2. Define what exactly is needed. Looking at Rails (although the constant comparison of Nitro and Rails starts to get annonying after a while, I know) might give us some hints: http://documentation.rubyonrails.com/ 3. Define priorities. Sure, every doc is valuable. Nonetheless some are more needed than others. For example the vides Rails provides are nice, but I'm sure most people will agree that what Peter mentioned earlier ("Real documentation would have a bunch of best practices for all common tasks, as well as listings of all the tools you have in different contexts.") would be more important for the time being. 4. Define which format to use. Wikis are undoubtedly nice, but we should at lest consider alternatives. E.g. Gentoo's documenation is written in GuideXML (http://www.gentoo.org/doc/en/xml-guide.xml), which then gets converted to HTML via xslt. That's pretty neat, as it allows us to generate different output from the same source easily. This may or may not be intersting for Nitro, but at least we should discuss it. 5. Misc stuff. E.g. could we get a subdomain like http://documentation.nitrohq.com? Would it make sense to create a separate ML called nitro-docs for the coordination of the docs team? Everything else that comes to mind. Why should you participate? --------------------------- 1. This is free software. You perceive a problem. Fix it! 2. You help yourself and others. 3. You help Nitro, which is a nice way to say "thank you!" to George and the others. I for one definitely am willing to participate in such a project, although I'm currently low on time (I'm currently writing my diploma thesis and Gentoo absorbs quite a lot of my time too). Nonetheless I think I will be able to spend an hour or two per week on this, and if e.g. 4 other people join this effort, we'd have between 5 and 10 hours a week dedicated to Nitro documentation, which is not that bad. Sorry that this mail got so long, but if you're reading this sentence, you're obviously interested in this project, so do the right thing and volunteer! "Uncle George needs YOU!" ;) Cheers, Michael -- web at citizen428.net citizen428 at gentoo.org http://citizen428.net/ http://dev.gentoo.org/~citizen428/ GnuPG key: 0x90CA09E3/4D21 916E DBCE 72B8 CDC5 BD87 DE2D 91A2 90CA 09E3 From tim at keow.org Fri Sep 2 09:11:26 2005 From: tim at keow.org (Tim Larson) Date: Fri, 2 Sep 2005 14:11:26 +0100 Subject: [Nitro] [ANN] Nitro Flare 0.3.0 In-Reply-To: References: <20050901173131.GB828@localhost> Message-ID: <20050902131126.GF828@localhost> On Fri, Sep 02, 2005 at 12:20:19PM +0300, George Moschovitis wrote: > Oh, the admin thing is experimental. You have to be careful and fill > all Article properties. > I would suggest that you use a Moveable Type client like BloGTK instead. Actually, I was just using the process of tracking down this bug/not-yet-implemented-feature not to use Flare, but to become more familiar with the Nitro/Og/etc. codebase. :) So I am more interested in the process of understanding the code and finding the right fix than in being able to use Flare as a blog engine, at least at this moment. So in this context (with my very limited knowledge), the fix from Reid Thompson makes sense and looks right to me. Does it seem like the right fix to you? (Adding _oid to belongs_to_tag) --Tim Larson From george.moschovitis at gmail.com Fri Sep 2 09:22:45 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Fri, 2 Sep 2005 16:22:45 +0300 Subject: [Nitro] [ANN] Nitro Flare 0.3.0 In-Reply-To: <20050902131126.GF828@localhost> References: <20050901173131.GB828@localhost> <20050902131126.GF828@localhost> Message-ID: yeap, the fix was correct. Somehow I must have introduced the bug at the last moment, fixed now. -g. On 9/2/05, Tim Larson wrote: > On Fri, Sep 02, 2005 at 12:20:19PM +0300, George Moschovitis wrote: > > Oh, the admin thing is experimental. You have to be careful and fill > > all Article properties. > > I would suggest that you use a Moveable Type client like BloGTK instead. > > Actually, I was just using the process of tracking down this > bug/not-yet-implemented-feature not to use Flare, but to become > more familiar with the Nitro/Og/etc. codebase. :) So I am more > interested in the process of understanding the code and finding > the right fix than in being able to use Flare as a blog engine, > at least at this moment. > > So in this context (with my very limited knowledge), the fix > from Reid Thompson makes sense and looks right to me. Does it > seem like the right fix to you? (Adding _oid to belongs_to_tag) > > --Tim Larson > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From Walter at mwsewall.com Fri Sep 2 09:29:15 2005 From: Walter at mwsewall.com (Walter) Date: Fri, 2 Sep 2005 09:29:15 -0400 Subject: [Nitro] Nitro/OG examples that show recommended ...... Message-ID: <9DB53D616B4D5B47B8353ACBF155C6B70CE06C@mwsewall.com> See inline comments: > > 1.) Passing data to/from controller variables/form fields. > > I am assuming there are predefined "controls" that can take > the form data and validate it against certain constraints, > automatically convert the data to the desired format, and if > there is an error automatically populate the appropriate > error list tha > t can be used to send the page back to the same page with > error messages. (similar to what Rails does with validation > errors for an AR object). > > yeap, this works almost exactly like AR validation. Have a look at > > lib/glue/valdation.rb > > > Ideally this would also work with non OG managed classes as well???? > > Yeap, unlike AR this works on non managed classes. > OK.....I did look at that and will experiment with that, but are there "controls" already defined to work with them. i.e Are there text fields that will automatically pull from the defined variable and to prefill the field, and then when posting automatically validates and set the data to the correct field. If there are errors how does it display them? On the same page or is this configurable??? Is there a basic architecture document that might allow me to wrap my head around the theories of Nitro. > > 2.) Is there a recommended directory layout for > views/controllers. If I have 3 controllers and they all have > an index.xhtml page, is there a recommend place to put these > different files. > > Nitro, unlike Rails does not force a directory structure. But If you > like it, you can use the structure of Flare. > Fair enough. > > 3.) An example of OG using compound primary keys, > especially with belongs_to, or other relations, especially > when dealing with a legacy database via an ODBC driver. > > have a look at: > > test/og/tc_reverse.rb > I did look at this and dug deeper into the OG source code. And while it does look like it can handle a legacy schema fairly well, I don't believe it currently works with compound primary keys. Everywhere in the source it refers to a pk field, it does not seem to allow for an array of these. Or have I just totally misunderstood something fundamental. > > 4.) An example of OG using sub-objects i.e. Person is an OG > managed class and it has an Address(line1, line2, city, st, > zip). So you could have > Person.find_something[0].address.city. Is this even possible with OG > > of course, it works just how you describe this :) Cool....I guess the only part I am missing is how to describe this? And are there requirements that they be set in the constructor or can they be set after object creation vie assessor fields. I have a table like Create table Customer(name varchar, seq_no int, other_fields varchar, addr1 char(30), addr2 char(30), city char(15), st char(2), zip char(10), more_fields varchar) And Ruby classes ... class Address attr_accessor :line1, :line2, :city, :state, :zip def to_s "#{line1}\t#{line2}\t#{city}\t#{state}\t#{zip}" end End Class Customer property :name, String property :seq_no, Integer property :other_fields, String property :address, Address #how do a assign the fields in the table to the address object property :more_fields, String end I am missing how I tell OG to map the fields to the sub-object Address contianed by Customer. My problem is that many times I am looking at things one way when they are really meant to be looked at another way. If I can get my head in the correct context, I can manage just fine, but sometimes starting out I have a totally wrong approach. I am trying to align my thinking with the inteded design/usage patterns for Nitro/OG. Thanks, Walt -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.344 / Virus Database: 267.10.17/85 - Release Date: 8/30/2005 From george.moschovitis at gmail.com Fri Sep 2 10:09:59 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Fri, 2 Sep 2005 17:09:59 +0300 Subject: [Nitro] Nitro/OG examples that show recommended ...... In-Reply-To: <9DB53D616B4D5B47B8353ACBF155C6B70CE06C@mwsewall.com> References: <9DB53D616B4D5B47B8353ACBF155C6B70CE06C@mwsewall.com> Message-ID: > OK.....I did look at that and will experiment with that, but are there "controls" already defined to work with them. i.e Are there text fields that will automatically pull from the defined variable and to prefill the field, and then when posting automatically validates and set the data to the correct field. If there are errors how does it display them? On the same page or is this configurable??? This is a work in progress. Have a look at the new scaffolding and auto admin code. This code does not support validations yet, but this will be available shortly. As an example have a look at Flare. > I did look at this and dug deeper into the OG source code. And while it does look like it can handle a legacy schema fairly well, > I don't believe it currently works with compound primary keys. Everywhere in the source it refers to a pk field, it does not seem to allow for an array of these. Or have I just totally misunderstood something fundamental. The next version will feature dynamic finder so you will be able to do this: Article.find_by_oid_and_author(2, 'gmosx') For the moment you can emulate this: def find_by_oid_and_author(oid, author) find(:condition => "oid = #{oid} AND author='#{author}'") end you can also define the compound sql index: class Article sql_index oid, author end > Cool....I guess the only part I am missing is how to describe this? And are there requirements > that they be set in the constructor or can they be set after object creation vie assessor fields. > ... > I am missing how I tell OG to map the fields to the sub-object Address contianed by Customer. I am not sure if this works in legacy schemas, but in normal mode Og handles the mapping automatically for you. Then again I am not sure I correctly understood your question. I am running a lot today. regards, George. -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From Walter at mwsewall.com Fri Sep 2 11:08:26 2005 From: Walter at mwsewall.com (Walter) Date: Fri, 2 Sep 2005 11:08:26 -0400 Subject: [Nitro] Nitro/OG examples that show recommended ...... Message-ID: <9DB53D616B4D5B47B8353ACBF155C6B70CE079@mwsewall.com> > > OK.....I did look at that and will experiment with that, > but are there "controls" already defined to work with them. > i.e Are there text fields that will automatically pull from > the defined variable and to prefill the field, and then when > posting auto > matically validates and set the data to the correct field. > If there are errors how does it display them? On the same > page or is this configurable??? > > This is a work in progress. Have a look at the new scaffolding and > auto admin code. This code does not support validations yet, but this > will be available shortly. As an example have a look at Flare. > Ahh ok.... I just didn't want to start working on something myself if it was already there, and I jut missed it. I will look at the above examples. > > I did look at this and dug deeper into the OG source code. > And while it does look like it can handle a legacy schema fairly well, > > I don't believe it currently works with compound primary > keys. Everywhere in the source it refers to a pk field, it > does not seem to allow for an array of these. Or have I just > totally misunderstood something fundamental. > > The next version will feature dynamic finder so you will be > able to do this: > > Article.find_by_oid_and_author(2, 'gmosx') > > For the moment you can emulate this: > > def find_by_oid_and_author(oid, author) > find(:condition => "oid = #{oid} AND author='#{author}'") > end > > you can also define the compound sql index: > > class Article > sql_index oid, author > end > The above is fine for querying objects, but it does not work when updating objects. For instance, I have a legacy schema the has invoice headers in an invoice table and invoice line items in a transact table. Invoices has_many transact The transacts do not have an oid or anything like that but are identified by the inv_no of the associated header and a line number. For me to update or delete any individual line_item I have to use those two fields to uniquely identify them. I can see, for reporting purposes how I can get the data, I just don't think the sql_index would solve my update issues. > > Cool....I guess the only part I am missing is how to > describe this? And are there requirements > that they be set > in the constructor or can they be set after object creation > vie assessor fields. > > ... Here I am asking if the sub-object (is there better terminology for this) needs to have its fields settable via a constructor or via accessors, is this configurable? > > I am missing how I tell OG to map the fields to the > sub-object Address contianed by Customer. > I guess I am missing the syntax of how to map the 5 db fields to the fields for the sub-object. If this will stored in a different table, then I could use has_one or has_many to that, but how is it done within the same table. I am sure I am just missing a simple piece, I just can't seem to find it. > I am not sure if this works in legacy schemas, but in normal mode Og > handles the mapping automatically for you. Then again I am not sure I > correctly understood your question. I am running a lot today. > > > regards, > George. > I do appreciate your time to answer my questions, it really has been very helpful to me. Thanks, Walt -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.344 / Virus Database: 267.10.17/85 - Release Date: 8/30/2005 From george.moschovitis at gmail.com Fri Sep 2 11:30:48 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Fri, 2 Sep 2005 18:30:48 +0300 Subject: [Nitro] Nitro/OG examples that show recommended ...... In-Reply-To: <9DB53D616B4D5B47B8353ACBF155C6B70CE079@mwsewall.com> References: <9DB53D616B4D5B47B8353ACBF155C6B70CE079@mwsewall.com> Message-ID: > The above is fine for querying objects, but it does not work when updating objects. > For instance, I have a legacy schema the has invoice headers in an invoice table and invoice line items in a transact table. I see, this is not available for the moment but you are right, this is an important feature. To tell you the truth, at the moment I am mostly working on Nitro stuff (and some internal nitro based projects) as I am waiting to see some progress on Deb's extensive Og patch. But I 'll manage to find some time to work on this before the next release. If one of the more experienced Og users can provide a patch, even better ;-) > I guess I am missing the syntax of how to map the 5 db fields to the fields for the sub-object. If this will stored in a different table, then I could use has_one or has_many to that, but how is it done within the same table. I am sure I am just missing a simple piece, I just can't seem to find it. Ah, now I understand your problem. How about this: module Address property :line1, String, :sql => 'CHAR(30)' property :line2, ... ... end class Customer include Address property :name, String property :seq_no, Integer property :other_fields, String property :more_fields, String end and then: Customer[1].line1 Does this work for you? > I do appreciate your time to answer my questions, it really has been very helpful to me. No prob, George. -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From Walter at mwsewall.com Fri Sep 2 12:17:54 2005 From: Walter at mwsewall.com (Walter) Date: Fri, 2 Sep 2005 12:17:54 -0400 Subject: [Nitro] Nitro/OG examples that show recommended ...... Message-ID: <9DB53D616B4D5B47B8353ACBF155C6B70CE086@mwsewall.com> > I see, this is not available for the moment but you are right, this is > an important feature. > To tell you the truth, at the moment I am mostly working on Nitro > stuff (and some internal nitro based projects) as I am waiting to see > some progress on Deb's extensive Og patch. But I 'll manage to find > some time to work on this before the next release. If one of the more > experienced Og users can provide a patch, even better ;-) > I do have a simple persistent object manager that does work with compound keys and allows for sub-objects but I haven't added the joins (has_one, has_many, etc....) and I am getting to the point where I would want that. I will study the Og code some more and see if I can perhaps integrate some of that in there. We have approached the design a bit differently but it does seem to make sense to update Og to work with compound primary keys more so than to update mine to do relations. Although I will say that I do need ODBC support and that might be an issue with OG as well. > > Ah, now I understand your problem. How about this: > > module Address > property :line1, String, :sql => 'CHAR(30)' > property :line2, ... > ... > end > > class Customer > include Address > property :name, String > property :seq_no, Integer > property :other_fields, String > property :more_fields, String > end > > and then: > > Customer[1].line1 > > Does this work for you? > Unfortunately no. The reason for defining them as sub-objects is that they all have extra logic built in. The Address example I gave you was a very stripped down version. The real one, knows how to parse the line to get the street number, the street itself, and the street type (road, street, ave, etc). It can sort and do other things. I have similar stuff for fiscal periods, and for phone numbers, etc. I am thinking of using a Money and Gallon value objects instead of floats and that would also apply there as well. Thanks, Walt -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.344 / Virus Database: 267.10.17/85 - Release Date: 8/30/2005 From deb at ysabel.org Fri Sep 2 12:25:15 2005 From: deb at ysabel.org (Ysabel) Date: Fri, 02 Sep 2005 10:25:15 -0600 Subject: [Nitro] Nitro/OG examples that show recommended ...... In-Reply-To: <9DB53D616B4D5B47B8353ACBF155C6B70CE086@mwsewall.com> References: <9DB53D616B4D5B47B8353ACBF155C6B70CE086@mwsewall.com> Message-ID: <54EC8150A1703AF56C67766B@[10.19.0.236]> --On Friday, September 02, 2005 12:17 PM -0400 Walter wrote: > We have approached the design a bit differently but it does seem to make > sense to update Og to work with compound primary keys more so than to > update mine to do relations. You might look at http://darcs.ysabel.org/nitro/og-store before you get too far into that. I've been unavailable for the last little bit here but I'm pulling the 0.23 release now so that I can do some integration work. I have 0.22 patches that probably just need some basic updating to work for 0.23, but I need to write Og-interface-level tests before I can be sure things generally work. (Sorry, George. I'd have said something earlier but honestly I've been busy worrying about family members down in New Orleans and trying to get some of the work for which I am generally paid done in between.) -- [ deb at ysabel.org ] - Ysabel - [ http://www.ysabel.org/ ] From robbie.wilhelm at gmail.com Fri Sep 2 12:50:05 2005 From: robbie.wilhelm at gmail.com (Robert Wagner) Date: Fri, 2 Sep 2005 18:50:05 +0200 Subject: [Nitro] Nitro Documentation Project (NDP) In-Reply-To: <20050902141000.4f299d25@localhost> References: <20050902141000.4f299d25@localhost> Message-ID: <5371ac740509020950632adac1@mail.gmail.com> hi, 2005/9/2, Michael Kohl : > 4. Define which format to use. Wikis are undoubtedly nice, but we > should at lest consider alternatives. E.g. Gentoo's documenation is > written in GuideXML (http://www.gentoo.org/doc/en/xml-guide.xml), which > then gets converted to HTML via xslt. That's pretty neat, as it allows > us to generate different output from the same source easily. This may > or may not be intersting for Nitro, but at least we should discuss it. > i like the gentoo doc stuff. when i was in the mood of documenting my lib long time ago :) i imitated the looks and added *direct-running-examples* and i like it still. http://www.xorc.org/xorcdoc/form_1.php -robert p.s. one should be able to leave comments From citizen428 at gentoo.org Fri Sep 2 12:59:58 2005 From: citizen428 at gentoo.org (Michael Kohl) Date: Fri, 2 Sep 2005 18:59:58 +0200 Subject: [Nitro] Nitro Documentation Project (NDP) In-Reply-To: <5371ac740509020950632adac1@mail.gmail.com> References: <20050902141000.4f299d25@localhost> <5371ac740509020950632adac1@mail.gmail.com> Message-ID: <20050902185958.511ecc31@localhost> On Fri, 2 Sep 2005 18:50:05 +0200 Robert Wagner wrote: > p.s. one should be able to leave comments I'm pretty sure we can come up with some magic to automatically add a link to something like ${page-title}-discuss at the bottom of every page. That would give us the best of both worlds, viz. nicely formatted "static" documentation with an additional wiki for suggestions etc. Cheers, Michael -- web at citizen428.net citizen428 at gentoo.org http://citizen428.net/ http://dev.gentoo.org/~citizen428/ GnuPG key: 0x90CA09E3/4D21 916E DBCE 72B8 CDC5 BD87 DE2D 91A2 90CA 09E3 From tim at keow.org Fri Sep 2 13:15:05 2005 From: tim at keow.org (Tim Larson) Date: Fri, 2 Sep 2005 18:15:05 +0100 Subject: [Nitro] fix for form mixing for admin pages Message-ID: <20050902171505.GG828@localhost> When a table has no relations (strange in production, but possible during in-between stages of early development) the form mixin fails. Line 88 of nitro/mixin/form.rb needs to be changed to allow for nil. From: for rel in obj.class.relations To: for rel in obj.class.relations || [] --Tim Larson From rainhead at gmail.com Fri Sep 2 13:18:27 2005 From: rainhead at gmail.com (Peter Abrahamsen) Date: Fri, 2 Sep 2005 10:18:27 -0700 Subject: [Nitro] Nitro Documentation Project (NDP) In-Reply-To: <20050902185958.511ecc31@localhost> References: <20050902141000.4f299d25@localhost> <5371ac740509020950632adac1@mail.gmail.com> <20050902185958.511ecc31@localhost> Message-ID: <01E6763C-C969-427E-8343-35A16B53BD52@gmail.com> Michael, Alright, sounds good. I've got some time, and though I don't understand how things work very well yet, at least I know what sorts of things would be useful to me. We need something that makes it easy for us to collaborate. Would the Gentoo-style docs (which are pretty, I admit) allow this? Also, the PHP, Zope, and Postgres docs allow for comments. This is handy, so long as people come along afterwards and address whatever issue is raised. Comments and questions used to stick around for years in the Zope docs and nobody touched 'em. But we're cooler than them :) Anyway it doesn't matter that much. We should be able to switch to some other system sometime in the future--something Nitro-based? Let's just get a space going where we can start putting ideas down. P On Sep 2, 2005, at 9:59 AM, Michael Kohl wrote: > I'm pretty sure we can come up with some magic to automatically add a > link to something like ${page-title}-discuss at the bottom of every > page. That would give us the best of both worlds, viz. nicely > formatted > "static" documentation with an additional wiki for suggestions etc. > > Cheers, > Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/nitro-general/attachments/20050902/4245bb21/attachment.html From james_b at neurogami.com Fri Sep 2 13:18:29 2005 From: james_b at neurogami.com (James Britt) Date: Fri, 02 Sep 2005 10:18:29 -0700 Subject: [Nitro] Nitro Documentation Project (NDP) In-Reply-To: <5371ac740509020950632adac1@mail.gmail.com> References: <20050902141000.4f299d25@localhost> <5371ac740509020950632adac1@mail.gmail.com> Message-ID: <43188965.30504@neurogami.com> Robert Wagner wrote: > hi, > > 2005/9/2, Michael Kohl : > >>4. Define which format to use. Wikis are undoubtedly nice, but we >>should at lest consider alternatives. E.g. Gentoo's documenation is >>written in GuideXML (http://www.gentoo.org/doc/en/xml-guide.xml), which >>then gets converted to HTML via xslt. That's pretty neat, as it allows >>us to generate different output from the same source easily. This may >>or may not be intersting for Nitro, but at least we should discuss it. >> > > > i like the gentoo doc stuff. when i was in the mood of documenting my > lib long time ago :) i imitated the looks and added > *direct-running-examples* and i like it still. > http://www.xorc.org/xorcdoc/form_1.php Is anyone actually suggesting people write docs in XML? Is there a problem with simply starting off with, say, textile or markdown, in simple flat-files? If writing docs is any harder than absolutely necessary it won't get done. Goal number one: get accurate content. A wiki, with user authentication, seems snake simple. Or perhaps this (I haven't tried it yet myself) http://www.writely.com/ or something like it. James Britt From ulmo at valaraan.de Fri Sep 2 13:35:10 2005 From: ulmo at valaraan.de (manveru) Date: Fri, 02 Sep 2005 19:35:10 +0200 Subject: [Nitro] Nitro Documentation Project (NDP) In-Reply-To: <43188965.30504@neurogami.com> References: <20050902141000.4f299d25@localhost> <5371ac740509020950632adac1@mail.gmail.com> <43188965.30504@neurogami.com> Message-ID: <43188D4E.6080207@valaraan.de> James Britt wrote: > Robert Wagner wrote: > >> hi, >> >> 2005/9/2, Michael Kohl : >> >>> 4. Define which format to use. Wikis are undoubtedly nice, but we >>> should at lest consider alternatives. E.g. Gentoo's documenation is >>> written in GuideXML (http://www.gentoo.org/doc/en/xml-guide.xml), which >>> then gets converted to HTML via xslt. That's pretty neat, as it allows >>> us to generate different output from the same source easily. This may >>> or may not be intersting for Nitro, but at least we should discuss it. >>> >> >> >> i like the gentoo doc stuff. when i was in the mood of documenting my >> lib long time ago :) i imitated the looks and added >> *direct-running-examples* and i like it still. >> http://www.xorc.org/xorcdoc/form_1.php > > > Is anyone actually suggesting people write docs in XML? > > Is there a problem with simply starting off with, say, textile or > markdown, in simple flat-files? > > If writing docs is any harder than absolutely necessary it won't get > done. Goal number one: get accurate content. > > A wiki, with user authentication, seems snake simple. > > Or perhaps this (I haven't tried it yet myself) > http://www.writely.com/ > > or something like it. > > > > James Britt > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > in fact me and Vagabond are working on a documentation-system for ruby - it's based on a modification of rdoc wich generates yamls... the whole thing is based upon nitro (very simple at the moment) i was planning to combine the power of a wiki to the documentation provided by the code by a simple link to the corresponding article in the wiki :) now that i have got both the wiki and the documentation built, you may want to have a look at it but i haven't implemented anything for the auth yet as i'm waiting for ysabels nitro-auth and also i'm looking for people who are willing to contribute to the project - it should be useable for that purpose as well as for the core/stdlib-documentation of ruby you can see an early version at http://brutalrepublic.com:4567/doc have rewritten it since the release of 0.23, but it should give you the taste (it's without the wiki, sorry - have to update the server sometime soon) i would be thankful for any kind of contribution, suggestions and so on... :) hope you like my idea so long... manveru From tim at keow.org Fri Sep 2 13:35:55 2005 From: tim at keow.org (Tim Larson) Date: Fri, 2 Sep 2005 18:35:55 +0100 Subject: [Nitro] Admin pages, fill excludes 'name' Message-ID: <20050902173555.GH828@localhost> I know the admin pages are alpha/beta/etc. but they seem very useful too. While working with them I noticed that #fill explicitly filters out 'name' and 'oid'...what makes 'name' especially unsafe? It seems like too common a field name to be making it hard to handle, unless there is a good reason... --Tim Larson From james_b at neurogami.com Fri Sep 2 13:47:12 2005 From: james_b at neurogami.com (James Britt) Date: Fri, 02 Sep 2005 10:47:12 -0700 Subject: [Nitro] Nitro Documentation Project (NDP) In-Reply-To: <43188D4E.6080207@valaraan.de> References: <20050902141000.4f299d25@localhost> <5371ac740509020950632adac1@mail.gmail.com> <43188965.30504@neurogami.com> <43188D4E.6080207@valaraan.de> Message-ID: <43189020.4020607@neurogami.com> manveru wrote: > in fact me and Vagabond are working on a documentation-system for ruby - > it's based on a modification of rdoc wich generates yamls... > the whole thing is based upon nitro (very simple at the moment) > i was planning to combine the power of a wiki to the documentation > provided by the code by a simple link to the corresponding article in > the wiki :) > now that i have got both the wiki and the documentation built, you may > want to have a look at it > but i haven't implemented anything for the auth yet as i'm waiting for > ysabels nitro-auth > > and also i'm looking for people who are willing to contribute to the > project - it should be useable for that purpose as well as for the > core/stdlib-documentation of ruby > > you can see an early version at > http://brutalrepublic.com:4567/doc I'm a bit overwhelmed by the redness, but otherwise this is quite nice. More stuff to pilfer for ruby-doc.org! BTW, I see you refer to it as RDOG up top. Have you considered "Red Dog" as a project name? > > have rewritten it since the release of 0.23, but it should give you the > taste (it's without the wiki, sorry - have to update the server sometime > soon) > > i would be thankful for any kind of contribution, suggestions and so > on... :) I'll see what I can do to help out. James From robbie.wilhelm at gmail.com Fri Sep 2 14:46:24 2005 From: robbie.wilhelm at gmail.com (Robert Wagner) Date: Fri, 2 Sep 2005 20:46:24 +0200 Subject: [Nitro] Nitro Documentation Project (NDP) In-Reply-To: <43188965.30504@neurogami.com> References: <20050902141000.4f299d25@localhost> <5371ac740509020950632adac1@mail.gmail.com> <43188965.30504@neurogami.com> Message-ID: <5371ac74050902114638f4a160@mail.gmail.com> 2005/9/2, James Britt : > Robert Wagner wrote: > > hi, > > > > 2005/9/2, Michael Kohl : > > > >>4. Define which format to use. Wikis are undoubtedly nice, but we > >>should at lest consider alternatives. E.g. Gentoo's documenation is > >>written in GuideXML (http://www.gentoo.org/doc/en/xml-guide.xml), which > >>then gets converted to HTML via xslt. That's pretty neat, as it allows > >>us to generate different output from the same source easily. This may > >>or may not be intersting for Nitro, but at least we should discuss it. > >> > > > > > > i like the gentoo doc stuff. when i was in the mood of documenting my > > lib long time ago :) i imitated the looks and added > > *direct-running-examples* and i like it still. > > http://www.xorc.org/xorcdoc/form_1.php > > Is anyone actually suggesting people write docs in XML? > aehm. *no*. what i do like is the layout. not the xml. i'd vote for markdown. -robert From citizen428 at gentoo.org Fri Sep 2 14:48:31 2005 From: citizen428 at gentoo.org (Michael Kohl) Date: Fri, 2 Sep 2005 20:48:31 +0200 Subject: [Nitro] Nitro Documentation Project (NDP) In-Reply-To: <43188965.30504@neurogami.com> References: <20050902141000.4f299d25@localhost> <5371ac740509020950632adac1@mail.gmail.com> <43188965.30504@neurogami.com> Message-ID: <20050902204831.1f7b056f@localhost> On Fri, 02 Sep 2005 10:18:29 -0700 James Britt wrote: > Is anyone actually suggesting people write docs in XML? I just offered it as a possibility. We (read Gentoo) write our docs in XML which has several advantages for our purposes. We do have a dedicated docs team though, and learning GuideXML takes a while, so I agree with you that I may not be the best alternative for what we're trying to achieve here. I like the RDOG-thingy that manveru is developing and together with a Wiki this could be really good for code-related documentation. Most probably a wiki will also be the best solution for in-depth HOWTOs etc. Cheers, Michael -- web at citizen428.net citizen428 at gentoo.org http://citizen428.net/ http://dev.gentoo.org/~citizen428/ GnuPG key: 0x90CA09E3/4D21 916E DBCE 72B8 CDC5 BD87 DE2D 91A2 90CA 09E3 From ulmo at valaraan.de Fri Sep 2 19:04:53 2005 From: ulmo at valaraan.de (manveru) Date: Sat, 03 Sep 2005 01:04:53 +0200 Subject: [Nitro] RDOG 0.2 (or something like that) In-Reply-To: <43189020.4020607@neurogami.com> References: <20050902141000.4f299d25@localhost> <5371ac740509020950632adac1@mail.gmail.com> <43188965.30504@neurogami.com> <43188D4E.6080207@valaraan.de> <43189020.4020607@neurogami.com> Message-ID: <4318DA95.2060506@valaraan.de> I'm happy i can announce the release of the new RDOG we've just finished the alpha of the new version - you can find it in the same place... i want to thank especially Vagabond for making this possible and protecting me from the bare evilness of rdoc ;) now we've got the why-wiki on the page as i'm not yet sure (and haven't tried out) if spark will behave like we want it to do... notice the little link to the wiki on the top :) maybe we find other solutions, but this should do for the moment i'm glad for everyone who points out bugs etc... hope you have fun with it :) >> you can see an early version at >> http://brutalrepublic.com:4567/doc > > I'm a bit overwhelmed by the redness, but otherwise this is quite > nice. More stuff to pilfer for ruby-doc.org! > BTW, I see you refer to it as RDOG up top. Have you considered "Red > Dog" as a project name? well, the redness is because of my lack of talent to design something properly :) in fact, we are searching still for a new name for the project... RDOG is somehow misleading but points out the fact of a ruby-documentation with og (wich is not yet true... due to some bugs with og) >> >> have rewritten it since the release of 0.23, but it should give you >> the taste (it's without the wiki, sorry - have to update the server >> sometime soon) >> >> i would be thankful for any kind of contribution, suggestions and so >> on... :) > > > I'll see what I can do to help out. > > James so long... manveru From james_b at neurogami.com Fri Sep 2 19:20:39 2005 From: james_b at neurogami.com (James Britt) Date: Fri, 02 Sep 2005 16:20:39 -0700 Subject: [Nitro] RDOG 0.2 (or something like that) In-Reply-To: <4318DA95.2060506@valaraan.de> References: <20050902141000.4f299d25@localhost> <5371ac740509020950632adac1@mail.gmail.com> <43188965.30504@neurogami.com> <43188D4E.6080207@valaraan.de> <43189020.4020607@neurogami.com> <4318DA95.2060506@valaraan.de> Message-ID: <4318DE47.8080402@neurogami.com> manveru wrote: > I'm happy i can announce the release of the new RDOG > > we've just finished the alpha of the new version - you can find it in > the same place... Is there a link to download the code? James From ulmo at valaraan.de Fri Sep 2 21:20:20 2005 From: ulmo at valaraan.de (manveru) Date: Sat, 03 Sep 2005 03:20:20 +0200 Subject: [Nitro] RDOG 0.2 (or something like that) In-Reply-To: <4318DE47.8080402@neurogami.com> References: <20050902141000.4f299d25@localhost> <5371ac740509020950632adac1@mail.gmail.com> <43188965.30504@neurogami.com> <43188D4E.6080207@valaraan.de> <43189020.4020607@neurogami.com> <4318DA95.2060506@valaraan.de> <4318DE47.8080402@neurogami.com> Message-ID: <4318FA54.9030908@valaraan.de> i'm sorry i cannot provide the source yet... should be possible tomorrow... i am also very sorry the server doesn't work all the time - in fact it's just a ssh and i cannot keep it open all the time. if you know some place where i can run the server as well as upload the tarball i would be really thankful... it's hard to find a place for a nitroserver, i'll probably get a virtual box somewhere, but that takes some time. for the time being, please be patient, i'm working to solve that problem James Britt wrote: > manveru wrote: > >> I'm happy i can announce the release of the new RDOG >> >> we've just finished the alpha of the new version - you can find it in >> the same place... > > > Is there a link to download the code? > > > James From james_b at neurogami.com Fri Sep 2 23:40:23 2005 From: james_b at neurogami.com (James Britt) Date: Fri, 02 Sep 2005 20:40:23 -0700 Subject: [Nitro] RDOG 0.2 (or something like that) In-Reply-To: <4318FA54.9030908@valaraan.de> References: <20050902141000.4f299d25@localhost> <5371ac740509020950632adac1@mail.gmail.com> <43188965.30504@neurogami.com> <43188D4E.6080207@valaraan.de> <43189020.4020607@neurogami.com> <4318DA95.2060506@valaraan.de> <4318DE47.8080402@neurogami.com> <4318FA54.9030908@valaraan.de> Message-ID: <43191B27.1040806@neurogami.com> manveru wrote: > i'm sorry i cannot provide the source yet... should be possible > tomorrow... i am also very sorry the server doesn't work all the time - > in fact it's just a ssh and i cannot keep it open all the time. > if you know some place where i can run the server as well as upload the > tarball i would be really thankful... it's hard to find a place for a > nitroserver, i'll probably get a virtual box somewhere, but that takes > some time. Have you considered hosting putting the code on rubyforge.org? James -- http://www.ruby-doc.org - The Ruby Documentation Site http://www.rubyxml.com - News, Articles, and Listings for Ruby & XML http://www.rubystuff.com - The Ruby Store for Ruby Stuff http://www.jamesbritt.com - Playing with Better Toys From george.moschovitis at gmail.com Fri Sep 2 23:45:01 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sat, 3 Sep 2005 06:45:01 +0300 Subject: [Nitro] Vacation Message-ID: Hello, everyone, I 'll have no Internet access this weekend (small vacations time ;-)). Be patient with those questions till monday! -g. -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From george.moschovitis at gmail.com Fri Sep 2 23:45:34 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sat, 3 Sep 2005 06:45:34 +0300 Subject: [Nitro] fix for form mixing for admin pages In-Reply-To: <20050902171505.GG828@localhost> References: <20050902171505.GG828@localhost> Message-ID: already seen and fixed that. -g. On 9/2/05, Tim Larson wrote: > When a table has no relations (strange in production, but > possible during in-between stages of early development) > the form mixin fails. Line 88 of nitro/mixin/form.rb > needs to be changed to allow for nil. > > From: for rel in obj.class.relations > To: for rel in obj.class.relations || [] > > --Tim Larson > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From george.moschovitis at gmail.com Fri Sep 2 23:46:20 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Sat, 3 Sep 2005 06:46:20 +0300 Subject: [Nitro] Admin pages, fill excludes 'name' In-Reply-To: <20050902173555.GH828@localhost> References: <20050902173555.GH828@localhost> Message-ID: An older version of Og handled name as a text key. I 'll remove this. thanks for reporting. -g. On 9/2/05, Tim Larson wrote: > I know the admin pages are alpha/beta/etc. but they seem > very useful too. While working with them I noticed that > #fill explicitly filters out 'name' and 'oid'...what makes > 'name' especially unsafe? It seems like too common a > field name to be making it hard to handle, unless there > is a good reason... > > --Tim Larson > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From citizen428 at gentoo.org Sat Sep 3 05:18:13 2005 From: citizen428 at gentoo.org (Michael Kohl) Date: Sat, 3 Sep 2005 11:18:13 +0200 Subject: [Nitro] RDOG 0.2 (or something like that) In-Reply-To: <4318DA95.2060506@valaraan.de> References: <20050902141000.4f299d25@localhost> <5371ac740509020950632adac1@mail.gmail.com> <43188965.30504@neurogami.com> <43188D4E.6080207@valaraan.de> <43189020.4020607@neurogami.com> <4318DA95.2060506@valaraan.de> Message-ID: <20050903111813.3e86147e@localhost> On Sat, 03 Sep 2005 01:04:53 +0200 manveru wrote: > now we've got the why-wiki on the page as i'm not yet sure (and > haven't tried out) if spark will behave like we want it to do... It would be cool if you can try this out, because I think it would be pretty cool if the Nitro API docs are hosted by Nitro itself. :) And I really think that RDOG will be the best solution for code-level documentation of Nitro, which has two benefits: We have a cool system that is a nice mix of static informatin plus the dynamic content a Wiki provides. Additionally lots (hopefully ;) of people will use your project, which may help to elimate bugs faster. Cheers, Michael -- web at citizen428.net citizen428 at gentoo.org http://citizen428.net/ http://dev.gentoo.org/~citizen428/ GnuPG key: 0x90CA09E3/4D21 916E DBCE 72B8 CDC5 BD87 DE2D 91A2 90CA 09E3 From vagabond at cataclysm-software.net Sat Sep 3 09:02:46 2005 From: vagabond at cataclysm-software.net (Andrew Thompson) Date: Sat, 03 Sep 2005 15:02:46 +0200 Subject: [Nitro] RDOG 0.2 (or something like that) In-Reply-To: <20050903111813.3e86147e@localhost> References: <20050902141000.4f299d25@localhost> <5371ac740509020950632adac1@mail.gmail.com> <43188965.30504@neurogami.com> <43188D4E.6080207@valaraan.de> <43189020.4020607@neurogami.com> <4318DA95.2060506@valaraan.de> <20050903111813.3e86147e@localhost> Message-ID: <43199EF6.1010809@cataclysm-software.net> Michael Kohl wrote: > It would be cool if you can try this out, because I think it would be > pretty cool if the Nitro API docs are hosted by Nitro itself. :) > > And I really think that RDOG will be the best solution for code-level > documentation of Nitro, which has two benefits: We have a cool system > that is a nice mix of static informatin plus the dynamic content a Wiki > provides. Additionally lots (hopefully ;) of people will use your > project, which may help to elimate bugs faster. > > Cheers, > Michael > We're certainly planning on integrating the wiki better, I'm thinking the static info at the top, the source code, and then the wiki entry so people can fill in the blanks and clarify things, heck we could even use the wiki data (filtered and edited) to improve the in-code documentation via submitting patches. One of the problems relating to releasing the source is that its not possible to generate the data for rdog without a modified rdoc. To get the data I wanted I've had to hack in things like C constant parsing, file seperation (so I can tell what function for a class/module was defined in what file) and some other minor stuff. My patches probably break current rdoc generators, so I doubt I'll be able to submit them (well the C constants one, and the C source code line detection might make it in). I'll probably have to figure out some tricks to override the rdoc functions I've changed or something so I don't have to distribute an entire rdoc install. Another issue is we're still storing info in YAML (og still doesn't seem to want to play nice with inherited classes), so there's a big chunk of data we'll need to bundle with the src. If manveru doesn't turn up soon I'll roll a tarball myself and host it for you guys, I can host files no problem, its just we need a proper nitro/og enabled host to run rdog on. Also, any devs interested in helping, we have a private svn repo. I'd open it to the public, but technically my ISP says no servers of any kind, and I don't want them to catch on :). Contact me or manveru if you'd like to help out. Andrew - The *other* RDOG hacker From ulmo at valaraan.de Sat Sep 3 14:41:11 2005 From: ulmo at valaraan.de (manveru) Date: Sat, 03 Sep 2005 20:41:11 +0200 Subject: [Nitro] deadlock ?? (webrick, nitro and nano) In-Reply-To: References: Message-ID: <4319EE47.7000509@valaraan.de> Hi list, i've just extended spark (0.5) with the rdog-stuff, and get these lines everytime i load a page (page gets to the browser, but webrick dies painful in the background --------------------- DEBUG: Rendering '/doc/core/Array'. DEBUG: Compiling action 'DocController#core' deadlock 0x40aa9fdc: run:- - (null):0 deadlock 0x40b3b4f0: sleep:T(1125772343.078191) - /usr/lib/ruby/gems/1.8/gems/nano-0.8.2/lib/nano/kernel/autoreload.rb:15 deadlock 0x402f2748: sleep:ST(1125772342.577432) (main) - /usr/lib/ruby/1.8/webrick/server.rb:91 deadlock 0x40b32490: sleep:T(1125772371.313616) - /usr/lib/ruby/1.8/timeout.rb:42 ---------------------------- after he spits out these lines, no strg+c of the world gives me back my shell, i have to 'killall ruby'... any idea what this is? i suppose some overload because of incompatibility between nano and webrick, but i'm not sure... it just doesn't make any sense to me. maybe someone who knows webrick better could help? i'm not sure if the problem is solved by running it on apache... have to get ruby running on it first. so long... manveru From ulmo at valaraan.de Sat Sep 3 14:44:43 2005 From: ulmo at valaraan.de (manveru) Date: Sat, 03 Sep 2005 20:44:43 +0200 Subject: [Nitro] deadlock ?? (webrick, nitro and nano) In-Reply-To: <4319EE47.7000509@valaraan.de> References: <4319EE47.7000509@valaraan.de> Message-ID: <4319EF1B.80407@valaraan.de> manveru wrote: > Hi list, > > i've just extended spark (0.5) with the rdog-stuff, and get these > lines everytime i load a page (page gets to the browser, but webrick > dies painful in the background > > --------------------- > DEBUG: Rendering '/doc/core/Array'. > DEBUG: Compiling action 'DocController#core' > deadlock 0x40aa9fdc: run:- - (null):0 > deadlock 0x40b3b4f0: sleep:T(1125772343.078191) - > /usr/lib/ruby/gems/1.8/gems/nano-0.8.2/lib/nano/kernel/autoreload.rb:15 > deadlock 0x402f2748: sleep:ST(1125772342.577432) (main) - > /usr/lib/ruby/1.8/webrick/server.rb:91 > deadlock 0x40b32490: sleep:T(1125772371.313616) - > /usr/lib/ruby/1.8/timeout.rb:42 forgot that the first time i start webrick again after ruby was killed, it let me surf 2-3 pages after dying with deadlock 0x40b1208c: run:-/usr/lib/ruby/1.8/timeout.rb:42: [BUG] Segmentation fault ruby 1.8.3 (2005-06-23) [i486-linux] > ---------------------------- > > after he spits out these lines, no strg+c of the world gives me back > my shell, i have to 'killall ruby'... > any idea what this is? > i suppose some overload because of incompatibility between nano and > webrick, but i'm not sure... it just doesn't make any sense to me. > maybe someone who knows webrick better could help? > i'm not sure if the problem is solved by running it on apache... have > to get ruby running on it first. > > so long... > manveru > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > From ulmo at valaraan.de Sat Sep 3 16:24:59 2005 From: ulmo at valaraan.de (manveru) Date: Sat, 03 Sep 2005 22:24:59 +0200 Subject: [Nitro] deadlock ?? (webrick, nitro and nano) In-Reply-To: <4319EE47.7000509@valaraan.de> References: <4319EE47.7000509@valaraan.de> Message-ID: <431A069B.5030703@valaraan.de> manveru wrote: > Hi list, > > i've just extended spark (0.5) with the rdog-stuff, and get these > lines everytime i load a page (page gets to the browser, but webrick > dies painful in the background > > --------------------- > DEBUG: Rendering '/doc/core/Array'. > DEBUG: Compiling action 'DocController#core' > deadlock 0x40aa9fdc: run:- - (null):0 > deadlock 0x40b3b4f0: sleep:T(1125772343.078191) - > /usr/lib/ruby/gems/1.8/gems/nano-0.8.2/lib/nano/kernel/autoreload.rb:15 > deadlock 0x402f2748: sleep:ST(1125772342.577432) (main) - > /usr/lib/ruby/1.8/webrick/server.rb:91 > deadlock 0x40b32490: sleep:T(1125772371.313616) - > /usr/lib/ruby/1.8/timeout.rb:42 > ---------------------------- > > after he spits out these lines, no strg+c of the world gives me back > my shell, i have to 'killall ruby'... > any idea what this is? > i suppose some overload because of incompatibility between nano and > webrick, but i'm not sure... it just doesn't make any sense to me. > maybe someone who knows webrick better could help? > i'm not sure if the problem is solved by running it on apache... have > to get ruby running on it first. > > so long... > manveru > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > i guess i solved the problem. i had this in the run.rb Nitro::Server.map = { '/' => WikiController, '/doc' => DocController, '/wiki' => WikiController } and after i removed the second WikiController, the problem was solved, i'm using sqlite3 for the database, maybe there were two calls to the same db wich broke the scheduler of ruby... may be a deeper bug. just as a reminder - never declare two paths to the same controller while using sqlite3 :) maybe this should be the first entry to the Nitro::Server.map entry in the rdog-wiki ;) so long... manveru From ulmo at valaraan.de Sat Sep 3 16:48:25 2005 From: ulmo at valaraan.de (manveru) Date: Sat, 03 Sep 2005 22:48:25 +0200 Subject: [Nitro] deadlock ?? (webrick, nitro and nano) In-Reply-To: <4319EE47.7000509@valaraan.de> References: <4319EE47.7000509@valaraan.de> Message-ID: <431A0C19.1020103@valaraan.de> manveru wrote: > Hi list, > > i've just extended spark (0.5) with the rdog-stuff, and get these > lines everytime i load a page (page gets to the browser, but webrick > dies painful in the background > > --------------------- > DEBUG: Rendering '/doc/core/Array'. > DEBUG: Compiling action 'DocController#core' > deadlock 0x40aa9fdc: run:- - (null):0 > deadlock 0x40b3b4f0: sleep:T(1125772343.078191) - > /usr/lib/ruby/gems/1.8/gems/nano-0.8.2/lib/nano/kernel/autoreload.rb:15 > deadlock 0x402f2748: sleep:ST(1125772342.577432) (main) - > /usr/lib/ruby/1.8/webrick/server.rb:91 > deadlock 0x40b32490: sleep:T(1125772371.313616) - > /usr/lib/ruby/1.8/timeout.rb:42 > ---------------------------- > > after he spits out these lines, no strg+c of the world gives me back > my shell, i have to 'killall ruby'... > any idea what this is? > i suppose some overload because of incompatibility between nano and > webrick, but i'm not sure... it just doesn't make any sense to me. > maybe someone who knows webrick better could help? > i'm not sure if the problem is solved by running it on apache... have > to get ruby running on it first. > > so long... > manveru > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > i tried that in a fresh and clean version of spark, i changed only the Og.setup in the run.rb to this: ----------------------------- Og.setup( # :destroy => true, :store => :sqlite, :name => 'spark', :user => 'root', :password => 'navelrulez' ) --------------------------- hope it helps to track down the problem... i remember ysabel said something about sqlite not fully supported or something but as it is, i rely on it, or on the filesys - but that is official broken... From ulmo at valaraan.de Sat Sep 3 20:06:31 2005 From: ulmo at valaraan.de (manveru) Date: Sun, 04 Sep 2005 02:06:31 +0200 Subject: [Nitro] deadlock ?? (webrick, nitro and nano) In-Reply-To: <431A0C19.1020103@valaraan.de> References: <4319EE47.7000509@valaraan.de> <431A0C19.1020103@valaraan.de> Message-ID: <431A3A87.9060803@valaraan.de> Hi list, after some hours of helpless searching finally Aria came up with a simple solution. for sqlite and postgres, you have to do that: Og.thread_safe = false Og.setup(:store => :sqlite, :name => 'spark') appearently this is a known bug at some place and will be fixed... there are some problems with webrick and Og, but nothing i think i could fix. with that setting, you may get a Timeout-error in your browser every n pages, but the server would crash otherwise, so i think it's a good temporary solution. so long... manveru From dcorbin at machturtle.com Sat Sep 3 21:13:51 2005 From: dcorbin at machturtle.com (David Corbin) Date: Sat, 3 Sep 2005 21:13:51 -0400 Subject: [Nitro] Nitro and rubyscript2exe In-Reply-To: References: <430BF3B2.6020804@neurogami.com> <4b6f054f05082822226dccf2e1@mail.gmail.com> Message-ID: <200509032113.52413.dcorbin@machturtle.com> On Monday 29 August 2005 02:58 am, George Moschovitis wrote: > > Ah who r we kidn Amiga was the best. > > You never forget your first love, Atari ST was the best computer :-) > > -g. Dare I cast a vote for the Altair 8800? (w 256 bytes of RAM.) From rainhead at gmail.com Sun Sep 4 03:37:22 2005 From: rainhead at gmail.com (Peter Abrahamsen) Date: Sun, 4 Sep 2005 00:37:22 -0700 Subject: [Nitro] RDOG 0.2 (or something like that) In-Reply-To: <43199EF6.1010809@cataclysm-software.net> References: <20050902141000.4f299d25@localhost> <5371ac740509020950632adac1@mail.gmail.com> <43188965.30504@neurogami.com> <43188D4E.6080207@valaraan.de> <43189020.4020607@neurogami.com> <4318DA95.2060506@valaraan.de> <20050903111813.3e86147e@localhost> <43199EF6.1010809@cataclysm-software.net> Message-ID: rdog now has an svn repository, located for the time being at: http://rdog.lly.org/rdog-svn/ (not hosted at lly, it's just a really short name) (I think we're gonna move to rubyforge at some point, not sure what's up with that) (If you're supposed to have commit access, send me a user name and password, preferably run through htpasswd2.) Go Crazy, P From transfire at gmail.com Sun Sep 4 06:07:14 2005 From: transfire at gmail.com (TRANS) Date: Sun, 4 Sep 2005 06:07:14 -0400 Subject: [Nitro] nitro.rb load mojo Message-ID: <4b6f054f05090403077ffe2341@mail.gmail.com> Not sure what this is all about in nitro.rb: unless $NITRO_NO_ENVIRONMENT # Setup up the proposed environment. You are free # to skip this if you dont like it. Just set # # $NITRO_NO_ENVIRONMENT = true # # before requiring nitro. Dir.chdir(File.dirname($0)) # Application code come here. $LOAD_PATH.unshift 'src' # Library code come here. $LOAD_PATH.unshift 'lib' end But it kills nitrogen. At first I thought it was RubyGems and I doltfully spouted on ruby-talk :O/ Oh well, I don't like RubyGems anyway |-) Thanks, T. From reid.thompson at ateb.com Sun Sep 4 09:35:41 2005 From: reid.thompson at ateb.com (Reid Thompson) Date: Sun, 04 Sep 2005 09:35:41 -0400 Subject: [Nitro] nitro.rb load mojo In-Reply-To: <4b6f054f05090403077ffe2341@mail.gmail.com> References: <4b6f054f05090403077ffe2341@mail.gmail.com> Message-ID: <431AF82D.6090704@ateb.com> TRANS wrote: >Not sure what this is all about in nitro.rb: > > unless $NITRO_NO_ENVIRONMENT > # Setup up the proposed environment. You are free > # to skip this if you dont like it. Just set > # > # $NITRO_NO_ENVIRONMENT = true > # > # before requiring nitro. > > Dir.chdir(File.dirname($0)) > > # Application code come here. > > $LOAD_PATH.unshift 'src' > > # Library code come here. > > $LOAD_PATH.unshift 'lib' > end > >But it kills nitrogen. At first I thought it was RubyGems and I >doltfully spouted on ruby-talk :O/ Oh well, I don't like RubyGems >anyway |-) > >Thanks, >T. > >_______________________________________________ >Nitro-general mailing list >Nitro-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/nitro-general > > looks to me like it's telling Nitro where things reside -- i.e. tells Nitro that the application code resides in the environments src directory and that library code resides in lib. If you set it to true, then you're prob going to have to tell Nitro where you've decided to place the src and libs... From transfire at gmail.com Sun Sep 4 10:55:07 2005 From: transfire at gmail.com (TRANS) Date: Sun, 4 Sep 2005 10:55:07 -0400 Subject: [Nitro] nitro.rb load mojo In-Reply-To: <431AF82D.6090704@ateb.com> References: <4b6f054f05090403077ffe2341@mail.gmail.com> <431AF82D.6090704@ateb.com> Message-ID: <4b6f054f05090407557d9564d6@mail.gmail.com> On 9/4/05, Reid Thompson wrote: > looks to me like it's telling Nitro where things reside -- i.e. tells > Nitro that the application code resides in the environments src > directory and that library code resides in lib. If you set it to true, > then you're prob going to have to tell Nitro where you've decided to > place the src and libs... Not so sure. $0 contains the path of the file being executed, so if you go to a nitro apps dir and type ruby run.rb Then it changes the pwd dir to the current directory and then sticks current_dir/lib and current_dir/src on the search path. I know I'm missing whatever it is that George is using this for, but still that pretty assuming (esspecailyl changing the working dir) --I suspect there a better way to handle whatever this is for. Anyway I just got rid of it and it works. (well sort of, now I'm dealing with Apache2 configuration) T. From transfire at gmail.com Sun Sep 4 10:56:45 2005 From: transfire at gmail.com (TRANS) Date: Sun, 4 Sep 2005 10:56:45 -0400 Subject: [Nitro] Apache2 Message-ID: <4b6f054f050904075657fd88dc@mail.gmail.com> Anyone have a working Apache2 Virtual Host configuration working with Nitro? Nitro works under Webrick, but under Apahce2 I'm getting 400 Bad Request Error. Thanks, T. From Aleksi.Niemela at cs.helsinki.fi Sun Sep 4 11:06:38 2005 From: Aleksi.Niemela at cs.helsinki.fi (Aleksi Niemela) Date: Sun, 04 Sep 2005 18:06:38 +0300 Subject: [Nitro] Apache2 In-Reply-To: <4b6f054f050904075657fd88dc@mail.gmail.com> References: <4b6f054f050904075657fd88dc@mail.gmail.com> Message-ID: <431B0D7E.5040400@cs.helsinki.fi> TRANS kirjoitti: >Anyone have a working Apache2 Virtual Host configuration working with Nitro? > >Nitro works under Webrick, but under Apahce2 I'm getting 400 Bad Request Error. > > I've not set up Apache nor Nitro but I wonder if Nitro would go in place along the Rails lines: http://www.rails4days.pwp.blueyonder.co.uk/Rails4Days.pdf On page 7 (numbered 3 on bottom of text page), you can see how Virtual host is set up for Rails. Also many examples and nitrogen seem to carry some form of Apache configuration I assume George is using. But as said, I haven't tried any of these. - Aleksi From nospam at lunacymaze.org Sun Sep 4 11:10:40 2005 From: nospam at lunacymaze.org (Ghislain Mary) Date: Sun, 04 Sep 2005 17:10:40 +0200 Subject: [Nitro] Nitro Documentation Project (NDP) In-Reply-To: <20050902141000.4f299d25@localhost> References: <20050902141000.4f299d25@localhost> Message-ID: <431B0E70.5070903@lunacymaze.org> I'd be happy to help with this. Unfortunatly I hadn't got the time to follow the progression of to nitro in the last weeks due to some vacations, to the end of my studies, the beginning of my first real world job, and to some time consecrated to my girlfriend. So I'll have to look at all the new features before I can really help, but if there are tasks to share between several persons I can certainly do some things. I also propose myself for the translation in french. So, don't hesitate to contact me. Regards, Ghislain From transfire at gmail.com Sun Sep 4 11:21:55 2005 From: transfire at gmail.com (TRANS) Date: Sun, 4 Sep 2005 11:21:55 -0400 Subject: [Nitro] Apache2 In-Reply-To: <431B0D7E.5040400@cs.helsinki.fi> References: <4b6f054f050904075657fd88dc@mail.gmail.com> <431B0D7E.5040400@cs.helsinki.fi> Message-ID: <4b6f054f0509040821186599a8@mail.gmail.com> On 9/4/05, Aleksi Niemela wrote: > TRANS kirjoitti: > > >Anyone have a working Apache2 Virtual Host configuration working with Nitro? > > > >Nitro works under Webrick, but under Apahce2 I'm getting 400 Bad Request Error. > > > > > I've not set up Apache nor Nitro but I wonder if Nitro would go in place > along the Rails lines: > > http://www.rails4days.pwp.blueyonder.co.uk/Rails4Days.pdf > > On page 7 (numbered 3 on bottom of text page), you can see how Virtual > host is set up for Rails. Also many examples and nitrogen seem to carry > some form of Apache configuration I assume George is using. But as said, > I haven't tried any of these. Thanks Aleksi, It seems the problem is two fold. First the rewrite rules given in Nitro's apache.conf example gives the 400 Error: RewriteEngine On RewriteRule ^$ index.html [QSA] RewriteRule ^([^.]+)$ $1.html [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ dispatch.cgi [QSA,L] So I'm not bothering with that at the moment and have remarked it out. But secondly, Mozilla Browser on Ubuntu Linux is picky about xml content. The nitrogen produced app's index.xhtml has an xml error --a missing , and secondly the header needs to be: T. > > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- ( o) ??? // trans. / / transfire at gmail.com From Aleksi.Niemela at cs.helsinki.fi Sun Sep 4 11:57:04 2005 From: Aleksi.Niemela at cs.helsinki.fi (Aleksi Niemela) Date: Sun, 04 Sep 2005 18:57:04 +0300 Subject: [Nitro] Idiom to pass multiple parameters Message-ID: <431B1950.7030802@cs.helsinki.fi> I know this is the usual way to introduce an action: def categories # do something useful with @category end action :categories, :route => /category\/(.*)/, 'category' => nil But how should I pass on multiple parameters? Url format of /foo/84/bar/3902 doesn't look outright horrible but can stay quite pretty for few parameters. It's surely more of a nuisance with dozens of parameters. Therefore I thought to go with /foo/84?bar=3902 Is this the "right way" to do it? If this is the path, is the following the way to get the parameters to use them? foo.xhtml: ec.name) ?> bar controller.rb: def categories params = UriUtils.query_string_to_hash(request.query_string) @bar = params["bar"] # use foo and bar in a useful way end action :categories, :route => /category\/(.*)/, 'category' => nil I find this way quite a bit clumsy. But if that's the way to work around I guess I'm forced to write up interception for an action method to set instance variables behind the scenes and gotta do something for the url building too. I hope I've missed some elementary step but couldn't find any more complex actions in Spark. It was Pager mixin that showed me this way. Or should I start using session or head my way to Wee like page storing? - Aleksi From james_b at neurogami.com Sun Sep 4 14:12:33 2005 From: james_b at neurogami.com (James Britt) Date: Sun, 04 Sep 2005 11:12:33 -0700 Subject: [Nitro] Idiom to pass multiple parameters In-Reply-To: <431B1950.7030802@cs.helsinki.fi> References: <431B1950.7030802@cs.helsinki.fi> Message-ID: <431B3911.80000@neurogami.com> Aleksi Niemela wrote: > I know this is the usual way to introduce an action: > > def categories > # do something useful with @category > end > action :categories, :route => /category\/(.*)/, 'category' => nil > > But how should I pass on multiple parameters? Url format of > > /foo/84/bar/3902 > > doesn't look outright horrible but can stay quite pretty for few > parameters. It's surely more of a nuisance with dozens of parameters. I've used that sort of format in a few different cases, where I sort of treat the URL as a command line. The way I would map this is: action :categories, :route => /category \/(.+)/, 'param_url' => String Then your method code can take the @param_url string and parse it as it wishes. In my case, I've been poking around with different ways to encode complex request params, so I wanted things that look like this: www.exmple.com/find/foo/bar+baz/ick,blick,ploo[foz] James -- http://www.ruby-doc.org - The Ruby Documentation Site http://www.rubyxml.com - News, Articles, and Listings for Ruby & XML http://www.rubystuff.com - The Ruby Store for Ruby Stuff http://www.jamesbritt.com - Playing with Better Toys From Aleksi.Niemela at cs.helsinki.fi Sun Sep 4 15:24:43 2005 From: Aleksi.Niemela at cs.helsinki.fi (Aleksi Niemela) Date: Sun, 04 Sep 2005 22:24:43 +0300 Subject: [Nitro] How iterate efficiently through collection of 'things'? Message-ID: <431B49FB.2010409@cs.helsinki.fi> Imagine the program gets some parameters out from user with first page, calculates a while and wants to show very big result set on multiple pages. To get this concrete, imagine user says "I want to see all known pieces of DNA which (approximately) match with this one I give you", then the program goes out to make a query and gets back with 900 best hits. Then it should show one piece of DNA, the match highlighted, per page and let the user go through Pager kind of list to get back and forth within proximity of current hit, and have quick access to the ends of the hit list. Now, we don't want to make the query for the DNA database server each time user clicks "next hit". Some kind of temporary storage is needed for the results. Where one should store the results in Nitro development? In Wee, I'd have an instance variable at the Controller object pointing to the result set and another indicating index. In Nitro the controller object lives only during one page generation. Nitro::Flash is can be used on temporary storage either, it's too short living. OTOH, Nitro discourages using session object and using state that's not persistent at all, like said at Nitro::Session rdocs State is a neccessary evil but session variables should be avoided as much as possible. Session state is typically distributed to many servers so avoid storing complete objects in session variables, only store oids and small integer/strings. I suppose one could misuse Caching, namely MemoryStore. What's the idiom here? How and where the MemoryStore should be instantiated and cleaned up? What's the preferable way to use it? I guess there's currently no example for this, so it would be great if someone (George, perhaps) could cook up a simple example providing answer this quite common need. - Aleksi From ulmo at valaraan.de Sun Sep 4 17:36:41 2005 From: ulmo at valaraan.de (manveru) Date: Sun, 04 Sep 2005 23:36:41 +0200 Subject: [Nitro] Og - mysql.sock Message-ID: <431B68E9.30403@valaraan.de> hi list, i was trying to get mysql running today on a debian-testing box, and i noticed they are doing odd things to mysql... but what me annoyed most, was that they have the mysql.sock not like everyone else in '/tmp/mysql.sock' - nah... - they had to put it in '/var/run/mysqld/mysqld.sock' well, i guess that someone else may stumble upon that too, and i just wanted to provide that information. ysabel, i have altered the Og.setup for mysql to ----------------------------------------------- Og.setup( #~ :destroy => true, :store => :mysql, :name => 'spark', :user => 'root', :password => 'mine :)', #~ :port => 3306, :socket => '/var/run/mysqld/mysqld.sock' ) ---------------------------------------------- and changed the '/lib/og/store/mysql.rb':117 ---------------------------------------------- @conn = Mysql.connect( options[:address] || 'localhost', options[:user], options[:password], options[:name], options[:port], options[:socket] ) ---------------------------------------------- i had to provide a option for the port before the socket too because the real_connect expects it and i don't want to mix up with your defaults, but none of the options is a must-have of course... hope that helps somebody, and maybe this could be added in a future version... i'll write a little help-text for the Og.setup later too, because it doesn't helped me much as it is - just some describing of how to use wich database and known bugs... so long... manveru From epiperak at softlab.ece.ntua.gr Sun Sep 4 21:15:18 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Mon, 5 Sep 2005 04:15:18 +0300 (EEST) Subject: [Nitro] MySQL... Message-ID: Manveru: I am using a Debian Sarge box and MySQL. I had no problem like the one you described :-/ OG works fine ... Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From rainhead at gmail.com Mon Sep 5 01:08:19 2005 From: rainhead at gmail.com (Peter Abrahamsen) Date: Sun, 4 Sep 2005 22:08:19 -0700 Subject: [Nitro] @template_root not set for secondary controllers Message-ID: <145C99CC-8FBF-4CFC-B00D-DDAD45F1AD1D@gmail.com> Hi, Nitro 0.23, everything up to date. I'm defining a controller-specific template_root, which compiler.rb appears to support. Here's some of the code: class PlayerController < Nitro::Controller include Nitro::XhtmlMixin # TODO caching, some day @@template_root = 'template/player' ... end I put a debug line in nitro/compiler.rb, at line 106: if cklass.respond_to?(:template_root) template_root = cklass.template_root Logger.debug "got template_root #{template_root} from # {cklass.to_s}" end the debug log is as follows: DEBUG: SELECT * FROM ogplayer WHERE oid=1 DEBUG: Rendering '/players/root'. DEBUG: Compiling action 'PlayerController#root' DEBUG: got template_root template from PlayerController DEBUG: got template_root from Nitro::Controller This is weird. I tried setting @template_root in initialize instead of @@template_root in the class, but the exact same thing happens. If I set PlayerController to be the default controller, drop the @template_root setting (and keep Template.root, which was there before), and move things to 'template' instead of 'template/player', everything's fine. Any ideas? Thanks, P From epiperak at softlab.ece.ntua.gr Mon Sep 5 02:33:42 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Mon, 5 Sep 2005 09:33:42 +0300 (EEST) Subject: [Nitro] Og and Relations/Queries Message-ID: Hi all, I have to implement a kind of custom security system, so I have User, Group, and Project classes like this: class User property :login, String has_many :groups, Group end class Group property :name, String belongs_to :user, User has_many :projects, Project end class Project belongs_to :group, Group # Returns all the projects that belong to the groups # that the currently logged in User belongs to def g_all @projects = User[session[:user_oid]].groups.projects end end Supposing that in session[:user_oid] I have the oid of the currently logged in user, would the g_all function work? Thanx Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From george.moschovitis at gmail.com Mon Sep 5 02:53:50 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Mon, 5 Sep 2005 09:53:50 +0300 Subject: [Nitro] deadlock ?? (webrick, nitro and nano) In-Reply-To: <431A3A87.9060803@valaraan.de> References: <4319EE47.7000509@valaraan.de> <431A0C19.1020103@valaraan.de> <431A3A87.9060803@valaraan.de> Message-ID: Hello, thanks for reporting, I 'll investigate this. I am pretty sure this has nothing to do with multiple controllers mounted to the same point. -g. On 9/4/05, manveru wrote: > Hi list, > > after some hours of helpless searching finally Aria came up with a > simple solution. > for sqlite and postgres, you have to do that: > > Og.thread_safe = false > Og.setup(:store => :sqlite, :name => 'spark') > > appearently this is a known bug at some place and will be fixed... > there are some problems with webrick and Og, but nothing i think i could > fix. > > with that setting, you may get a Timeout-error in your browser every n > pages, but the server would crash otherwise, so i think it's a good > temporary solution. > > so long... > manveru > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From george.moschovitis at gmail.com Mon Sep 5 02:55:59 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Mon, 5 Sep 2005 09:55:59 +0300 Subject: [Nitro] RDOG 0.2 (or something like that) In-Reply-To: <43199EF6.1010809@cataclysm-software.net> References: <20050902141000.4f299d25@localhost> <5371ac740509020950632adac1@mail.gmail.com> <43188965.30504@neurogami.com> <43188D4E.6080207@valaraan.de> <43189020.4020607@neurogami.com> <4318DA95.2060506@valaraan.de> <20050903111813.3e86147e@localhost> <43199EF6.1010809@cataclysm-software.net> Message-ID: > (og still doesn't seem to want to play nice with inherited classes), what is the problem exactly? -g. -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From george.moschovitis at gmail.com Mon Sep 5 03:03:44 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Mon, 5 Sep 2005 10:03:44 +0300 Subject: [Nitro] nitro.rb load mojo In-Reply-To: <4b6f054f05090407557d9564d6@mail.gmail.com> References: <4b6f054f05090403077ffe2341@mail.gmail.com> <431AF82D.6090704@ateb.com> <4b6f054f05090407557d9564d6@mail.gmail.com> Message-ID: Thanks for pointing this out! This mechanism was used to provide some default places where to put stuff that you could require in your application. For example the src and lib dirs in your application directory are automatically added to the LOAD_PATH. Btw, I don't use require 'my_stuff.rb' in my projects any more. As suggested by M.Neumann I use the cleaner: require 'src/my_stuff.rb' so perhaps this code should be removed. -g. On 9/4/05, TRANS wrote: > On 9/4/05, Reid Thompson wrote: > > looks to me like it's telling Nitro where things reside -- i.e. tells > > Nitro that the application code resides in the environments src > > directory and that library code resides in lib. If you set it to true, > > then you're prob going to have to tell Nitro where you've decided to > > place the src and libs... > > Not so sure. $0 contains the path of the file being executed, so if > you go to a nitro apps dir and type > > ruby run.rb > > Then it changes the pwd dir to the current directory and then sticks > current_dir/lib and current_dir/src on the search path. I know I'm > missing whatever it is that George is using this for, but still that > pretty assuming (esspecailyl changing the working dir) --I suspect > there a better way to handle whatever this is for. > > Anyway I just got rid of it and it works. (well sort of, now I'm > dealing with Apache2 configuration) > > T. > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From george.moschovitis at gmail.com Mon Sep 5 03:04:40 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Mon, 5 Sep 2005 10:04:40 +0300 Subject: [Nitro] nitro.rb load mojo In-Reply-To: <4b6f054f05090403077ffe2341@mail.gmail.com> References: <4b6f054f05090403077ffe2341@mail.gmail.com> Message-ID: > But it kills nitrogen. At first I thought it was RubyGems and I > doltfully spouted on ruby-talk :O/ Oh well, I don't like RubyGems > anyway |-) Interstingly I also thought, this is a Gems bug ;-) -g. -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From george.moschovitis at gmail.com Mon Sep 5 03:06:08 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Mon, 5 Sep 2005 10:06:08 +0300 Subject: [Nitro] Apache2 In-Reply-To: <4b6f054f0509040821186599a8@mail.gmail.com> References: <4b6f054f050904075657fd88dc@mail.gmail.com> <431B0D7E.5040400@cs.helsinki.fi> <4b6f054f0509040821186599a8@mail.gmail.com> Message-ID: I have run Nitro applications with Apache and FastCGI with the suplied example. But I haven't verified it with the latest version. I 'll check this again. regards, George. On 9/4/05, TRANS wrote: > On 9/4/05, Aleksi Niemela wrote: > > TRANS kirjoitti: > > > > >Anyone have a working Apache2 Virtual Host configuration working with Nitro? > > > > > >Nitro works under Webrick, but under Apahce2 I'm getting 400 Bad Request Error. > > > > > > > > I've not set up Apache nor Nitro but I wonder if Nitro would go in place > > along the Rails lines: > > > > http://www.rails4days.pwp.blueyonder.co.uk/Rails4Days.pdf > > > > On page 7 (numbered 3 on bottom of text page), you can see how Virtual > > host is set up for Rails. Also many examples and nitrogen seem to carry > > some form of Apache configuration I assume George is using. But as said, > > I haven't tried any of these. > > Thanks Aleksi, > > It seems the problem is two fold. First the rewrite rules given in > Nitro's apache.conf example gives the 400 Error: > > RewriteEngine On > RewriteRule ^$ index.html [QSA] > RewriteRule ^([^.]+)$ $1.html [QSA] > RewriteCond %{REQUEST_FILENAME} !-f > RewriteRule ^(.*)$ dispatch.cgi [QSA,L] > > So I'm not bothering with that at the moment and have remarked it out. > But secondly, Mozilla Browser on Ubuntu Linux is picky about xml > content. The nitrogen produced app's index.xhtml has an xml error --a > missing , and secondly the header needs to be: > > > PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" > "DTD/xhtml1-strict.dtd"> > > > T. > > > > > > > > > _______________________________________________ > > Nitro-general mailing list > > Nitro-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/nitro-general > > > > > -- > ( o) ??? > // trans. > / / transfire at gmail.com > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From george.moschovitis at gmail.com Mon Sep 5 03:25:26 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Mon, 5 Sep 2005 10:25:26 +0300 Subject: [Nitro] Idiom to pass multiple parameters In-Reply-To: <431B1950.7030802@cs.helsinki.fi> References: <431B1950.7030802@cs.helsinki.fi> Message-ID: Have you tried the default 'nice' dispatcher? it maps url of the form: my_action/x/y/z to def my_action(x, y, z) .. end If you want a different mapping for example: my_action/par1/x/par2/y/par3/z to def my_action(par1, par2, par3) end you could write (and donate ;-)) another dispatcher ;-) regards, George. On 9/4/05, Aleksi Niemela wrote: > I know this is the usual way to introduce an action: > > def categories > # do something useful with @category > end > action :categories, :route => /category\/(.*)/, 'category' => nil > > But how should I pass on multiple parameters? Url format of > > /foo/84/bar/3902 > > doesn't look outright horrible but can stay quite pretty for few > parameters. It's surely more of a nuisance with dozens of parameters. > Therefore I thought to go with > > /foo/84?bar=3902 > > Is this the "right way" to do it? If this is the path, is the following > the way to get the parameters to use them? > > foo.xhtml: > uri = UriUtils.update_query_string("categories/#{@foo}", > :kategoria=>ec.name) > ?> > bar > > controller.rb: > def categories > params = UriUtils.query_string_to_hash(request.query_string) > @bar = params["bar"] > # use foo and bar in a useful way > end > action :categories, :route => /category\/(.*)/, 'category' => nil > > I find this way quite a bit clumsy. But if that's the way to work around > I guess I'm forced to write up interception for an action method to set > instance variables behind the scenes and gotta do something for the url > building too. > > I hope I've missed some elementary step but couldn't find any more > complex actions in Spark. It was Pager mixin that showed me this way. > > Or should I start using session or head my way to Wee like page storing? > > - Aleksi > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From george.moschovitis at gmail.com Mon Sep 5 03:31:31 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Mon, 5 Sep 2005 10:31:31 +0300 Subject: [Nitro] How iterate efficiently through collection of 'things'? In-Reply-To: <431B49FB.2010409@cs.helsinki.fi> References: <431B49FB.2010409@cs.helsinki.fi> Message-ID: > used on temporary storage either, it's too short living. OTOH, Nitro > discourages using session object and using state that's not persistent > at all, like said at Nitro::Session rdocs Nitro discourages the usage of session variables but provides the session object for problems like the one you describe. For example you could use a MemoryStore backed Session to store the results. regards, George. -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From george.moschovitis at gmail.com Mon Sep 5 03:33:01 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Mon, 5 Sep 2005 10:33:01 +0300 Subject: [Nitro] Og - mysql.sock In-Reply-To: <431B68E9.30403@valaraan.de> References: <431B68E9.30403@valaraan.de> Message-ID: thanks for the patche, please also send me the updated setup help for inclusion in the next version. regards, George. On 9/5/05, manveru wrote: > hi list, > > i was trying to get mysql running today on a debian-testing box, and i > noticed they are doing odd things to mysql... > but what me annoyed most, was that they have the mysql.sock not like > everyone else in '/tmp/mysql.sock' - nah... - they had to put it in > '/var/run/mysqld/mysqld.sock' > well, i guess that someone else may stumble upon that too, and i just > wanted to provide that information. > > ysabel, i have altered the Og.setup for mysql to > > ----------------------------------------------- > Og.setup( > #~ :destroy => true, > :store => :mysql, > :name => 'spark', > :user => 'root', > :password => 'mine :)', > #~ :port => 3306, > :socket => '/var/run/mysqld/mysqld.sock' > ) > ---------------------------------------------- > > and changed the '/lib/og/store/mysql.rb':117 > ---------------------------------------------- > @conn = Mysql.connect( > options[:address] || 'localhost', > options[:user], > options[:password], > options[:name], > options[:port], > options[:socket] > ) > ---------------------------------------------- > > i had to provide a option for the port before the socket too because the > real_connect expects it and i don't want to mix up with your defaults, > but none of the options is a must-have of course... > > hope that helps somebody, and maybe this could be added in a future > version... > i'll write a little help-text for the Og.setup later too, because it > doesn't helped me much as it is - just some describing of how to use > wich database and known bugs... > > > so long... > manveru > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From george.moschovitis at gmail.com Mon Sep 5 03:36:19 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Mon, 5 Sep 2005 10:36:19 +0300 Subject: [Nitro] Og and Relations/Queries In-Reply-To: References: Message-ID: > Supposing that in session[:user_oid] I have the oid of the currently > logged in user, would the g_all function work? Yes. -g. -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From george.moschovitis at gmail.com Mon Sep 5 03:39:39 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Mon, 5 Sep 2005 10:39:39 +0300 Subject: [Nitro] Og and Relations/Queries In-Reply-To: References: Message-ID: Btw, the latest Og (0.23.0) has more advanced inflection capabilities: class User property :login, String has_many :groups end class Group property :name, String belongs_to :user has_many :projects end class Project belongs_to :group end in general the following forms work: has_many :projects, Project has_many Project has_many :projects all three are equivalent. I personally prefer the 3rd. -g. -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From george.moschovitis at gmail.com Mon Sep 5 03:42:53 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Mon, 5 Sep 2005 10:42:53 +0300 Subject: [Nitro] @template_root not set for secondary controllers In-Reply-To: <145C99CC-8FBF-4CFC-B00D-DDAD45F1AD1D@gmail.com> References: <145C99CC-8FBF-4CFC-B00D-DDAD45F1AD1D@gmail.com> Message-ID: You have to use @template_root instead of @@template_root. This should work, dunno why it doesnt work for you (perhaps an accessor method for @template_root is not defined?) In any case, the template_root setting needs some improvement, @template_root = ... is not as elegant as it should be. regards, George. On 9/5/05, Peter Abrahamsen wrote: > Hi, > > Nitro 0.23, everything up to date. > > I'm defining a controller-specific template_root, which compiler.rb > appears to support. Here's some of the code: > > class PlayerController < Nitro::Controller > include Nitro::XhtmlMixin > > # TODO caching, some day > @@template_root = 'template/player' > ... > end > > I put a debug line in nitro/compiler.rb, at line 106: > > if cklass.respond_to?(:template_root) > template_root = cklass.template_root > Logger.debug "got template_root #{template_root} from # > {cklass.to_s}" > end > > the debug log is as follows: > > DEBUG: SELECT * FROM ogplayer WHERE oid=1 > DEBUG: Rendering '/players/root'. > DEBUG: Compiling action 'PlayerController#root' > DEBUG: got template_root template from PlayerController > DEBUG: got template_root from Nitro::Controller > > This is weird. I tried setting @template_root in initialize instead > of @@template_root in the class, but the exact same thing happens. > > If I set PlayerController to be the default controller, drop the > @template_root setting (and keep Template.root, which was there > before), and move things to 'template' instead of 'template/player', > everything's fine. > > Any ideas? > > Thanks, P > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From epiperak at softlab.ece.ntua.gr Mon Sep 5 03:43:55 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Mon, 5 Sep 2005 10:43:55 +0300 (EEST) Subject: [Nitro] hmm... Message-ID: INFO: Database 'weezv2' not found! DEBUG: Og manageable classes: [Bank, TrustBank, Owner, Broker, Area, ForeignProject, Cashflow, IncomeRep, RepairRep, ManagementRep, RentRollRep, RandDRep, JournalRep, ProfitLossRep, DomesticProject, Company, TColumn, TRow, TData, TView, Table, Spc, Tenant, Unit, Repair, Management, RandD, Info, Journal, Building, Report, Investment, Loan, BGroup, Group, User, Officer, Project, BalanceSheetRep, Investor, Capital] INFO: Created table 'ogbank'. INFO: Created table 'ogtrustbank'. INFO: Created table 'ogowner'. INFO: Created table 'ogbroker'. INFO: Created table 'ogarea'. INFO: Created table 'ogforeignproject'. INFO: Created table 'ogcashflow'. INFO: Created table 'ogincomerep'. INFO: Created table 'ogrepairrep'. INFO: Created table 'ogmanagementrep'. INFO: Created table 'ogrentrollrep'. INFO: Created table 'ogranddrep'. INFO: Created table 'ogjournalrep'. INFO: Created table 'ogprofitlossrep'. INFO: Created table 'ogdomesticproject'. INFO: Created table 'ogcompany'. INFO: Created table 'ogtcolumn'. INFO: Created table 'ogtrow'. INFO: Created table 'ogtdata'. INFO: Created table 'ogtview'. INFO: Created table 'ogtable'. INFO: Created table 'ogspc'. Og shoule make more tables but it stops after ogspc!!! why? Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From epiperak at softlab.ece.ntua.gr Mon Sep 5 03:47:27 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Mon, 5 Sep 2005 10:47:27 +0300 (EEST) Subject: [Nitro] Og and Relations/Queries In-Reply-To: References: Message-ID: > in general the following forms work: > > has_many :projects, Project > has_many Project > has_many :projects > > all three are equivalent. I personally prefer the 3rd. Thank you for your reply, but my question is How can I make the queries. So if I want all the projects that belong to any of the groups of the current user would the following line work? @projects = User[session[:user_oid]].groups.projects and would it return an array of projects as I would expect? Thanx again... PS. When is the new server coming up online? :-/ Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From george.moschovitis at gmail.com Mon Sep 5 04:03:56 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Mon, 5 Sep 2005 11:03:56 +0300 Subject: [Nitro] hmm... In-Reply-To: References: Message-ID: No idea, can you investigate this further? -g. On 9/5/05, Emmanuel Piperakis wrote: > INFO: Database 'weezv2' not found! > DEBUG: Og manageable classes: [Bank, TrustBank, Owner, Broker, Area, > ForeignProject, Cashflow, IncomeRep, RepairRep, ManagementRep, > RentRollRep, RandDRep, JournalRep, ProfitLossRep, DomesticProject, > Company, TColumn, TRow, TData, TView, Table, Spc, Tenant, Unit, Repair, > Management, RandD, Info, Journal, Building, Report, Investment, Loan, > BGroup, Group, User, Officer, Project, BalanceSheetRep, Investor, Capital] > INFO: Created table 'ogbank'. > INFO: Created table 'ogtrustbank'. > INFO: Created table 'ogowner'. > INFO: Created table 'ogbroker'. > INFO: Created table 'ogarea'. > INFO: Created table 'ogforeignproject'. > INFO: Created table 'ogcashflow'. > INFO: Created table 'ogincomerep'. > INFO: Created table 'ogrepairrep'. > INFO: Created table 'ogmanagementrep'. > INFO: Created table 'ogrentrollrep'. > INFO: Created table 'ogranddrep'. > INFO: Created table 'ogjournalrep'. > INFO: Created table 'ogprofitlossrep'. > INFO: Created table 'ogdomesticproject'. > INFO: Created table 'ogcompany'. > INFO: Created table 'ogtcolumn'. > INFO: Created table 'ogtrow'. > INFO: Created table 'ogtdata'. > INFO: Created table 'ogtview'. > INFO: Created table 'ogtable'. > INFO: Created table 'ogspc'. > > > Og shoule make more tables but it stops after ogspc!!! > > why? > > Emmanouil Piperakis (epiperak at cs.ntua.gr) > {To explore is Human, to Create is Devine, > To teach is Primal, to Rule is Sin} > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From george.moschovitis at gmail.com Mon Sep 5 04:05:07 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Mon, 5 Sep 2005 11:05:07 +0300 Subject: [Nitro] Og and Relations/Queries In-Reply-To: References: Message-ID: On 9/5/05, Emmanuel Piperakis wrote: > > in general the following forms work: > > > > has_many :projects, Project > > has_many Project > > has_many :projects > > > > all three are equivalent. I personally prefer the 3rd. > > Thank you for your reply, but my question is How can I make the queries. > So if I want all the projects that belong to any of the groups of the > current user would the following line work? > > @projects = User[session[:user_oid]].groups.projects > > and would it return an array of projects as I would expect? > > Thanx again... > > PS. When is the new server coming up online? :-/ > > I said 'yes', this would work :-) -g. -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From epiperak at softlab.ece.ntua.gr Mon Sep 5 04:37:10 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Mon, 5 Sep 2005 11:37:10 +0300 (EEST) Subject: [Nitro] hmm... In-Reply-To: References: Message-ID: I did, the problem was in forward declarations. Apparently they are not necessary. Og found the class Project; end and did not create the table. I deleted all the forward declarations and problem was solved > No idea, > > can you investigate this further? > > -g. > > On 9/5/05, Emmanuel Piperakis wrote: >> INFO: Database 'weezv2' not found! >> DEBUG: Og manageable classes: [Bank, TrustBank, Owner, Broker, Area, >> ForeignProject, Cashflow, IncomeRep, RepairRep, ManagementRep, >> RentRollRep, RandDRep, JournalRep, ProfitLossRep, DomesticProject, >> Company, TColumn, TRow, TData, TView, Table, Spc, Tenant, Unit, Repair, >> Management, RandD, Info, Journal, Building, Report, Investment, Loan, >> BGroup, Group, User, Officer, Project, BalanceSheetRep, Investor, Capital] >> INFO: Created table 'ogbank'. >> INFO: Created table 'ogtrustbank'. >> INFO: Created table 'ogowner'. >> INFO: Created table 'ogbroker'. >> INFO: Created table 'ogarea'. >> INFO: Created table 'ogforeignproject'. >> INFO: Created table 'ogcashflow'. >> INFO: Created table 'ogincomerep'. >> INFO: Created table 'ogrepairrep'. >> INFO: Created table 'ogmanagementrep'. >> INFO: Created table 'ogrentrollrep'. >> INFO: Created table 'ogranddrep'. >> INFO: Created table 'ogjournalrep'. >> INFO: Created table 'ogprofitlossrep'. >> INFO: Created table 'ogdomesticproject'. >> INFO: Created table 'ogcompany'. >> INFO: Created table 'ogtcolumn'. >> INFO: Created table 'ogtrow'. >> INFO: Created table 'ogtdata'. >> INFO: Created table 'ogtview'. >> INFO: Created table 'ogtable'. >> INFO: Created table 'ogspc'. >> >> >> Og shoule make more tables but it stops after ogspc!!! >> >> why? >> >> Emmanouil Piperakis (epiperak at cs.ntua.gr) >> {To explore is Human, to Create is Devine, >> To teach is Primal, to Rule is Sin} >> _______________________________________________ >> Nitro-general mailing list >> Nitro-general at rubyforge.org >> http://rubyforge.org/mailman/listinfo/nitro-general >> > > > -- > http://www.gmosx.com > http://www.navel.gr > http://www.nitrohq.com > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From epiperak at softlab.ece.ntua.gr Mon Sep 5 04:38:24 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Mon, 5 Sep 2005 11:38:24 +0300 (EEST) Subject: [Nitro] Og and Relations/Queries In-Reply-To: References: Message-ID: > > I said 'yes', this would work :-) > gmosx => 'thanx :-\/' Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From george.moschovitis at gmail.com Mon Sep 5 04:52:58 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Mon, 5 Sep 2005 11:52:58 +0300 Subject: [Nitro] hmm... In-Reply-To: References: Message-ID: Yeap, Og is clever enough to handle classes that are not defined yet ;-) Never understimate the power of Ruby. -g. On 9/5/05, Emmanuel Piperakis wrote: > I did, the problem was in forward declarations. Apparently they are not > necessary. Og found the > class Project; end > > and did not create the table. I deleted all the forward declarations and > problem was solved > > > > No idea, > > > > can you investigate this further? > > > > -g. > > > > On 9/5/05, Emmanuel Piperakis wrote: > >> INFO: Database 'weezv2' not found! > >> DEBUG: Og manageable classes: [Bank, TrustBank, Owner, Broker, Area, > >> ForeignProject, Cashflow, IncomeRep, RepairRep, ManagementRep, > >> RentRollRep, RandDRep, JournalRep, ProfitLossRep, DomesticProject, > >> Company, TColumn, TRow, TData, TView, Table, Spc, Tenant, Unit, Repair, > >> Management, RandD, Info, Journal, Building, Report, Investment, Loan, > >> BGroup, Group, User, Officer, Project, BalanceSheetRep, Investor, Capital] > >> INFO: Created table 'ogbank'. > >> INFO: Created table 'ogtrustbank'. > >> INFO: Created table 'ogowner'. > >> INFO: Created table 'ogbroker'. > >> INFO: Created table 'ogarea'. > >> INFO: Created table 'ogforeignproject'. > >> INFO: Created table 'ogcashflow'. > >> INFO: Created table 'ogincomerep'. > >> INFO: Created table 'ogrepairrep'. > >> INFO: Created table 'ogmanagementrep'. > >> INFO: Created table 'ogrentrollrep'. > >> INFO: Created table 'ogranddrep'. > >> INFO: Created table 'ogjournalrep'. > >> INFO: Created table 'ogprofitlossrep'. > >> INFO: Created table 'ogdomesticproject'. > >> INFO: Created table 'ogcompany'. > >> INFO: Created table 'ogtcolumn'. > >> INFO: Created table 'ogtrow'. > >> INFO: Created table 'ogtdata'. > >> INFO: Created table 'ogtview'. > >> INFO: Created table 'ogtable'. > >> INFO: Created table 'ogspc'. > >> > >> > >> Og shoule make more tables but it stops after ogspc!!! > >> > >> why? > >> > >> Emmanouil Piperakis (epiperak at cs.ntua.gr) > >> {To explore is Human, to Create is Devine, > >> To teach is Primal, to Rule is Sin} > >> _______________________________________________ > >> Nitro-general mailing list > >> Nitro-general at rubyforge.org > >> http://rubyforge.org/mailman/listinfo/nitro-general > >> > > > > > > -- > > http://www.gmosx.com > > http://www.navel.gr > > http://www.nitrohq.com > > > > _______________________________________________ > > Nitro-general mailing list > > Nitro-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/nitro-general > > > > Emmanouil Piperakis (epiperak at cs.ntua.gr) > {To explore is Human, to Create is Devine, > To teach is Primal, to Rule is Sin} > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From epiperak at softlab.ece.ntua.gr Mon Sep 5 05:11:04 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Mon, 5 Sep 2005 12:11:04 +0300 (EEST) Subject: [Nitro] hmm... In-Reply-To: References: Message-ID: > Yeap, Og is clever enough to handle classes that are not defined yet ;-) > Never understimate the power of Ruby. -Nitro has powers that some might consider "unnatural". Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From epiperak at softlab.ece.ntua.gr Mon Sep 5 06:42:05 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Mon, 5 Sep 2005 13:42:05 +0300 (EEST) Subject: [Nitro] Og and Relations/Queries In-Reply-To: References: Message-ID: Dear friends, after a lot of investigating I found the problem: When defining relations you have some choices that do not apply to all types of relations. So here are the available choices: (first is the most prefarable by G., last is the least) belongs_to :article belongs_to Article belongs_to :article, Article belongs_to :article, Article, :view => 'lala' refers_to :topic refers_to Topic has_one User # THIS RELATION has only one way to be declared!!! BE AWARE! has_many :comments ### GEORGE, please verify if this is CORRECT! has_many Comment has_many :comments, Comment The problem I was facing was when using the has_one (incorrect syntax), that did not put out an error, but also did not create the table. ...epiperak out... > On 9/5/05, Emmanuel Piperakis wrote: >>> in general the following forms work: >>> >>> has_many :projects, Project >>> has_many Project >>> has_many :projects >>> >>> all three are equivalent. I personally prefer the 3rd. >> >> Thank you for your reply, but my question is How can I make the queries. >> So if I want all the projects that belong to any of the groups of the >> current user would the following line work? >> >> @projects = User[session[:user_oid]].groups.projects >> >> and would it return an array of projects as I would expect? >> >> Thanx again... >> >> PS. When is the new server coming up online? :-/ >> >> > > I said 'yes', this would work :-) > > -g. > > -- > http://www.gmosx.com > http://www.navel.gr > http://www.nitrohq.com > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From Aleksi.Niemela at cs.helsinki.fi Mon Sep 5 16:34:53 2005 From: Aleksi.Niemela at cs.helsinki.fi (Aleksi Niemela) Date: Mon, 05 Sep 2005 23:34:53 +0300 Subject: [Nitro] How iterate efficiently through collection of 'things'? In-Reply-To: References: <431B49FB.2010409@cs.helsinki.fi> Message-ID: <431CABED.2030105@cs.helsinki.fi> George Moschovitis kirjoitti: >>used on temporary storage either, it's too short living. OTOH, Nitro >>discourages using session object and using state that's not persistent >>at all, like said at Nitro::Session rdocs >> >> > > >Nitro discourages the usage of session variables but provides the session object >for problems like the one you describe. For example you could use a >MemoryStore backed Session to store the results. > > Thanks for the recent replies. Related to this one I have a problem. I don't know how to use Flash. In my login_check action I say: flash[:invalid_login] = true render "login" # or originally redirect, but no effect In login.xhtml I have The flashed information won't show in login.xhtml, instead flash is empty. I think I'm inside one request, just diverting into another "action" when failing login. But probably I'm in two request so Flashing won't work. And no, I don't think I'm going to merge login_check into login and determine from empty parameter if I'm coming to login page first time or after sent form. It's cleaner and more self-documenting this way. Using session works probably ok. So I guess one should use Flashing for one action + .xhtml -pair. If that's so, what's the use of the concept? I use @invalid_login type of variables to carry useful information into xhtml files. If instance variable naming pollution becomes an issue, it's not hard to set @flash = {} (or openstruct or something) and carry info through it. But pollution hasn't been a problem. Or am I misunderstanding something? - Aleksi From ulmo at valaraan.de Mon Sep 5 19:07:50 2005 From: ulmo at valaraan.de (manveru) Date: Tue, 06 Sep 2005 01:07:50 +0200 Subject: [Nitro] getting spark to hightlight syntax... In-Reply-To: <431CABED.2030105@cs.helsinki.fi> References: <431B49FB.2010409@cs.helsinki.fi> <431CABED.2030105@cs.helsinki.fi> Message-ID: <431CCFC6.9070008@valaraan.de> hi list, i've been wasting the last hours trying to find out how the spark-pages get rendered... my goal was simple enough - getting text between [code]-tags parsed through coderay like that: --------------------------- "[code] this is some code [/code]".gsub(/\[code\](.*)\[\/code\]/) { |c| c = CodeRay.scan(c, 'ruby').encode(:html, :bold_every => 10, :wrap => :div) } ----------- should give me something like ---------------------------------
1
This is some 
code...
---------------------------------- so i've put the following lines into the WikiController.view ------------------------------- body = @page.body.gsub(' ', ' ') @page.body = body.gsub(/\[code\](.*)\[\/code\]/) { |c| c.gsub!('[code]', '') c.gsub!('[/code]', '') c.strip! c = CodeRay.scan(c, 'ruby').encode(:html, :bold_every => 10, :wrap => :div) } ----------------------------------- you may notice how absurd these lines are... especially the first, but trying to gsub without that causes a nil-exception... well, it works almost for one-liners, redcloth is destroying the markup coderay produces anyway. now i could kick out redcloth, but that seems as the worst solution to get syntax-highlighting. is there some way to either: *define an area redcloth doesn't process *hack redcloth from within the nitro-app and tell him to do that gsub *get the redcloth-parsing optional in the skin *change that 'Markup.setup_markup_transform do |text|' so it doesn't iterate through lines and instead takes the whole text - this may cause severe problems with redcloth... *something else i haven't thought about i just want to highlight that code... can't be that hard after all... btw, i know my regexp is wrong - haven't spent too much time finding out how to match linebrakes... i am really greatful for any help so long... manveru From guillaume.pierronnet at laposte.net Mon Sep 5 19:33:08 2005 From: guillaume.pierronnet at laposte.net (Guillaume Pierronnet) Date: Tue, 6 Sep 2005 01:33:08 +0200 (CEST) Subject: [Nitro] Apache2 In-Reply-To: <4b6f054f050904075657fd88dc@mail.gmail.com> References: <4b6f054f050904075657fd88dc@mail.gmail.com> Message-ID: <36749.127.0.0.1.1125963188.squirrel@localhost> if you define the configuration inside your apache2.conf instead of .htaccess file, in you have to use something like this: ServerName nitro DocumentRoot /somewhere/on/disk/public/ Options +FollowSymLinks +ExecCGI RewriteEngine On RewriteRule ^$ index.html [QSA] RewriteRule ^([^.]+)$ $1.html [QSA] RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ /fcgi.rb [QSA,L] ErrorDocument 500 "

Application error

Nitro failed to start properly"
> Anyone have a working Apache2 Virtual Host configuration working with Nitro? > > Nitro works under Webrick, but under Apahce2 I'm getting 400 Bad Request Error. > > Thanks, > T. > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > > From epiperak at softlab.ece.ntua.gr Mon Sep 5 23:18:47 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Tue, 6 Sep 2005 06:18:47 +0300 (EEST) Subject: [Nitro] Again me... Message-ID: Sorry for all the bothering... I would like to store in the DB an object of type Currency that I made. (Just a Float will not do, I need to convert from JPY, to USD, EUR, and so on, but also store the different type of number each time - once representing JPY with no decimal digits, the other time USD with 2 decimal, etc etc). So I did the followin in the model.rb class Currency < Float def initialize(value = 0.0, type = 'JPY', precission = 0) super @value, @type, @precission = value, type, precission end def jpy end def usd end def eur end end and then class Project property :locality, String # domestic, foreign property :state, String # fixed, planned, under development property :fee_per, Float property :fee, Currency belongs_to :officer belongs_to :group belongs_to :company has_many :loans has_many :investments has_many :reports has_one Bgroup end But Og complains in property :fee, Currency with... /usr/lib/ruby/1.8/mysql.rb:453:in `read': You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for th e right syntax to use near ' investment_size integer, type text, acquisition_date date, pla (Mysql::Error) from /usr/lib/ruby/1.8/mysql.rb:345:in `read_query_result' from /usr/lib/ruby/1.8/mysql.rb:160:in `real_query' from /usr/lib/ruby/1.8/mysql.rb:275:in `query' from /usr/lib/ruby/gems/1.8/gems/og-0.23.0/lib/og/store/mysql.rb:229:in `create_table' from (eval):5:in `send' from (eval):5:in `og_create_schema' from /usr/lib/ruby/gems/1.8/gems/og-0.23.0/lib/og/store/sql.rb:290:in `enchant' from /usr/lib/ruby/gems/1.8/gems/og-0.23.0/lib/og/store/mysql.rb:152:in `enchant' from /usr/lib/ruby/gems/1.8/gems/og-0.23.0/lib/og/manager.rb:130:in `manage' from /usr/lib/ruby/gems/1.8/gems/og-0.23.0/lib/og/manager.rb:186:in `manage_classes' from /usr/lib/ruby/gems/1.8/gems/og-0.23.0/lib/og/manager.rb:186:in `each' from /usr/lib/ruby/gems/1.8/gems/og-0.23.0/lib/og/manager.rb:186:in `manage_classes' from /usr/lib/ruby/gems/1.8/gems/og-0.23.0/lib/og.rb:119:in `setup' Any ideas? Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From epiperak at softlab.ece.ntua.gr Mon Sep 5 23:20:09 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Tue, 6 Sep 2005 06:20:09 +0300 (EEST) Subject: [Nitro] Epiphany... Message-ID: I had an epiphany last night... Lets call the first book/doc on Nitro: "Nitro: It's all Greek to me" (something like the Idiots Guide to Nitro) George? What do you think? Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From transfire at gmail.com Tue Sep 6 00:16:21 2005 From: transfire at gmail.com (TRANS) Date: Tue, 6 Sep 2005 00:16:21 -0400 Subject: [Nitro] Again me... In-Reply-To: References: Message-ID: <4b6f054f05090521163b15d55@mail.gmail.com> On 9/5/05, Emmanuel Piperakis wrote: > Sorry for all the bothering... > > I would like to store in the DB an object of type Currency that I made. > (Just a Float will not do, I need to convert from JPY, to USD, EUR, and so > on, but also store the different type of number each time - once > representing JPY with no decimal digits, the other time USD with 2 > decimal, etc etc). So I did the followin in the model.rb > > class Currency < Float > > def initialize(value = 0.0, type = 'JPY', precission = 0) > super > @value, @type, @precission = value, type, precission > end > > def jpy > end > > def usd > end > > def eur > end > end In some cases Ruby does not make subclassing feasible, like with Float. So subclassing Float will do you no good. You are simply delegating via the three instance vars. Get rid of < Float and the call to super. Not sure what Nitro's doing though. T. From transfire at gmail.com Tue Sep 6 00:18:01 2005 From: transfire at gmail.com (TRANS) Date: Tue, 6 Sep 2005 00:18:01 -0400 Subject: [Nitro] Again me... In-Reply-To: <4b6f054f05090521163b15d55@mail.gmail.com> References: <4b6f054f05090521163b15d55@mail.gmail.com> Message-ID: <4b6f054f050905211832a18b51@mail.gmail.com> class Currency def initialize(value = 0.0, type = 'JPY', precission = 0) @value, @type, @precission = value.to_f, type.to_s, precission.to_i end ... -- ( o) ??? // trans. / / transfire at gmail.com From epiperak at softlab.ece.ntua.gr Tue Sep 6 00:27:33 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Tue, 6 Sep 2005 07:27:33 +0300 (EEST) Subject: [Nitro] Again me... In-Reply-To: <4b6f054f050905211832a18b51@mail.gmail.com> References: <4b6f054f05090521163b15d55@mail.gmail.com> <4b6f054f050905211832a18b51@mail.gmail.com> Message-ID: Thanx for the tip on subclassing Float The problem now it that Og does not accept this class as TrueClass type. Why? George permits declarations of type Integer, Float, String, ... , and TrueClass. Hash is a TrueClass and it can be used as a property, in the db it is converted to Text type. But my class Curr (renamed it cause Currency is reserved or something) is not accepted... ?? > class Currency > > def initialize(value = 0.0, type = 'JPY', precission = 0) > @value, @type, @precission = value.to_f, type.to_s, precission.to_i > end > > ... > > -- > ( o) ?????? > // trans. > / / transfire at gmail.com > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From ulmo at valaraan.de Tue Sep 6 00:47:58 2005 From: ulmo at valaraan.de (manveru) Date: Tue, 06 Sep 2005 06:47:58 +0200 Subject: [Nitro] getting spark to hightlight syntax... In-Reply-To: <431CCFC6.9070008@valaraan.de> References: <431B49FB.2010409@cs.helsinki.fi> <431CABED.2030105@cs.helsinki.fi> <431CCFC6.9070008@valaraan.de> Message-ID: <431D1F7E.5050000@valaraan.de> hi list... now, after freeing my mind a bit and drinking some coffee - the world has cleared up :) the problem was in the template/view.xhtml i have replaced ------------ #|@page.body| --------------------- with ---------------- \1') body.gsub!(/href="(.*?)"/) { $&.gsub(/ /, '_') } body = body.gsub(/(\[code\])(.*?)(\[\/code\])/m) { |c| puts c.inspect c.gsub!('[code]', '') c.gsub!('[/code]', '') c.strip! c = CodeRay.scan(c, 'ruby').encode(:html, :bold_every => 10, :wrap => :div) } render_text(body) ?> ----------------------- and it works perfect for me... and i stripped the entry in the run.rb down to ------------------- Markup.setup_markup_transform do |text| String.sanitize(text) end ------------------- i assume it checks that all closing-tags are set and like, but haven't checked that yet. now i've got ruby-code-highlighting in rdog and a simple hack for everyone who wants his spark doing that! :) hope i didn't waste your time, but all the templating/parsing/rendering/modeling/controlling/data-storing/checking has eaten up my mind for a while... one last question: what does #|somevar| exactly do? it reminds me of #{somevar} but seems to have some connection to Markup... PS: one can find coderay at http://rd.cycnus.de/coderay/ so long... manveru From rainhead at gmail.com Tue Sep 6 02:35:16 2005 From: rainhead at gmail.com (Peter Abrahamsen) Date: Mon, 5 Sep 2005 23:35:16 -0700 Subject: [Nitro] @template_root not set for secondary controllers In-Reply-To: References: <145C99CC-8FBF-4CFC-B00D-DDAD45F1AD1D@gmail.com> Message-ID: <209652B6-5919-4F83-8948-49A1A5E99070@gmail.com> George, The answer to this is that compiler.rb doesn't instantiate the controller class before calling template_root. Class attributes are private, so you have to write a class method. The following code made my controller work: def PlayerController.template_root 'template/player' end In tracking this down, it looks like Nitro guesses the location of the template based on the path name. I thought I'd be able to put my code in template/players, but for some reason this didn't work. I haven't looked into it any more now that I have something that works. As you say, this system could use some improvement. You know what'd be appropriate better than I, but an automatic template_root() inserted by compiler.rb and usable like action, pre, post, etc, is obvious. But perhaps it would be most correct to have it typically set from run.rb? Cheers, P On Sep 5, 2005, at 12:42 AM, George Moschovitis wrote: > You have to use > @template_root instead of @@template_root. > > This should work, dunno why it doesnt work for you (perhaps an > accessor method for @template_root is not defined?) > > In any case, the template_root setting needs some improvement, > @template_root = ... is not as elegant as it should be. > > regards, > George. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/nitro-general/attachments/20050906/3ca4c4b5/attachment.html From epiperak at softlab.ece.ntua.gr Tue Sep 6 03:17:58 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Tue, 6 Sep 2005 10:17:58 +0300 (EEST) Subject: [Nitro] Localization Message-ID: Hi all, how can I put localization in the Input tag? fails. It says... malformed XML: missing tag start Line: Position: Last 80 unconsumed characters: Any help? Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From george.moschovitis at gmail.com Tue Sep 6 03:21:26 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Tue, 6 Sep 2005 10:21:26 +0300 Subject: [Nitro] Localization In-Reply-To: References: Message-ID: Hmm, try: if that doesnt work escape this: -g. On 9/6/05, Emmanuel Piperakis wrote: > Hi all, > how can I put localization in the Input tag? > > > > fails. It says... > malformed XML: missing tag start Line: Position: Last 80 unconsumed > characters: > > Any help? > > Emmanouil Piperakis (epiperak at cs.ntua.gr) > {To explore is Human, to Create is Devine, > To teach is Primal, to Rule is Sin} > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From rainhead at gmail.com Tue Sep 6 03:26:25 2005 From: rainhead at gmail.com (Peter Abrahamsen) Date: Tue, 6 Sep 2005 00:26:25 -0700 Subject: [Nitro] xhtml builder in model? Message-ID: Hi all, Why can we only use the XhtmlMixin's build in a controller? I'd really like to be able to use it in a model, so that the model knows how to generate an edit form, not the controller. This means that I can put a form to create a new whatever from anywhere in my site, no matter which is the current controller. Perhaps it would be easy to generalize this? Perhaps what I'm saying is already possible? Thanks, Peter From george.moschovitis at gmail.com Tue Sep 6 03:39:18 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Tue, 6 Sep 2005 10:39:18 +0300 Subject: [Nitro] xhtml builder in model? In-Reply-To: References: Message-ID: I think you can already do this. If not, we could generalize the XhtmlMixin module. This is a reasonable request I guess. thanks, George. On 9/6/05, Peter Abrahamsen wrote: > Hi all, > > Why can we only use the XhtmlMixin's build in a controller? I'd > really like to be able to use it in a model, so that the model knows > how to generate an edit form, not the controller. This means that I > can put a form to create a new whatever from anywhere in my site, no > matter which is the current controller. > > Perhaps it would be easy to generalize this? Perhaps what I'm saying > is already possible? > > Thanks, Peter > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From epiperak at softlab.ece.ntua.gr Tue Sep 6 04:27:21 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Tue, 6 Sep 2005 11:27:21 +0300 (EEST) Subject: [Nitro] Localization In-Reply-To: References: Message-ID: > Hmm, try: > > This worked fine! [[bgroup_creation]]: #{date_select(Time.now, :name => 'creation')} but this does not work. It returns in the request the selected values but it does not store the in the object with the request.fill(object) def save_bgroup puts request['creation'] if request.post? bgroup = Bgroup.new request.fill(bgroup) bgroup.save end redirect_to_referer end any ideas? > > if that doesnt work escape this: > > ... > ]]> > > -g. > > On 9/6/05, Emmanuel Piperakis wrote: >> Hi all, >> how can I put localization in the Input tag? >> >> >> >> fails. It says... >> malformed XML: missing tag start Line: Position: Last 80 unconsumed >> characters: >> >> Any help? >> >> Emmanouil Piperakis (epiperak at cs.ntua.gr) >> {To explore is Human, to Create is Devine, >> To teach is Primal, to Rule is Sin} >> _______________________________________________ >> Nitro-general mailing list >> Nitro-general at rubyforge.org >> http://rubyforge.org/mailman/listinfo/nitro-general >> > > > -- > http://www.gmosx.com > http://www.navel.gr > http://www.nitrohq.com > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From george.moschovitis at gmail.com Tue Sep 6 04:41:52 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Tue, 6 Sep 2005 11:41:52 +0300 Subject: [Nitro] Localization In-Reply-To: References: Message-ID: Have a look how this is currently handled in lib/nitro/mixin/form.rb -g. PS: this will be improved a lot in the next version (next week). On 9/6/05, Emmanuel Piperakis wrote: > > Hmm, try: > > > > > > This worked fine! > > [[bgroup_creation]]: #{date_select(Time.now, :name => 'creation')} > > but this does not work. It returns in the request the selected values but > it does not store the in the object with the request.fill(object) > > def save_bgroup > puts request['creation'] > if request.post? > bgroup = Bgroup.new > request.fill(bgroup) > bgroup.save > end > redirect_to_referer > end > > any ideas? > > > > > > if that doesnt work escape this: > > > > > ... > > ]]> > > > > -g. > > > > On 9/6/05, Emmanuel Piperakis wrote: > >> Hi all, > >> how can I put localization in the Input tag? > >> > >> > >> > >> fails. It says... > >> malformed XML: missing tag start Line: Position: Last 80 unconsumed > >> characters: > >> > >> Any help? > >> > >> Emmanouil Piperakis (epiperak at cs.ntua.gr) > >> {To explore is Human, to Create is Devine, > >> To teach is Primal, to Rule is Sin} > >> _______________________________________________ > >> Nitro-general mailing list > >> Nitro-general at rubyforge.org > >> http://rubyforge.org/mailman/listinfo/nitro-general > >> > > > > > > -- > > http://www.gmosx.com > > http://www.navel.gr > > http://www.nitrohq.com > > > > _______________________________________________ > > Nitro-general mailing list > > Nitro-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/nitro-general > > > > Emmanouil Piperakis (epiperak at cs.ntua.gr) > {To explore is Human, to Create is Devine, > To teach is Primal, to Rule is Sin} > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From epiperak at softlab.ece.ntua.gr Tue Sep 6 05:03:52 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Tue, 6 Sep 2005 12:03:52 +0300 (EEST) Subject: [Nitro] Localization In-Reply-To: References: Message-ID: > Have a look how this is currently handled in > > lib/nitro/mixin/form.rb > Only if there was a better example... eg
[[title]]: [[bgroup_creation]]: #{date_select(Date.today, :name => 'creation')}
how can this be done in the new way? with the FormMixin? Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From george.moschovitis at gmail.com Tue Sep 6 05:05:44 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Tue, 6 Sep 2005 12:05:44 +0300 Subject: [Nitro] getting spark to hightlight syntax... In-Reply-To: <431D1F7E.5050000@valaraan.de> References: <431B49FB.2010409@cs.helsinki.fi> <431CABED.2030105@cs.helsinki.fi> <431CCFC6.9070008@valaraan.de> <431D1F7E.5050000@valaraan.de> Message-ID: Hello, #|..| is an alias for #{markup(...)} #(..) is an alias for #{sanitize(...)} I think these aliases (macros) help keep templates clean. If you want to customize the rendering you can overload the methods: Markup.markup Markup.sanitize hope this helps. regards, George. -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From george.moschovitis at gmail.com Tue Sep 6 05:47:57 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Tue, 6 Sep 2005 12:47:57 +0300 Subject: [Nitro] How iterate efficiently through collection of 'things'? In-Reply-To: <431CABED.2030105@cs.helsinki.fi> References: <431B49FB.2010409@cs.helsinki.fi> <431CABED.2030105@cs.helsinki.fi> Message-ID: > In my login_check action I say: > > flash[:invalid_login] = true > render "login" # or originally redirect, but no effect > ... > > p flash > if flash[:invalid_login] ?> > > This should work. Flash is alive until the next request. Will have a look at this. -g. -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From rainhead at gmail.com Tue Sep 6 12:43:28 2005 From: rainhead at gmail.com (Peter Abrahamsen) Date: Tue, 6 Sep 2005 09:43:28 -0700 Subject: [Nitro] Rdocs Message-ID: <908914B5-48C3-4845-9FE2-56CA8FCF8797@gmail.com> If anyone needs nitro/og/glue rdocs while nitrohq is down, I've got some over here: http://taffy.findpage.com/~peidran/ Cheers, Peter From james_b at neurogami.com Tue Sep 6 12:51:13 2005 From: james_b at neurogami.com (James Britt) Date: Tue, 06 Sep 2005 09:51:13 -0700 Subject: [Nitro] xhtml builder in model? In-Reply-To: References: Message-ID: <431DC901.6000400@neurogami.com> George Moschovitis wrote: > I think you can already do this. If not, we could generalize the > XhtmlMixin module. > This is a reasonable request I guess. > > thanks, > George. > > On 9/6/05, Peter Abrahamsen wrote: > >>Hi all, >> >>Why can we only use the XhtmlMixin's build in a controller? I'd >>really like to be able to use it in a model, so that the model knows >>how to generate an edit form, not the controller. This means that I >>can put a form to create a new whatever from anywhere in my site, no >>matter which is the current controller. >> Is this a case, though, of having the model (e.g., that data) getting mixed up with the presentation, breaking MVC? On the other hand, I'm reminded of Allen Holub's articles on doing GUI stuff in Java, where he derided getters and setters, and said something along the lines of objects should know how to render themselves. http://www.javaworld.com/javaworld/jw-07-1999/jw-07-toolbox_p.html I'll explain the whys and wherefors in a moment, but here are some rules of thumb that you can apply to see if you're really looking at an object-oriented system: 1. All data is private. Period. (This rule applies to all implementation details, not just the data.) 2. get and set functions are evil. (They're just elaborate ways to make the data public.) 3. Never ask an object for the information you need to do something; rather, ask the object that has the information to do the work for you. 4. It must be possible to make any change to the way an object is implemented, no matter how significant that change may be, by modifying the single class that defines that object. 5. All objects must provide their own UI. If the system doesn't follow these rules, it isn't object-oriented. It's that simple. That's not to say non-object-oriented systems are bad; there are many perfectly good procedural systems in the world. Nonetheless, not exposing data is a fundamental principle of object-oriented systems. If you violate your principles, you're nothing, and the same goes for object-oriented systems. If a system violates object-oriented principles, it isn't object-oriented; it's some sort of weird hybrid that you may or may not ever get to work right. So, does this suggest that if I want to render, say, an Account object in a Web page, I should do something like this: <%= account.render( xhtml_form_builder ) %> where xhtml_form_builder is some object that an Account instance knows how to manipulate without needing to know the specifics of the rendering environment? James From ulmo at valaraan.de Tue Sep 6 13:09:40 2005 From: ulmo at valaraan.de (manveru) Date: Tue, 06 Sep 2005 19:09:40 +0200 Subject: [Nitro] spark and update_time Message-ID: <431DCD54.8040108@valaraan.de> hi list, now, almost a tradition, my daily problem :) i noticed that in spark every page wich contains: #{@revision.update_time.to_s(:db)} fails to render, i'm not sure why, not even sure what that code does, but i think that it wants to get the latest update_time in a string out of :db i have added the error-messages at the end of the post, the problem seems clear - to_s doesn't want any arguments, and i really don't think it is supposed to need that information, as the revision should know by itself where to get that information... maybe it's just some problem with mysql here... however, i can live without the date of the last update for the meanwhile, just wanted to post that here so the problem gets known so long... manveru ------------------------------------------- ERROR: Error while handling '/diff'. ERROR: wrong number of arguments (1 for 0) template/diff.xhtml:79:in `to_s' template/diff.xhtml:79:in `diff_template' (eval):10:in `diff_action' /usr/lib/ruby/gems/1.8/gems/nitro-0.23.0/lib/nitro/controller.rb:163:in `method_missing' /usr/lib/ruby/gems/1.8/gems/nitro-0.23.0/lib/nitro/render.rb:124:in `render' /usr/lib/ruby/gems/1.8/gems/nitro-0.23.0/lib/nitro/adapter/webrick.rb:125:in `do_GET' /usr/lib/ruby/1.8/webrick/httpservlet/abstract.rb:35:in `service' /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run' /usr/lib/ruby/1.8/webrick/server.rb:172:in `start_thread' /usr/lib/ruby/1.8/webrick/server.rb:161:in `start' /usr/lib/ruby/1.8/webrick/server.rb:161:in `start_thread' /usr/lib/ruby/1.8/webrick/server.rb:95:in `start' /usr/lib/ruby/1.8/webrick/server.rb:92:in `each' /usr/lib/ruby/1.8/webrick/server.rb:92:in `start' /usr/lib/ruby/1.8/webrick/server.rb:82:in `start' /usr/lib/ruby/1.8/webrick/server.rb:82:in `start' /usr/lib/ruby/gems/1.8/gems/nitro-0.23.0/lib/nitro/adapter/webrick.rb:47:in `start' /usr/lib/ruby/gems/1.8/gems/nitro-0.23.0/lib/nitro/server/runner.rb:282:in `invoke_server' /usr/lib/ruby/gems/1.8/gems/nitro-0.23.0/lib/nitro/server/runner.rb:248:in `invoke' /usr/lib/ruby/gems/1.8/gems/nitro-0.23.0/lib/nitro/server.rb:125:in `run' /usr/lib/ruby/gems/1.8/gems/nitro-0.23.0/lib/nitro.rb:65:in `run' run.rb:76 LOGGED FROM: /usr/lib/ruby/gems/1.8/gems/nitro-0.23.0/lib/nitro/render.rb:180:in `log_error' ---------------------------------------------- From ulmo at valaraan.de Tue Sep 6 13:12:42 2005 From: ulmo at valaraan.de (manveru) Date: Tue, 06 Sep 2005 19:12:42 +0200 Subject: [Nitro] spark and update_time In-Reply-To: <431DCD54.8040108@valaraan.de> References: <431DCD54.8040108@valaraan.de> Message-ID: <431DCE0A.6000304@valaraan.de> manveru wrote: > hi list, > > now, almost a tradition, my daily problem :) > > i noticed that in spark every page wich contains: > > #{@revision.update_time.to_s(:db)} i shouldn't post too fast next time - i looked at some other templates and found the combination update_time.stamp(:db) quite often, so i replaced to_s with that stamp... it's just a quick fix - maybe some alias would be better so long... manveru From rainhead at gmail.com Tue Sep 6 14:00:40 2005 From: rainhead at gmail.com (Peter Abrahamsen) Date: Tue, 6 Sep 2005 11:00:40 -0700 Subject: [Nitro] xhtml builder in model? In-Reply-To: <431DC901.6000400@neurogami.com> References: <431DC901.6000400@neurogami.com> Message-ID: <2E3F9E77-D5FD-4714-B4A1-61F3A4487046@gmail.com> James, Thanks a lot for your message. The article looks very interesting, I'll read it in a minute. What you and Allen Holub say seems very intuitive to me. In my view, an object--in Nitro, an entity--ought to know how to express itself. It's the controller's responsibility to make things express themselves in a coherent visual and code environment. Templates (are these really the V in MVC?) are split off more for the benefit of letting designers not have to wade through program code. Some of them are for the benefit of models (entities) and some for the benefit of controllers (e.g. how to build a page). Or maybe this is simply not an MVC model? I don't know much about the models one finds in the literature, I just knew how I wanted to organize my program, and Nitro seemed flexible enough to let me do that. All that said, it seems clear that by my own logic, the edit_form ought to be an .xhtml template. Though, since I'm (presently) playing all roles in my project, it doesn't yet make that much difference. Relatedly, I'm really looking forward to some good tools for building forms. George, have you ever seen Zope's Formulator product? It's pretty impressive, and was the first tool of its kind when it came out some years ago. Maybe it could give you some inspiration :) http://sourceforge.net/projects/formulator Sorry, couldn't find the old tutorials. For all of Zope's problems, they had (I think it's appropriate to use the past tense at this point) there was some cool stuff going on there. Cheers, Peter On Sep 6, 2005, at 9:51 AM, James Britt wrote: > Is this a case, though, of having the model (e.g., that data) > getting mixed up with the presentation, breaking MVC? > > On the other hand, I'm reminded of Allen Holub's articles on doing > GUI stuff in Java, where he derided getters and setters, and said > something along the lines of objects should know how to render > themselves. > > http://www.javaworld.com/javaworld/jw-07-1999/jw-07-toolbox_p.html > > > > > I'll explain the whys and wherefors in a moment, but here are some > rules of thumb that you can apply to see if you're really looking > at an object-oriented system: > > 1. All data is private. Period. (This rule applies to all > implementation details, not just the data.) > 2. get and set functions are evil. (They're just elaborate ways > to make the data public.) > 3. Never ask an object for the information you need to do > something; rather, ask the object that has the information to do > the work for you. > 4. It must be possible to make any change to the way an object > is implemented, no matter how significant that change may be, by > modifying the single class that defines that object. > 5. All objects must provide their own UI. > > If the system doesn't follow these rules, it isn't object-oriented. > It's that simple. That's not to say non-object-oriented systems are > bad; there are many perfectly good procedural systems in the world. > Nonetheless, not exposing data is a fundamental principle of object- > oriented systems. If you violate your principles, you're nothing, > and the same goes for object-oriented systems. If a system violates > object-oriented principles, it isn't object-oriented; it's some > sort of weird hybrid that you may or may not ever get to work right. > > > > So, does this suggest that if I want to render, say, an Account > object in a Web page, I should do something like this: > > <%= account.render( xhtml_form_builder ) %> > > where xhtml_form_builder is some object that an Account instance > knows how to manipulate without needing to know the specifics of > the rendering environment? > > James > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > From transfire at gmail.com Tue Sep 6 14:14:32 2005 From: transfire at gmail.com (TRANS) Date: Tue, 6 Sep 2005 14:14:32 -0400 Subject: [Nitro] xhtml builder in model? In-Reply-To: <431DC901.6000400@neurogami.com> References: <431DC901.6000400@neurogami.com> Message-ID: <4b6f054f0509061114580d1121@mail.gmail.com> On 9/6/05, James Britt wrote: > > > I'll explain the whys and wherefors in a moment, but here are some rules > of thumb that you can apply to see if you're really looking at an > object-oriented system: > > 1. All data is private. Period. (This rule applies to all > implementation details, not just the data.) > 2. get and set functions are evil. (They're just elaborate ways to > make the data public.) > 3. Never ask an object for the information you need to do something; > rather, ask the object that has the information to do the work for you. > 4. It must be possible to make any change to the way an object is > implemented, no matter how significant that change may be, by modifying > the single class that defines that object. > 5. All objects must provide their own UI. > > If the system doesn't follow these rules, it isn't object-oriented. It's > that simple. That's not to say non-object-oriented systems are bad; > there are many perfectly good procedural systems in the world. > Nonetheless, not exposing data is a fundamental principle of > object-oriented systems. If you violate your principles, you're nothing, > and the same goes for object-oriented systems. If a system violates > object-oriented principles, it isn't object-oriented; it's some sort of > weird hybrid that you may or may not ever get to work right. > > Crap. Don't listen to that drival. While the idea has merit up to a limited scale it quickly turns into hell fire. And poos on SOC. Are you really going to teach each object how to display itself in PDF, XML, RDF, ASCII-Art, as infinitum. I don't think so. Your going to convert it to ONE common format, say some nice YAML, and then write Renders for that --is dumping YAML considered accessing public data? Now for a _main_ intereface, say a GUI, sure that's reasonable, but if you really want to get high class you'd use AOP to "weave" the Rendering into the object, thus maintining SOC at the same time. As usual balance is key. I'd be wary of anyone who makes ultimatiums like: "If the system doesn't follow these rules, it isn't object-oriented. It's that simple." > So, does this suggest that if I want to render, say, an Account object > in a Web page, I should do something like this: > > <%= account.render( xhtml_form_builder ) %> > > where xhtml_form_builder is some object that an Account instance knows > how to manipulate without needing to know the specifics of the rendering > environment? Feasible. Is it really much different then an elaborate: out = my_form_str % account.data_for_my_form_str Granted template systems these day have embedded procedures to deal with, but you get the idea. T. From vagabond at cataclysm-software.net Tue Sep 6 15:29:29 2005 From: vagabond at cataclysm-software.net (Andrew Thompson) Date: Tue, 06 Sep 2005 21:29:29 +0200 Subject: [Nitro] RDOG 0.2 (or something like that) In-Reply-To: References: <20050902141000.4f299d25@localhost> <5371ac740509020950632adac1@mail.gmail.com> <43188965.30504@neurogami.com> <43188D4E.6080207@valaraan.de> <43189020.4020607@neurogami.com> <4318DA95.2060506@valaraan.de> <20050903111813.3e86147e@localhost> <43199EF6.1010809@cataclysm-software.net> Message-ID: <431DEE19.4060804@cataclysm-software.net> You've asked me this about 3 times now George, I'll paste my testcase AGAIN, maybe this time you'll keep it somewhere handy :). I just want to have Classes and Methods both able to store Method objects... Vag ============================ require 'rubygems' require_gem 'og' #turn on debugging $DBG = true class Doc property :name, String def initialize(name) @name = name end end class DocModule < Doc has_many :functions, DocMethod #contains many methods end class DocClass < DocModule many_to_many :modules, DocModule #may have many modules, and those modules may be in other classes end class DocMethod < Doc belongs_to :parent, DocModule #belong to a DocModule as DocClass is a subclass of DocModule end db = Og.setup( :store => 'mysql', :name => 'test', :user => 'bleh', :password => 'something' ) testclass = DocClass.new('Testd') testmethod = DocMethod.new('test') testmodule = DocModule.new('module') testmethod.parent = testclass #save the objects testclass.save testmethod.save #this works testmethod.parent = testclass #but reports no parents... puts testmethod.parent #this causes a crash #testclass.add_function(testmethod) #this causes a crash #puts testclass.functions =============================== George Moschovitis wrote: >>(og still doesn't seem to want to play nice with inherited classes), > > > what is the problem exactly? > > -g. > > > From Jochen at Schalanda.de Tue Sep 6 17:39:56 2005 From: Jochen at Schalanda.de (Jochen Schalanda) Date: Tue, 06 Sep 2005 23:39:56 +0200 Subject: [Nitro] Rdocs In-Reply-To: <908914B5-48C3-4845-9FE2-56CA8FCF8797@gmail.com> References: <908914B5-48C3-4845-9FE2-56CA8FCF8797@gmail.com> Message-ID: On 09/06/2005 06:43 PM, Peter Abrahamsen wrote: > If anyone needs nitro/og/glue rdocs while nitrohq is down, I've got > some over here: > > http://taffy.findpage.com/~peidran/ > > Cheers, Peter Just in case someone didn't (like me some time ago): You can access the rdoc of any gem locally on http://localhost:8808, if you start "gem_server". It should be faster (and more bandwidth friendly) than accessing the docs on a remote server. Regards, Jochen From rainhead at gmail.com Tue Sep 6 19:04:58 2005 From: rainhead at gmail.com (Peter Abrahamsen) Date: Tue, 6 Sep 2005 16:04:58 -0700 Subject: [Nitro] Views and Templating Message-ID: The V part of MVC feels neglected. Actions and views seem to be the same thing in Nitro, and that's (for my uses) a weakness. I still don't know Nitro well enough to know what breaking out of that circumstance entails. Here are some problems that arise: - I'd like to ask for some model object ("entity"?) to express itself in some way, I have to do some work to track down the right view. I'd like to just say, "Tell the person whose name is Fred to give me a summary of himself." But as things are, a Person has no idea how to do that. This becomes a problem if the view is associated with a different Controller. - If I want a site-wide (across Controllers) generic page template, then each action_view template needs to call something in the Controller, or something in the Skin (some Element). A view shouldn't be /expected/ to provide or delegate to provide an tag. What I'd like is for the template to have that option, or else the Controller can provide wrap the template, and the Controller may additionally resort to a site-wide template (which would happen by default if nothing's specified in the Controller). I'm not positive about this division of responsibility, but it's closer to what I'd like to see. --> does Advice have something to do with this? All of this is informed by Zope's Page Templates (ZPT, TAL, and TALES) which provided a large degree of flexibility. It was almost Aspect-oriented, in that templates could replace parts of each other, and data could be coming from several different parts of the code. If you haven't seen ZPT in action, it's entirely worthwhile to install a copy of Plone or something and see how it works. Having actions and views coupled tightly precludes this kind of behavior. I'd enjoy hearing how I'm not seeing things correctly, or how to achieve some of these goals in Nitro without going crazy. Cheers, Peter From james_b at neurogami.com Tue Sep 6 20:07:32 2005 From: james_b at neurogami.com (James Britt) Date: Tue, 06 Sep 2005 17:07:32 -0700 Subject: [Nitro] xhtml builder in model? In-Reply-To: <4b6f054f0509061114580d1121@mail.gmail.com> References: <431DC901.6000400@neurogami.com> <4b6f054f0509061114580d1121@mail.gmail.com> Message-ID: <431E2F44.5060803@neurogami.com> TRANS wrote: .. > > > Crap. Don't listen to that drival. While the idea has merit up to a > limited scale it quickly turns into hell fire. And poos on SOC. Are > you really going to teach each object how to display itself in PDF, > XML, RDF, ASCII-Art, as infinitum. I don't think so. No, I thin the idea is to be able to do something like this: my_model.render( pdf_writer ) or my_model.render( wml_writer ) where all *_writer objects expose a known API; my_model need only know about that single API, passing data to the writer object. The writer need not know the data details of my_model. > Your going to > convert it to ONE common format, say some nice YAML, and then write > Renders for that --is dumping YAML considered accessing public data? > Now for a _main_ intereface, say a GUI, sure that's reasonable, but if > you really want to get high class you'd use AOP to "weave" the > Rendering into the object, thus maintining SOC at the same time. Except I think that leads to coupling between the model's YAML and the rendering code. > > As usual balance is key. I'd be wary of anyone who makes ultimatiums > like: "If the system doesn't follow these rules, it isn't > object-oriented. It's that simple." Well, such statements may be designed more to provoke discussion than to actually assert something as fact. "Hype is the new black", and all that. But I believe he is essentially correct. > > >>So, does this suggest that if I want to render, say, an Account object >>in a Web page, I should do something like this: >> >><%= account.render( xhtml_form_builder ) %> >> >>where xhtml_form_builder is some object that an Account instance knows >>how to manipulate without needing to know the specifics of the rendering >>environment? > > > Feasible. Is it really much different then an elaborate: > > out = my_form_str % account.data_for_my_form_str > Depends. Who is asking whom for what? In which direction do (most of) the dependencies go? James -- http://www.ruby-doc.org - The Ruby Documentation Site http://www.rubyxml.com - News, Articles, and Listings for Ruby & XML http://www.rubystuff.com - The Ruby Store for Ruby Stuff http://www.jamesbritt.com - Playing with Better Toys From rainhead at gmail.com Tue Sep 6 20:49:20 2005 From: rainhead at gmail.com (Peter Abrahamsen) Date: Tue, 6 Sep 2005 17:49:20 -0700 Subject: [Nitro] Rdocs In-Reply-To: References: <908914B5-48C3-4845-9FE2-56CA8FCF8797@gmail.com> Message-ID: <36D8479E-6091-45D0-9634-C15DD80B1307@gmail.com> I didn't know that. It's wonderful, thanks. P On Sep 6, 2005, at 2:39 PM, Jochen Schalanda wrote: > On 09/06/2005 06:43 PM, Peter Abrahamsen wrote: > >> If anyone needs nitro/og/glue rdocs while nitrohq is down, I've got >> some over here: >> >> http://taffy.findpage.com/~peidran/ >> >> Cheers, Peter >> > > Just in case someone didn't (like me some time ago): > You can access the rdoc of any gem locally on http://localhost: > 8808, if > you start "gem_server". It should be faster (and more bandwidth > friendly) than accessing the docs on a remote server. > > Regards, > Jochen > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > From epiperak at softlab.ece.ntua.gr Tue Sep 6 21:29:05 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Wed, 7 Sep 2005 04:29:05 +0300 (EEST) Subject: [Nitro] Rdocs In-Reply-To: References: <908914B5-48C3-4845-9FE2-56CA8FCF8797@gmail.com> Message-ID: > Just in case someone didn't (like me some time ago): > You can access the rdoc of any gem locally on http://localhost:8808, if > you start "gem_server". It should be faster (and more bandwidth > friendly) than accessing the docs on a remote server. My Nitro installation has some kind of problem and the rdoc is not installed! Therefore this option does not work... :-) > > Regards, > Jochen > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From epiperak at softlab.ece.ntua.gr Tue Sep 6 22:44:15 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Wed, 7 Sep 2005 05:44:15 +0300 (EEST) Subject: [Nitro] table Message-ID: Hi all, my latest question ;-) After poking around on how to use the TableMixin I found out the following: 1) the example in the file table.rb is wrong (deprecated). In order to use the TableMixin you have to do the following a) create a header array b) create a values array of array by mapping your data to that array c) call the mixin eg. # in the controller def bgroups @data = Bgroup.all.map {|b| [b.title_en,b.title_jp,b.creation]} @header = ['title_en','title_jp','creation'] @id = 'bgroup_id' # same as in the css file, used for formating end # in the view file
#{table(:id => @id, :headers => @header, :values => @data)}
2) My question is: when I want to Localize the headers then the following line does not work (even thought it should) @header = ['[[bgroup_title_en]]','[[bgroup_title_jp]]','[[bgroup_creation]]'] it seems that the TableMixin returns the string for the table creation, but the string does not get Localized. George? Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From james_b at neurogami.com Tue Sep 6 23:03:36 2005 From: james_b at neurogami.com (James Britt) Date: Tue, 06 Sep 2005 20:03:36 -0700 Subject: [Nitro] Rdocs In-Reply-To: References: <908914B5-48C3-4845-9FE2-56CA8FCF8797@gmail.com> Message-ID: <431E5888.8060302@neurogami.com> Emmanuel Piperakis wrote: >> Just in case someone didn't (like me some time ago): >> You can access the rdoc of any gem locally on http://localhost:8808, if >> you start "gem_server". It should be faster (and more bandwidth >> friendly) than accessing the docs on a remote server. > > > My Nitro installation has some kind of problem and the rdoc is not > installed! Therefore this option does not work... :-) I *think* you can run rdoc over the source tree, and then copy the resulting docs over to where they should be in the gems/docs tree James -- http://www.ruby-doc.org - The Ruby Documentation Site http://www.rubyxml.com - News, Articles, and Listings for Ruby & XML http://www.rubystuff.com - The Ruby Store for Ruby Stuff http://www.jamesbritt.com - Playing with Better Toys From epiperak at softlab.ece.ntua.gr Tue Sep 6 23:42:37 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Wed, 7 Sep 2005 06:42:37 +0300 (EEST) Subject: [Nitro] Rdocs In-Reply-To: <431E5888.8060302@neurogami.com> References: <908914B5-48C3-4845-9FE2-56CA8FCF8797@gmail.com> <431E5888.8060302@neurogami.com> Message-ID: > I *think* you can run rdoc over the source tree, and then copy the resulting > docs over to where they should be in the gems/docs tree I tried rake rdoc, rake doc (no result). Probably my rake is not installed correctly...... Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From transfire at gmail.com Wed Sep 7 00:23:57 2005 From: transfire at gmail.com (TRANS) Date: Wed, 7 Sep 2005 00:23:57 -0400 Subject: [Nitro] xhtml builder in model? In-Reply-To: <431E2F44.5060803@neurogami.com> References: <431DC901.6000400@neurogami.com> <4b6f054f0509061114580d1121@mail.gmail.com> <431E2F44.5060803@neurogami.com> Message-ID: <4b6f054f05090621234bcbe6ce@mail.gmail.com> On 9/6/05, James Britt wrote: > TRANS wrote: > .. > > > > > > > Crap. Don't listen to that drival. While the idea has merit up to a > > limited scale it quickly turns into hell fire. And poos on SOC. Are > > you really going to teach each object how to display itself in PDF, > > XML, RDF, ASCII-Art, as infinitum. I don't think so. > > No, I thin the idea is to be able to do something like this: > > my_model.render( pdf_writer ) > or > my_model.render( wml_writer ) > > where all *_writer objects expose a known API; my_model need only know > about that single API, passing data to the writer object. The writer > need not know the data details of my_model. But what does that amount to? Both writer's have to have the same API. That can be difficult, commonly resulting in an LCD effect. Even so, you've reduced the problem to a single interface writer->model, but it's a one-to-one mapping so you can turn it orthogonally and do model -> writer. It amounts to the same thing. class Writer def render( model ) do_this(model.x) do_that(model.y) class Model def render( writer ) writer.do_this(self.x) writer.do_that(self.y) > > Your going to > > convert it to ONE common format, say some nice YAML, and then write > > Renders for that --is dumping YAML considered accessing public data? > > Now for a _main_ intereface, say a GUI, sure that's reasonable, but if > > you really want to get high class you'd use AOP to "weave" the > > Rendering into the object, thus maintining SOC at the same time. > > Except I think that leads to coupling between the model's YAML and the > rendering code. A coupling is inevitable. In fact that's exactly what you are after. The choice that really matters is to make it generic or specific, not whater the model does it to the controller or vice versa --that's mostly just a matter of perspective. > > > > As usual balance is key. I'd be wary of anyone who makes ultimatiums > > like: "If the system doesn't follow these rules, it isn't > > object-oriented. It's that simple." > > Well, such statements may be designed more to provoke discussion than to > actually assert something as fact. "Hype is the new black", and all > that. But I believe he is essentially correct. Correct as in a fact? This is subject and is all about where you stand, and what works. Taken as fact, this purity of reason could have one expecting a baseball to know how to be hit by a bat. > >>So, does this suggest that if I want to render, say, an Account object > >>in a Web page, I should do something like this: > >> > >><%= account.render( xhtml_form_builder ) %> > >> > >>where xhtml_form_builder is some object that an Account instance knows > >>how to manipulate without needing to know the specifics of the rendering > >>environment? > > > > > > Feasible. Is it really much different then an elaborate: > > > > out = my_form_str % account.data_for_my_form_str > > > > Depends. Who is asking whom for what? In which direction do (most of) > the dependencies go? That is a good question, b/c that will generally determine LOC. T. From james_b at neurogami.com Wed Sep 7 00:42:50 2005 From: james_b at neurogami.com (James Britt) Date: Tue, 06 Sep 2005 21:42:50 -0700 Subject: [Nitro] xhtml builder in model? In-Reply-To: <4b6f054f05090621234bcbe6ce@mail.gmail.com> References: <431DC901.6000400@neurogami.com> <4b6f054f0509061114580d1121@mail.gmail.com> <431E2F44.5060803@neurogami.com> <4b6f054f05090621234bcbe6ce@mail.gmail.com> Message-ID: <431E6FCA.4080902@neurogami.com> TRANS wrote: > On 9/6/05, James Britt wrote: ... >>No, I thin the idea is to be able to do something like this: >> >>my_model.render( pdf_writer ) >> or >>my_model.render( wml_writer ) >> >>where all *_writer objects expose a known API; my_model need only know >>about that single API, passing data to the writer object. The writer >>need not know the data details of my_model. > > > But what does that amount to? Both writer's have to have the same API. > That can be difficult, commonly resulting in an LCD effect. Even so, > you've reduced the problem to a single interface writer->model, but > it's a one-to-one mapping so you can turn it orthogonally and do > model -> writer. It amounts to the same thing. > > class Writer > def render( model ) > do_this(model.x) > do_that(model.y) > > class Model > def render( writer ) > writer.do_this(self.x) > writer.do_that(self.y) > I don't know that I can offer a persuasive argument, but I prefer the latter. James -- http://www.ruby-doc.org - The Ruby Documentation Site http://www.rubyxml.com - News, Articles, and Listings for Ruby & XML http://www.rubystuff.com - The Ruby Store for Ruby Stuff http://www.jamesbritt.com - Playing with Better Toys From james_b at neurogami.com Wed Sep 7 00:54:31 2005 From: james_b at neurogami.com (James Britt) Date: Tue, 06 Sep 2005 21:54:31 -0700 Subject: [Nitro] Rdocs In-Reply-To: References: <908914B5-48C3-4845-9FE2-56CA8FCF8797@gmail.com> <431E5888.8060302@neurogami.com> Message-ID: <431E7287.1090103@neurogami.com> Emmanuel Piperakis wrote: >> I *think* you can run rdoc over the source tree, and then copy the >> resulting docs over to where they should be in the gems/docs tree > > > I tried rake rdoc, rake doc (no result). Probably my rake is not > installed correctly...... > Forget rake. Just run rdoc. C:\ruby\lib\ruby\gems\1.8\gems\og-0.23.0\lib>rdoc --main og.rb collection.rb: mc................ entity.rb: mm.m....................cc. errors.rb: mc. # much stuff ... mysql411.rb: c............. Generating HTML... Files: 37 Classes: 52 Modules: 51 Methods: 520 Elapsed: 16.563s C:\ruby\lib\ruby\gems\1.8\gems\og-0.23.0\lib> This produces a 'doc' directory, with the rdoc files. Copy the contents of that 'doc' dir to C:\ruby\lib\ruby\gems\1.8\doc\og-0.23.0\rdoc Adjust where needed on *nix boxen. Actually, the README file in the main Og source directory makes a better main page for the rdoc, so you may consider moving it to the lib ir before running rdoc, and setting that as the main page: rdoc --main README But this should give you an idea of what to do. James -- http://www.ruby-doc.org - The Ruby Documentation Site http://www.rubyxml.com - News, Articles, and Listings for Ruby & XML http://www.rubystuff.com - The Ruby Store for Ruby Stuff http://www.jamesbritt.com - Playing with Better Toys From epiperak at softlab.ece.ntua.gr Wed Sep 7 01:26:03 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Wed, 7 Sep 2005 08:26:03 +0300 (EEST) Subject: [Nitro] Rdocs In-Reply-To: <431E7287.1090103@neurogami.com> References: <908914B5-48C3-4845-9FE2-56CA8FCF8797@gmail.com> <431E5888.8060302@neurogami.com> <431E7287.1090103@neurogami.com> Message-ID: Thanx! :-| > Emmanuel Piperakis wrote: >>> I *think* you can run rdoc over the source tree, and then copy the >>> resulting docs over to where they should be in the gems/docs tree >> >> >> I tried rake rdoc, rake doc (no result). Probably my rake is not >> installed correctly...... >> > > Forget rake. Just run rdoc. > > > C:\ruby\lib\ruby\gems\1.8\gems\og-0.23.0\lib>rdoc --main og.rb > > collection.rb: mc................ > entity.rb: mm.m....................cc. > errors.rb: mc. > # much stuff ... > mysql411.rb: c............. > Generating HTML... > > Files: 37 > Classes: 52 > Modules: 51 > Methods: 520 > Elapsed: 16.563s > > C:\ruby\lib\ruby\gems\1.8\gems\og-0.23.0\lib> > > This produces a 'doc' directory, with the rdoc files. Copy the contents of > that 'doc' dir to > > C:\ruby\lib\ruby\gems\1.8\doc\og-0.23.0\rdoc > > Adjust where needed on *nix boxen. > > Actually, the README file in the main Og source directory makes a better main > page for the rdoc, so you may consider moving it to the lib ir before running > rdoc, and setting that as the main page: > > rdoc --main README > > > But this should give you an idea of what to do. > > James > > -- > > http://www.ruby-doc.org - The Ruby Documentation Site > http://www.rubyxml.com - News, Articles, and Listings for Ruby & XML > http://www.rubystuff.com - The Ruby Store for Ruby Stuff > http://www.jamesbritt.com - Playing with Better Toys > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From transfire at gmail.com Wed Sep 7 01:34:31 2005 From: transfire at gmail.com (TRANS) Date: Wed, 7 Sep 2005 01:34:31 -0400 Subject: [Nitro] xhtml builder in model? In-Reply-To: <431E6FCA.4080902@neurogami.com> References: <431DC901.6000400@neurogami.com> <4b6f054f0509061114580d1121@mail.gmail.com> <431E2F44.5060803@neurogami.com> <4b6f054f05090621234bcbe6ce@mail.gmail.com> <431E6FCA.4080902@neurogami.com> Message-ID: <4b6f054f0509062234457d1f05@mail.gmail.com> On 9/7/05, James Britt wrote: > > class Writer > > def render( model ) > > do_this(model.x) > > do_that(model.y) > > > > class Model > > def render( writer ) > > writer.do_this(self.x) > > writer.do_that(self.y) > > > > I don't know that I can offer a persuasive argument, but I prefer the > latter. I understand. I generally do too, but we program Ruby. Now if we were Lisp programmers, I have a feeling we' might have a different opinion. T. From epiperak at softlab.ece.ntua.gr Wed Sep 7 01:34:58 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Wed, 7 Sep 2005 08:34:58 +0300 (EEST) Subject: [Nitro] just some suggestions Message-ID: Hi all, I know I am not a Ruby Guru, but here are some suggestions: in Nitro, xhtml.rb, in date_select I believe the 3rd line should be data ||= Date.today cause data ||= Time.now makes the recieve object of class Time and it is incompatible with Date objects in Og... Also date_select should have options for a wider range of year select (not just +- 10 years) Also there should be an option for turning months to numbers, turning off days, displaying years in '05 format, etc etc... I might try to rewrite it myself, but since I am no Ruby guru :-( Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From george.moschovitis at gmail.com Wed Sep 7 01:48:12 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Wed, 7 Sep 2005 08:48:12 +0300 Subject: [Nitro] RDOG 0.2 (or something like that) In-Reply-To: <431DEE19.4060804@cataclysm-software.net> References: <20050902141000.4f299d25@localhost> <5371ac740509020950632adac1@mail.gmail.com> <43188965.30504@neurogami.com> <43188D4E.6080207@valaraan.de> <43189020.4020607@neurogami.com> <4318DA95.2060506@valaraan.de> <20050903111813.3e86147e@localhost> <43199EF6.1010809@cataclysm-software.net> <431DEE19.4060804@cataclysm-software.net> Message-ID: :-) ok... -g. On 9/6/05, Andrew Thompson wrote: > You've asked me this about 3 times now George, I'll paste my testcase > AGAIN, maybe this time you'll keep it somewhere handy :). I just want to > have Classes and Methods both able to store Method objects... > > Vag > > > ============================ > > require 'rubygems' > require_gem 'og' > > #turn on debugging > $DBG = true > > class Doc > property :name, String > > def initialize(name) > @name = name > end > end > > class DocModule < Doc > has_many :functions, DocMethod #contains many methods > end > > class DocClass < DocModule > many_to_many :modules, DocModule #may have many modules, and those > modules may be in other classes > end > > class DocMethod < Doc > belongs_to :parent, DocModule #belong to a DocModule as DocClass is > a subclass of DocModule > end > > db = Og.setup( > :store => 'mysql', > :name => 'test', > :user => 'bleh', > :password => 'something' > ) > > testclass = DocClass.new('Testd') > testmethod = DocMethod.new('test') > testmodule = DocModule.new('module') > > testmethod.parent = testclass > > #save the objects > > testclass.save > testmethod.save > > #this works > testmethod.parent = testclass > > #but reports no parents... > puts testmethod.parent > > #this causes a crash > #testclass.add_function(testmethod) > > #this causes a crash > #puts testclass.functions > > =============================== > > George Moschovitis wrote: > >>(og still doesn't seem to want to play nice with inherited classes), > > > > > > what is the problem exactly? > > > > -g. > > > > > > > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From george.moschovitis at gmail.com Wed Sep 7 02:02:09 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Wed, 7 Sep 2005 09:02:09 +0300 Subject: [Nitro] spark and update_time In-Reply-To: <431DCE0A.6000304@valaraan.de> References: <431DCD54.8040108@valaraan.de> <431DCE0A.6000304@valaraan.de> Message-ID: yeap Trans changed the to_s method, thanks for pointing out. -g. On 9/6/05, manveru wrote: > manveru wrote: > > > hi list, > > > > now, almost a tradition, my daily problem :) > > > > i noticed that in spark every page wich contains: > > > > #{@revision.update_time.to_s(:db)} > > i shouldn't post too fast next time - i looked at some other templates > and found the combination update_time.stamp(:db) quite often, so i > replaced to_s with that stamp... > it's just a quick fix - maybe some alias would be better > > so long... > manveru > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From epiperak at softlab.ece.ntua.gr Wed Sep 7 04:47:30 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Wed, 7 Sep 2005 11:47:30 +0300 (EEST) Subject: [Nitro] %| | Message-ID: what does it stand for? Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From george.moschovitis at gmail.com Wed Sep 7 05:10:03 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Wed, 7 Sep 2005 12:10:03 +0300 Subject: [Nitro] %| | In-Reply-To: References: Message-ID: it is the same as %{} this is a feature of ruby. -g. On 9/7/05, Emmanuel Piperakis wrote: > what does it stand for? > > Emmanouil Piperakis (epiperak at cs.ntua.gr) > {To explore is Human, to Create is Devine, > To teach is Primal, to Rule is Sin} > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From epiperak at softlab.ece.ntua.gr Wed Sep 7 05:11:51 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Wed, 7 Sep 2005 12:11:51 +0300 (EEST) Subject: [Nitro] nobody there? Message-ID: Hi, why doesn't anybody answer? :-( The problem I am facing in kind of this: most of the Mixin functions return a string using the %| .... | which evaluates correctly when I pass #{...} in it, but when I use it in the .xhtml files is is not correctly proccessed, eg in the controller I have def link_pop(function_s = "", label_s = "", caller_s = "", id_s = "") %|\#\{popup(:text => '#{label_s}', :uri => '#{function_s}/#{caller_s}/#{id_s}')\}| end which I pass to the view through this... @data = @bgroups.map {|b| [b.title_en, b.title_jp, b.creation, link_set("sel","S","bgroup",b.oid.to_s), link_pop("edi","E","bgroup",b.oid.to_s), link_set("del","D","bgroup",b.oid.to_s)]} then in the view I have... #{table(:headers => @header, :values => @data)} but instead of getting the popup link I get a string like... #{popup(:text => 'E', :uri => 'edi/bgroup/1')} Please help here... Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From george.moschovitis at gmail.com Wed Sep 7 05:25:41 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Wed, 7 Sep 2005 12:25:41 +0300 Subject: [Nitro] nobody there? In-Reply-To: References: Message-ID: > why doesn't anybody answer? :-( we are extremely busy, be patient. > The problem I am facing in kind of this: > > most of the Mixin functions return a string using the %| .... | which > evaluates correctly when I pass #{...} in it, but when I use it in the > .xhtml files is is not correctly proccessed, eg > > in the controller I have > > Please help here... from a quick look, you probably need to remove the escaping from #{popup} -g. -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From citizen428 at gentoo.org Wed Sep 7 05:45:59 2005 From: citizen428 at gentoo.org (Michael Kohl) Date: Wed, 7 Sep 2005 11:45:59 +0200 Subject: [Nitro] nobody there? In-Reply-To: References: Message-ID: <20050907114559.2d12714c@localhost> On Wed, 7 Sep 2005 12:11:51 +0300 (EEST) Emmanuel Piperakis wrote: > why doesn't anybody answer? :-( Judging from the time stamps on your two messages, there were only 24 minutes between them. Expecting this kind of response time from a mailing list is a little demanding, don't you think? You know that there also is #nitro at Freeenode, maybe you should try IRC if you really need fast answers. Cheers, Michael -- web at citizen428.net citizen428 at gentoo.org http://citizen428.net/ http://dev.gentoo.org/~citizen428/ GnuPG key: 0x90CA09E3/4D21 916E DBCE 72B8 CDC5 BD87 DE2D 91A2 90CA 09E3 From citizen428 at gentoo.org Wed Sep 7 05:55:00 2005 From: citizen428 at gentoo.org (Michael Kohl) Date: Wed, 7 Sep 2005 11:55:00 +0200 Subject: [Nitro] nobody there? In-Reply-To: <20050907114559.2d12714c@localhost> References: <20050907114559.2d12714c@localhost> Message-ID: <20050907115500.059cbf12@localhost> On Wed, 7 Sep 2005 11:45:59 +0200 Michael Kohl wrote: > Judging from the time stamps on your two messages, there were only 24 > minutes between them. And from the lack of coffee in my blood stream I no gather to your 3 last messages, not only the last one... Sorry for that! But my original statement still holds true, this is a volunteer thing, and people will answer if they have the time and the knowledge to do so. Somtimes you'll just have to wait a little longer... :) -- web at citizen428.net citizen428 at gentoo.org http://citizen428.net/ http://dev.gentoo.org/~citizen428/ GnuPG key: 0x90CA09E3/4D21 916E DBCE 72B8 CDC5 BD87 DE2D 91A2 90CA 09E3 From epiperak at softlab.ece.ntua.gr Wed Sep 7 05:57:01 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Wed, 7 Sep 2005 12:57:01 +0300 (EEST) Subject: [Nitro] nobody there? In-Reply-To: <20050907114559.2d12714c@localhost> References: <20050907114559.2d12714c@localhost> Message-ID: >> why doesn't anybody answer? :-( > > Judging from the time stamps on your two messages, there were only 24 > minutes between them. Expecting this kind of response time from a > mailing list is a little demanding, don't you think? > > You know that there also is #nitro at Freeenode, maybe you should try > IRC if you really need fast answers. I am actually the only one speaking in the channel (now that manveru has gone to sleep). And it takes more time to write 2 paragraphs of text than actually think about the question I was not demanding, I was just inquiring... Regards > > > Cheers, > Michael > > -- > web at citizen428.net citizen428 at gentoo.org > http://citizen428.net/ http://dev.gentoo.org/~citizen428/ > GnuPG key: 0x90CA09E3/4D21 916E DBCE 72B8 CDC5 BD87 DE2D 91A2 90CA 09E3 > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From transfire at gmail.com Wed Sep 7 05:57:36 2005 From: transfire at gmail.com (TRANS) Date: Wed, 7 Sep 2005 05:57:36 -0400 Subject: [Nitro] spark and update_time In-Reply-To: References: <431DCD54.8040108@valaraan.de> <431DCE0A.6000304@valaraan.de> Message-ID: <4b6f054f05090702573d36738d@mail.gmail.com> On 9/7/05, George Moschovitis wrote: > yeap Trans changed the to_s method, thanks for pointing out. :-] In my own defence, an important rule of thumb is to create a new method rather the override a built-in one. That's why that was "fixed". T. From epiperak at softlab.ece.ntua.gr Wed Sep 7 06:03:46 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Wed, 7 Sep 2005 13:03:46 +0300 (EEST) Subject: [Nitro] nobody there? In-Reply-To: <20050907115500.059cbf12@localhost> References: <20050907114559.2d12714c@localhost> <20050907115500.059cbf12@localhost> Message-ID: > And from the lack of coffee in my blood stream I no gather to your 3 > last messages, not only the last one... Sorry for that! > No worries, ... The thing is I am on a deadline, I am porting my already working rails app to nitro, just to prove that things work better with nitro and to support the project (and to add some new features to the original app ;-) So being under a lot of stress, searching for a thing that is 100% impossible for me to find out it is impossible to constrain myself from posting. If I get annoying, plz tell me... I will stop posting. Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From citizen428 at gentoo.org Wed Sep 7 06:15:02 2005 From: citizen428 at gentoo.org (Michael Kohl) Date: Wed, 7 Sep 2005 12:15:02 +0200 Subject: [Nitro] nobody there? In-Reply-To: References: <20050907114559.2d12714c@localhost> <20050907115500.059cbf12@localhost> Message-ID: <20050907121502.3945269d@localhost> On Wed, 7 Sep 2005 13:03:46 +0300 (EEST) Emmanuel Piperakis wrote: > If I get annoying, plz tell me... I will stop posting. Nah, I think the only annoying person in this thread was me for jumping on you too quickly. Lack of sleep plus lack of caffeine is a dangerous combination when it comes to my social skills... ;) -- web at citizen428.net citizen428 at gentoo.org http://citizen428.net/ http://dev.gentoo.org/~citizen428/ GnuPG key: 0x90CA09E3/4D21 916E DBCE 72B8 CDC5 BD87 DE2D 91A2 90CA 09E3 From epiperak at softlab.ece.ntua.gr Wed Sep 7 06:22:38 2005 From: epiperak at softlab.ece.ntua.gr (Emmanuel Piperakis) Date: Wed, 7 Sep 2005 13:22:38 +0300 (EEST) Subject: [Nitro] nobody there? In-Reply-To: <20050907121502.3945269d@localhost> References: <20050907114559.2d12714c@localhost> <20050907115500.059cbf12@localhost> <20050907121502.3945269d@localhost> Message-ID: > Nah, I think the only annoying person in this thread was me for jumping > on you too quickly. Lack of sleep plus lack of caffeine is a dangerous > combination when it comes to my social skills... ;) > The worst thing is that a huge tyfoo is passing close to Tokyo and the winds are really strong. As a result of the cheap architectural design of the building I am working in, the 8th floor feels like I am in a boat. The building actually SHAKES!!! I am constantly feeling sick for 8 hours and trying to debug!!! Emmanouil Piperakis (epiperak at cs.ntua.gr) {To explore is Human, to Create is Devine, To teach is Primal, to Rule is Sin} From james_b at neurogami.com Wed Sep 7 09:04:12 2005 From: james_b at neurogami.com (James Britt) Date: Wed, 07 Sep 2005 06:04:12 -0700 Subject: [Nitro] xhtml builder in model? In-Reply-To: <4b6f054f0509062234457d1f05@mail.gmail.com> References: <431DC901.6000400@neurogami.com> <4b6f054f0509061114580d1121@mail.gmail.com> <431E2F44.5060803@neurogami.com> <4b6f054f05090621234bcbe6ce@mail.gmail.com> <431E6FCA.4080902@neurogami.com> <4b6f054f0509062234457d1f05@mail.gmail.com> Message-ID: <431EE54C.3000208@neurogami.com> TRANS wrote: > On 9/7/05, James Britt wrote: > >>> class Writer >>> def render( model ) >>> do_this(model.x) >>> do_that(model.y) >>> >>> class Model >>> def render( writer ) >>> writer.do_this(self.x) >>> writer.do_that(self.y) >>> >> >>I don't know that I can offer a persuasive argument, but I prefer the >>latter. > > > I understand. I generally do too, but we program Ruby. Now if we were > Lisp programmers, I have a feeling we' might have a different opinion. > Could you you explain that? I believe my choice sticks closer to a "Tell, don't ask", approach, which seems pretty consistent with an OO style. James -- http://www.ruby-doc.org - The Ruby Documentation Site http://www.rubyxml.com - News, Articles, and Listings for Ruby & XML http://www.rubystuff.com - The Ruby Store for Ruby Stuff http://www.jamesbritt.com - Playing with Better Toys From tim at keow.org Wed Sep 7 09:05:41 2005 From: tim at keow.org (Tim Larson) Date: Wed, 7 Sep 2005 14:05:41 +0100 Subject: [Nitro] nitrogen and relative paths Message-ID: <20050907130541.GA4465@localhost> Could nitrogen be changed for the next release to resolve relative paths against to the current working directory? I believe this would be much more intuitive than how it works now, resolving relative paths against some other unstated, and probably unexpected, directory. --Tim Larson From james_b at neurogami.com Wed Sep 7 09:06:30 2005 From: james_b at neurogami.com (James Britt) Date: Wed, 07 Sep 2005 06:06:30 -0700 Subject: [Nitro] just some suggestions In-Reply-To: References: Message-ID: <431EE5D6.90008@neurogami.com> Emmanuel Piperakis wrote: > Hi all, > I know I am not a Ruby Guru, but here are some suggestions: > in Nitro, xhtml.rb, in date_select I believe the 3rd line should be > data ||= Date.today > cause data ||= Time.now makes the recieve object of class Time and it is > incompatible with Date objects in Og... > > Also date_select should have options for a wider range of year select > (not just +- 10 years) > > Also there should be an option for turning months to numbers, turning > off days, displaying years in '05 format, etc etc... > > I might try to rewrite it myself, but since I am no Ruby guru :-( > Ah, but skill to do comes of doing. James -- http://www.ruby-doc.org - The Ruby Documentation Site http://www.rubyxml.com - News, Articles, and Listings for Ruby & XML http://www.rubystuff.com - The Ruby Store for Ruby Stuff http://www.jamesbritt.com - Playing with Better Toys From fabian at oggu.de Wed Sep 7 09:42:02 2005 From: fabian at oggu.de (Fabian Buch) Date: Wed, 7 Sep 2005 15:42:02 +0200 Subject: [Nitro] Elements killing Message-ID: <125e06d10a652057e009301a6afd0ec6@oggu.de> hi A blank text area as usually used in an entry_form or comment_form like , without content (I don't even want a blankspace to be there) is squeezed together to , which I consider more as a hack than a solution since I think the so called Web Engine should do it right, not the individual webapps. For everyone having the same problem: commenting out 165 and 166 in elements.rb has no real negative side-effects. Fabian Buch From Walter at mwsewall.com Wed Sep 7 09:55:11 2005 From: Walter at mwsewall.com (Walter) Date: Wed, 7 Sep 2005 09:55:11 -0400 Subject: [Nitro] Validation errors and redisplaying form field data.... Message-ID: <9DB53D616B4D5B47B8353ACBF155C6B70CE172@mwsewall.com> Hi Everyone. What is the recommend way to redisplay a page, show the error info, but also have the previous user data show up as well. Take a simple example. I have a form on the index page which has 2 text fields that correlate to 2 non Og related model fields. Currently the form post to the "result" action. It then gets validated. If there is a validation error I store that in the flash and then issue a redirect_to_referer. Now it appears to be a true redirect which means the request params are empty, so I do not have the original post data. What is the pattern that everyone is using here? Do I need to store the params in a session and then manually pull them back out? Are there helpers that do this already? I just feel like I am doing work that is probably already done by Nitro and I am missing a couple of fundamental points. Thanks for any feedback, Walt -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.344 / Virus Database: 267.10.18/91 - Release Date: 9/6/2005 From deb at ysabel.org Wed Sep 7 09:56:09 2005 From: deb at ysabel.org (Ysabel) Date: Wed, 07 Sep 2005 07:56:09 -0600 Subject: [Nitro] Encapsulation (was Re: xhtml builder in model?) Message-ID: <08C1619A2C03EA65CBC384D7@[10.19.0.236]> >> class Writer >> def render( model ) >> do_this(model.x) >> do_that(model.y) >> >> class Model >> def render( writer ) >> writer.do_this(self.x) >> writer.do_that(self.y) >> > > I don't know that I can offer a persuasive argument, but I prefer the > latter. The former violates encapsulation (Writer knows that model has properties X and Y, and if you change the general shape of Model, you'll have to change Writer as well). The latter does not, presuming that do_this() and do_that() are, in fact, intended as part of Writer's public interface and thus less likely to change. To make it more concrete, since do_this and do_that don't tell you much, compare: class Model attr_accessor :name attr_accessor :color def self.color_choices [ "Red", "Green", "Blue" ] end end class Writer def render_text_input(value) ... end def render_choice(value) ... end def render(model) render_text_input(model.name) render_choice(model.color, Model.color_choices) end end to this: class Writer def render_text_input(value) ... end def render_choice(value) ... end end class Model def render(writer) writer.render_text_input(@name) writer.render_choice(@color, ["Red", "Green", "Blue"]) end end When looking at those two cases, ask the question about which objects know what things. Encapsulation is all about keeping knowledge on a need-to-know basis. Yes, the code for these two isn't all that different, but in the first case Writer knows about Model's implementation -- it knows that Models have names and colors and that names should be rendered as text and colors should be rendered as choices, and it has to know how to figure out what the valid choices for a color are; in the second only Model knows how it's implemented (and the details aren't even exposed). In the first, Model doesn't know anything at all about Writer; in the second, Model knows that Writer allows one to render a text input and a choice, but nothing more. This is, of course, based on the assumption that Writer has a well-defined interface and it's most likely Model that you're planning on tweaking as you work through the problem. If Writer is not well-defined, then both of the original examples violate encapsulation by messing with each other's implementation details...and you really need to figure out some sort of stable interface! Or at least a metastable one...note also that I am using interface in a generic sense here rather than in some sort of strict-typing capital-I-Interface sense. This is not unique to Ruby somehow; it's a standard problem in every language I've ever worked in, though the idiomatic solution may change from language to language. Reducing coupling and increasing coherency (and defining which is which) is an issue even in non-OO languages like, oh, C or assembly. :) -- [ deb at ysabel.org ] - Ysabel - [ http://www.ysabel.org/ ] From transfire at gmail.com Wed Sep 7 09:58:35 2005 From: transfire at gmail.com (TRANS) Date: Wed, 7 Sep 2005 09:58:35 -0400 Subject: [Nitro] nitrogen and relative paths In-Reply-To: <20050907130541.GA4465@localhost> References: <20050907130541.GA4465@localhost> Message-ID: <4b6f054f05090706585b93999e@mail.gmail.com> On 9/7/05, Tim Larson wrote: > Could nitrogen be changed for the next release to resolve > relative paths against to the current working directory? > I believe this would be much more intuitive than how it > works now, resolving relative paths against some other > unstated, and probably unexpected, directory. Yes, me thinks the current operation is a bug. Any other things people like to see nitrogen do? T. From george.moschovitis at gmail.com Wed Sep 7 10:19:48 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Wed, 7 Sep 2005 17:19:48 +0300 Subject: [Nitro] nitrogen and relative paths In-Reply-To: <4b6f054f05090706585b93999e@mail.gmail.com> References: <20050907130541.GA4465@localhost> <4b6f054f05090706585b93999e@mail.gmail.com> Message-ID: > Any other things people like to see nitrogen do? I would like to introduce a code generation sub system for the next version of Nitro. something similar to what is available for rails but quite simpler. If anyone would like to help with this or send some suggestions please let me know ;-) (Trans perhaps) -g. -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From transfire at gmail.com Wed Sep 7 10:42:49 2005 From: transfire at gmail.com (TRANS) Date: Wed, 7 Sep 2005 10:42:49 -0400 Subject: [Nitro] Encapsulation (was Re: xhtml builder in model?) In-Reply-To: <08C1619A2C03EA65CBC384D7@10.19.0.236> References: <08C1619A2C03EA65CBC384D7@10.19.0.236> Message-ID: <4b6f054f05090707423312a2c0@mail.gmail.com> On 9/7/05, Ysabel wrote: > The former violates encapsulation (Writer knows that model has properties X > and Y, and if you change the general shape of Model, you'll have to change > Writer as well). The latter does not, presuming that do_this() and > do_that() are, in fact, intended as part of Writer's public interface and > thus less likely to change. > > To make it more concrete, since do_this and do_that don't tell you much, > compare: > > class Model > attr_accessor :name > attr_accessor :color > > def self.color_choices > [ "Red", "Green", "Blue" ] > end > end > > class Writer > def render_text_input(value) > ... > end > def render_choice(value) > ... > end > def render(model) > render_text_input(model.name) > render_choice(model.color, Model.color_choices) > end > end > > to this: > > class Writer > def render_text_input(value) > ... > end > def render_choice(value) > ... > end > end > > class Model > def render(writer) > writer.render_text_input(@name) > writer.render_choice(@color, ["Red", "Green", "Blue"]) > end > end > > When looking at those two cases, ask the question about which objects know > what things. Encapsulation is all about keeping knowledge on a > need-to-know basis. Yes, the code for these two isn't all that different, > but in the first case Writer knows about Model's implementation -- it knows > that Models have names and colors and that names should be rendered as text > and colors should be rendered as choices, and it has to know how to figure > out what the valid choices for a color are; in the second only Model knows > how it's implemented (and the details aren't even exposed). In the first, > Model doesn't know anything at all about Writer; in the second, Model knows > that Writer allows one to render a text input and a choice, but nothing > more. > > This is, of course, based on the assumption that Writer has a well-defined > interface and it's most likely Model that you're planning on tweaking as > you work through the problem. If Writer is not well-defined, then both of > the original examples violate encapsulation by messing with each other's > implementation details...and you really need to figure out some sort of > stable interface! Or at least a metastable one...note also that I am using > interface in a generic sense here rather than in some sort of strict-typing > capital-I-Interface sense. > > This is not unique to Ruby somehow; it's a standard problem in every > language I've ever worked in, though the idiomatic solution may change from > language to language. Reducing coupling and increasing coherency (and > defining which is which) is an issue even in non-OO languages like, oh, C > or assembly. :) Nicely stated. Thanks. I think you've mad it clear that the issue is really one of coupling, and how to minimize the headaches invloved with that. Often you are write it is the model that is more likely to change. But it depends --what if you've had the model for ages and now need a new format? What about... module IFace_Writer_Model def render_text_input( writer, model ) ... end def render_choice( writer, model ) ... end end Then you can teach both the writer and the model to call on the above --and it works either way. Of course, in the end probably the keenest thing to do is learn about dependency injection. I've gone over it myself and basically "get it" (or I should say "have gotten it") but have never put it to use, so don't have enough experience to say. T. From transfire at gmail.com Wed Sep 7 10:47:36 2005 From: transfire at gmail.com (TRANS) Date: Wed, 7 Sep 2005 10:47:36 -0400 Subject: [Nitro] xhtml builder in model? In-Reply-To: <431EE54C.3000208@neurogami.com> References: <431DC901.6000400@neurogami.com> <4b6f054f0509061114580d1121@mail.gmail.com> <431E2F44.5060803@neurogami.com> <4b6f054f05090621234bcbe6ce@mail.gmail.com> <431E6FCA.4080902@neurogami.com> <4b6f054f0509062234457d1f05@mail.gmail.com> <431EE54C.3000208@neurogami.com> Message-ID: <4b6f054f050907074710d7dc04@mail.gmail.com> On 9/7/05, James Britt wrote: > TRANS wrote: > > On 9/7/05, James Britt wrote: > > > >>> class Writer > >>> def render( model ) > >>> do_this(model.x) > >>> do_that(model.y) > >>> > >>> class Model > >>> def render( writer ) > >>> writer.do_this(self.x) > >>> writer.do_that(self.y) > >>> > >> > >>I don't know that I can offer a persuasive argument, but I prefer the > >>latter. > > > > > > I understand. I generally do too, but we program Ruby. Now if we were > > Lisp programmers, I have a feeling we' might have a different opinion. > > > > Could you you explain that? I believe my choice sticks closer to a > "Tell, don't ask", approach, which seems pretty consistent with an OO style. Oh, I just mean that lisp is functional (or essentially so at least) so the writer here is in essence the funtional element, to which the data is passed: (write model) vs and OOP language like Ruby where the object takes precedence: model.write T. From george.moschovitis at gmail.com Wed Sep 7 11:00:04 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Wed, 7 Sep 2005 18:00:04 +0300 Subject: [Nitro] Views and Templating In-Reply-To: References: Message-ID: Hello Peter, > The V part of MVC feels neglected. Actions and views seem to be the > ... > circumstance entails. Here are some problems that arise: I agree that the View part is quite important. My experience is that this is often the most time consuming part in developing a web application. > - I'd like to ask for some model object ("entity"?) to express itself > in some way, I have to do some work to track down the right view. I'd > ... > do that. This becomes a problem if the view is associated with a > different Controller. You can do that. In fact even the scaffold system injects methods like to_href or to_link into managed objects. You can add a custom to_summary method if you want. There is also support for forms: #{form_for obj} > - If I want a site-wide (across Controllers) generic page template, > ... > like to see. If i understand this correctly, you propose something like the layout system of Rails. Even though I don't think this system is flexible enough for many common cases (at least for several of my projects it is unusable) I plan to add this functionality (it is useful for the scaffolder for example). Of course I would prefer to receive a patch for this ;-) > All of this is informed by Zope's Page Templates (ZPT, TAL, and > .. > copy of Plone or something and see how it works. Having actions and > views coupled tightly precludes this kind of behavior. I have no much experience with Zope. Can you provide some better examples? thanks, George -- http://www.gmosx.com http://www.navel.gr http://www.nitrohq.com From george.moschovitis at gmail.com Wed Sep 7 11:05:15 2005 From: george.moschovitis at gmail.com (George Moschovitis) Date: Wed, 7 Sep 2005 18:05:15 +0300 Subject: [Nitro] Elements killing In-Reply-To: <125e06d10a652057e009301a6afd0ec6@oggu.de> References: <125e06d10a652057e009301a6afd0ec6@oggu.de> Message-ID: > In-Reply-To: References: <125e06d10a652057e009301a6afd0ec6@oggu.de> Message-ID: <77caa582f920a53a4f8931a5bc4bc03f@oggu.de> Am 07.09.2005 um 17:05 schrieb George Moschovitis: >> In-Reply-To: <77caa582f920a53a4f8931a5bc4bc03f@oggu.de> References: <125e06d10a652057e009301a6afd0ec6@oggu.de> <77caa582f920a53a4f8931a5bc4bc03f@oggu.de> Message-ID: Am 07.09.2005 um 19:26 schrieb Fabian Buch: > > Am 07.09.2005 um 17:05 schrieb George Moschovitis: >>>