ddfreyne changed the topic of #nanoc to: 3.7.5 (January 12th) | web http://nanoc.ws/ | repo http://bit.ly/XE6e3G | issues http://bit.ly/VfXaSV | forum http://ho.io/n-discuss | irclog http://irclog.whitequark.org/nanoc
julieeharshaw has joined #nanoc
ddfreyne has joined #nanoc
_whitelogger_ has joined #nanoc
number-six has quit [Ping timeout: 244 seconds]
dkm has quit [Ping timeout: 265 seconds]
dkm has joined #nanoc
_whitelogger_ has joined #nanoc
dkm has quit [Ping timeout: 244 seconds]
dkm has joined #nanoc
_whitelogger_ has quit [Excess Flood]
_whitelogger_ has joined #nanoc
dkm has quit [Ping timeout: 244 seconds]
number-six has joined #nanoc
dkm has joined #nanoc
number-six has quit [Ping timeout: 244 seconds]
irsol has quit [Ping timeout: 244 seconds]
irsol has joined #nanoc
_whitelogger_ has joined #nanoc
number-six has joined #nanoc
number-six has quit [Ping timeout: 244 seconds]
number-six has joined #nanoc
dkm has quit [Ping timeout: 244 seconds]
dkm has joined #nanoc
dkm has quit [Ping timeout: 244 seconds]
dkm has joined #nanoc
dkm has quit [Ping timeout: 244 seconds]
dkm has joined #nanoc
dkm has quit [Ping timeout: 244 seconds]
dkm has joined #nanoc
dkm has quit [Ping timeout: 244 seconds]
dkm has joined #nanoc
dkm has quit [Ping timeout: 244 seconds]
dkm has joined #nanoc
dkm has quit [Ping timeout: 244 seconds]
dkm has joined #nanoc
cDlm has quit [Quit: mi dormas]
pkunc has joined #nanoc
pkunc has quit [Quit: Leaving.]
cDlm has joined #nanoc
cDlm is now known as VitamineD
pkunc has joined #nanoc
pkunc has quit [Read error: Connection reset by peer]
pkunc has joined #nanoc
tantalum has joined #nanoc
<guardian> bobthecow: the man who knows a lot, do you know by chance why Ruby Net::HTTP has both request_post and post methods?
<bobthecow> guardian: post (the old one) yields response fragments.
<bobthecow> post2 (or request_post) yields the response.
<bobthecow> the old one is still there for backwards compatibility, but you'd likely never use it unless you're streaming enormous responses from posts and need to write them to disk incrementally or something.
<bobthecow> the real question, though, is why you're not using httparty instead of Net::HTTP?
<bobthecow> abstractions exist for a reason ;)
<guardian> I don't know httparty
<guardian> there's rest-client
<guardian> there's nestful
<bobthecow> there are a lot of 'em.
<bobthecow> the fact remains that you're using Net:HTTP when there are much better HTTP abstractions out there :)
<guardian> bobthecow: I don't get the difference between response fragment and response. Documentation says both request_post and post return an HTTPResponse object
<guardian> yeah but I'm also learning :)
<guardian> also I can't use request_post or post anyways since I need to req.basic_auth 'user', 'pass'
<bobthecow> look at the block in that code sample.
<bobthecow> it's receiving the response a string at a time.
<bobthecow> and writing each fragment to f.
<guardian> ah yeah that's when using a block
<guardian> but if you don't use a block there's no difference right?
<guardian> apart from the deprecated destnil param
<guardian> dest param
<bobthecow> "yields response fragments" means "when using a block". that's what yield is ;)
<guardian> bobthecow: while I'm at it, and then I'll stop substituting you for #ruby: I find weird people use instance variables in plain ruby scripts, is this common in Ruby land?
<bobthecow> give me an example?
<guardian> e.g. https://www.socialtext.net/open/very_simple_rest_in_ruby_part_3_post_to_create_a_new_workspace -- we can argue it's not a good example, but I found many examples like this
<guardian> I would have written "user = ..." and not "@user = ..." because I'm not in a class, hence there's no such thing as an instance variable
<bobthecow> but there is, and you are :)
<bobthecow> everything's an object in ruby, remember?
<guardian> well yes, still looks weird to me
<guardian> I better look at user being a local variable of the main method, than an instance variable of the instance that happens to own the main method
<bobthecow> i don't particularly have strong feelings one way or another. if i were writing it i'd use local variables.
<guardian> ok
<guardian> thx bobthecow
<bobthecow> no problem.
<guardian> looking into httparty but well I'm not sure it brings much compared to what I really need
<guardian> at least it's not less verbose to POST json using httparty than with net/http
<bobthecow> httparty is about encapsulating related requests into something you can reason about and work with.
VitamineD has quit [Ping timeout: 245 seconds]
cDlm has joined #nanoc
FabianB has joined #nanoc
leobalter has left #nanoc ["tchau"]
FabianB_ has quit [Ping timeout: 252 seconds]
<ddfreyne> I found Net::HTTP to be the most reliable.
<ddfreyne> People say a lot of nice stuff about Faraday, but its API is unpredictable.
pkunc has quit [Ping timeout: 255 seconds]
tantalum has quit [Quit: Leaving]
pkunc has joined #nanoc
pkunc has quit [Quit: Leaving.]
srbaker has quit [Remote host closed the connection]
srbaker has joined #nanoc