ljarvis changed the topic of #ruby-lang to: Ruby 2.1.2; 2.0.0-p481; 1.9.3-p547: http://ruby-lang.org || Paste code on http://gist.github.com
Squarepy has quit [Quit: Leaving]
Lewix has quit [Remote host closed the connection]
tkuchiki has quit [Remote host closed the connection]
symm- has joined #ruby-lang
djbkd has joined #ruby-lang
seamon has quit [Quit: seamon]
dingus_khan has joined #ruby-lang
seamon has joined #ruby-lang
Averna has joined #ruby-lang
adphillips has quit [Remote host closed the connection]
bantic has quit [Quit: bantic]
tkuchiki has joined #ruby-lang
ddv has quit [Ping timeout: 260 seconds]
ddv has joined #ruby-lang
CaptainJet has quit [Ping timeout: 255 seconds]
seamon has quit [Quit: seamon]
CaptainJet has joined #ruby-lang
tectonic has quit []
marr has quit [Ping timeout: 264 seconds]
DivineEntity has quit [Quit: leaving]
diegoviola has joined #ruby-lang
postmodern has joined #ruby-lang
alexju has quit [Remote host closed the connection]
willmarshall has joined #ruby-lang
tectonic has joined #ruby-lang
charliesome_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
djbkd has quit [Remote host closed the connection]
Lewix has joined #ruby-lang
Miphix has joined #ruby-lang
diegoviola has quit [Read error: Connection reset by peer]
diegoviola has joined #ruby-lang
centrx has joined #ruby-lang
charliesome has joined #ruby-lang
nofxx has joined #ruby-lang
nofxx has joined #ruby-lang
yfeldblu_ has joined #ruby-lang
sharpmachine has joined #ruby-lang
yfeldblum has quit [Ping timeout: 240 seconds]
havenwood has joined #ruby-lang
yfeldblu_ has quit [Remote host closed the connection]
yfeldblum has joined #ruby-lang
DivineEntity has joined #ruby-lang
fostertheweb has joined #ruby-lang
Cakey has joined #ruby-lang
robbyoconnor has quit [Ping timeout: 272 seconds]
Cakey has quit [Ping timeout: 260 seconds]
Cakey has joined #ruby-lang
stayarrr has joined #ruby-lang
robbyoconnor has joined #ruby-lang
vintik has quit [Ping timeout: 256 seconds]
Cakey has quit [Ping timeout: 255 seconds]
Cakey has joined #ruby-lang
TrueJet has joined #ruby-lang
nofxx has quit [Remote host closed the connection]
CaptainJet has quit [Ping timeout: 255 seconds]
Cakey has quit [Ping timeout: 255 seconds]
Cakey has joined #ruby-lang
fostertheweb has quit [Quit: Textual IRC Client: www.textualapp.com]
toretore has joined #ruby-lang
yfeldblum has quit [Read error: Connection reset by peer]
Cakey has quit [Ping timeout: 260 seconds]
yfeldblum has joined #ruby-lang
Cakey has joined #ruby-lang
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Cakey has quit [Ping timeout: 250 seconds]
Cakey has joined #ruby-lang
yliu has quit [Ping timeout: 256 seconds]
yliu has joined #ruby-lang
shinnya has quit [Ping timeout: 245 seconds]
freedrull has quit [Ping timeout: 240 seconds]
freedrull has joined #ruby-lang
Cakey has quit [Remote host closed the connection]
Cakey has joined #ruby-lang
fmendez has quit [Remote host closed the connection]
shinnya has joined #ruby-lang
Cakey has quit [Ping timeout: 255 seconds]
charliesome has joined #ruby-lang
Cakey has joined #ruby-lang
havenwood has quit []
Cakey has quit [Ping timeout: 245 seconds]
Cakey has joined #ruby-lang
weems|mac has quit [Quit: weems|mac]
stayarrr has quit [Quit: Leaving...]
yatish27 has joined #ruby-lang
centrx has quit [Quit: Mead error: Connection reset by beer]
Cakey has quit [Ping timeout: 264 seconds]
Cakey has joined #ruby-lang
amystephen has quit [Quit: amystephen]
Cakey has quit [Ping timeout: 255 seconds]
Cakey has joined #ruby-lang
araujo has quit [Quit: Leaving]
shinnya has quit [Ping timeout: 260 seconds]
Cakey has quit [Ping timeout: 250 seconds]
Cakey has joined #ruby-lang
shinnya has joined #ruby-lang
cornerman has joined #ruby-lang
Cakey has quit [Ping timeout: 256 seconds]
Cakey has joined #ruby-lang
cornerma1 has quit [Ping timeout: 256 seconds]
Atttwww has joined #ruby-lang
weems|mac has joined #ruby-lang
Cakey has quit [Ping timeout: 245 seconds]
Cakey has joined #ruby-lang
Cakey has quit [Ping timeout: 240 seconds]
Cakey has joined #ruby-lang
mistym has joined #ruby-lang
Cakey has quit [Ping timeout: 250 seconds]
spastorino has quit [Quit: Connection closed for inactivity]
Cakey has joined #ruby-lang
gix has quit [Ping timeout: 256 seconds]
Cakey has quit [Ping timeout: 240 seconds]
willmarshall has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gix has joined #ruby-lang
tkuchiki_ has joined #ruby-lang
cantonic has quit [Read error: Connection reset by peer]
cantonic has joined #ruby-lang
s1kx has quit [Read error: Connection reset by peer]
ascarter has joined #ruby-lang
tkuchiki has quit [Ping timeout: 256 seconds]
shinnya has quit [Ping timeout: 264 seconds]
hahuang65 has quit [Ping timeout: 250 seconds]
stayarrr has joined #ruby-lang
DivineEntity has quit [Quit: leaving]
sharpmachine has quit [Remote host closed the connection]
TrueJet has quit []
davispuh has quit [Read error: Connection reset by peer]
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
stardiviner has quit [Ping timeout: 260 seconds]
jxie has quit [Ping timeout: 245 seconds]
jxie has joined #ruby-lang
heftig has quit [Ping timeout: 260 seconds]
tkuchiki_ has quit [Remote host closed the connection]
tkuchiki has joined #ruby-lang
willmarshall has joined #ruby-lang
ascarter has joined #ruby-lang
duper has quit [Ping timeout: 256 seconds]
yfeldblum has quit [Read error: Connection reset by peer]
yfeldblum has joined #ruby-lang
yatish27 has quit [Remote host closed the connection]
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ascarter has joined #ruby-lang
stayarrr has quit [Quit: Leaving...]
hahuang65 has joined #ruby-lang
stayarrr has joined #ruby-lang
duper has joined #ruby-lang
yatish27 has joined #ruby-lang
hahuang65 has quit [Quit: WeeChat 0.4.3]
hahuang65 has joined #ruby-lang
hahuang65 has quit [Client Quit]
hahuang65 has joined #ruby-lang
amerine has quit [Quit: Textual IRC Client: www.textualapp.com]
weems|mac has quit [Quit: weems|mac]
amerine has joined #ruby-lang
mehlah has quit [Quit: Leaving...]
jxie has quit [Ping timeout: 245 seconds]
brianpWins has joined #ruby-lang
jxie has joined #ruby-lang
symm- has quit [Ping timeout: 240 seconds]
kiddorails has joined #ruby-lang
jxie has quit [Ping timeout: 255 seconds]
vintik has joined #ruby-lang
ur5us has quit [Read error: Connection reset by peer]
ur5us_ has joined #ruby-lang
jxie has joined #ruby-lang
kyb3r_ has joined #ruby-lang
ur5us_ has quit [Ping timeout: 245 seconds]
apeiros_ has joined #ruby-lang
kiddorails has quit [Remote host closed the connection]
apeiros has quit [Read error: Connection reset by peer]
tectonic has quit []
apeiros_ has quit [Remote host closed the connection]
apeiros has joined #ruby-lang
hahuang65 has quit [Ping timeout: 256 seconds]
apeiros has quit [Ping timeout: 260 seconds]
kiddorails has joined #ruby-lang
relix has joined #ruby-lang
kiddorails has quit [Remote host closed the connection]
AKASkip has joined #ruby-lang
kiddorails has joined #ruby-lang
amclain has quit [Quit: Leaving]
brianpWins has quit [Quit: brianpWins]
_ht has joined #ruby-lang
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
brianpWins has joined #ruby-lang
brianpWins has quit [Client Quit]
hahuang65 has joined #ruby-lang
stayarrr has quit [Quit: Leaving...]
hahuang65 has quit [Ping timeout: 240 seconds]
stayarrr has joined #ruby-lang
dingus_khan has quit []
hahuang65 has joined #ruby-lang
amystephen has joined #ruby-lang
cantonic has quit [Quit: cantonic]
certainty has quit [Ping timeout: 255 seconds]
certainty has joined #ruby-lang
kyb3r_ has quit [Ping timeout: 240 seconds]
kyb3r_ has joined #ruby-lang
hahuang65 has quit [Ping timeout: 240 seconds]
Cakey has joined #ruby-lang
willmarshall has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Cakey has quit [Ping timeout: 240 seconds]
Cakey has joined #ruby-lang
hahuang65 has joined #ruby-lang
mistym has quit [Remote host closed the connection]
mistym has joined #ruby-lang
rahul_j has joined #ruby-lang
Forgetful_Lion has joined #ruby-lang
Cakey has quit [Ping timeout: 250 seconds]
rahul_j has quit [Client Quit]
hahuang65 has quit [Ping timeout: 240 seconds]
Cakey has joined #ruby-lang
mistym has quit [Ping timeout: 240 seconds]
rahul_j has joined #ruby-lang
apeiros has joined #ruby-lang
ur5us has joined #ruby-lang
vondruch has joined #ruby-lang
hahuang65 has joined #ruby-lang
solars has joined #ruby-lang
Cakey has quit [Ping timeout: 260 seconds]
Cakey has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
TvL2386 has joined #ruby-lang
hahuang65 has quit [Ping timeout: 255 seconds]
olivererxleben has joined #ruby-lang
Cakey has quit [Ping timeout: 260 seconds]
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Cakey has joined #ruby-lang
stayarrr has quit [Ping timeout: 240 seconds]
lsegal has quit [Quit: Quit: Quit: Quit: Stack Overflow.]
vintik has quit [Remote host closed the connection]
kiddorails has quit [Remote host closed the connection]
kiddorails has joined #ruby-lang
tbuehlmann has joined #ruby-lang
olivererxleben has quit [Quit: Leaving...]
adphillips has joined #ruby-lang
stayarrr has joined #ruby-lang
michd is now known as MichD
s1kx has joined #ruby-lang
ironhide_604 has joined #ruby-lang
sMecKs_ has quit [Read error: Connection reset by peer]
hahuang65 has joined #ruby-lang
hahuang65 has quit [Ping timeout: 260 seconds]
Cakey has quit [Ping timeout: 240 seconds]
kiddorails has quit [Remote host closed the connection]
Cakey has joined #ruby-lang
hahuang65 has joined #ruby-lang
kiddorails has joined #ruby-lang
danijoo has joined #ruby-lang
elia has joined #ruby-lang
Averna has quit [Quit: Leaving.]
hahuang65 has quit [Ping timeout: 250 seconds]
mikecmpbll has joined #ruby-lang
fullybaked has joined #ruby-lang
Cakey has quit [Ping timeout: 260 seconds]
Cakey has joined #ruby-lang
Cakey has quit [Ping timeout: 240 seconds]
Cakey has joined #ruby-lang
Cakey has quit [Ping timeout: 250 seconds]
Cakey has joined #ruby-lang
benlovell has joined #ruby-lang
enebo has quit [Quit: enebo]
gianlucadv has quit [Ping timeout: 260 seconds]
rahul_j has quit [Quit: rahul_j]
nirix has quit [Ping timeout: 272 seconds]
erichmenge has quit [Ping timeout: 250 seconds]
justinmcp has quit [Quit: No Ping reply in 180 seconds.]
justinmcp has joined #ruby-lang
vondruch has quit [Quit: Ex-Chat]
llakey has quit [Ping timeout: 272 seconds]
nirix has joined #ruby-lang
llakey has joined #ruby-lang
Cakey has quit [Ping timeout: 255 seconds]
erichmenge has joined #ruby-lang
Cakey has joined #ruby-lang
stardiviner has joined #ruby-lang
Cakey has quit [Ping timeout: 245 seconds]
jmeeuwen_ has joined #ruby-lang
hahuang65 has joined #ruby-lang
Cakey has joined #ruby-lang
vintik has joined #ruby-lang
AKASkip has quit [Ping timeout: 255 seconds]
jmeeuwen has quit [Ping timeout: 260 seconds]
jmeeuwen_ is now known as jmeeuwen
hahuang65 has quit [Ping timeout: 240 seconds]
kek has joined #ruby-lang
Newbie0086 has joined #ruby-lang
Cakey has quit [Remote host closed the connection]
Cakey has joined #ruby-lang
stayarrr has quit [Quit: Linkinus - http://linkinus.com]
gianlucadv has joined #ruby-lang
hahuang65 has joined #ruby-lang
Cakey has quit [Ping timeout: 260 seconds]
vondruch has joined #ruby-lang
Cakey has joined #ruby-lang
<yorickpeterse> morning
<matti> Ohai yorickpeterse
<matti> #rubyhugs
robbyoconnor has quit [Ping timeout: 256 seconds]
vintik has quit [Remote host closed the connection]
marr has joined #ruby-lang
Mon_Ouie has quit [Read error: Connection reset by peer]
kiddorails has quit [Remote host closed the connection]
Mon_Ouie has joined #ruby-lang
Mon_Ouie has joined #ruby-lang
Mon_Ouie has quit [Changing host]
ddv has quit [Changing host]
ddv has joined #ruby-lang
robbyoconnor has joined #ruby-lang
kiddorails has joined #ruby-lang
kek_ has joined #ruby-lang
<yorickpeterse> my pants are soaked
<yorickpeterse> I'm very tempted to grab an XL t-shirt we have lying around and wear that as a skirt
ur5us has quit [Remote host closed the connection]
djinni` has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
kek has quit [Ping timeout: 245 seconds]
Cakey has quit [Ping timeout: 260 seconds]
hahuang65 has quit [Ping timeout: 250 seconds]
Benny1992 has quit [Quit: leaving]
Benny1992 has joined #ruby-lang
djinni` has joined #ruby-lang
macsplean1 has joined #ruby-lang
<macsplean1> hey, i am just learning how to spawn a process. does anyone know how to 'reactivate' one, i.e. unbackground it
<yorickpeterse> macsplean1: Once detached you can not re-attach it
<macsplean1> thanks yorickpeterse
ur5us has joined #ruby-lang
<matti> Soaked pants.
Newbie0086 has quit [Ping timeout: 250 seconds]
<yorickpeterse> Jeans, even worse
<yorickpeterse> That means they never dry up
<matti> yorickpeterse: For the same of UK, I had to mentally s/pants/trousers/ ;p
<yorickpeterse> heh
<matti> yorickpeterse: Otherwise it sonuded bit awkward ;]
* matti hugs yorickpeterse
<yorickpeterse> ヽ(´ー`)ノ
<yorickpeterse> dang it that's not the one
haraoka has joined #ruby-lang
<yorickpeterse> (つ。◕‿‿‿‿◕。)つ
<yorickpeterse> nope
<yorickpeterse> (っ´ω`)っ
<yorickpeterse> That's it
<yorickpeterse> I have too many
robbyoconnor has quit [Excess Flood]
robbyoconnor has joined #ruby-lang
jxie has quit [Ping timeout: 264 seconds]
jxie has joined #ruby-lang
gianlucadv has quit [Ping timeout: 260 seconds]
Newbie0086 has joined #ruby-lang
Newbie0086 has quit [Read error: Connection reset by peer]
hahuang65 has joined #ruby-lang
dangerousdave has joined #ruby-lang
hahuang65 has quit [Ping timeout: 240 seconds]
hahuang65 has joined #ruby-lang
gianlucadv has joined #ruby-lang
Lewix_ has joined #ruby-lang
Lewix has quit [Ping timeout: 256 seconds]
Miphix has quit [Quit: Leaving]
hahuang65 has quit [Ping timeout: 272 seconds]
macsplean1 has quit [Ping timeout: 245 seconds]
heftig has joined #ruby-lang
vintik has joined #ruby-lang
Muz_ is now known as Muz
kek_ has quit [Remote host closed the connection]
kek has joined #ruby-lang
kek has quit [Ping timeout: 240 seconds]
gianlucadv has quit [Ping timeout: 260 seconds]
AlecTaylor has joined #ruby-lang
AlecTaylor has joined #ruby-lang
<AlecTaylor> hi
<AlecTaylor> self is @ right?
<apeiros> no
havenwood has joined #ruby-lang
<apeiros> but @variables belong to the object referenced by self
<AlecTaylor> Hmm
* AlecTaylor is from C++, Python and JavaScript
<AlecTaylor> Can you explain?
<apeiros> what should I explain?
homeless has joined #ruby-lang
<homeless> test
<homeless> i don't what wrong with the rails irc
ur5us has quit [Read error: Connection reset by peer]
ur5us_ has joined #ruby-lang
<homeless> what is the difference between RsSpec and capybara
<homeless> anyone
<yorickpeterse> homeless: One is a testing framework, the other one is a library that you can use in said framework to test web pages
havenwood has quit [Ping timeout: 264 seconds]
<homeless> my confusing is why i have to write capybara inside Rspec
<AlecTaylor> apeiros: Are there any issues with always using @ instead of self? - Can self do something @ can't do; and vice versa?
<yorickpeterse> homeless: do you want to test web pages by checking for certain elements, or if some JS is working?
vintik has quit [Remote host closed the connection]
<yorickpeterse> homeless: or perhaps test web pages in an actual browser? If so, Capybara.
<yorickpeterse> If not, then you don't need it
<yorickpeterse> You can use rack-test for most basic testing
<yorickpeterse> * more basic
<homeless> I am following tutorial from micheal
<yorickpeterse> "micheal"?
<homeless> I am nearly finished
<apeiros> AlecTaylor: self.foo is not the same as @foo
<apeiros> AlecTaylor: self.foo calls a method. which must be defined. @foo is a variable lookup.
<homeless> This book by Michael Hartl
<apeiros> AlecTaylor: and self.foo being a method, it does not necessarily have to be a method which returns the value of @foo, or does nothing else than returning that value
macsplean1 has joined #ruby-lang
<apeiros> but self and @vars are closely related. as said before, @variables belong to the object referenced by self.
* apeiros will be back in ~30min
Lewix_ has quit [Remote host closed the connection]
apeiros has quit [Remote host closed the connection]
apeiros has joined #ruby-lang
<homeless> yorickpeterse: thanks for trying to help me
ikrima has quit [Ping timeout: 240 seconds]
<homeless> I will do some mor reasearch
diegoviola has quit [Ping timeout: 260 seconds]
<homeless> and come up with some clear question
macsplean1 has quit [Ping timeout: 240 seconds]
<homeless> why we have to implement TDD at the begaining
<homeless> why can't we should do it at the last
apeiros has quit [Ping timeout: 245 seconds]
hahuang65 has joined #ruby-lang
<ljarvis_> homeless: that's the definition of tdd
ljarvis_ is now known as ljarvis
kiddorails has quit [Remote host closed the connection]
diegoviola has joined #ruby-lang
homeless has quit [Ping timeout: 246 seconds]
hahuang65 has quit [Ping timeout: 240 seconds]
kek has joined #ruby-lang
hahuang65 has joined #ruby-lang
sepp2k has joined #ruby-lang
heftig has quit [Ping timeout: 272 seconds]
kek has quit [Ping timeout: 240 seconds]
heftig has joined #ruby-lang
rahul_j has joined #ruby-lang
kiddorails has joined #ruby-lang
apeiros has joined #ruby-lang
unsymbol has joined #ruby-lang
diegoviola has quit [Quit: WeeChat 0.4.3]
hahuang65 has quit [Ping timeout: 260 seconds]
JohnBat26 has joined #ruby-lang
<yorickpeterse> https://pbs.twimg.com/media/BtoITT6CMAAUOmU.png:orig here's why you should not use Mongo
<yorickpeterse> Just one of many reasons
<yorickpeterse> That spike is me removing data
kek has joined #ruby-lang
<oddmunds> yorickpeterse: what should i use instead?
<yorickpeterse> A proper fucking database
symm- has joined #ruby-lang
<yorickpeterse> MySQL or PostgreSQL will serve most needs, outside of that evaluate choices based on your use-case
<yorickpeterse> But avoid Mongo like the plague
<oddmunds> i heard postgres got key store stuff that outperforms the nosql stuff
<yorickpeterse> It has JSON support which in some cases is indeed better than Mongo
<yorickpeterse> lemme see if I can find the slides
<yorickpeterse> Hm can't find it
<yorickpeterse> Either way, some core Pg dev I believe compared Pg to Mongo and found that in some cases it was faster and compressed data more efficiently
kiddorails has quit [Remote host closed the connection]
postmodern has quit [Quit: Leaving]
stamina has joined #ruby-lang
kiddorails has joined #ruby-lang
rahul_j has quit [Quit: rahul_j]
AKASkip has joined #ruby-lang
alexju has joined #ruby-lang
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hahuang65 has joined #ruby-lang
ldnunes has joined #ruby-lang
kyb3r_ has quit [Read error: Connection reset by peer]
benlovell has quit [Ping timeout: 255 seconds]
yatish27 has quit [Ping timeout: 240 seconds]
hahuang65 has quit [Ping timeout: 250 seconds]
Miphix has joined #ruby-lang
tomkadwill has joined #ruby-lang
miqui has quit [Remote host closed the connection]
hahuang65 has joined #ruby-lang
joonty has quit [Quit: WeeChat 0.4.2]
Sgeo has quit [Read error: Connection reset by peer]
ur5us_ has quit [Remote host closed the connection]
benlovell has joined #ruby-lang
yatish27 has joined #ruby-lang
spastorino has joined #ruby-lang
snoopybbt has joined #ruby-lang
hahuang65 has quit [Ping timeout: 260 seconds]
snoopybbt has quit [Read error: Connection reset by peer]
mehlah has joined #ruby-lang
<AlecTaylor> Is this approach recommended? - http://stackoverflow.com/a/15574534/587021 - I want multiple constructors for my class
<yorickpeterse> AlecTaylor: what the fuck, no
<yorickpeterse> Don't do that shit
<yorickpeterse> This isn't Java
<yorickpeterse> Ruby has optional arguments, you can use those
* AlecTaylor is just learning Ruby
<AlecTaylor> yorickpeterse: So if I wanted two constructors, one taking in one object at a time, the other for batch processing
<AlecTaylor> I should just extract that functionality outside the constructor?
<AlecTaylor> b=Foo(); b.add_batch([])
<AlecTaylor> ^Like that?
<AlecTaylor> yorickpeterse: Also I'm not a Java guy (C++ for me :P)
<yorickpeterse> Your constructor should have no side effects
<yorickpeterse> That is, when you create a new instance it shouldn't do all kinds of heavy lifting
dorei has joined #ruby-lang
<yorickpeterse> The one exception being something like sockets (dbs, etc)
<yorickpeterse> Breaking that out into separate methods also, in theory, makes it easier to test
<AlecTaylor> Mmmk
<yorickpeterse> So what you can do is something like
<yorickpeterse> MyFoobarBatch.new(rows_here).process
<yorickpeterse> or MyFoobarBatch.new.process(rows_here) depending on what you need
<AlecTaylor> Mmm
[spoiler] has joined #ruby-lang
<AlecTaylor> yorickpeterse: Going to just do batch as default case
<AlecTaylor> Find to have a one element list for the other case
<AlecTaylor> *fine
<yorickpeterse> You mean pass the data to process in the constructor?
<apeiros> AlecTaylor: if you want multiple constructors, have a normalized new, and just define the other constructors as class methods which normalize the input and call new
<AlecTaylor> Mmm
<apeiros> if that's not feasible, you probably shouldn't stick it into one class
gianlucadv has joined #ruby-lang
gianlucadv has quit [Remote host closed the connection]
<apeiros> yorickpeterse: IMO a different constructor can have side-effects. but only on the created object. e.g. it runs a couple of methods for you already (your socket example would probably fit that bill)
<yorickpeterse> apeiros: what I mostly meant is that some object shouldn't start batch-processing lord knows how much data when you create an instance of it
<yorickpeterse> It also introduces this pattern where you create instances you never use
<yorickpeterse> e.g.
<yorickpeterse> MyFoobarObject.new(...) # that's all, no methods are ever called on it since it already did everything
<apeiros> ah. yes, true
<yorickpeterse> which is basically procedural programming using objects
<yorickpeterse> aka Javascript
* yorickpeterse runs
<apeiros> what I mean is that with your example `MyFoobarBatch.new(rows_here).process`, one could make a constructor `MyFoobarBatch.process(rows_here)` which does precisely that: call new(rows_here).process.
<yorickpeterse> Oh right
<yorickpeterse> Yeah that's fine, just don't overwrite "new"
hahuang65 has joined #ruby-lang
* apeiros nods
tkuchiki has quit [Ping timeout: 260 seconds]
katlogic has quit [Read error: Connection reset by peer]
hahuang65 has quit [Ping timeout: 260 seconds]
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jgpawletko has joined #ruby-lang
katlogic has joined #ruby-lang
skade has joined #ruby-lang
Forgetful_Lion has quit [Remote host closed the connection]
<yorickpeterse> Docs question: is there something in Ruby similar to Sphinx (http://sphinx-doc.org/) minus the braindead RST markup
<yorickpeterse> I'm currently looking at what we'd use for our API docs and such, there are a few things (e.g. Slate or Home grown stuff) but I prefer to be as lazy as possible
hahuang65 has joined #ruby-lang
emerson_ has joined #ruby-lang
<yorickpeterse> Right now we have some Swagger stuff running which is ok-ish for just some examples
<yorickpeterse> But you can't really fit freeform documentation in it
<yorickpeterse> Plus I had to hack it to get Markdown support
<yorickpeterse> In particular I *hate* the markup used for hyperlinks in RST
<yorickpeterse> `Text here <link-here>`__ # <- who the F came up with this
tkuchiki has joined #ruby-lang
jxie has quit [Ping timeout: 255 seconds]
<yorickpeterse> https://www.gitbook.io/ heh, Github design rip-off much
jxie has joined #ruby-lang
hahuang65 has quit [Ping timeout: 256 seconds]
malconis has joined #ruby-lang
relix has joined #ruby-lang
danijoo has quit [Read error: Connection reset by peer]
danijoo has joined #ruby-lang
<darix> yorickpeterse: if you consider that plaintext readable
<darix> the format is actually nice
<darix> much more readable than [Text here](linkhere)
<darix> imho
hahuang65 has joined #ruby-lang
<sluukkonen> I never remember if it's (foo)[bar] or [foo](bar)
<sluukkonen> and usually I guess wrong
hahuang65 has quit [Ping timeout: 272 seconds]
kiddorails has quit []
thang has quit [Remote host closed the connection]
fmendez has joined #ruby-lang
dangerousdave has quit [Read error: Connection reset by peer]
dangerousdave has joined #ruby-lang
danijoo has quit [Read error: Connection reset by peer]
danijoo has joined #ruby-lang
TvL2386 has quit [Quit: Ex-Chat]
weems|mac has joined #ruby-lang
davidfrey has joined #ruby-lang
khaase has joined #ruby-lang
khaase has joined #ruby-lang
weems|mac has quit [Client Quit]
<yorickpeterse> darix: I disagree
yxhuvud has joined #ruby-lang
<yorickpeterse> sluukkonen: one of them is for images
<yorickpeterse> I forgot which one
<yorickpeterse> something like !(alt text)[image url]
<yorickpeterse> or the other way around
JohnFord has joined #ruby-lang
Cakey has joined #ruby-lang
charliesome has joined #ruby-lang
shinnya has joined #ruby-lang
loincloth has joined #ruby-lang
jds has joined #ruby-lang
AlecTaylor has quit [Quit: Leaving]
havenwood has joined #ruby-lang
frank_o has joined #ruby-lang
araujo has joined #ruby-lang
khaase has quit [Remote host closed the connection]
khaase has joined #ruby-lang
chouhoulis has joined #ruby-lang
hahuang65 has joined #ruby-lang
<frank_o> Hello. I'm fetching some products from the ShopSense API with Rails, but the part that parses the XML looks really ugly. Is there a way I can beautify it with Hashie Rash? Ie. https://gist.github.com/frankie-loves-jesus/6b8012f9197ca6c675a9 although that errors out.
havenwood has quit [Remote host closed the connection]
enebo has joined #ruby-lang
khaase has quit [Ping timeout: 272 seconds]
hahuang65 has quit [Ping timeout: 250 seconds]
GenaraL has joined #ruby-lang
haraoka has quit [Ping timeout: 255 seconds]
<GenaraL> sLm
GenaraL has quit [Client Quit]
Sirupsen has joined #ruby-lang
cmhobbs has joined #ruby-lang
cmhobbs has joined #ruby-lang
arBmind1 has joined #ruby-lang
arBmind has quit [Ping timeout: 255 seconds]
hahuang65 has joined #ruby-lang
havenwood has joined #ruby-lang
sharpmachine has joined #ruby-lang
sharpmachine has quit [Remote host closed the connection]
hahuang65 has quit [Ping timeout: 272 seconds]
cmhobbs has quit [Remote host closed the connection]
hahuang65 has joined #ruby-lang
mistym has joined #ruby-lang
stamina has quit [Ping timeout: 245 seconds]
hahuang65 has quit [Ping timeout: 240 seconds]
ari-_-e has quit [Read error: Connection reset by peer]
mistym has quit [Remote host closed the connection]
centrx has joined #ruby-lang
sharpmachine has joined #ruby-lang
riffraff has joined #ruby-lang
Miphix has quit [Quit: Leaving]
redgetan has quit [Quit: Leaving]
JohnBat26 has quit [Quit: KVIrc 4.3.1 Aria http://www.kvirc.net/]
redgetan has joined #ruby-lang
glace has joined #ruby-lang
cmhobbs has joined #ruby-lang
cmhobbs has quit [Client Quit]
<glace> Hey guys I'm not sure if this is the right place but I'm after some help with a metaprogramming technique
cmhobbs has joined #ruby-lang
havenwood has quit [Remote host closed the connection]
redgetan has left #ruby-lang [#ruby-lang]
solars has quit [Ping timeout: 250 seconds]
<centrx> If this is the right place, you must ask question
redgetan has joined #ruby-lang
mehlah has quit [Quit: Leaving...]
dwknoxy has joined #ruby-lang
glace has quit [Ping timeout: 246 seconds]
AKASkip has quit [Ping timeout: 256 seconds]
tomkadwill has quit [Remote host closed the connection]
havenwood has joined #ruby-lang
mistym has joined #ruby-lang
|jemc| has joined #ruby-lang
dwknoxy has quit [Ping timeout: 245 seconds]
karamazov has joined #ruby-lang
khaase has joined #ruby-lang
khaase has joined #ruby-lang
<redgetan> Hi all, I wrote about Timeout internals in MRI 2.0 - http://redgetan.cc/understanding-timeouts-in-cruby/
<redgetan> feedback, comments, criticisms welcome
<centrx> Cool
loincloth has quit []
banister has joined #ruby-lang
<centrx> You should put it up on Hacker News or Reddit Ruby or whatever the kids are using these days
banister has quit [Max SendQ exceeded]
banister has joined #ruby-lang
banister has quit [Max SendQ exceeded]
<redgetan> centrx: ive put it on hn yesterday - https://news.ycombinator.com/item?id=8093899
banister has joined #ruby-lang
fragamus has joined #ruby-lang
<darix> redgetan: maybe also check the system_timer thing, which as far as i know was generated for better working timeouts
stulzer has joined #ruby-lang
banister has quit [Ping timeout: 245 seconds]
Cakey has quit [Ping timeout: 256 seconds]
Cakey has joined #ruby-lang
loincloth has joined #ruby-lang
banister has joined #ruby-lang
banister has quit [Max SendQ exceeded]
banister has joined #ruby-lang
banister has quit [Max SendQ exceeded]
banister has joined #ruby-lang
ironhide_604 has quit [Ping timeout: 264 seconds]
rippa has joined #ruby-lang
JohnFord has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<redgetan> darix: it seems like system_timer is mostly used for ruby 1.8 where the prob is green threads are not getting scheduled, but i'll take a look at it :)
Blaguvest has joined #ruby-lang
mikecmpbll has quit [Remote host closed the connection]
tbuehlmann has quit [Quit: Leaving]
jlovick has joined #ruby-lang
benlovell has quit [Ping timeout: 264 seconds]
kek has quit [Remote host closed the connection]
kek has joined #ruby-lang
kek has quit [Remote host closed the connection]
mistym has quit [Remote host closed the connection]
__butch__ has joined #ruby-lang
mistym has joined #ruby-lang
cantonic has joined #ruby-lang
__butch__ has quit [Client Quit]
__butch__ has joined #ruby-lang
yalue has joined #ruby-lang
fragamus has quit [Quit: Computer has gone to sleep.]
vintik has joined #ruby-lang
vintik has quit [Remote host closed the connection]
banister has quit [Read error: Connection reset by peer]
mistym has quit [Ping timeout: 240 seconds]
ari-_-e has joined #ruby-lang
cornerma1 has joined #ruby-lang
banister has joined #ruby-lang
banister has quit [Client Quit]
adphillips has quit []
JohnFord has joined #ruby-lang
cornerman has quit [Ping timeout: 255 seconds]
relix_ has joined #ruby-lang
relix has quit [Ping timeout: 250 seconds]
banister has joined #ruby-lang
Cakey has quit [Ping timeout: 255 seconds]
khaase has quit [Remote host closed the connection]
khaase has joined #ruby-lang
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
cantonic has quit [Quit: cantonic]
wallerdev has joined #ruby-lang
khaase has quit [Ping timeout: 256 seconds]
fragamus has joined #ruby-lang
benlovell has joined #ruby-lang
banister has quit [Ping timeout: 250 seconds]
banister has joined #ruby-lang
banister has quit [Max SendQ exceeded]
banister has joined #ruby-lang
mistym has joined #ruby-lang
mistym_ has joined #ruby-lang
mistym has quit [Ping timeout: 240 seconds]
majjoha has joined #ruby-lang
<majjoha> If I want to write good documentation for a gem I am working, what would be the best tool then: TomDoc, YARD, RDoc or something else?
banister has quit [Ping timeout: 240 seconds]
Mon_Ouie has quit [Ping timeout: 256 seconds]
charliesome has joined #ruby-lang
emerson_ has quit [Remote host closed the connection]
stardiviner has quit [Quit: my website: http://stardiviner.dyndns-blog.com/]
ascarter has joined #ruby-lang
benlovell has quit [Ping timeout: 272 seconds]
frank_o has quit [Ping timeout: 272 seconds]
wallerdev has quit [Quit: wallerdev]
mehlah has joined #ruby-lang
riffraff has quit [Quit: This computer has gone to sleep]
havenwood has quit [Remote host closed the connection]
fullybaked has quit []
havenwood has joined #ruby-lang
ascarter has quit [Quit: Textual IRC Client: www.textualapp.com]
djbkd has joined #ruby-lang
ascarter has joined #ruby-lang
Lewix has joined #ruby-lang
yatish27 has quit [Remote host closed the connection]
Mon_Ouie has joined #ruby-lang
enebo has quit [Quit: enebo]
banister has joined #ruby-lang
djbkd has quit [Remote host closed the connection]
djbkd has joined #ruby-lang
rahul_j has joined #ruby-lang
stulzer has quit [Quit: leaving]
stulzer has joined #ruby-lang
mistym_ is now known as mistym
cantonic has joined #ruby-lang
<Lewix> hi guys
shinnya has quit [Ping timeout: 272 seconds]
<havenwood> hi
banister has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
wallerdev has joined #ruby-lang
tbuehlmann has joined #ruby-lang
saarinen has joined #ruby-lang
mbr__ is now known as mbr
elia has quit [Quit: Computer has gone to sleep.]
dangerousdave has quit [Read error: Connection reset by peer]
toastynerd has quit []
dangerousdave has joined #ruby-lang
<karamazov> I'm about to work through the ruby koans using vim but can't seem to find a definitive guide to setting Vim up for Ruby. Anyone have suggestions? Right now I'm running vanilla vim.
riffraff has joined #ruby-lang
rahul_j has quit [Quit: rahul_j]
banister has joined #ruby-lang
banister has quit [Max SendQ exceeded]
banister has joined #ruby-lang
banister has quit [Max SendQ exceeded]
adphillips has joined #ruby-lang
<centrx> karamazov, I just use syntax highlighting
kek has joined #ruby-lang
<karamazov> Cool, thanks centrx
jds has quit [Quit: Connection closed for inactivity]
skade has quit [Quit: Computer has gone to sleep.]
<centrx> karamazov, You can install/activate auto-completion for Ruby or for Rails, but that always seems unnecessary with Ruby and more for languagesThatUseUnnecessaryLongMethodNames()
<karamazov> Haha that's a valid point. I think I'll stick to syntax highlighting for now and then maybe incorporate tmux if I find myself wanting it
<centrx> vim also has window-splitting
AKASkip has joined #ruby-lang
kek has quit [Ping timeout: 272 seconds]
djbkd has quit [Remote host closed the connection]
<karamazov> oh yeah - I do think I stumbled across that before.
djbkd has joined #ruby-lang
banister has joined #ruby-lang
javilm has joined #ruby-lang
javilm has left #ruby-lang [#ruby-lang]
vintik has joined #ruby-lang
go|dfish has quit [Quit: SIGQUIT]
jgpawletko has quit [Ping timeout: 240 seconds]
yfeldblum has quit [Ping timeout: 255 seconds]
solars has joined #ruby-lang
jgpawletko has joined #ruby-lang
<bougyman> karamazov: i go a little more crazy: https://github.com/bougyman/dotvim
<karamazov> bougyman: Oh wow ha...I'll have to work to that status
stamina has joined #ruby-lang
banister has quit [Read error: Connection reset by peer]
apeiros is now known as proc{|x|}
stamina has quit [Client Quit]
jgpawletko has quit [Ping timeout: 240 seconds]
proc{|x|} is now known as apeiros
Lewix has quit [Remote host closed the connection]
Lewix has joined #ruby-lang
jgpawletko has joined #ruby-lang
fragamus has quit [Quit: Computer has gone to sleep.]
majjoha has quit [Quit: Lost terminal]
x0f has quit [Ping timeout: 245 seconds]
riffraff has quit [Read error: Connection reset by peer]
x0f has joined #ruby-lang
cantonic has quit [Ping timeout: 264 seconds]
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
centrx has quit [Quit: Mead error: Connection reset by beer]
riffraff has joined #ruby-lang
malconis has joined #ruby-lang
riffraff has quit [Ping timeout: 260 seconds]
ferski has joined #ruby-lang
ferski has quit [Client Quit]
banister has joined #ruby-lang
malconis has quit [Remote host closed the connection]
ferski has joined #ruby-lang
malconis has joined #ruby-lang
luiz_lha has joined #ruby-lang
yfeldblum has joined #ruby-lang
loincloth has quit [Remote host closed the connection]
riffraff has joined #ruby-lang
enebo has joined #ruby-lang
davispuh has joined #ruby-lang
jader12321 has joined #ruby-lang
<ferski> What is a good resource to understand how this variables work inside of classes?
<ferski> I am doing ruby koans and am stuck on https://gist.github.com/ferski/d36be0177ba37fc0c258
<ferski> it's about_dice_project.rb
<ferski> and I don't know why this small sample isn't confirming that this is Array
<Mon_Ouie> I'm not sure, but the problem is that @variables are instance variables of self, and you can check what self is at the point where you created one:
<Mon_Ouie> >> class Foo; self; end
<Mon_Robot> Mon_Ouie: => Foo (https://eval.in/172734)
__butch__ has quit [Ping timeout: 255 seconds]
saarinen has quit [Quit: saarinen]
__butch__ has joined #ruby-lang
<ferski> Mon_Ouie, so how do I make a variable that can be accessed outside of this class?
<Mon_Ouie> You need to set it when self is an instance of your class, not when it is the class itself
dorei has quit []
<ferski> Mon_Ouie, so use initialize?
<Mon_Ouie> Yup :)
amsi has joined #ruby-lang
banister_ has joined #ruby-lang
banister_ has quit [Max SendQ exceeded]
<ferski> do I still need attr_accessor :values?
banister_ has joined #ruby-lang
saarinen has joined #ruby-lang
<ferski> I see that ruby koans is not enough for me :( I will do another course, but want to finish this one
saarinen has quit [Client Quit]
banister has quit [Read error: Connection reset by peer]
<Mon_Ouie> Yes, the purpose of attr_accessor is to define a getter and a setter so you can access that ivar from the outside
saarinen has joined #ruby-lang
<ferski> ok cool
skade has joined #ruby-lang
<Mon_Ouie> attr_accessor :foo is basically like def foo; @foo; end and def foo=(x); @foo = x; end
<ferski> oh okay
<ferski> now it makes sense, and it passed the test
<ferski> thanks for helping :)
<toretore> is there a way to know if you're inside a signal handler?
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
GaelanAintAround has quit [Quit: Bye!]
zz_dlu has quit [Quit: ZNC - http://znc.in]
centrx has joined #ruby-lang
jader12321 has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
zz_dlu has joined #ruby-lang
GaelanAintAround has joined #ruby-lang
hahuang65 has joined #ruby-lang
ascarter has joined #ruby-lang
postmodern has joined #ruby-lang
loincloth has joined #ruby-lang
djbkd has quit [Remote host closed the connection]
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
momomomomo has joined #ruby-lang
davispuh is now known as _Peacekeeper
_Peacekeeper is now known as davispuh
Bosox20051 has joined #ruby-lang
seamon has joined #ruby-lang
djbkd has joined #ruby-lang
seamon has quit [Client Quit]
ari-_-e has quit [Ping timeout: 240 seconds]
ascarter has joined #ruby-lang
charliesome has quit [Ping timeout: 245 seconds]
Sirupsen has quit [Ping timeout: 245 seconds]
mehlah has quit [Quit: Leaving...]
jbardin has joined #ruby-lang
elia has joined #ruby-lang
scampbell has joined #ruby-lang
dangerousdave has quit [Read error: Connection reset by peer]
charliesome has joined #ruby-lang
dangerousdave has joined #ruby-lang
frank_o has joined #ruby-lang
yfeldblum has quit [Remote host closed the connection]
yfeldblum has joined #ruby-lang
mehlah has joined #ruby-lang
yfeldblu_ has joined #ruby-lang
stayarrr has joined #ruby-lang
riffraff has quit [Quit: This computer has gone to sleep]
yfeldblum has quit [Ping timeout: 240 seconds]
ari-_-e has joined #ruby-lang
DivineEntity has joined #ruby-lang
<ferski> Hey, me again. Having problem with the same ruby koan. This is my updated class, and the test that is failing
<ferski> I debugged it with 'puts first_time' and 'puts second_time' and it has different numbers generated, what's the problem?
AKASkip has quit [Read error: Connection reset by peer]
amsi has quit [Ping timeout: 260 seconds]
<wallerdev> hard to say from that code, but might be you're initializing the random generator with the same seed so you get the same results
<wallerdev> oh i see
<wallerdev> lol
<wallerdev> first_time and second_time are references to the same array
AKASkip has joined #ruby-lang
<wallerdev> youre returning a reference to the internal diceset array
<wallerdev> so the second time you roll you're replacing the first values with the new ones
karamazov has quit [Ping timeout: 272 seconds]
<ferski> but shouldnt the test check for the values instead of the reference?
<wallerdev> the values are the same because first_time and second_time both point to the same array
<wallerdev> they both point to dice.values, which points to the internal @values variable
<wallerdev> so when you roll again, all references to dice.values are getting updated
<wallerdev> if you did like @values = [] instead of @values.clear it would work
<ferski> ok
<wallerdev> because that would create a new array and assign it to the @values variable
<ferski> I fixed this by deleting def initialize and I added @values = Array.new
<ferski> inside my roll method
<wallerdev> yeah you dont even need an instance variable
<ferski> yeah you're right
<ferski> thank you :)
<Mon_Ouie> He doese
<Mon_Ouie> Because of the values method that has to be implemented
<wallerdev> we got someone from the future here i guess
<wallerdev> lol
karamazov has joined #ruby-lang
<Mon_Ouie> (But yeah, in practice that DiceSet class doesn't really make sense…)
tbuehlmann has quit [Remote host closed the connection]
<Mon_Ouie> wallerdev: That's an exercise from rubykoans ;)
<wallerdev> :p
djbkd has quit [Remote host closed the connection]
seamon has joined #ruby-lang
<ferski> programming for my brain is like sex for my penis
frank_o has quit [Read error: No route to host]
frank_o_ has joined #ruby-lang
<aledovsky> What way of storing class related config (e.g. API endpoint) would you prefer of the following? https://gist.github.com/anonymous/ac53389aae142b955db4
elia has quit [Quit: Computer has gone to sleep.]
foucist has joined #ruby-lang
<foucist> how do i call a method twice, and have it only run on the first call
<foucist> not quite memoization..
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
elia has joined #ruby-lang
Blaguvest has quit [Remote host closed the connection]
<aledovsky> What return value do you expect on the second run?
<foucist> don't care
<foucist> it's a resque call
<foucist> would memoization actually work for that ?
<foucist> @foobar ||= ResqueProxy.enqueue
<centrx> Yes, as long as it never returns false or nil
symm- has quit [Ping timeout: 250 seconds]
<centrx> Then you can add return @foobar unless @foobar.nil?
elia has quit [Client Quit]
<centrx> or unless defined?(@foobar)
stayarrr has quit [Quit: Leaving...]
_ht has quit [Read error: Connection reset by peer]
jbardin has quit [Quit: jbardin]
frank_o_ has quit [Quit: leaving]
<foucist> ok
loincloth has quit []
khaase has joined #ruby-lang
khaase has quit [Changing host]
khaase has joined #ruby-lang
centrx has quit [Quit: Mead error: Connection reset by beer]
havenwood has quit [Remote host closed the connection]
[spoiler] has quit [Quit: Leaving]
kirby has joined #ruby-lang
kyb3r_ has joined #ruby-lang
kirby has quit [Client Quit]
djbkd has joined #ruby-lang
shinnya has joined #ruby-lang
dev_progrming has joined #ruby-lang
adphillips has quit []
loincloth has joined #ruby-lang
Soilent_ has joined #ruby-lang
kyb3r_ has quit [Read error: Connection reset by peer]
xybr_ is now known as xybre
dev_progrming is now known as dev_progrmn
dev_progrmn is now known as dev_progrmin
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ferski has quit [Quit: Leaving]
skade_ has joined #ruby-lang
dev_progrmin has quit [Quit: Leaving]
skade has quit [Ping timeout: 255 seconds]
karamazov has quit []
malconis has joined #ruby-lang
momomomomo_ has joined #ruby-lang
momomomomo has quit [Ping timeout: 260 seconds]
momomomomo_ is now known as momomomomo
Guest85999 has quit [Ping timeout: 240 seconds]
jbardin has joined #ruby-lang
Bosox20051 has quit [Ping timeout: 250 seconds]
chaos___________ has joined #ruby-lang
karamazov has joined #ruby-lang
khaase has quit [Remote host closed the connection]
<karamazov> This feels trivial but I can't figure out why the second array value is nil as opposed to [] https://gist.github.com/anonymous/3ae6485eddb443b5b56f
<karamazov> Opps - found the SO answer. Sorry!
elia has joined #ruby-lang
Squarepy has joined #ruby-lang
amsi has joined #ruby-lang
Lewix has quit [Remote host closed the connection]
<dostoyevsky> Can I tell to_json somehow that I it shouldn't try to convert my binary encoded strings as UTF8?
seamon has quit [Quit: seamon]
Lewix has joined #ruby-lang
gix has quit [Ping timeout: 240 seconds]
Johz has joined #ruby-lang
agrinb has joined #ruby-lang
<darix> dostoyevsky: define a to_json on them which encodes them as base64 e.g.?
gix has joined #ruby-lang
banister_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
toastynerd has joined #ruby-lang
<agrinb> noob question: I thought pop removes the last element in the array and returns it, therefore I can iterate through an array with an each loop and eventually be left with an empty array. However, I'm getting something else in pry.
<dostoyevsky> darix: I've just done: class String; def encode(*a); self; end; end
dangerousdave has quit [Read error: Connection reset by peer]
dangerousdave has joined #ruby-lang
foucist has quit [Quit: leaving]
<dostoyevsky> and now to_json doesn't muck about anymore
ur5us has joined #ruby-lang
djbkd has quit [Remote host closed the connection]
<dostoyevsky> I am not sure how to_json will determine the encoding it wants to create... maybe there is another flag I just could set to "binary" like my strings are...
<wallerdev> agrinb: when you do pop youre changing the size of the array youre iterating over
djbkd has joined #ruby-lang
ldnunes has quit [Quit: Leaving]
<wallerdev> not usually a good idea
<wallerdev> try doing a loop like while arr.size > 0; arr.pop; end
banister has joined #ruby-lang
relix_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
JohnFord has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<agrinb> that makes perfect sense, and I honestly haven't looked for alternatives because I want to understand what's happening with the pop method.
JohnFord has joined #ruby-lang
<wallerdev> i think everytime the block runs arr.each checks that its not past the end of the array
<wallerdev> so at 1, it removes the 7, sees theres 6 items in the list and keeps going, 2 removes 6, 5 items, 3 removes 5, 4 items, 4 removes 4, 3 items in the array now, it sees its trying to iterate past the end and stops
<wallerdev> somethin like that
<wallerdev> not sure about the internals of it
<wallerdev> but a lot of languages dont let you even modify arrays in foreach loops because of the weird issues that can happen
<aledovsky> It leaves precisely half of array unprocessed, so your theory seems valid
<agrinb> ok, that makes sense, will try the alternative you suggested. Thanks
<aledovsky> RARRAY_LEN is calculated at every step
<wallerdev> makes sense
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
solars has quit [Ping timeout: 245 seconds]
vintik has quit [Remote host closed the connection]
vintik has joined #ruby-lang
<aledovsky> Obviously the reverse is also valid. `x = [1]; x.each { x << 1 }`
<wallerdev> haha wow that runs fast
<wallerdev> ctrl+c after a second and ive got over a million elements
<aledovsky> using `puts x` inside block surely hangs mine REPL
<wallerdev> yeah i did x.size
rubynewb has joined #ruby-lang
<rubynewb> anyone alive in here?
vintik has quit [Remote host closed the connection]
vintik has joined #ruby-lang
<aledovsky> rubynewb: Hi
nix12 has joined #ruby-lang
nix12 has quit [Client Quit]
rubynewb has quit [Ping timeout: 246 seconds]
dangerousdave has quit [Ping timeout: 240 seconds]
jgpawletko has quit [Quit: jgpawletko]
havenwood has joined #ruby-lang
Johz has quit [Ping timeout: 264 seconds]
x0f has quit [Ping timeout: 256 seconds]
x0f has joined #ruby-lang
vintik has quit [Remote host closed the connection]
vintik has joined #ruby-lang
stulzer has quit [Quit: leaving]
vintik has quit [Ping timeout: 260 seconds]
fukyu has joined #ruby-lang
fukyu has quit [Client Quit]
vintik has joined #ruby-lang
cmhobbs has quit [Remote host closed the connection]
alexju_ has joined #ruby-lang
alexju has quit [Ping timeout: 256 seconds]
wacko has joined #ruby-lang
loincloth has quit [Remote host closed the connection]
Olipro has quit [Ping timeout: 256 seconds]
Sgeo has joined #ruby-lang
djbkd has quit [Remote host closed the connection]
Olipro has joined #ruby-lang
jlovick has quit [Ping timeout: 240 seconds]
djbkd has joined #ruby-lang
vintik has quit [Remote host closed the connection]
djbkd has quit [Remote host closed the connection]
djbkd has joined #ruby-lang
alexju_ has quit [Ping timeout: 256 seconds]
apeiros has quit [Remote host closed the connection]
havenwood has quit [Remote host closed the connection]
apeiros has joined #ruby-lang
elia has quit [Quit: Computer has gone to sleep.]
Squarepy has quit [Quit: Leaving]
apeiros has quit [Ping timeout: 264 seconds]
vintik has joined #ruby-lang
dvgroc has joined #ruby-lang
dvgroc has quit [Client Quit]
DEac- has quit [Read error: Connection reset by peer]
DEac-_ has joined #ruby-lang
skade_ has quit [Quit: Computer has gone to sleep.]
davidfrey has quit [Remote host closed the connection]
davidfrey has joined #ruby-lang
alexju has joined #ruby-lang
elia has joined #ruby-lang
AKASkip has quit [Ping timeout: 260 seconds]
davidfrey has quit [Ping timeout: 264 seconds]
momomomomo has quit [Quit: momomomomo]
nivardus_ has quit [Ping timeout: 272 seconds]
havenwood has joined #ruby-lang
nivardus has joined #ruby-lang
__butch__ has quit [Quit: Leaving.]
MichD is now known as michd
agrinb has quit [Remote host closed the connection]
agrinb has joined #ruby-lang
agrinb has quit [Ping timeout: 250 seconds]
fmendez has quit [Remote host closed the connection]
havenwood has quit [Ping timeout: 264 seconds]
agrinb has joined #ruby-lang
lele has quit [Ping timeout: 256 seconds]
agrinb has quit [Remote host closed the connection]
JohnFord has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
agrinb has joined #ruby-lang
agrinb has quit [Ping timeout: 255 seconds]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
djbkd has quit [Remote host closed the connection]
djbkd has joined #ruby-lang
RobertBirnie has joined #ruby-lang
djbkd has quit [Ping timeout: 264 seconds]
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
|jemc| has quit [Ping timeout: 250 seconds]
sMecKs has joined #ruby-lang
spastorino has quit [Quit: Connection closed for inactivity]
apeiros has joined #ruby-lang
apeiros has quit [Ping timeout: 255 seconds]
marr has quit [Ping timeout: 245 seconds]
emmesswhy has joined #ruby-lang
enebo has quit [Quit: enebo]
lcdhoffman has joined #ruby-lang
charliesome has joined #ruby-lang
danijoo has quit [Read error: Connection reset by peer]
danijoo has joined #ruby-lang