<    March 2010    >
Su Mo Tu We Th Fr Sa
    1  2  3  4  5  6
 7  8  9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
00:01 kohei_ joined
00:06 yinkei joined
00:11 kohei joined
00:16 cpg joined
00:29 bweikulrich left
00:32 kohei joined
00:33 ph^_ joined
00:37 kohei joined
00:41 r11t joined
00:51 qwerxy joined
01:30 coderdad joined
01:31 crohr joined
01:40 RichGuk joined
01:43 ph^_ joined
01:51 khaase joined
02:22 crohr joined
02:24 karmi joined
02:46 mitkok joined
02:55 karmi joined
02:55 hassox joined
03:06 RichGuk joined
03:19 towski joined
03:19 ph^_ joined
03:40 alexmchale_ joined
03:54 towski joined
04:15 fbru02 joined
04:26 fbru02 joined
04:28 alexmchale_ joined
04:38 cypher23 joined
04:40 cypher23 joined
04:45 anathematic joined
05:04 qwerxy joined
05:18 erthad joined
05:18 erthad joined
05:31 hipe joined
05:37 ph^_ joined
05:58 shilin left
05:59 djanowski joined
06:07 alexmchale_ joined
06:36 alexmchale_ joined
06:40 tbuehlmann joined
06:59 <khaase> anybody awake?
07:03 <* shift> is kind of around.
07:05 anatoo joined
07:05 <khaase> how long does it usually take till people comment on submitted patches? i.e. how do i get peoples attention?
07:10 <harryv> khaase: open a ticket in lighthouse
07:11 <harryv> .. oh, you already have.
07:11 <harryv> I need to renew my domain so I get all these damn mails :D
07:11 <khaase> :)
07:11 <khaase> it's not an old ticket or something. just wanted to poke around to get things moving.
07:11 quirkey joined
07:12 <khaase> harryv: but yeah, i did that.
07:14 <cypher23> khaase, depends. rtomayko or sr usually look at them, and I guess it depends on their workload
07:15 <khaase> cypher23: okay. that's sort of an answer i was looking for.
07:15 <cypher23> you can poke/ask them when they're around in here
07:16 <khaase> as i was not really sure who is like "in charge" now
07:16 karmi joined
07:16 <cypher23> Not sure if there's such a thing as a core team w/ sinatra, but bmizerany did most of the inital work (and still commits stuff), and rtomayko and sr do most of the current development
07:44 mjw2 joined
07:50 mr-rock joined
08:00 maddox_ joined
08:10 giskard joined
08:11 <giskard> hi guys how can i retrive the IP that makes a connect from sinatra?
08:12 benlovell joined
08:12 dekroning joined
08:15 <harryv> giskard: request.ip
08:16 stepheneb joined
08:16 <giskard> so easy? thanks
08:17 arnaudsj joined
08:17 arnaudsj left
08:18 kristopher joined
08:24 coderdad joined
08:48 bolson joined
08:51 hipe joined
09:09 arnaudsj joined
09:24 drev1 joined
09:24 SirSydAlot joined
09:32 stepheneb joined
09:41 mitkok joined
09:48 docelic joined
09:53 bdimcheff joined
09:57 eddanger joined
10:00 arnaudsj left
10:03 khaase joined
10:05 hadees joined
10:11 neonski joined
10:14 imajes joined
10:18 yinkei joined
10:19 qwerxy joined
10:22 jhenderson joined
10:22 giskard joined
10:23 <neonski> hey good morning / afternoon / evening everyone
10:23 <neonski> am having issues receiving application/json content type on a POST
10:23 <cypher23> generic greetings to you too!
10:24 <neonski> lol
10:24 <neonski> you never know what time zone ppl are in eh
10:24 <cypher23> yup.
10:25 <neonski> essentially request.POST returns nothing
10:25 <cypher23> request.body is also empty?
10:25 <neonski> i am making the query via rest-client, resource.post( payload, :content_type => "application/json" )
10:26 <cypher23> neonski, I have a similar app, I just do a `data = request.body.read'
10:27 matehat joined
10:27 <neonski> i'll try that right now. it seems that Rack::Request is trying to make sense of what's in the body
10:27 <neonski> probably expecting form data
10:27 matehat joined
10:28 <neonski> hey that worked perfectly. awesome, thanks cypher23
10:30 <cypher23> yw
10:31 <cypher23> and yes, Rack::Request#POST expects a form post
10:31 <cypher23> not a 'generic' (or whatever it is called) POST from e.g. RestClient
10:35 <neonski> that'd be something interesting to add to rack, maybe.. to handle content_type => "application/json"
10:35 <neonski> and return a hash
10:35 <neonski> dunno if it's a common case but we tend to do a lot with json around here
10:35 r11t joined
10:39 <cypher23> neonski, well, you could monkey-patch it in (or into Sinatra's Request class)
10:40 khaase joined
10:40 r11t_ joined
10:42 <neonski> for sure yes...
10:44 mtkd joined
10:44 r11t__ joined
10:46 lala joined
10:48 <neonski> cypher23: i'm still a ruby noob - is there an easy way in ruby to do "aspect oriented" programming? i would simply like to wrap certain methods when i'm in debug mode, for example
10:49 <neonski> i'm used to doing that in javascript a lot (and currying, etc... )
10:56 kevwil joined
11:01 anatoo joined
11:08 stepheneb joined
11:11 eddanger joined
11:12 joeconyers joined
11:13 kjs3 joined
11:14 fbru02_ joined
11:17 codeswing joined
11:18 loincloth joined
11:25 warthurton joined
11:29 bradgonesurfing joined
11:44 atmos joined
11:50 khaase joined
11:51 giskard joined
11:59 victori joined
12:01 stepheneb_ joined
12:04 RichGuk joined
12:11 <namelessjon> neonski: I think there's a middleware to do json conversion automagically
12:11 <namelessjon> neonski: Possibly in rack-contrib
12:11 stepheneb joined
12:16 coderdad joined
12:20 zodiak joined
12:22 evan_luck joined
12:24 fbru02_ joined
12:26 cpg joined
12:27 matflores joined
12:47 khaase_ joined
12:50 coderdad joined
12:53 Joe_Conyers joined
13:03 khaase joined
13:14 damnpepe joined
13:31 SeanLazer joined
13:32 <SeanLazer> Does anyone know what it means when my app tells me "Not Found" on every URL in production (using Apache + Passenger and Sinatra 1.0)
13:32 <SeanLazer> The same actions work fine on my local machine
13:33 ph^_ joined
13:45 kjs3 joined
13:52 mies joined
13:59 mitkok joined
14:00 <neonski> SeanLazer: do you mean for routes you have defined, or static files?
14:00 <SeanLazer> neonski: Defined routes, static files still load
14:01 <neonski> you have :set the root of the application in your rackup file?
14:01 <neonski> (or in your app or whatever)
14:01 <SeanLazer> no i have not
14:01 <SeanLazer> set :root, '/' ?
14:02 <neonski> usually i would use set :root, File.dirame(__FILE)
14:02 <neonski> usually i would use set :root, File.dirname(__FILE)
14:02 <neonski> uhh __FILE__
14:03 <neonski> you can set :app_file also
14:03 <neonski> to your main .rb file
14:03 <SeanLazer> a ha, ok i'll give that a try
14:05 <SeanLazer> not in my config file?
14:06 <SeanLazer> setting it in my main app.rb file still gives me "Not Found"
14:06 <SeanLazer> and setting it in config.ru gives me a passenger error
14:06 <SeanLazer> saying no such whatever _FILE_
14:08 <neonski> you would do it in your main app.rb file
14:08 <neonski> it's __FILE__
14:08 <neonski> if you still get not found, something else is wrong
14:08 <neonski> have you looked at the apache error log?
14:09 hipe joined
14:16 ph^ joined
14:21 kjs3 joined
14:26 Craig` joined
14:27 <Craig`> hey guys
14:27 <Craig`> can someone assist me? this is my code: hey guys, can someone help me with sinatra? here is my code: http://pastie.org/874410 .. I tried to visit the URI commented in the code, but I get a 404 message saying, "Sinatra doesn't know this ditty." can you tell me where I'm going wrong please?
14:30 itsmeduncan joined
14:37 kjs3 joined
14:40 <atmos> Craig`: the /v/ portion is why it's 404ing
14:40 <Craig`> why is that?
14:40 <Craig`> basically all I'm wanting to do is get the end part of the URI, and then go to fukung.net/whatever
14:41 <Craig`> righto, thanks.
14:46 johnny joined
14:47 mattly joined
14:50 khaase joined
15:07 ph^_ joined
15:07 cored joined
15:07 cored joined
15:09 hipe joined
15:19 burlyscudd joined
15:32 karmi joined
15:34 khaase joined
15:40 tpiep joined
15:41 fbru02_ joined
15:50 Tuplanolla joined
15:51 fbru02 joined
15:54 tibaza` joined
15:55 hassox joined
15:55 zodiak joined
16:05 jpld joined
16:10 khaase_ joined
16:16 ph^_ joined
16:18 <tibaza`> Hi everyone! I think I'm missing something really basic...
16:18 <tibaza`> How do you nest views into a layout so that they don't step on each other?
16:19 <tibaza`> Let me explain: I have two divs, the first is a form, and the second is for the results of a post on that form.
16:20 <tibaza`> So the second is rendered after the post.
16:20 <tibaza`> It seems whatever I try that second div wipes out the first when it renders.
16:21 <tibaza`> There is a "yield" in the layout.haml file. But how do I get the first view to render into the second div?
16:21 <tibaza`> Does that make sense?
16:22 <Tuplanolla> You need to send the whole webpage to the client both times.
16:22 <Tuplanolla> Unless of course you use some messy AJAX hack.
16:23 <tibaza`> So both views should have essentially the same content?
16:25 <johnny> you should send a view that contains 2 partial views..
16:25 <neonski> jquery supports a kind of partial system using .load...
16:25 <neonski> you can pass in a selector to only load part of the resulting page, for example
16:25 <neonski> otherwise with sinatra, you have to roll your own partial "system"
16:26 <atmos> tibaza`: you probably want :layout => false
16:28 <tibaza`> atmos: that would be for the second view?
16:29 <atmos> yeah, or inside of the first view
16:29 <atmos> if it's a search result that you wnt inserted into the dom then you'll need to send back a document w/o the layout and use JS or something to add the html
16:31 <tibaza`> So pass the JS in as the second view?
16:35 <tibaza`> Tuplanolla: I just tried using the "whole webpage" method you describe. Seems to work. I thought I had tried this before and got a nasty "flash" as it reloaded. But now it doesn't... hmm.
16:35 <tibaza`> I'll try a jquery option, since that is probably less "heavy".
16:37 jacius joined
16:38 pedrobelo joined
16:44 greg8si joined
16:48 zodiak joined
16:50 postmodern joined
16:51 <Tuplanolla> It's likely to be slower and mostly unsupported, tibaza.
16:52 <johnny> mostly unsupported? by who?
16:53 mattly joined
16:53 <Tuplanolla> By browsers.
16:53 <Tuplanolla> And many people keep JS turned off.
16:59 <johnny> not many
17:00 <johnny> most people have js turned on
17:00 <johnny> almost the same amount of people have js turned on.. as have flash installed
17:00 <johnny> if you look at the number of people who use gmail and google maps
17:01 <johnny> then you must have js on
17:04 <tibaza`> Thanks guys. I use a lot of jquery,so I'll go with a combined effort. See, I knew it was basic! :-)
17:08 jhenderson joined
17:16 loincloth joined
17:30 r11t joined
17:31 RichGuk joined
17:33 bweikulrich joined
17:50 zodiak joined
18:00 coderdad joined
18:02 zodiak joined
18:08 anatoo joined
18:17 hipe_ joined
18:17 mitkok joined
18:18 qwerxy_ joined
18:21 ngw joined
18:23 soveran joined
18:25 kohei joined
18:53 imajes joined
19:01 kohei joined
19:04 soveran joined
19:17 hipe joined
19:18 loinclot_ joined
19:40 grandy joined
19:48 greg8si joined
19:57 <grandy> hello, anyone have any ideas for how to have my current_user method not query the db each time it's called?
19:57 <grandy> (it is a helper method)
19:59 <namelessjon> grandy: I assume it pulls the id from the session?
19:59 <grandy> namelessjon, yep
19:59 <namelessjon> grandy: def current_user; @user ||= User.get(session[:id]); end or so.
20:00 <grandy> i am doing that but it still queries multiple times, oddly
20:00 <namelessjon> grandy: Does the user exist?
20:01 <grandy> namelessjon, hah that is the problem :) doh
20:02 <grandy> namelessjon, can you think of a way to avoid the queries? I guess not since there is no way to know which call is the last ...
20:03 <namelessjon> grandy: You could always make a AnonCoward object which quacks like a User?
20:03 <namelessjon> grandy: Then, if you actually log in, explicitly set @user
20:03 <grandy> namelessjon, ahh ok interesting
20:05 fbru02_ joined
20:33 r11t_ joined
20:40 fbru02_ joined
20:44 aaroninfidel_ joined
20:46 aaroninfidel_ left
20:50 haruki_zaemon joined
20:51 <haruki_zaemon> Hi all, hopefully a quick question... is there anyway to get redirects in sinatra to pre-pend the full base-path? Ie. if my app is at http://someserver/myapp/ how do I redirect to "http://someserver/myapp/somepath" without constructing a full URL myself?
20:53 loincloth joined
20:56 <haruki_zaemon> I'm using Rack:RelativeRedirect but that doesn't seem to add the context path either
20:56 <johnny> sinatra doensn't have such a thing..
20:58 <haruki_zaemon> johnny: right, I figured it was probably a rack thing after I asked the question
20:58 <haruki_zaemon> might go ask the rack guys
21:00 <haruki_zaemon> thanks
21:00 haruki_zaemon left
21:03 zodiak joined
21:12 cpg joined
21:13 loinclot_ joined
21:14 hassox joined
21:31 hipe_ joined
21:45 quirkey joined
21:47 markwithout joined
21:53 zodiak joined
21:56 jpld joined
22:00 SeanLazer joined
22:26 thomaz joined
22:58 warthurton joined
22:58 warthurton joined
23:04 coderdad joined
23:14 bradgonesurfing joined
23:26 loincloth joined
23:27 kristopher_ joined
23:37 jpld joined