From arne at arnebrasseur.net Mon Oct 1 08:34:57 2007 From: arne at arnebrasseur.net (Arne Brasseur) Date: Mon, 01 Oct 2007 20:34:57 +0800 Subject: [Nitro] [Patch] FormHelper RDoc improvement Message-ID: <4700E970.2000904@arnebrasseur.net> This adds top-level documentation to FormHelper and fixes an interface change that wasn't reflected yet in the comments (f.property -> f.attribute). (ab) -- Arne Brasseur http://www.arnebrasseur.net arne at arnebrasseur.net -------------- next part -------------- A non-text attachment was scrubbed... Name: bundle_ab_20071001.patch Type: text/x-patch Size: 66803 bytes Desc: not available Url : http://rubyforge.org/pipermail/nitro-general/attachments/20071001/82328a4d/attachment-0001.bin From john at oxyliquit.de Mon Oct 1 08:38:24 2007 From: john at oxyliquit.de (Jonathan Buch) Date: Mon, 01 Oct 2007 14:38:24 +0200 Subject: [Nitro] Request#params In-Reply-To: <47005B96.9090401@robmela.com> References: <47005629.60208@robmela.com> <47005B96.9090401@robmela.com> Message-ID: Hi, > OgAdminController#save attempts to access request data via the 'request' > method call: > > klass = name_to_class(*request*['object_class_name'].to_s) > obj.assign(*request*, :assign_relations => true, :force_boolean => true) yes, I believe that was always like that, as a shortcut to request.params. > A couple problems > > - Major misnomer: request returns a @context object That I don't know about. > - @request does not have a [] method for accessing incoming request > variables ( nor should it...) Any reason why? * request.params['foo'] * request['foo'] I use the second form all the time. > I've worked around it for now by calling > @context.post_params['object_class_name'] .... which led up to the > question in my prev. email, since @context.params would be nicer... I'm not sure I follow you here. The parameters come from the "Request" (requested by browser) and I'm not sure if 'context' better describes where the parameters come from. IMO they belong to the current 'request cycle' and not to a 'generic context'. But mind you, that is just generally, if Nitro returns a `Context` object when you call `request` then that's just kind of an alias.... >> 31 def params >> 32 return method == :post ? @post_params : @get_params >> 33 end I'm not sure about the contents of those, but IIRC the plan (quite a while back) was to do a little more: def params return method == :post ? @get_params.merge(@post_params) : @get_params end (Where I assume the @get_params is an hash.) But that might now be obsolete when we have both .get/post_params available. Carry on :P Jo -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/ From rob at robmela.com Mon Oct 1 08:41:13 2007 From: rob at robmela.com (Robert Mela) Date: Mon, 01 Oct 2007 08:41:13 -0400 Subject: [Nitro] Request#params In-Reply-To: <47005B96.9090401@robmela.com> References: <47005629.60208@robmela.com> <47005B96.9090401@robmela.com> Message-ID: <4700EAE9.6020300@robmela.com> Whoa.. I should proofread... "@request does not have a [] method" should read "@context does not have..." Robert Mela wrote: > A second, related question -- > > OgAdminController#save attempts to access request data via the > 'request' method call: > > klass = name_to_class(*request*['object_class_name'].to_s) > obj.assign(*request*, :assign_relations => true, :force_boolean => true) > > A couple problems > > - Major misnomer: request returns a @context object > - @request does not have a [] method for accessing incoming request > variables ( nor should it...) > > I've worked around it for now by calling > @context.post_params['object_class_name'] .... which led up to the > question in my prev. email, since @context.params would be nicer... > > > > > > Robert Mela wrote: >> Not sure what the intent is here in request.rb, module Raw, included >> in class Context >> >> 31 def params >> 32 if method == :post >> 33 @post_params.instance_variable_get("@hash") >> 34 else >> 35 @get_params.instance_variable_get("@hash") >> 36 end >> 37 end >> >> >> @post_params is itself a hash and an instance variable on Context, >> and @post_params.instance_variable_get( "@hash" ) returns nil. >> >> Anything wrong with doing this instead? >> >> 31 def params >> 32 return method == :post ? @post_params : @get_params >> 33 end >> >> If that's acceptable I'll add it to the patches I'm preparing. >> >> thx. >> _______________________________________________ >> Nitro-general mailing list >> Nitro-general at rubyforge.org >> http://rubyforge.org/mailman/listinfo/nitro-general > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general -------------- next part -------------- A non-text attachment was scrubbed... Name: rob.vcf Type: text/x-vcard Size: 116 bytes Desc: not available Url : http://rubyforge.org/pipermail/nitro-general/attachments/20071001/05976721/attachment.vcf From john at oxyliquit.de Mon Oct 1 08:41:51 2007 From: john at oxyliquit.de (Jonathan Buch) Date: Mon, 01 Oct 2007 14:41:51 +0200 Subject: [Nitro] =?utf-8?b?5pSv5oyB5aSa55So5oi35LmI?= In-Reply-To: References: <36944AFF-D373-41B6-B6B6-285392DD4F37@yoyo.org> Message-ID: Hi, I used google to translate it, but the 2 last kanji aren't translatable apparently - so I asked Manveru what it meant: [11:54] uh, ok, then, did you read the nitro ML? [11:55] there's some japanese there which I'm unable to translate :) [11:55] nitro-general is now on ruby-forum? [11:56] uh, I do not know :) [11:56] that's just spam [11:56] ok :) [12:01] I'd hate to miss out on something, ah well ^^; [12:01] :) [12:02] or it's not spam but the sender hit send way too soon [12:02] and changed encoding while writing [12:02] XD [12:02] in any way just ignore it :) Jo On Sun, 30 Sep 2007 09:52:42 +0200, George Moschovitis wrote: > huh? ;-) > > -g. > > On 9/30/07, Aidan Rogers wrote: >> ??? >> >> On Sep 29, 2007, at 8:15 PM, Afa Reg wrote: >> >> > ?????? >> > -- >> > Posted via http://www.ruby-forum.com/. >> > _______________________________________________ >> > Nitro-general mailing list >> > Nitro-general at rubyforge.org >> > http://rubyforge.org/mailman/listinfo/nitro-general >> >> _______________________________________________ >> Nitro-general mailing list >> Nitro-general at rubyforge.org >> http://rubyforge.org/mailman/listinfo/nitro-general > > -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/ From arne at arnebrasseur.net Mon Oct 1 08:42:55 2007 From: arne at arnebrasseur.net (Arne Brasseur) Date: Mon, 01 Oct 2007 20:42:55 +0800 Subject: [Nitro] Updated tutorial Message-ID: <4700EB4F.2010708@arnebrasseur.net> One new chapter to the tutorial, plus a Mercurial repo. hg clone http://repo.arnebrasseur.net/nitrotutorial/hgweb.cgi /your/local/dir That URL should also show you the latest history of changes. e-mail me if you want commit access. The basic tutorial will broadly follow the outline from the Ramaze tutorial : http://ramaze.rubyforge.org/tutorial/todolist.html Small example apps are also welcome. All content can be freely copied and adapted, e.g. to the Nitro repo, to Oxyliquit, to Nitro RDoc, blogs, wikis, etc. (ab) -- Arne Brasseur http://www.arnebrasseur.net arne at arnebrasseur.net -------------- next part -------------- A non-text attachment was scrubbed... Name: nitrotutorial.tar.gz Type: application/x-gzip Size: 52140 bytes Desc: not available Url : http://rubyforge.org/pipermail/nitro-general/attachments/20071001/4016481e/attachment-0001.gz From rob at robmela.com Mon Oct 1 09:26:16 2007 From: rob at robmela.com (Robert Mela) Date: Mon, 01 Oct 2007 09:26:16 -0400 Subject: [Nitro] Request#params In-Reply-To: References: <47005629.60208@robmela.com> <47005B96.9090401@robmela.com> Message-ID: <4700F578.4000305@robmela.com> You're right... but.... still.... I swear -- 'request[]' failed in nitro/part/admin/og/controller.rb in OgAdminController::save I'll try a very simple test case to verify -- perhaps some code included via raw/model/webfile.rb is overriding it somehow... The accessors do work as advertised in this case: #!/usr/bin/env ruby require 'nitro_and_og' include Nitro class Foo def index render_text " request() returns #{request.nil? ? 'nil' : request.class.name } Parameters " end def paramtest(*args) %{ params=#{request.params}
request[:foo] = #{request[:foo]} } end end app=Application.new app.dispatcher.root = Foo app.start Jonathan Buch wrote: > Hi, > >> OgAdminController#save attempts to access request data via the 'request' >> method call: >> >> klass = name_to_class(*request*['object_class_name'].to_s) >> obj.assign(*request*, :assign_relations => true, :force_boolean => true) > > yes, I believe that was always like that, as a shortcut to > request.params. > >> A couple problems >> >> - Major misnomer: request returns a @context object > > That I don't know about. > >> - @request does not have a [] method for accessing incoming request >> variables ( nor should it...) > > Any reason why? > > * request.params['foo'] > * request['foo'] > > I use the second form all the time. > >> I've worked around it for now by calling >> @context.post_params['object_class_name'] .... which led up to the >> question in my prev. email, since @context.params would be nicer... > > I'm not sure I follow you here. The parameters come from the "Request" > (requested by browser) and I'm not sure if 'context' better describes > where the parameters come from. IMO they belong to the current > 'request cycle' and not to a 'generic context'. But mind you, that is > just generally, if Nitro returns a `Context` object when you call > `request` then that's just kind of an alias.... > >>> 31 def params >>> 32 return method == :post ? @post_params : @get_params >>> 33 end > > I'm not sure about the contents of those, but IIRC the plan (quite a > while > back) was to do a little more: > > def params > return method == :post ? @get_params.merge(@post_params) : @get_params > end > > (Where I assume the @get_params is an hash.) > > But that might now be obsolete when we have both .get/post_params > available. > > Carry on :P > > Jo > -------------- next part -------------- A non-text attachment was scrubbed... Name: rob.vcf Type: text/x-vcard Size: 116 bytes Desc: not available Url : http://rubyforge.org/pipermail/nitro-general/attachments/20071001/e8f25efa/attachment.vcf From rob at robmela.com Mon Oct 1 09:30:42 2007 From: rob at robmela.com (Robert Mela) Date: Mon, 01 Oct 2007 09:30:42 -0400 Subject: [Nitro] =?utf-8?b?5pSv5oyB5aSa55So5oi35LmI?= In-Reply-To: References: <36944AFF-D373-41B6-B6B6-285392DD4F37@yoyo.org> Message-ID: <4700F682.3060803@robmela.com> I think it's actually Chinese -- something about supporting multiple users -- perhaps asking about multithreading? ?? -- does it support ? -- many ??? -- I'm not sure -- something about tasks or users. No compounds match in the Japanese dictionaries, but texts in Chinese do contain this. Looks like Greek to me ( as we say...) Jonathan Buch wrote: > Hi, > > I used google to translate it, but the 2 last kanji aren't translatable > apparently - so I asked Manveru what it meant: > > [11:54] uh, ok, then, did you read the nitro ML? > [11:55] there's some japanese there which I'm unable to > translate :) > [11:55] nitro-general is now on ruby-forum? > [11:56] uh, I do not know :) > [11:56] that's just spam > [11:56] ok :) > [12:01] I'd hate to miss out on something, ah well ^^; > [12:01] :) > [12:02] or it's not spam but the sender hit send way too soon > [12:02] and changed encoding while writing > [12:02] XD > [12:02] in any way just ignore it :) > > Jo > > On Sun, 30 Sep 2007 09:52:42 +0200, George Moschovitis > wrote: > > >> huh? ;-) >> >> -g. >> >> On 9/30/07, Aidan Rogers wrote: >> >>> ??? >>> >>> On Sep 29, 2007, at 8:15 PM, Afa Reg wrote: >>> >>> >>>> ?????? >>>> -- >>>> Posted via http://www.ruby-forum.com/. >>>> _______________________________________________ >>>> Nitro-general mailing list >>>> Nitro-general at rubyforge.org >>>> http://rubyforge.org/mailman/listinfo/nitro-general >>>> >>> _______________________________________________ >>> Nitro-general mailing list >>> Nitro-general at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/nitro-general >>> >> > > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: rob.vcf Type: text/x-vcard Size: 123 bytes Desc: not available Url : http://rubyforge.org/pipermail/nitro-general/attachments/20071001/c7a63e74/attachment.vcf From aidan at yoyo.org Mon Oct 1 09:42:42 2007 From: aidan at yoyo.org (Aidan Rogers) Date: Mon, 1 Oct 2007 14:42:42 +0100 (BST) Subject: [Nitro] =?iso-8859-1?q?=E6=94=AF=E6=8C=81=E5=A4=9A=E7=94=A8=E6=88?= =?iso-8859-1?q?=B7=E4=B9=88?= In-Reply-To: References: <36944AFF-D373-41B6-B6B6-285392DD4F37@yoyo.org> Message-ID: <31593.199.67.140.242.1191246162.squirrel@yoyo.org> Yeah, that's what I thought too - so I just replied "yes" to see what would happen :-) > Hi, > > I used google to translate it, but the 2 last kanji aren't translatable > apparently - so I asked Manveru what it meant: > > [11:54] uh, ok, then, did you read the nitro ML? > [11:55] there's some japanese there which I'm unable to > translate :) > [11:55] nitro-general is now on ruby-forum? > [11:56] uh, I do not know :) > [11:56] that's just spam > [11:56] ok :) > [12:01] I'd hate to miss out on something, ah well ^^; > [12:01] :) > [12:02] or it's not spam but the sender hit send way too soon > [12:02] and changed encoding while writing > [12:02] XD > [12:02] in any way just ignore it :) > > Jo > > On Sun, 30 Sep 2007 09:52:42 +0200, George Moschovitis > wrote: > >> huh? ;-) >> >> -g. >> >> On 9/30/07, Aidan Rogers wrote: >>> ????????? >>> >>> On Sep 29, 2007, at 8:15 PM, Afa Reg wrote: >>> >>> > ?????????????????? >>> > -- >>> > Posted via http://www.ruby-forum.com/. >>> > _______________________________________________ >>> > Nitro-general mailing list >>> > Nitro-general at rubyforge.org >>> > http://rubyforge.org/mailman/listinfo/nitro-general >>> >>> _______________________________________________ >>> Nitro-general mailing list >>> Nitro-general at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/nitro-general >> >> > > > > -- > Using Opera's revolutionary e-mail client: http://www.opera.com/mail/ > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general From arne at arnebrasseur.net Mon Oct 1 11:24:50 2007 From: arne at arnebrasseur.net (Arne Brasseur) Date: Mon, 01 Oct 2007 23:24:50 +0800 Subject: [Nitro] =?utf-8?b?5pSv5oyB5aSa55So5oi35LmI?= In-Reply-To: <4700F682.3060803@robmela.com> References: <36944AFF-D373-41B6-B6B6-285392DD4F37@yoyo.org> <4700F682.3060803@robmela.com> Message-ID: <47011142.3070301@arnebrasseur.net> Robert Mela schreef: > I think it's actually Chinese -- something about supporting multiple > users -- perhaps asking about multithreading? > > ?? -- does it support > > ? -- many > > ??? -- I'm not sure -- something about tasks or users. No > compounds match in the Japanese dictionaries, but texts in Chinese do > contain this. ?? - (yong4 hu4) - user ? - (me5) - probably used here to make it a question, like ? That last character is simplified so it's Chinese from the mainland (PRC). Two new vocab items for me, very nice :-) (ab) > > Looks like Greek to me ( as we say...) > > Jonathan Buch wrote: >> Hi, >> >> I used google to translate it, but the 2 last kanji aren't translatable >> apparently - so I asked Manveru what it meant: >> >> [11:54] uh, ok, then, did you read the nitro ML? >> [11:55] there's some japanese there which I'm unable to >> translate :) >> [11:55] nitro-general is now on ruby-forum? >> [11:56] uh, I do not know :) >> [11:56] that's just spam >> [11:56] ok :) >> [12:01] I'd hate to miss out on something, ah well ^^; >> [12:01] :) >> [12:02] or it's not spam but the sender hit send way too soon >> [12:02] and changed encoding while writing >> [12:02] XD >> [12:02] in any way just ignore it :) >> >> Jo >> >> On Sun, 30 Sep 2007 09:52:42 +0200, George Moschovitis >> wrote: >> >> >>> huh? ;-) >>> >>> -g. >>> >>> On 9/30/07, Aidan Rogers wrote: >>> >>>> ??? >>>> >>>> On Sep 29, 2007, at 8:15 PM, Afa Reg wrote: >>>> >>>> >>>>> ?????? >>>>> -- >>>>> Posted via http://www.ruby-forum.com/. >>>>> _______________________________________________ >>>>> Nitro-general mailing list >>>>> Nitro-general at rubyforge.org >>>>> http://rubyforge.org/mailman/listinfo/nitro-general >>>>> >>>> _______________________________________________ >>>> Nitro-general mailing list >>>> Nitro-general at rubyforge.org >>>> http://rubyforge.org/mailman/listinfo/nitro-general >>>> >>> >> >> >> >> > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general -- Arne Brasseur http://www.arnebrasseur.net arne at arnebrasseur.net From rob at robmela.com Mon Oct 1 11:41:00 2007 From: rob at robmela.com (Robert Mela) Date: Mon, 01 Oct 2007 11:41:00 -0400 Subject: [Nitro] =?utf-8?b?5pSv5oyB5aSa55So5oi35LmI?= In-Reply-To: <47011142.3070301@arnebrasseur.net> References: <36944AFF-D373-41B6-B6B6-285392DD4F37@yoyo.org> <4700F682.3060803@robmela.com> <47011142.3070301@arnebrasseur.net> Message-ID: <4701150C.8030704@robmela.com> Japanese would have *? *( ka ) as the question particle at the end of the sentence. I think that Japanese would also have the verb towards the end... Are we off topic yet? Arne Brasseur wrote: > Robert Mela schreef: >> I think it's actually Chinese -- something about supporting multiple >> users -- perhaps asking about multithreading? >> >> ?? -- does it support >> >> ? -- many >> >> ??? -- I'm not sure -- something about tasks or users. No >> compounds match in the Japanese dictionaries, but texts in Chinese do >> contain this. > ?? - (yong4 hu4) - user > ? - (me5) - probably used here to make it a question, like ? > > That last character is simplified so it's Chinese from the mainland > (PRC). > > Two new vocab items for me, very nice :-) > > (ab) -------------- next part -------------- A non-text attachment was scrubbed... Name: rob.vcf Type: text/x-vcard Size: 123 bytes Desc: not available Url : http://rubyforge.org/pipermail/nitro-general/attachments/20071001/e647f418/attachment.vcf From rob at robmela.com Mon Oct 1 12:03:11 2007 From: rob at robmela.com (Robert Mela) Date: Mon, 01 Oct 2007 12:03:11 -0400 Subject: [Nitro] Resending: Re: Request#params In-Reply-To: <4700F578.4000305@robmela.com> References: <47005629.60208@robmela.com> <47005B96.9090401@robmela.com> <4700F578.4000305@robmela.com> Message-ID: <47011A3F.2050600@robmela.com> Resending With a fresh darcs get ( 30 minutes ago ) and this test program: #!/usr/bin/env ruby require 'ubygems' require 'sqlite3' require 'nitro_and_og' include Nitro require 'nitro/part/admin' # Og model class Book attr_accessor :title, String attr_accessor :author, String end # Controller class Foo def index render_text "Foo" end end Og.create_schema = true Og.use_uuid_primary_keys = true Og.start( :name => "library", :adapter => :sqlite, :evolve_schema => :full ) app=Application.new app.dispatcher.root = Foo app.start Saving a 'Book' produces this exception: ERROR: Error while handling OgAdminController#save() ERROR: undefined method `[]' for nil:NilClass /Users/rmela/nitro2/repo.nitroproject.org/script/lib/../../raw/lib/raw/context/request.rb:304:in `[]' /Users/rmela/nitro2/repo.nitroproject.org/script/lib/../../nitro/lib/nitro/part/admin/og/controller.rb:93:in `save' Line 93 throws the exception: 92 def save 93 klass = name_to_class(request['object_class_name'].to_s) 94 95 if oid = request['oid'] 96 obj = klass[oid.to_s] 97 obj.assign(request, :assign_relations => true, :force_boolean => true) 98 else 99 obj = klass.new 100 obj.assign(request, :assign_relations => true) 101 end I modified that slightly to produce some output: 92 def save 93 if request.nil? 94 puts "OGADMIN request returns 'nil'" 95 else 96 puts "OGADMIN request() returns a #{request.class.name}" 97 puts "OGADMIN request.params returns #{request.params || 'nil'}" 98 puts "OGADMIN request['oid'] returns #{request['oid']}" 99 end which produced this exception: ERROR: undefined method `[]' for nil:NilClass /Users/rmela/nitro/repo.nitroproject.org/script/lib/../../raw/lib/raw/context/request.rb:304:in `[]' /Users/rmela/nitro/repo.nitroproject.org/script/lib/../../nitro/lib/nitro/part/admin/og/controller.rb:98:in `save' And this output: OGADMIN request() returns a Raw::Context OGADMIN request.params returns nil Robert Mela wrote: > You're right... but.... still.... I swear -- 'request[]' failed in > nitro/part/admin/og/controller.rb in OgAdminController::save > > I'll try a very simple test case to verify -- perhaps some code > included via raw/model/webfile.rb is overriding it somehow... > > The accessors do work as advertised in this case: > > #!/usr/bin/env ruby > require 'nitro_and_og' > include Nitro > > > class Foo > def index > render_text " > request() returns #{request.nil? ? 'nil' : request.class.name } > Parameters > " > end > def paramtest(*args) > %{ > params=#{request.params}
> request[:foo] = #{request[:foo]} > } > end > end > > app=Application.new > app.dispatcher.root = Foo > app.start > > > Jonathan Buch wrote: >> Hi, >> >>> OgAdminController#save attempts to access request data via the >>> 'request' >>> method call: >>> >>> klass = name_to_class(*request*['object_class_name'].to_s) >>> obj.assign(*request*, :assign_relations => true, :force_boolean => >>> true) >> >> yes, I believe that was always like that, as a shortcut to >> request.params. >> >>> A couple problems >>> >>> - Major misnomer: request returns a @context object >> >> That I don't know about. >> >>> - @request does not have a [] method for accessing incoming request >>> variables ( nor should it...) >> >> Any reason why? >> >> * request.params['foo'] >> * request['foo'] >> >> I use the second form all the time. >> >>> I've worked around it for now by calling >>> @context.post_params['object_class_name'] .... which led up to the >>> question in my prev. email, since @context.params would be nicer... >> >> I'm not sure I follow you here. The parameters come from the "Request" >> (requested by browser) and I'm not sure if 'context' better describes >> where the parameters come from. IMO they belong to the current >> 'request cycle' and not to a 'generic context'. But mind you, that is >> just generally, if Nitro returns a `Context` object when you call >> `request` then that's just kind of an alias.... >> >>>> 31 def params >>>> 32 return method == :post ? @post_params : @get_params >>>> 33 end >> >> I'm not sure about the contents of those, but IIRC the plan (quite a >> while >> back) was to do a little more: >> >> def params >> return method == :post ? @get_params.merge(@post_params) : @get_params >> end >> >> (Where I assume the @get_params is an hash.) >> >> But that might now be obsolete when we have both .get/post_params >> available. >> >> Carry on :P >> >> Jo >> > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general -------------- next part -------------- A non-text attachment was scrubbed... Name: rob.vcf Type: text/x-vcard Size: 116 bytes Desc: not available Url : http://rubyforge.org/pipermail/nitro-general/attachments/20071001/33ba411e/attachment.vcf From george.moschovitis at gmail.com Mon Oct 1 13:37:56 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Mon, 1 Oct 2007 20:37:56 +0300 Subject: [Nitro] Updated tutorial In-Reply-To: <4700EB4F.2010708@arnebrasseur.net> References: <4700EB4F.2010708@arnebrasseur.net> Message-ID: Many, many thanks Arne. Once again I am running short on time today and tomorrow, but I 'll be back on Wednesday. keep up the great work. -g. On 10/1/07, Arne Brasseur wrote: > One new chapter to the tutorial, plus a Mercurial repo. > > hg clone http://repo.arnebrasseur.net/nitrotutorial/hgweb.cgi > /your/local/dir > > That URL should also show you the latest history of changes. > > e-mail me if you want commit access. The basic tutorial will broadly > follow the outline from the Ramaze tutorial : > http://ramaze.rubyforge.org/tutorial/todolist.html > Small example apps are also welcome. > > All content can be freely copied and adapted, e.g. to the Nitro repo, to > Oxyliquit, to Nitro RDoc, blogs, wikis, etc. > > (ab) > > -- > Arne Brasseur > http://www.arnebrasseur.net > arne at arnebrasseur.net > > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > > -- http://gmosx.me.gr http://phidz.com http://blog.gmosx.com http://cull.gr http://www.joy.gr http://nitroproject.org From rob at robmela.com Mon Oct 1 17:06:24 2007 From: rob at robmela.com (Robert Mela) Date: Mon, 01 Oct 2007 17:06:24 -0400 Subject: [Nitro] web file directory fixes Message-ID: <47016150.60200@robmela.com> Is it still correct to spam the group with patches, or should I be sending them directly to George? Anyhow, here are some fixes to get WebFile working with forms & Og Two little things: replace Nitro::Server.public_root with $nitro_current_application.public_dir replace WebFile.upload_root with WebFile.upload_dir, since WebFile defines upload_dir but not upload_root -------------- next part -------------- A non-text attachment was scrubbed... Name: webfile_upload_dir_fix.tar.gz Type: application/x-gzip Size: 18218 bytes Desc: not available Url : http://rubyforge.org/pipermail/nitro-general/attachments/20071001/f4a6dcf8/attachment.gz -------------- next part -------------- A non-text attachment was scrubbed... Name: rob.vcf Type: text/x-vcard Size: 116 bytes Desc: not available Url : http://rubyforge.org/pipermail/nitro-general/attachments/20071001/f4a6dcf8/attachment.vcf From rob at robmela.com Mon Oct 1 17:18:23 2007 From: rob at robmela.com (Robert Mela) Date: Mon, 01 Oct 2007 17:18:23 -0400 Subject: [Nitro] OgAdminController request params fix(?) Message-ID: <4701641F.8070007@robmela.com> I suppose the right thing to do is to figure out why request['oid'] doesn't work inside OgAdminController. In the short term here's a workaround -- not sure whether this half-step should go into the repository or whether we should do the real fix. -------------- next part -------------- A non-text attachment was scrubbed... Name: ogadmin_request_params_fix.tar.gz Type: application/x-gzip Size: 18226 bytes Desc: not available Url : http://rubyforge.org/pipermail/nitro-general/attachments/20071001/f6a310e4/attachment-0001.gz -------------- next part -------------- A non-text attachment was scrubbed... Name: rob.vcf Type: text/x-vcard Size: 116 bytes Desc: not available Url : http://rubyforge.org/pipermail/nitro-general/attachments/20071001/f6a310e4/attachment-0001.vcf From rob at robmela.com Mon Oct 1 21:25:42 2007 From: rob at robmela.com (Robert Mela) Date: Mon, 01 Oct 2007 21:25:42 -0400 Subject: [Nitro] Updated tutorial In-Reply-To: References: <4700EB4F.2010708@arnebrasseur.net> Message-ID: <47019E16.3020401@robmela.com> I suppose I should merge the newly expanded http://robmela.com/cheatsheets into this... or copy stuff from this into cheatsheets... working through og relations today... George Moschovitis wrote: > Many, many thanks Arne. > > Once again I am running short on time today and tomorrow, but I 'll be > back on Wednesday. > > keep up the great work. > > -g. > > On 10/1/07, Arne Brasseur wrote: > >> One new chapter to the tutorial, plus a Mercurial repo. >> >> hg clone http://repo.arnebrasseur.net/nitrotutorial/hgweb.cgi >> /your/local/dir >> >> That URL should also show you the latest history of changes. >> >> e-mail me if you want commit access. The basic tutorial will broadly >> follow the outline from the Ramaze tutorial : >> http://ramaze.rubyforge.org/tutorial/todolist.html >> Small example apps are also welcome. >> >> All content can be freely copied and adapted, e.g. to the Nitro repo, to >> Oxyliquit, to Nitro RDoc, blogs, wikis, etc. >> >> (ab) >> >> -- >> Arne Brasseur >> http://www.arnebrasseur.net >> arne at arnebrasseur.net >> >> >> _______________________________________________ >> Nitro-general mailing list >> Nitro-general at rubyforge.org >> http://rubyforge.org/mailman/listinfo/nitro-general >> >> >> > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: rob.vcf Type: text/x-vcard Size: 116 bytes Desc: not available Url : http://rubyforge.org/pipermail/nitro-general/attachments/20071001/918bd19c/attachment.vcf From rob at robmela.com Mon Oct 1 21:46:52 2007 From: rob at robmela.com (Robert Mela) Date: Mon, 01 Oct 2007 21:46:52 -0400 Subject: [Nitro] Ignore the last webfile patch... In-Reply-To: <47016150.60200@robmela.com> References: <47016150.60200@robmela.com> Message-ID: <4701A30C.8090709@robmela.com> Looking through the test specs I saw Nitro::Application.current. Seems better than using $nitro_current_application Robert Mela wrote: > Is it still correct to spam the group with patches, or should I be > sending them directly to George? > > Anyhow, here are some fixes to get WebFile working with forms & Og > > Two little things: > > replace Nitro::Server.public_root with > $nitro_current_application.public_dir > replace WebFile.upload_root with WebFile.upload_dir, since WebFile > defines upload_dir but not upload_root > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: webfile_upload_dir_fix Url: http://rubyforge.org/pipermail/nitro-general/attachments/20071001/6bbcccab/attachment-0001.pl -------------- next part -------------- A non-text attachment was scrubbed... Name: rob.vcf Type: text/x-vcard Size: 116 bytes Desc: not available Url : http://rubyforge.org/pipermail/nitro-general/attachments/20071001/6bbcccab/attachment-0001.vcf From george.moschovitis at gmail.com Tue Oct 2 06:11:24 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Tue, 2 Oct 2007 13:11:24 +0300 Subject: [Nitro] Facets 1.8.54 problem? Message-ID: Tom, sudo gem install facets does not work for me at the moment. I have to manually download the gem and install it from local disk. Can you please have a look at this? thanks, -g. -- http://gmosx.me.gr http://phidz.com http://blog.gmosx.com http://cull.gr http://www.joy.gr http://nitroproject.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/nitro-general/attachments/20071002/71ea3ebd/attachment.html From transfire at gmail.com Tue Oct 2 08:13:08 2007 From: transfire at gmail.com (Trans) Date: Tue, 02 Oct 2007 12:13:08 -0000 Subject: [Nitro] Facets 1.8.54 problem? In-Reply-To: References: Message-ID: <1191327188.260383.296270@k79g2000hse.googlegroups.com> On Oct 2, 6:11 am, "George Moschovitis" wrote: > Tom, > > sudo gem install facets does not work for me at the moment. > > I have to manually download the gem and install it from local disk. > > Can you please have a look at this? C:\Documents and Settings\trans>gem install facets Bulk updating Gem source index for: http://gems.rubyforge.org Successfully installed facets-1.8.54 Installing ri documentation for facets-1.8.54... Installing RDoc documentation for facets-1.8.54... C:\Documents and Settings\trans> No problems here. Try it again and let me know exactly what's going wrong. BTW, I'm going to release 2.0.0 today. T. From arne at arnebrasseur.net Wed Oct 3 02:46:54 2007 From: arne at arnebrasseur.net (Arne Brasseur) Date: Wed, 03 Oct 2007 14:46:54 +0800 Subject: [Nitro] Where to define Og relations Message-ID: <47033ADE.40807@arnebrasseur.net> I just found out the hard way that defining a 'belongs_to' relation at the beginning of the model class does not work. Once any managed attributes are defined it does works. require "og" class Word belongs_to WordList attr_accessor :definitions, Array end gives: ./app/model/word.rb:3: undefined method `belongs_to' for Word:Class (NoMethodError) This: class Word attr_accessor :definitions, Array belongs_to WordList end works fine. Alternatively: class Word include Og::RelationDSL belongs_to WordList attr_accessor :definitions, Array end also works fine. It's not clear to me if this is intended or not, has_many seems to work fine once "og" is required. I haven't checked the other types of relations. G, is this known/intended? If so it should be documented. Robert, you could perhaps add this to your cheatsheets? Very nice work BTW! I'm using them all the time now. http://robmela.com/cheatsheets (ab) -- Arne Brasseur http://www.arnebrasseur.net arne at arnebrasseur.net From transfire at gmail.com Wed Oct 3 03:27:34 2007 From: transfire at gmail.com (Trans) Date: Wed, 03 Oct 2007 07:27:34 -0000 Subject: [Nitro] ANN: Facets 2.0.0 Message-ID: <1191396454.436532.269200@d55g2000hsg.googlegroups.com> Today I have officially released Facets 2.0.0. gem install facets Facets 2.0.0 represent the project's official push into "production ready" status --a major departure from the 1.x series which was focused on acquiring functionality. For more information about this release see the README below. As with any zero-point release, I expect some minor releases to quickly follow. Please, let me know if you encounter any problems so I can get them fixed right away. Special thanks to everyone that helped me get this release together! T. --- = Ruby Facets http://facets.rubyforge.com "ALL YOUR BASE ARE BELONG TO RUBY" == Introduction Ruby Facets is the single largest collection of general purpose method extensions and system additions for the Ruby programming language. The core extensions is a large collection of methods which extend the core capabilities of Ruby's built-in classes and modules. This collection of extension methods are unique by virtue of their atomicity. The methods are stored in relatively small groups of tightly coupled methods so that each can be required independently. This gives developers the potential for much finer control over which extra methods to bring into their code. The "more" additions are a collection of classes, modules and light meta-systems which constitutes an ever improving source of reusable components. Some very nice additions are provided, from the simple Functor class to a full-blown annotations system. == Installation You can install either via RubyGems or manually: % gem install facets or % tar -xzf facets-2.x.x.tar.gz % cd facets-2.x.x % sudo task/install IMPORTANT! Note that setup.rb is no longer used due to Facets new special layout. == Compatibility with 1.x series. Prior to 2.0, Facets was divided between CORE and MORE --standalone extensions vs. classes and modules, respectively. With 2.0, the idea of CORE has take only a slightly new meaning. Instead CORE now represents the libraries that are considered essential and as such are loaded automatically when using ++require "facets"++. While still primarily made up of extension methods a few classes now belong to core as well. In conjunction with this the extension methods are no longer stored on a per-method basis, but rather in tight knit packs. While dividing the extension methods up on a per-method basis had certain advantages, not the least of which was a simple organization, it proved too granular --rather than "atomic" it was "subatomic". With 2.0 we have address this issue. All the extension methods have now been organized into small tightly related groups. However, being able to require on the basis of a method is still a useful approach, so a compatibility layer for the 1.x series has been created. It makes it possible to load Facets libraries on a per method basis, just as before, via require redirection. For example: require 'facets/core/string/underscore' Will redirect according to the content of the underscore.rb file: require 'facets/string/stylize' So the underscore method will be loaded just as before. But a few other *stylization* methods will be loaded as well. This actually proves a more useful approach b/c often one will want to use one of the related methods as well. == Mission Facets holds to the notion that the more we can reasonably integrate into a common foundation directed toward general needs, the better that foundation will be able to serve everyone. There are a number of advantages here: * Better Code-reuse * Collaborative Improvements * Greater Name Consistency * One-stop Shop and Installation == Status The current status is quite good. While some parts are still considered beta, everything is relatively usable. == Installation The easiest way to install is via RubyGems. On the command line enter: > gem install facets To manually install, unpack the .tar.bz2 package and use the included setup.rb script. For example: > tar -xvzf facets-x.x.x.tar.gz > cd facets-x.x.x > sudo util/setup On Window the last step will be: > ruby util/setup == Usage For detailed usage of any given method or module please refer to the API RDocs. Most are well documented. Assistance in improving documentation though is always appreciated. If you plan to use more then a few of Facets core method it is recommended that you require require the main facility. require 'facets' This loads all the CORE functionality at once. Of course you can use the CORE library piecemeal if you prefer. The general require statement for a core extensions library is: require 'facets//' For example: require 'facets/time/stamp' Most "atoms" contain only a few methods, sometimes only one, but a few exceptions provide quite a few method, such as ++string/indexable.rb+ +. You can load per-class or per-module groups of core methods by requiring the class or module by name. For example" require 'facets/time' Will require all the Time method extensions. Note that some methods that were part of CORE in 1.8 and earlier are now part of MORE libraries. A good example is 'random.rb'. There were separated b/c they had more specialized usecases, where as CORE extensions are intended as general purpose. Using a Facets/MORE library of modules, classes or microframeworks is essentially the same. For example: require 'facets/basicobject' # PLEASE IGNORE THIS FOR NOW It is possible to eliminate the need for the 'facets/' prefix on requires if the Facets libpaths are added to the LOAD_PATH. But this isn't as straight-forward as it is for most libraries b/c of the layout of Facets library. require 'facets-topload' require 'basicobject' Understand that on the off chance that another library has the same name as one of Facets' everything will still work fine. You will just not be able to use the prefixless shortcut to require it. # END IGNORE. Again, for details pertaining to the functionality of each feature, please see the API Docs. == Method File Names Operator method redirect files are stored using English names. For instance for Proc#* is 'proc/op_mul'. For reference, here is the chart. +@ => op_plus_self -@ => op_minus_self + => op_plus - => op_minus ** => op_pow * => op_mul / => op_div % => op_mod ~ => op_tilde <=> => op_cmp << => op_lshift >> => op_rshift < => op_lt > => op_gt === => op_case_eq == => op_equal =~ => op_apply <= => op_lt_eq >= => op_gt_eq | => op_or & => op_and ^ => op_xor []= => op_store [] => op_fetch Facets simply takes the '*' and translates it into a string acceptable to all file systems. Also, if a method ends in '=', '?' or '!' it is simply removed. == Contribute This project thrives on contribution. If you have any extension methods, classes, modules or small frameworks that you think have general applicability and would like to see them included in this project, don't hesitiate to submit. There's a very good chance it will be included. Also, if you have better versions of any thing already included or simply have a patch, they too are more than welcome. We want Ruby Facets to be of the highest quality. == Authors This collection was put together by, and largely written by Thomas Sawyer (aka Trans). He can be reached via email at transfire at gmail.com. Some parts of this collection were written and/or inspired by other persons. Fortunately nearly all were copyrighted under the same open license, the Ruby License. In the few exceptions I have included the copyright notice with the source code. Any code file not specifically labeled shall fall under the Ruby License. In all cases, I have made every effort to give credit where credit is due. You will find these copyrights, thanks and acknowledgments embedded in the source code, and an unobtrusive "Author(s)" section is given in the RDocs. Also see the AUTHORS file for a list of all contributing Rubyists. If anyone is missing from the list, please let me know and I will correct right away. Thanks. == License The collection PER COLLECTION is licensed as follows: Ruby Facets Copyright (c) 2004-2006 Thomas Sawyer Distributed under the terms of the Ruby license. The Ruby license is a dual license that also provides for use of the GPL. Complete texts of both licenses accompany this document (see doc/ COPYING). This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc. 59 Temple Place, Suite 330 Boston, MA 02111-1307 USA Acknowledgments and Copyrights for particular snippets of borrowed code are given in their respective source. All licenses are either compatible with the Ruby license (namely the GPL) or the original author has given permission for inclusion of their code under such license. From arne at arnebrasseur.net Wed Oct 3 03:48:25 2007 From: arne at arnebrasseur.net (Arne Brasseur) Date: Wed, 03 Oct 2007 15:48:25 +0800 Subject: [Nitro] RFC: Let the HTML format report 'charset=utf-8' when $KCODE='UTF8' Message-ID: <47034949.8060405@arnebrasseur.net> This just occurred to me as being a very natural way of doing things. With this patch when you set $KCODE to 'UTF8' (or 'u'), then Nitro's HTML headers contain not just Content-Type: text/html But Content-Type: text/html; charset=utf-8 Wed Oct 3 15:34:45 CST 2007 Arne Brasseur * Let the HTML format report 'charset=utf-8' when $KCODE='UTF8'. When I set $KCODE='UTF8', I expect all subsystems to use utf-8. It's POLS, it's "just standard Ruby", it's how it IMHO should be. My documentation patch from Monday is also included. (ab) -- Arne Brasseur http://www.arnebrasseur.net arne at arnebrasseur.net -------------- next part -------------- A non-text attachment was scrubbed... Name: bundle_ab_20071003.patch Type: text/x-patch Size: 66213 bytes Desc: not available Url : http://rubyforge.org/pipermail/nitro-general/attachments/20071003/a76bdd5d/attachment-0002.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: bundle_ab_20071001.patch Type: text/x-patch Size: 66803 bytes Desc: not available Url : http://rubyforge.org/pipermail/nitro-general/attachments/20071003/a76bdd5d/attachment-0003.bin From george.moschovitis at gmail.com Wed Oct 3 03:59:26 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Wed, 3 Oct 2007 10:59:26 +0300 Subject: [Nitro] ANN: Facets 2.0.0 In-Reply-To: <1191396454.436532.269200@d55g2000hsg.googlegroups.com> References: <1191396454.436532.269200@d55g2000hsg.googlegroups.com> Message-ID: Congratulations for your monumental effort! Can't wait to try it! -g. PS: after a couple of extra-full days I am back ;-) On 10/3/07, Trans wrote: > > Today I have officially released Facets 2.0.0. > > gem install facets > > Facets 2.0.0 represent the project's official push into "production > ready" status --a major departure from the 1.x series which was > focused on acquiring functionality. For more information about this > release see the README below. > > As with any zero-point release, I expect some minor releases to > quickly follow. Please, let me know if you encounter any problems so I > can get them fixed right away. > > Special thanks to everyone that helped me get this release together! > > T. > > --- > > = Ruby Facets > > http://facets.rubyforge.com > > "ALL YOUR BASE ARE BELONG TO RUBY" > > > == Introduction > > Ruby Facets is the single largest collection of general purpose method > extensions and system additions for the Ruby programming language. > > The core extensions is a large collection of methods which extend the > core capabilities of Ruby's built-in classes and modules. This > collection of extension methods are unique by virtue of their > atomicity. The methods are stored in relatively small groups of > tightly coupled methods so that each can be required independently. > This gives developers the potential for much finer control over which > extra methods to bring into their code. > > The "more" additions are a collection of classes, modules and light > meta-systems which constitutes an ever improving source of reusable > components. Some very nice additions are provided, from the simple > Functor class to a full-blown annotations system. > > > == Installation > > You can install either via RubyGems or manually: > > % gem install facets > > or > > % tar -xzf facets-2.x.x.tar.gz > % cd facets-2.x.x > % sudo task/install > > IMPORTANT! Note that setup.rb is no longer used due to Facets new > special layout. > > > == Compatibility with 1.x series. > > Prior to 2.0, Facets was divided between CORE and MORE --standalone > extensions vs. classes and modules, respectively. With 2.0, the idea > of CORE has take only a slightly new meaning. Instead CORE now > represents the libraries that are considered essential and as such are > loaded automatically when using ++require "facets"++. While still > primarily made up of extension methods a few classes now belong to > core as well. In conjunction with this the extension methods are no > longer stored on a per-method basis, but rather in tight knit packs. > While dividing the extension methods up on a per-method basis had > certain advantages, not the least of which was a simple organization, > it proved too granular --rather than "atomic" it was "subatomic". With > 2.0 we have address this issue. All the extension methods have now > been organized into small tightly related groups. > > However, being able to require on the basis of a method is still a > useful approach, so a compatibility layer for the 1.x series has been > created. It makes it possible to load Facets libraries on a per method > basis, just as before, via require redirection. > > For example: > > require 'facets/core/string/underscore' > > Will redirect according to the content of the underscore.rb file: > > require 'facets/string/stylize' > > So the underscore method will be loaded just as before. But a few > other *stylization* methods will be loaded as well. This actually > proves a more useful approach b/c often one will want to use one of > the related methods as well. > > > == Mission > > Facets holds to the notion that the more we can reasonably integrate > into a common foundation directed toward general needs, the better > that foundation will be able to serve everyone. There are a number of > advantages here: > > * Better Code-reuse > * Collaborative Improvements > * Greater Name Consistency > * One-stop Shop and Installation > > > == Status > > The current status is quite good. While some parts are still > considered beta, everything is relatively usable. > > > == Installation > > The easiest way to install is via RubyGems. On the command line enter: > > > gem install facets > > To manually install, unpack the .tar.bz2 package and use the included > setup.rb script. For example: > > > tar -xvzf facets-x.x.x.tar.gz > > cd facets-x.x.x > > sudo util/setup > > On Window the last step will be: > > > ruby util/setup > > > == Usage > > For detailed usage of any given method or module please refer to the > API RDocs. Most are well documented. Assistance in improving > documentation though is always appreciated. > > If you plan to use more then a few of Facets core method it is > recommended that you require require the main facility. > > require 'facets' > > This loads all the CORE functionality at once. > > Of course you can use the CORE library piecemeal if you prefer. The > general require statement for a core extensions library is: > > require 'facets//' > > For example: > > require 'facets/time/stamp' > > Most "atoms" contain only a few methods, sometimes only one, but a few > exceptions provide quite a few method, such as ++string/indexable.rb+ > +. > > You can load per-class or per-module groups of core methods by > requiring the class or module by name. For example" > > require 'facets/time' > > Will require all the Time method extensions. > > Note that some methods that were part of CORE in 1.8 and earlier are > now part of MORE libraries. A good example is 'random.rb'. There were > separated b/c they had more specialized usecases, where as CORE > extensions are intended as general purpose. > > Using a Facets/MORE library of modules, classes or microframeworks is > essentially the same. For example: > > require 'facets/basicobject' > > # PLEASE IGNORE THIS FOR NOW > > It is possible to eliminate the need for the 'facets/' prefix on > requires if the Facets libpaths are added to the LOAD_PATH. But this > isn't as straight-forward as it is for most libraries b/c of the > layout of Facets library. > > require 'facets-topload' > require 'basicobject' > > Understand that on the off chance that another library has the same > name as one of Facets' everything will still work fine. You will just > not be able to use the prefixless shortcut to require it. > > # END IGNORE. > > Again, for details pertaining to the functionality of each feature, > please see the API Docs. > > > == Method File Names > > Operator method redirect files are stored using English names. For > instance for Proc#* is 'proc/op_mul'. > > For reference, here is the chart. > > +@ => op_plus_self > -@ => op_minus_self > + => op_plus > - => op_minus > ** => op_pow > * => op_mul > / => op_div > % => op_mod > ~ => op_tilde > <=> => op_cmp > << => op_lshift > >> => op_rshift > < => op_lt > > => op_gt > === => op_case_eq > == => op_equal > =~ => op_apply > <= => op_lt_eq > >= => op_gt_eq > | => op_or > & => op_and > ^ => op_xor > []= => op_store > [] => op_fetch > > Facets simply takes the '*' and translates it into a string acceptable > to all file systems. Also, if a method ends in '=', '?' or '!' it is > simply removed. > > > == Contribute > > This project thrives on contribution. > > If you have any extension methods, classes, modules or small > frameworks that you think have general applicability and would like to > see them included in this project, don't hesitiate to submit. There's > a very good chance it will be included. Also, if you have better > versions of any thing already included or simply have a patch, they > too are more than welcome. We want Ruby Facets to be of the highest > quality. > > > == Authors > > This collection was put together by, and largely written by Thomas > Sawyer (aka Trans). He can be reached via email at transfire at > gmail.com. > > Some parts of this collection were written and/or inspired by other > persons. Fortunately nearly all were copyrighted under the same open > license, the Ruby License. In the few exceptions I have included the > copyright notice with the source code. > > Any code file not specifically labeled shall fall under the Ruby > License. > > In all cases, I have made every effort to give credit where credit is > due. You will find these copyrights, thanks and acknowledgments > embedded in the source code, and an unobtrusive "Author(s)" section is > given in the RDocs. > > Also see the AUTHORS file for a list of all contributing Rubyists. > > If anyone is missing from the list, please let me know and I will > correct right away. Thanks. > > > == License > > The collection PER COLLECTION is licensed as follows: > > Ruby Facets > Copyright (c) 2004-2006 Thomas Sawyer > > Distributed under the terms of the Ruby license. > > The Ruby license is a dual license that also provides for use of the > GPL. Complete texts of both licenses accompany this document (see doc/ > COPYING). > > This program is free software; you can redistribute it and/or > modify it under the terms of the GNU General Public License as > published by the Free Software Foundation; either version 2 of > the License, or (at your option) any later version. > > This program is distributed in the hope that it will be useful, > but WITHOUT ANY WARRANTY; without even the implied warranty of > MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > GNU General Public License for more details. > > You should have received a copy of the GNU General Public License > along with this program; if not, write to the > Free Software Foundation, Inc. > 59 Temple Place, Suite 330 > Boston, MA 02111-1307 USA > > Acknowledgments and Copyrights for particular snippets of borrowed > code are given in their respective source. All licenses are either > compatible with the Ruby license (namely the GPL) or the original > author has given permission for inclusion of their code under such > license. > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://gmosx.me.gr http://phidz.com http://blog.gmosx.com http://cull.gr http://www.joy.gr http://nitroproject.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/nitro-general/attachments/20071003/754f419a/attachment.html From george.moschovitis at gmail.com Wed Oct 3 04:05:50 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Wed, 3 Oct 2007 11:05:50 +0300 Subject: [Nitro] [Patch] FormHelper RDoc improvement In-Reply-To: <4700E970.2000904@arnebrasseur.net> References: <4700E970.2000904@arnebrasseur.net> Message-ID: thanks. On 10/1/07, Arne Brasseur wrote: > > This adds top-level documentation to FormHelper and fixes an interface > change that wasn't reflected yet in the comments (f.property -> > f.attribute). > > (ab) > > -- > Arne Brasseur > http://www.arnebrasseur.net > arne at arnebrasseur.net > > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > > -- http://gmosx.me.gr http://phidz.com http://blog.gmosx.com http://cull.gr http://www.joy.gr http://nitroproject.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/nitro-general/attachments/20071003/a0835e79/attachment.html From george.moschovitis at gmail.com Wed Oct 3 04:07:40 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Wed, 3 Oct 2007 11:07:40 +0300 Subject: [Nitro] Request#params In-Reply-To: <47005629.60208@robmela.com> References: <47005629.60208@robmela.com> Message-ID: @post_params/@get_params are Dictionary objects. And I needed a version of them as Hash. Dictionary is not that compatible with Hash as someone would like. -g. On 10/1/07, Robert Mela wrote: > > Not sure what the intent is here in request.rb, module Raw, included in > class Context > > 31 def params > 32 if method == :post > 33 @post_params.instance_variable_get("@hash") > 34 else > 35 @get_params.instance_variable_get("@hash") > 36 end > 37 end > > > @post_params is itself a hash and an instance variable on Context, and > @post_params.instance_variable_get( "@hash" ) returns nil. > > Anything wrong with doing this instead? > > 31 def params > 32 return method == :post ? @post_params : @get_params > 33 end > > If that's acceptable I'll add it to the patches I'm preparing. > > thx. > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > > -- http://gmosx.me.gr http://phidz.com http://blog.gmosx.com http://cull.gr http://www.joy.gr http://nitroproject.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/nitro-general/attachments/20071003/85c4dc8b/attachment-0001.html From george.moschovitis at gmail.com Wed Oct 3 04:09:21 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Wed, 3 Oct 2007 11:09:21 +0300 Subject: [Nitro] Request#params In-Reply-To: References: <47005629.60208@robmela.com> <47005B96.9090401@robmela.com> Message-ID: > > * request.params['foo'] > * request['foo'] > > I use the second form all the time. > I use request["foo"] too... btw you can also use: request[:foo] one more hidden 0.50.0 new feature? -g. -- http://gmosx.me.gr http://phidz.com http://blog.gmosx.com http://cull.gr http://www.joy.gr http://nitroproject.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/nitro-general/attachments/20071003/66e60730/attachment.html From george.moschovitis at gmail.com Wed Oct 3 04:19:58 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Wed, 3 Oct 2007 11:19:58 +0300 Subject: [Nitro] web file directory fixes In-Reply-To: <47016150.60200@robmela.com> References: <47016150.60200@robmela.com> Message-ID: > > Is it still correct to spam the group with patches, or should I be > sending them directly to George? please 'spam' the group ;-) thanks for the patch. -g. -- http://gmosx.me.gr http://phidz.com http://blog.gmosx.com http://cull.gr http://www.joy.gr http://nitroproject.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/nitro-general/attachments/20071003/401d38b0/attachment.html From george.moschovitis at gmail.com Wed Oct 3 04:24:40 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Wed, 3 Oct 2007 11:24:40 +0300 Subject: [Nitro] Where to define Og relations In-Reply-To: <47033ADE.40807@arnebrasseur.net> References: <47033ADE.40807@arnebrasseur.net> Message-ID: > > It's not clear to me if this is intended or not, has_many seems to work > fine once "og" is required. I haven't checked the other types of > relations. This is known/intended. Are you sure that has_many works without defining a serializable attribute first? This is what I use: class Word is Og::Model belongs_to :user end the shortcut is that calling attr_accessor :filed, Type automatically includes Og::Model. I hope this helps -g. -- http://gmosx.me.gr http://phidz.com http://blog.gmosx.com http://cull.gr http://www.joy.gr http://nitroproject.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/nitro-general/attachments/20071003/d3863993/attachment.html From amusic at freemail.gr Wed Oct 3 06:00:40 2007 From: amusic at freemail.gr (amusic at freemail.gr) Date: Wed, 3 Oct 2007 13:00:40 +0300 Subject: [Nitro] Installing Nitro on Windows in 11 steps Message-ID: <4703684860cde7.15282900@freemail.gr> Hello everyone, I'm new to the list and I've been told that some people have been having some trouble installing Nitro on a Windows system. So for those having trouble here's a 11 step checklist. (I assume that you've already installed Ruby and MySQL on your system) 1) Download Darcs from www.darcs.net and decompress it in any directory 2*) Add the darcs root folder in the PATH environmental variable (i.e. C:\Darcs;) 3) Download the latest Nitro version from the repository through darcs by: going to the directory you want to store nitro and typing in command line: `darcs get --partial http://repo.nitroproject.org nitro` 4) Find the RUBYOPTS environmental variable (it should already contain `-rubygems` in it and after it add the following: -I[PATH_TO_NITRO]\nitro\lib -I[PATH_TO_NITRO]\nitro\vendor -I[PATH_TO_NITRO]\og\lib -I[PATH_TO_NITRO]\glue\lib -I[PATH_TO_NITRO]\raw\lib * replace [PATH_TO_NITRO] with the path to your nitro folder (example: C:\nitro) 5) Add the same directories in the PATH environmental variable as well (ex. C:\nitro\nitro\lib;C:\nitro\nitro\vendor;C:\nitro\og\lib;C:\nitro\glue\lib;C:\nitro\raw\lib) 6) Go to the Nitro root directory and type: `darcs pull` and select "yes" to all patch prompts 7) Install the "facets" gem (gem install facets) 8) Install the "redcloth" gem (gem install redcloth) 9) Install the "xmlSimple" gem (gem install xml-simple) 10) Install the "mysql" gem (gem install mysql) [Select option 1] 11) Install the "uuidtools" gem (gem install uuidtools) * In order to get to your system's environmental variables, right click on your "My Computer" icon and select `Properties`. Select the `Advanced` Tab and on the bottom click on the `Environmental Variables` button. I intend to write an installer to automagically install Nitro on a windows system (and do all the dirty work) as well as keeping it up to date. Hope this helps. From george.moschovitis at gmail.com Wed Oct 3 07:11:55 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Wed, 3 Oct 2007 14:11:55 +0300 Subject: [Nitro] Installing Nitro on Windows in 11 steps In-Reply-To: <4703684860cde7.15282900@freemail.gr> References: <4703684860cde7.15282900@freemail.gr> Message-ID: Welcome Sotiri ;-) thanks for this info! -g. On 10/3/07, amusic at freemail.gr wrote: > > > Hello everyone, I'm new to the list and I've been told that some people > have been having some trouble installing Nitro on a Windows system. So for > those having trouble here's a 11 step checklist. (I assume that you've > already installed Ruby and MySQL on your system) > > 1) Download Darcs from www.darcs.net and decompress it in any directory > > 2*) Add the darcs root folder in the PATH environmental variable (i.e. > C:\Darcs;) > > 3) Download the latest Nitro version from the repository through darcs by: > going to the directory you want to store nitro and > typing in command line: `darcs get --partial > http://repo.nitroproject.org nitro` > > 4) Find the RUBYOPTS environmental variable (it should already contain > `-rubygems` in it and after it add the following: > > -I[PATH_TO_NITRO]\nitro\lib -I[PATH_TO_NITRO]\nitro\vendor > -I[PATH_TO_NITRO]\og\lib -I[PATH_TO_NITRO]\glue\lib > -I[PATH_TO_NITRO]\raw\lib > > * replace [PATH_TO_NITRO] with the path to your nitro folder (example: > C:\nitro) > > 5) Add the same directories in the PATH environmental variable as well > (ex. > C:\nitro\nitro\lib;C:\nitro\nitro\vendor;C:\nitro\og\lib;C:\nitro\glue\lib;C:\nitro\raw\lib) > > 6) Go to the Nitro root directory and type: `darcs pull` and select "yes" > to all patch prompts > > 7) Install the "facets" gem (gem install facets) > 8) Install the "redcloth" gem (gem install redcloth) > 9) Install the "xmlSimple" gem (gem install xml-simple) > 10) Install the "mysql" gem (gem install mysql) [Select option 1] > 11) Install the "uuidtools" gem (gem install uuidtools) > > * In order to get to your system's environmental variables, right click on > your "My Computer" icon and select `Properties`. Select the `Advanced` Tab > and on the bottom click on the `Environmental Variables` button. > > I intend to write an installer to automagically install Nitro on a windows > system (and do all the dirty work) as well as keeping it up to date. > > Hope this helps. > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://gmosx.me.gr http://phidz.com http://blog.gmosx.com http://cull.gr http://www.joy.gr http://nitroproject.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/nitro-general/attachments/20071003/6a59bc63/attachment.html From rob at robmela.com Wed Oct 3 08:21:20 2007 From: rob at robmela.com (Robert Mela) Date: Wed, 03 Oct 2007 08:21:20 -0400 Subject: [Nitro] Where to define Og relations In-Reply-To: <47033ADE.40807@arnebrasseur.net> References: <47033ADE.40807@arnebrasseur.net> Message-ID: <47038940.6000804@robmela.com> Some of the relation declarations are for the benefit of Og in schema generation. Others are for the benefit of Forms in generating form elements to bind relations ( see the views in nitro/part/admin/og ) Arne Brasseur wrote: > I just found out the hard way that defining a 'belongs_to' relation at > the beginning of the model class does not work. Once any managed > attributes are defined it does works. > > require "og" > > class Word > belongs_to WordList > > attr_accessor :definitions, Array > end > > gives: > ./app/model/word.rb:3: undefined method `belongs_to' for Word:Class > (NoMethodError) > > This: > > class Word > attr_accessor :definitions, Array > > belongs_to WordList > end > > works fine. > > Alternatively: > > class Word > include Og::RelationDSL > belongs_to WordList > > attr_accessor :definitions, Array > end > > also works fine. > > It's not clear to me if this is intended or not, has_many seems to work > fine once "og" is required. I haven't checked the other types of relations. > > G, is this known/intended? If so it should be documented. Robert, you > could perhaps add this to your cheatsheets? Very nice work BTW! I'm > using them all the time now. > > http://robmela.com/cheatsheets > > (ab) > > -------------- next part -------------- A non-text attachment was scrubbed... Name: rob.vcf Type: text/x-vcard Size: 116 bytes Desc: not available Url : http://rubyforge.org/pipermail/nitro-general/attachments/20071003/fd7e8ce9/attachment.vcf From rob at robmela.com Wed Oct 3 08:26:29 2007 From: rob at robmela.com (Robert Mela) Date: Wed, 03 Oct 2007 08:26:29 -0400 Subject: [Nitro] Request#params In-Reply-To: References: <47005629.60208@robmela.com> <47005B96.9090401@robmela.com> Message-ID: <47038A75.8090603@robmela.com> It's not working in OgAdminController. Perhaps it's some interaction with WebFile...? Try OgAdminController with this model (written from memory -- some changes might be needed....) In app.rb: require 'raw/model/webfile' Model: class Asset attr_accessor :name, String attr_accessor :file, WebFile end George Moschovitis wrote: > > * request.params['foo'] > * request['foo'] > > I use the second form all the time. > > > I use request["foo"] too... > > btw you can also use: > > request[:foo] > > one more hidden 0.50.0 new feature? > > -g. > > > -- > http://gmosx.me.gr > http://phidz.com > http://blog.gmosx.com > http://cull.gr > http://www.joy.gr > http://nitroproject.org > ------------------------------------------------------------------------ > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general -------------- next part -------------- A non-text attachment was scrubbed... Name: rob.vcf Type: text/x-vcard Size: 116 bytes Desc: not available Url : http://rubyforge.org/pipermail/nitro-general/attachments/20071003/1fb60d35/attachment.vcf From rob at robmela.com Wed Oct 3 08:35:05 2007 From: rob at robmela.com (Robert Mela) Date: Wed, 03 Oct 2007 08:35:05 -0400 Subject: [Nitro] Oops, and documentation idea... In-Reply-To: <47038940.6000804@robmela.com> References: <47033ADE.40807@arnebrasseur.net> <47038940.6000804@robmela.com> Message-ID: <47038C79.6020804@robmela.com> Sorry... I misunderstood the question... I'm up to my eyeballs in exploring Og right now, and its filtering everything I see. I look at my wife and kids and visualize the generated foreign key attributes that join us.... :) Thanks for the kudos. What I'd like more than my cheatsheets is a collaborative effort to produce documentation similar to the PHP docs -- http://www.php.net/docs.php. I see it as a nitro app, with content in DocBook or something similar. Perhaps Nitro elements could be created named similarly to DocBook elements, such that the docbook pages can be served up directly, as-is. The same pages could be used later to generate a print book -- produced by a community(!) with proceeds going back to the project. Would someone be willing to host that in a mercurial or darcs archive? thx. Robert Mela wrote: > Some of the relation declarations are for the benefit of Og in schema > generation. > > Others are for the benefit of Forms in generating form elements to > bind relations ( see the views in nitro/part/admin/og ) > > Arne Brasseur wrote: >> >> G, is this known/intended? If so it should be documented. Robert, you >> could perhaps add this to your cheatsheets? Very nice work BTW! I'm >> using them all the time now. >> >> http://robmela.com/cheatsheets >> >> (ab) >> >> > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general -------------- next part -------------- A non-text attachment was scrubbed... Name: rob.vcf Type: text/x-vcard Size: 116 bytes Desc: not available Url : http://rubyforge.org/pipermail/nitro-general/attachments/20071003/3ea97df4/attachment-0001.vcf From rob at robmela.com Wed Oct 3 08:47:55 2007 From: rob at robmela.com (Robert Mela) Date: Wed, 03 Oct 2007 08:47:55 -0400 Subject: [Nitro] Installing Nitro on Windows in 11 steps In-Reply-To: <4703684860cde7.15282900@freemail.gr> References: <4703684860cde7.15282900@freemail.gr> Message-ID: <47038F7B.5050401@robmela.com> This is extremely thourough, complete, and well organized. I'm probably not the only one thinking that you should sign up at oxyliquit.de and post this as a tip... I'd be thrilled if folks could add it to their own collections ( e.g., if Arne wanted to add it to thedailynitro, or I to cheatsheets ). I envision doing that with credit to the author being one of the first things on the page -- author's name, and if desired, a link to the author's web site. Maybe nitroproject.org could host a "From the Archives" section, with gems like this as entries, indexed by category and tag, with descriptive links. amusic at freemail.gr wrote: > Hello everyone, I'm new to the list and I've been told that some people have been having some trouble installing Nitro on a Windows system. So for those having trouble here's a 11 step checklist. (I assume that you've already installed Ruby and MySQL on your system) > > 1) Download Darcs from www.darcs.net and decompress it in any directory > > 2*) Add the darcs root folder in the PATH environmental variable (i.e. C:\Darcs;) > > 3) Download the latest Nitro version from the repository through darcs by: > going to the directory you want to store nitro and > typing in command line: `darcs get --partial http://repo.nitroproject.org nitro` > > 4) Find the RUBYOPTS environmental variable (it should already contain `-rubygems` in it and after it add the following: > > -I[PATH_TO_NITRO]\nitro\lib -I[PATH_TO_NITRO]\nitro\vendor -I[PATH_TO_NITRO]\og\lib -I[PATH_TO_NITRO]\glue\lib -I[PATH_TO_NITRO]\raw\lib > > * replace [PATH_TO_NITRO] with the path to your nitro folder (example: C:\nitro) > > 5) Add the same directories in the PATH environmental variable as well > (ex. C:\nitro\nitro\lib;C:\nitro\nitro\vendor;C:\nitro\og\lib;C:\nitro\glue\lib;C:\nitro\raw\lib) > > 6) Go to the Nitro root directory and type: `darcs pull` and select "yes" to all patch prompts > > 7) Install the "facets" gem (gem install facets) > 8) Install the "redcloth" gem (gem install redcloth) > 9) Install the "xmlSimple" gem (gem install xml-simple) > 10) Install the "mysql" gem (gem install mysql) [Select option 1] > 11) Install the "uuidtools" gem (gem install uuidtools) > > * In order to get to your system's environmental variables, right click on your "My Computer" icon and select `Properties`. Select the `Advanced` Tab and on the bottom click on the `Environmental Variables` button. > > I intend to write an installer to automagically install Nitro on a windows system (and do all the dirty work) as well as keeping it up to date. > > Hope this helps. > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: rob.vcf Type: text/x-vcard Size: 116 bytes Desc: not available Url : http://rubyforge.org/pipermail/nitro-general/attachments/20071003/01f45f9b/attachment.vcf From arne at arnebrasseur.net Wed Oct 3 08:52:10 2007 From: arne at arnebrasseur.net (Arne Brasseur) Date: Wed, 03 Oct 2007 20:52:10 +0800 Subject: [Nitro] Nitro on Apache Message-ID: <4703907A.8090503@arnebrasseur.net> I'm for the first time trying to actually deploy a Nitro app on my shared hosting account. I'm trying to use FastCGI since that's what I had success with using Rails. It took some tweaking of the FastCGI adapter, it seems unmaintained. I'm mainly stealing ideas from Rails here, I created a dispatch.fcgi that just loads Nitro, sets the mode to :live and requires app.rb. If I run it gives the two green lines : 03/10 05:13:11 INFO: Og uses the Mysql store. 03/10 05:13:11 INFO: Starting Fastcgi server in live mode, listening at 0.0.0.0:9000 My .htaccess should be good. Now if I visit the site I get a server 500 error. The error log mentions : [Wed Oct 03 05:11:59 2007] [error] [client 61.225.17.58] FastCGI: incomplete headers (0 bytes) received from server "/home/ar nebrasseur/subdomains/vocab/dispatch.fcgi" Have other people gotten this to work? Do I have other options having only limited control over the apache configuration? Thanks for any pointers! (ab) -- Arne Brasseur http://www.arnebrasseur.net arne at arnebrasseur.net From george.moschovitis at gmail.com Wed Oct 3 09:01:26 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Wed, 3 Oct 2007 16:01:26 +0300 Subject: [Nitro] Nitro on Apache In-Reply-To: <4703907A.8090503@arnebrasseur.net> References: <4703907A.8090503@arnebrasseur.net> Message-ID: I use Apache + mod_proxy_ballancer + Mongrel. I will try to prepare a *short* tutorial. -g. On 10/3/07, Arne Brasseur wrote: > > I'm for the first time trying to actually deploy a Nitro app on my > shared hosting account. I'm trying to use FastCGI since that's what I > had success with using Rails. It took some tweaking of the FastCGI > adapter, it seems unmaintained. > > I'm mainly stealing ideas from Rails here, I created a dispatch.fcgi > that just loads Nitro, sets the mode to :live and requires app.rb. If I > run it gives the two green lines : > > 03/10 05:13:11 INFO: Og uses the Mysql store. > 03/10 05:13:11 INFO: Starting Fastcgi server in live mode, listening at > 0.0.0.0:9000 > > My .htaccess should be good. Now if I visit the site I get a server 500 > error. The error log mentions : > > [Wed Oct 03 05:11:59 2007] [error] [client 61.225.17.58] FastCGI: > incomplete headers (0 bytes) received from server "/home/ar > nebrasseur/subdomains/vocab/dispatch.fcgi" > > Have other people gotten this to work? Do I have other options having > only limited control over the apache configuration? > > Thanks for any pointers! > > (ab) > > -- > Arne Brasseur > http://www.arnebrasseur.net > arne at arnebrasseur.net > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > -- http://gmosx.me.gr http://phidz.com http://blog.gmosx.com http://cull.gr http://www.joy.gr http://nitroproject.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/nitro-general/attachments/20071003/7951a6e1/attachment.html From rob at robmela.com Wed Oct 3 09:08:35 2007 From: rob at robmela.com (Robert Mela) Date: Wed, 03 Oct 2007 09:08:35 -0400 Subject: [Nitro] Nitro on Apache In-Reply-To: <4703907A.8090503@arnebrasseur.net> References: <4703907A.8090503@arnebrasseur.net> Message-ID: <47039453.1020608@robmela.com> fcgi is not worth the trouble. I suggest running Nitro standalone and using Apache's reverse proxying features as a front-end. With Apache 2.2 there's mod_proxy_balancer, which is *very* nice. With both Apache 2.0 and 2.2 you can use mod_rewrite like this: ServerName robmela.com ServerAlias www.robmela.com ServerAlias blog.robmela.com RewriteEngine On RewriteRule ^/admin(.*) https://nb.robmela.com/admin$1 [L,R] RewriteRule ^/(.*) http://127.0.0.1:9001/$1 [L,P] #ProxyRequests off #ProxyPass / http://127.0.0.1:9001/ #ProxyPassReverse / http://127.0.0.1:9001/ #ProxyPreserveHost on There is one caveat for heavily loaded sites or applications with long-running pages... which I'll get into later as I'm writing an Apache / Mongrel how-to that covers some gotchas. Arne Brasseur wrote: > I'm for the first time trying to actually deploy a Nitro app on my > shared hosting account. I'm trying to use FastCGI since that's what I > had success with using Rails. It took some tweaking of the FastCGI > adapter, it seems unmaintained. > > I'm mainly stealing ideas from Rails here, I created a dispatch.fcgi > that just loads Nitro, sets the mode to :live and requires app.rb. If I > run it gives the two green lines : > > 03/10 05:13:11 INFO: Og uses the Mysql store. > 03/10 05:13:11 INFO: Starting Fastcgi server in live mode, listening at > 0.0.0.0:9000 > > My .htaccess should be good. Now if I visit the site I get a server 500 > error. The error log mentions : > > [Wed Oct 03 05:11:59 2007] [error] [client 61.225.17.58] FastCGI: > incomplete headers (0 bytes) received from server "/home/ar > nebrasseur/subdomains/vocab/dispatch.fcgi" > > Have other people gotten this to work? Do I have other options having > only limited control over the apache configuration? > > Thanks for any pointers! > > (ab) > > -------------- next part -------------- A non-text attachment was scrubbed... Name: rob.vcf Type: text/x-vcard Size: 116 bytes Desc: not available Url : http://rubyforge.org/pipermail/nitro-general/attachments/20071003/62c0103f/attachment.vcf From rob at robmela.com Wed Oct 3 09:25:49 2007 From: rob at robmela.com (Robert Mela) Date: Wed, 03 Oct 2007 09:25:49 -0400 Subject: [Nitro] Nitro on Apache In-Reply-To: References: <4703907A.8090503@arnebrasseur.net> Message-ID: <4703985D.8@robmela.com> I'm preparing a lengthy how-to. I've spent many pressured hours on at http://httpd.apache.org/docs/2.2/mod/mod_proxy.html NB: There's a major problem with the way Mongrel 1.0.1 handles connection limits. If it's over it's configured connection limit It accepts, then immediately closes with no processing. Things would work much better with mod_proxy_balancer if monger were modified ( perhaps configurably ) to simply not call accept() when it's reached its configured connection limit. The problem is less likely to be triggered if Mongrel is running Nitro, but it's still a flaw. It's a MAJOR headache on a busy Rails site with slow-loading pages. For details on mod_proxy and mod_proxy_balancer, look at http://httpd.apache.org/docs/2.2/mod/mod_proxy.html There's also the mod_rewrite trick for handling static files -- cuts request times from tens of milliseconds to tenths of milliseconds, and with a lot less CPU -- very important on asset-heavy, busy sites... see the RewriteCond... RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f RewriteRule (.*) $1 [L] ProxyPass / balancer://myserverpool/ #### NB: trailing slash ProxyPassReverse / balancer://myserverpool/ ### NB: trailing slash ProxyPreserveHost on # no trailing slash BalancerMember http://192.168.10.10:10000 keepalive=on max=10 lbset=0 timeout=1 BalancerMember http://192.168.10.10:10001 keepalive=on max=10 lbset=1 BalancerMember http://192.168.10.11:10000 keepalive=on max=10 lbset=0 timeout=1 I've also got a Apache module that I'm polishing up that very simply handles very large hashed directory caches ( millions of entries ). Very useful for rails on large sites: http://myapp.mysite.net/image/1782.gif or /myappdir/public/image/1/7/8/2/1782.gif.cache George Moschovitis wrote: > I use Apache + mod_proxy_ballancer + Mongrel. > > I will try to prepare a *short* tutorial. > > -g. > > > > On 10/3/07, *Arne Brasseur* < arne at arnebrasseur.net > > wrote: > > I'm for the first time trying to actually deploy a Nitro app on my > shared hosting account. I'm trying to use FastCGI since that's what I > had success with using Rails. It took some tweaking of the FastCGI > adapter, it seems unmaintained. > > I'm mainly stealing ideas from Rails here, I created a dispatch.fcgi > that just loads Nitro, sets the mode to :live and requires app.rb. > If I > run it gives the two green lines : > > 03/10 05:13:11 INFO: Og uses the Mysql store. > 03/10 05:13:11 INFO: Starting Fastcgi server in live mode, > listening at > 0.0.0.0:9000 > > My .htaccess should be good. Now if I visit the site I get a > server 500 > error. The error log mentions : > > [Wed Oct 03 05:11:59 2007] [error] [client 61.225.17.58 > ] FastCGI: > incomplete headers (0 bytes) received from server "/home/ar > nebrasseur/subdomains/vocab/dispatch.fcgi" > > Have other people gotten this to work? Do I have other options having > only limited control over the apache configuration? > > Thanks for any pointers! > > (ab) > > -- > Arne Brasseur > http://www.arnebrasseur.net > arne at arnebrasseur.net > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > > > > > -- > http://gmosx.me.gr > http://phidz.com > http://blog.gmosx.com > http://cull.gr > http://www.joy.gr > http://nitroproject.org > ------------------------------------------------------------------------ > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general -------------- next part -------------- A non-text attachment was scrubbed... Name: rob.vcf Type: text/x-vcard Size: 116 bytes Desc: not available Url : http://rubyforge.org/pipermail/nitro-general/attachments/20071003/f1e11ab1/attachment.vcf From rob at robmela.com Wed Oct 3 11:05:58 2007 From: rob at robmela.com (Robert Mela) Date: Wed, 03 Oct 2007 11:05:58 -0400 Subject: [Nitro] problem posting code on oxyliquit Message-ID: <4703AFD6.8030205@robmela.com> I tried to submit this as an oxyliquit tutorial but goofed on the initial post -- now when I edit and submit the changes it's not saved correctly... # # Using Apache 2.0 and 2.2 as a reverse proxy # for a Nitro application. # # Note that Apache 2.2 offers a load balancing # proxy. Oxyliquit tutorial forthcoming... # # This scheme is based on Apache's NameVirtualHost # feature. The following line should appear # in your httpd.conf file: # # NameVirtualHost *:80 # # Next, add the following. # # You *could* put this directly in httpd.conf. # # But with large numbers of virtual hosts, # it makes sense to have an include directory # under your_apache_install/conf and add this # to httpd.conf: # # Include conf/vhosts/* # # or # # Include conf/vhosts/foo.com # Include conf/vhosts/bar.com # ServerName myhost.com ServerAlias www.myhost.com ServerAlias myalias.net ServerAlias www.myalias.net RewriteEngine On ProxyRequests off ProxyPass / http://127.0.0.1:9001/ ProxyPassReverse / http://127.0.0.1:9001/ ProxyPreserveHost on # If your application exposes administrative URLs that # you want to protect, then you can redirect to an ssl # port on the server. RewriteRule ^/admin(.*) https://admin.myhost.com/admin$1 [L,R] RewriteRule ^/(.*) http://127.0.0.1:9001/$1 [L,P] # # If you want an SSL port for secure URLs for your app, # create an additional vhost # # Again, remember to add this somewhere before it: # # NameVirtualHost *:443 # ServerName admin.myhost.com ServerAlias topsecret.myhost.com ProxyRequests off ProxyPass / http://127.0.0.1:9001/ ProxyPassReverse / http://127.0.0.1:9001/ ProxyPreserveHost on AuthName "Restricted Access" AuthType Basic Require user YoursTruly AuthUserFile /top/secret/path/htpasswd AuthName "Restricted Access" AuthType Basic Require group SiteEditors AuthUserFile /top/secret/path/htpasswd SSLEngine on SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL SSLCertificateFile /path-to-cert-files/ssl.crt/self_signed.cert SSLCertificateKeyFile /path-to-cert-files/ssl.key/self_signed.key SSLOptions +FakeBasicAuth +ExportCertData +CompatEnvVars +StrictRequire -------------- next part -------------- A non-text attachment was scrubbed... Name: rob.vcf Type: text/x-vcard Size: 116 bytes Desc: not available Url : http://rubyforge.org/pipermail/nitro-general/attachments/20071003/91e6027e/attachment.vcf From arne at arnebrasseur.net Wed Oct 3 11:12:21 2007 From: arne at arnebrasseur.net (Arne Brasseur) Date: Wed, 03 Oct 2007 23:12:21 +0800 Subject: [Nitro] Nitro on Apache In-Reply-To: <47039453.1020608@robmela.com> References: <4703907A.8090503@arnebrasseur.net> <47039453.1020608@robmela.com> Message-ID: <4703B155.3010508@arnebrasseur.net> Can I do this from .htaccess? (ab) Robert Mela schreef: > fcgi is not worth the trouble. > > I suggest running Nitro standalone and using Apache's reverse proxying > features as a front-end. > > With Apache 2.2 there's mod_proxy_balancer, which is *very* nice. > > With both Apache 2.0 and 2.2 you can use mod_rewrite like this: > > > > ServerName robmela.com > ServerAlias www.robmela.com > ServerAlias blog.robmela.com > RewriteEngine On > RewriteRule ^/admin(.*) https://nb.robmela.com/admin$1 [L,R] > RewriteRule ^/(.*) http://127.0.0.1:9001/$1 [L,P] > #ProxyRequests off > #ProxyPass / http://127.0.0.1:9001/ > #ProxyPassReverse / http://127.0.0.1:9001/ > #ProxyPreserveHost on > > > There is one caveat for heavily loaded sites or applications with > long-running pages... which I'll get into later as I'm writing an > Apache / Mongrel how-to that covers some gotchas. > > Arne Brasseur wrote: >> I'm for the first time trying to actually deploy a Nitro app on my >> shared hosting account. I'm trying to use FastCGI since that's what I >> had success with using Rails. It took some tweaking of the FastCGI >> adapter, it seems unmaintained. >> >> I'm mainly stealing ideas from Rails here, I created a dispatch.fcgi >> that just loads Nitro, sets the mode to :live and requires app.rb. If >> I run it gives the two green lines : >> >> 03/10 05:13:11 INFO: Og uses the Mysql store. >> 03/10 05:13:11 INFO: Starting Fastcgi server in live mode, listening >> at 0.0.0.0:9000 >> >> My .htaccess should be good. Now if I visit the site I get a server >> 500 error. The error log mentions : >> >> [Wed Oct 03 05:11:59 2007] [error] [client 61.225.17.58] FastCGI: >> incomplete headers (0 bytes) received from server "/home/ar >> nebrasseur/subdomains/vocab/dispatch.fcgi" >> >> Have other people gotten this to work? Do I have other options having >> only limited control over the apache configuration? >> >> Thanks for any pointers! >> >> (ab) >> >> > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general -- Arne Brasseur http://www.arnebrasseur.net arne at arnebrasseur.net From wyhaines at gmail.com Wed Oct 3 11:18:11 2007 From: wyhaines at gmail.com (Kirk Haines) Date: Wed, 3 Oct 2007 08:18:11 -0700 Subject: [Nitro] Nitro on Apache In-Reply-To: <4703985D.8@robmela.com> References: <4703907A.8090503@arnebrasseur.net> <4703985D.8@robmela.com> Message-ID: On 10/3/07, Robert Mela wrote: > NB: There's a major problem with the way Mongrel 1.0.1 handles > connection limits. If it's over it's configured connection limit It > accepts, then immediately closes with no processing. Things would work > much better with mod_proxy_balancer if monger were modified ( perhaps > configurably ) to simply not call accept() when it's reached its > configured connection limit. Use evented_mongrel or swiftiply w/ swiftiplied_mongrel. It will help this. It was an oversight on my part that evented mongrel doesn't use epoll if it is available. This has been patched and will be available in the next version, which means you could have more than 1024 (the limit on select()) connections queued up without any problems, if you had to (on Linux 2.6.x based systems). > The problem is less likely to be triggered if Mongrel is running Nitro, > but it's still a flaw. It's a MAJOR headache on a busy Rails site with > slow-loading pages. evented_mongrel will let you queue up lots of requests without incurring the RAM and performance killing overhead of threads in Mongrel. Swiftiply with swiftiplied_mongrel will load balance your slow requests across your backends optimally, with no crowding on any one backend, while again ensuring that you don't have RAM and performance killing overhead of threads in Mongrel. George had said that he was going to make sure Nitro 0.50 had builtin support for using both of these. I am not sure of the status of that or if he needs anything from me. George? Kirk Haines From rob at robmela.com Wed Oct 3 12:10:52 2007 From: rob at robmela.com (Robert Mela) Date: Wed, 03 Oct 2007 12:10:52 -0400 Subject: [Nitro] Nitro on Apache In-Reply-To: References: <4703907A.8090503@arnebrasseur.net> <4703985D.8@robmela.com> Message-ID: <4703BF0C.2010003@robmela.com> An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/nitro-general/attachments/20071003/50b9b3fc/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: rob.vcf Type: text/x-vcard Size: 116 bytes Desc: not available Url : http://rubyforge.org/pipermail/nitro-general/attachments/20071003/50b9b3fc/attachment.vcf From john at oxyliquit.de Wed Oct 3 12:53:53 2007 From: john at oxyliquit.de (Jonathan Buch) Date: Wed, 03 Oct 2007 18:53:53 +0200 Subject: [Nitro] Nitro on Apache In-Reply-To: <47039453.1020608@robmela.com> References: <4703907A.8090503@arnebrasseur.net> <47039453.1020608@robmela.com> Message-ID: Hi, thank you for adding the tutorial (it is however quite short and might have fit better into a tip). I had to clean up a little due to a slight misunderstanding between you and oxy which was more like 'wtf' ;). It led me on a small debugging trip to find out why there wasn't any content. Anyway, for tutorials the "description" field is supposed to be a small entry on what the tutorial contains. This is shown on the front page. Inside the tutorial then there should be one or more pages which you can add. This is available to help structure your tutorial in easyly digestable chunks. Anyway, thanks for using oxywtf. ^_^ Feel free to change my hastily added description. Jo -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/ From john at oxyliquit.de Wed Oct 3 12:58:35 2007 From: john at oxyliquit.de (Jonathan Buch) Date: Wed, 03 Oct 2007 18:58:35 +0200 Subject: [Nitro] Installing Nitro on Windows in 11 steps In-Reply-To: <4703684860cde7.15282900@freemail.gr> References: <4703684860cde7.15282900@freemail.gr> Message-ID: Hi, and welcome! > Hope this helps. Very concise and easy to read, like Rob already said, I'd be happy if you could add this as an Oxyiliquit tip[1]. Thank you very much for supporting the poor windows guys, they don't get too much love these days! ^_^ Jo [1] http://www.oxyliquit.de/add/tip -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/ From wyhaines at gmail.com Wed Oct 3 13:25:34 2007 From: wyhaines at gmail.com (Kirk Haines) Date: Wed, 3 Oct 2007 10:25:34 -0700 Subject: [Nitro] Nitro on Apache In-Reply-To: <4703BF0C.2010003@robmela.com> References: <4703907A.8090503@arnebrasseur.net> <4703985D.8@robmela.com> <4703BF0C.2010003@robmela.com> Message-ID: > I'm worried about queuing. > > I'm working to remediate a Rails app ( not mine ) that can take as long as > a minute to generate certain pages. > > Consider the case where mod_proxy_balancer sends a request to an application > server that's 1 second into a 60-second rails page. With queuing, wouldn't > the second request sit in the queue for 59 seconds while waiting for the > first request to complete? Yes. This brings up an interesting issue, though. 1 minute to render a page is horrific, and if everything is that slow, there are no good solutions. But if the app only has certain pages that are that slow, while the rest are fast, it brings up an interesting, solveable scaling quandry. > The current workaround is to have a hundred of Rails app server instances > chewing up huge amounts of RAM. I would quite happily trade that in for the > memory and performance overhead of whatever multiplexing or multithreading > scheme is used in the app server. All I need is a guarantee that the app > server will not call select if 1) it's already working on a request and 2) > it won't open and close a socket for a request it's not prepared to handle. > If the app doesn't call accept() Apache will gracefully move on to another > app server. (*nod*) Mongrel accpets requests as they come in. If it reaches its request limit, it starts killing things. That request limit, unless you have set it lower, is the select() limit of 1024 file handles. In a case where you have some actions that are very, very slow, a mongrel that is in this situation probably just crawls and takes forever to render anything. It also uses a ton of RAM. If one is using an evented_mongrel, you still have the problem that you mention, that a fast action sitting behind a slow one has to wait for the slow one to finish. The slow one will, however, finish a lot faster, and the overall RAM usage will be a _LOT_ lower, too. With Swiftiply, a fast action won't ever be queued up behind a slow action unless there are no available backends to take any actions at all. Then the fast action will wait until one of the backends finishes its unit of work and returns a response. As soon as that happens, the fast action that has been waiting for a backend will be picked up and handled. > I'll look at swiftiply -- this is the first I've heard of it. swiftiply.swiftcore.org #swiftcore on irc.freenode.net Kirk Haines From cwdinfo at gmail.com Wed Oct 3 13:49:25 2007 From: cwdinfo at gmail.com (s.ross) Date: Wed, 3 Oct 2007 10:49:25 -0700 Subject: [Nitro] Nitro on Apache In-Reply-To: References: <4703907A.8090503@arnebrasseur.net> <4703985D.8@robmela.com> <4703BF0C.2010003@robmela.com> Message-ID: Have you ever tried to make an app thread-safe? The dependencies are so bizarre that the testability of the app vastly increases in complexity. Bugs are subtle and don't happen often -- even then, they are not readily reproducible. Worse, they may not even be in your code! I've been a proponent (in the past) of some kind of MT Rails, but the more I think about injecting mutexes or bracketing sections of code with semaphores, etc, etc, hoping I've made my code reentrant, the less I like it when compared to the multiprocess model. Note also that a good deal of any Web app is made up of instance objects which are typically not long-lived and don't benefit from MT. So you get to think about a whole different set of things: Where do I store app- global data and how do I store thread-local data? This can be a nightmare for request/response cycles that typically take milliseconds and for which a multiprocess alternative exists. Just my $.02 On Oct 3, 2007, at 10:25 AM, Kirk Haines wrote: >> I would quite happily trade that in for the >> memory and performance overhead of whatever multiplexing or >> multithreading >> scheme is used in the app server. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/nitro-general/attachments/20071003/9c3b3e36/attachment.html From amusic at freemail.gr Wed Oct 3 14:00:04 2007 From: amusic at freemail.gr (Sotiris Varotsis) Date: Wed, 3 Oct 2007 21:00:04 +0300 Subject: [Nitro] Installing Nitro on Windows in 11 steps In-Reply-To: References: <4703684860cde7.15282900@freemail.gr> Message-ID: <00f101c805e7$3a990430$afcb0c90$@gr> The first installer build looks promising (as in installing Nitro on a system that already has mysql and ruby on it). Of course it assumes much for granted at this stage. I'm going to add some checks for presence of ruby, mysql or other nitro versions and do the relevant error handling, make it pretty and per George's suggestion make it a component based, all in one package (i.e. ruby/mysql/nitro). I expect it to be released really soon. Auto-updating (kind of like building a nitro specific darcs in the installer) will be a bit trickier and it will be looked upon later on. -aMUSiC -----Original Message----- From: Jonathan Buch [mailto:john at oxyliquit.de] Sent: Wednesday, October 03, 2007 7:59 PM To: amusic at freemail.gr; General discussion about Nitro Subject: Re: [Nitro] Installing Nitro on Windows in 11 steps Hi, and welcome! > Hope this helps. Very concise and easy to read, like Rob already said, I'd be happy if you could add this as an Oxyiliquit tip[1]. Thank you very much for supporting the poor windows guys, they don't get too much love these days! ^_^ Jo [1] http://www.oxyliquit.de/add/tip -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/ No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.488 / Virus Database: 269.14.0/1046 - Release Date: 3/10/2007 10:08 ?? No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.488 / Virus Database: 269.14.0/1046 - Release Date: 3/10/2007 10:08 ?? From rob at robmela.com Wed Oct 3 14:45:25 2007 From: rob at robmela.com (Robert Mela) Date: Wed, 03 Oct 2007 14:45:25 -0400 Subject: [Nitro] Nitro on Apache In-Reply-To: References: <4703907A.8090503@arnebrasseur.net> <4703985D.8@robmela.com> <4703BF0C.2010003@robmela.com> Message-ID: <4703E345.50705@robmela.com> Kirk Haines wrote: > Yes. This brings up an interesting issue, though. 1 minute to render > a page is horrific, and if everything is that slow, there are no good > solutions. But if the app only has certain pages that are that slow, > while the rest are fast, it brings up an interesting, solveable > scaling quandry. > I didn't write it... just wanna make that clear... I inherited it and have solved enough of it that at least users can get on to the system, which gives them a chance to grumble about the speed. This is the offending code in gems/mongrel-1.0.1/lib/mongrel.rb. I've set num_processors in mongrel_cluster.yml to 1, and it seems a fairly straightforward workaround to replace accept ( line 722 ) with a polling loop: def accept_workaround reap_dead_workers if worker queue length < max_processors return accept else sleep 0.1 seconds # more properly: wait for a barrier condition end end Gets me out of my current hell. A proper fix would have a barrier condition replacing the sleep, but compared to what I'm up against now, a 0.1 second polling loop is nothing. Swiftiply looks good -- scanning the docs now. As an alternative, the above, unless I'm missing something, would also mesh seamlessly with mod_proxy_balancer. - query worker_list.lengthand if it's greater than num_processors, b 721 while true 722 begin 723 client = @socket.accept 724 725 if $tcp_cork_opts 726 client.setsockopt(*$tcp_cork_opts) rescue nil 727 end 728 729 worker_list = @workers.list 730 731 if worker_list.length >= @num_processors 732 STDERR.puts "Server overloaded with #{worker_list.length} processors (#@num_processors max). Dropping connection." 733 client.close rescue Object 734 reap_dead_workers("max processors") 735 else -------------- next part -------------- A non-text attachment was scrubbed... Name: rob.vcf Type: text/x-vcard Size: 116 bytes Desc: not available Url : http://rubyforge.org/pipermail/nitro-general/attachments/20071003/15d8c3a0/attachment-0001.vcf From wyhaines at gmail.com Wed Oct 3 14:49:08 2007 From: wyhaines at gmail.com (Kirk Haines) Date: Wed, 3 Oct 2007 11:49:08 -0700 Subject: [Nitro] Nitro on Apache In-Reply-To: References: <4703907A.8090503@arnebrasseur.net> <4703985D.8@robmela.com> <4703BF0C.2010003@robmela.com> Message-ID: On 10/3/07, s.ross wrote: > Have you ever tried to make an app thread-safe? The dependencies are so > bizarre that the testability of the app vastly increases in complexity. Bugs > are subtle and don't happen often -- even then, they are not readily > reproducible. Worse, they may not even be in your code! Are you talking to me or to Robert? You attribute the quote at the bottom of your post to me, but those aren't my words -- they are Robert's. I have made apps threadsafe. IOWA is threadsafe, and IOWA apps are generally threadsafe. It's not a terrible nightmare, but often there are simpler alternatives, as you suggest. > This can be a nightmare for request/response cycles that typically take > milliseconds and for which a multiprocess alternative exists. It can be a nightmare for a lot of reasons. The main complains about the multiprocess alternative are the management issues. Managing your pool of backend processes, monitoring their individual health, stopping/restarting, sizing the pool to the loads, etc.... These are all issues that I am working towards solving with Swiftiply, regardless of what framework one uses. Kirk Haines From rob at robmela.com Wed Oct 3 16:08:08 2007 From: rob at robmela.com (Robert Mela) Date: Wed, 03 Oct 2007 16:08:08 -0400 Subject: [Nitro] Nitro on Apache In-Reply-To: References: <4703907A.8090503@arnebrasseur.net> <4703985D.8@robmela.com> <4703BF0C.2010003@robmela.com> Message-ID: <4703F6A8.4030605@robmela.com> For sure -- it'd be labor intensive and tedious to take a legacy framework with all its associated plugins from disparate sources and make it thread-safe. You'd have to make the default mode single-threaded and allow a year or two for plugins and new development to catch up. There are actually very few cases where a framework user would need to consider concurrency. Most of the shared resources are things like session stores, database connections -- and all that's taken care of by the framework. Presumably a developer advanced enough to create a shared resource is also someone who has a clue as to what needs to be done. s.ross wrote: > Have you ever tried to make an app thread-safe? The dependencies are > so bizarre that the testability of the app vastly increases in > complexity. Bugs are subtle and don't happen often -- even then, they > are not readily reproducible. Worse, they may not even be in your code! > > I've been a proponent (in the past) of some kind of MT Rails, but the > more I think about injecting mutexes or bracketing sections of code > with semaphores, etc, etc, hoping I've made my code reentrant, the > less I like it when compared to the multiprocess model. Note also that > a good deal of any Web app is made up of instance objects which are > typically not long-lived and don't benefit from MT. So you get to > think about a whole different set of things: Where do I store > app-global data and how do I store thread-local data? > > This can be a nightmare for request/response cycles that typically > take milliseconds and for which a multiprocess alternative exists. > > Just my $.02 > > On Oct 3, 2007, at 10:25 AM, Kirk Haines wrote: > >>> I would quite happily trade that in for the >>> >>> memory and performance overhead of whatever multiplexing or >>> multithreading >>> >>> scheme is used in the app server. >>> > > ------------------------------------------------------------------------ > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general -------------- next part -------------- A non-text attachment was scrubbed... Name: rob.vcf Type: text/x-vcard Size: 116 bytes Desc: not available Url : http://rubyforge.org/pipermail/nitro-general/attachments/20071003/5b4f16e5/attachment.vcf From cwdinfo at gmail.com Wed Oct 3 17:34:43 2007 From: cwdinfo at gmail.com (s.ross) Date: Wed, 3 Oct 2007 14:34:43 -0700 Subject: [Nitro] Nitro on Apache In-Reply-To: <4703F6A8.4030605@robmela.com> References: <4703907A.8090503@arnebrasseur.net> <4703985D.8@robmela.com> <4703BF0C.2010003@robmela.com> <4703F6A8.4030605@robmela.com> Message-ID: <3D4B217B-F5BE-4E38-9379-A781DCBC5901@gmail.com> First to Kirk: Sorry about the attribution -- my mistake. Second, this is more a general comment on the desirability and cost/benefit of using threads in short-duration processes such as request/response cycles. The cost of tracking down and fixing a concurrency bug may be higher than adding a mongrel or whatever. If swiftiply solves some or much of this problem, I'll be very happy. In the meantime, the cheap way to remove blocking is add servers in separate processes. Rob, if Rails is any example, features and stability will trump concurrency for a long time. Certainly, threading is worth keeping on the radar, but then you have to open the discussion of whether green threads really do what you want and which of the next-generation Ruby engines are likely to succeed in providing an efficient threading model -- efficient enough to make thread-safety a priority. I believe one philosophy that typically works is the "sin no more" philosophy. If you know you didn't get concurrency right in the first place, at least don't knowingly create new problems. Hmmmm? On Oct 3, 2007, at 1:08 PM, Robert Mela wrote: > For sure -- it'd be labor intensive and tedious to take a legacy > framework with all its associated plugins from disparate sources > and make it thread-safe. You'd have to make the default mode > single-threaded and allow a year or two for plugins and new > development to catch up. > > There are actually very few cases where a framework user would need > to consider concurrency. Most of the shared resources are things > like session stores, database connections -- and all that's taken > care of by the framework. Presumably a developer advanced enough > to create a shared resource is also someone who has a clue as to > what needs to be done. > > From mvyver at gmail.com Thu Oct 4 05:49:14 2007 From: mvyver at gmail.com (Mark Van De Vyver) Date: Thu, 4 Oct 2007 19:49:14 +1000 Subject: [Nitro] Nitro/Og rspec heads-up: any alternative solutions. Message-ID: <389c43e40710040249i19ef7429o7171a27252da3ce4@mail.gmail.com> Hi Devs, Hope this 'head-up' saves someone some time. I'd appreciate any alternative the are better then what I cam up with. The following is known on the rspec list and I've asked there for suggestions - will fwd if anything useful comes up. The essential point is that rspec describe blocks are not isolated name spaces. Consequence: if you're going to define classes then you'll need to choose different class names for each describe/example block, or else the spec's will run a good chance of being contaminated. Any other suggestions? Example, from the code snippets below, the last describe/example block will return two attributes for the Person class: @attrs # [:name, :age] :) module Og describe DbiAdapter, "field_sql_for_attribute (without :sql annotation)" do include OgSpecExpectations before(:all) do class Person attr_accessor :name, String, :sql => "some text" end end <...> end describe DbiAdapter, "field_sql_for_attribute (without :sql annotation)" do include OgSpecExpectations before(:all) do class Person attr_accessor :age, String end <...> @attrs = @man.store.serializable_attributes_for_class(Person) end <...> end end From arne at arnebrasseur.net Thu Oct 4 11:21:05 2007 From: arne at arnebrasseur.net (Arne Brasseur) Date: Thu, 04 Oct 2007 23:21:05 +0800 Subject: [Nitro] Nitro on Apache In-Reply-To: References: <4703907A.8090503@arnebrasseur.net> Message-ID: <470504E1.90206@arnebrasseur.net> This seems the way to go, but unfortunately mod_proxy is not an option for me. I'm on shared hosting with little chance of changing apache's configuration, except by .htaccess files. It seems both cgi and fcgi adapters are simply broken because of changes to the adapter interface. E.g. what used to be class methods are now instance methods, but that's not all. Would it be hard to fix them? Or just one of them? I'm not too concerned about performance at this point, if it runs I'd be happy. If they're not being fixed please add a big BROKEN sign or remove them altogether. Thank you (once again)! (ab) George Moschovitis schreef: > I use Apache + mod_proxy_ballancer + Mongrel. > > I will try to prepare a *short* tutorial. > > -g. > > > > On 10/3/07, *Arne Brasseur* < arne at arnebrasseur.net > > wrote: > > I'm for the first time trying to actually deploy a Nitro app on my > shared hosting account. I'm trying to use FastCGI since that's what I > had success with using Rails. It took some tweaking of the FastCGI > adapter, it seems unmaintained. > > I'm mainly stealing ideas from Rails here, I created a dispatch.fcgi > that just loads Nitro, sets the mode to :live and requires app.rb. > If I > run it gives the two green lines : > > 03/10 05:13:11 INFO: Og uses the Mysql store. > 03/10 05:13:11 INFO: Starting Fastcgi server in live mode, > listening at > 0.0.0.0:9000 > > My .htaccess should be good. Now if I visit the site I get a > server 500 > error. The error log mentions : > > [Wed Oct 03 05:11:59 2007] [error] [client 61.225.17.58 > ] FastCGI: > incomplete headers (0 bytes) received from server "/home/ar > nebrasseur/subdomains/vocab/dispatch.fcgi" > > Have other people gotten this to work? Do I have other options having > only limited control over the apache configuration? > > Thanks for any pointers! > > (ab) > > -- > Arne Brasseur > http://www.arnebrasseur.net > arne at arnebrasseur.net > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > > > > > -- > http://gmosx.me.gr > http://phidz.com > http://blog.gmosx.com > http://cull.gr > http://www.joy.gr > http://nitroproject.org > ------------------------------------------------------------------------ > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general -- Arne Brasseur http://www.arnebrasseur.net arne at arnebrasseur.net -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/nitro-general/attachments/20071004/2bed7f6e/attachment.html From rob at robmela.com Thu Oct 4 13:32:49 2007 From: rob at robmela.com (Robert Mela) Date: Thu, 04 Oct 2007 13:32:49 -0400 Subject: [Nitro] caching and index params Message-ID: <470523C1.6010905@robmela.com> Is this still true? # Handle static files? Set to true in live mode to avoid a # nasty bug: when caching is enabled and the index method # accepts parameters, static files may get corrupted. Think # something better. -------------- next part -------------- A non-text attachment was scrubbed... Name: rob.vcf Type: text/x-vcard Size: 116 bytes Desc: not available Url : http://rubyforge.org/pipermail/nitro-general/attachments/20071004/797f9fbf/attachment.vcf From prpht9 at gmail.com Thu Oct 4 15:07:12 2007 From: prpht9 at gmail.com (chris) Date: Thu, 4 Oct 2007 15:07:12 -0400 Subject: [Nitro] Oops, and documentation idea... In-Reply-To: <47038C79.6020804@robmela.com> References: <47033ADE.40807@arnebrasseur.net> <47038940.6000804@robmela.com> <47038C79.6020804@robmela.com> Message-ID: Rob, This is similar to something I mentioned awhile back. And it has one particular issue. The documentation does not evolve and get transported to users when they do, say... "sudo gem install og --version= 0.40.0" or however you would type this for a specific version. (don't feel like looking it up) Including og and nitro documentation in rdoc along with the code accomplishes your goal and it keeps all evolving changes to documentation with the pertinent code. Tutorials should be a part of the rdoc documentation is what I'm saying. Oxyliquit provides a place for users to post tutorial ideas and the base ones, like your cheatsheets get installed with every gem. As for the collaborative documentation aspect, I'll have to think about that for a bit. The back of my head is screaming wiki with an automated export into darcs that only george can kick off. I'll post back when I have some more defined ideas. I would be willing to post an example of what I propose to this list for you guys to consider. I know this doesn't necessarily associate the comment threads like on the php docs site you mentioned, I'd have to put more thought into that than I have available brain power currently. Just my 2cents Chris Below is the comment I made a while back about documentation called "Keeping Documentation and Tutorials up-to-date" Hi all, > > A methodology recommendation has been rolling around in my head for a > few days now and I'd like to bring it up here on the mailing list. So, I'll > get started with a little background and a question. > > I was reading a post earlier today called "The basics" and want to ask > the question "Where are the new tutorials going to be published?". > > This seemed like an innocent enough question until i realized, your > probably going to put it on OxyLiquit . I'm not going > to knock putting them there, it's actually one of the top locations new > users are going to look for that information. The problem I see is the same > thing that happened to the other 4 tutorials. > > They went out of date almost as quickly as they were posted. > > I would like to make a recommendation to the Nitro/Og (raw, etc, etc.) > team. How about rolling a basic tutorial into the RDocs. IMHO the > situation your team is running into is a knowledge transfer gap between the > creators and the intermediate to expert users of Nitro, not the newbies who > barely know where to start. Rake's RDoc index pageis a good example of what I think Nitro's should look like. It gives all > the information a newbie needs to get their feet wet and attempt to get to > an intermediate level of understanding. > > What the expert users needs is good reference material that explains the > inner workings of how the components work with each other and small examples > of how someone can utilize them. eg: Rake::RDocTaskand > Rake::GemPackageTask > These examples do not need to be easily understood by a novice. However, > they do need to effectively communicate a technical concept to a competent > ruby developer without having to delve too deeply into the code to > accomplish something. I'm not saying they won't run into exceptions trying > to get it working, but they should know what is possible with the class or > module. > > note: I used rake just because it's something I picked up fairly quickly > due to the rdocs. > > The advantage of taking this approach to documenting your projects is > you create a basis for the expert users to write the tutorials. They could > write them on their blogs, (good for your google ranking), on Fora or on > OxyLiquit. I'm basically saying, you should not be writing full blown > tutorials, but moving smaller examples of how to perform actions into your > RDocs. This has key advantages... > > 1 - When a developer makes a change to the code they can make the example > adjustments without having to open another editor. > eg: Or even better, without having to open a web browser, login to a > wiki ( whatever ) and then make changes. Way too many steps. Developers > are lazy, I mean efficient. (tongue in cheek) > 2 - The examples for a particular version of each project are in revision > control with the code they reference. > eg: someone can download x.x lower version of the project and have the > correct examples for that version > 3 - The published RDocs can be available through your website and through > ri without you having to publish yet another piece of documentation. > eg: rake deploy is all it takes (if you use newgem, not sure if you do) > 4 - Patches from your userbase don't have to be just code, they can be > updates to your tutorials as well. > eg: In fact if I were in your shoes, the first page of the RDocs would > reference a page on how to submit updates to the examples as a patch. > > As a final note, I would like to say the HelloWorld example from the > repository for nitro-0.50 is a perfect starting point to put in the > RDocs. Then you could work the Blog example in for each of the components > you want to communicate howto ___. I'm all done ranting. > > Criticism always welcome, > > Chris Scheper > On 10/3/07, Robert Mela wrote: > > Sorry... I misunderstood the question... I'm up to my eyeballs in > exploring Og right now, and its filtering everything I see. I look at > my wife and kids and visualize the generated foreign key attributes that > join us.... :) > > Thanks for the kudos. What I'd like more than my cheatsheets is a > collaborative effort to produce documentation similar to the PHP docs -- > http://www.php.net/docs.php. I see it as a nitro app, with content > in DocBook or something similar. Perhaps Nitro elements could be > created named similarly to DocBook elements, such that the docbook pages > can be served up directly, as-is. The same pages could be used later > to generate a print book -- produced by a community(!) with proceeds > going back to the project. > > Would someone be willing to host that in a mercurial or darcs archive? > > thx. > > Robert Mela wrote: > > Some of the relation declarations are for the benefit of Og in schema > > generation. > > > > Others are for the benefit of Forms in generating form elements to > > bind relations ( see the views in nitro/part/admin/og ) > > > > Arne Brasseur wrote: > >> > >> G, is this known/intended? If so it should be documented. Robert, you > >> could perhaps add this to your cheatsheets? Very nice work BTW! I'm > >> using them all the time now. > >> > >> http://robmela.com/cheatsheets > >> > >> (ab) > >> > >> > > > > _______________________________________________ > > Nitro-general mailing list > > Nitro-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/nitro-general > > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/nitro-general/attachments/20071004/1876495e/attachment-0001.html From mvyver at gmail.com Fri Oct 5 02:16:55 2007 From: mvyver at gmail.com (Mark Van De Vyver) Date: Fri, 5 Oct 2007 16:16:55 +1000 Subject: [Nitro] Og [patch]: Rename write_attr_ to serialize_attr_ Message-ID: <389c43e40710042316o703d52eamd55609e4443dd5ea@mail.gmail.com> These changes should have no effect at the users level? * Rename write_attr_ to serialize_attr_ These names properly reflect what is happening. Renaming is also a precursor to some changes that 1) DRY out the serialization that occurs in Og, 2) Should permit Og's type mapping to be extensible (without touching the code). -------------- next part -------------- A non-text attachment was scrubbed... Name: mvdv-20071005-1.tar.gz Type: application/x-gzip Size: 18958 bytes Desc: not available Url : http://rubyforge.org/pipermail/nitro-general/attachments/20071005/f82b1fb4/attachment.gz From george.moschovitis at gmail.com Fri Oct 5 03:33:13 2007 From: george.moschovitis at gmail.com (George Moschovitis) Date: Fri, 5 Oct 2007 10:33:13 +0300 Subject: [Nitro] caching and index params In-Reply-To: <470523C1.6010905@robmela.com> References: <470523C1.6010905@robmela.com> Message-ID: I am not really sure... will have to check this... -g. On 10/4/07, Robert Mela wrote: > > Is this still true? > > # Handle static files? Set to true in live mode to avoid a > # nasty bug: when caching is enabled and the index method > # accepts parameters, static files may get corrupted. Think > # something better. > > _______________________________________________ > Nitro-general mailing list > Nitro-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/nitro-general > > -- http://gmosx.me.gr http://phidz.com http://blog.gmosx.com http://cull.gr http://www.joy.gr http://nitroproject.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyf