towski has quit [Remote host closed the connection]
saxy has quit [Ping timeout: 276 seconds]
yxhuvud has joined #ruby-lang
neocoin has quit [Remote host closed the connection]
kith_ is now known as kith
tenderlove has joined #ruby-lang
qwerxy has joined #ruby-lang
tenderlove has quit [Ping timeout: 268 seconds]
jstemmer has joined #ruby-lang
thone_ has joined #ruby-lang
<mfn>
Can someone help me try understand how I can read at http://www.ruby-doc.org/core-1.9.3/File.html (or IO page?) that "File.write(filename, content)" works? I discovered it by accidant but can't find it documented this way
thone has quit [Ping timeout: 264 seconds]
<mfn>
It acts like File.open(filename, 'w') { |f| f.write content } AFAICS
<erikh>
yes, and is encoding-aware
<erikh>
if you want to write binary files, use binwrite
<erikh>
and write comes from IO
<erikh>
it's just included (or wrapped, can't remember) in File.
t86926 has quit [Remote host closed the connection]
t76047 has joined #ruby-lang
tenderlove has joined #ruby-lang
kvirani has joined #ruby-lang
tenderlove has quit [Ping timeout: 246 seconds]
TDJACR has joined #ruby-lang
josh^ has quit [Ping timeout: 264 seconds]
tjadc has joined #ruby-lang
josh^ has joined #ruby-lang
yats has joined #ruby-lang
r0bby has joined #ruby-lang
ioga_wrk has quit [Quit: Leaving]
robotmay has joined #ruby-lang
chendo_ has joined #ruby-lang
chendo_ has quit [Changing host]
chendo_ has joined #ruby-lang
mytrile has joined #ruby-lang
Axsuul has quit [Ping timeout: 246 seconds]
t76047 has quit [Remote host closed the connection]
machuga has joined #ruby-lang
t52144 has joined #ruby-lang
ioga_wrk has joined #ruby-lang
ryez has quit [Ping timeout: 245 seconds]
charliesome has joined #ruby-lang
Hakon has joined #ruby-lang
saxy has joined #ruby-lang
postmodern has quit [Quit: Leaving]
deryl has joined #ruby-lang
Hakon has quit [Quit: Leaving...]
chendo_ has quit [Ping timeout: 252 seconds]
saxy has quit [Ping timeout: 246 seconds]
chendo_ has joined #ruby-lang
chendo_ has quit [Changing host]
chendo_ has joined #ruby-lang
rolfb has joined #ruby-lang
chendo_ has quit [Ping timeout: 272 seconds]
chendo_ has joined #ruby-lang
<mfn>
Can I restart the application in pry when I'm in a pry session? I entered the session with "binding.pry" in my code; analysed some stuff and set a conditional breakpoint. But I'm already past this breakpoint; if a exit the session and restart my app -> breakpoint gone.
kuja_ has joined #ruby-lang
d3vic3_ has joined #ruby-lang
kuja has quit [*.net *.split]
jstemmer has quit [*.net *.split]
d3vic3 has quit [*.net *.split]
t52144 has quit [Remote host closed the connection]
t96942 has joined #ruby-lang
m3nd3s has joined #ruby-lang
chendo_ has quit [Ping timeout: 240 seconds]
<darix>
mfn: how about
<darix>
start application fresh with binding.pry very early
<darix>
set breakpoints
<darix>
and let it continue?
voker57 has joined #ruby-lang
voker57 has quit [Changing host]
voker57 has joined #ruby-lang
<mfn>
yes, I did this now. but I'd have to edit the source, then when I'm unlucky i may change line numbers; yep, it works. would be nice to restart the whole thing from pry without loosing breakpoints though
chendo_ has joined #ruby-lang
chendo_ has quit [Changing host]
chendo_ has joined #ruby-lang
IPGlider has quit []
tbuehlmann has quit [Remote host closed the connection]
machuga is now known as machuga|away
qwerxy has quit [Quit: offski]
chendo_ has quit [Ping timeout: 252 seconds]
voker57 has quit [Remote host closed the connection]
m3nd3s has quit [Read error: Connection timed out]
S1kx has joined #ruby-lang
S1kx has quit [Changing host]
S1kx has joined #ruby-lang
Virunga has joined #ruby-lang
Virunga has quit [Client Quit]
Virunga_ has joined #ruby-lang
m3nd3s has joined #ruby-lang
Virunga_ has quit [Client Quit]
Virunga has joined #ruby-lang
Virunga is now known as LennyLinux
t96942 has quit [Remote host closed the connection]
t52109 has joined #ruby-lang
robotmay has quit [Remote host closed the connection]
elux has joined #ruby-lang
jxie has quit [Quit: leaving]
Leeky is now known as Leeky_afk
saxy has joined #ruby-lang
Leeky_afk is now known as Leeky
josh^ has quit [Remote host closed the connection]
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
saxy has quit [Ping timeout: 246 seconds]
t52109 has quit [Remote host closed the connection]
t55789 has joined #ruby-lang
sailias has joined #ruby-lang
<erikh>
mfn: you should find banisterfiend and tell him that.
<erikh>
he's absolutely crazy and will try really hard to make that work
<rue|w>
That doesn’t really even sound hard
<rue|w>
Just maintain the list of breakpoints somewhere and re-eval
<zzak>
good morning!
<masterkorp>
zzak: good afternoon
saxy has joined #ruby-lang
mistym has quit [Remote host closed the connection]
t34536 has quit [Remote host closed the connection]
t8006 has joined #ruby-lang
bytephilia has joined #ruby-lang
luuuuu has joined #ruby-lang
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
slyphon has quit [Quit: WeeChat 0.3.7]
kvirani has joined #ruby-lang
gsav has joined #ruby-lang
luuuuu has quit []
deryl has quit [Quit: deryl]
m3nd3s has quit [Remote host closed the connection]
<mfn>
Using nokogiri, I've a code similar to http://pastie.org/4636285 ; shortened example of course, but basically that's it. I get 'Invalid retry' on that line and don't unterstand it; I thought I can force reevaluation of node.children.each ?
<darix>
mfn: maybe nodeset doesnt support "rewind"?
<darix>
mfn: what problem is your loop trying to solve?
<mfn>
darix: I iterate over the children of "node" and possibly remove children and thus need to do the loop again
<mfn>
hmm, maybe I don't really need to retry the loop .. will have to test
<darix>
well removing elements of an array while looping is tricky :)
<mfn>
exactly, that's why my first thought was to simply retry the whole operation .. but I just did a short test with nokogiri, seems to be fine. doc = Nokogiri::XML('<root><a></a><b></b><c></c>') and then doc.root.children.each { |child| p child; child.remove if child.name == 'b' }; still iterates over all children
saxy has quit [Remote host closed the connection]
<mfn>
darix: because you said "doesn't support rewind" -> ruby gives me a compile error. IMHO ruby doesn't know at this point whether node.children.each is going to be an iterator or not due it's dynamic nature
<mfn>
git describe --contains 860b40fd631f280fbc9164abdc36409dcfac7e27 # => v1_9_0_0~382 ; seems this was removed during the 1.9 release
rins has joined #ruby-lang
Oloryn_lt2 has joined #ruby-lang
m3nd3s has quit [Read error: Connection timed out]
m3nd3s has joined #ruby-lang
yats has quit [Ping timeout: 276 seconds]
deryl has joined #ruby-lang
adambeynon has joined #ruby-lang
stardiviner has joined #ruby-lang
t8006 has quit [Remote host closed the connection]
t91969 has joined #ruby-lang
m3nd3s has quit [Ping timeout: 244 seconds]
wmoxam_ has joined #ruby-lang
wmoxam has quit [Disconnected by services]
wmoxam_ has quit [Client Quit]
wmoxam has joined #ruby-lang
yankov has joined #ruby-lang
|Vargas| has quit [Quit: ...]
CoverSlide has joined #ruby-lang
<mfn>
ok, this is how I can "emulate" retry: begin; 1.upto(5) { |i| p i; sleep 0.5 ; raise Exception if i == 3}; rescue Exception; retry; end . Any better ideas? If I would understand catch/throw better I'd try it ...
CarlB_the_great has quit [Ping timeout: 245 seconds]
tenderlove has joined #ruby-lang
<injekt>
lol
<matti>
:>
NemesisD has joined #ruby-lang
Groomm has joined #ruby-lang
<NemesisD>
is there a global setting for which gcc to use when compiling gems? i'm using RVM and at some point I think i configured it to use gcc-4.6, i want to try 4.7 instead
<lianj>
hamster life, awesome
Weems has quit [Read error: Connection reset by peer]
alvaro_o has joined #ruby-lang
<NemesisD>
is it just whatever was used to compile ruby itself?
<injekt>
NemesisD: what executable is being called?
<rue>
Should be the one from rbconfig
<NemesisD>
injekt: /usr/bin/gcc-4.6, i want it to use /usr/bin/gcc
nXqd has quit [Ping timeout: 244 seconds]
Weems has joined #ruby-lang
Weems has quit [Changing host]
Weems has joined #ruby-lang
Groomm has quit [Client Quit]
<injekt>
NemesisD: what's in RbConfig::CONFIG['CC'] ?
gnufied has quit [Quit: Leaving.]
<NemesisD>
injekt: /usr/bin/gcc-4.6
<injekt>
there you go
<NemesisD>
how can i change that?
<injekt>
it's jut a hash ;)
<NemesisD>
but it persists to disk?
RomyRomy has joined #ruby-lang
cdt has quit [Quit: Ex-Chat]
havenn has joined #ruby-lang
CarlB_the_great has joined #ruby-lang
<injekt>
you need to change it for your rbconfig
alex_kira has quit [Remote host closed the connection]
<injekt>
er extconf sorry
<NemesisD>
injekt: i found an rbconfig in .rvm/src/ree-1.8.7-2012.02/source/rbconfig.rb but changing it has no effect, i don't have to rebuild the gem do i?
<injekt>
I'm pretty sure it's overidable by ENV though, maybe try CC=gcc when you try and built it
<injekt>
yes of course
<NemesisD>
whoops, i mean rebuild ruby*
<injekt>
oh no
<NemesisD>
hmm. so i could add CC=/usr/bin/gcc in my .zshrc, was just curious is there was a permanent way to do it with ruby without having to add that
<injekt>
RbConfig['CC'] is defined when you built ruby, I'm not sure how it persists
<NemesisD>
ah now i remember why i switched. when using gcc-4.7 installing a gem with native extensions, i just get an error "C compiler cannot create extensiosn"
lsegal has quit [Quit: Quit: Quit: Quit: Stack Overflow.]
gsav has quit [Quit: Lost terminal]
<NemesisD>
cannot create executables*
sn0wb1rd has quit [Quit: sn0wb1rd]
butchanton has joined #ruby-lang
<zzak>
NemesisD: you're using 1.8 right?
<injekt>
a wild zzak appears
slyphon is now known as slyphon_away
<zzak>
what version of rvm?
<zzak>
inkjet :D
savage- has joined #ruby-lang
<NemesisD>
zzak: ree 2012.02
<zzak>
NemesisD: using rvm-head?
Leeky_afk is now known as Leeky
<NemesisD>
haven't headed in a bit but i don't think thats the issue. the compile dies on the the configure step thinking my gcc can't create executables
zelezarof924 has joined #ruby-lang
<rue>
NemesisD: You should look at the actual make log to see where that error comes from
<zzak>
and what'd you try? CC=/usr/bin/gcc gem install whatever?
<rue>
Could certainly be a path issue but could be something else
<NemesisD>
zzak: yeah i did that
<zzak>
which gem?
<NemesisD>
zzak: ffi :( it'll happen with any native gem now though
<NemesisD>
oddly enough a lot of the output from my config.log is using the wrong gcc
alex_kira has quit [Remote host closed the connection]
banisterfiend has quit [Remote host closed the connection]
vlad_starkov has quit [Remote host closed the connection]
havenn has quit [Ping timeout: 276 seconds]
jstemmer has joined #ruby-lang
alvaro_o_ has joined #ruby-lang
carloslopes has joined #ruby-lang
alvaro_o has quit [Ping timeout: 240 seconds]
havenn has joined #ruby-lang
runeb has quit [Remote host closed the connection]
Carnage\ has joined #ruby-lang
neocoin has joined #ruby-lang
alex_kira has joined #ruby-lang
wallerdev has joined #ruby-lang
Skif has quit [Ping timeout: 240 seconds]
macmartine has quit [Quit: Computer has gone to sleep.]
Leeky_afk is now known as Leeky
MrPunkin has joined #ruby-lang
<MrPunkin>
Okay guys, using Tempfile to write a full file from a Net::HTTP response before moving it to its final file folder location so that zero / half-written files don't exist there. On smaller files if I don't 'read' the temp file within it's open block before copying it there is no data. What am I doing wrong? https://gist.github.com/3556509
<MrPunkin>
I was doing this all directly to the files, but if there was an error or anything I didn't want the files existing in their final location. I guess I could simply remove them in a rescue block if that were an issue.
<MrPunkin>
do I need to close it first in the block and unlink it in the ensure?
<andrewvos>
MrPunkin: Maybe copy the file *after* you have written to it.
<andrewvos>
MrPunkin: In other words, close it before you copy it.
<MrPunkin>
andrewvos: yep. that seemed to work
<andrewvos>
MrPunkin: I'm guessing that because it's such a small amount of data, it doesn't get flushed yet. Probably there's some sort of buffer size and it only gets written when this size is reached.
<MrPunkin>
yeah. working great now that I close it before moving it
<andrewvos>
Oh wow I didn't read the last two things you said.
<MrPunkin>
haha
* andrewvos
grabs coat
<MrPunkin>
its all good
<andrewvos>
Damn it. And that was the one time when I was almost useful here.
hhatch has quit [Quit: leaving]
runeb has joined #ruby-lang
runeb has quit [Remote host closed the connection]
Guest___ has left #ruby-lang [#ruby-lang]
nXqd has quit [Remote host closed the connection]
Guest___ has joined #ruby-lang
tim__ has joined #ruby-lang
Guest___ has left #ruby-lang [#ruby-lang]
dnadeau has joined #ruby-lang
<mfn>
wmoxam: so throw(:symbol, arg) lets the catch(:symbol) statement return the arg ?
<wmoxam>
yup
vlad_starkov has quit [Remote host closed the connection]
<mfn>
that's fancy. thanks again for the sample
krz has joined #ruby-lang
rue|w has joined #ruby-lang
voker57_ has joined #ruby-lang
areil has quit [Remote host closed the connection]
tjadc has quit [Ping timeout: 246 seconds]
voker57 has quit [Ping timeout: 246 seconds]
rue|w has quit [Ping timeout: 252 seconds]
rhizmoe has quit [Read error: Connection reset by peer]
rhizmoe has joined #ruby-lang
mohamad has joined #ruby-lang
mohamad has quit [Remote host closed the connection]
gsav has joined #ruby-lang
gsav__ has joined #ruby-lang
g0bl1n has joined #ruby-lang
gsav__ has quit [Client Quit]
gsav has quit [Client Quit]
rippa has joined #ruby-lang
tim__ has quit [Quit: Page closed]
havenn has quit [Remote host closed the connection]
kvirani has joined #ruby-lang
lcdhoffman has joined #ruby-lang
d3vic3_ has quit [Quit: leaving]
carloslopes has quit [Ping timeout: 260 seconds]
replore has quit [Remote host closed the connection]
tenderlove has quit [Remote host closed the connection]
Carnage\ has quit []
gregmore_ has joined #ruby-lang
tjadc has joined #ruby-lang
runeb has joined #ruby-lang
gregmoreno has quit [Ping timeout: 240 seconds]
havenn has joined #ruby-lang
gregmore_ has quit [Remote host closed the connection]
gregmoreno has joined #ruby-lang
havenn has quit [Remote host closed the connection]
m3nd3s has quit [Remote host closed the connection]
sandbags has quit [Remote host closed the connection]
mattonrails has joined #ruby-lang
t29174 has quit [Remote host closed the connection]
t22145 has joined #ruby-lang
devn has quit [Read error: Operation timed out]
no_i_wont has quit [Ping timeout: 246 seconds]
Carnage\ has joined #ruby-lang
anaconda99 has quit [Ping timeout: 245 seconds]
ldk has quit [Ping timeout: 245 seconds]
cid^ has quit [Ping timeout: 268 seconds]
mephux has quit [Ping timeout: 272 seconds]
djinni`_ has quit [Ping timeout: 276 seconds]
havenn has joined #ruby-lang
tallship has joined #ruby-lang
m3nd3s has joined #ruby-lang
m3nd3s has quit [Read error: Connection reset by peer]
m3nd3s has joined #ruby-lang
Musfuut has quit [Ping timeout: 250 seconds]
t22145 has quit [Remote host closed the connection]
Musfuut has joined #ruby-lang
t65423 has joined #ruby-lang
Musfuut is now known as Guest87705
bluemonk has quit [Ping timeout: 264 seconds]
bluemonk has joined #ruby-lang
rue|w has joined #ruby-lang
jxie has joined #ruby-lang
vlad_starkov has joined #ruby-lang
vlad_starkov has quit [Remote host closed the connection]