<    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:12 ibacchus joined
00:18 kohei joined
00:29 ph^_ joined
00:44 crohr joined
00:46 RichGuk joined
01:42 pdelgallego joined
01:48 RichGuk joined
01:49 RichGuk joined
01:56 erthad joined
02:08 bradgonesurfing joined
02:08 hlb joined
02:12 postmodern joined
02:12 mitkok joined
02:33 fbru02 joined
02:42 lala joined
02:55 jeremyevans joined
03:09 joeconyers joined
03:09 gma joined
03:09 julienXX joined
03:09 ph^_ joined
03:13 jeremyevans joined
03:17 bradgonesurfing joined
03:20 fbru02 joined
03:23 chimp joined
03:53 hipertracker joined
04:20 loincloth joined
04:35 alexmchale_ joined
04:41 soveran joined
04:45 alexmchale_ joined
05:19 khaase joined
05:35 ph^_ joined
05:42 kristopher joined
05:44 alexmchale_ joined
05:45 mitkok joined
05:51 xperience joined
05:53 benlovell joined
05:55 ecin joined
06:04 futurechimp joined
06:13 alexmchale_ joined
06:21 ibacchus joined
06:22 tbuehlmann joined
06:52 coderdad joined
06:52 khaase_ joined
06:54 benlovell joined
07:31 Swimming_Bird joined
07:36 kristopher joined
07:42 pjammer joined
07:48 stahnma_ joined
07:51 stouset joined
07:51 pdelgallego joined
07:52 ecin joined
07:53 stahnma joined
07:53 stahnma joined
07:55 imajes joined
07:59 arnaudsj joined
08:04 ph^_ joined
08:13 ecin joined
08:21 pjammer joined
08:22 loincloth joined
08:23 arnaudsj left
08:25 xperience joined
08:26 markwithout joined
08:34 multigrain joined
08:46 stouset joined
08:50 kristopher joined
08:52 kristopher joined
08:53 multigrain joined
08:55 imajes joined
09:06 stepheneb joined
09:28 kristopher_ joined
09:28 kristopher_ joined
09:30 hadees joined
09:30 ibacchus joined
09:44 pdelgallego joined
09:45 imajes joined
09:57 erthad joined
09:59 flegelleicht joined
10:03 misza222 joined
10:03 <neonski> good morning/afternoon/evening
10:03 <neonski> anyone can help with post file uploads?
10:04 <neonski> i'm trying to find a good example of this but all i find seems to be outdated
10:08 <ecin> With reading the file or making the html form?
10:09 <tbuehlmann> http://gist.github.com/60396/aa2fc6deaba86d7e5eafb5d3ebc972418d77997d
10:12 <neonski> with receiving the file in a POST handler
10:12 <ecin> tbuehlmann: so what's the error you're getting?
10:12 <neonski> thanks tbuehlmann
10:15 ibacchus joined
10:16 <neonski> works perfectly. yay
10:20 xperience joined
10:27 eddanger joined
10:27 ecin joined
10:35 julienXX joined
10:39 pdelgallego joined
10:41 aeldaly joined
10:56 ibacchus joined
11:00 codeswing joined
11:05 bleything joined
11:08 joeconyers joined
11:08 loincloth joined
11:12 mitkok joined
11:13 RichGuk joined
11:14 atmos joined
11:14 drev1 joined
11:15 irclogger_com joined
11:15 Topic for
11:16 atmos joined
11:19 <baxter-> what's the best way to generate an etag?
11:20 <baxter-> i'm currently generating one based on String#hash
11:20 stepheneb joined
11:21 xperience joined
11:22 xperience joined
11:28 xperience joined
11:36 malte_ joined
11:38 <malte_> when using sinatra, if you want to load a css (sass) file in the < head > tag, what exactly are you meant to do? are you meant to first manually compile the sass file into css and call the css file, or is there some way of letting sinatra / haml / sass take care of that itself so i don't have to manually recompile the css file for each change?
11:40 mattly joined
11:40 <baxter-> malte_, do you mean embedding css within <style> tags? or something like <link href='/style.css' rel='stylesheet' type='text/css'>?
11:40 <baxter-> if you mean the latter, i would create a route like get '/style.css' do ...
11:41 <malte_> baxter-, the latter .. im not talking about inline css, but referencing a css file (pure html wise)
11:41 <baxter-> ok
11:41 <baxter-> i would create a new get statement for your css file, and then use something like 'sass :style'
11:42 <malte_> baxter-, but does that mean then that for every request to load the css, the entire sinatra app is called? that must get pretty clunky in the long run .. is there no way to make it just recompile the sass file itself when needed, but always just serve the static css to the consumer for speed and efficiency reasons?
11:43 <baxter-> there might be a way to do that :) i'm not sure
11:44 <baxter-> i'm hosting my stuff on heroku and relying on caching, but that might not be any good for you
11:44 <malte_> oh :) .. ok, some sites indicate that its possible .. they just don't say how the F its done :p
11:44 <baxter-> hehe
11:45 <malte_> hmms, just started using ruby / sinatra / haml / sass etc the other day, so learning the ropes right now .. will take a look at heroku a little later when i feel like i have the basics under control
11:45 <baxter-> ok :)
11:50 <malte_> baxter-, i found a way!
11:50 <baxter-> what did you do?
11:52 <malte_> baxter-, if you use 'thin' to run the app, and you place the sass files in /public/stylesheets/sass, and add some stuff to config.ru, then thin recompiles the sass into css whenever needed
11:52 cpg joined
11:52 <baxter-> oh, interesting
11:53 <malte_> could you tell me what 'thin' is in a nutshell though? you are not meant to use it in a production environment are you?
11:53 <baxter-> thin is a web server
11:53 <baxter-> i think you can use it in production. i'm sure heroku runs on a version of thin
11:54 <malte_> hm... but can it handle even nearly as much requests as nginx for example?
11:54 <malte_> i come from a python background, and using these native webservers in production is never recommended there at least
11:54 <malte_> they are just for development there really
11:55 <baxter-> i think thin can run on nginx... i'm not really sure actually, let me read up
11:56 <malte_> yes it can
11:56 <malte_> just reading about it now
11:56 ibacchus joined
11:56 <malte_> so thin is kind of like wsgi in python then i take it .. like a protocol that also has a native web server implemented, but you can opt to use a 'real' webserver too, like nginx with it
11:58 <baxter-> i'm not familiar with wsgl, so i can't say for certain
11:58 <baxter-> wsgi*
11:59 <malte_> WSGI is the Web Server Gateway Interface. It is a specification for web servers and application servers to communicate with web applications (though it can also be used for more than that). It is a Python standard, described in detail in PEP 333.
11:59 <malte_> :)
11:59 <baxter-> i think with thin nginx works as a proxy
12:00 <baxter-> hmm, well i would say rack is the equivalent to wsgi
12:00 <baxter-> based on that definition
12:00 <malte_> yep, that's what i'm going to assume for now as well
12:01 <baxter-> where did you find that info about thin processing sass files? i would quite like to have a read
12:01 bresc joined
12:02 <malte_> http://github.com/nex3/haml
12:03 <bresc> HI I'm having sinatra running with Thin and I want to POST gziped json. So everything works fine if I don't send gzip. But with gzip there doesn't seem to be anything in "request.body.read"
12:04 <baxter-> i can't believe i've missed that, thanks malte_!
12:05 <malte_> np :)
12:06 <bresc> I should mention that I use nginx to proxy to Thin
12:11 coderdad joined
12:23 r11t joined
12:30 charlenopires joined
12:32 soveran joined
13:00 soveran joined
13:01 zodiak joined
13:12 mtkd joined
13:21 xperiencezZz joined
13:26 Swimming_Bird joined
13:27 pedrobelo joined
13:30 Swimming_Bird joined
13:33 <brainproxy> using the builder gem in a sinatra app; I've got an xml tag that has colon in the name
13:33 <brainproxy> but
13:33 <brainproxy> xml.bar:foo
13:33 <brainproxy> doesn't work
13:34 <brainproxy> proper way to make that work?
13:36 xperience joined
13:42 mitkok joined
13:45 <baxter-> brainproxy, just wondering, if you put a space between bar and :foo what happens
13:51 <bleything> baxter-, brainproxy: that's exactly how you do namespaces. xml.foo :bar do ...
13:53 ylluminate joined
13:53 <baxter-> thanks bleything
13:57 <brainproxy> i need my tag to look like this
13:57 <brainproxy> <bar:foo arg1="yoz" arg2="baz">
13:57 <brainproxy> well, ending with />
13:58 <brainproxy> sorry, a bit new to this so I wasn't sure exactly how to apply your namespace suggestion, bleything
13:58 <brainproxy> though I am looking at the builder docs on rubyforge
13:58 <brainproxy> and saw that bulletpoint
13:58 <bleything> yeah, the docs will show you the way.
13:58 <bleything> if you don't give builder a block, it'll create a self-closing tag
13:58 <brainproxy> well there's no example for tag!
13:58 <brainproxy> which is how it suggests doing it at first
13:58 <brainproxy> e.g.
13:59 <brainproxy> xml.tag!("bar:foo")
13:59 <brainproxy> that works
13:59 <brainproxy> but how to add the arguments
13:59 <brainproxy> no examples in documentation
13:59 <brainproxy> also, no examples for suggestion that namespace is a better way to go
13:59 <bleything> I don't understand what you mean by "namespace is a better way to go"
14:00 <brainproxy> reading in http://builder.rubyforge.org/classes/Builder/XmlMarkup.html
14:01 <brainproxy> from docs: "(But see the next bullet item for a better way to handle XML namespaces)."
14:01 <brainproxy> so I didn't say it quite right
14:01 <bleything> yes?
14:01 <bleything> xml.bar :foo, :arg1 => "yoz", :arg2 => "baz"
14:01 <bleything> does what you want
14:02 <bleything> Just Try It™
14:02 <brainproxy> okay
14:02 <brainproxy> sorry, it wasn't obvious to me
14:02 <brainproxy> only been doing ruby for about 2 days :)
14:02 <bleything> I know
14:02 <brainproxy> heh
14:02 <bleything> here's the thing to know about ruby: whatever you think might work, probably will :)
14:03 <bleything> for instance, I haven't used builder for yeaaaaars. but I just slapped that together and it magically worked
14:03 <brainproxy> thanks for the tips :)
14:03 <bleything> np, good luck!
14:04 <brainproxy> it worked, whadda ya know :)
14:06 multigrain joined
14:15 ecin joined
14:16 stepheneb joined
14:20 djanowski joined
14:22 kristopher joined
14:30 xperience joined
14:34 stepheneb joined
14:37 <neonski> good morning/afternoon/evening
14:38 <neonski> so in my application, there is no database - the data comes from a REST based api on another server
14:39 <neonski> so when a request comes in, I have to do a request (right now using RestClient) to the backend
14:39 <neonski> and process it using the views, etc in the sinatra app
14:40 <neonski> i'm wondering if there's a more efficient way of doing this - maybe using sinatra as a rack middleware? it becomes tricky because there will be cookies involved, etc
14:40 <neonski> just wondering if someone has ideas, design wise, on how to implement this in an efficient way
14:40 <neonski> (be back in 10)
14:42 xperience joined
14:44 xperience joined
14:48 djanowski joined
14:48 xperiencezZz joined
14:54 xperience joined
15:00 capndiesel joined
15:04 xperiencezZz joined
15:20 fbru02_ joined
15:26 stepheneb_ joined
15:29 aaroninfidel joined
15:38 ylluminate joined
15:40 xperience joined
15:48 pdelgallego joined
15:53 bdimcheff joined
16:00 fbru02_ joined
16:01 hadees joined
16:13 imajes joined
16:21 johnny joined
16:24 pdelgallego joined
16:32 postmodern joined
16:41 pdelgallego joined
17:02 Swimming_Bird joined
17:07 pdelgallego joined
17:11 pdelgallego joined
17:17 stepheneb joined
17:29 pdelgallego joined
17:49 ngw joined
17:50 coderdad joined
17:53 joeconyers joined
18:01 imajes joined
18:02 johnny left
18:24 dark joined
18:28 cpg joined
18:36 johnny joined
18:38 thomaz joined
18:49 alexmchale joined
18:50 Swimming_Bird joined
18:52 syd_ joined
18:57 cincinatus joined
19:01 cincinatus_ joined
19:20 ibacchus joined
19:28 multigrain joined
19:28 imajes joined
19:33 jbrennan joined
19:40 bolson joined
19:59 r11t_ joined
20:05 r11t_ joined
20:06 alexmchale joined
20:07 stepheneb joined
20:10 r11t_ joined
20:17 <pjammer> oh gosh, now where did rack/test go in 1.0.1
20:24 alexmchale joined
20:27 ylluminate joined
20:36 <pjammer> did you know that rack 1.1.0 doesn't have rack/test?
20:37 <sr> pjammer, it is not part of rack itself, you need to gem install rack-test
20:38 <pjammer> yes, but somehow i was able to test without it before.... unless that was when i had my imac...hmmm
20:39 imajes joined
20:40 <johnny> were you using sinatra test before?
20:40 <johnny> that used to be part of sinatra until recently
20:40 <pjammer> but either way, shouldn't that tibbit be in the docs?
20:40 <johnny> it is
20:40 <johnny> it says so right in the sinatra docs
20:40 <pjammer> i think my situation was i had a new imac, hated it, and went back to this laptop i'm on.
20:41 <johnny> to use rack-test and that the sinatra test was being removed
20:41 <pjammer> johnny: where does it say, install rack-test using sudo gem install rack-test
20:41 <pjammer> as the examples show
20:41 <johnny> it just says to use rack-test
20:42 <johnny> not sure if it says how to install it
20:42 <johnny> but it says you must
20:43 alexmchale joined
20:43 <pjammer> http://www.sinatrarb.com/testing.html
20:44 zodiak joined
20:44 <pjammer> in here?
20:45 <pjammer> the other thing is that rack comes with rack::mockwhatever... which one would assume had rack::test in it too, not that this is a rack room.
20:45 <pjammer> so you can mock right out of rack, but you can't test.
20:46 <pjammer> anyways, i'm sorry for whining. one of those days.
20:49 <sr> pjammer, you could use Rack::MockRequest to test your app, actualy. check rack's test for an example
20:49 <sr> rack/test is based on it. it just adds a bit of sugar on top of it
20:50 <pjammer> yeah, i am using rack/test already, i wrote this in November ish...
20:50 <pjammer> using last_response.ok? and stuff
20:50 <pjammer> follow_redirect! etc
21:05 <pjammer> hmm hmm hmm
21:05 <pjammer> mocking xml, i wonder if that can be done in mockrequest
21:08 <tdmackey> don't see why not
21:09 <pjammer> fudge, i hate coming back to things 4 months later.
21:10 <pjammer> so active resource sends a post request to my sinatra app /blah.xml
21:10 <pjammer> so i then have to get said file, and parse it.
21:10 <pjammer> and
21:10 <pjammer> it seems that rack test has an upload_file.rb file
21:10 <pjammer> post "/photos", "file" => Rack::Test::UploadedFile.new("me.jpg", "image/jpeg")
21:11 <pjammer> maybe that's how i do it.
21:15 <pjammer> ok that part works.
21:15 <pjammer> changed for xml of course
21:16 <tdmackey> what are you doing with xml?
21:16 <pjammer> isn't the following code a redirect? - return @shorty.to_xml
21:17 <pjammer> tdmackey: i'm using the file from active Resource to create a record on my sinatra app based on the content inside.
21:19 <pjammer> i guess it isn't although the return sends a request back to Active Resource
21:20 <pjammer> so maybe redirect means like a true 301 or something
21:22 <pjammer> yeah, stupid legacy code.
21:22 <pjammer> night night, too late to keep thinking.
21:24 ibacchus joined
22:00 qrush_ joined
22:04 kristopher joined
22:39 dark joined
22:58 mattly joined
22:58 warthurton joined
22:58 warthurton joined
22:59 ibacchus joined
23:09 mattly joined
23:22 benschwarz joined
23:23 fbru02 joined
23:29 loincloth joined
23:32 lala joined
23:52 bradgonesurfing joined
23:54 hubub joined