<    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:00 bradgonesurfing joined
00:05 flexd joined
00:12 mitkok joined
00:13 RichGuk joined
00:19 ujihisa joined
00:32 russm left
00:40 defunkt joined
00:45 loincloth joined
00:45 crohr joined
00:52 bmizerany joined
00:57 loincloth joined
01:03 ph^ joined
01:21 philly-mac joined
01:23 <philly-mac> Hi, anyone here have experience using the padrino-framework that sits on top of sinatra?
01:25 bmizerany joined
01:25 hadees joined
01:33 bradgonesurfing joined
01:34 philly-mac left
01:46 hadees joined
01:56 RichGuk joined
01:56 erthad joined
02:31 hadees joined
02:37 TomV-415 joined
02:52 khaase joined
02:54 fbru02 joined
03:05 crohr joined
03:08 jeremyevans joined
03:09 fbru02 joined
03:23 loinclot_ joined
03:31 gma joined
03:41 huma joined
03:43 loincloth joined
03:48 mitkok joined
03:48 rtomayko joined
03:53 loincloth joined
03:54 qwerxy joined
03:56 tbuehlmann joined
04:01 futurechimp joined
04:08 <huma> how do i get current app :env option?
04:29 ibacchus joined
04:34 soveran joined
04:40 ecin_ joined
04:44 alexmchale joined
05:05 zelnick joined
05:09 <cypher23> huma, `settings.environment'
05:10 <cypher23> (`options' is an alias for settings)
05:12 <cypher23> huma, also, settings is only available from 0.9.5 onwards
05:13 <zelnick> hey, are there any helpers to make a (DELETE|PUT) Request from a view?
05:13 <harryv> zelnick: you can use the _method hack.
05:13 <cypher23> zelnick, in what sense? Via AJAX?
05:14 <zelnick> im trying to keep my application restful
05:15 <zelnick> so i just want to delete a resource in the db...
05:16 <cypher23> zelnick, as harryv said, just do a POST, and have a parameter called '_method' set to either 'put' or 'delete' depending on what you want to do
05:16 <zelnick> allright, thx guys
05:16 <cypher23> the MethodOverride Middleware will then convert the POST to the appropriate HTTP verb
05:16 <zelnick> thats how rails does it, right?
05:16 <harryv> yeah
05:16 <cypher23> they use the same middleware
05:17 <harryv> if you have a top level app it's enabled by default. if you subclass Sinatra::Base you have to `enable :method_override` (in some earlier version its :methodoverride iirc)
05:22 <zelnick> its, working thx :)
05:38 rsinger joined
05:39 qwerxy joined
06:04 warthurton joined
06:04 warthurton joined
06:06 ecin joined
06:18 slaskis joined
06:18 santiago joined
06:19 <santiago> hi all. i want to apply a filter only to certain routes, how to do that? is it possible at all?
06:20 <tbuehlmann> you have to check the route, if that wasn't changed
06:21 <santiago> check the route?
06:22 <namelessjon> In the before filter
06:23 <tbuehlmann> right, I assumed you are already working with it
06:30 akahn joined
06:40 hipertracker joined
06:45 <santiago> i don't know what it means to "check" the route
06:45 <santiago> anyways ...
06:45 <santiago> anyone with experience with sinatra in GAE?
06:46 <cypher23> santiago, if request.path =~ %r{/some/route}; ...; end
06:46 <cypher23> ^ check if it's the route you want to handle in your before filter
06:48 <santiago> :(
06:48 <santiago> could be something better
06:48 <santiago> anyone with experience deploying sinatra to GAE?
06:49 <cypher23> santiago, you can also define multiple handlers with the same route, and simply call `pass' if the handler thinks it can't handle the request
06:49 <cypher23> then sinatra will pass the request to the next handler with the same route
06:55 akahn joined
07:02 <huma> cypher23: thanks
07:03 <huma> also, the example is missing "type=hidden" at http://sinatra-book.gittr.com/#the_put_and_delete_methods :)
07:06 qrush joined
07:08 <pjammer> no no this is what i need. request.query_string
07:09 <SkramX> santiago: i know people who have deployed sinatra to GAE, what's wrong?
07:28 kristopher joined
07:30 pjammer joined
07:30 <santiago> SkramX: only route that works is '/', whenever i use another route GAE complains by telling the file does not exist
07:33 akahn joined
07:34 mjw2 joined
07:35 <SkramX> http://www.jzlabs.com/2009/05/18/sinatra-on-google-app-engine/ perhaps
07:35 <SkramX> in the changelog for 0.9.2, there were some GAE fixes
07:37 <santiago> i'm using 0.9.6
07:41 <cypher23> santiago, are your paths prefixed with a '/'?
07:41 <cypher23> ie., get '/foo/bar', or get 'foo/bar'?
07:41 <santiago> yes sir
07:41 <cypher23> try removing that
07:41 <santiago> prefixed with /
07:41 <santiago> remove the '/' ?
07:41 <cypher23> yeah
07:41 <cypher23> just test it with one URL
07:41 <santiago> ok, i'll check
07:42 <santiago> it is only happening with POST routes
07:43 coderdad joined
07:49 <santiago> :(
07:49 <santiago> with GET work aright, the prob happen with POST routes
07:50 <cypher23> weird
07:50 <santiago> Mar 11, 2010 2:48:54 PM com.google.appengine.tools.development.LocalResourceFileServlet doGet
07:50 <santiago> WARNING: No file found for: /project.html
07:51 <santiago> the is the route "/project", later "project" as you suggested
07:51 <santiago> and then i do ...
07:51 <santiago> RestClient.post "http://localhost:8080/project", '{name:"First project", description:"First project created in GAE datastore"}'
07:52 <santiago> then i get the warning
07:52 <santiago> it seems that GAE is passing a GET request to sinatra, i think that because of this ... Mar 11, 2010 2:48:54 PM com.google.appengine.tools.development.LocalResourceFileServlet doGet
07:52 <santiago> doGet
07:53 loincloth joined
07:55 <cypher23> santiago, I've never done anything with GAE (or jRuby, for that matter), so I can't help you there
07:57 bbttxu joined
08:02 stepheneb joined
08:05 mitkok joined
08:07 akahn joined
08:09 fbru02_ joined
08:18 hadees joined
08:18 akahn left
08:19 pdelgallego joined
08:19 julienXX joined
08:25 lala joined
08:26 markwithout joined
08:28 <markwithout> is there a right way to do a `get /:id do` where the id param is optional? Can this be solved via regex or something?
08:29 <cypher23> `get %r{/(\d+)?}'
08:30 <harryv> … given the id is a number :)
08:30 <cypher23> yeah :)
08:32 <markwithout> cool thanks. \/ escape the forward though ;P
08:34 arnaudsj joined
08:34 <cypher23> markwithout, what for?
08:35 <cypher23> that's why I used %r{}, so I didn't have to
08:35 arnaudsj left
08:36 <markwithout> oh, sorry. well, I suppose you learn something new every day
08:36 <cypher23> :)
08:36 <cypher23> %r{} is very useful with regex routes, because escaping every single / gets old quickly
08:37 <harryv> or %r|| or %r-- or whatever fits.
08:37 qwerxy joined
08:38 <cypher23> markwithout, http://www.zenspider.com/Languages/Ruby/QuickRef.html is always handy in such cases
08:39 <markwithout> thanks cypher23
08:42 loincloth joined
08:42 djanowski joined
08:57 hadees joined
09:00 <huma> cypher23: why is it not settings.env, btw? you set :env, but look for environment. not consistent.
09:01 <cypher23> no, you set :environment
09:02 <cypher23> huma, you can still `set :env, :foobar', but sinatra uses :environment
09:02 <huma> cypher23: yes, i've been looking at http://sinatra-book.gittr.com/#deployment_lighttpd
09:02 <harryv> it's deprecated. removed in 1.0
09:03 <huma> it says :env there
09:03 <huma> ok
09:03 <huma> i like :env better, though. less typing :)
09:05 djanowski joined
09:07 <cypher23> huma, if you're typing 'environment' often enough that this is actually becoming an issue, you're probably doing something wrong :)
09:10 pjammer joined
09:15 <huma> why did they change it anyway?
09:16 bdimcheff joined
09:16 <harryv> it's more descriptive I guess.
09:17 <harryv> there's really no reason to shorten it, as you don't use it very often.
09:32 stouset joined
09:46 imajes joined
09:48 ph^_ joined
09:57 <huma> so, my layout.haml supposed to be in .views and all should work then?
10:00 drev1 joined
10:01 jbrennan joined
10:01 pdelgallego joined
10:02 <huma> except it doesn't. is something from this deprecated? http://sinatra-book.gittr.com/#layouts
10:05 hadees joined
10:06 <huma> ah, got it
10:14 pdelgallego joined
10:17 hadeees joined
10:21 eddanger joined
10:34 flegelleicht joined
11:00 jbrennan joined
11:14 gp5st joined
11:14 pdelgallego joined
11:15 <gp5st> hey! so, i erb :view and it's saying that the variables I use are undefined, but if I pp them before I call erb
11:24 <gp5st> they are set*
11:24 <gp5st> forgot that part
11:25 adulteratedjedi joined
11:26 soveran joined
11:26 charlenopires joined
11:29 eddanger joined
11:35 RichGuk joined
11:38 matflores joined
11:42 zodiak joined
11:45 gp5st left
11:52 cpg joined
11:52 cpjolicoeur joined
11:59 <pjammer> i do love how sinatra is all ruby-y. forces you to get back to ruby code, at it's core.
12:00 <ecin> pjammer: don't get that feeling with Rails?
12:01 <pjammer> yeah i do, but that's only when 'shit' hasn't been figured out yet.
12:01 <pjammer> like a helper here, or a weird validation there
12:01 <pjammer> with sinatra, it's all ruby. makes you a better man
12:02 <pjammer> except for the rack bits....
12:02 <pjammer> those are helper-esque.
12:07 qwerxy joined
12:10 codeswin_ joined
12:10 johnny left
12:12 johnny joined
12:12 bleything joined
12:15 mattly joined
12:15 atmos joined
12:15 joeconyers joined
12:16 coderdad joined
12:28 gp5st joined
12:29 <gp5st> i'm having an issue where things in the public folder cause sinatra to give a 404 :-\ any idea of why or how to fix it?
12:33 <sr> gp5st, enable :static ? also, see you have public/foo.png, you'd access it via /foo.png
12:33 <sr> s/see/say
12:33 <gp5st> it works for other things, but if i add a file it won't see it
12:33 <gp5st> sorry, i didn't mention that
12:33 <gp5st> i restarted the test server too
12:37 Joe_Conyers joined
12:38 <gp5st> :-\ i made sure the perms were the same
12:40 matflores joined
12:40 <gp5st> nvm, i'm just stupid
12:56 imajes joined
12:56 bdimcheff joined
13:00 jacius joined
13:06 aaroninfidel joined
13:09 bleything joined
13:10 coderdad joined
13:14 joeconyers joined
13:17 fbru02_ joined
13:19 bdimcheff joined
13:25 pedrobelo joined
13:36 pdelgallego joined
13:37 hadees joined
13:46 khaase joined
13:56 ph^_ joined
14:02 gp5st left
14:14 bolson joined
14:15 postmodern joined
14:27 santiago joined
14:28 qwerxy joined
14:33 fbru02_ joined
14:34 xperience joined
14:40 xperience joined
14:44 joeconyers joined
14:55 flegelleicht joined
14:58 jbrennan joined
15:00 BrianTheCoder joined
15:01 xperience joined
15:07 charlenopires joined
15:12 kevwil joined
15:23 flegelleicht_ joined
15:23 neonski joined
15:27 baxter- joined
15:28 abcde joined
15:33 mtkd joined
15:45 thefifthcircuit joined
15:47 ecin joined
15:48 bdimcheff joined
15:55 bleything joined
15:58 dark joined
16:08 pdelgallego joined
16:16 abcde joined
16:28 coderdad joined
16:33 joeconyers joined
16:40 stouset joined
16:42 coderdad joined
16:42 ngw joined
16:43 jfarmer joined
16:44 <santiago> hi anyone with experience deploying to GAE?
16:49 alexmchale_ joined
16:51 coderdad_ joined
16:53 abcde joined
16:54 qwerxy joined
16:56 coderdad joined
16:57 pdelgallego joined
16:59 pdelgallego joined
17:02 coderdad_ joined
17:06 alexmchale_ joined
17:06 BrianTheCoder joined
17:13 kristopher joined
17:14 zelnick joined
17:16 millionmonkey joined
17:18 kohei joined
17:28 bdimcheff joined
17:42 flegelleicht_ joined
17:43 huma joined
17:44 flegelleicht__ joined
17:44 xperience joined
17:48 <santiago> what would be a reason for gettin require': no such file to load -- ostruct (LoadError)
17:49 <johnny> you didn't require rubygems ?
17:50 <namelessjon> santiago: A messed up ruby install?
17:51 <santiago> yeh i commented out require 'rubygems'
17:51 <namelessjon> ostruct is part of the stdlib though
17:52 <santiago> but still
17:57 loincloth joined
18:12 Swimming_Bird joined
18:12 <Swimming_Bird> for some reason when i server up a sass file using sass :foo, :layout => false the browser doesnt parse it
18:13 <Swimming_Bird> but the same stylesheet served from public is parsed just fine
18:13 <Swimming_Bird> is there something i need to do to set the mime type?
18:16 aaroninfidel_ joined
18:22 stepheneb joined
18:28 coderdad joined
18:38 alexmchale_ joined
18:44 aaroninfidel_ left
18:45 alexmchale_ joined
18:47 alexmchale_ joined
19:16 multigrain joined
19:21 alexmchale_ joined
19:29 abcde joined
19:47 imajes joined
19:52 lalala joined
19:55 Scyllinice joined
19:59 aaroninfidel_ joined
19:59 nitsujw joined
20:03 greg8si joined
20:07 alexmchale_ joined
20:12 jbrennan joined
20:16 zodiak joined
20:25 mattly joined
20:28 alexmchale_ joined
20:32 flegelleicht_ joined
20:37 joeconyers joined
21:00 cpg joined
21:03 coderdad joined
21:19 alexmchale_ joined
21:26 ecin joined
21:51 ibacchus joined
22:15 loincloth joined
22:16 flegelleicht joined
22:19 loincloth joined
22:29 mattly joined
22:29 flexd joined
22:30 loincloth joined
22:40 qrush joined
22:58 warthurton joined
22:58 warthurton joined
23:21 bradgonesurfing joined