ChanServ changed the topic of #ruby-lang to: Ruby 1.9.3-p125: http://ruby-lang.org | Paste >3 lines of text on http://pastie.org or use a gist
_whitelogger has joined #ruby-lang
bryancp has joined #ruby-lang
benjammin891 has quit [Quit: Leaving]
ryez has joined #ruby-lang
steven has quit [Ping timeout: 248 seconds]
steven has joined #ruby-lang
thisirs has quit [Remote host closed the connection]
yumike has quit [Quit: Computer has gone to sleep.]
outoftime_ has joined #ruby-lang
brunocoe_ has joined #ruby-lang
brunocoelho has quit [Ping timeout: 246 seconds]
rfx has joined #ruby-lang
macmartine has joined #ruby-lang
<rfx> hi
macmartine has quit [Read error: Connection reset by peer]
<mistym> Hi, rfx
fgomez has joined #ruby-lang
macmartine has joined #ruby-lang
brunocoelho has joined #ruby-lang
rhodee has joined #ruby-lang
ryez has quit [Ping timeout: 245 seconds]
kunsel has joined #ruby-lang
brunocoe_ has quit [Ping timeout: 246 seconds]
ttilley is now known as ttilley_off
hackeron_ has quit [Quit: leaving]
hackeron has joined #ruby-lang
brunocoelho has quit [Read error: Connection reset by peer]
<rfx> I've worked with ruby a bit so far and not yet touched rails except some basic tutorial stuff. I want to write an application which is part web and part doing stuff "in the background" (in a thread). Background stuff is misc things, e.g. scanning directories for changes or getting some data request on non-web ports and eventually putting information back in a db.
RubyRedGirl has left #ruby-lang [#ruby-lang]
<hackeron> hey, this is a general gps qeustion, not specific to ruby, but maybe you guys can help :) - I have a ruby socket just doing server.gets(';') -- The lines I'm getting from the tracker look like this: imei:012497000372775,tracker,1206202237,,F,143745.000,A,5136.1991,N,00013.1538,E,0.00,,; -- any ideas how I would convert that to longitude and latitude decimals?
brunocoelho has joined #ruby-lang
<rfx> Ideally I don't want rely on cron for regular background tasks but provide everything "out of the box". I looked into sinatra and understand the minimal context how it works. However I'd like to use rails, but can't understand whether I've the same flexbility with it. Any ideas, pointers?
<oddmunds> hackeron: i'd assume the N,00013.1538,E,0.00 to be the long, lat
tbuehlmann has joined #ruby-lang
<hackeron> oddmunds: the long lat for the location is: 000.219230 and 51.603320 (this is what the tracker send ms as an SMS), but how do I get those from the format it uses to send the data to the TCP socket?
robotmay has quit [Ping timeout: 246 seconds]
wmoxam_ has quit [Quit: leaving]
wmoxam_ has joined #ruby-lang
banisterfiend has quit [Ping timeout: 252 seconds]
robotmay has joined #ruby-lang
cirenyc has joined #ruby-lang
<bnagy> weird
<bnagy> those numbers are too close to be a coincidence (before N and E)
<bnagy> maybe there's a fudge in there, or maybe it uses a weird long lat system?
<bnagy> what's A?
<hackeron> bnagy: I tried to type into google, it shows +51° 36' 13.20", +0° 13' 9.25"
<bnagy> ahh there we go
<hackeron> bnagy: which almost coincide with the 51361991 000131538, hmm
Eric_ has quit [Ping timeout: 272 seconds]
<hackeron> bnagy: but it's a little off, like a street off
kunsel|2 has joined #ruby-lang
nertzy has quit [Read error: Connection reset by peer]
yannis has joined #ruby-lang
msaffitz has joined #ruby-lang
<hackeron> bnagy: where as the sms coordinates are accurate
nertzy has joined #ruby-lang
<bnagy> but they're in a different format, no?
qwerxy has quit [Ping timeout: 244 seconds]
solars has quit [Ping timeout: 244 seconds]
<hackeron> bnagy: yeh, 51361991 000131538 -- being +51 36' 19.91", +000 13.15' 3.8"
<hackeron> very weird format
<bnagy> no like the sms coords are not in degree minute sec
<oddmunds> maybe it's adjusted for summer time
qwerxy has joined #ruby-lang
<hackeron> oddmunds: how do I make this adjustment?
<oddmunds> i was joking
<bnagy> also if you look at the seconds, 19 - 6 = 13 15 - 6= 9
ddfreyne has quit [Ping timeout: 248 seconds]
<bnagy> so I think the seconds are just glumped in somehow
kunsel has quit [Ping timeout: 244 seconds]
<hackeron> same time, same coords: From TCP: +51 36' 19.91" +0 13' 15.38"
<hackeron> Converted drom decimal SMS: +51° 36' 13.20", +0° 13' 9.25"
ddfreyne has joined #ruby-lang
akira989 has joined #ruby-lang
<bnagy> maybe try googling about converting long lat degree second to decimal or something
thone has joined #ruby-lang
<bnagy> it's virtually there
<bnagy> like both the seconds are ~600 out
thone_ has quit [Ping timeout: 264 seconds]
kunsel has joined #ruby-lang
msaffitz has quit [Quit: Computer has gone to sleep.]
<hackeron> bnagy: it is weird - I don't get it. maybe the last digit in the tracker isn't seconds? - the rest matches up
ezkl has joined #ruby-lang
rippa has joined #ruby-lang
<hackeron> this is what I'm getting:
<hackeron> SMS - 51.603320 000.219230 (lat/long) - +51° 36' 13.20", +0° 13' 9.25"
<hackeron> TCP - 51.605531 000.220942 (lat/long) - +51 36' 19.91", +0 13' 15.39" (Raw: A,5136.1991,N,00013.1538,E)
augustl has joined #ruby-lang
<hackeron> what is causing the seconds to be off? - I think I'm converting them wrong maybe?
<augustl> hi folks. I want to write some integration tests with Ruby. How do I best shell out to start a server, make the server run in the background so that my actual integration tests can run, and then kill the server afterwards?
kunsel|2 has quit [Ping timeout: 252 seconds]
<workmad3> hackeron: are you transferring floats?
bfreeman has quit [Quit: bfreeman]
<augustl> I suppose the server part is irrelevant, this is just about processes in general.
<hackeron> workmad3: I'm getting data like this from a GPS tracker: tracker,1206202314,,F,151404.000,A,5136.1991,N,00013.1538,E,0.00,,;
<hackeron> I think the format is DDDMM.mmmm / DDMM.mmmm
apeiros_ has quit [Remote host closed the connection]
florentg2 has joined #ruby-lang
<oddmunds> workmad3: maybe the sms-thing is doing something with floats
ben_m has joined #ruby-lang
<bnagy> hackeron: that raw looked exactly right? or are you just inferring the seconds?
<workmad3> hackeron: I was wondering if you were hitting float rounding issues
<augustl> in general it would be useful with the buide "Ruby I/O from a Node.JS perspective" :)
Fullmoon has quit [Quit: Fullmoon]
<augustl> I would also need to read stdin from my process so I can know when the server has actually started
<bnagy> hackeron: fuckit, subtract 600 and divide by 100 for your seconds
<bnagy> you're going to be within the accuracy of the satellite anyway
<hackeron> oh I think I get it, it is giving me minutes, not seconds
<hackeron> so I need to convert the 00013.1538 to be 0' 13.1538 minutes, so the 0.1538 is a minute, not number of seconds
jperry2_ has joined #ruby-lang
<bnagy> no it's 0 deg 13'
<bnagy> but (1538 - 600)/100 == 9.38
kunsel has quit []
<bnagy> which is about 5m out
Fullmoon has joined #ruby-lang
<bnagy> although more samples would help getting a fudgey algorithm
<hackeron> 13' and 0.1538 minutes - so that's 9.228 seconds
<hackeron> brb going to drive around and test :D
jperry2 has quit [Ping timeout: 260 seconds]
jperry2_ is now known as jperry2
<andrewvos> In god I want to have a process start, and when that process is running I want another process to launch. Any ideas how I do this?
kitallis has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
jxie has joined #ruby-lang
<bnagy> hackeron: that doesn't work out
<bnagy> if .1991 -> 13.2"
gsav has joined #ruby-lang
gouthamvel has joined #ruby-lang
gouthamvel has left #ruby-lang [#ruby-lang]
solars has joined #ruby-lang
kurko_ has quit [Ping timeout: 246 seconds]
stardiviner has joined #ruby-lang
kurko_ has joined #ruby-lang
Xzyx987X_ has joined #ruby-lang
stardiviner has quit [Client Quit]
Xzyx987X has quit [Ping timeout: 260 seconds]
cirenyc has quit [Quit: Leaving...]
awwaiid has quit [Ping timeout: 272 seconds]
awwaiid has joined #ruby-lang
tallship has quit [Ping timeout: 276 seconds]
wmoxam has quit [Disconnected by services]
wmoxam_ has quit [Quit: leaving]
wmoxam has joined #ruby-lang
lightcap has joined #ruby-lang
fgomez has quit [Quit: leaving]
judofyr has quit [Remote host closed the connection]
robotmay has quit [Remote host closed the connection]
carloslopes has joined #ruby-lang
<hackeron> bnagy: think I figured it out - I do DD+(mm.mmmmm/60.0) then I get 51.603320 000.21923 from SMS and 51.603318 000.219230 with my calculation
tallship has joined #ruby-lang
<hackeron> bnagy: pretty much spot on
kurko_ has quit [Ping timeout: 244 seconds]
<bnagy> hackeron: what does 5136.1991 turn into?
<bnagy> I thought it was supposed to turn into 51 36' 13.20" ?
<hackeron> bnagy: 51+(36.1991/60.0) = 51.603318333333334
<hackeron> bnagy: I just want to turn it into some usable format :)
msaffitz has joined #ruby-lang
ivanoats has joined #ruby-lang
ivanoats has quit [Read error: Connection reset by peer]
ivanoats has joined #ruby-lang
<bnagy> ok. I think it's no closer than my bizare mystery 6 second fudge :)
ivanoats has quit [Changing host]
ivanoats has joined #ruby-lang
apeiros_ has joined #ruby-lang
ivanoats has quit [Client Quit]
<hackeron> bnagy: you what? - it's practically spot on, heh - the 6 second judge was half a mile down the road, lol
<bnagy> 6 second put it within like 5 metres :)
<bnagy> 51 36 13.91
<hackeron> it wasn't 5 meters, it was 6 seconds away in each direction, that's like 36 meters :)
<bnagy> that's .7 secs out, ok which is 20 metres, so not so great
<bnagy> I don't know what the unit diffs work out to with those decimal converted ones though
brunocoelho has quit [Remote host closed the connection]
kurko_ has joined #ruby-lang
<hackeron> bnagy: 51+(36.1991/60.0) gives me the same result as sms (no visible difference on google map) and it's exactly where the car is parked, I'm happy with that :P
<bnagy> yeah but it's still not right :/ I want to KNOW
<hackeron> what's not right, lol?
sora_h is now known as s0ra_h
<hackeron> there is some inherit GPS drift - I don't think you can get away from that
<hackeron> also TCP is every 30 seconds, SMS is on demand when I call the tracker
<hackeron> so it wasn't sampled at the exact same time, it was a few seconds off
<bnagy> ah ok.. I thought they were 2 representations of the exact same event
<hackeron> I tried to request the SMS as soon as the coordinate was reported to the TCP socket, but yeh, it's not the exact same event I guess :)
<bnagy> ok well I guess that makes sense
<augustl> tried passing a StringIO to the :out of a Kernel.spawn, seems it's not supported. What should I do instead?
heftig has quit [Ping timeout: 245 seconds]
savage- has joined #ruby-lang
<augustl> not having much success with IO.popen either. Are there any guides I should read? :)
<Mon_Ouie> IO.popen(…) { |io| io.write your_string; …; io.read }
butchanton has joined #ruby-lang
<augustl> Mon_Ouie: what will io.read do?
<Mon_Ouie> Read the output of the command
<augustl> my command is long lived though, it's a server. So I need to get data from it as it runs.
sepp2k has joined #ruby-lang
<Mon_Ouie> You can use IO.select and read chunks of output as they come
<augustl> I'll look that up, thanks
qwerxy has quit [Ping timeout: 272 seconds]
<augustl> "See Kernel#select", heh
<augustl> that's the docs for Kernel#select in the kernel module docs :)
<Mon_Ouie> That bug has been fixed since then
fayimora has joined #ruby-lang
<augustl> are there any examples for how to use it?
<augustl> IO.popen("my thing") {|io| p IO.select([io]) } never prints anything it seems
<Mon_Ouie> Probably many examples, it's very commonly used with sockets (but can be used just the same way with pipes)
<Mon_Ouie> Oh, I have an example with Open3 (which isn't that different from popen)
ivanoats has joined #ruby-lang
fra000 has quit [Quit: Leaving]
kurko_ has quit [Ping timeout: 246 seconds]
<augustl> thanks
<augustl> hmm, `Open3.popen3("ruby ticker.rb") do |stdin, stdout, stderr, wait_thr| p IO.select([stdout, stderr]) end` still doesn't print anything
<Mon_Ouie> Does the command actually output something?
<augustl> yes
<Mon_Ouie> Can you show ticker.rb?
<augustl> it's a loop { puts "foo"; sleep 1; } type thing
<Mon_Ouie> Also it may need to flush its output
<Mon_Ouie> Try with $stdout.sync = true
<Mon_Ouie> (in ticker.rb)
<augustl> here's all of it http://pastie.org/4121294
<savage-> Mon_Ouie: Do you have any general rule that you follow for using {} vs. do/end for blocks?
<augustl> perhaps there are some libraries I can use so I don't have to talk directly to the stdlibs level of abstraction
<savage-> Mon_Ouie: It seems like some folks are using {} only when you care about the return value, otherwise do/end for "side-effect" type blocks
<augustl> savage-: some people use {} for single lines, do/end for multi lines
francisfish has quit [Remote host closed the connection]
kurko_ has joined #ruby-lang
<Mon_Ouie> I use the rule augustl mentioned
<Mon_Ouie> But I am aware of that other rule
<augustl> Mon_Ouie: fyi, my end goal is to use Ruby to write some integration tests, part of the setup is to start a sub process that is the server I'm integration testing
<augustl> I need to read out "Listening at port 34022" or something like that from the server, so I know when it's ready
<Mon_Ouie> Did you try my last advice (using $stdout.sync)?
<savage-> Cool.
<augustl> Mon_Ouie: cool, something changed :) It prints "[[#<IO:fd 7>], [], []]" once
outsmartin has joined #ruby-lang
cantonic_ has joined #ruby-lang
<Mon_Ouie> Yep, whenever it returns an IO in res[0], there's something to read for you
<augustl> with $stdout.sync = true, a plain "while line = stdout.gets" works too
bfreeman has joined #ruby-lang
<Mon_Ouie> It may be fine in your case, but blocking IO doesn't always do the job
<augustl> so the IO.sync stuff is what I can use to get notified when data is actually written by the sub process?
<Mon_Ouie> If IO#sync is true, whenever you write something, the output gets flushed
cantonic has quit [Ping timeout: 264 seconds]
cantonic_ is now known as cantonic
<augustl> and this is why they say Ruby is made for programmers, not computers? :)
msisk has quit [Ping timeout: 245 seconds]
vmoravec has quit [Quit: Leaving]
slyphon has joined #ruby-lang
umttumt has quit [Remote host closed the connection]
asahi has joined #ruby-lang
Criztian has joined #ruby-lang
<asahi> if I have an xpath, (something like '/html/body/div[2]/div'), how can I find the parent node of this?
<asahi> without using a regex
<lianj> .children?
burgestrand has joined #ruby-lang
<whitequark> hm
<whitequark> does Ripper.parse ever work?
<whitequark> Ripper.parse("whatever") # => nil
<savage-> Mon_Ouie: If you SIgnal#trap two different signals, is it possible to be executing those two signals if they get sent at the same time concurrently?
<lianj> asahi: oh parent. '..'
<savage-> Mon_Ouie: In other words, Ruby doesn't send one after the other, correct?
singpolyma has quit [Quit: Lost terminal]
<augustl> this seems to do the trick http://pastie.org/4121379
chrismcg is now known as zz_chrismcg
jacobwg has joined #ruby-lang
<asahi> lianj: thanks
msaffitz has quit [Ping timeout: 260 seconds]
outoftime_ has left #ruby-lang [#ruby-lang]
outoftime has joined #ruby-lang
tenderlove has joined #ruby-lang
<outoftime> testing...
<matti> outoftime: .
<outoftime> matti: indeed.
<matti> :)
<outoftime> i seem to have found myself (under the guise outoftime_) banned from this channel. was anyone around when this happened? someone else has been attempting to use my nick...
<outoftime> i promise i'm not naughty.
msaffitz has joined #ruby-lang
<matti> When was that?
<matti> Hi tenderlove
<tenderlove> HELLO!
<outoftime> matti: unclear. i was cool last night around midnight EST, then just noticed a couple minutes ago
<outoftime> er, EDT
<matti> outoftime: I do not see anybody banning you.
<outoftime> matti: it was outoftime_ that was banned. maybe it's unrelated to me altogether -- i was just signed in as outoftime_ because somebody was squatting on my real nick
<outoftime> so yeah i guess i won't worry about it as long as I'm not on anyone's s**t list : )
<matti> outoftime: See for yourself: http://pastebin.com/kk90XMWY
<workmad3> outoftime: if someone is squatting on your nick, you can reclaim it
<matti> outoftime: Unless it was different server after a split :)
<workmad3> outoftime: /msg nickserv identify <username> <password> followed by /msg nickserv ghost <username>
<outoftime> matti: quite so
<outoftime> workmad3: yep, that's why i'm here under my real nick now : )
<workmad3> :)
<hackeron> I have a regex question, I have a string "5136.2202" - the format is (d)dddmm.mmmm - I want to split the string to (d)dd and mm.mmmm -- so ["51","36.2202"] - I'm trying to do: "5136.2202".findall(/([0-9]*)([0-9][0-9]\.[0-9]$)/) but that doesn't seem to work. Any ideas?
lightcap has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
<matti> hackeron: '5136.2202'.match(/^(\d{2})(.+)/)[1,2]
<matti> hackeron: Add any modifications you can think of :)
<hackeron> '00013.1429'.match(/^(\d{2})(.+)/)[1,2]
<hackeron> => ["00", "013.1429"]
<hackeron> should be ["000", "13.1429"]
brianpWins has joined #ruby-lang
<matti> hackeron: [19:00:15] < matti> hackeron: Add any modifications you can think of :)
<hackeron> heh, trying :)
<erikh> \d{2,3}
cdt has quit [Quit: Ex-Chat]
<matti> erikh: ;p
<erikh> will take at minimum 2, maximum 3.
<erikh> corundum: quickref?
<hackeron> if I do \d{2,3} I get: '5136.2202'.match(/^(\d{2,3})(.+)/)[1,2]
<hackeron> => ["513", "6.2202"]
<erikh> hackeron: ^ read that
<erikh> it covers regex stanzas pretty well
zmack has quit [Remote host closed the connection]
<matti> Mind you, this one might be annoying to get right.
<matti> Your use-cases do vary.
<workmad3> hackeron: /^(\d{2,3})(\d{2}\.\d+)$/
singpolyma has joined #ruby-lang
<matti> Hehe
<hackeron> workmad3: hmm, that seems to have done it :)
<matti> workmad3 wins a toaster!
<workmad3> woo!
<matti> Yeah.
<workmad3> wait, I bought one only a few days ago, I don't need a new one
<hackeron> you deserve 2 :)
<matti> Hehe
<workmad3> hackeron: the thing you missed is that regexs try to be 'greedy'
<erikh> mastering regular expressions. purchase this.
<workmad3> hackeron: so your \d{2,3} was grabbing 3 digits whenever possible
<workmad3> hackeron: and then the rest was just being matched by the second .+
<matti> And workmad3 is telling you all the secrets.
<matti> I will be jobless ;/
gnufied has quit [Quit: Leaving.]
<workmad3> matti: if your job depends on knowing this sort of regex stuff when noone else does... you deserve to lose your job :P
<matti> workmad3: :(
<erikh> ow.
bglusman has joined #ruby-lang
<matti> workmad3: Harsh.
<workmad3> matti: but fair ;)
* matti is crying because of workmad3
<erikh> heh
<workmad3> my work here is done :)
<workmad3> partly because it's time to go home :P
ivanoats has quit [Quit: Leaving...]
JohnBat26 has joined #ruby-lang
badfish129 has joined #ruby-lang
workmad3 has quit [Ping timeout: 248 seconds]
brianpWins has quit [Read error: Connection reset by peer]
brianpWins has joined #ruby-lang
jakko has quit [Remote host closed the connection]
jakko has joined #ruby-lang
heftig has joined #ruby-lang
voker57 has joined #ruby-lang
voker57 has quit [Changing host]
voker57 has joined #ruby-lang
kurko_ has quit [Quit: This computer has gone to sleep]
tenderlove has quit [Read error: Connection reset by peer]
tenderlove has joined #ruby-lang
qwerxy has joined #ruby-lang
kurko_ has joined #ruby-lang
tenderlove has quit [Read error: Connection reset by peer]
tenderlove has joined #ruby-lang
_br_ has joined #ruby-lang
ivanoats has joined #ruby-lang
dejongge has quit [Ping timeout: 246 seconds]
tzvi|netbook has joined #ruby-lang
jacobwg has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
Dreamer3 has quit [Quit: Leaving...]
sailias has quit [Ping timeout: 240 seconds]
dhruvasagar has quit [Ping timeout: 276 seconds]
<augustl> I'm using Open3.popen3 to start a new process. It doesn't seem to die along with my top level ruby process. How can I set that up?
<augustl> currently wrapping everything in a begin/ensure/end block
<hackeron> quick question about GPS, whenever I am driving, the GPS tracker reports 2 numbers, for example 24.86 (speed?) and 155.06 -- what do you think could be the second number? - It isn't reported when the vehicle is stationary
tzvi|work has joined #ruby-lang
fayimora has quit [Quit: Busy…..zzzzz]
jarred has joined #ruby-lang
kurko_ has quit [Quit: This computer has gone to sleep]
brunocoelho has joined #ruby-lang
M4g1c5t0rM1 has joined #ruby-lang
sockmonk has joined #ruby-lang
naz has quit [Quit: Leaving]
dhruvasagar has joined #ruby-lang
M4g1c5t0rM has quit [Ping timeout: 248 seconds]
countdigi has quit [Remote host closed the connection]
countdigi has joined #ruby-lang
r0bby has joined #ruby-lang
robbyoconnor has quit [Ping timeout: 272 seconds]
elux has joined #ruby-lang
kurko_ has joined #ruby-lang
fayimora has joined #ruby-lang
futurechimp has quit [Quit: Leaving]
rhodee has quit [Quit: rhodee]
tzvi|netbook has quit [Ping timeout: 246 seconds]
<burgestrand> hackeron: baring?
<burgestrand> like, uh, direction
<erikh> augustl: trap SIGCHLD, or maybe it double-forks?
<augustl> erikh: not sure what it does :)
<hackeron> burgestrand: yeh, I think it is, it is never more than 359
<burgestrand> hackeron: :)
<hackeron> burgestrand: thanks :)
rhodee has joined #ruby-lang
burgestrand has quit [Ping timeout: 245 seconds]
anjen has joined #ruby-lang
r0bby has quit [Ping timeout: 246 seconds]
r0bby has joined #ruby-lang
tommyvyo has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
r0bby_ has joined #ruby-lang
r0bby has quit [Ping timeout: 260 seconds]
ivanoats has quit [Quit: Linkinus - http://linkinus.com]
wasnotrice is now known as zz_wasnotrice
robbyoconnor has joined #ruby-lang
workmad3 has joined #ruby-lang
vesan has quit [Read error: Connection reset by peer]
brunocoelho has quit [Remote host closed the connection]
r0bby_ has quit [Ping timeout: 246 seconds]
imperator has joined #ruby-lang
rhodee has quit [Quit: rhodee]
r0bby has joined #ruby-lang
qpingu has joined #ruby-lang
<imperator> what's the ruby rabbitmq client lib of choice these days?
burgestrand has joined #ruby-lang
robbyoconnor has quit [Ping timeout: 246 seconds]
robotmay has joined #ruby-lang
heftig has quit [Ping timeout: 248 seconds]
heftig_ has joined #ruby-lang
benanne has joined #ruby-lang
<imperator> bnagy, inspired by your question (about the WaitForSingleObject timeout), version 0.7.0 of win32-process will let you set the timeout value, the dll module and the exit proc if you like
workmad3 has quit [Ping timeout: 245 seconds]
anjen has quit [Quit: anjen]
riffraff has quit [Quit: This computer has gone to sleep]
yannis has quit [Quit: Bye!]
pygmael has quit [Ping timeout: 240 seconds]
r0bby is now known as robbyoconnor
<rue> imperator: Ask antares on #travis… I think it’s hot bunnies or something like that
qwerxy has quit [Quit: offski]
<rue> Or, well, he’s probably on other channels too, come to think of it. Like #rabbitmq maybe but anyway
ryanf has joined #ruby-lang
jacobwg has joined #ruby-lang
<imperator> rue, looks like hot_bunnies is the java/jruby client, but i'll try bunny, thanks
workmad3 has joined #ruby-lang
tallship has quit [Ping timeout: 240 seconds]
tommyvyo_ has joined #ruby-lang
fayimora_ has joined #ruby-lang
heftig_ is now known as heftig
fayimora has quit [Ping timeout: 250 seconds]
fayimora_ is now known as fayimora
fayimora_ has joined #ruby-lang
sailias has joined #ruby-lang
francisfish has joined #ruby-lang
<imperator> (or maybe i'll just try it with jruby)
fayimora has quit [Ping timeout: 250 seconds]
fayimora_ is now known as fayimora
<rue> JRuby is pretty awesome now
fayimora_ has joined #ruby-lang
Axsuul has joined #ruby-lang
tallship has joined #ruby-lang
coryf has joined #ruby-lang
fayimora has quit [Ping timeout: 248 seconds]
fayimora_ is now known as fayimora
<jacobwg> Anyone gotten mina (https://github.com/nadarei/mina) working with rbenv?
cjs226 has joined #ruby-lang
ruurd has quit [Quit: Leaving...]
elux has quit [Quit: Bye!]
tenderlove has quit [Remote host closed the connection]
kurko__ has joined #ruby-lang
rhodee has joined #ruby-lang
rhodee has quit [Client Quit]
kurko__ has quit [Ping timeout: 244 seconds]
workmad3 has quit [Ping timeout: 260 seconds]
rhodee has joined #ruby-lang
kurko__ has joined #ruby-lang
msaffitz has quit [Quit: Computer has gone to sleep.]
Skif has joined #ruby-lang
benanne has quit [Ping timeout: 252 seconds]
kurko__ has quit [Ping timeout: 255 seconds]
florentg2 has quit [Ping timeout: 246 seconds]
kurko__ has joined #ruby-lang
pygmael has joined #ruby-lang
vesan has joined #ruby-lang
robin850 has quit [Quit: Konversation terminated!]
florentg2 has joined #ruby-lang
rhodee has left #ruby-lang [#ruby-lang]
brunocoelho has joined #ruby-lang
perryh is now known as perry
fayimora has quit [Quit: Busy…..zzzzz]
benanne has joined #ruby-lang
pygmael has quit [Ping timeout: 265 seconds]
jakko has quit [Ping timeout: 265 seconds]
pygmael has joined #ruby-lang
publicvoid__ has joined #ruby-lang
fayimora has joined #ruby-lang
kurko__ has quit [Ping timeout: 246 seconds]
dejongge has joined #ruby-lang
kurko__ has joined #ruby-lang
tenderlove has joined #ruby-lang
QaDeS has joined #ruby-lang
jperry2 has quit [Remote host closed the connection]
jperry2 has joined #ruby-lang
Natch has quit [Read error: Connection reset by peer]
Natch has joined #ruby-lang
outsmartin has quit [Quit: Leaving.]
zmack has joined #ruby-lang
wallerdev has joined #ruby-lang
hahuang65 has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
naz has joined #ruby-lang
sepp2k has quit [Ping timeout: 246 seconds]
andrew__ has joined #ruby-lang
sockmonk has left #ruby-lang ["ERC Version 5.3 (IRC client for Emacs)"]
JohnBat26 has quit [Read error: Operation timed out]
kurko___ has joined #ruby-lang
kurko__ has quit [Ping timeout: 260 seconds]
sailias has quit [Quit: Leaving.]
stamina has quit [Quit: Lost terminal]
kurko___ has quit [Ping timeout: 246 seconds]
kurko__ has joined #ruby-lang
woollyams has joined #ruby-lang
carloslopes has quit [Quit: Leaving.]
workmad3 has joined #ruby-lang
mark_locklear has quit [Remote host closed the connection]
woollyams has quit [Client Quit]
rippa has quit [Ping timeout: 245 seconds]
sepp2k has joined #ruby-lang
neocoin has quit [Remote host closed the connection]
ryanf has quit [Quit: Lost terminal]
ryanf has joined #ruby-lang
cdt has joined #ruby-lang
Hakon|mbp has quit [Quit: Leaving...]
francisfish has quit [Remote host closed the connection]
perry is now known as perryh_away
jperry2 has quit [Ping timeout: 246 seconds]
shevy has joined #ruby-lang
digitalbane has left #ruby-lang [#ruby-lang]
kurko___ has joined #ruby-lang
rowanu has quit [Ping timeout: 276 seconds]
solars has quit [Ping timeout: 244 seconds]
kurko__ has quit [Ping timeout: 276 seconds]
workmad3 has quit [Ping timeout: 272 seconds]
telemachus has quit [Ping timeout: 244 seconds]
hynkle has quit [Read error: Connection reset by peer]
hynkle has joined #ruby-lang
imperator has quit [Ping timeout: 248 seconds]
francisfish has joined #ruby-lang
kurko___ has quit [Ping timeout: 246 seconds]
zz_wasnotrice is now known as wasnotrice
kurko__ has joined #ruby-lang
tommyvyo_ has quit [Quit: Computer has gone to sleep.]
francisfish has quit [Read error: Connection reset by peer]
francisfish has joined #ruby-lang
kurko___ has joined #ruby-lang
hynkle has quit [Quit: hynkle]
kurko__ has quit [Ping timeout: 276 seconds]
kurko___ has quit [Client Quit]
tcopp has quit [Quit: Lost terminal]
telemachus has joined #ruby-lang
andrew__ is now known as andrewhl
jbsan_ has joined #ruby-lang
setmeaway has quit [Ping timeout: 250 seconds]
jbsan has quit [Ping timeout: 245 seconds]
jbsan_ is now known as jbsan
kurko__ has joined #ruby-lang
kyrylo has joined #ruby-lang
kyrylo has quit [Changing host]
kyrylo has joined #ruby-lang
msaffitz has joined #ruby-lang
kurko_ has quit [Ping timeout: 246 seconds]
mssola has quit [Quit: Konversation terminated!]
francisfish has quit [Remote host closed the connection]
tomb_ has quit [Quit: Computer has gone to sleep.]
sailias has joined #ruby-lang
s0ra_h is now known as sora_h
ezkl has quit []
msaffitz has quit [Quit: Computer has gone to sleep.]
tenderlove has quit [Remote host closed the connection]
tenderlove has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
<tonni> with Array.each - how can I detect if the iteration has reached the last element in the array?
<apeiros_> tonni: you can't really. what do you want to do?
tenderlo_ has joined #ruby-lang
bglusman has quit [Remote host closed the connection]
<apeiros_> ary[0..-2].each, ary.last - maybe these two can help you?
<tonni> apeiros_: I'm matching each element and want to perform some action if no match was found
<drbrain> tonni: each_cons?
<drbrain> tonni: combination?
<tonni> I'll have a look
<drbrain> tonni: or do you want select?
<drbrain> (or find)
<lianj> or none?
<apeiros_> tonni: what do you mean by "match"?
<tonni> if x == y
<lianj> [1,2].inclue?(1)
<lianj> *d
<apeiros_> tonni: so something akin: ary.each do |x| if x == y then do_stuff end end
<drbrain> +d
tenderlove has quit [Ping timeout: 245 seconds]
<apeiros_> and now you want to do something if no x was ever == y ?
sailias has quit [Quit: Leaving.]
sailias has joined #ruby-lang
wmoxam has quit [Ping timeout: 255 seconds]
dv310p3r has quit [Ping timeout: 244 seconds]
mistym has quit [Remote host closed the connection]
sailias has quit [Client Quit]
<tonni> [[1,2,3],[4,5,6],[7,8,9]].each {|x,y,z| break "MATCH" if x == x` && y == y` && z == z`; puts "END" if <last element checked }
<tonni> guess its just a stupid construct
<apeiros_> uh
<apeiros_> use find for that
<apeiros_> and if find returns nil, you can do whatever you need to do if nothing can be found
<drbrain> puts a.find([x, y, z]) ? "MATCH" : "END"
<lianj> [[1,2,3],[4,5,6],[7,8,9]].include?([x,y,z])
<tonni> well, x and y is files that I check with File.fnmatch
<apeiros_> or yes, include?
<drbrain> tonni: use find with a block
tzvi|work has quit [Remote host closed the connection]
bryancp has quit [Remote host closed the connection]
<tonni> thanks, I will investigate your suggestions
jacobwg has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
yxhuvud has quit [Ping timeout: 255 seconds]
<tonni> how do you split a long if-statement into multiple lines - have been looking through some style guides with no result
<drbrain> x = … long stuff …; if x then … end
<drbrain> that and turning an Array into an Object that responds sensibly to #==
Criztian has quit [Remote host closed the connection]
sora_h is now known as s0ra_h
Kero has quit [Ping timeout: 246 seconds]
wpaulson has joined #ruby-lang
<erikh> def x; long stuff; end; do_stuff if x
<cout> ^
<erikh> METHOD ALL THE THINGS
<apeiros_> erikh needs a meme-pic… :)
<erikh> drbrain: make corundum use the meme generator
<tonni> if File.fnmatch(File.join(cfg["paths"]["repos"], repo.gsub("repo=", "")), ssh_repo) && File.fnmatch(File.join(cfg["paths"]["keys"], user.gsub("user=", "")), File.join(cfg["paths"]["keys"], ssh_key)); ...; end
<tonni> sorry to blind you :)
<tbuehlmann> that's so dirty
<drbrain> tonni: make cfg["paths"] an object
<tonni> drbrain: I'm not sure what you mean
neocoin has joined #ruby-lang
<tonni> cfg is just a hash
brushbox has joined #ruby-lang
postmodern has joined #ruby-lang
<cout> tonni: don't be afraid to assign to local variables
<cout> when you use a variable, you give something a name
<tonni> cout: right, I guess thats part of my problem :)
<cout> and according to matz, if a thing doesn't have a name, it doesn't have a right to be
coryf has quit [Remote host closed the connection]
<drbrain> tonni: a hash + methods that work with it are semantically equivalent to an class
srbartlett has quit [Remote host closed the connection]
brushbox has quit [Client Quit]
Faris has joined #ruby-lang
butchanton has quit [Quit: Leaving.]
<tonni> drbrain: I'm confused and mussing the point, sorry
<tonni> missing even
<erikh> tonni: how much OOP have you done?
<drbrain> tonni: so you have this: File.fnmatch(File.join(cfg["paths"]["repos"], repo.gsub("repo=", "")), ssh_repo)
<erikh> you can think of an object and its methods and its instance variables as a fancy struct
<erikh> in fact, that's what C++ calls it for some cases.
Boohbah has joined #ruby-lang
<erikh> a hash table with named keys is just a variable size struct.
<erikh> ergo...
<drbrain> which is doing something with cfg["paths"]["repos"]
<drbrain> and the same for "keys"
toretore has quit [Quit: Leaving]
wasnotrice is now known as zz_wasnotrice
ilyam has joined #ruby-lang
<drbrain> so you can take cfg["paths"] and create an object that performs the Fnmatch for each item
<drbrain> like erikh suggested, you can start with a method that wraps that up
florentg2 has quit [Quit: florentg2]
<drbrain> def match_paths paths, ssh_repo, ssh_key, …; File.fnmatch(paths["repos"] …) and File.fnmatch … end
<tonni> hmm
<outoftime> other than faraday, are there any well-maintained libraries to provide a common interface to the various widely-used HTTP libraries?
zz_chrismcg is now known as chrismcg
<drbrain> I assume you do other things with cfg["paths"] as well, so you can make similar methods that accept paths as a first argument
<drbrain> then wrap them up in the Object and swap the paths argument for an instance variable
<tonni> I'm no stranger to OOP - but this I don't understand :(
<tonni> are suggesting that a create a simple method for evaluating the paths ?
wpaulson has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
<drbrain> tonni: start with that, yes
rowanu has joined #ruby-lang
rowanu has quit [Remote host closed the connection]
juanvieira has joined #ruby-lang
apeiros_ has quit [Remote host closed the connection]
juanvieira has quit [Quit: juanvieira]
<tonni> drbrain: or something like Paths.repo.fnmatch(pattern) ?
<drbrain> tonni: sure
wardrop has joined #ruby-lang
<tonni> drbrain: I'm asking what you meant :)
wardrop has left #ruby-lang [#ruby-lang]
<drbrain> tonni: where exactly the method lives isn't really a big deal
<tonni> oki
<drbrain> tonni: put it where it makes sense to you, be that in the same object your test code lives, or in a separate object
<drbrain> tonni: you may decide in the future it makes more sense in a different spot, so you can move it around then
<tonni> sure
<tonni> it makes sense - I just got confused :)
dhruvasagar has quit [Ping timeout: 260 seconds]
r0bby_ has joined #ruby-lang
robbyoconnor has quit [Ping timeout: 244 seconds]
Hakon|mbp has joined #ruby-lang
chrismcg is now known as zz_chrismcg
outoftime has quit [Quit: Leaving]
msaffitz has joined #ruby-lang
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
fayimora has quit [Read error: Operation timed out]
saLOUt has joined #ruby-lang
benanne has quit [Quit: kbai]
dejongge has quit [Ping timeout: 240 seconds]
fayimora has joined #ruby-lang
srbartlett has joined #ruby-lang
brunocoelho has quit [Remote host closed the connection]
s0ra_h is now known as sora_h
badfish129 has quit [Quit: badfish129]
badfish129 has joined #ruby-lang
robotmay has quit [Remote host closed the connection]
mikkelb has joined #ruby-lang
<mikkelb> Slightly off topic but - at https://gist.github.com/2900419 (zsh renaming script) - how do I prevent rule 3 from converting two or more underscores to -? They should be _.
<mikkelb> (was gonna do it in Ruby but I figured it'd be overkill - kinda like taking a supersonic jet to visit your next door neighbor :-P)
shevy has left #ruby-lang ["I'll be back ... maybe"]
zmack has quit [Remote host closed the connection]
brushbox has joined #ruby-lang
macmartine has quit [Quit: macmartine]
<zenspider> mikkelb: I use a very old perl script for file renaming. works great so I've not touched it since.
<zenspider> basically it takes a s/// as an arg and then evals that over all the file names and calls rename with the result
<zenspider> from the original perl book
<mikkelb> zenspider: cool
msaffitz has quit [Quit: Computer has gone to sleep.]
<zenspider> it's only 16 lines long and very powerful as a result
tintin has joined #ruby-lang
<ben_m> zenspider, no strict? D:
<tintin> zenspider: Hi,
<tintin> zenspider: Do you use ruby on rails too?
<mikkelb> zenspider: nice script
<mikkelb> zenspider: would you happen to know what to do with mine though?
<tintin> Is this the forum for ruby developers? http://www.ruby-forum.com/forum/ruby-core
<tintin> Or this? http://www.ruby-forum.com/forum/15 to get support from ruby devs?
<ironcamel> mikkelb, zenspider, there is a pretty powerful command line tool named rename
<mikkelb> ironcamel: I'm happy with mine, I just need to fix one regex
<tintin> I don't use rename, normally i use mv :)
<ironcamel> mikkelb: rename is written in perl as well, and takes a regex as an argument
<mikkelb> ironcamel: Mine is made especially for my purpose which is to rename large MP3 collections: see their filenames https://gist.github.com/2900419
<zenspider> ben_m: meh. who cares.
<zenspider> mikkelb: I don't know zsh. sorry.
<tintin> zenspider: Do you use ruby on rails?
<mikkelb> cool thanks though
<tintin> To test or debug code what do you use?
<zenspider> tintin: please stop asking me inane questions for hours on end.
<tintin> zenspider: I asked that because i got zenspider.com
<tintin> with rails connectin somewhere
<postmodern> tintin, use irb to test code manually
<postmodern> tintin, to debug, ruby 1.9 has a builtin debugger. Just "require 'debug'"
<tintin> Which forum is used to discuss about devs?
<zenspider> postmodern: (so does 1.8)
<postmodern> tintin, also there's Pry, http://pry.github.com/
<postmodern> zenspider, holy cow, i didn't realize it was added to 1.8.7
<postmodern> zenspider, thought it showed up in 1.9.1
<postmodern> or 1.9.0
<zenspider> ruby_1_4/lib/debug.rb
sepp2k has quit [Remote host closed the connection]
<postmodern> knowing is half the battle
imperator has joined #ruby-lang
<tintin> There is a vm.c
<tintin> vm_exec.c and other vm_...c
<tintin> Which one is for virtual machine work
mistym has quit [Remote host closed the connection]