IRC log for 2008-05-13

0 views
Skip to first unread message

David Leal

unread,
May 13, 2008, 7:05:01 PM5/13/08
to me...@googlegroups.com
--- Log opened Tue May 13 11:08:38 2008
12:37 <+hot-dog> how i can make a route to send a send a file there is in public ? exemple r.match('/'). ??
12:51 <+Somebee> does merb run on 1.9 yet?
12:52 <+aflatter> Somebee: I think it does
12:52 <+Somebee> aflatter: ok
12:53 <+aflatter> Somebee: oops. No. I meant rubinus. Sorry
12:53 <+Somebee> aflatter: ah, ok. yeah, I've heard that to
12:53 <+Somebee> some of the new 1.9 stuff seems very cool, so I hope rubinius and the rest will follow and implement it :/
12:57 <+aflatter> didnt really look at it yet :)
13:00 <+antares> Somebee: MRI have to fix their development process before they get back to their "cool features"
13:00 <+antares> 1.8.7 and 187 p114-117 are all full of regressions because they have no CI, do not use RubySpec
13:01 <+antares> Somebee: but Rubinius is close to 1.8.6 completeness, then phase of optimization and 1.9 :)
13:02 <+Somebee> antares: :-) But could rubinius ever compare with 1.9 on speed etc? I've read depressing stuff about it :/
13:02 <+antares> Somebee: read stuff on Smalltalk VMs
13:02 <+antares> Somebee: and stop reading idiots who moan
13:02 <+Somebee> hehe
13:02 <+antares> Somebee: JRuby used to be lagging behind, now 1.1.1 is the fastest Ruby implmentation out there
13:03 <+antares> Somebee: I don't want to be rude but I bet people who write "depressing stuff" on Rubinius did not work on any Ruby VM at all
13:04 <+Somebee> antares: the last I read was from the creator of jruby I think. Not that it would never be fast, but that rubinius had some huuge challenges ahead to begin to compare in speed
13:04 <+Somebee> this might not be the channel to discuss this :P
13:04 <+antares> Somebee: last thing, even if Rubinius will be just a bit faster than today's 1.8.6 it has so many neat things to adopt it instead of MRI
13:05 <+antares> Somebee: Charles meant that Rubinius is not actually Ruby in Ruby, but it can be faster than JRuby, the question is how hard you try to use best algorithms
13:05 <+antares> Somebee: GC in Rubinius is faster this means Rails performance may be better on Rubinius just because of that :)
13:06 <+Somebee> antares: thanks for clearing things up :-) I'm really looking forward to both 1.9 and rubinius :P
13:10 <+iamaleksey> and I've heard its GC doesn't screw copy-on-write forking, which is good, given the amount of memory an instance of mongrel+rails needs
13:12 <+antares> iamaleksey: MRI GC is very naive. Rubinius has 2 GCs actually. JVM has like 15 these days but having more advanced Baker algorithm and kind of "adaptive" GC is good indeed.
13:17 <+iamaleksey> antares: yeah. I just want to be able to just fork a few instances of an app, without each using half of my 256 vps memory.
14:05 <+sam_> hi all. can someone take a look a this conf file and let me know what I might be doing wrong? http://pastie.caboo.se/196028 My problem is that I'm trying have requests for files like jpgs bypass merb althogether, but what i've got here is not working for me. I'm starting merb by cd'ing to my merb directory and issuing : sudo merb --port 9000 -e production -h 0.0.0.0
14:07 <+sam_> oh, and i'm using apache 2
14:20 <+macmaN6789> haml is worth it?
14:28 <+dramsay> macmaN6789: i think that's a pretty subjective question - some people love haml, others not so much
14:30 <+iamaleksey> macmanN6789: I like my views being as close to html as possible, but it's just me. If you are writing both backend and frontend by yourself, give it a try
14:31 <+Skip> does sequel migrations work for anyone off of git?
14:32 <+Skip> I get errors like this: uninitialized constant Organisation::User
14:32 <+Skip> where Organisation and User are both models..
14:33 <+Skip> so it looks like the model files aren't loading correctly
14:53 <+sam_> ok, i'm going nuts here, I have a swf that i want to serve from my app like acme.com/swfs/test.swf how can I avoid the request being served by merb?
15:02 <+djwonk> sam_: you have a proxy in front?
15:02 <+djwonk> sam_: like nginx?
15:03 <+djwonk> (proxy may not be the right word)
15:14 <+sam_> no
15:14 <+sam_> using apache and mod_proxy
15:21 <+djwonk> sam_: how about telling apache what files to serve directly?
15:40 <+Somebee> any idea what this problem might be? http://pastie.caboo.se/196087 - started happening after updating to trunk merb+dm right now
15:42 <+Silex> Somebee: what happens when you do x = t.voucher; x.nil?
15:42 <+Silex> (or x.class)
15:42 <+Somebee> x.nil? => true
15:43 <+Somebee> x.class => => DataMapper::Associations::ManyToOne::Proxy
15:43 <+Somebee> ah
15:43 <+Somebee> hmm
15:44 <+Somebee> any suggestions on what to do?
15:45 <+Somebee> maybe I'll just need to du t.voucher.nil?
15:45 <+Somebee> but it doesn't feel natural (maybe because I'm used to AR)
15:53 <+Silex> Somebee: t.voucher.nil? is the only way
16:05 <+the_mug> richc: ping
16:05 <+richc> the_mug: hey
16:05 <+the_mug> hola
16:18 <+subtleGradient> ahoy y'all
16:18 <+afrench> what up?
16:19 <+subtleGradient> just checking out the "Exploring Merb" video
16:19 <+subtleGradient> and I found the returning proc and running it later after the end of the request
16:19 <+subtleGradient> I've been passively looking for some way to do that for a long time
16:20 <+subtleGradient> any docs on how to actually do that?
16:22 <+subtleGradient> how stable is master/trunk?
16:22 <+afrench> subtleGradient: talk you into linking me to the video? I don't think I've seen it yet
16:22 <+subtleGradient> http://rubyhoedown2007.confreaks.com/session02.html
16:22 <+afrench> subtleGradient: pretty stable, though it's always a better strategy to work with the gem
16:22 <+subtleGradient> this is for personal projects. nothing too important
16:22 <+afrench> aah yeah, I have seen that video. it's good, a little old, but good
16:23 <+afrench> subtleGradient: http://www.merbivore.com/documentation.html all the docs you could possibly want
16:24 <+subtleGradient> how well does merb handle shared hosts now? I know rack does fcgi and merb works with rack now...
16:25 <+afrench> I'm not sure. we're doing the dedicated box thing
16:26 <+subtleGradient> ya. probly best
16:27 <+subtleGradient> you using rspec?
16:28 <+afrench> yup
16:28 <+subtleGradient> textmate?
16:28 <+afrench> yup
16:28 <+afrench> git? yup
16:28 <+subtleGradient> you see all the merb tmbundles?
16:29 <+afrench> I have, though I haven't used them
16:29 <+afrench> been doing the merb thing for about 6 months now.....sorta learned to get around without those bundles
16:30 <+subtleGradient> yeah. I did rails back before 1.0. CrazyEgg.com
16:30 <+subtleGradient> after that I've only been doing clientside work.
16:30 <+subtleGradient> I have an updated CSS bundle and javascript bundle and mootools bundle
16:45 <+mcolyer> is Michael Klishin here?
17:19 <+sam_> where do i add mime types?
18:16 <+bbn> hassox -- how does DM handle migrations? or does it?
18:16 <+macmaN6789> doesnt
18:17 <+macmaN6789> just drops everything and recreates
18:17 <+bbn> maybe I'm naive, but that seems spooky
18:17 <+macmaN6789> not really
18:17 <+bbn> not really naive, or not really spooky? :)
18:17 <+macmaN6789> but it can depend i guess
18:17 <+macmaN6789> i think you right about both
18:18 <+jackdempsey> its great for test env :-)
18:18 <+veritas> i just upgraded to merb trunk on -core, -more and -plugins and started getting the following error: /usr/lib/ruby/gems/1.8/gems/merb_datamapper-0.9.2/lib/merb_datamapper.rb:8: uninitialized constant Merb::Orms::DataMapper::Connect::BeforeAppRuns (NameError)
18:18 <+bbn> sure, but production??
18:19 <+Defiler> veritas: DataMapper appears to change its API every 11 seconds or so
18:19 <+veritas> heh
18:20 <+Defiler> You probably need a matching (trunk) version of it as well, assuming it has even been updated to work with merb trunk
18:20 <+veritas> k, thx
18:20 <+jackdempsey> veritas: there's a patch in for that
18:20 <+Defiler> Just a guess, though
18:20 <+jackdempsey> if you want to fix it locally yourself
18:20 <+jackdempsey> its BeforeAppLoads
18:20 <+jackdempsey> not BeforeAppRuns
18:20 <+veritas> ahhh cool
18:27 <+veritas> jackdempsey: that worked well! thanks :)
18:27 <+jackdempsey> np man
18:30 <+Ski1> does merb-core depent on activesupport?
18:30 <+Ski1> depend rather
18:31 <+jackdempsey> it doesn't really, but you might see active_support in some stack traces
18:31 <+jackdempsey> obviously if you're using activerecord....but i've also seen when you do stuff with merb that uses rubigen active support gets brought in as well
18:32 <+Ski1> yeah that's what I'm getting
18:32 <+Ski1> I use Sequel
18:32 <+Ski1> and I get this:
18:32 <+Ski1> /usr/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/active_support/
18:32 <+Ski1> dependencies.rb:489:in `load'
18:32 <+Ski1> /usr/lib/ruby/gems/1.8/gems/merb-core-0.9.4/lib/merb-core/
18:32 <+Ski1> bootloader.rb:333:in `load_file'
18:32 <+Ski1> I'm having issues with Merb loading models correctly during migrations
18:32 <+jackdempsey> yeah TBH at this point i'm not exactly sure whats going on and how its getting hooked it....just haven't had time to look at it
18:34 <+Ski1> any other Sequel users having issues with migrations and models?
18:37 <+macmaN6789> is anyone knowledgeable about singletons
18:38 <+macmaN6789> if i run some sort of service registry (needle) in merb
18:39 <+macmaN6789> does singleton mean that if the registry gets instantiated, every one of my connecting users will get the same instance
18:39 <+macmaN6789> contents will be the same for everyone
18:49 <+mattetti> quick question, how many people get paid to write Merb?
18:50 <+mattetti> to write some Merb projects (not Merb's code itself)
18:50 * ezmobius raises hand
18:51 <+smerickson> i'm using merb at my work. but we aren't technically a merb/ruby shop.
18:53 <+macmaN6789> whats the point of this klass object
18:53 <+macmaN6789> ive seen it created in several source files
18:53 <+macmaN6789> in different places
18:53 <+macmaN6789> why is it named klass all the time?
18:54 <+ezmobius> because 'class' is a resrved word
18:54 <+mattetti> Klass is german for class :p
18:54 <+macmaN6789> klass is estonian for class too
18:54 <+macmaN6789> but.
18:54 <+mattetti> ahahah I was just kidding
18:54 <+macmaN6789> so basically its just to show
18:54 <+macmaN6789> that no special variable name is needed
18:54 <+mattetti> you can't use class or Class
18:54 <+mattetti> it's reserved
18:54 <+macmaN6789> you could say MyClass or something
18:54 <+mattetti> correct
18:54 <+macmaN6789> instead they chose klass
18:55 <+macmaN6789> cause its germanic
18:55 <+mattetti> no
18:55 <+macmaN6789> :)
18:55 <+macmaN6789> jk
18:55 <+mattetti> :p
18:55 <+macmaN6789> klass ftw!
18:55 <+mattetti> it's a convention in the ruby world
18:55 <+macmaN6789> and you are the winner
18:55 <+macmaN6789> that was the answer i was looking for
18:58 <+midget_nuts> das ist mein klass!
19:04 <+taf2> anyone have merb able to log the request path that triggered the application error?
19:05 <+jackdempsey> its not in request ?
19:06 <+jackdempsey> haven't done it specifically myself but i would think you coudl get at it...and if not, i would think thats a valid enhancement
19:07 <+taf2> i guess just increasing log level but that's not what i want... i want on error specific information about how to reproduce the error from the log
19:08 <+taf2> shouldn't be too difficult to add to application.rb
19:08 * taf2 adds
19:08 <+jackdempsey> so taf2 i have an app running
19:08 <+jackdempsey> and hit it at app.com/foob/bar/bam
19:08 <+jackdempsey> then in my not_found action of exceptions i have
19:09 <+jackdempsey> request.inspect as the last line
19:09 <+jackdempsey> result shows a nice hash with this in it
19:09 <+jackdempsey> "PATH_INFO"=>"/foob/bar/bam"
19:09 <+taf2> cool
19:09 <+jackdempsey> is that useful or am i misunderstanding how you need to use/do this
19:10 <+taf2> no yeah that's useful
19:10 <+macmaN6789> did anyone use ruport?
19:10 <+jackdempsey> cool gl
19:11 <+jackdempsey> and nope
19:18 <+xilef> anyone using redcloth or activemerchant with merb?
19:18 <+xilef> seem to have trouble loading these two gems
19:18 <+macmaN6789> i have included redcloth but i havent gotten around to it
19:18 <+macmaN6789> my redcloth loads fine
19:18 <+macmaN6789> RedCloth right?
19:18 <+xilef> yep
19:19 <+xilef> keep getting ' no such file to load' errors
19:19 <+xilef> particularly for AM, have ditched RC for now
19:20 <+macmaN6789> man i need a networked clipboard
19:20 <+macmaN6789> i think that would be fairly easy to do with ruby?
19:20 <+macmaN6789> or perhaps anyone knows any existing pieces
19:20 <+macmaN6789> free
19:21 <+xilef> pastie?
19:21 <+xilef> hah
19:21 <+adelcambre> macmaN6789: You mean like Apple-C on one box then apple-v on another works properly?
19:21 <+macmaN6789> too slow
19:21 <+macmaN6789> exactly
19:21 <+adelcambre> Synergy has a component that does that
19:21 <+macmaN6789> but i need x-platform
19:21 <+macmaN6789> i got mac and windows side by side here
19:21 <+adelcambre> yeah, synergy is probably what you want
19:21 <+xilef> +1
19:21 <+adelcambre> it will let you share mouse/keyboard too
19:22 <+xilef> i use it quite often with windows + linux
19:22 <+adelcambre> http://synergy2.sourceforge.net/
19:22 <+macmaN6789> WOW
19:22 <+macmaN6789> hahahahahahaha
19:22 <+macmaN6789> THATS AMAZING
19:22 <+macmaN6789> and so simple
19:22 <+many> and unencrypted.
19:22 <+macmaN6789> doesnt matter on a lan does it
19:22 <+xilef> but fun to hack others who are using it at work
19:22 <+macmaN6789> and you can always proxy it with openvpn and whatnot i guess
19:22 <+many> if its your lan, no. i use it myself. just thought i mention it
19:22 <+macmaN6789> or ssh tunnel
19:23 <+many> its actually explicitely mentioned in the faq. but nobody nowadays reads faqs, do they?
19:27 <+project_> only if i have a question
19:34 <+macmaN6789> hoooooly shmokies
19:34 <+macmaN6789> im typing this on.... my ma
19:34 <+macmaN6789> mac
19:34 <+macmaN6789> through my windows pidgin
19:34 <+macmaN6789> bring on them lolcats
19:34 <+macmaN6789> thats all i gotta say
19:35 <+macmaN6789> ammmaazzziiing
19:36 <+macmaN6789> hrm
19:36 <+macmaN6789> copypasting doesnt seem to work
19:38 <+project_> who do i have to bribe to get a [merb] prefix on me...@googlegroups.com?
19:40 <+macmaN6789> brin?
19:42 <+eivindu> any other bdd-like suites for ruby than: mspec, rspec, test/spec, and bacon?
19:43 <+eivindu> avaluating them for my master thesis project
19:43 <+jackdempsey> shoulda?
19:43 <+eivindu> jackdempsey: isn't shoulda rails specific?
19:43 <+macmaN6789> yes. it was running synergys inside screen problem
19:43 <+jackdempsey> not sure
19:43 <+macmaN6789> alright no more synergy status reports, thanks
19:44 <+BrianTheCoder> eivindu: there's shoulda
19:45 <+BrianTheCoder> oops
19:45 <+BrianTheCoder> didn't read down before I spoke
19:47 <+eivindu> btw, anyone used starling?
19:52 <+BrianTheCoder> eivindu: I have
19:55 <+mysterio> Hi. I opened two tickets, but they were marked as spam. Why? Urls for tickets: http://merb.lighthouseapp.com/projects/7588-merb-plugins/tickets/111-missed-file-database-yml-sample and http://merb.lighthouseapp.com/projects/7435-merb-more/tickets/134-merb-gen-model-doesn-t-work
19:56 <+antares`> mysterio: I'll have a look. LightHouse tries to be too smart.
19:56 <+mysterio> Ok, thanks
19:58 <+antares`> what is your problem with merb-gen once again?
19:58 <+antares`> I am getting angry every time I have to submit a ticket to LH crew :)
19:58 <+mysterio> merb-gen model doesn't create model stub at all
19:59 <+eltiare_> Hey does anyone have some sites that are running Merb in production?
19:59 <+BrianTheCoder> with which orm?
19:59 <+mysterio> datamapper
19:59 <+BrianTheCoder> which version of datamapper/merb_datamapper?
19:59 <+mysterio> But I think, this is not datamapper problem
20:00 <+mysterio> merb_datamapper (0.9.3) from git
20:01 <+mysterio> I used sake task from http://merb.4ninjas.org/
20:02 <+bbn> i've used starling a lot
20:03 <+project_> bbn: how do you like it?
20:03 <+bbn> it's great
20:03 <+project_> i use drb in a big project... it's good, but clunky
20:04 <+project_> i'll probably dive into it very soon
20:04 <+bbn> my starling project is pretty big
20:04 <+project_> starling that is
20:04 <+bbn> 350,000 users
20:04 <+project_> wow, cool
20:04 <+bbn> lots of traffoc
20:04 <+project_> twitter's is pretty big too :)
20:04 <+bbn> traffic
20:04 <+bbn> indeed
20:04 <+bbn> currently trying to figure out best way to clean up starling spool files
20:05 <+bbn> they accumulate .
20:05 <+project_> hmmm
20:05 <+project_> process them? :)
20:05 <+project_> or do they linger even after being popped?
20:05 <+bbn> they linger
20:06 <+bbn> like a bad date
20:06 <+antares`> mysterio: ok, I'll have a look but merb-gen right now is something that needs a lot of attention.
20:06 <+antares`> How do I protect myself from Lighthouse spam protection?
20:06 <+project_> bbn: that sounds like a big issue indeed
20:16 <+antares`> mysterio: ping
20:17 <+mysterio> antares, ?
20:18 <+mysterio> antares`, what?
20:19 <+antares`> mysterio: please paste full stacktrace for #111 in -plugins.
20:19 <+mysterio> antares`, one minute
20:21 <+jackdempsey> hmm
20:21 <+jackdempsey> isn't 111 technically a bug for the dm people now?
20:21 <+jackdempsey> (not that we can't solve it)
20:21 <+jackdempsey> just brings up how to handle things like this in the future
20:22 <+antares`> jackdempsey: I cannot say until I see what is the root of exception
20:22 <+jackdempsey> yeah
20:22 <+jackdempsey> although i just looked
20:22 <+jackdempsey> inside ~/dm/dm-more/merb_datamapper/lib/merb/orms/data_mapper
20:22 <+jackdempsey> and database.yml.sample does exist
20:22 <+jackdempsey> so, we'll see what the trace says
20:24 <+mysterio> I just put database.sample.yml to proper location... but I can reinstall merb manually from sources and check, that it exists again
20:27 <+antares`> mysterio: it would be helpful
20:28 <+macmaN6789> ok im looking to integrate Needle with merb
20:28 <+macmaN6789> im wondering where i should create the registry
20:29 <+macmaN6789> Application?
20:29 <+macmaN6789> or perhaps global_helpers
20:30 <+jackdempsey> maybe the revision you were using at that particular point was screwy....looks ok from the outside to me
20:30 <+antares`> macmaN6789: wherever you want I think
20:35 <+macmaN6789> but does this means every user will get their own registry object
20:35 <+macmaN6789> i think i need it to be singleton
20:35 <+macmaN6789> since all users need to have the same state of the registry anyway i think
20:37 <+antares> macmaN6789: no idea, I am familiar with needle for 2 minutes or so.
20:38 <+antares> mysterio: if it is really hard for you to reproduce, just tell us
20:39 <+bbn> routing question:
20:39 <+bbn> setting up a new merb app.
20:39 <+bbn> when I remove r.default_routes, merb throws an error at startup
20:39 <+bbn> I am adding a match as follows: r.match('/fb/:callback_path/:controller/:action')
20:40 <+bbn> but r.default_routes has to be in there, or else I get the following error
20:40 <+antares`> bbn: pastie your error please
20:40 <+bbn> ok
20:41 <+mysterio> antares`, wait 5 minutes
20:41 <+bbn> http://pastie.caboo.se/196331
20:42 <+jackdempsey> pastie the router with error and without?
20:42 <+bbn> ok
20:42 <+jackdempsey> seems like a simple parse error
20:42 <+jackdempsey> thats maybe not so obvious
20:42 <+bbn> router with error : http://pastie.caboo.se/196332
20:43 <+bbn> router without error: http://pastie.caboo.se/196333
20:44 <+jackdempsey> as an aside, don't you want a .to on that match?
20:44 <+jackdempsey> also i'd have default routes as the last route listed
20:45 <+bbn> I don't want default routes
20:45 <+jackdempsey> oh
20:45 <+jackdempsey> gotcha
20:45 <+bbn> re: the .to, maybe I do - I wasn't clear on whether I needed it in there or not
20:45 <+bbn> basically I just want the router to ignore the prefix of /fb/ and pass the remaining stuff like regular routes
20:45 <+bbn> oh, and :callback_path is different too.
20:46 <+jackdempsey> ok so i think its because you haven't set a .to on that match
20:46 <+jackdempsey> r.match("/foo").to(:controller => 'foo') is ok for me
20:46 <+jackdempsey> without the .to........ part i get the same error
20:46 <+bbn> but I want the controller, action, etc to be variable
20:47 <+jackdempsey> so maybe a regex?
20:47 <+jackdempsey> r.match(%r[^/(\w+)/(\w+)$]).to(:controller => "home", :cmd => "[1]", :val => "[2]")
20:47 <+jackdempsey> is something i've used
20:47 <+bbn> right, guess I can do that. :(
20:48 <+jackdempsey> i mean how else would you expect it to work?
20:48 <+bbn> would just expect it to match on my string with symbols
20:48 <+bbn> symbols mapped to params, I mean
20:49 <+macmaN6789> hrm the more i think about it... i do need to have my registry somewhere where it stays the same for all clients. kinda like it would be part of merb itself.
20:49 <+jackdempsey> so bbn
20:49 <+jackdempsey> look at how default_routes is implement
20:49 <+jackdempsey> ed
20:49 <+bbn> okay
20:49 <+jackdempsey> http://pastie.caboo.se/196338
20:50 <+bbn> great, I can just use that model. thanks.
20:50 <+jackdempsey> you should be able to do something very similar and get what you want
20:50 <+jackdempsey> yep, np
20:50 <+bbn> I am regex-averse
20:50 <+jackdempsey> hehe
20:50 <+mysterio> antares`, I installed merb and datamapper from git now and database.sample.yml DOES not exist in /usr/lib/ruby/gems/1.8/gems/merb_datamapper-0.9.3/lib/merb/orms/data_mapper/
20:51 <+bbn> or regex-challenged is perhaps a better way to describe myself :)
20:51 <+jackdempsey> you notice that its using a regex there right? :-D
20:51 <+jackdempsey> heheh
20:51 <+bbn> yes
20:51 <+bbn> but one that has been created for me! thanks again.
20:51 <+jackdempsey> ahh, ok cool!
20:52 <+antares> jackdempsey: btw check out new Route class documentation, new low(-er) level router specs and give me some feedback :)
20:53 <+jackdempsey> yeah been seeing you mention that, will definitely check it out
20:55 <+bbn> jackdempsey -- so it appears that all I had to do was append a .to with an empty hash to ake my original way work
20:55 <+bbn> seems like a bit of a wart. to me, at least
20:55 <+jackdempsey> so things actually get routed correctly on those routes?
20:55 <+jackdempsey> i would think specifying a blank to would be bad
20:55 <+bbn> haven't gotten that far yet, but at least merb starts up!
20:56 <+jackdempsey> oh
20:56 <+jackdempsey> hehehe
20:56 <+bbn> the default specifies a blank .to
20:56 <+bbn> look at the pastie you sent me
20:56 <+jackdempsey> oh i see what you mean
20:57 <+antares> jackdempsey: if you specify blank it uses default routes set
20:58 <+bbn> yes, things route correctly for me now
20:58 <+bbn> and no regex! yay!
21:01 <+macmaN6789> whats the point of r.resoures definition
21:01 <+macmaN6789> something to do with restful routes?
21:01 <+macmaN6789> hows that different from the regular routes
21:02 <+macmaN6789> hmmm
21:03 <+macmaN6789> the regular route is /controller/action/resoure_id
21:03 <+macmaN6789> with restful stuff i can add /model/id
21:03 <+Defiler> basically it gives you more routes with fewer lines of routing declaration
21:04 <+Defiler> but they are not custom, so you have to use the naming conventions to take advantage
21:04 <+macmaN6789> not model/id, its still /controller/id
21:04 <+Ski1> can you specify the load order for models?
21:04 <+Defiler> (or set irritating options)
21:04 <+jackdempsey> macmaN6789: if you want to learn about rest check out http://www.amazon.com/RESTful-Web-Services-Leonard-Richardson/dp/0596529260/ref=pd_bbs_sr_1?ie=UTF8&s=books&qid=1210708776&sr=8-1
21:04 <+jackdempsey> or just to start with, lots of articles out there on the web
21:04 <+macmaN6789> im reading actioncontroller resorces right now
21:04 <+macmaN6789> irc is still good for one line advice
21:04 <+jackdempsey> cool
21:05 <+macmaN6789> i might read the whole doc
21:05 <+macmaN6789> and still not know what its really good for
21:05 <+macmaN6789> it looks as if its just a shortcut
21:05 <+macmaN6789> to some default actions in the controller
21:07 <+bbn> antares / jackdempsey -- ok, i've looked at the code in router.rb and it's a little opaque (to me) in terms of what the match function returns that is called by the .to method
21:08 <+bbn> it would be an improvement not to have to append a .to({}) at the end of matched routes, but maybe it's more hassle than it's worth. I don't have a lot of perspective.
21:08 <+antares> bbn: it returns Behavior instance if you are interested
21:08 <+langenberg> evening
21:08 <+antares> bbn: give me an example of what you do now and what you'd like to be able to do
21:08 <+antares> langenberg: evening
21:08 <+bbn> okay antares:
21:09 <+bbn> pastie of what I do now: http://pastie.caboo.se/196355
21:09 <+bbn> pastie of what I'd like to be able to do: http://pastie.caboo.se/196356
21:10 <+bbn> so it looks like the Behaviour model doesn't create a Route unless the .to method is called
21:10 <+bbn> in the match
21:10 <+bbn> sorry, after the match
21:11 <+antares> bbn: looks reasonable, submit it to LH please. I am not sure how simple it would be with existing router that nobody'd like to change significantly once we close to 1.0 :)
21:12 <+bbn> okay
21:12 <+antares> bbn: Behavior only creates route if you call to or to_route
21:12 <+antares> Yurik: hey
21:20 <+macmaN6789> what exactly is a part controller?
21:21 <+bbn> antares: submitted. thanks
21:24 <+langenberg> Oh I really like the way Merb::Controller uses the inherited hook.
21:24 <+macmaN6789> whats speial about it
21:24 <+grenek> Hi, if you want add some action in different view(s) , different controller , like write one, use any
21:24 <+langenberg> No I can just put a bunch of controllers in a special subdir without hassle
21:24 <+langenberg> now*
21:25 <+antares> bbn: thank you
21:26 <+grenek> excelent example part controller in slideshare , find "merbintro"
21:30 <+macmaN6789> ok looking
21:31 <+grenek> parts is someting beyond controllers
21:34 <+macmaN6789> what is that like a predefined query of some sort?
21:35 <+macmaN6789> so if you'd GET /articles/recent
21:35 <+macmaN6789> thats the part it would jump to
21:37 <+macmaN6789> hmmm no it seems
21:37 <+context> ummm
21:37 <+macmaN6789> he's doing a whole lot of throw - catching content
21:38 <+antares> macmaN6789: parts have to be manually called inside actions
21:38 <+macmaN6789> hrm. maybe its late at night.. kinda hard to visualize partial vs parts
21:38 <+jackdempsey> a partial is simply view code
21:39 <+jackdempsey> a part brings together more than that (controller stuff)
21:39 <+context> so a part is like a before_filter ?
21:41 <+antares> context: no, they are pieces of code (controller, views, models) that you call to get a string any way you like
21:41 <+jackdempsey> http://yehudakatz.com/2007/09/06/merbs-parts-are-pretty-rocking-too/
21:42 <+antares> so they can render a partial and insert content into your template, or just give you pieces of JSON or XML you manipulate later, etc
21:42 <+antares> jackdempsey: I personally think that post of Yehuda only confuses people :)
21:43 <+jackdempsey> oh really?
21:43 <+antares> it has what I call synthetic example
21:43 <+jackdempsey> feels like at least it'd give the basic info which people don't have yet
21:43 <+jackdempsey> synthetic in that its not really something you'd do right?
21:43 <+antares> jackdempsey: yes, not real life example
21:43 <+antares> jackdempsey: I think good example of part would be a login part
21:44 <+jackdempsey> yeah, point taken
21:44 <+jackdempsey> sure
21:44 <+antares> merbful authentication done as part + login partial
21:44 <+antares> and it actually would be very useful
21:45 <+afrench> wycats: ping
21:46 <+antares> jackdempsey: I'll try to work on that when I finish this r.match("/old/location").redirect("/new/location") thing with routes
21:47 <+jackdempsey> nice
22:04 <+langenberg> antares: you are working on redirecting to url's from the router?
22:05 <+antares> langenberg: I do, I need to figure out simplest possible way to do redirect in Dispatcher#handle and add a spec for it, then implementation (I already have redirection method and options for Behavior)
22:05 <+langenberg> antares: So that I can replace the ugly hash in this code? http://pastie.org/196393
22:08 <+antares> langenberg: I don't know, you'll be able to do r.match("/old/location").redirect("/new/location", true)
22:08 <+antares> true for permanent status
22:08 <+antares> langenberg: you probably want to have :host condition on routes?
22:09 <+antares> like r.match("/", :host => "api").to(:controller => "api") ?
22:09 <+langenberg> No, this is a multi-site system (SaaS)
22:09 <+langenberg> I have n hosts
22:09 <+technomancy> So I'm trying to get streaming HTTP responses working with Merb's patched version of Rack
22:10 <+antares> langenberg: what is your problem then?
22:10 <+technomancy> I was told you could just make the body a Proc and write to response.body within that proc, but response.body is a StringIO object, so I can't see how that would be hooked up directly to the socket
22:10 <+technomancy> is there any way to force it to write?
22:11 <+technomancy> It seems like StringIO#flush and #sync= are no-ops that only exist to preserve compatibility with IO.
22:13 <+langenberg> antares: Site#default_url currently returns a hash with a controller and action key
22:13 <+langenberg> antares: I would like to replace that with a url
22:13 <+langenberg> antares: or rather say the default_url is url(:pages, @page)
22:14 <+antares> langenberg: so does #redirect method make it any easier?
22:16 <+wycats> afrench: pong
22:17 <+afrench> wycats: I'm sorry, man, I don't remember why I needed to ping you
22:17 <+langenberg> No, I want to be able to return a url/string as a result of defer_to.
22:17 <+langenberg> but it's kinda recursive so it's probably not a good idea
22:18 <+langenberg> if defer_to returns '/posts/1', it should retry the routing tree to see where '/posts/1' matches to.
22:21 <+blackspyder> heyo
22:24 <+langenberg> antares: I've a table 'sites' and want to be able to have a different default route '/' for every site.
22:25 <+langenberg> based on request.host one site could want to show a static page while the other wants a list of the last posts.
22:27 <+langenberg> currently I've got a sites table with fields for 'controller', 'action' and 'id', so I can build a hash to return when it's getting called within defer_to
22:27 <+langenberg> I'm not sure if that's the best solution though
22:56 <+subtleGradient> does mod_rails / Phusion Passenger work with Merb?
22:57 <+mattetti> subtleGradient: nope
22:58 <+subtleGradient> :'(
22:59 <+datafirm> hello! :)
22:59 <+mattetti> mod_rack is coming up soon
22:59 <+datafirm> I was looking for a rake task to show my current tasks, anything available?
22:59 <+mattetti> rake -T
22:59 <+datafirm> mattetti: that shows all teh available tasks..?
23:00 <+mattetti> yep
23:00 <+datafirm> mattetti: none of which show my routes?
23:00 <+melito> Is there anyone actively working on mod_rack ?
23:00 <+datafirm> not sure why I said tasks.. i meant routes. haha
23:00 <+mattetti> datafirm: for routes do merb -i and then merb.routes
23:00 <+mattetti> merb.show_routes
23:01 <+datafirm> mattetti: perfect.. thanks!
23:01 <+mattetti> I believe someone is working on a rake task to do that
23:01 <+datafirm> Cool.
23:01 <+datafirm> Not a huge deal, just helpful sometimes.
23:02 <+datafirm> Im impressed so far.. thanks for all the hard work.
23:02 <+melito> mattetti: Is there anyone that you know of that is actively working on mod_rack ?
23:02 <+mattetti> melito: I think so, mod_rubinius and mod_rack but I can't tell you who. For the moment stick to mongrels, ebb or thin
23:02 <+melito> sorry for the repeat
23:02 <+datafirm> Running over lighttpd with fastcgi is not reccomended?
23:02 <+melito> mattetti: I am....it'd be nice if there was something on github or somewhere though
23:02 <+mattetti> datafirm: nope
23:02 <+melito> mattetti: Really get the ball rolling
23:03 <+mattetti> melito: msg ezmobius or wycats and ask them
23:03 <+mattetti> I use nginx :p
23:03 <+neilon_> Anyone getting this? http://pastie.caboo.se/pastes/195251 (it's not actually my pastie, but it's the only thing google came up with for my error)
23:03 <+mattetti> I hope for a nginx mod
23:04 <+mattetti> neilon_: why are you using AS?
23:05 <+mattetti> nm rubygen is using AS
23:05 <+datafirm> hope this is not off topic, but was looking for a reccomendation on a roles/acl plugin. Im used to the ZF roles/acl system which is very open and simple.
23:05 <+mattetti> neilon_: are you using the latest version from git?
23:05 <+neilon_> mattetti: sure am
23:06 <+mattetti> latest version of DM too?
23:06 <+neilon_> yeah I've just done a git pull on everything and now I'm getting this error
23:07 <+mattetti> ask in #datamapper
23:07 <+mattetti> it looks like an issue there
23:07 <+mattetti> jackdempsey seems to have pasted the pastie you mentioned
23:07 <+mattetti> ping him too
23:07 <+jackdempsey> neilon_: yes
23:07 <+jackdempsey> its now BeforeAppLoads
23:07 <+jackdempsey> not Runs anymore
23:08 <+neilon_> ah ok, is this waiting for a DM update?
23:08 <+jackdempsey> i believe antares put in a patch for this and its probably waiting
23:08 <+neilon_> right ok, I'll roll back for now :)
23:08 <+antares> it has been applied
23:08 <+neilon_> oh....
23:08 <+neilon_> hmmm.... what was the patch on?
23:09 <+jackdempsey> oh cool
23:09 <+neilon_> the merb_datamapper plugin?
23:09 <+neilon_> or some part of datamapper itself?
23:09 <+antares> neilon_: it renames bootloader class in DM plugin to reflect change in merb-core
23:09 <+jackdempsey> yep and thats in this file: lib/merb_datamapper.rb
23:10 <+antares> neilon_: so it has been applied and you can use merb_datamapper from edge dm-more with edge merb
23:10 <+neilon_> ok I'll do that, thanks guys
23:11 <+jackdempsey> cool gl
23:19 <+techbelly> Hi all. Just looking at merb-core. Can someone help me out answering what's the purpose of the deferred? method on application.rb?
23:27 <+iamaleksey> techbelly: http://brainspl.at/articles/2008/04/18/deferred-requests-with-merb-ebb-and-thin
23:27 <+techbelly> Perfect. Thx.
23:29 <+iamaleksey> glad to help )
23:58 <+quik_> ezmobius: Are you about mate?
--- Log closed Wed May 14 00:00:28 2008
Reply all
Reply to author
Forward
0 new messages