Ringobot log - RingoJS IRC channel: #ringojs on irc.freenode.net
2010-05-11:
[0:44] <ringostarr> 902c517 Andreas Bolka: Fix whitespace[0:44] <ringostarr> 3e207d2 Andreas Bolka: Extend docs for the io module as per CommonJS IO/A
[0:52] <oravecz> From webapp.js: var configId = env['ringo.config'] || 'config';
[0:52] <oravecz> how is ringo.config set?
[0:56] <earl> it typically is not
[0:57] <earl> ringo.config in the jsgi env points to a module name to be used as config module
[0:58] <earl> typically the default 'config' is used
[0:59] <oravecz> just trying to figure out the nuances...how do properties on env get set?
[1:00] <earl> not sure what you mean?
[1:01] <earl> most jsgi properties are set by the jsgi environment
[1:02] <earl> which are the java classes in org.ringojs.jsgi, in our case
[1:02] <earl> JsgiEnv's ctor in particular, initialises a standard jsgi environment
[1:03] <earl> besides that, jsgi "middleware" might set custom env properties
[1:27] <oravecz> i see, so env['ringo.config'] is set to moduleId in jsgi.js, thx
[6:44] <gmosx> good morning...
[8:12] <ringostarr> 2114fa2 Hannes Walln?fer: Grow output buffers as needed, allow encoder/decoders to be connected to streams, implement Decoder.readLine()
[8:12] <ringostarr> e639c5d Hannes Walln?fer: Use ringo/encoding in TextStream, make line iteration work, add MemoryStream class for in-memory streams.
[8:12] <ringostarr> 0bbc90a Hannes Walln?fer: Make MemoryStream.read() and skip() work
[8:18] <ringostarr> 6be185a Hannes Walln?fer: Use dedicated threads to pump streams in ringo/subprocess.
[8:31] <ringostarr> 3075e0c Hannes Walln?fer: Destructuring require
[8:31] <ringostarr> 86a70e1 Hannes Walln?fer: Make JSGI REQUEST_METHOD property writable to make MethodOveride middleware work
[9:09] <hannesw> so is everybody fine with making the switch to JSGI 0.3?
[9:09] <gmosx> yeah...
[9:10] <hannesw> gmosx won't that break your and jack's middleware?
[9:10] <gmosx> is the jsgi0.3 branch fully working?
[9:10] <gmosx> I will convert it to jsgi0.3
[9:10] <hannesw> there's a minor problem with retried requests
[9:10] <gmosx> just let me know that the jsgi0.3 branch is complete and I will port my code (and report problems ;-))
[9:11] <gmosx> retried requests?
[9:12] <hannesw> that's a feature of ringo you can throw {retry: true} and request evaluation will be restarted.
[9:12] <gmosx> where is that useful?
[9:13] <hannesw> we use that to restart evaluation with a different optimization level, e.g. for things that require optimization level -1 such as the profier
[9:13] <gmosx> ah
[9:13] <hannesw> http://ringojs.org/demo/logging?profile=1
[9:13] <gmosx> ok... I don't need this for the time beeing...
[9:13] <hannesw> apart from that, it should be working
[9:14] <gmosx> so I will have to pull ringo/jsgi3 and merge with master?
[9:14] <hannesw> well i will merge soon anyway
[9:14] <gmosx> then I 'll wait for the merge...
[9:14] <gmosx> another thing...
[9:14] <hannesw> but i think writable request method is not yet implemented on jsgi-0.3, so better wait :)
[9:14] <gmosx> i 'll wait ;-)
[9:15] <gmosx> another thing, I understand you added some async stuff, does this mess with appengine?
[9:15] <hannesw> no, it probably just won't work, as appengine doesn#t support it
[9:15] <hannesw> you shouldn't have any problems though
[9:15] <gmosx> ok
[9:52] <ringostarr> 9a173ff Hannes Walln?fer: Support Array arguments in Binary.concat() and improve conversion from Array in Binary constructor.
[12:32] <robi42> i'm fine with upgrading to jsgi 0.3 impl (as long as it works) :)
[12:32] <robi42> hannesw, is ringo's promise api subject to change?
[12:32] <hannesw> robi42 no if you ask me
[12:32] <hannesw> yes i think if you ask earl
[12:33] <robi42> thought about posting a little example following your gist
[12:33] <hannesw> if more people have a problem with it, we can change it
[12:33] <hannesw> +1
[12:33] <robi42> to wet people's appetite, so to speak ;)
[12:33] <hannesw> something long-pullish would be cool
[12:33] <hannesw> err... pollish :)
[12:33] <robi42> :)
[12:34] <hannesw> finally fixing file upload here
[12:34] <robi42> for the time being i'll just start with your gist
[12:34] <robi42> then something more "useful" as a follow-up or so
[12:44] <olegp_> hey guys, further to our chat the other day, I've got a ringo-admin "war" script, which packages up a ringojs app as a webapp archive
[12:44] <olegp_> http://ringojs.pastebin.com/WgtXUuLV
[12:44] <olegp_> it needs to be cleaned up a bit, but the functionality is there, if anybody wants to incorporate it into the project
[12:44] <olegp_> things that need to be cleaned up are:
[12:45] <olegp_> 1) removed commented out native interface
[12:45] <olegp_> 2) move zip method into zip.js ?
[12:45] <olegp_> 3) consolidate the copyTree, copyJars and other methods which are copied straight from create.js
[13:12] <robi42> fyi: http://log.robert42.com/6 (feedback welcome)
[13:13] <robi42> olegp_, awesome!
[13:16] <olegp_> also it takes the current dir youre in as the webapp dir root, which may not be too clear from the help
[13:16] <olegp_> and the logic for figuring out whether it should create a WAR or just copy stuff to a dir is determined by the path provided
[13:17] <olegp_> if it sees an extension, it creates a war, otherwise it assumes you want to just copy all the files to a directory
[13:17] <olegp_> should maybe make that more explicit via an option
[13:50] <robi42> oberhamsi: thumbs up for the tutorial wiki page, great stuff! :)
[13:50] <oberhamsi> yep thanks
[13:50] <oberhamsi> want something to lure php devs hehe
[13:50] <robi42> :)
[13:51] <robi42> anyway, we need to have some more extensive "getting started" info provided
[13:52] <robi42> it's not enough if only the handful of us knows how cool ringo is, i guess ;)
[13:52] <robi42> know*
[13:53] <earl> robi42, re promise api: no, i don't want it to change either
[13:53] <robi42> ok
[13:53] <earl> robi42: i'd only like to change the jsgi-side of handling promises
[13:53] <robi42> ah ok, i see
[13:54] <robi42> so the interface wouldn't be touched by that then
[13:54] <earl> hannes' example gist would still work
[13:54] <robi42> ok
[13:55] <earl> the only thing i'd like to add, is that you'd also be allowed to directly return the "deferred" object you get from calling defer()
[13:56] <earl> so that you don't _have_ to write `return response.promise` but also can simply write `return response`
[13:57] <robi42> ah, would that be possible to allow both ways?
[14:01] <earl> yes, i think so
[14:03] <earl> i think adding `if (typeof result.promise.then === "function) result = result.promise;` after line 70 of ringo/jsgi.js should suffice
[14:04] <earl> (module typos)
[14:04] <earl> (modulo*, damn ....)
[14:06] <robi42> ok, i see
[14:44] <robi42> oberhamsi: in your tutorial there's `Foo.query().slice(from, to)` mentioned
[14:44] <robi42> is that an api proposal, so to speak? :)
[14:44] <oberhamsi> ops, no that needs fixing
[14:44] <oberhamsi> but.. not the worst accidental proposal i ever made
[14:45] <robi42> :)
[14:45] <oberhamsi> query().forEach
[14:45] <robi42> btw, hibernate currently supports limit(int), offset(int) and range(from, to)
[14:46] <oberhamsi> great, i will switch to hibernate for tutorial. more conventional
[14:46] <robi42> :)
[14:46] <robi42> forEach's actually already supported since what you get is an array, no?
[14:47] <oberhamsi> ah i wrote query().select().slice(.. and that works of course
[14:47] <robi42> ah, i see
[14:47] <robi42> sure
[14:48] <oberhamsi> :)
[14:48] <oberhamsi> in hibernate it do: query().range(0,20).select() ?
[14:48] <robi42> exactly
[14:49] <robi42> so you could "prepare" a query and "execute" it later, so to speak
[14:49] <oberhamsi> aha okay.
[14:50] <robi42> that's the nice thing about select() :)
[14:50] <oberhamsi> my first thought was to replace select() with forEach, range(), but that doesn't make sense due to select('fieldname') possibility
[14:50] <oberhamsi> ^^ and the prepare aspect
[14:50] <robi42> right :)
[15:06] <ringostarr> 74aacc6 Hannes Walln?fer: Do not unset buffer in MemoryStream.close(), it's needed for retrieving content, plus minor fixes.
[15:06] <ringostarr> ff7bd79 Hannes Walln?fer: Fix Stream.write() interpreting third argument as length instead of end index
[15:06] <ringostarr> 2b2c3f5 Hannes Walln?fer: Mild refactoring and bug fixes for fileupload.
[15:06] <ringostarr> 7fd34ca Hannes Walln?fer: Do not copy buffer in MemoryStream.content getter and use buffer.length as content length.
[15:08] <emilis_info> uhm... what should I use instead of "file" module?
[15:08] <hannesw_> emilis_info: fs
[15:08] <hannesw_> it's the same, only better :)
[15:12] <emilis_info> hmm ok :)
[15:23] <hannesw_> olegp_ create-war script looks good
[15:23] <hannesw_> there are a few things that can be done in ringo natively
[15:24] <hannesw_> like java.lang.reflect.Array.newInstance(java.lang.Byte.TYPE, 1024);
[15:24] <hannesw_> ~ new ByteArray(1024)
[15:24] <olegp_> ok
[15:24] <olegp_> would it be worth adding that whole lot to zip.js?
[15:25] <hannesw_> yes, i'd like to have support for creating zip files
[15:25] <hannesw_> i think this could become a new option to ringo-admin create, right?
[15:26] <hannesw_> like ringo-admin create -w/--war
[15:26] <hannesw_> what do you think?
[15:26] <olegp_> yeah, I had it inside create to start off with
[15:26] <olegp_> but then realized its not a project setup task, but rather a packaging one
[15:26] <olegp_> so separated it out into a separate js file
[15:26] <hannesw_> ah, ok. true
[15:27] <olegp_> so maybe put it into a "package.js" file or something ... and leave room for extending it to package app up as a deb or whatever
[15:27] <hannesw_> I'll give it a try
[15:28] <olegp_> although package may not be the best name, since it overlaps with the concept of commonjs packages
[15:28] <hannesw_> yes
[15:28] <olegp_> distribute maybe?
[15:28] <olegp_> oh also a quick note: I created a webapp skeleton app, which is just the appengine app without the appengine specific stuff
[15:31] <hannesw_> ok
[15:31] <hannesw_> we definitley need a place to put all our skeletons or app templates or whatever we call them
[15:33] <olegp_> I was thinking that there should only be one format of ringo app for dev
[15:33] <olegp_> the fact that you can set up an appengine layout or standard layout is a bit confusing
[15:34] <hannesw_> agreed. problem is that google app engine is so different (special apis for everything) that you need to develop inside it
[15:34] <olegp_> if somebody does want it in appengine/webapp format, they could first create a ringo skeleton app, then call "distribute" on it to turn it into an appengine/webapp format
[15:34] <olegp_> yeah ..
[15:34] <hannesw_> but i think appengine is a special case
[15:37] <hannesw_> so.. a lot of last minute stuff i committed today
[15:37] <hannesw_> i know that might be a bit worrying
[15:38] <hannesw_> given tomorrow's release
[15:38] <hannesw_> but i think it's better to have the APIs in the release, maybe mildly broken, than introduce new APIs immediately after release
[15:39] <hannesw_> io.MemoryStream will definitely be very useful (it already is)
[15:39] <hannesw_> is everybody happy with the name "MemoryStream"?
[15:39] <hannesw_> is it clear what it is?
[15:40] <earl> yes, sounds good
[15:43] <robi42> yep, +1 from my side for that as well.
[15:44] <robi42> just noticed there are a few typos in MemoryStream's jsdoc header
[15:47] <hannesw_> i guess there are, and black holes too :)
[15:47] <robi42> :)
[16:03] <earl> ha!
[16:15] <gmosx> hannes?
[16:16] <gmosx> I pulled from the latest git repo, and now request.params seems to be not working (at least for POST requests)
[16:16] <gmosx> the hash is empty...
[16:16] <gmosx> any ideas?
[16:19] <hannesw_> gmosx will look into it
[16:23] <gmosx> thanks
[16:27] <hannesw_> gmosx everything works normal for me
[16:27] <hannesw_> have you rebuilt the jar file?
[16:27] <gmosx> hmm...
[16:27] <gmosx> yeah, let me check the symlinks...
[16:27] <hannesw_> is this a normal form or a file-upload form?
[16:28] <gmosx> hmm this is an ajax POST request
[16:28] <gmosx> $.post(...)
[16:28] <gmosx> jquery...
[16:29] <gmosx> request.params is {} (empty)
[16:29] <gmosx> (the methodoveride works fine btw, thanks)
[16:29] <gmosx> this used to work...
[16:33] <gmosx> have you merged the jsgi0.3 stuff?
[16:33] <hannesw_> hm, i just tried a project where i use jquery $.post() and it's working
[16:33] <hannesw_> no, not yet
[16:33] <gmosx> ah, annoying... :(
[16:34] <gmosx> let have a better look...
[16:36] <gmosx> hmm some middleware seems to mangle the request...
[16:36] <hannesw_> ahhh
[16:36] <hannesw_> maybe it's because of the method (POST) not being POST anymore?
[16:37] <hannesw_> i think we're only parsing input if request is post...
[16:38] <hannesw_> http://github.com/ringo/ringojs/blob/master/modules/ringo/webapp/request.js#L86
[16:38] <hannesw_> maybe try to comment out that line
[16:39] <gmosx> line 86?
[16:55] <gmosx> hmm there is a problem when calling both jacks Request(env) and Ringo's Request(env)
[16:55] <gmosx> anw, will fix later...
[17:09] <gmosx> hannesw: still here?
[17:14] <gmosx> I think I found the problem
[17:14] <gmosx> if I call new Request(env) 2 times
[17:14] <gmosx> the second time request.params is empty
[17:16] <gmosx> new Request(env) should be idempotent (and cached in env for multiple invocations)
[17:27] <bailey_> Hi All- I'm new to ringo, but excited by it's possibilities. I'm currently trying to get RIngoJS to connect to MongoDB...any suggestions?
[17:28] <gmosx> hey bailey_, welcome...
[17:29] <gmosx> no idea about mongodb though, sorry :(
[17:29] <earl> bailey_: we don't have a mongodb connector for ringojs at the moment
[17:29] <earl> best idea would probably to look for a nice java lib and wrap it
[17:30] <earl> using java libs from ringojs is usually nice and easy
[17:30] <bailey_> Hi guys, thanks for the replies! I'm installed narwhal-mongodb as a package (which uses a javalib) but it's now throwing a java error.
[17:31] <bailey_> I'll have to play around with it for a bit and see what we can find.
[17:31] <earl> you could post the error at http://ringojs.pastebin.com/
[17:34] <bailey_> thnx earl, I'll get ahold of the narwhal-mongodb creator and see what light he can shed. if there's still an issue I'll post it.
[17:35] <gmosx> perhaps this will help
[17:35] <gmosx> http://github.com/gmosx/narwhal-lib
[17:35] <gmosx> narwhal stuff that works with ringojs
[17:36] <robi42> nice
[17:37] <bailey_> ah cool
[17:39] <robi42> bailey_, there's an official mongodb java driver lib; so probably wrapping that would be a way to go: http://api.mongodb.org/java/2.0-pre1-/
[17:41] <bailey_> great. I'll give that a shot and see what we can spin up. thanks again
[20:46] <bailey_> Hi all- Just an update from my earlier question. After installing the latest narwhal-mongodb package, the path to the mongo jar needed updated in the package.json file (was missing "jars/" before the jar file name), and Voila, connecting and querying!
[20:47] <earl> bailey_: good to know!
