apeiros changed the topic of #ruby-lang to: Ruby 2.0.0-p247: http://ruby-lang.org (Ruby 1.9.3-p448) || Paste >3 lines of text on http://gist.github.com
bradsmit_ has quit [Remote host closed the connection]
sascha_d has quit [Quit: obai]
arooni-mobile has quit [Ping timeout: 240 seconds]
mdedetrich has joined #ruby-lang
marr has quit [Ping timeout: 264 seconds]
glebm has quit [Quit: Textual IRC Client: www.textualapp.com]
Mon_Ouie has quit [Ping timeout: 276 seconds]
chimkan has quit [Quit: chimkan]
dumfries has quit [Ping timeout: 248 seconds]
yfeldblum has quit [Ping timeout: 240 seconds]
dumfries has joined #ruby-lang
hahuang65 has quit [Ping timeout: 246 seconds]
chimkan has joined #ruby-lang
malev has quit [Remote host closed the connection]
zomgbie has joined #ruby-lang
zomgbie has quit [Ping timeout: 246 seconds]
yfeldblum has joined #ruby-lang
arooni-mobile has joined #ruby-lang
hinbody has quit [Ping timeout: 256 seconds]
havenwood has joined #ruby-lang
havenn has joined #ruby-lang
havenwood has quit [Ping timeout: 256 seconds]
barami has joined #ruby-lang
kstuart has quit [Ping timeout: 248 seconds]
apeiros has quit [Remote host closed the connection]
apeiros has joined #ruby-lang
sush24 has joined #ruby-lang
ohsix has quit [Ping timeout: 276 seconds]
ffio has joined #ruby-lang
bradsmith has joined #ruby-lang
bradsmith has quit [Ping timeout: 264 seconds]
sush24 has quit [Quit: This computer has gone to sleep]
nivanson has quit [Remote host closed the connection]
s1kx has joined #ruby-lang
nivanson has joined #ruby-lang
geopet has joined #ruby-lang
havenn has quit [Remote host closed the connection]
havenwood has joined #ruby-lang
havenwood has quit [Ping timeout: 240 seconds]
Krowbar has joined #ruby-lang
symm- has quit [Ping timeout: 264 seconds]
kurko__ has quit [Quit: Computer has gone to sleep.]
skmp has quit [Quit: Leaving.]
geopet has quit [Quit: geopet]
arooni-mobile has quit [Ping timeout: 240 seconds]
geopet has joined #ruby-lang
arooni-mobile has joined #ruby-lang
DefV has quit [Ping timeout: 264 seconds]
Jan_ has joined #ruby-lang
Jan_ is now known as Guest42307
barami has left #ruby-lang [#ruby-lang]
geopet has quit [Quit: geopet]
tenderlove has joined #ruby-lang
GeissT has joined #ruby-lang
cads has joined #ruby-lang
heftig has quit [Read error: Connection reset by peer]
heftig has joined #ruby-lang
Krowbar has quit [Quit: Leaving]
joshuawscott has joined #ruby-lang
ffio has quit [Ping timeout: 248 seconds]
dhruvasagar has joined #ruby-lang
chimkan has quit [Quit: chimkan]
dhruvasagar has quit [Ping timeout: 240 seconds]
chimkan has joined #ruby-lang
hahuang65 has joined #ruby-lang
kurko__ has joined #ruby-lang
tkuchiki has joined #ruby-lang
nathanstitt has quit [Quit: I growing sleepy]
LauraE has joined #ruby-lang
LauraE has left #ruby-lang [#ruby-lang]
rippa has joined #ruby-lang
sascha_d has joined #ruby-lang
joshuawscott has quit [Quit: Leaving.]
kurko__ has quit [Quit: Computer has gone to sleep.]
havenwood has joined #ruby-lang
scottschecter has quit [Ping timeout: 248 seconds]
ffio has joined #ruby-lang
havenn has joined #ruby-lang
arooni-mobile has quit [Remote host closed the connection]
havenwood has quit [Ping timeout: 264 seconds]
tomzx_mac has quit [Ping timeout: 276 seconds]
MarianM has joined #ruby-lang
MarianM has quit [Client Quit]
duckinatorr has joined #ruby-lang
duckinatorr is now known as duckinator
io_syl has quit [Quit: io_syl]
io_syl has joined #ruby-lang
tenderlove has quit [Remote host closed the connection]
pipework has joined #ruby-lang
mistym has joined #ruby-lang
scottschecter has joined #ruby-lang
bradsmith has joined #ruby-lang
geopet has joined #ruby-lang
Modred has joined #ruby-lang
imperator has joined #ruby-lang
tenderlove has joined #ruby-lang
beerdy has quit [Remote host closed the connection]
chimkan has quit [Quit: chimkan]
ohsix has joined #ruby-lang
tenderlove has quit [Ping timeout: 246 seconds]
Modred has left #ruby-lang [#ruby-lang]
yfeldblum has quit [Read error: Operation timed out]
yfeldblum has joined #ruby-lang
eoinkelly_ has joined #ruby-lang
yfeldblum has quit [Ping timeout: 264 seconds]
havenn has quit [Ping timeout: 256 seconds]
ffio has quit [Quit: WeeChat 0.4.1]
<zzak> zenspider: ##
yfeldblum has joined #ruby-lang
<imperator> evenin'
mistym has quit [Remote host closed the connection]
mistym has joined #ruby-lang
mdedetrich has quit [Quit: Computer has gone to sleep.]
yfeldblum has quit [Ping timeout: 264 seconds]
<bnagy> imperator: ltns
<bnagy> what you been workin on?
henrikhodne has joined #ruby-lang
<imperator> bnagy, mostly my latest game: http://www.boardgamegeek.com/boardgame/136955/hands-in-the-sea
<imperator> but also converting the rest of the win32utils stuff over to ffi
jonahR has joined #ruby-lang
<imperator> you?
<bnagy> slowly fixing internal stuff
<bnagy> trying to take a bunch of hacky crap and turn it into actual software
<bnagy> win32 stuff is all on github? I need to take a look, get more ffi tips :P
<imperator> that can be fun; at least i like doing stuff like that
<imperator> yep, all on github, typically in "ffI" branch
tkuchiki has quit [Remote host closed the connection]
<imperator> er ffi
tkuchiki has joined #ruby-lang
<bnagy> yeah the bad part is documentation, for me :(
<bnagy> like, stuff for people that can't read code or rdoc
<bnagy> PITA
<imperator> eh, you can generate the code from rdoc, can't you?
<imperator> er, docs
<imperator> i suppose not high level instructions, though
<bnagy> yeah, wiki style walkthrough stuff
<bnagy> which also means the code itself has to be several notches more robust than I'm comfortable with
tkuchiki has quit [Ping timeout: 240 seconds]
<gnufied> what are you building bnagy?
<gnufied> all this secret ffi stuff piques my curiosity
tkuchiki has joined #ruby-lang
<bnagy> I write systems for concurrent fuzzing
<bnagy> usually I only need FFI at the pointy end
<gnufied> "The first Punic War"
<gnufied> amazing stuff
tenderlove has joined #ruby-lang
<gnufied> A friend of mine keeps trying to get me into War gaming
<gnufied> err wargaming
<imperator> gnufied, thanks
<imperator> plenty of introductory wargames, if you're interested
<imperator> so you don't have to go straight to the monsters
<imperator> my game there is very much a "light" wargame, pretty euro-y in some ways
tenderlove has quit [Ping timeout: 264 seconds]
mdedetrich has joined #ruby-lang
dhruvasagar has joined #ruby-lang
<imperator> gnufied, you play euros?
geopet has quit [Quit: geopet]
s1kx has quit [Quit: s1kx]
<imperator> guess he went to bed ;)
zmike123 has joined #ruby-lang
apeiros has quit [Remote host closed the connection]
apeiros has joined #ruby-lang
dhruvasagar has quit [Read error: Connection reset by peer]
vlad_starkov has joined #ruby-lang
mdedetrich has quit [Quit: Computer has gone to sleep.]
krz has joined #ruby-lang
vlad_starkov has quit [Ping timeout: 264 seconds]
bradsmith has quit [Remote host closed the connection]
bradsmith has joined #ruby-lang
bradsmith has quit [Remote host closed the connection]
D9 has joined #ruby-lang
tenderlove has joined #ruby-lang
tenderlove has quit [Ping timeout: 256 seconds]
bradsmith has joined #ruby-lang
mistym has quit [Remote host closed the connection]
dc5ala has joined #ruby-lang
apeiros has quit [Remote host closed the connection]
apeiros has joined #ruby-lang
rails_smith has quit [Ping timeout: 245 seconds]
injekt has quit [Ping timeout: 264 seconds]
andrewvos has quit [Ping timeout: 264 seconds]
Senjai has quit [Ping timeout: 240 seconds]
rickruby has joined #ruby-lang
jonahR has quit [Quit: jonahR]
zmike123 has quit [Quit: ~]
rails_smith has joined #ruby-lang
spinagon has joined #ruby-lang
rippa has quit [Ping timeout: 248 seconds]
andrewvos has joined #ruby-lang
injekt has joined #ruby-lang
spinagon has quit [Ping timeout: 248 seconds]
<rue> €
D9 has quit [Ping timeout: 256 seconds]
tbuehlmann has joined #ruby-lang
mistym has joined #ruby-lang
KM has joined #ruby-lang
Guest82295 has quit [Read error: Connection reset by peer]
KM is now known as Guest72114
wallerdev has quit [Quit: wallerdev]
rheddry has quit [Excess Flood]
levifig has joined #ruby-lang
marr has joined #ruby-lang
io_syl has quit [Quit: io_syl]
hackndoes has joined #ruby-lang
<hackndoes> Hi, guys I am new to ruby and have some trouble understanding a specific syntax
<hackndoes> it can be seen when using OptionParser, you do OptionParser.new do... new I know OptionParser.new creates a new instance and calls the initalize method, what does it mean to call do right after?
<bnagy> it's a block
tenderlove has joined #ruby-lang
<bnagy> so basically you're creating an instance, the argument to new is a block of code ( which does the option handling )
skade has joined #ruby-lang
m6n has joined #ruby-lang
tenderlove has quit [Ping timeout: 264 seconds]
eoinkelly_ is now known as eoinkelly
x0f has quit [Ping timeout: 256 seconds]
x0f has joined #ruby-lang
henrikhodne has quit [Read error: Operation timed out]
<hackndoes> bnagy: sorry for late reply, was called on something at work
<hackndoes> thanks for help. so it's like an anonymous method
<hackndoes> new will execute that block of code for me?
Mon_Ouie has joined #ruby-lang
<bnagy> I guess, that's how Trollop works, I don't use OptionParser
<hackndoes> hmmmmmm why? is there a better way?
<hackndoes> is it standard to pass block of code to constractor?
<hackndoes> does it work always and everywhere?
<bnagy> not really, but it's appropriate for some stuff
<bnagy> definitely does not work always
<hackndoes> OK so the target class needs to be designed and coded to support it.
<bnagy> yep
<hackndoes> is there a better option you would suggest for options parsing? cli?
<bnagy> I like Trollop
<bnagy> there's another popular one, too, but I forget
<hackndoes> is Trollop a gem?
<bnagy> yes
<hackndoes> thanks I will take a look at that too....
<hackndoes> you the mann :)
r0bgleeson has quit [Ping timeout: 276 seconds]
tenderlove has joined #ruby-lang
Mon_Ouie has quit [Quit: WeeChat 0.4.1]
hangingclowns has joined #ruby-lang
<hangingclowns> hey guys, anyone know of a way to replace a captured group?
<hangingclowns> i tried using sub (i only want to replace this once), but am having some issues
<hangingclowns> it completely rewrites the text and leaves off the end.
Mon_Ouie has joined #ruby-lang
glebm has joined #ruby-lang
skmp has joined #ruby-lang
tenderlove has quit [Ping timeout: 264 seconds]
<canton7> >> a = "hello world"; a[/wo(rld)/, 1] = 'mble; puts a
<eval-in> canton7 => /tmp/execpad-aa06278919a5/source-aa06278919a5:2: unterminated string meets end of file ... (https://eval.in/39356)
<canton7> >> a = "hello world"; a[/wo(rld)/, 1] = 'mble'; puts a
<eval-in> canton7 => hello womble ... (https://eval.in/39357)
<canton7> use #slice if you'd prefer, instead of the square brackets
<hangingclowns> hmm
<hangingclowns> slice instead?
<hangingclowns> it doesn't matter what i use, just want to replace with some solid string
<hangingclowns> seems sub is not what i was looking for since it replaces the WHOLE regex and not just the captured group
<hangingclowns> let me try that
rickruby has quit [Remote host closed the connection]
<hangingclowns> no, that doens't work, either
<canton7> example of what you're trying to do?
<hangingclowns> have a tag I need to replace inside of a block of text from wordpress
eoinkelly has quit [Quit: eoinkelly]
<heftig> hangingclowns: you're thinking the wrong way around
<hangingclowns> how so?
<canton7> as in, sample input and sample output?
<heftig> you need to use capture groups to capture the parts you want to retain
<heftig> not the parts you want to replace
<hangingclowns> well, then how do i replace the parts I want to replace?
<bnagy> >> "foobar".sub /(fo)o(bar)/, '\1a\2'
<eval-in> bnagy => "foabar" (https://eval.in/39358)
<hangingclowns> the \1 will replace what follows it?
<heftig> the \1 will be replaced with capture group 1
<heftig> fo, in this case
<hangingclowns> oh okay, got ya
<hangingclowns> that's annoying, but let me have a try
lsegal has quit [Quit: Quit: Quit: Quit: Stack Overflow.]
<hangingclowns> hmm, that seemed to have worked
<hangingclowns> so just remember that capture groups are for keeping the data?
<heftig> for reusing it, yes
<heftig> "one-two three-four five-six".gsub(/(\w+)-(\w+)/, '\2:\1')
<heftig> >> "one-two three-four five-six".gsub(/(\w+)-(\w+)/, '\2:\1')
<eval-in> heftig => "two:one four:three six:five" (https://eval.in/39361)
<hangingclowns> hmm,
<hangingclowns> werid
<hangingclowns> geting something very strange
<hangingclowns> "\u0001[contact-form-7 id=\"3284\" title=\"Book a view, we pick you up._copy\"]\u0002"
<hangingclowns> what is that?
<hangingclowns> i'm using the capture groups, but seems getting a strange unicode response?
<bnagy> just encoding
<hangingclowns> yeah, so how do I fix this?
<bnagy> "\u0001".bytes.to_a
<hangingclowns> i thought 1.9 and after has no encoding issues?
<hangingclowns> to_a?
<bnagy> >> "\u0001".bytes.to_a
<eval-in> bnagy => [1] (https://eval.in/39362)
<heftig> uh, if you use "-strings, you need to double your backslashes
<heftig> see:
riotbit_ has joined #ruby-lang
<heftig> >> '\1'
<eval-in> heftig => "\\1" (https://eval.in/39363)
<heftig> >> "\\1"
<eval-in> heftig => "\\1" (https://eval.in/39364)
<heftig> >> "\1"
<hangingclowns> oh
<eval-in> heftig => "\u0001" (https://eval.in/39365)
<hangingclowns> then let me do that
<bnagy> it's just showing it to you as unicode
<hangingclowns> ahh, nice
<bnagy> >> "\u0001".encode 'ascii-8bit'
<eval-in> bnagy => "\x01" (https://eval.in/39366)
<hangingclowns> double backslash works
riotbit has quit [Ping timeout: 264 seconds]
riotbit_ is now known as riotbit
<hangingclowns> so why have to use double backslash? cause of encoding?
<heftig> hangingclowns: no, because of how backslashes are treated in "-literals
<hangingclowns> oh, of course
<heftig> e.g. \n becomes a line feed
<heftig> \\ is a literal backslash
<hangingclowns> yes, of course
<hangingclowns> i didn't think about that
<heftig> then the regexp engine also uses backslashes as special characters, \1 becomes a capture reference and \\ is again reduced to a literal backslash
Azpo has joined #ruby-lang
<heftig> so when using a "-literal as a replacement, you actually need four backslashes (\\\\) to make a single backslash
<heftig> >> "1".sub(/1/, "\\\\")
<eval-in> heftig => "\\" (https://eval.in/39367)
<bnagy> which it shows to you as two backslashes, but it's really only one
<hangingclowns> hmm
<bnagy> >> "\\".bytesize
<eval-in> bnagy => 1 (https://eval.in/39368)
<hangingclowns> little bit too much for me so late in the afternoon
<bnagy> basically, use single quotes for replacements, or you go mad
<hangingclowns> so this is okay? content.sub! english_pick, "\\1#{chinese_pick}\\2"
<hangingclowns> cause it looks like it worked alright
<heftig> eh, i'd probably use .sub!(english_pick) { $1 + chinese_pick + $2 }
<heftig> just so chinese_pick isn't interpreted again
<Azpo> Hi there. Call me crazy but I would like to know if it's possible to redefine a keyword in Ruby. I'm just having fun with obfuscation, nothing to wierd don't worry :)
<heftig> Azpo: no
<hangingclowns> hmm, seems it did end up being picked up, again
<hangingclowns> damn
hackndoes has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
<Azpo> heftig: Aw, pity :(
<bnagy> hangingclowns: 17:04 < canton7> >> a = "hello world"; a[/wo(rld)/, 1] = 'mble'; puts a
<hangingclowns> no, not that
<hangingclowns> i mean, i ran it multple times
<bnagy> that is looking more and more like what you really want
<hangingclowns> cause its' divided up into 2 sections with these goofy html comments
<hangingclowns> one for chinese and other for english
<hangingclowns> so ii think when i ran it again, it didn't work out
<heftig> trying to mess with html using regular expressions is likely to end in failure in all but the simplest of cases
<hangingclowns> no
<heftig> html is not a regular language
<hangingclowns> not like that
<hangingclowns> it's mostly text in here
<Azpo> heftig: I can still make dirty things :D This one for instance : http://pastie.org/8183252
<hangingclowns> just some HTML comments to separate the languages
<heftig> Azpo: loop is not a keyword
<Azpo> What I did is still dirty :P
<hangingclowns> okay, looks like i think i got it
rickruby has joined #ruby-lang
Azpo has quit [Quit: Page closed]
<heftig> >> def method_missing(*args); args.map(&:to_s).join " "; end; look ma I can ruby!
<eval-in> heftig => "look ma I can ruby!" (https://eval.in/39369)
r0bgleeson has joined #ruby-lang
mistym has quit [Remote host closed the connection]
workmad3 has joined #ruby-lang
relix has joined #ruby-lang
skade has quit [Read error: Operation timed out]
Squarepy_ has joined #ruby-lang
skade has joined #ruby-lang
glebm_ has joined #ruby-lang
glebm has quit [Ping timeout: 256 seconds]
workmad3 has quit [Ping timeout: 264 seconds]
skade has quit [Ping timeout: 256 seconds]
Squarepy has quit [Quit: Leaving]
skade has joined #ruby-lang
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sascha_d has quit [Quit: obai]
glebm_ has quit [Ping timeout: 276 seconds]
tenderlove has joined #ruby-lang
nivanson has quit [Remote host closed the connection]
nivanson has joined #ruby-lang
skade has quit [Ping timeout: 248 seconds]
skade has joined #ruby-lang
mbj has joined #ruby-lang
glebm has joined #ruby-lang
tenderlove has quit [Ping timeout: 240 seconds]
hinbody has joined #ruby-lang
skade has quit [Ping timeout: 256 seconds]
tkuchiki has quit [Remote host closed the connection]
tkuchiki has joined #ruby-lang
mihar has quit [Ping timeout: 240 seconds]
Voker57 has quit [Ping timeout: 246 seconds]
mihar has joined #ruby-lang
realDAB has joined #ruby-lang
diegoviola has joined #ruby-lang
Voker57 has joined #ruby-lang
relix has joined #ruby-lang
hangingclowns has left #ruby-lang [#ruby-lang]
tenderlove has joined #ruby-lang
rob___ has joined #ruby-lang
rob___ has left #ruby-lang [#ruby-lang]
Squarepy_ has quit [Quit: Leaving]
rob_ has joined #ruby-lang
<rob_> hi
<rob_> im trying to extend a ruby class but the class im looking at has 'class << self' in it and i dont quite understand what that means, here's a snippet: http://hastebin.com/raw/merijuqiga
<toretore> how are you trying to extend it?
<rob_> when i try and access methods in the Waveform class i get no method errors if i do something like this: http://hastebin.com/raw/rajehenuyu
<toretore> class << self opens up the class' eigenclass, in which "class" methods are defined
tenderlove has quit [Ping timeout: 264 seconds]
* rob_ looks that up
<realDAB> rob_: in general, class << any_object (including but not limited to a class object) opens up that object's singleton class, where per-object methods are defined for that object's sole use
<erikh> rob_: suuuup
<erikh> rob_: just to be clear before you get all confused, you
<erikh> you'll hear "singleton class" "metaclass" and "eigenclass" used interchangeably
<erikh> they almost always mean the same thing
<rob_> ahh thanks dudes
<rob_> erikh: :D
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<injekt> :D
sush24 has joined #ruby-lang
ledestin has joined #ruby-lang
firstdayonthejob has quit [Ping timeout: 264 seconds]
anjen has joined #ruby-lang
realDAB has quit [Quit: realDAB]
hinbody has quit [Ping timeout: 256 seconds]
jxie has quit [Quit: leaving]
MaddinXx_ has joined #ruby-lang
skade has joined #ruby-lang
anjen has quit [Quit: anjen]
sush24 has quit [Read error: Connection reset by peer]
skade has quit [Ping timeout: 246 seconds]
firstdayonthejob has joined #ruby-lang
vlad_starkov has joined #ruby-lang
diegoviola has quit [Ping timeout: 240 seconds]
mbj has quit [Ping timeout: 246 seconds]
apeiros has quit [Read error: Connection reset by peer]
apeiros_ has joined #ruby-lang
anjen has joined #ruby-lang
rippa has joined #ruby-lang
relix has joined #ruby-lang
skade has joined #ruby-lang
sush24 has joined #ruby-lang
tenderlove has joined #ruby-lang
tenderlove has quit [Ping timeout: 264 seconds]
Guest79934 has joined #ruby-lang
Guest79934 is now known as diegoviola
maxmanders has joined #ruby-lang
vlad_starkov has quit [Read error: Connection reset by peer]
vlad_starkov has joined #ruby-lang
spuk has quit [Quit: Human beings were created by water to transport it uphill.]
stardiviner has joined #ruby-lang
Smoochict has quit [Quit: Quit]
Smoochict has joined #ruby-lang
Smoochict is now known as Guest76388
Guest76388 has left #ruby-lang [#ruby-lang]
Smoochict has joined #ruby-lang
<Smoochict> test
kstuart has joined #ruby-lang
skade has quit [Ping timeout: 256 seconds]
mbj has joined #ruby-lang
Smoochict is now known as DanielRb
skade has joined #ruby-lang
kstuart has quit [Quit: kstuart]
skade has quit [Client Quit]
DanielRb is now known as danielrb
kstuart has joined #ruby-lang
skade has joined #ruby-lang
postmodern has quit [Quit: Leaving]
mdedetrich has joined #ruby-lang
<imperator> test failure, implosion imminent
rippa has quit [Ping timeout: 248 seconds]
danielrb has left #ruby-lang [#ruby-lang]
ledestin has quit [Quit: ledestin]
skade has quit [Ping timeout: 264 seconds]
sascha_d has joined #ruby-lang
hashkey_ has joined #ruby-lang
hashkey has quit [Ping timeout: 264 seconds]
realDAB has joined #ruby-lang
publicvoid has joined #ruby-lang
rob_ has left #ruby-lang [#ruby-lang]
hinbody has joined #ruby-lang
Guest75556 has joined #ruby-lang
diegoviola has quit [Ping timeout: 246 seconds]
Guest75556 is now known as diegoviola
hashkey_ is now known as hashkey
joshuawscott has joined #ruby-lang
realDAB has quit [Quit: realDAB]
marr has quit [Ping timeout: 264 seconds]
anjen has quit [Quit: anjen]
stardiviner has quit [Read error: Connection reset by peer]
stardiviner_ has joined #ruby-lang
joshuawscott has quit [Quit: Leaving.]
workmad3 has joined #ruby-lang
realDAB has joined #ruby-lang
realDAB has quit [Client Quit]
realDAB has joined #ruby-lang
sepp2k has joined #ruby-lang
davetoxa has joined #ruby-lang
imperator has quit [Quit: Leaving]
realDAB has quit [Quit: realDAB]
GeissT has quit [Quit: MillBroChat AdIRC User]
r0bgleeson has quit [Ping timeout: 256 seconds]
tenderlove has joined #ruby-lang
<davetoxa> Hello! Can anybody help me, with writing 1 test
joshuawscott has joined #ruby-lang
pbjorklund has quit [Ping timeout: 240 seconds]
marr has joined #ruby-lang
tenderlove has quit [Ping timeout: 240 seconds]
Voker57 has quit [Read error: Connection reset by peer]
workmad3 has quit [Ping timeout: 264 seconds]
realDAB has joined #ruby-lang
pbjorklund has joined #ruby-lang
realDAB has quit [Client Quit]
vlad_starkov has quit [Remote host closed the connection]
rickruby has quit [Remote host closed the connection]
nathanstitt has joined #ruby-lang
realDAB has joined #ruby-lang
mdedetrich has quit [Quit: Computer has gone to sleep.]
realDAB has quit [Client Quit]
x0f has quit [Ping timeout: 276 seconds]
x0f has joined #ruby-lang
ruby-lang925 has joined #ruby-lang
x0f has quit [Read error: Operation timed out]
x0f has joined #ruby-lang
jerrytgarcia has joined #ruby-lang
jerrytgarcia has quit [Client Quit]
workmad3 has joined #ruby-lang
x0f has quit [Ping timeout: 240 seconds]
vlad_starkov has joined #ruby-lang
x0f has joined #ruby-lang
r0bgleeson has joined #ruby-lang
wallerdev has joined #ruby-lang
ruby-lang925 has quit [Ping timeout: 250 seconds]
yfeldblum has joined #ruby-lang
zmike123 has joined #ruby-lang
sergiocampama has joined #ruby-lang
tenderlove has joined #ruby-lang
sergiocampama has quit [Client Quit]
sergiocampama has joined #ruby-lang
sergiocampama has quit [Client Quit]
MaddinXx_ has quit [Remote host closed the connection]
tenderlove has quit [Ping timeout: 246 seconds]
zmike123 has quit [Ping timeout: 276 seconds]
sergiocampama has joined #ruby-lang
realDAB has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
sergiocampama has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
sergiocampama has joined #ruby-lang
geopet has joined #ruby-lang
cads has quit [Quit: Leaving]
sergiocampama has quit [Client Quit]
sergiocampama has joined #ruby-lang
realDAB has quit [Quit: realDAB]
realDAB has joined #ruby-lang
realDAB has quit [Client Quit]
vlad_starkov has quit [Remote host closed the connection]
Kabaka has quit [Remote host closed the connection]
zmike has joined #ruby-lang
Kabaka has joined #ruby-lang
<andrewvos> davetoxa: You deleted the code?
yfeldblum has quit [Ping timeout: 256 seconds]
<davetoxa> andrewvos, yes, I solved the problem
realDAB has joined #ruby-lang
<davetoxa> thanks, for participating
realDAB has quit [Client Quit]
apeiros_ is now known as apeiros
realDAB has joined #ruby-lang
vlad_starkov has joined #ruby-lang
x0f has quit [Ping timeout: 248 seconds]
x0f has joined #ruby-lang
realDAB has quit [Client Quit]
wallerdev has joined #ruby-lang
MaddinXx_ has joined #ruby-lang
_jpb_ has joined #ruby-lang
LauraE has joined #ruby-lang
mosca_ has joined #ruby-lang
workmad3 has quit [Ping timeout: 264 seconds]
realDAB has joined #ruby-lang
realDAB has quit [Client Quit]
tomzx_mac has joined #ruby-lang
tkuchiki has quit [Remote host closed the connection]
diegoviola has quit [Ping timeout: 256 seconds]
jxie has joined #ruby-lang
jsaak has quit [Read error: Operation timed out]
tenderlove has joined #ruby-lang
tenderlove has quit [Remote host closed the connection]
realDAB has joined #ruby-lang
geopet has quit [Quit: geopet]
symm- has joined #ruby-lang
rippa has joined #ruby-lang
realDAB has quit [Quit: realDAB]
setmeaway2 has quit [Ping timeout: 264 seconds]
yfeldblum has joined #ruby-lang
kristofferrr has joined #ruby-lang
kristofferrr is now known as sreffotsirk
sergiocampama has quit [Remote host closed the connection]
_jpb_ has quit [Ping timeout: 264 seconds]
tbuehlmann has quit [Remote host closed the connection]
yfeldblum has quit [Ping timeout: 246 seconds]
jacktrick has joined #ruby-lang
sergiocampama has joined #ruby-lang
sergiocampama has quit [Remote host closed the connection]
lsegal has joined #ruby-lang
sergiocampama has joined #ruby-lang
mosca_ has quit [Ping timeout: 264 seconds]
shinnya has quit [Ping timeout: 264 seconds]
_jpb_ has joined #ruby-lang
sepp2k has quit [Quit: Leaving.]
sush24 has quit [Quit: This computer has gone to sleep]
sush24 has joined #ruby-lang
sush24 has quit [Remote host closed the connection]
bradsmith has quit [Remote host closed the connection]
LauraE has left #ruby-lang [#ruby-lang]
Senjai has joined #ruby-lang
Senjai has joined #ruby-lang
Senjai has quit [Changing host]
skmp has quit [Quit: Leaving.]
zmike has quit [Ping timeout: 264 seconds]
skmp has joined #ruby-lang
sdegutis has joined #ruby-lang
LauraE has joined #ruby-lang
sdegutis has quit [Remote host closed the connection]
zmike has joined #ruby-lang
mbj has quit [Ping timeout: 246 seconds]
kirin` has quit [Ping timeout: 276 seconds]
skmp has quit [Quit: Leaving.]
itcharlie has joined #ruby-lang
kirin` has joined #ruby-lang
mbj has joined #ruby-lang
realDAB has joined #ruby-lang
jxie has quit [Ping timeout: 264 seconds]
jxie has joined #ruby-lang
D9 has joined #ruby-lang
asahi has joined #ruby-lang
Voker57 has joined #ruby-lang
<asahi> hello, if i have a module with methods defined in it, how can I make a variable available to each of these methods?
sreffotsirk has quit [Quit: ❤]
jacktrick has quit [Quit: Leaving]
davetoxa has quit [Remote host closed the connection]
henrikhodne has joined #ruby-lang
realDAB has quit [Quit: realDAB]
<andrewvos> asahi: Are you including this module somewhere?
<naquad> is there something like guard, but more general than with guard? also w/o dozens of stupid dependencies?
mistym has joined #ruby-lang
chris2 has quit [Ping timeout: 260 seconds]
retro|cz has quit [Ping timeout: 264 seconds]
zmike has quit [Read error: Operation timed out]
mbj has quit [Ping timeout: 276 seconds]
symm- has quit [Ping timeout: 264 seconds]
nivanson_ has joined #ruby-lang
nivanson has quit [Read error: Connection reset by peer]
symm- has joined #ruby-lang
rsl has quit [Ping timeout: 268 seconds]
rsl has joined #ruby-lang
bartell has joined #ruby-lang
sdegutis has joined #ruby-lang
<asahi> andrewvos: yes, i'm including it in a rails app
<asahi> but it's pretty much a standalone module
krz has quit [Quit: krz]
supki has joined #ruby-lang
nivanson_ has quit [Read error: Connection reset by peer]
nivanson has joined #ruby-lang
publicvoid has quit [Ping timeout: 248 seconds]
yfeldblum has joined #ruby-lang
singpolyma has quit [Ping timeout: 246 seconds]
singpolyma has joined #ruby-lang
amerine has joined #ruby-lang
rsl has quit [Ping timeout: 240 seconds]
rsl has joined #ruby-lang
chris2 has joined #ruby-lang
<manveru> asahi: just use an instance var?
sstrickl has quit [Read error: No route to host]
rsl has quit [Ping timeout: 264 seconds]
sstrickl has joined #ruby-lang
rsl has joined #ruby-lang
hexreel has quit [Quit: leaving]
skmp has joined #ruby-lang
rippa has quit [Ping timeout: 248 seconds]
<asahi> manveru: ahh i see. thanks
riotbit has quit [Quit: riotbit]
<sdegutis> yo
<sdegutis> if i pass a lambda do a C function to call later, should i do rb_gc_register_address() right away and rb_gc_unregister_address() when im done with it?
xuser has quit [Quit: Lost terminal]
nazty has joined #ruby-lang
Johz has joined #ruby-lang
symm- has quit [Ping timeout: 240 seconds]
marr has quit []
hahuang65 has quit [Ping timeout: 248 seconds]
Mon_Ouie has quit [Read error: No route to host]
Mon_Ouie has joined #ruby-lang
sascha_d has quit [Quit: obai]
sascha_d has joined #ruby-lang
jonahR has joined #ruby-lang
lsegal has quit [Quit: Quit: Quit: Quit: Stack Overflow.]
marr has joined #ruby-lang
maxmanders has quit [Quit: Computer has gone to sleep.]
firstdayonthejob has quit [Ping timeout: 264 seconds]
henrikhodne has quit [Ping timeout: 246 seconds]
mistym has quit [Remote host closed the connection]
<drbrain> sdegutis: a lambda created from ruby?
<drbrain> there's no need
<drbrain> use rb_gc_(un)register_address for things like static VALUE foo; that aren't allocated on the stack and may get lost
<sdegutis> drbrain: its really a do-end block passed into a c function
<drbrain> yeah, there's no need, the stack will have a reference to it
<sdegutis> drbrain: but how will the garbage collector know it still exists when im passing it around my C program internally and then it waits a few hours before getting called?
<drbrain> a do-end block is not any different than an Array or a String on the stack
<drbrain> sdegutis: when you allocated it there's a reference on the stack
<drbrain> same as a String
<sdegutis> drbrain: oh by stack you mean the C stack?
<drbrain> the C stack, yes
<sdegutis> whoa, so the Ruby GC is looking at my C stack?
<drbrain> yep
<sdegutis> that seems dirty
<drbrain> it is
<sdegutis> btw this is an ObjC program
<drbrain> I need to run to the store, bbiab
<sdegutis> do you think thatll affect this?
<drbrain> shouldn't matter
<sdegutis> ok
<sdegutis> thx
<drbrain> it's all just pointers
<sdegutis> cya when you get back :)
<sdegutis> guys, is StringValueCStr the right way to get a c string reliably from a ruby string?
<sdegutis> it seems reliable but the docs offer a few choices.
Johz has quit [Quit: Leaving]
mbj has joined #ruby-lang
firstdayonthejob has joined #ruby-lang
rondale_sc has quit [Quit: leaving]
workmad3 has joined #ruby-lang
realDAB has joined #ruby-lang
rondale_sc has joined #ruby-lang
realDAB has quit [Client Quit]
vlad_starkov has quit [Remote host closed the connection]
Avatar[01] has quit [Quit: Bye]
D9 has quit [Quit: Leaving]
henrikhodne has joined #ruby-lang
Domon has quit [Ping timeout: 245 seconds]
franckverrot has quit [Ping timeout: 260 seconds]
ndrst has quit [Ping timeout: 264 seconds]
symm- has joined #ruby-lang
franckverrot has joined #ruby-lang
poga has joined #ruby-lang
realDAB has joined #ruby-lang
<drbrain> sdegutis: to get a null-terminated C string, yes
<drbrain> it raises a Ruby exception if the source string contains a null byte
<sdegutis> drbrain: ah. works great then.
<sdegutis> thanks again drbrain
<sdegutis> drbrain: btw you using a mac?
<drbrain> yes
<sdegutis> drbrain: im adding Ruby scripting to https://github.com/sdegutis/zephyros
<sdegutis> (and Python next)
<drbrain> neat
<sdegutis> just in case you're into any of that stuff, thats all.
<drbrain> I've got my window positioning mostly figured out
eoinkelly has joined #ruby-lang
mosca_ has joined #ruby-lang
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
chickenflu has quit [Ping timeout: 245 seconds]
vlad_starkov has joined #ruby-lang
Guest72114 has quit [Read error: Connection reset by peer]
Guest72114 has joined #ruby-lang
realDAB has quit [Quit: realDAB]
relix has joined #ruby-lang
hahuang65 has joined #ruby-lang
rippa has joined #ruby-lang
dc5ala has quit [Quit: Ex-Chat]
vlad_starkov has quit [Ping timeout: 240 seconds]
hahuang65 has quit [Ping timeout: 246 seconds]
realDAB has joined #ruby-lang
ndrst has joined #ruby-lang
pipework has quit [Remote host closed the connection]
poga has quit [Remote host closed the connection]
rue has quit [Ping timeout: 248 seconds]
realDAB has quit [Quit: realDAB]
bartell has quit [Remote host closed the connection]
sergiocampama has quit [Quit: sergiocampama]
eoinkelly has quit [Quit: eoinkelly]
eoinkelly has joined #ruby-lang
rue has joined #ruby-lang
pskosinski has joined #ruby-lang
pskosinski has quit [Quit: Til rivido Idisti!]
x0f has quit [Ping timeout: 264 seconds]
x0f has joined #ruby-lang
adambeynon has joined #ruby-lang
adambeynon has quit [Client Quit]
x0f has quit [Read error: Operation timed out]
RickHull has joined #ruby-lang
x0f has joined #ruby-lang
<RickHull> is there a good way to fold comments in emacs? i am thinking either collapse all multiline comments to the top line, or collapse all comments to nil
<RickHull> with a toggle, obv
<erikh> there is, and it supports the {{{ syntax too
<erikh> BUT, I don't remember how to control it
<RickHull> yeah i don't want that in my source code
<RickHull> emacs shit
<erikh> actually vim can use them too
<RickHull> just normal # comments
<erikh> but you don't need to use them to fold
<erikh> there's probably a M-x describe-* something that can help you find it
rippa has quit [Read error: Connection reset by peer]
x0f has quit [Ping timeout: 264 seconds]
x0f has joined #ruby-lang
joshuawscott has quit [Quit: Leaving.]
Elico has joined #ruby-lang
<Elico> hey there. I am trying to work with xml file but I am a bit confused..
x0f has quit [Ping timeout: 270 seconds]
cjs226 has quit [Ping timeout: 256 seconds]
apeiros has quit [Remote host closed the connection]
apeiros has joined #ruby-lang
x0f has joined #ruby-lang
pipework has joined #ruby-lang
vlad_starkov has joined #ruby-lang
bartell has joined #ruby-lang
cjs226 has joined #ruby-lang
intellitech has quit [Quit: intellitech]
vlad_starkov has quit [Ping timeout: 264 seconds]
<Boohbah> can anyone recommend a good webmail application?
tsou has joined #ruby-lang
workmad3 has quit [Ping timeout: 246 seconds]
sergiocampama has joined #ruby-lang
akahn has quit [Ping timeout: 246 seconds]
sdegutis has quit [Remote host closed the connection]
Rylai has quit [Ping timeout: 246 seconds]
prezJFK has joined #ruby-lang
Rylai has joined #ruby-lang
akahn has joined #ruby-lang
iliketurtles has joined #ruby-lang
mosca_ has quit [Ping timeout: 246 seconds]
elia has joined #ruby-lang
sergiocampama has quit [Quit: sergiocampama]
intellitech has joined #ruby-lang
joshuawscott has joined #ruby-lang
sergiocampama has joined #ruby-lang
Domon has joined #ruby-lang
sergiocampama has quit [Quit: sergiocampama]
joshuawscott has quit [Ping timeout: 256 seconds]
_whitelogger has joined #ruby-lang
headius has joined #ruby-lang
bartell_ has joined #ruby-lang
bartell has quit [Read error: Connection reset by peer]
toretore has quit [Ping timeout: 256 seconds]
MaddinXx_ has quit [Remote host closed the connection]
chickenflu has joined #ruby-lang
MaddinXx_ has joined #ruby-lang
prezJFK has quit [Remote host closed the connection]
MaddinXx_ has quit [Remote host closed the connection]
joshuawscott has joined #ruby-lang
glebm has quit [Ping timeout: 256 seconds]
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
realDAB has joined #ruby-lang
glebm has joined #ruby-lang
toretore has joined #ruby-lang
realDAB has quit [Quit: realDAB]
sdegutis has joined #ruby-lang
sdegutis has joined #ruby-lang
<sdegutis> Is it possible to obtain the implicit Ruby block from within a C function?
elia has quit [Quit: Computer has gone to sleep.]
hakunin has quit [Read error: Connection reset by peer]
hakunin has joined #ruby-lang
joshuawscott has quit [Quit: Leaving.]
<matti> manveru: You alive?
<matti> sdegutis: You mean, you want to be able to create enumerator in C binding?
<matti> sdegutis: Or do you want a Proc-ish thing in C binding?
<sdegutis> matti: i want the C equiv of defining the &block param to use within the fn
<sdegutis> matti: my workaround is: def trampoline *args, &blj \n real_fn(args, blj) \n end
mbj has quit [Quit: leaving]
<sdegutis> matti: im taking the block and storing it for later, to call in the indefinite future
<sdegutis> (callback)
<matti> I know.
<sdegutis> k
<matti> I was just looking for something.
anonymuse has joined #ruby-lang
<matti> sdegutis: Sorry about the links. Its better to read to get the idea.
<matti> sdegutis: C API is so-so documented.
<sdegutis> thx matti
RickHull has quit [Quit: Leaving.]
<matti> This one is from banisterfiend on #ruby.
<matti> He might help in needed.
<sdegutis> matti: oh man that rb_block_proc() stack trick is neat, if i understand it right
mbj has joined #ruby-lang
<matti> Yeah.
<matti> Proc is context bound.
<matti> And this like helper will return right pointer to the Proc in context.
<sdegutis> neat
<matti> So you will have an entry point to your saved closure in C.
rrecio has joined #ruby-lang
mbj has quit [Client Quit]
<sdegutis> that worked beautifully.
<matti> :)
<matti> Ruby's C API is not bad, actually.
<matti> Sadly, under-documetned ;/
<matti> sdegutis: This is obviously a go-to page: http://rxr.whitequark.org/
<sdegutis> friendlier ui
<matti> No. This is too old.
<sdegutis> oh
<matti> Sometimes you have to read source.
<sdegutis> thx
<sdegutis> nite matti
r0bgleeson has quit [Ping timeout: 264 seconds]
joshuawscott has joined #ruby-lang
<matti> :)
<matti> sdegutis: Example how to get underlying exception.
<sdegutis> sweet
<sdegutis> matti: ok go to bed already before i start relying on you for all my ruby needs :D
<matti> Haha
<matti> sdegutis: What are you doing?
<matti> I am curius now.
<matti> Funny, you are asking me about C API in Ruby ;p And I just finished writing library binding to Go ;p
<matti> Haha
tyman has joined #ruby-lang
<sdegutis> matti: well
r0bgleeson has joined #ruby-lang
<sdegutis> adding Ruby and Python support
<sdegutis> cuz i really hate JS, and also cuz its wicked fun
elia has joined #ruby-lang
<matti> :)
<sdegutis> matti: you use Mac?
iliketurtles has quit [Quit: zzzzz…..]
LauraE has left #ruby-lang [#ruby-lang]
<matti> Yes.