apeiros_ changed the topic of #ruby-lang to: Ruby 2.1.2; 2.0.0-p481; 1.9.3-p545: http://ruby-lang.org || Paste >3 lines of text on http://gist.github.com
omosoj has quit [Ping timeout: 240 seconds]
toastynerd has joined #ruby-lang
toastynerd has quit [Remote host closed the connection]
toastynerd has joined #ruby-lang
stulzer has joined #ruby-lang
kitak has quit [Remote host closed the connection]
stulzer has quit [Client Quit]
kitak has joined #ruby-lang
stulzer has joined #ruby-lang
sharpmachine has joined #ruby-lang
bubodlack has joined #ruby-lang
znz_jp has quit [Quit: kill -QUIT $$]
brianpWins has quit [Quit: brianpWins]
sluukkonen has quit [Ping timeout: 252 seconds]
sluukkonen has joined #ruby-lang
sharpmachine has quit [Ping timeout: 245 seconds]
znz_jp has joined #ruby-lang
lcdhoffman has quit [Quit: lcdhoffman]
tkuchiki has quit [Remote host closed the connection]
starbucks has joined #ruby-lang
stulzer has quit [Quit: leaving]
stulzer has joined #ruby-lang
ddv has quit [Ping timeout: 245 seconds]
stulzer has quit [Client Quit]
stulzer has joined #ruby-lang
pen_isident has quit [Ping timeout: 258 seconds]
ddv has joined #ruby-lang
stulzer has quit [Client Quit]
kitak_ has joined #ruby-lang
omosoj has joined #ruby-lang
mehlah has joined #ruby-lang
lewix has joined #ruby-lang
specialblend has joined #ruby-lang
pen_isident has joined #ruby-lang
tkuchiki has joined #ruby-lang
marr has quit []
jsullivandigs has quit [Read error: Connection reset by peer]
jsullivandigs has joined #ruby-lang
mister_integer has quit [Remote host closed the connection]
llakey has quit [Ping timeout: 240 seconds]
pen_isident has quit [Remote host closed the connection]
specialblend has quit [Quit: specialblend]
toretore has quit [Quit: This computer has gone to sleep]
tkuchiki has quit [Remote host closed the connection]
jsullivandigs has quit [Quit: Leaving...]
knu has quit [Ping timeout: 252 seconds]
cyndis has quit [Remote host closed the connection]
cyndis has joined #ruby-lang
sepp2k has quit [Read error: Connection reset by peer]
mistym has quit [Ping timeout: 276 seconds]
mister_i_ has joined #ruby-lang
alexju has joined #ruby-lang
xsdg_ has quit [Quit: Reconnecting]
omosoj_ has joined #ruby-lang
xsdg has joined #ruby-lang
alexju has quit [Remote host closed the connection]
isale-eko has joined #ruby-lang
cored has quit [Ping timeout: 255 seconds]
mehlah has quit [Quit: Leaving...]
tkuchiki has joined #ruby-lang
mister_i_ has quit [Ping timeout: 255 seconds]
<brixen> nofxx: is that an issue you've had with rbx?
omosoj has quit [Ping timeout: 252 seconds]
spastorino has joined #ruby-lang
omosoj_ has quit [Quit: Leaving]
alexju has joined #ruby-lang
isale-eko has quit [Remote host closed the connection]
alexju has quit [Remote host closed the connection]
bubodlack has quit [Quit: Leaving...]
Miphix has quit [Read error: Connection reset by peer]
Missphoenix has joined #ruby-lang
mykoweb has joined #ruby-lang
alexju has joined #ruby-lang
mykoweb has quit [Ping timeout: 264 seconds]
starbucks has quit [Remote host closed the connection]
bhrgunatha has joined #ruby-lang
starbucks has joined #ruby-lang
centrx has joined #ruby-lang
_JokerDoom has joined #ruby-lang
JokerDoom has quit [Ping timeout: 265 seconds]
bhrgunatha has quit [Client Quit]
danijoo has quit [Quit: Leaving...]
postmodern has joined #ruby-lang
danijoo has joined #ruby-lang
|jemc| has joined #ruby-lang
mister_integer has joined #ruby-lang
machuga has left #ruby-lang ["Textual IRC Client: www.textualapp.com"]
sharpmachine has joined #ruby-lang
mister_integer has quit [Ping timeout: 240 seconds]
sharpmachine has quit [Ping timeout: 240 seconds]
mykoweb has joined #ruby-lang
mykoweb has quit [Remote host closed the connection]
mykoweb has joined #ruby-lang
mykoweb_ has joined #ruby-lang
llakey has joined #ruby-lang
mykoweb has quit [Ping timeout: 240 seconds]
mykoweb_ has quit [Remote host closed the connection]
mykoweb has joined #ruby-lang
junkmechanic_ has quit [Ping timeout: 240 seconds]
mykoweb has quit [Ping timeout: 276 seconds]
danijoo has quit [Read error: Connection reset by peer]
danijoo has joined #ruby-lang
sharpmachine has joined #ruby-lang
sharpmachine has quit [Client Quit]
lewix has quit [Ping timeout: 255 seconds]
dingus_khan has joined #ruby-lang
thomasxie has quit [Quit: Leaving.]
thomasxie has joined #ruby-lang
dingus_khan has quit [Remote host closed the connection]
dingus_khan has joined #ruby-lang
hahuang65 has quit [Quit: Bye.]
hahuang65 has joined #ruby-lang
sharpmachine has joined #ruby-lang
gix has quit [Ping timeout: 252 seconds]
symm- has quit [Ping timeout: 252 seconds]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
dingus_khan has quit [Remote host closed the connection]
danijoo has quit [Ping timeout: 252 seconds]
mistym has joined #ruby-lang
gix has joined #ruby-lang
danijoo has joined #ruby-lang
lewix has joined #ruby-lang
brianpWins has joined #ruby-lang
__butch__ has joined #ruby-lang
__butch__ has quit [Client Quit]
thomasxie has quit [Quit: Leaving.]
thomasxie has joined #ruby-lang
<nofxx> brixen, no, java!
mykoweb has joined #ruby-lang
smiams has joined #ruby-lang
mr-foobar has joined #ruby-lang
<smiams> Hello! I'm running ruby 2.1.1 patch level 76...should this file exist on the ruby-lang.org ftp site?
<smiams> i don't see it when i go here: http://ftp.ruby-lang.org/pub/ruby/2.1/, but these files seem to exist for ruby 1.9
smiams has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
toastynerd has quit [Remote host closed the connection]
smiams has joined #ruby-lang
Atttwwww has quit []
Atttwww has joined #ruby-lang
sharpmachine has quit [Remote host closed the connection]
woollyams has quit [Ping timeout: 252 seconds]
Mon_Ouie has quit [Quit: WeeChat 0.4.3]
dik_dak has quit [Quit: Leaving]
toastynerd has joined #ruby-lang
mistym has quit [Remote host closed the connection]
Asher has quit [Quit: Leaving.]
mister_integer has joined #ruby-lang
alexju_ has joined #ruby-lang
thomasxie has quit [Remote host closed the connection]
alexju has quit [Ping timeout: 252 seconds]
thomasxie has joined #ruby-lang
saltsa has joined #ruby-lang
smiams has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mister_integer has quit [Ping timeout: 252 seconds]
woollyams has joined #ruby-lang
smiams has joined #ruby-lang
centrx has quit [Quit: Mission accomplished. Ready for self-termination.]
smiams has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
phansch has joined #ruby-lang
mistym has joined #ruby-lang
robbyoconnor has quit [Excess Flood]
robbyoconnor has joined #ruby-lang
phansch has quit [Quit: WeeChat 0.4.3]
lewix has quit [Remote host closed the connection]
fezziwig has joined #ruby-lang
karamazov has joined #ruby-lang
yatish27 has joined #ruby-lang
WishBoy has joined #ruby-lang
Mon_Ouie has joined #ruby-lang
Mon_Ouie has joined #ruby-lang
luiz_ has joined #ruby-lang
starbucks has quit [Quit: Leaving...]
yatish27 has quit [Ping timeout: 264 seconds]
sleepee has quit [Quit: Leaving]
luiz_lha has quit [Ping timeout: 255 seconds]
knu has joined #ruby-lang
mister_integer has joined #ruby-lang
spuk has quit [Quit: Human beings were created by water to transport it uphill.]
mister_integer has quit [Read error: Connection reset by peer]
mister_integer has joined #ruby-lang
mister_integer has quit [Ping timeout: 252 seconds]
WishBoy has quit [Ping timeout: 258 seconds]
relix has joined #ruby-lang
WishBoy has joined #ruby-lang
charliesome has joined #ruby-lang
karamazov has quit [Remote host closed the connection]
mykoweb has quit [Remote host closed the connection]
JaReAx has joined #ruby-lang
mykoweb has joined #ruby-lang
mykoweb has quit [Ping timeout: 240 seconds]
knu has quit [Ping timeout: 252 seconds]
_ht has joined #ruby-lang
johnjgrieco has joined #ruby-lang
<johnjgrieco> Anyone familiar with Gosu want to help me out? Ran into a problem in my code. Thanks
kitak_ has quit [Remote host closed the connection]
ur5us has quit [Remote host closed the connection]
<johnjgrieco> Is anyone out there? Lol
kitak_ has joined #ruby-lang
<ari-_-e> johnjgrieco: generally it's better to just ask your question
<johnjgrieco> Ah okay
<johnjgrieco> First timer
<johnjgrieco> I was hoping that I could have someone look at my code, its not very long, I am making a silly game with Gosu.
ta has quit [Remote host closed the connection]
<johnjgrieco> Or if someone can explain Module
<johnjgrieco> This is where my issue is occurring
<ari-_-e> johnjgrieco: you'll want to paste your code, describe the issue, etc
<ari-_-e> (don't paste in the channel though)
<johnjgrieco> Where do I paste it?
<ari-_-e> a paste site... the topic recommends gist but it can be any one
WishBoy has quit [Remote host closed the connection]
<johnjgrieco> This is my first successful code in which I just have mushrooms to collect in the game https://github.com/evergreen-csf/grijoh11/blob/master/GosuGameWorking
<johnjgrieco> This is the code that I am having trouble with when I try to add another item for my player to collect (acorns) https://github.com/evergreen-csf/grijoh11/blob/master/GosuGameNotWorking
<ari-_-e> is that a private repo?
<johnjgrieco> Oh gosh
JPascal has joined #ruby-lang
<johnjgrieco> Yeah it is
<johnjgrieco> I'll make another
<ari-_-e> another repo?
<ari-_-e> using a paste site is fine
<johnjgrieco> This is the working code https://gist.github.com/JohnGrieco/6c29480010540bfafbd3
<ari-_-e> hmm... your indentation is kinda all over the place
ledestin has quit [Ping timeout: 276 seconds]
spastorino has quit [Quit: Connection closed for inactivity]
<johnjgrieco> This is the not working code when I try to add acorns to the game https://gist.github.com/JohnGrieco/8074ec7111c65c19a0b2
<johnjgrieco> Very new to this, Thanks for any help
JPascal has quit []
JPascal has joined #ruby-lang
JPascal has quit [Client Quit]
JPascal has joined #ruby-lang
JaReAx has quit [Ping timeout: 258 seconds]
ta has joined #ruby-lang
fezziwig has quit [Remote host closed the connection]
<johnjgrieco> Is the code legible?
fezziwig has joined #ruby-lang
<ari-_-e> not really
|jemc| has quit [Ping timeout: 258 seconds]
<johnjgrieco> When I click the link it looks pretty neat on the github site
nkirkwood has joined #ruby-lang
<johnjgrieco> Did you try running it?
<ari-_-e> no
<ari-_-e> I'm just looking at the gist
<ari-_-e> the indentation is inconsistent
<nkirkwood> Hello. Does anyone have experience with accessing ODBC with ruby. Specifically FileMaker
<johnjgrieco> I know that might make it not very neat but it doesn't really make the code not work right?
JaReAx has joined #ruby-lang
scepticulous has joined #ruby-lang
<ari-_-e> johnjgrieco: the interpreter will have no trouble with it, but the people you're asking for help from might have different feelings :)
fezziwig has quit [Ping timeout: 240 seconds]
<johnjgrieco> Yeah, and for that I apologize:) Do you think you'll be able to help?
sharpmachine has joined #ruby-lang
<ari-_-e> well, you haven't even said what your issue is
smiams has joined #ruby-lang
smiams has left #ruby-lang [#ruby-lang]
woollyams has quit [Ping timeout: 252 seconds]
zlogan has joined #ruby-lang
<johnjgrieco> The first set of code runs great, then I tried to add another item for my player to collect (acorns) and it fails, I get an error having to do with ZOrder, a module I created
alexju_ has quit [Remote host closed the connection]
<johnjgrieco> Also my terminology is most likely not accurate so bare with me
<ari-_-e> what error?
<johnjgrieco> NameError
<ari-_-e> the full error
<ari-_-e> paste it if it's long
woollyams has joined #ruby-lang
[spoiler] has joined #ruby-lang
sharpmachine has quit [Remote host closed the connection]
woollyams has quit [Ping timeout: 252 seconds]
amclain has quit [Quit: Leaving]
ta has quit [Ping timeout: 252 seconds]
<johnjgrieco> Imain.rb:54:in `draw': uninitialized constant DCTGame::ZOrder (NameError) from main.rb:171:in `<main>'
Cakey has joined #ruby-lang
<johnjgrieco> ari-_-e: main.rb:54:in `draw': uninitialized constant DCTGame::ZOrder (NameError) from main.rb:171:in `<main>'
arooni-mobile has quit [Ping timeout: 255 seconds]
<ari-_-e> heh
ta has joined #ruby-lang
<ari-_-e> johnjgrieco: fix your indentation
<johnjgrieco> on the gist?
<ari-_-e> do it for yourself
<ari-_-e> you'll be happier
<johnjgrieco> Okay I'll do it right now
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<ari-_-e> johnjgrieco: also count your "end"s
<johnjgrieco> ari-_-e: Too many?
<johnjgrieco> This is my first time coding, you should treat me like I know practically nothing
<johnjgrieco> ari-_-e: I updated the working code, is this what you were asking?
<johnjgrieco> Check it out and see if it looks better
<johnjgrieco> Although that is not the code that I am having issues with.
Cakey has quit [Ping timeout: 252 seconds]
<ari-_-e> johnjgrieco: ends are supposed to line up with the thing that they end
<ari-_-e> and yeah, do it on your newest code
Mon_Ouie has quit [Ping timeout: 245 seconds]
banister has joined #ruby-lang
cnivolle has joined #ruby-lang
banister has quit [Client Quit]
charliesome has joined #ruby-lang
<johnjgrieco> Okay I did it to the code thats not working https://gist.github.com/JohnGrieco/8074ec7111c65c19a0b2
<ari-_-e> better
<ari-_-e> did you count your ends?
<johnjgrieco> Yeah, it made it much easier to understand what I was ending, am I missing some? Or have too many?
<ari-_-e> count em :)
<johnjgrieco> Okay I added one
<ari-_-e> sweet
ironhide_604 has joined #ruby-lang
<johnjgrieco> I ran the code again and it seemed to have helped, I saw a glimps of life but then it gave me a different error
<johnjgrieco> in `draw': divided by 0 (ZeroDivisionError) from main.rb:56:in `block in draw' from main.rb:56:in `each' from main.rb:56:in `draw' from main.rb:171:in `<main>'
<ari-_-e> what's the first line num?
<johnjgrieco> 163
<ari-_-e> so there's only one candidate there
<ari-_-e> for what could be 0
<johnjgrieco> Lol, I'm not dividing anything by zero on that line though
cnivolle has quit [Remote host closed the connection]
<johnjgrieco> And I did it exactly the same on the Shroom class and no errors
<johnjgrieco> line 144
cnivolle has joined #ruby-lang
<ari-_-e> you're right - in fact, those classes are almost identical
<johnjgrieco> Yeah so why would I have issues with just one?
<johnjgrieco> I want them to do the exact same thing
mistym has quit [Remote host closed the connection]
<johnjgrieco> Just with a different image
<ari-_-e> well why don't you merge them? if you want them to do the same thing, that seems logical
ta has quit [Ping timeout: 265 seconds]
[spoiler] has quit [Remote host closed the connection]
<johnjgrieco> Okay, sounds like a good plan
<johnjgrieco> Work me through it?
<ari-_-e> well, how are they different?
<johnjgrieco> The image will be different and the pixels that they appear in will be different
<ari-_-e> doesn't look like it to me
cnivolle has quit [Ping timeout: 258 seconds]
<ari-_-e> don't think about how exactly you're using them
[spoiler] has joined #ruby-lang
<ari-_-e> when it comes to merging them, you want to look at the code differences
dingus_khan has joined #ruby-lang
<johnjgrieco> There are no code differences
<ari-_-e> I see one
<johnjgrieco> Class name
<ari-_-e> well yeah
<ari-_-e> two :)
<johnjgrieco> ZOrder
<ari-_-e> right
<johnjgrieco> That is where I was having the error in the first place
<ari-_-e> the first error?
<johnjgrieco> Yeah
<ari-_-e> well you fixed that
<ari-_-e> ancient history
<johnjgrieco> Yeah
<ari-_-e> so they have different ZOrders
<johnjgrieco> Right
<ari-_-e> can you think of a way to factor that out?
banister has joined #ruby-lang
<johnjgrieco> I thought I did that by adding acorns to the module
<ari-_-e> did what?
<johnjgrieco> Line 127
banister has quit [Client Quit]
<johnjgrieco> The constants, right?
<ari-_-e> yeah
<ari-_-e> I see that there's an Acorns constant
<johnjgrieco> lol
<ari-_-e> :)
<johnjgrieco> Obviously didn't help with the merging
<ari-_-e> I meant the different ZOrders
ta has joined #ruby-lang
<ari-_-e> how could you factor out the ZOrder difference from those two classes?
<ari-_-e> because once that's gone they'll be identical, right?
woollyams has joined #ruby-lang
<johnjgrieco> Create another class?
<johnjgrieco> or def zorder?
<ari-_-e> johnjgrieco: what is different about different instances of Shroom or Acorn?
<ari-_-e> actually...
<ari-_-e> hmm
<ari-_-e> johnjgrieco: before, you said that there were some differences in how you were using Shroom and Acorn, what were they again?
<johnjgrieco> I'll be using them exactly the same, they are both items for my player to pick up, just different images
<ari-_-e> right
ta has quit [Remote host closed the connection]
<ari-_-e> and how are you telling them to have different images?
moogumbo has quit [Quit: Connection closed for inactivity]
<johnjgrieco> in the @acorn_anim
<johnjgrieco> Created an Acorn class and gave it its own animation
<ari-_-e> and Shroom also, right?
<johnjgrieco> Yes
<ari-_-e> could you do that same thing with the ZOrder?
<johnjgrieco> Make ZOrder a class and put both animations in it?
JohnBat26 has joined #ruby-lang
woollyams has quit [Ping timeout: 252 seconds]
<ari-_-e> no, give Acorn/Shroom their ZOrders
<ari-_-e> like you did with their animations
<johnjgrieco> I thought thats what I did
<johnjgrieco> Each one has ZOrder
<ari-_-e> do you see how you're passing in the animations?
ledestin has joined #ruby-lang
<johnjgrieco> Yes, through draw right?
<ari-_-e> say you're creating an Acorn
<ari-_-e> an Acorn instance
<ari-_-e> do you see how you set that instance's animation?
<ari-_-e> did you write this code?
solars has joined #ruby-lang
dingus_khan has quit [Read error: Connection reset by peer]
<johnjgrieco> I was following a tutorial and then I decided to try and take if further.
<ari-_-e> which tutorial?
lsegal has quit [Quit: Quit: Quit: Quit: Stack Overflow.]
<johnjgrieco> I have already emailed the creator but stopped by hear for help
<johnjgrieco> I am trying to understand
knu has joined #ruby-lang
<ari-_-e> johnjgrieco: I see, so this comes from the Star class?
GBrawl has joined #ruby-lang
<johnjgrieco> Yeah
<johnjgrieco> But I tried to add another star class (acorn) the same way and here we are
<ari-_-e> johnjgrieco: if this is your first time coding, you might not want to start with this
<johnjgrieco> I learn better by starting with harder stuff...
<ari-_-e> I think this is for people who want to learn how to use gosu with ruby, not for people who are new to programming
<ari-_-e> well it's not telling you anything about object-oriented programming or anything
<ari-_-e> which is important
<johnjgrieco> I understand that this is not for people new to programming but Gosu does seem to be a beginners tool to creating something tangible from code.
<johnjgrieco> I would really like to know how to add another (star) to my game....
<ari-_-e> johnjgrieco: does Acorn.png actually exist?
<johnjgrieco> Yes
<ari-_-e> how big is it?
knu has quit [Ping timeout: 252 seconds]
<johnjgrieco> pixel size or file size?
<ari-_-e> and how big is shroom.png?
<ari-_-e> pixel size
<ari-_-e> dimensions
<johnjgrieco> 25, 25
<johnjgrieco> small
<johnjgrieco> I can send you a video of the working game with the shrooms
<johnjgrieco> So you have an idea of whats going on
<ari-_-e> so they're the same dimensions?
<johnjgrieco> Yes
<ari-_-e> hmm...
<johnjgrieco> Seemed like a good size, the shrooms look perfect
<johnjgrieco> The background is a forest, so the shrooms pop up on the forest floor
toastynerd has quit [Remote host closed the connection]
<johnjgrieco> I want Acorns to pop up in the trees
<johnjgrieco> I know I have them set to both appear in the same area but I was going to change that when I got them to appear at all
gregf_ has quit [Quit: leaving]
<ari-_-e> johnjgrieco: ok, well do you see what must be zero on line 163 for you to be getting this error?
<ari-_-e> also: do you know what the % operator does?
<johnjgrieco> milliseconds?
<ari-_-e> it's division by zero
<ari-_-e> are you divising by milliseconds?
<ari-_-e> dividing
adphillips has joined #ruby-lang
adphillips has quit [Remote host closed the connection]
<johnjgrieco> oh, @animation.size
<ari-_-e> yeah
mikecmpbll has joined #ruby-lang
<ari-_-e> there is another possibility actually, that I had to check: are you familiar with the term operator precedence?
ta has joined #ruby-lang
<johnjgrieco> Yes, kind of, the order that the language does things in?
<johnjgrieco> Which operator goes first
<ari-_-e> it's the order that the operators are evaluated in, yes
<ari-_-e> it could have been that the % was evaluated first, and the 100 % @animation.size resulted in zero, causing the division by zero
mikecmpbll has quit [Client Quit]
<ari-_-e> but that's not the case - / and % actually have the same precedence, and in this case the operators are evaluated left to right
<ari-_-e> so the / is evaluated first
<ari-_-e> each group of operators that have the same precedence have something called "associativity" which says what direction operators of the same precedence are evaluated in
<ari-_-e> *, / and % have the same precedence and their associativity is left to right
Fushi has joined #ruby-lang
<johnjgrieco> Right, I found that, got it
<johnjgrieco> So thats not an issue
<ari-_-e> right, so the problem is @animation.size
<johnjgrieco> Yeah but it works just fine with the Shroom class...
<ari-_-e> which brings us back to where @animation comes from :)
frzng has quit [Quit: frzng]
<ari-_-e> do you know what the @ means?
Mon_Ouie has joined #ruby-lang
Mon_Ouie has quit [Changing host]
Mon_Ouie has joined #ruby-lang
<johnjgrieco> So how did I set that instance's animation?
<ari-_-e> right
charliesome has quit [Read error: Connection reset by peer]
charliesome_ has joined #ruby-lang
skade has joined #ruby-lang
<johnjgrieco> So how did I? lol
<ari-_-e> do you know what the @ means?
tbuehlmann has joined #ruby-lang
mikecmpbll has joined #ruby-lang
fezziwig has joined #ruby-lang
skade_ has joined #ruby-lang
<johnjgrieco> I don't
<johnjgrieco> Variable in a class?
michd is now known as MichD
skade has quit [Ping timeout: 240 seconds]
<ari-_-e> in an instance
<ari-_-e> it's an instance variable
fezziwig has quit [Ping timeout: 240 seconds]
<johnjgrieco> Got it
<ari-_-e> do you see where it is set?
<johnjgrieco> Yes, it's set twice, once under Shroom class and another under Acorn class
havenwood has quit []
<ari-_-e> well, every instance has its own instance variables
<johnjgrieco> Okay got it
<ari-_-e> so those aren't the same variable
<ari-_-e> in fact, every time either of those pieces of code run it's a new variable
Cakey has joined #ruby-lang
<ari-_-e> but yes
<johnjgrieco> Okay so I should change the name of one of them?
<ari-_-e> no
<ari-_-e> they're already different
<ari-_-e> what methods are they set in?
<johnjgrieco> Initialze
<ari-_-e> and do you know when initialize is called?
<johnjgrieco> I don't
<johnjgrieco> Like what order?
<johnjgrieco> Or when in the program is it called?
<ari-_-e> what would you have to do for that method to be called
<johnjgrieco> end?
<ari-_-e> it's an initializer for instances
<ari-_-e> it's called when you create an instance
<ari-_-e> to initialize it
<johnjgrieco> got it, in this case, @animation
<ari-_-e> it does a few other things
Cakey has quit [Ping timeout: 265 seconds]
<johnjgrieco> right
<ari-_-e> where in the program do instantiate Acorn?
wallerdev has quit [Quit: wallerdev]
<ari-_-e> *do you
<johnjgrieco> in the game class
<johnjgrieco> Right?
<ari-_-e> yeah
<ari-_-e> what line
<johnjgrieco> 16
<ari-_-e> no
<johnjgrieco> oh yeah 15
<ari-_-e> also no
<johnjgrieco> Under draw?
<ari-_-e> nope
Cakey has joined #ruby-lang
<johnjgrieco> 56?
<ari-_-e> to instantiate Foo, you do Foo.new(arguments)
<ari-_-e> that creates a new instance of Foo
<ari-_-e> you would have to reference Foo somehow
<ari-_-e> or Acorn
<ari-_-e> lines 15, 16, and 56 do not reference Acorn
<johnjgrieco> line 16 @acorns = Array.new
<ari-_-e> yup
<johnjgrieco> okay
<ari-_-e> no Acorn there
marr has joined #ruby-lang
<ari-_-e> there's @acorns
<ari-_-e> but no Acorn
<johnjgrieco> Ah
<johnjgrieco> 150 Class Acorn
<ari-_-e> ?
cnivolle has joined #ruby-lang
twintail has joined #ruby-lang
Cakey has quit [Ping timeout: 245 seconds]
<johnjgrieco> Acorn is only on two lines
<johnjgrieco> 56 and 150
<maloik> hehe
<maloik> someone decided to restart our CI server
<maloik> and all of a sudden it decides to start sending emails for failed builds
<maloik> as in, all failed builds, ever
<maloik> 125 mails in 2 mminutes and counting
<ari-_-e> johnjgrieco: almost all programming languages are case-sensitive
<ari-_-e> the ones that aren't aren't worth bothering with
<johnjgrieco> Okay so I have lowercase a for acorn and I should capitalize it?
<ari-_-e> ...no
<ari-_-e> we're trying to find where Acorn is currently instantiated
<ari-_-e> you haven't found it
<ari-_-e> remember how I said Foo.new instantiates Foo?
<johnjgrieco> ah line 46
<ari-_-e> yes
<ari-_-e> the arguments to .new are passed to initialize
qba73 has joined #ruby-lang
<johnjgrieco> Got it
<ari-_-e> so where does @animation come from?
phansch has joined #ruby-lang
<johnjgrieco> I figured it out! You helped so much
<johnjgrieco> line 45
<johnjgrieco> acorn size was set < 25
<johnjgrieco> the actual pixels were higher than 25
<johnjgrieco> I changed the image size to lower than 25 pixels and now i have acorns
<ari-_-e> hmm...
<johnjgrieco> the image file for acorn was 23 x 37 pixels
<ari-_-e> I asked you what the size was :-/
<johnjgrieco> I changed it to 25 X 25
<johnjgrieco> Yeah, I had it saved incorrectly
<ari-_-e> hmm
<ari-_-e> ok
<johnjgrieco> Thank you so much!
<johnjgrieco> You would be a great teacher
<ari-_-e> well, the @acorns.size < 25 on line 45 isn't the cause
mehlah has joined #ruby-lang
<ari-_-e> @acorns.size isn't the size of the image
tomkadwill has joined #ruby-lang
<yorickpeterse> morning
toastynerd has joined #ruby-lang
Missphoenix has quit [Quit: Leaving]
<johnjgrieco> Oh okay, well maybe it was holding me to the 25, 25 on line 15
<ari-_-e> johnjgrieco: that would be my guess
<ari-_-e> that's why I asked about the size of the image
<johnjgrieco> Yeah I was going through your comments above and I rechecked the size and sure enough it was wrong
toastynerd has quit [Ping timeout: 240 seconds]
<johnjgrieco> Thanks for all of your help
<johnjgrieco> You have the patience of a saint
<johnjgrieco> Any ideas on how to package this into a DMG file so that others can view my game?
<ari-_-e> johnjgrieco: is this for a class?
<johnjgrieco> Yeah
<johnjgrieco> I finished the Ruby Codecadamy but didn't learn very much, then I decided to mess around with making a simple game
<ari-_-e> have you not been taught anything about ruby in your class...?
<johnjgrieco> Learning curve is pretty brutal
<ari-_-e> what was the assignment exactly?
Cakey has joined #ruby-lang
<johnjgrieco> Follow an online programming course, which I finished in like a week, then mess around the language you learned
<johnjgrieco> I need some sort of theory
<johnjgrieco> This is a very small part of my class
<johnjgrieco> Programming/Software Anthropology/hardware/lecture series
<johnjgrieco> ari-_-e: Thanks for the help! I'm sure i'll be back;)
<johnjgrieco> Have a good night or morning.
workmad3 has joined #ruby-lang
<johnjgrieco> In Washington its 2 am
alex-quiterio has joined #ruby-lang
<ari-_-e> in massachusetts it's 5am
<johnjgrieco> Time for bed? Or are you just starting your day?
<johnjgrieco> ari-_-e: Also, what path did you take in learning Ruby, or any language in general?
<ari-_-e> hah well I've been talking to you since 1:30am my time, so...
Cakey has quit [Ping timeout: 252 seconds]
Cakey has joined #ruby-lang
<workmad3> ari-_-e: so time for lunch? :)
<johnjgrieco> Haha
<ari-_-e> ~_~
kitak_ has quit [Ping timeout: 240 seconds]
Miphix has joined #ruby-lang
kitak_ has joined #ruby-lang
Cakey has quit [Ping timeout: 240 seconds]
JPascal has quit []
robmiller has quit [Quit: Leaving.]
<johnjgrieco> Any good advice for learning Ruby? Tools, Books, websites?
<ari-_-e> dunno
<johnjgrieco> How did you learn?
<ari-_-e> reading other people's code is useful
<johnjgrieco> Yeah, that is the route I'm currently taking
<johnjgrieco> Well thanks again
<johnjgrieco> time for me to hit the sack
Atttwww has quit [Ping timeout: 255 seconds]
johnjgrieco has quit [Quit: Page closed]
cored has joined #ruby-lang
cored has quit [Changing host]
cored has joined #ruby-lang
knu has joined #ruby-lang
benlovell has joined #ruby-lang
arBmind has joined #ruby-lang
thomasxie has quit [Quit: Leaving.]
danijoo has quit [Read error: Connection reset by peer]
frobrob has joined #ruby-lang
danijoo has joined #ruby-lang
ur5us has joined #ruby-lang
heftig has joined #ruby-lang
ironhide_604 has quit [Ping timeout: 245 seconds]
elia has joined #ruby-lang
cored has quit [Ping timeout: 252 seconds]
ur5us has quit [Read error: No route to host]
ur5us has joined #ruby-lang
ironhide_604 has joined #ruby-lang
lewix has joined #ruby-lang
JPascal has joined #ruby-lang
gregf_ has joined #ruby-lang
GBrawl has quit [Quit: Computer has gone to sleep.]
fezziwig has joined #ruby-lang
GBrawl_ has joined #ruby-lang
kitak_ has quit [Remote host closed the connection]
fezziwig has quit [Ping timeout: 276 seconds]
woollyams has joined #ruby-lang
kyb3r_ has quit [Read error: Connection reset by peer]
kitak_ has joined #ruby-lang
cbreeze has joined #ruby-lang
kitak_ has quit [Read error: Connection reset by peer]
kitak_ has joined #ruby-lang
lewix has quit [Remote host closed the connection]
toastynerd has joined #ruby-lang
lewix has joined #ruby-lang
GBrawl_ has quit [Quit: Computer has gone to sleep.]
mehlah has quit [Quit: Leaving...]
alex-quiterio1 has joined #ruby-lang
alex-quiterio1 has quit [Remote host closed the connection]
toastynerd has quit [Ping timeout: 240 seconds]
lewix has quit [Ping timeout: 240 seconds]
alex-quiterio has quit [Ping timeout: 258 seconds]
charliesome_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
cnivolle has quit [Remote host closed the connection]
franzip has joined #ruby-lang
stamina has joined #ruby-lang
yfeldblum has quit [Remote host closed the connection]
simono has joined #ruby-lang
elia has quit [Quit: (IRC Client: textualapp.com)]
elia has joined #ruby-lang
mehlah has joined #ruby-lang
bubodlack has joined #ruby-lang
elia has quit [Client Quit]
elia has joined #ruby-lang
kitak_ has quit [Remote host closed the connection]
elia has quit [Client Quit]
marr has quit [Ping timeout: 252 seconds]
twintail has quit [Quit: Leaving.]
joonty has joined #ruby-lang
rsl has joined #ruby-lang
lewix has joined #ruby-lang
ironhide_604 has quit [Ping timeout: 245 seconds]
alexju has joined #ruby-lang
ironhide_604 has joined #ruby-lang
lewix has quit [Ping timeout: 252 seconds]
roelof has joined #ruby-lang
<roelof> Hello, You can use x.select { |y| y.even?} to make a new array with only even numbers
zenspider has quit [Ping timeout: 252 seconds]
qba73 has quit []
<roelof> but how do I make it works as someone puts a y["a"'] as a argument. This gives a NoMethodError
zenspider has joined #ruby-lang
<roelof> as test I made this : Test.assert_raise(NoMethodError , no_odds(["a"]), "Er bestaat geen ?even voor een string") but that will not work either
<yorickpeterse> eh?
<yorickpeterse> You mean something like x.select { |y| y['a'].even? }
<yorickpeterse> + ?
ht_ has joined #ruby-lang
<roelof> yorickpeterse: nope, I mean something like this ["a".select { |y| y.iseven? }
Kero has quit [Ping timeout: 240 seconds]
cbreeze has quit [Quit: Textual IRC Client: www.textualapp.com]
_ht has quit [Ping timeout: 252 seconds]
<sluukkonen> you mean ["a"].select { |y| y.even? } ?
kitak has quit [Remote host closed the connection]
kitak has joined #ruby-lang
<yorickpeterse> roelof: that is invalid Ruby
<roelof> sluukkonen: that what I meant. sorry for the confusion
<roelof> yorickpeterse: see respons to sluukkonen
ascarter has quit [Quit: Textual IRC Client: www.textualapp.com]
<sluukkonen> not sure what you want to do. obviously you can't ask a String if it's even, because a String is not an Integer.
ascarter has joined #ruby-lang
<roelof> sluukkonen: correct, you get a NoMethodError.
<apeiros> you can't use select either since it's not Enumerable
toastynerd has joined #ruby-lang
<sluukkonen> apeiros: Array of Strings
<apeiros> sluukkonen: not in his example
<roelof> I try to make a test but I always see a syntax error
<apeiros> "a".select # <-- not an array of strings
yfeldblum has joined #ruby-lang
<roelof> How can I make a good assert_raise test for this
<sluukkonen> I thought he meant ["a"].select { |y| y.even? }
<sluukkonen> like I asked above
GBrawl has joined #ruby-lang
<roelof> this seems to be wrong : Test.assert_raise(NoMethodError , no_odds(["a"])
<apeiros> sluukkonen: I take stuff at face value and ask if I think people made mistakes when asking :)
<sluukkonen> well you're missing the last ) on that line
<roelof> sluukkonen: then I see this output : http://pastebin.com/uCTatuCi
<sluukkonen> where does that Test.assert_raise come from anyway?
<roelof> I doing exercises from codewars so I think they have made some classes
<workmad3> roelof: investigate, because that isn't going to work as a way to test for asserts
toastynerd has quit [Ping timeout: 245 seconds]
<sluukkonen> I'm thinking that Test.assert_raise thingy wants a block
<workmad3> *raises
<workmad3> sluukkonen: that's what I'd expect :) a block, or maybe a lambda as the second arg
yfeldblum has quit [Ping timeout: 255 seconds]
<sluukkonen> because no_odds(["a"]) is evaluated before Test.assert_raise is called
ascarter has quit [Quit: Textual IRC Client: www.textualapp.com]
<sluukkonen> I suggest reading the documentation/source code for the Test module
ascarter has joined #ruby-lang
<roelof> so more like this : http://pastebin.com/SxPdYfUZ
<roelof> or do I have to change my normal code with a if then ?
<sluukkonen> probably something along those lines
<roelof> sluukkonen: which lines ??
frzng has joined #ruby-lang
dmitrykorotkov has joined #ruby-lang
Kero has joined #ruby-lang
dmitrykorotkov is now known as Guest21294
priodev has quit [Ping timeout: 264 seconds]
ironhide_604 has quit [Remote host closed the connection]
ur5us has quit [Remote host closed the connection]
<roelof> sluukkonen: do you mean the pastebin piece or the if-then ?
Guest21294 has quit [Ping timeout: 240 seconds]
<sluukkonen> I mean the correct way to test it will be probably something like what you paste in that pastebin
bubodlack has quit [Read error: Connection reset by peer]
bubodlack has joined #ruby-lang
<sluukkonen> but I don't know how that Test module you're using is built
marr has joined #ruby-lang
<roelof> sluukkonen: pity . I tried this :http://pastebin.com/XsFXxxvu but then I see this error NoMethodError: undefined method `assert_raise' for Test:Class
bubodlack is now known as bubodlack|away
<badeball> oh my gawd, mongoid really is rittled with method_missing overrides
<badeball> and respond_to?
bubodlack|away is now known as bubodlack
<yorickpeterse> badeball: yup
<yorickpeterse> I've had cases where respond_to?() would return true
<yorickpeterse> even if the method wasn't there
<badeball> the stacktrace gives me absolutely no idea whats going on
<yorickpeterse> Summary:
<yorickpeterse> lol
<yorickpeterse> Description:
<yorickpeterse> lol error
<yorickpeterse> ^ hate those errors
<badeball> in our case, because we have a translated app, but not bothered with translating mongoid.. Problem: translation missing: no.mongoid.errors.messages.document_not_found.message
<yorickpeterse> ha
ironhide_604 has joined #ruby-lang
<badeball> I'm a big boy and probably would have understod ExceptionNotFound
<roelof> sluukkonen: yorickpeterse thanks for all the help and have a good day
<roelof> byee
<yorickpeterse> roelof: toodles
<yorickpeterse> badeball: the weirdest part is why you would want i18n translations
<yorickpeterse> for errors
<yorickpeterse> like
<yorickpeterse> wat
roelof has quit [Quit: Page closed]
<badeball> yeah, in no way do I want mongoid to handle that
sarkyniin has joined #ruby-lang
nofxx has quit [Ping timeout: 240 seconds]
nofxx has joined #ruby-lang
nofxx has quit [Changing host]
nofxx has joined #ruby-lang
skade_ has quit [Ping timeout: 276 seconds]
ozzloy has quit [Remote host closed the connection]
ozzloy has joined #ruby-lang
ozzloy has joined #ruby-lang
alexju has quit [Remote host closed the connection]
tomkadwill has quit [Remote host closed the connection]
tomkadwill has joined #ruby-lang
heftig has quit [Quit: Quitting]
alexju has joined #ruby-lang
postmodern has quit [Quit: Leaving]
frobrob has quit [Ping timeout: 252 seconds]
Derander has quit [Ping timeout: 276 seconds]
alexju has quit [Remote host closed the connection]
luiz_ has quit [Remote host closed the connection]
luiz_ has joined #ruby-lang
elia has joined #ruby-lang
toretore has joined #ruby-lang
tomkadwill has quit [Ping timeout: 240 seconds]
Derander has joined #ruby-lang
zz_nopc0de is now known as nopc0de
workmad3 is now known as wm3|away
vpretzel has joined #ruby-lang
<maloik> day two of debugging invoicing totals in a rails 3.0 project without test coverage
<yorickpeterse> write some tests you scrub
<maloik> still haven't thrown myself off a cliff
<yorickpeterse> oh wait TDD is dead anyway
* yorickpeterse runs
<maloik> easier said than done
<maloik> I still haven't figured out the problem, while still working on a basic understanding of all these methods calculating a bunch of seemingly unrelated shit
toastynerd has joined #ruby-lang
<maloik> reductions, reduction percentages, totals, VATs, VAT percentages, subtotals, ...
<maloik> some are cached, others aren't, some look like they'd be cached in the line item model but arent (all fields are nil)
<maloik> good times
<apeiros> yorickpeterse: given that he has no test, it's not TDD but BDTW anyway :)
<apeiros> (Bug Driven Test Writing)
<maloik> :D
<maloik> that could definately be a thing
<maloik> I think by the time I'm done it'll be DDI
<maloik> development driven insanity
<apeiros> I think insanity is pretty much a prerequisite for development
<certainty> +1
<yorickpeterse> well yeah
<maloik> another problem (well, nuissance really) is that while testing the methods is all good and well, they actually have to be used in the pdf's for the invoices as well
skade_ has joined #ruby-lang
toastynerd has quit [Ping timeout: 258 seconds]
dvorak has quit [Quit: leaving]
dvorak has joined #ruby-lang
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<yorickpeterse> man updating shit to 2.1.2 is a game of whack-a-mole
<yorickpeterse> but in a production environment
matp has joined #ruby-lang
<yorickpeterse> Update Rails app X, now it fails at some random action_view require()
<yorickpeterse> but only when you try to log in
sarkyniin has quit [Quit: Quitte]
<DefV> hmz
<DefV> wondering if maloik is working on a project I worked on before :-)
<yorickpeterse> "oadError: cannot load such file -- action_view/template/error" <- out of fucking nowhere
<yorickpeterse> * LoadError
JaRe_Ax has joined #ruby-lang
<maloik> you're in the list of authors anyway :-)
<DefV> maloik: that doesn't surprise me then :-)
<maloik> I'm at the point where rewriting it for fun in my spare time almost sounds like a realistic option
<maloik> :D
<DefV> haha
<yorickpeterse> oh derp, I think I forgot to deploy this app
<yorickpeterse> so it's still running in 1.9 mode
<DefV> just add tests while you go along
<yorickpeterse> but trying to load 2.1 shit
<yorickpeterse> brb, finding a nice wall to park my face in
JaReAx has quit [Ping timeout: 252 seconds]
JaRe_Ax is now known as JaReAx
<maloik> yea that's the plan
bubodlack has quit [Read error: Connection reset by peer]
bubodlack has joined #ruby-lang
lcdhoffman has joined #ruby-lang
stamina has quit [Quit: WeeChat 0.4.3]
<yorickpeterse> yay, everything except our dreaded REE app now runs on MRI 2.1
<yorickpeterse> now to apply my GC hacks everywhere to get memory down
yalue has joined #ruby-lang
<yorickpeterse> Death by a thousand yaks
<darix> yorickpeterse: did you see the talk from the discourse dev about ruby 2.1 and memory?
<yorickpeterse> I saw the blog post
<yorickpeterse> I spent the past...3 weeks? Tweaking things
<yorickpeterse> Rolled out 2.1.2 to a bunch of daemons last week
<yorickpeterse> Started doing our Rails apps yesterday
<darix> he mentioned that github has a 2.1 branch with GC improvements that are not upstream yet
<yorickpeterse> Ah yeah I saw that
<yorickpeterse> Don't want to rely on somebody else's Ruby though
<yorickpeterse> Too much of a fuzz
cnivolle has joined #ruby-lang
tomkadwill has joined #ruby-lang
melter has quit [Quit: Client exiting]
centrx has joined #ruby-lang
junkmechanic_ has joined #ruby-lang
bubodlack is now known as bubodlack|away
scampbell has joined #ruby-lang
yfeldblum has joined #ruby-lang
yatish27 has joined #ruby-lang
ascarter has joined #ruby-lang
malconis has joined #ruby-lang
yfeldblum has quit [Ping timeout: 255 seconds]
bubodlack|away is now known as bubodlack
canton7 has quit [Quit: ZNC - http://znc.in]
canton7 has joined #ruby-lang
stulzer has joined #ruby-lang
lewis has joined #ruby-lang
lewix has joined #ruby-lang
lewix has joined #ruby-lang
malconis has quit [Client Quit]
lewix has quit [Client Quit]
_JokerDoom has quit [Quit: Leaving]
priodev has joined #ruby-lang
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
stulzer has quit [Quit: leaving]
alexju has joined #ruby-lang
arBmind has quit [Quit: Leaving.]
nofxx_ has joined #ruby-lang
nofxx_ has joined #ruby-lang
nofxx_ has quit [Changing host]
luiz_lha has joined #ruby-lang
lewis has quit [Remote host closed the connection]
elia has quit [Quit: Computer has gone to sleep.]
stulzer has joined #ruby-lang
ldnunes has joined #ruby-lang
toastynerd has joined #ruby-lang
momomomomo has joined #ruby-lang
lcdhoffman has quit [Quit: lcdhoffman]
malconis has joined #ruby-lang
elia has joined #ruby-lang
nofxx has quit [Ping timeout: 265 seconds]
karamazov has joined #ruby-lang
stulzer has quit [Client Quit]
stulzer has joined #ruby-lang
stulzer has quit [Client Quit]
toastynerd has quit [Ping timeout: 264 seconds]
stulzer has joined #ruby-lang
wm3|away is now known as workmad3
stulzer has quit [Client Quit]
[spoiler] has quit [Quit: Leaving]
stulzer has joined #ruby-lang
khaase has joined #ruby-lang
khaase has joined #ruby-lang
khaase has quit [Changing host]
tkuchiki has quit [Ping timeout: 276 seconds]
stulzer has quit [Client Quit]
stulzer has joined #ruby-lang
lewis has joined #ruby-lang
lewis has joined #ruby-lang
lewis has quit [Changing host]
stulzer has quit [Client Quit]
nofxx has joined #ruby-lang
nofxx has quit [Changing host]
nofxx has joined #ruby-lang
bubodlack has quit [Read error: Connection reset by peer]
bubodlack has joined #ruby-lang
stulzer has joined #ruby-lang
jgpawletko has joined #ruby-lang
stulzer has quit [Client Quit]
fragamus has joined #ruby-lang
symm- has joined #ruby-lang
musurgia has joined #ruby-lang
stulzer has joined #ruby-lang
lcdhoffman has joined #ruby-lang
lele has quit [Ping timeout: 245 seconds]
stulzer has quit [Quit: leaving]
yfeldblum has joined #ruby-lang
yfeldblum has quit [Ping timeout: 258 seconds]
joonty has quit [Ping timeout: 245 seconds]
codename539 has joined #ruby-lang
codename539 has quit [Max SendQ exceeded]
codename539 has joined #ruby-lang
codename539 has quit [Max SendQ exceeded]
fragamus has quit [Quit: Computer has gone to sleep.]
codename539 has joined #ruby-lang
stulzer has joined #ruby-lang
JPascal has quit []
stulzer has quit [Client Quit]
codename539 has quit [Max SendQ exceeded]
tkuchiki has joined #ruby-lang
stulzer has joined #ruby-lang
olauzon has joined #ruby-lang
olauzon has quit [Client Quit]
melter has joined #ruby-lang
nofxx has quit []
diegoviola has joined #ruby-lang
joonty has joined #ruby-lang
bubodlack has quit [Ping timeout: 252 seconds]
elia has quit [Quit: Computer has gone to sleep.]
JohnBat26 has quit [Quit: KVIrc 4.3.1 Aria http://www.kvirc.net/]
joonty has quit [Client Quit]
canton7 has quit [Quit: ZNC - http://znc.in]
joonty has joined #ruby-lang
canton7 has joined #ruby-lang
fezziwig has joined #ruby-lang
nofxx_ has quit [Ping timeout: 245 seconds]
nofxx_ has joined #ruby-lang
nofxx_ has quit [Changing host]
nofxx_ has joined #ruby-lang
AncientAmateur has joined #ruby-lang
yatish27 has quit [Remote host closed the connection]
yatish27 has joined #ruby-lang
toastynerd has joined #ruby-lang
stulzer has quit [Quit: leaving]
Sunnyan has joined #ruby-lang
yatish27 has quit [Remote host closed the connection]
nofxx__ has joined #ruby-lang
yatish27 has joined #ruby-lang
nofxx_ has quit [Ping timeout: 240 seconds]
toastynerd has quit [Ping timeout: 255 seconds]
lcdhoffman has quit [Quit: lcdhoffman]
yatish27 has quit [Remote host closed the connection]
lcdhoffman has joined #ruby-lang
ta has quit [Remote host closed the connection]
yatish27 has joined #ruby-lang
toastynerd has joined #ruby-lang
yatish27 has quit [Ping timeout: 264 seconds]
yatish27_ has joined #ruby-lang
elia has joined #ruby-lang
<musurgia> I have a beginning question about file I/O if anyone is willing to help.
<darix> musurgia: rule n
<darix> musurgia: rule #1 just ask.
dik_dak has joined #ruby-lang
luiz_ has quit [Quit: Saindo]
bubodlack has joined #ruby-lang
mistym has joined #ruby-lang
<musurgia> darix: thanks.
<musurgia> Initialize method reads file into string as @@infile = File.open(@infile_name, "rb) ; @data = @@infile.read
elia has quit [Ping timeout: 258 seconds]
<musurgia> I have a "main" method that closes the program based on user input; I use @@infile.close in that method.
<musurgia> Question is, why does infile have to be a class variable?
yfeldblum has joined #ruby-lang
dik_dak has quit [Ping timeout: 240 seconds]
<ericwood> musurgia: so it can be used across instances of that class?
mykoweb has joined #ruby-lang
<ericwood> and they're all writing to the same file without stepping on each other's toes?
<ericwood> makes sense to me
<musurgia> Why doesn't it work as an instance variable?
mistym has quit [Remote host closed the connection]
<ericwood> because an instance variable is only available inside a single instance
<ericwood> say you have several instances of a class, all of which need to write to the same output file
<ericwood> you could have each open the file for writing, but that doesn't work
<ericwood> or you could have a single instance of the open file available to all instances so they can share it
<ericwood> no more race conditions!
yatish27_ has quit [Remote host closed the connection]
yfeldblum has quit [Ping timeout: 265 seconds]
cored has joined #ruby-lang
cored has quit [Changing host]
cored has joined #ruby-lang
elia has joined #ruby-lang
<musurgia> Okay, I'm close to understanding.
<workmad3> ericwood: infile is a file being read from though, not written to ;)
<musurgia> The string I read the file into is an instance variable, @data. I can use it in multiple methods of the class.
ta has joined #ruby-lang
<musurgia> But I can't treat the input file the same way, it has to be @@infile.
<ericwood> workmad3: I only skim things
philh_wfh has joined #ruby-lang
yatish27_ has joined #ruby-lang
<ericwood> well, regardless my explanation still kind of makes sense
<workmad3> ericwood: kinda... except that each new instance re-opens the file and then re-reads it into an instance variable :)
<ericwood> workmad3: ideally it should check to ensure it points to something already
philh_wfh has left #ruby-lang [#ruby-lang]
<workmad3> musurgia: I'm guessing that your 'main' method is a class method? if so, you need @@infile to be a class variable simply because you can't access instance variables from a class method (you don't have an instance to operate on)
<musurgia> workmad3: Aha! That's the answer. Thank you.
rsl has quit [Quit: Textual IRC Client: www.textualapp.com]
<workmad3> musurgia: so in essence, you're trying to make sure that you always close the file... but if you create > 1 instance of that class, you've abandoned an open file
<workmad3> musurgia: really, what I suspect you want to do is simply '@data = File.read(@infile_name)'
toastynerd has quit [Remote host closed the connection]
sheperson has joined #ruby-lang
rsl has joined #ruby-lang
<workmad3> musurgia: rather than open a file, call read on it and then only try to close it at the end of the program
<musurgia> I don't need to open it explicitly? Am obviously new to ruby coming from C.
<workmad3> musurgia: there are several ways to deal with files in ruby
<workmad3> musurgia: and several convenience methods... such as File.read, which simply reads the entire file into memory
<workmad3> musurgia: there's also File.readlines which gives you an array of lines
<workmad3> musurgia: there's also a 'block-form' of File.open, which you could use, e.g. 'File.open(@infile_name, "rb") {|file| @data = file.read}'
<workmad3> musurgia: all of those will open the file, read the data and then close the file again, rather than leaving it open to be cleaned up (or not) later
dik_dak has joined #ruby-lang
<workmad3> musurgia: you tend to only need to keep a file object around if you need to deal with it over a longer period of time in ruby... such as ericwood's example where you open a file for writing to and keep that reference around :)
<musurgia> workmad3: Very helpful, thanks. Makes sense that if you're just reading contents of file once it would close immediately after.
elia has quit [Quit: Computer has gone to sleep.]
<musurgia> PS, is a "main" class method (obvious holdover from C thinking) a good idea?
jsullivandigs has joined #ruby-lang
nofxx__ has quit [Ping timeout: 252 seconds]
WishBoy has joined #ruby-lang
elia has joined #ruby-lang
yalue has quit [Quit: Leaving]
nofxx__ has joined #ruby-lang
chouhoulis has joined #ruby-lang
mistym has joined #ruby-lang
chouhoulis has quit [Remote host closed the connection]
<workmad3> musurgia: the two approaches I've tended to see in ruby are either scripts, where the code is just written at the top-level and run from top-to-bottom, or larger applications which tend to have an 'Application' object of some form... in the latter case, it seems somewhat common to have a 'run' or a 'start' method on that object to enter the main program flow after you've finished loading code and config
chouhoulis has joined #ruby-lang
khaase has quit [Remote host closed the connection]
khaase has joined #ruby-lang
yalue has joined #ruby-lang
<musurgia> workmad3: Okay, thanks. I need to read more real code instead of just trying to figure out from the textbooks.
zlogan has quit [Ping timeout: 276 seconds]
<workmad3> musurgia: ruby is a somewhat different world from C... the idea of a 'main' method as the entry point into a program doesn't really translate well... in C, you need that in order to create the compiled binary... in ruby, when you invoke ruby, it just starts running code from the start of the file you specify (e.g. ruby foobar.rb just starts running from the top of foobar.rb)
khaase has quit [Ping timeout: 245 seconds]
ghg has joined #ruby-lang
<workmad3> musurgia: so in the one sense, no, the idea of a 'main' method doesn't make sense... but if you have a large application, it makes sense to have an object wrapping that top-level abstraction up, and then a single method to 'start' it makes sense... similarly, when you have larger command line tools, it's common to have small scripts in a bin/ directory that load stuff and pass command line options through to some form of
havenwood has joined #ruby-lang
symm- has quit [Ping timeout: 240 seconds]
lcdhoffman has quit [Quit: lcdhoffman]
joonty has quit [Ping timeout: 255 seconds]
<musurgia> workmad3: to some form of ...? (msg cut off )
<workmad3> application object and then just call a method on it
<workmad3> sorry, for some reason my irc client doesn't show me when my messages truncate :(
solars has quit [Ping timeout: 252 seconds]
<musurgia> This program is about 90 lines. I thought it good to put all the code into one class,
<musurgia> then at the bottom of the file I just call game = Game.new("input.file") ; Game.main(game)
<musurgia> But perhaps in a short program I could just as easily put the "main" routine at the bottom on its own.
sheperson has quit [Quit: sheperson]
|jemc| has joined #ruby-lang
frzng has quit [Quit: frzng]
nathanstitt has joined #ruby-lang
joonty has joined #ruby-lang
sheperson has joined #ruby-lang
herpless has joined #ruby-lang
fezziwig has quit [Remote host closed the connection]
bubodlac has joined #ruby-lang
bubodlack has quit [Read error: Connection reset by peer]
ta has quit [Ping timeout: 264 seconds]
toastynerd has joined #ruby-lang
yfeldblum has joined #ruby-lang
lolmaus has quit [Read error: Connection reset by peer]
khaase has joined #ruby-lang
khaase has joined #ruby-lang
khaase has quit [Changing host]
speakingcode-wor has quit [Quit: Lost terminal]
yfeldblum has quit [Ping timeout: 264 seconds]
yatish27_ has quit [Remote host closed the connection]
yatish27 has joined #ruby-lang
sheperson has quit [Ping timeout: 258 seconds]
Sunnyan has quit [Ping timeout: 240 seconds]
lolmaus has joined #ruby-lang
yatish27 has quit [Ping timeout: 255 seconds]
diegoviola has quit [Quit: WeeChat 0.4.3]
ta has joined #ruby-lang
arooni-mobile has joined #ruby-lang
rippa has joined #ruby-lang
herpless has quit []
Atttwww has joined #ruby-lang
sheperson has joined #ruby-lang
robbyoconnor has quit [Excess Flood]
robbyoconnor has joined #ruby-lang
sheperson_ has joined #ruby-lang
sheperson has quit [Ping timeout: 240 seconds]
ta has quit [Remote host closed the connection]
sheperson_ is now known as sheperson
vpretzel is now known as vpretzel|away
diegoviola has joined #ruby-lang
mister_integer has joined #ruby-lang
mister_integer has quit [Remote host closed the connection]
mister_integer has joined #ruby-lang
wallerdev has joined #ruby-lang
frzng has joined #ruby-lang
havenwood has quit [Remote host closed the connection]
Cakey has joined #ruby-lang
sharpmachine has joined #ruby-lang
x0f_ has joined #ruby-lang
x0f has quit [Ping timeout: 245 seconds]
jayne has quit [Read error: Connection reset by peer]
tbuehlmann has quit [Quit: Leaving]
snsei has quit [Remote host closed the connection]
__butch__ has joined #ruby-lang
jxpx777 has joined #ruby-lang
lcdhoffman has joined #ruby-lang
mistym has quit [Remote host closed the connection]
vpretzel_ has joined #ruby-lang
vpretzel|away has quit [Ping timeout: 255 seconds]
havenwood has joined #ruby-lang
hahuang65 has quit [Ping timeout: 252 seconds]
psycho_one has joined #ruby-lang
<musurgia> I'm using String.scan(@regex) to extract words in brackets from string and store them in array.
<musurgia> But if there are multiple words inside the brackets, then that gets stored as an array and I end up with an array of arrays.
<musurgia> Can I just scan them as plain strings regardless of the contents inside the brackets?
iamcalledrob has joined #ruby-lang
<musurgia> to be clear, I mean @array = @string.scan(@regex)
yatish27 has joined #ruby-lang
<bougyman> musurgia: can you show example text and expected results?
<musurgia> bougyman: Like a madlib. "A {person's name} {verb}ed into a {place}"
yfeldblum has joined #ruby-lang
<musurgia> desired results: @array = ["person's name", "verb", "place"]
<musurgia> current results: @array = [["person's name"], ["verb"], ["place"]]
phansch has quit [Ping timeout: 258 seconds]
lewix has joined #ruby-lang
lewix has quit [Changing host]
lewix has joined #ruby-lang
<apeiros> musurgia: doesn't seem to be related to having multiple words…
<apeiros> musurgia: anyway, you use a capturing group in your scan, that's why
<bougyman> s.scan(/\{(.*?)\}/).flatten
<apeiros> using flatten is admitting defeat.
lewis has quit [Ping timeout: 255 seconds]
<apeiros> at least in this context it doesn't matter that you didn't use flatten(1) :-p
AncientAmateur has quit [Remote host closed the connection]
mikecmpbll has quit [Quit: i've nodded off.]
<musurgia> apeiros: can you explain for this noob?
<apeiros> musurgia: () in a regex is a capturing group. if you have one or more capturing groups, scan will return an array of arrays. an array for every match, with the values of the capturing groups.
<apeiros> ri String#scan documents that btw.
<apeiros> so if you don't want arrays of arrays as result, you can either use flatten, as bougyman suggested, or not use a capturing group in your regex
elia has quit [Quit: Computer has gone to sleep.]
cored has quit [Ping timeout: 252 seconds]
<musurgia> apeiros, bougyman: thanks. Will read docs on flatten and scan!
fezziwig has joined #ruby-lang
bubodlac has quit [Read error: Connection reset by peer]
mehlah has quit [Quit: Leaving...]
<apeiros> musurgia: oh, btw, [] are brackets. {} are curly braces
<apeiros> >> "A {person's name} {verb}ed into a {place}".scan(/(?<=\{)[^}]*(?=\})/)
<eval-in__> apeiros => ["person's name", "verb", "place"] (https://eval.in/156768)
<apeiros> and an example without capturing groups
sheperson has quit [Quit: sheperson]
<musurgia> apeiros: That was my next question, can I search for text within brackets without using the capturing group?
<musurgia> eval-in__: or, why does your version not produce array of arrays?
mistym has joined #ruby-lang
<musurgia> apeiros: ahem, curly braces
<apeiros> musurgia: because it does not use a capturing group.
sharpmachine has quit [Remote host closed the connection]
<apeiros> (?…) are not capturing groups (even though they're in parens)
<musurgia> apeiros: ah, that was my confusion. Reading list is increasing.
<apeiros> add 'look-around expressions in regular expressions' to the list then ;-)
fezziwig has quit [Remote host closed the connection]
fezziwig has joined #ruby-lang
tomkadwill has quit []
<musurgia> apeiros, eval-in__: many thanks!
iamcalledrob has quit [Quit: Computer has gone to sleep.]
wallerdev has quit [Quit: wallerdev]
benlovell has quit [Ping timeout: 252 seconds]
<apeiros> eval-in__ is a bot ;-)
iamcalledrob has joined #ruby-lang
skade_ has quit [Ping timeout: 276 seconds]
<musurgia> apeiros: hard to come back from that. am obviously clueless. thanks for your help anyway.
brianpWins has quit [Quit: brianpWins]
twintail has joined #ruby-lang
mykoweb has quit [Remote host closed the connection]
mykoweb has joined #ruby-lang
mykoweb has quit [Read error: No route to host]
mykoweb_ has joined #ruby-lang
brianpWins has joined #ruby-lang
sharpmachine has joined #ruby-lang
brianpWins has quit [Client Quit]
mykoweb_ has quit [Remote host closed the connection]
yatish27 has quit [Remote host closed the connection]
mykoweb has joined #ruby-lang
musurgia has left #ruby-lang [#ruby-lang]
mykoweb_ has joined #ruby-lang
mykoweb_ has quit [Remote host closed the connection]
mykoweb_ has joined #ruby-lang
frzng has quit [Quit: frzng]
yatish27 has joined #ruby-lang
saarinen has joined #ruby-lang
mykoweb has quit [Ping timeout: 240 seconds]
mikecmpbll has joined #ruby-lang
wallerdev has joined #ruby-lang
momomomomo has quit [Quit: momomomomo]
pixelhandler has joined #ruby-lang
frzng has joined #ruby-lang
zlogan has joined #ruby-lang
mykoweb_ has quit [Ping timeout: 240 seconds]
bubodlack has joined #ruby-lang
pr0ton_ has joined #ruby-lang
AncientAmateur has joined #ruby-lang
zlogan has quit [Ping timeout: 240 seconds]
yatish27 has quit [Remote host closed the connection]
yatish27 has joined #ruby-lang
yatish27 has quit [Read error: Connection reset by peer]
yatish27 has joined #ruby-lang
<eam> Is there a way to set $/ local to a particular IO object?
hahuang65 has joined #ruby-lang
AncientAmateur has quit [Ping timeout: 255 seconds]
twintail has quit [Quit: Leaving.]
Sunnyan has joined #ruby-lang
twintail has joined #ruby-lang
<Mon_Ouie> Not that I know of, but you can pass an explicit argument to gets(…) and keep track of which one to use yourself
vpretzel_ is now known as vpretzel
twintail has quit [Client Quit]
frzng has quit [Quit: frzng]
tkuchiki has quit [Remote host closed the connection]
Cakey has quit [Ping timeout: 255 seconds]
frzng has joined #ruby-lang
Johz has joined #ruby-lang
AncientAmateur has joined #ruby-lang
skade_ has joined #ruby-lang
sarkyniin has joined #ruby-lang
yfeldblum has quit [Ping timeout: 252 seconds]
workmad3 has quit [Ping timeout: 255 seconds]
pr0ton_ has quit [Quit: pr0ton_]
<eam> Mon_Ouie: interesting. seems it'd be useful to change the IFS on a per-handle basis
tbuehlmann has joined #ruby-lang
yatish27 has quit [Remote host closed the connection]
pr0ton_ has joined #ruby-lang
yatish27 has joined #ruby-lang
centrx has quit [Quit: Mission accomplished. Ready for self-termination.]
phansch has joined #ruby-lang
robbyoconnor has quit [Ping timeout: 265 seconds]
pr0ton_ has quit [Ping timeout: 252 seconds]
yatish27 has quit [Ping timeout: 264 seconds]
sheperson has joined #ruby-lang
fragamus has joined #ruby-lang
Coincidental has joined #ruby-lang
bubodlack has quit [Read error: Connection reset by peer]
sheperson has quit [Ping timeout: 252 seconds]
sheperson has joined #ruby-lang
nofxx__ has quit [Ping timeout: 264 seconds]
jxpx777 has quit [Quit: Linkinus - http://linkinus.com]
mehlah has joined #ruby-lang
cnivolle has quit [Remote host closed the connection]
cnivolle has joined #ruby-lang
havenwood has quit [Remote host closed the connection]
havenwood has joined #ruby-lang
cnivolle has quit [Ping timeout: 265 seconds]
yatish27 has joined #ruby-lang
fijimunkii has joined #ruby-lang
havenwood has quit [Remote host closed the connection]
simono has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
yfeldblum has joined #ruby-lang
gix has quit [Ping timeout: 276 seconds]
cored has joined #ruby-lang
gix has joined #ruby-lang
AncientAmateur has quit [Read error: Connection reset by peer]
AncientAmateur has joined #ruby-lang
sharpmachine has quit [Remote host closed the connection]
mykoweb has joined #ruby-lang
vpretzel is now known as vpretzel|sysadmi
jayne has joined #ruby-lang
JohnBat26 has joined #ruby-lang
sharpmachine has joined #ruby-lang
lewix has quit [Quit: Leaving]
lewix has joined #ruby-lang
lewix has joined #ruby-lang
lewix has quit [Changing host]
sheperson has quit [Ping timeout: 258 seconds]
simono has joined #ruby-lang
mikewintermute has joined #ruby-lang
sheperson has joined #ruby-lang
Sunnyan has quit [Ping timeout: 240 seconds]
mikewintermute has quit [Remote host closed the connection]
mikewintermute has joined #ruby-lang
jhass|off is now known as jhass
scampbell has quit [Remote host closed the connection]
mikewintermute has left #ruby-lang [#ruby-lang]
fragamus has quit [Quit: Computer has gone to sleep.]
frzng has quit [Quit: frzng]
arooni-mobile__ has joined #ruby-lang
chouhoul_ has joined #ruby-lang
arooni-mobile has quit [Ping timeout: 255 seconds]
robmiller has joined #ruby-lang
chouhoul_ has quit [Remote host closed the connection]
chouhoul_ has joined #ruby-lang
chouhoulis has quit [Ping timeout: 255 seconds]
mykoweb has quit [Remote host closed the connection]
mykoweb has joined #ruby-lang
moogumbo has joined #ruby-lang
mykoweb has quit [Ping timeout: 240 seconds]
BucOder has joined #ruby-lang
yatish27 has quit [Remote host closed the connection]
siflyn has joined #ruby-lang
luiz_lha has quit [Remote host closed the connection]
luiz_lha has joined #ruby-lang
mister_i_ has joined #ruby-lang
mykoweb has joined #ruby-lang
enebo has joined #ruby-lang
matp has quit [Quit: Bye!]
mister_integer has quit [Ping timeout: 252 seconds]
amsi has joined #ruby-lang
Fushi has quit [Quit: Connection closed for inactivity]
symm- has joined #ruby-lang
zlogan has joined #ruby-lang
datazombie has joined #ruby-lang
<datazombie> hello, I have a dataset of numbers and I want to create a policy in which if i have 311, 312, 313, 316 i want to be able to say all this fall under 31x
<datazombie> without specifying the 31x category
Asher has joined #ruby-lang
<Mon_Ouie> I don't know what you mean by a "policy" but that sounds like dividing by 10
robmiller has quit [Quit: Leaving.]
zlogan has quit [Ping timeout: 255 seconds]
<datazombie> a policy in my mind is a validation rule
<apeiros> if your question requires reading your mind, it can't be answered.
<wallerdev> i think i know what he wants
<wallerdev> >> '311'.sub(/.$/, 'x')
<eval-in__> wallerdev => "31x" (https://eval.in/156770)
<apeiros> (haven't actually seen a question yet, so well, waiting)
<wallerdev> lol
<datazombie> ill repost the question
<datazombie> I have a dataset of numbers and I want to create a policy in which if i have 311, 312, 313, 316 i want to be able to say all this fall under 31x
<jhass> may I also copy paste apeiros answers?
Coincidental has quit [Read error: Connection reset by peer]
<apeiros> I'm sorry, but I still don't see a question
<wallerdev> >> list = [311, 312, 313, 316]; if list == [311, 312, 313, 316]; "this fall under 31x"; end
<eval-in__> wallerdev => "this fall under 31x" (https://eval.in/156771)
<jhass> I think he wants to know whether the first two digits of the numbers in his array are the same
<Mon_Ouie> There's no point in pasting the exact thing you wrote before you know, we need it rephrased as it doesn't make sense now
<datazombie> thanks jhass
matp has joined #ruby-lang
<datazombie> jhass caught what I wanted to ask
Coincidental has joined #ruby-lang
AncientAmateur has quit [Remote host closed the connection]
robbyoconnor has joined #ruby-lang
<Mon_Ouie> Checking if all the numbers in the array start with the same 2-digit sequence?
<datazombie> yes
robbyoconnor has quit [Client Quit]
<Mon_Ouie> see Enumerable#all?
<apeiros> that, + what Mon_Ouie already said about dividing by 10
<Mon_Ouie> apeiros: Well that gives you "all digits but the last", those are only the first two-digit for 3-digit numbers
<apeiros> his description says ...x
<apeiros> that's contradicting "the first two digits". but well.
vpretzel_ has joined #ruby-lang
<datazombie> ok let me see if I can rephrase my question
sheperson has quit [Ping timeout: 240 seconds]
<datazombie> I have a dataset which is an array that has random numbers in a range from 200 to 999
<datazombie> lets say I have in the data set [311, 315, 316, 319]
vpretzel_ is now known as vpretzel
vpretzel|sysadmi has quit [Ping timeout: 264 seconds]
AncientA_ has joined #ruby-lang
ahf has quit [Remote host closed the connection]
<datazombie> if i have like 4 or more with the same two first numbers I want to push the first 2 into a new array
<datazombie> datagroup = [31]
<datazombie> which would say to my system that there are 4 or more numbers in the 31x range
pr0ton_ has joined #ruby-lang
<datazombie> is that clearer?
<apeiros> not much
<apeiros> might want group_by
<Mon_Ouie> Say your input is [311, 315, 316, 319, 320, 321, 322, 323, 330], the output should be [31, 32] right?
pr0ton_ has quit [Client Quit]
<datazombie> yes
<apeiros> group_by + div + select + keys
lolmaus has quit [Ping timeout: 240 seconds]
* apeiros fascinated
<apeiros> somehow I almost expected somebody to write the full code
<datazombie> thanks
arooni-mobile has joined #ruby-lang
Coincidental has quit [Read error: Connection reset by peer]
wallerdev has quit [Quit: wallerdev]
arooni-mobile__ has quit [Ping timeout: 276 seconds]
Coincidental has joined #ruby-lang
<jhass> apeiros: I don't always press enter :P
bubodlack has joined #ruby-lang
<apeiros> you wrote it and didn't send it?
* apeiros only wrote it in his pry and didn't copy & paste it
<apeiros> that's how bad a person I am
<jhass> well, not the one for the one with the two new requirements
<apeiros> ah, haha, yeah.
<apeiros> new requirements. always fun.
<jhass> but the each_cons(2).all? one
<apeiros> I see
robbyoconnor has joined #ruby-lang
fijimunkii has quit [Ping timeout: 255 seconds]
robbyoconnor has quit [Remote host closed the connection]
workmad3 has joined #ruby-lang
fijimunkii has joined #ruby-lang
ta has joined #ruby-lang
ht_ has quit [Remote host closed the connection]
psycho_one has quit [Remote host closed the connection]
lcdhoffman has quit [Quit: lcdhoffman]
doitjay has joined #ruby-lang
Coincidental has quit [Read error: Connection reset by peer]
diegoviola has quit [Read error: Connection reset by peer]
BucOder has quit [Quit: Computer has gone to sleep.]
Coincidental has joined #ruby-lang
charliesome has joined #ruby-lang
ascarter has joined #ruby-lang
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
lele has joined #ruby-lang
Miphix has quit [Remote host closed the connection]
amsi has quit [Ping timeout: 264 seconds]
vpretzel has quit [Remote host closed the connection]
sepp2k has joined #ruby-lang
vpretzel has joined #ruby-lang
skade_ has quit [Ping timeout: 252 seconds]
mykoweb has quit [Remote host closed the connection]
mistym is now known as mistym_curry
mykoweb has joined #ruby-lang
jsullivandigs has quit [Remote host closed the connection]
vpretzel_ has joined #ruby-lang
jsullivandigs has joined #ruby-lang
mykoweb has quit [Ping timeout: 265 seconds]
vpretzel has quit [Ping timeout: 255 seconds]
wallerdev has joined #ruby-lang
jsullivandigs has quit [Ping timeout: 240 seconds]
musurgia has joined #ruby-lang
jsullivandigs has joined #ruby-lang
vpretzel_ is now known as vpretzel
pr0ton_ has joined #ruby-lang
Bosox20051 has joined #ruby-lang
datazombie has quit [Ping timeout: 240 seconds]
Cakey has joined #ruby-lang
musurgia has left #ruby-lang [#ruby-lang]
Cakey has quit [Ping timeout: 240 seconds]
frzng has joined #ruby-lang
nathanstitt has quit [Quit: I growing sleepy]
doitjay has quit [Quit: Leaving]
mister_i_ has quit [Remote host closed the connection]
ylluminate has joined #ruby-lang
mister_integer has joined #ruby-lang
_1_chaserailey has joined #ruby-lang
<_1_chaserailey> Hi it chaserailey
_1_chaserailey has quit [Remote host closed the connection]
AncientA_ has quit [Remote host closed the connection]
enebo has quit [Quit: enebo]
AncientAmateur has joined #ruby-lang
kyb3r_ has joined #ruby-lang
GBrawl has quit [Quit: Computer has gone to sleep.]
enebo has joined #ruby-lang
tbuehlmann has quit [Remote host closed the connection]
<jtoy> how can I get the full path from a directory listing? Dir.new("templates/").entries gives partial paths
karamazov has quit [Remote host closed the connection]
karamazov has joined #ruby-lang
<canton7> .entries.map{ |x| File.expand_path(x) } is one way
karamazov has quit [Ping timeout: 240 seconds]
<drbrain> probably need to expand_path with an argument since it assumes "."
omosoj has joined #ruby-lang
diegoviola has joined #ruby-lang
<bougyman> Pathname(x).expand_path
<bougyman> Pathname(x).expand_path.to_s if you want a string.
malconis has quit [Ping timeout: 252 seconds]
malconis has joined #ruby-lang
nathanstitt has joined #ruby-lang
<drbrain> bougyman: even Pathname#expand_path needs a reference directory if you're getting the entries out of a directory that's not "."
lewix has quit [Ping timeout: 265 seconds]
nathanst_ has joined #ruby-lang
<bougyman> drbrain: really?
oddmunds has quit [Ping timeout: 245 seconds]
<drbrain> ruby -rpathname -e 'p Pathname("nonexistent").expand_path' #=> a directory that does not exist
<bougyman> ah
<bougyman> Dir["etc/*"].entries.map { |t| Pathname(t).expand_path }
<bougyman> => [#<Pathname:/home/bougyman/etc/pisg (xena's conflicted copy 2013-04-19).cfg>
<drbrain> since jtoy is getting the entries from a subdir (?) I think Pathname(entry).expand_path(reference)
<bougyman> worked with just a relative dir, here.
oddmunds has joined #ruby-lang
<bougyman> I didn't try a non-existent one.
<drbrain> hrm
nathanstitt has quit [Read error: Connection reset by peer]
<drbrain> ah, Dir[] and Dir.new.entries don't return the same thing
zlogan has joined #ruby-lang
<drbrain> glob includes the relative portion, Dir.new does not
<drbrain> err, #entries from each
<drbrain> Dir.new("lib/").entries #=> %w[. .. rubygems rubygems.rb etc.]
polyidus has joined #ruby-lang
<drbrain> Dir['lib/*'].entries #=> %w[lib/rubygems lib/rubygems.rb lib/etc.]
mistym_curry is now known as mistym
__butch__ has quit [Quit: Leaving.]
amsi has joined #ruby-lang
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
nathanst_ has quit [Ping timeout: 265 seconds]
skade_ has joined #ruby-lang
zlogan has quit [Ping timeout: 240 seconds]
GBrawl has joined #ruby-lang
alex-quiterio has joined #ruby-lang
nathanstitt has joined #ruby-lang
alexju has quit [Remote host closed the connection]
ledestin has quit [Quit: ledestin]
workmad3_ has joined #ruby-lang
ldnunes has quit [Quit: Leaving]
workmad3 has quit [Ping timeout: 240 seconds]
JohnBat26 has quit [Ping timeout: 264 seconds]
alex-quiterio has left #ruby-lang [#ruby-lang]
DEac-_ has joined #ruby-lang
DEac- has quit [Read error: Connection reset by peer]
workmad3_ is now known as workmad3
ur5us has joined #ruby-lang
phansch has quit [Quit: WeeChat 0.4.3]
ghg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
siflyn has quit []
ascarter has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sarkyniin has quit [Quit: Quitte]
workmad3 has quit [Ping timeout: 252 seconds]
AncientAmateur has quit [Quit: Leaving...]
jgpawletko has quit [Quit: jgpawletko]
thoolihan has quit [Ping timeout: 255 seconds]
lcdhoffman has joined #ruby-lang
AncientAmateur has joined #ruby-lang
ahf_ has joined #ruby-lang
ahf_ has quit [Changing host]
ahf_ has joined #ruby-lang
polyidus has quit [Quit: EOF]
psycho_one has joined #ruby-lang
ahf_ is now known as ahf
psycho_one has quit [Ping timeout: 255 seconds]
doitjay has joined #ruby-lang
omosoj has quit [Ping timeout: 276 seconds]
nathanstitt has quit [Quit: I growing sleepy]
banister has joined #ruby-lang
dingus_khan has joined #ruby-lang
AncientAmateur has quit [Remote host closed the connection]
havenwood has joined #ruby-lang
woollyams has quit [Ping timeout: 252 seconds]
jhass is now known as jhass|off
Coincidental has quit [Read error: Connection reset by peer]
ghg has joined #ruby-lang
dingus_khan has quit [Remote host closed the connection]
Coincidental has joined #ruby-lang
dingus_khan has joined #ruby-lang
jsullivandigs has quit [Remote host closed the connection]
dik_dak has quit [Read error: Connection reset by peer]
dik_dak_ has joined #ruby-lang
ledestin has joined #ruby-lang
diegoviola has quit [Ping timeout: 276 seconds]
workmad3 has joined #ruby-lang
<zenspider> that's mostly about "*" in glob
duderonomy has joined #ruby-lang
MichD is now known as michd
fijimunkii has quit [Ping timeout: 252 seconds]
amsi has quit [Ping timeout: 264 seconds]
spuk has joined #ruby-lang
Bosox20051 has quit [Read error: Connection reset by peer]
jsullivandigs has joined #ruby-lang
saarinen has quit [Quit: saarinen]
amsi has joined #ruby-lang
nemec has quit [Read error: Connection reset by peer]
nemec has joined #ruby-lang
omosoj has joined #ruby-lang
Coincidental has quit [Read error: Connection reset by peer]
enebo has quit [Quit: enebo]
Coincidental has joined #ruby-lang
kitak has quit [Remote host closed the connection]
kitak has joined #ruby-lang
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
dingus_khan has quit [Remote host closed the connection]
dik_dak_ has quit [Read error: Connection reset by peer]
dik_dak_ has joined #ruby-lang
dik_dak_ has quit [Read error: Connection reset by peer]
saarinen has joined #ruby-lang
dik_dak has joined #ruby-lang
ironhide_604 has quit [Remote host closed the connection]
Johz has quit [Quit: Leaving]
khaase has quit [Remote host closed the connection]
khaase has joined #ruby-lang
saarinen has quit [Quit: saarinen]
saarinen has joined #ruby-lang
khaase has quit [Ping timeout: 265 seconds]
workmad3 has quit [Ping timeout: 245 seconds]
kitak has quit [Remote host closed the connection]
kitak has joined #ruby-lang
GBrawl has quit [Quit: Lingo - http://lingoirc.com]
woollyams has joined #ruby-lang
saarinen has quit [Quit: saarinen]
luiz_ has joined #ruby-lang
dik_dak has quit [Quit: Leaving]
luiz_lha has quit [Ping timeout: 245 seconds]
pr0ton_ has quit [Quit: pr0ton_]
saarinen has joined #ruby-lang
Coincidental has quit [Read error: Connection reset by peer]
zlogan has joined #ruby-lang
Coincidental has joined #ruby-lang
zlogan has quit [Ping timeout: 264 seconds]
mikecmpbll has quit [Quit: i've nodded off.]
machuga has joined #ruby-lang
khaase has joined #ruby-lang
simono has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
brianpWins has joined #ruby-lang
khaase_ has joined #ruby-lang
yfeldblu_ has joined #ruby-lang
yfeldblu_ has quit [Remote host closed the connection]
yfeldblu_ has joined #ruby-lang
khaase has quit [Ping timeout: 265 seconds]
yfeldblum has quit [Ping timeout: 240 seconds]
khaase_ has quit [Ping timeout: 265 seconds]
nathanstitt has joined #ruby-lang
amsi has quit [Ping timeout: 264 seconds]
amsi has joined #ruby-lang
doitjay has quit [Ping timeout: 255 seconds]
fezziwig_ has joined #ruby-lang
lcdhoffman has quit [Quit: lcdhoffman]
fezziwig has quit [Ping timeout: 240 seconds]
|jemc| has quit [Ping timeout: 255 seconds]
dingus_khan has joined #ruby-lang
bubodlack is now known as bubodlack|away
bubodlack|away is now known as bubodlack
dingus_khan has quit [Remote host closed the connection]
ascarter has joined #ruby-lang
kitak has quit [Remote host closed the connection]
kitak has joined #ruby-lang
fijimunkii has joined #ruby-lang