From tbray at textuality.com Thu Jul 3 18:47:00 2008 From: tbray at textuality.com (Tim Bray) Date: Thu, 3 Jul 2008 15:47:00 -0700 Subject: [Ape-development] Testing Message-ID: <517bf110807031547o450b59eara9b8150eb27253f1@mail.gmail.com> Is this thing on? -T From tbray at textuality.com Thu Jul 3 19:22:29 2008 From: tbray at textuality.com (Tim Bray) Date: Thu, 3 Jul 2008 16:22:29 -0700 Subject: [Ape-development] Recent Ape not re-entrant? Message-ID: <517bf110807031622u21318073mef59a5c738a2dfd5@mail.gmail.com> I'm using Ape to debug a server implementation... works fine first time I run it, crashes 2nd time: ======================= The Ape says: http://localhost:4444/app/atom/service Summary: 1 error, 0 warnings 1. TESTING: Service document and collections. 2. ? Retrieval of Service Document: it exists and is served properly.[Dialog] 3. Schema validation is just available building the ape with jruby. 4. Found these collections: * 'Entries' accepts application/atom+xml;type=entry * 'Media' accepts */* 5. ! Ouch! Ape fall down go boom; details: haven't been setted Ape::ValidationError ./bin/../lib/ape.rb:147:in `check_manifest'./bin/../lib/ape.rb:159:in `check_validator'./bin/../lib/ape.rb:75:in `might_fail'./bin/../lib/ape.rb:74:in `each'./bin/../lib/ape.rb:74:in `might_fail'./bin/../lib/ape.rb:59:in `check'./bin/../lib/ape/handler.rb:31:in `process'/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:159:in ========================== I'm poking around trying to figure out this manifest thing, thought I'd post this while I do that in case someone says "Oh, that's obvious" -Tim From david.calavera at gmail.com Fri Jul 4 03:51:20 2008 From: david.calavera at gmail.com (David Calavera) Date: Fri, 4 Jul 2008 09:51:20 +0200 Subject: [Ape-development] Recent Ape not re-entrant? In-Reply-To: <517bf110807031622u21318073mef59a5c738a2dfd5@mail.gmail.com> References: <517bf110807031622u21318073mef59a5c738a2dfd5@mail.gmail.com> Message-ID: It seem that the check_manifest method deleted the class fields moreover the variable field. I've fixed and I've released a new version of the gem because I think is a critical bug. On Fri, Jul 4, 2008 at 1:22 AM, Tim Bray wrote: > I'm using Ape to debug a server implementation... works fine first > time I run it, crashes 2nd time: > ======================= > The Ape says: > > http://localhost:4444/app/atom/service > > Summary: 1 error, 0 warnings > > 1. TESTING: Service document and collections. > 2. ? Retrieval of Service Document: it exists and is served > properly.[Dialog] > 3. Schema validation is just available building the ape with jruby. > 4. > > Found these collections: > * 'Entries' accepts application/atom+xml;type=entry > * 'Media' accepts */* > 5. ! Ouch! Ape fall down go boom; details: haven't been setted > Ape::ValidationError > ./bin/../lib/ape.rb:147:in > `check_manifest'./bin/../lib/ape.rb:159:in > `check_validator'./bin/../lib/ape.rb:75:in > `might_fail'./bin/../lib/ape.rb:74:in `each'./bin/../lib/ape.rb:74:in > `might_fail'./bin/../lib/ape.rb:59:in > `check'./bin/../lib/ape/handler.rb:31:in > > `process'/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.4/lib/mongrel.rb:159:in > ========================== > I'm poking around trying to figure out this manifest thing, thought > I'd post this while I do that in case someone says "Oh, that's > obvious" > -Tim > _______________________________________________ > Ape-development mailing list > Ape-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/ape-development > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tbray at textuality.com Fri Jul 11 09:59:08 2008 From: tbray at textuality.com (Tim Bray) Date: Fri, 11 Jul 2008 06:59:08 -0700 Subject: [Ape-development] Thinking about how to use Ape Message-ID: <517bf110807110659h3aa0667s8dc8b64b07c74d33@mail.gmail.com> I've got meta-publication (a collection that you post to do collection CRUD) basically working in mod_atom, and I've been using the Ape, but it's kind of clumsy, and with the new metaprogramming hooks (invokers and validators and so on) I'm wondering what hooks might make all this more useful. This is a request for ideas. Here's how it works. A meta-collection ("meta" for short) has a special attribute mod-atom:meta="service" on its root. If you post an atom:entry to it, it creates a couple of collections for entries and media and a service doc to wrap them, let's call that a sub-pub or sub for short. So what I do with the Ape is: - manually run it against the meta-pub. - peek in the logs to see where one of the the newly-created pub went (since the Ape insists on cleaning up its creations) - manually run the ape against the newly-created Pub (and expect everything to pass). Now, the next thing I'm going to do when I finish cleaning up this code is run some benchmarks. So I think what I really want is a nice programmatic way to access the Ape code to look inside service docs and collection docs, and then to issue POSTs and PUTs and GETs and DELETEs. Basically, find the collection with the mod-atom:meta attribute, run a POST against it to create a new pub, then, run Ape#check against the newly-created service doc, then DELETE the new publication. Then for benchmarking, I want to create a huge number of new pubs and run a huge number of random CRUD operations against them. So if the Ape class gets a few more methods for this stuff, I just need to have an Ape object for the meta and one for each of the subs and with access to the CRUD methods, it should be pretty easy. Now that I've written this, I've convinced myself that it shouldn't be complicated, so I'll go start looking at how to do it. I suspect that a general-purpose programmable Atompub client will be quite a useful thing, and Ape is most of the way there now. -Tim From david.calavera at gmail.com Fri Jul 11 17:26:39 2008 From: david.calavera at gmail.com (David Calavera) Date: Fri, 11 Jul 2008 23:26:39 +0200 Subject: [Ape-development] Thinking about how to use Ape In-Reply-To: <517bf110807110659h3aa0667s8dc8b64b07c74d33@mail.gmail.com> References: <517bf110807110659h3aa0667s8dc8b64b07c74d33@mail.gmail.com> Message-ID: Well, I've followed the thread into the atom list XD. Although now the ape is closer a testing tool instead of a library, you can also use the core classes. Nevetheless I suppose we should improve and publish the rdoc. Btw, I send you a piece of code that I think it could be help you: http://pastie.org/232348 On Fri, Jul 11, 2008 at 3:59 PM, Tim Bray wrote: > I've got meta-publication (a collection that you post to do collection > CRUD) basically working in mod_atom, and I've been using the Ape, but > it's kind of clumsy, and with the new metaprogramming hooks (invokers > and validators and so on) I'm wondering what hooks might make all this > more useful. This is a request for ideas. > > Here's how it works. A meta-collection ("meta" for short) has a > special attribute mod-atom:meta="service" on its root. If > you post an atom:entry to it, it creates a couple of collections for > entries and media and a service doc to wrap them, let's call that a > sub-pub or sub for short. So what I do with the Ape is: > > - manually run it against the meta-pub. > - peek in the logs to see where one of the the newly-created pub went > (since the Ape insists on cleaning up its creations) > - manually run the ape against the newly-created Pub (and expect > everything to pass). > > Now, the next thing I'm going to do when I finish cleaning up this > code is run some benchmarks. > > So I think what I really want is a nice programmatic way to access the > Ape code to look inside service docs and collection docs, and then to > issue POSTs and PUTs and GETs and DELETEs. Basically, find the > collection with the mod-atom:meta attribute, run a POST against it to > create a new pub, then, run Ape#check against the newly-created > service doc, then DELETE the new publication. Then for benchmarking, > I want to create a huge number of new pubs and run a huge number of > random CRUD operations against them. > > So if the Ape class gets a few more methods for this stuff, I just > need to have an Ape object for the meta and one for each of the subs > and with access to the CRUD methods, it should be pretty easy. > > Now that I've written this, I've convinced myself that it shouldn't be > complicated, so I'll go start looking at how to do it. > > I suspect that a general-purpose programmable Atompub client will be > quite a useful thing, and Ape is most of the way there now. -Tim > _______________________________________________ > Ape-development mailing list > Ape-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/ape-development > -- David Calavera http://www.thinkincode.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From tbray at textuality.com Mon Jul 14 19:37:55 2008 From: tbray at textuality.com (Tim Bray) Date: Mon, 14 Jul 2008 16:37:55 -0700 Subject: [Ape-development] Thinking about how to use Ape In-Reply-To: References: <517bf110807110659h3aa0667s8dc8b64b07c74d33@mail.gmail.com> Message-ID: <517bf110807141637u5581b0b6h215f692bbeadd270@mail.gmail.com> 2008/7/11 David Calavera : > Although now the ape is closer a testing tool instead of a library, you can > also use the core classes. Nevetheless I suppose we should improve and > publish the rdoc. > > Btw, I send you a piece of code that I think it could be help you: > > http://pastie.org/232348 Here's a little pastie with my thinking... I don't think something like this would be too hard to build. I think that the Ape could quite easily become the Ruby standard Atompub client library, not just the testing library. http://pastie.org/233389 -Tim From tbray at textuality.com Tue Jul 15 10:52:10 2008 From: tbray at textuality.com (Tim Bray) Date: Tue, 15 Jul 2008 07:52:10 -0700 Subject: [Ape-development] libxml Message-ID: <517bf110807150752j4a2a7ff1m8cd2de4fc9b772b5@mail.gmail.com> I hate REXML more than you, but please don't change to libxml... it won't work on JRuby. Thanks, Tim From david.calavera at gmail.com Tue Jul 15 11:02:50 2008 From: david.calavera at gmail.com (David Calavera) Date: Tue, 15 Jul 2008 17:02:50 +0200 Subject: [Ape-development] performance REXML vs libxml-ruby Message-ID: Hi, I've created a branch where I migrated the xml code to libxml-ruby. I've ran a benchmark test against the Joe Gregorio apptestsite. I endorse the results: ape-trunk$ ruby benchmark.rb ' http://bitworking.org/projects/apptestsite/app.cgi/service/;service_document ' user system total real 1.950000 0.220000 2.170000 ( 73.387951) ape-libxml$ ruby benchmark.rb ' http://bitworking.org/projects/apptestsite/app.cgi/service/;service_document ' user system total real 0.570000 0.090000 0.660000 ( 88.123802) -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.calavera at gmail.com Tue Jul 15 16:36:47 2008 From: david.calavera at gmail.com (David Calavera) Date: Tue, 15 Jul 2008 22:36:47 +0200 Subject: [Ape-development] Thinking about how to use Ape In-Reply-To: <517bf110807141637u5581b0b6h215f692bbeadd270@mail.gmail.com> References: <517bf110807110659h3aa0667s8dc8b64b07c74d33@mail.gmail.com> <517bf110807141637u5581b0b6h215f692bbeadd270@mail.gmail.com> Message-ID: I'd say that methods can be really useful although I find the lazy loading a little weird and I absolutly agree that we don't need the ape class. On Tue, Jul 15, 2008 at 1:37 AM, Tim Bray wrote: > 2008/7/11 David Calavera : > > > Although now the ape is closer a testing tool instead of a library, you > can > > also use the core classes. Nevetheless I suppose we should improve and > > publish the rdoc. > > > > Btw, I send you a piece of code that I think it could be help you: > > > > http://pastie.org/232348 > > Here's a little pastie with my thinking... I don't think something > like this would be too hard to build. I think that the Ape could > quite easily become the Ruby standard Atompub client library, not just > the testing library. > > http://pastie.org/233389 > > -Tim > -- David Calavera http://www.thinkincode.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From tbray at textuality.com Sat Jul 19 12:38:17 2008 From: tbray at textuality.com (Tim Bray) Date: Sat, 19 Jul 2008 09:38:17 -0700 Subject: [Ape-development] What does rake do? Message-ID: <517bf110807190938x77d2887ft95f4b898f68b4f41@mail.gmail.com> If I type "rake test" I get a messy blow-up. There are a lot of testfiles. What's the setup? -Tim From david.calavera at gmail.com Sat Jul 19 14:16:15 2008 From: david.calavera at gmail.com (David Calavera) Date: Sat, 19 Jul 2008 20:16:15 +0200 Subject: [Ape-development] What does rake do? In-Reply-To: <517bf110807190938x77d2887ft95f4b898f68b4f41@mail.gmail.com> References: <517bf110807190938x77d2887ft95f4b898f68b4f41@mail.gmail.com> Message-ID: <88E501AC-480E-4460-8A55-773C1F0607E3@gmail.com> There isn't a setup file. It executes all the test files under test/ unit. You can look at Rakefile. Enviado desde mi iPhone El 19/07/2008, a las 18:38, "Tim Bray" escribi?: > If I type "rake test" I get a messy blow-up. There are a lot of > testfiles. What's the setup? -Tim > _______________________________________________ > Ape-development mailing list > Ape-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/ape-development From tbray at textuality.com Sun Jul 20 17:40:27 2008 From: tbray at textuality.com (Tim Bray) Date: Sun, 20 Jul 2008 14:40:27 -0700 Subject: [Ape-development] Collections Message-ID: <517bf110807201440w31f1893bvc4fc2aee0f60cee0@mail.gmail.com> I think I realized why I kept re-re-re-re-factoring. There are two entirely different things, here. The first is the element in the service doc, the second is the thing that you send HTTP messages to do resource CRUD. The first should have an accept? method, the second post/put/delete methods. Ape::Collection should be the second, since that's at the core of the protocol, with feed-paging methods as well as the CRUD. It's probably worth having a separate class, call it ServiceColl or CollElement, for the second, because that's a good place to put accept? and also (later) accept_cat? - so accept? becomes accept_type? Sigh, blowing up lots of unit tests :( -T From tbray at textuality.com Mon Jul 21 18:55:56 2008 From: tbray at textuality.com (Tim Bray) Date: Mon, 21 Jul 2008 15:55:56 -0700 Subject: [Ape-development] ape_server in debug mode? Message-ID: <517bf110807211555x64b84319q73a24c71089e1b98@mail.gmail.com> I'm a mongrel n00b. Is there a way to run ape_server in debug mode so it'll reload changed .rb files? -T