jhass changed the topic of #ruby to: Welcome new users migrating from #ruby-lang! || Rules & more: http://ruby-community.com || Ruby 2.2.2; 2.1.6; 2.0.0-p645: https://ruby-lang.org || Paste >3 lines of text on https://gist.github.com || log @ http://irclog.whitequark.org/ruby/
commondream has quit [Remote host closed the connection]
<pontiki> we had a term in our consulting practice for this: "They're in violent agreement"
sfarley has joined #ruby
netmask has joined #ruby
scripore has quit [Quit: This computer has gone to sleep]
<jhass> haha, I know that situation
<Senjai> pontiki: hahahahaa
<pontiki> indeed, i'm pretty sure everyone's lived through it, several times. it's still tough to recognize when one's in the midst of doing it yet again
pietr0 has quit [Quit: pietr0]
gambl0re has quit [Ping timeout: 246 seconds]
icebourg has quit []
avahey has joined #ruby
<Senjai> Good night ruby.
<Senjai> Going home now
<volty> _blizzy_ must be cutting with scissors :)
<volty> gn Senjai
<t-richards> See ya
cndiv has quit []
fabrice31 has joined #ruby
uptownhr has quit [Quit: uptownhr]
mrmargolis has joined #ruby
<t-richards> Okay, having a super brain-fart moment here: https://gist.github.com/t-richards/9a5e2d27964b286e682e
<t-richards> What's the most idiomatic way to express "append value 'foo' to array if it exists, otherwise, initialize array to ['foo']"?
dopie has joined #ruby
sfarley has quit [Remote host closed the connection]
<jhass> array ||= []; array << value (; in IRC are newlines in code)
arooni-mobile has joined #ruby
<zenspider> The most idiomatic way is to actually set your variables
<jhass> that's a good idea too
wildroman2 has quit [Remote host closed the connection]
<volty> >> (a =|| []).push(3)
<ruboto> volty # => /tmp/execpad-2da003ca0818/source-2da003ca0818:2: syntax error, unexpected || ...check link for more (https://eval.in/387261)
fabrice31 has quit [Ping timeout: 244 seconds]
<t-richards> zenspider: haha, if only it were that easy :)
marr has quit [Ping timeout: 272 seconds]
<eam> sometimes it's a value of a hash/array
greensoup has quit [Ping timeout: 255 seconds]
<jhass> volty: and there you destroyed my hope of that example not coming :(
<eam> autoviv in ruby is somewhat clumsy
<jhass> t-richards: why isn't it that easy?
<volty> jhass: I understand, but I had to use it (somewhere, can't remember where) :)
serivichi has joined #ruby
<t-richards> Like eam said, sometimes hash values aren't present and you have to deal with that
<volty> generally i am against it
<jhass> volty: it's often used in in inject/reduce misuse
<eam> jhass: one example is the classic interview question: count word frequency in some text (initializing integers instead of array, but same fundamental issue)
<jhass> which then usually is meant to be an each_with_object
<jhass> eam: Hash.new(0) ?
<baweaver> >> h = Hash.new { 0 }; h[:a] += 5; h[:b] += 10; h
<ruboto> baweaver # => {:a=>5, :b=>10} (https://eval.in/387263)
workmad3 has joined #ruby
<eam> yeah but for an array you have to use {}
<volty> jhass: never there, i have (somewhere) very obscure code that catches some events on fly -- very particular, and exceptional
<eam> its gets complicated
<t-richards> jhass: thanks, exactly what I was looking for
<eam> even moreso if you're doing multilevel hash/array stuff
<jhass> t-richards: it's a local variable in your real code too?
<baweaver> Always safer to use the block as it gets reevaluated as the default proc every time a key is missing
serivich has quit [Ping timeout: 272 seconds]
<eam> baweaver: yeah, which is necessary if the values are Hash or Array
<t-richards> jhass: No, I suppose my example was a bit misleading in that regard. My real "array" is really one of many values in a hash (that may or may not be present)
<jhass> t-richards: Hash.new {|h, k| h[k] = [] }
<zenspider> baweaver: it isn't always safer. fixnum is a fine example of that
<baweaver> eam: pretty much, that tends to bite people a lot.
jlast has joined #ruby
<baweaver> granted.
<t-richards> I didn't want to go for a default hash value, since it's not going to be the same for all missing keys
<volty> ah, yes, used with hashes too.
<baweaver> anything that doesn't pass a value
<zenspider> the problem with those forms (and understand I use them all the time) is that you now have a proc attached to the object so you can't marshal it w/o jumping through hoops
<volty> I like hashes that grow alone :)
danielpclark has quit [Ping timeout: 246 seconds]
bronson has quit [Remote host closed the connection]
<volty> (by themselves)
<zenspider> t-richards: what you're describing is using a hash like an object. poorly. I suggest you use actual objects that retain their own logic and can maintain their own state.
<zenspider> (not to say that hashes aren't objects... but you know what I mean)
<volty> what for (that object)? @ t-richards
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<eam> I think there's value in reusing simple structures over objects - easy to understand the interaction rules
<baweaver> trying to use hashes deeply is a hack implementation of FP in most cases without the benefit of functional datastructures.
<eam> I run into this issue in one-liner throwaway code all the time
<eam> damn right it's a hack, but ... :)
<volty> I do not want to promote to a class of mine an object that has to serve a trivial purpose
<baweaver> It's called abstraction chicken
workmad3 has quit [Ping timeout: 252 seconds]
<baweaver> will I finish before this all goes to hell or not
<t-richards> jhass: I totally understand. This is all for a crappy jekyll plugin anyway - I'm not too concerned with extracting data into an object
<t-richards> volty: Exactly this.
<jhass> t-richards: check your target ;)
jlast has quit [Ping timeout: 255 seconds]
ajrob27 has joined #ruby
<t-richards> jhass: I need to get a working proof-of-concept before I make it there :D
baweaver has quit [Remote host closed the connection]
sevenseacat has joined #ruby
<jhass> nah, I mean zenspider was doing the follow up statement ;)
<volty> yes, long live rude code that works. Class promotions only afterwards :)
dopie has quit [Quit: This computer has gone to sleep]
robustus has quit [Ping timeout: 264 seconds]
bayed has quit [Quit: Connection closed for inactivity]
theery has joined #ruby
<eam> just redefine [] on the instance
<volty> top - bottm & bottom - up — in parallel. Though it all depends on the problem and on one's skill.
bronson has joined #ruby
<jhass> eam: how's that different from putting the logic you'd but there into the default_proc?
<eam> it's uglier?
Yiota has joined #ruby
havenwood has quit [Ping timeout: 246 seconds]
<jhass> hmm
<volty> agree with jhass
<eam> (it's a joke)
baweaver has joined #ruby
axl__ has quit [Quit: axl__]
shazaum_ has joined #ruby
<volty> i found no value in defining instance methods
<eam> it's a great way to mess with people
<_blizzy_> I almost wish I kept the code the way it was
<t-richards> s/mess with/infuriate
<_blizzy_> I'm more confused than I was before.
scripore has joined #ruby
geiltalasdair has joined #ruby
robustus has joined #ruby
<volty> very rarely you need an instance method, and just for readability
arooni-mobile has quit [Ping timeout: 248 seconds]
ajrob27 has left #ruby [#ruby]
<volty> sorry _blizzy_ but I can't imagine something worse :)
<_blizzy_> volty, it wasn't that bad to me.
axl__ has joined #ruby
<_blizzy_> it seems like people think that big = bad
<_blizzy_> :/
<volty> _blizzy_: could be, if it was enough for you to only look at your code (did it work?)
axl__ has quit [Client Quit]
<_blizzy_> volty, yes, minus one bug
<pontiki> _blizzy_: are you using git or some other version control?
<volty> _blizzy_: you didn't erase your old files, did you ?
geilt has quit [Ping timeout: 248 seconds]
<_blizzy_> volty, no.
<_blizzy_> pontiki, yes.
danielpclark has joined #ruby
rubie has quit [Remote host closed the connection]
blackmesa has quit [Quit: WeeChat 1.2]
rubie has joined #ruby
theery has quit [Remote host closed the connection]
<_blizzy_> I'm stuck
<_blizzy_> if I keep it the way it is, I'll get jumped on
<_blizzy_> but if I change it, I'll be more confused
<_blizzy_> :/
geilt has joined #ruby
geiltalasdair has quit [Read error: Connection reset by peer]
duoi has quit [Quit: duoi]
<Aeyrix> <joepie91> snake case causes too much syntax cruft - it reduces readability
<Aeyrix> ;_;
<Aeyrix> <joepie91> lowerCamelCase is okay
jenrzzz has quit [Ping timeout: 272 seconds]
<_blizzy_> ugh, fuck this
<_blizzy_> I'm confused and mad now
duoi has joined #ruby
GitGud is now known as GitStud
bronson has quit [Remote host closed the connection]
riskish has joined #ruby
duderonomy has joined #ruby
dopie has joined #ruby
<eam> /win 1
<sevenseacat> trollolololol?
<Aeyrix> no
<Aeyrix> he was serious
pengin has quit [Remote host closed the connection]
<Aeyrix> he is serious
<Aeyrix> he also prefers tabs
<Aeyrix> i need emotional support, here
serivichi has quit [Quit: Leaving]
<pontiki> _blizzy_: it's ok to put it up and away, work on something else for a while, take a walk, lay on the grass, etc
<eam> wait what
<_blizzy_> pontiki, it's not that
<jhass> _blizzy_: it is, trust us
<pontiki> _blizzy_: i think *everyone* gets cussing angry and confused
jpfuentes2 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<pontiki> _blizzy_: what is it?
<pontiki> am i lagged??
aryaching has joined #ruby
<_blizzy_> WAIT
<volty> as already said, he needs to implement a state-of-the-art tic-tac-toe game first. And my nose tells me that we are after same old whining «trollo-beginner» that happens from time to time.
oo_ has joined #ruby
Trynemjoel has quit [Ping timeout: 272 seconds]
<_blizzy_> how am I trolling?
<volty> :). have a good night
<_blizzy_> ....
volty has quit [Quit: Konversation terminated!]
<_blizzy_> thank god
<Aeyrix> Obligatory reminder on both sides that this is, first and foremost, a channel for learning and help.
<pontiki> _blizzy_: i don't think the trolling claim was aimed at you...
<sevenseacat> it wasn't.
sarmiena_ has quit [Ping timeout: 248 seconds]
oo_ has quit [Remote host closed the connection]
<pontiki> Aeyrix: indeed.
ixti has quit [Ping timeout: 256 seconds]
oo_ has joined #ruby
commondream has joined #ruby
<pontiki> some poeple come with their cup already overflowing demanding the teach keep filling it
<_blizzy_> but for now it works. people want me to split it into like 50 different methods.
<pontiki> _blizzy_: please, writing crappy code and *showing* it to people is how you learn to write great code
<_blizzy_> If I do what they say, I'll be more confused. if I stick with what I have, people will jump on me.
lolmaus has quit [Ping timeout: 256 seconds]
<zenspider> _blizzy_: confusion is a sign that it is your moment to learn
<zenspider> it's a good thing
husanu has quit [Remote host closed the connection]
<pontiki> it feels like jumping on, and it's people enthusiastically trying to help you get better; sometimes it's too much to take
_seanc_ has quit [Quit: _seanc_]
<zenspider> frustrating, yes... but good overall
husanu has joined #ruby
commondream has quit [Remote host closed the connection]
jackjackdripper has quit [Quit: Leaving.]
<pontiki> honest and truly, though, making *anything*, trying something out, is more than a lot of people manage
<pontiki> and wanting to make things is a great aspiration and feeling
<zenspider> yup yup
<pontiki> that, plus anything worth doing is worth doing poorly at first
Alayde_ has quit [Ping timeout: 265 seconds]
<zenspider> haha. I embrace failure. one of the best lessons I learned and embraced early on
Beoran_ has quit [Ping timeout: 252 seconds]
<zenspider> I do my damndest to reinforce it all the time
<pontiki> "failure, mistakes, are just lessons whose teaching has not yet been fully grokked"
<pontiki> and sometimes (a lot of times) it doesn't feel like fun at all
<pontiki> but it is
<_blizzy_> I'm still upset because my code is shit
<_blizzy_> but I like it because it works
<_blizzy_> :/
Trynemjoel has joined #ruby
<zenspider> _blizzy_: what sort of upset?
<pontiki> yes, both of these are good things
luriv has quit [Ping timeout: 250 seconds]
<_blizzy_> zenspider, like, mad at myself upset.
<pontiki> making something work is the first step
<pontiki> mad enough to keep trying?
<_blizzy_> I think that's my problem
<zenspider> _blizzy_: nah. be mad at the code. attack it. keep attacking it until it is beautiful
<_blizzy_> yes, mad enough to keep trying
<_blizzy_> thank god for git
<pontiki> :D
Igorshp has joined #ruby
<pontiki> then you'll be fine. be mad. throw shit. kick the wall.
<pontiki> this is the fucking *process*
_seanc_ has joined #ruby
<pontiki> alright, i'ma stfu now
<baweaver> THE ART OF BEAUTIFUL CODE HAS BEEN PASSED DOWN THE ARMSTRONG FAMILY FOR GENERATIONS!
* baweaver *might* be listening to FMA: Brotherhood soundtrack
hakunin has joined #ruby
Alayde_ has joined #ruby
<_blizzy_> Again is best MFA:B opening.
axilla has quit [Ping timeout: 246 seconds]
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
CloCkWeRX has quit [Ping timeout: 256 seconds]
kies has joined #ruby
CloCkWeRX has joined #ruby
pyon has quit [Quit: fix config]
Beoran_ has joined #ruby
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
simplyaubs has joined #ruby
greensoup has joined #ruby
<pontiki> the book _Beautiful Code_ is *well* worth reading
<pontiki> it is *not* a how to
oo_ has quit [Remote host closed the connection]
<baweaver> pontiki: Who wrote that one?
slawrence00 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<pontiki> it's an anthology
<pontiki> Andy Oram is (one of?) the editors
bruno- has joined #ruby
<baweaver> hm, I'll give it a one over later.
reebs has joined #ruby
reebs has quit [Max SendQ exceeded]
djellemah_ has joined #ruby
oo_ has joined #ruby
<sevenseacat> not sure if i have that book
lolmaus has joined #ruby
djellemah has quit [Ping timeout: 244 seconds]
Igorshp has quit [Remote host closed the connection]
netmask_ has joined #ruby
jenrzzz has joined #ruby
Channel6 has joined #ruby
wallerdev has quit [Ping timeout: 248 seconds]
yqt has quit [Ping timeout: 264 seconds]
__butch__ has quit [Quit: Linkinus - http://linkinus.com]
netmask has quit [Ping timeout: 250 seconds]
bb010g has quit [Quit: Connection closed for inactivity]
FernandoBasso has quit [Quit: WeeChat 1.2]
jlast has joined #ruby
Musashi007 has joined #ruby
markalanevans has quit [Quit: markalanevans]
michael_mbp has quit [Excess Flood]
cpruitt has joined #ruby
Scroff has joined #ruby
bruno- has quit [Ping timeout: 256 seconds]
findaway has quit [Quit: findaway]
jlast has quit [Ping timeout: 256 seconds]
michael_mbp has joined #ruby
greensoup has quit [Ping timeout: 272 seconds]
jpfuentes2 has joined #ruby
jpfuentes2 has quit [Client Quit]
CloCkWeRX has quit [Ping timeout: 255 seconds]
greensoup has joined #ruby
nobitanobi has quit [Remote host closed the connection]
towski_ has quit [Remote host closed the connection]
Scroff has quit [Ping timeout: 252 seconds]
netmask_ has quit [Remote host closed the connection]
greensoup has quit [Client Quit]
netmask has joined #ruby
nobitanobi has joined #ruby
danielpclark has quit [Ping timeout: 246 seconds]
baweaver has quit [Remote host closed the connection]
al2o3-cr has joined #ruby
CloCkWeRX has joined #ruby
netmask has quit [Ping timeout: 265 seconds]
cpruitt has quit [Quit: cpruitt]
netmask has joined #ruby
jenrzzz has quit [Ping timeout: 244 seconds]
eggoez has quit [Ping timeout: 252 seconds]
tkuchiki has joined #ruby
tkuchiki_ has joined #ruby
baweaver has joined #ruby
bronson has joined #ruby
<_blizzy_> I hope this looks better. I'm not done, but yeah. https://gist.github.com/NotBlizzard/d1400489efc06d33adbc
<_blizzy_> for some reason, @team is still resetting
datanoise has quit [Ping timeout: 272 seconds]
aryaching has quit [Ping timeout: 252 seconds]
adamjleonard has quit [Quit: Leaving...]
CalvinnHobbes has joined #ruby
lordkryss has quit [Quit: Connection closed for inactivity]
<Radar> But there's no get_team method defined afaics
rubie has quit [Remote host closed the connection]
baweaver has quit [Ping timeout: 276 seconds]
bronson has quit [Ping timeout: 256 seconds]
eggoez has joined #ruby
danielpclark has joined #ruby
aryaching has joined #ruby
<_blizzy_> took me a while to understand what afaics stood for
<_blizzy_> let me update my gist
<_blizzy_> with the get_team method
<Radar> oh there's more code
theery has joined #ruby
<Radar> um no
<Radar> get_team in a completely separate file with no indication of how it's linked to the original? Pass.
<_blizzy_> I just noticed that they are not linked
<_blizzy_> thanks, Radar
theery has quit [Remote host closed the connection]
nettoweb has joined #ruby
Rickmasta has joined #ruby
theery has joined #ruby
dopie has quit [Quit: This computer has gone to sleep]
jtdoncas has joined #ruby
PaulCapestany has joined #ruby
marciotex has joined #ruby
Agoldfish has quit [Quit: G'Bye]
nobitanobi has quit [Remote host closed the connection]
<_blizzy_> ok, I updated the gist again, Radar c:
<Radar> c:\\nope.jpg
<_blizzy_> why nope?
<Radar> a.rb and b.rb aren't the real filenames
<Radar> And if I wanted to look at 150 lines of terrible code there's parts of the app that I work on erryday that are like that
<sevenseacat> assuming the second file is the helpers.rb
<Radar> sevenseacat: you know what they say about cliches
Igorshp has joined #ruby
* _blizzy_ sighs
<_blizzy_> ok
<sevenseacat> lol
<sevenseacat> you make an ass out of you and... iche?
juanpaucar has quit [Remote host closed the connection]
<_blizzy_> there I updated the gist with the correct file names
<_blizzy_> and I wouldn't call it terrible code
Igorshp has quit [Remote host closed the connection]
<_blizzy_> :/
<Aeyrix> Radar: >:(
<Radar> Aeyrix: _blizzy_ has been doing it long enough and should know better by now.
<sevenseacat> i'd call it incomprehensible code, looking at it from the outside
<sevenseacat> but anyway, whats the problem with it?
<Radar> Steps to reproduce the problem plzkthx
<_blizzy_> sevenseacat, may I pm you?
<sevenseacat> I'd prefer you didn't.
<_blizzy_> ok.
<sevenseacat> if its about the code, we can discuss it here.
<_blizzy_> it's not about the code.
<_blizzy_> it's about something else.
freerobby has joined #ruby
<sevenseacat> okay, sure.
<pontiki> _blizzy_: 3 questions: 1) does it work? 2) how do you know it works? 3) do you understand why it works?
simplyaubs has quit [Quit: simplyaubs]
<al2o3-cr> why is ws not an instance variable?
<_blizzy_> I've been refactoring this code for the past hour
DoubleMalt has quit [Ping timeout: 256 seconds]
ziprar is now known as zipace
<_blizzy_> why is ws not a instance variable? this is still a rough rough draft.
jenrzzz has joined #ruby
<_blizzy_> I'm still making changes.
inoic has quit [Ping timeout: 244 seconds]
<al2o3-cr> ah, okay dokay no worries :)
<sevenseacat> so, whats the problem with it?
<_blizzy_> well, I've been using byebug, and after the line where @team is assigned to get_team(), @team has a hash. however, a few lines down, @team gets reset to 'nil' for some reason.
<sevenseacat> and where is that
<sevenseacat> and where is it nil
<_blizzy_> @team?
<zenspider> you had to make him rename it... now the diffs aren't as good
dorei has quit []
<_blizzy_> @team is nil at line 67
<sevenseacat> and where are you setting it to not nil
<_blizzy_> even though it is assigned a value at line 46.
<sevenseacat> if you say 46 I'm goin gto be grumpyu
<_blizzy_> .
<_blizzy_> well then.
fabrice31 has joined #ruby
<sevenseacat> they're two different branches of the same case statement
<sevenseacat> only one will execute
<zenspider> I really wouldn't call what you've done over the past hour "refactoring". you've moved one hunk of code to a different file as far as I can see
<_blizzy_> zenspider, I'm splitting up the file
<_blizzy_> into tiny methods
<zenspider> not yet you're not
<_blizzy_> I am.
<_blizzy_> the file isn't as long as it was like 2 hours ago.
<sevenseacat> if line 67 runs, like 46 isnt running.
<sevenseacat> *line
fgo has joined #ruby
slackbotgz1 has quit [Remote host closed the connection]
<_blizzy_> the method 'run' is being ran (heh) multiple times
slackbotgz has joined #ruby
<zenspider> you know we can see all the revisions, right?
<_blizzy_> yes.
<_blizzy_> I know.
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Radar> I don't see where the run method is being called at all.
<_blizzy_> I'm not pasting entire files into gist. I'm only pasting what is needed to find the solution.
<sevenseacat> ok, some more information
<sevenseacat> where are you calling this run method from?
<Radar> If we had some steps to reproduce the error that you're seeing that would really help us.
<sevenseacat> _blizzy_: you're posting little enough o frustrate the people trying to help you
findaway has joined #ruby
<zenspider> so you know that I know that it is roughly the same as 2 hours ago. it does LESS now... but that isn't refactoring
findaway has quit [Client Quit]
fabrice31 has quit [Ping timeout: 250 seconds]
<_blizzy_> ok.
gaucheph has joined #ruby
<sevenseacat> I am honestly not wanting to touch this code.
<_blizzy_> well nvm then. I'll just figure out the bug myself. c:
<sevenseacat> given it's 300 lines of spaghetti
mandarinkin2 has quit [Ping timeout: 248 seconds]
<eam> man I could go for some spaghetti right now
<_blizzy_> how is it 300 lines of spaghetti.
<_blizzy_> long != bad
<zenspider> 300 lines of spaghetti I can deal with. Someone seemingly not wanting to learn I won't deal with.
<_blizzy_> I'm willing to learn.
<zenspider> long IS bad if we're talking about a single method. Have you broken it up like I (and others) suggested? no.
<_blizzy_> yes.
<_blizzy_> I have.
<zenspider> 785.2: Battle#run a.rb:24
<zenspider> 270.1: Battle#decide a.rb:189
<zenspider> old
<zenspider> 312.4: ShowdownBot#run parser.rb:37
<zenspider> 267.8: Battle#run battle.rb:25
<zenspider> 108.6: main#get_team helpers.rb:1
<zenspider> new
workmad3 has joined #ruby
<sevenseacat> and all of the information still isnt there, like what are you calling this ShowdownBot.run message with
<zenspider> so... NOT REALLY
<_blizzy_> ok, I'll just paste every file
<pontiki> or just link the repo
<sevenseacat> basically, the amount of work that is required to understand it greatly exceeds the amount of time i'm willing to spend on it.
<_blizzy_> ok.
<_blizzy_> I'll find the bug myself.
<sevenseacat> if it was broken down smaller, it would be a lot easier to understand.
<_blizzy_> I'm still refactoring.
<sevenseacat> and that doesnt just mean 'move things into tony methods'
<sevenseacat> tiny
<sevenseacat> it means an easier to understand structure
<_blizzy_> I know what refactoring means.
<eam> code structure is a really hard skill to learn
<sevenseacat> apparently not
<sevenseacat> eam: for sure
<eam> it's OK to not know how to do it
<sevenseacat> its very easy to do things badly
<sevenseacat> overengineer, underengineer
findaway has joined #ruby
<_blizzy_> man, the python community is so much 'friendly' - er.
<sevenseacat> of course.
<sevenseacat> tell people something they dont want to hear, and the community now sucks.
<_blizzy_> I never said that, but ok.
jpfuentes2 has joined #ruby
<eam> I don't mind hearing that; maybe it's true
<eam> _blizzy_: one thing you should consider is how you can change your approach to better extract information from the folks here
<_blizzy_> eam, the problem is that
<_blizzy_> I'm trying to get help, and people are calling my code bad instead of helping with why it's bad.
Ontolog has quit [Quit: Leaving...]
<eam> yeah I get it, that's sometimes part of soliciting help
workmad3 has quit [Ping timeout: 256 seconds]
<eam> and sometimes it gets worse depending on how you ask for the help (or how you respond to the advice)
<eam> I'd recommend not worrying about it -- you can ignore anyone here; they don't matter (but, you can also learn from them)
<_blizzy_> true.
<_blizzy_> thanks, eam. :)
Lucky_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<eam> most of the advice you're getting is very good
<_blizzy_> it's just the way they say it imo.
meph has quit [Quit: Leaving.]
<_blizzy_> they come off as 'cocky'
<eam> could also be the way you hear it -- many of the people here are very good at what they do
<_blizzy_> true.
<eam> sometimes 'cockey' is confused with actual real world competence
shazaum_ has quit [Quit: This computer has gone to sleep]
<_blizzy_> well, I better look for this bug.
shortdudey123 has quit [Max SendQ exceeded]
shortdudey123 has joined #ruby
Lucky_ has joined #ruby
astrobun_ has joined #ruby
ReK2 has quit [Quit: Konversation terminated!]
Ox0dea has joined #ruby
<Ox0dea> _blizzy_: It's much easier to find something in a clean room.
tomjoro has quit [Remote host closed the connection]
<_blizzy_> Ox0dea, I know my code isn't the best
<_blizzy_> but I wouldn't call it that bad.
<scripore> Question: is there any way I can improve on this? https://gist.github.com/Scripore/4aaab2b307a472f1f29b
Channel6 has quit [Quit: Leaving]
<Ox0dea> scripore: Yes.
<scripore> it's a short 10 line program to decode a string by rotating the letters 13 chars.
jlast has joined #ruby
<sevenseacat> Ox0dea: no golfing.
<Ox0dea> Alas.
<sevenseacat> ;)
<Ox0dea> I was so ready to golf.
<scripore> how could I improve it better?
Igorshp has joined #ruby
darkf has joined #ruby
<_blizzy_> so, I guess no one will attempt to help. c: ok.
<pontiki> i'd use map instead of each to build the array as you go, but it's ok as it is, too
<Ox0dea> scripore: You're "translating" each letter to a different one, for which String#tr is particularly suited.
<Ox0dea> >> 'abcabc'.tr 'abc', 'def'
<ruboto> Ox0dea # => "defdef" (https://eval.in/387312)
Igorshp has quit [Remote host closed the connection]
robbyoconnor has joined #ruby
<Ox0dea> scripore: Construct the new "alphabet" and translate to it from the standard one.
<scripore> oh, that's neat. I wasn't aware of that method.
duderonomy has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Igorshp has joined #ruby
Scroff has joined #ruby
Igorshp has quit [Remote host closed the connection]
hatzopoulos has quit [Quit: Leaving]
greenbagels has joined #ruby
jlast has quit [Ping timeout: 252 seconds]
Igorshp has joined #ruby
<_blizzy_> so what if I'm supposed to do if no one will attempt to help me find the bug, but no one will point out what exactly is wrong with my code? :/
greenbagels has quit [Max SendQ exceeded]
prereflect has joined #ruby
Deele has quit [Ping timeout: 256 seconds]
<pontiki> take a break, come back tomorrow
Igorshp has quit [Remote host closed the connection]
findaway has quit [Quit: findaway]
<_blizzy_> I'm trying to refactor my code, but it seems like I'm getting kicked down everytime I try. :/
<_blizzy_> discourages me.
<_blizzy_> pontiki, good idea.
Igorshp has joined #ruby
<Ox0dea> I think it's a great idea. Give your background mind time to think things over.
<_blizzy_> ok.
<_blizzy_> and I'm trying to shorten the file.
<_blizzy_> got it to around 130 atm. :)
<_blizzy_> well, 132.
Igorshp has quit [Remote host closed the connection]
symm- has quit [Ping timeout: 252 seconds]
eggoez has quit [Ping timeout: 246 seconds]
Scroff has quit [Ping timeout: 272 seconds]
prereflect has quit [Client Quit]
al2o3-cr has quit [Quit: WeeChat 1.2]
Igorshp has joined #ruby
<Ox0dea> "Measuring programming progress by lines of code is like measuring aircraft building progress by weight." -- Bill Gates
al2o3-cr has joined #ruby
findaway has joined #ruby
Igorshp has quit [Remote host closed the connection]
<_blizzy_> well, people here seem to like that shorter == better.
<_blizzy_> so IDK anymore. :/
<scripore> @Ox0dea, thanks, it worked wonderfully!
<Ox0dea> scripore: Nice! Are you handling capitals, though? :)
<scripore> I added .downcase to the encoded string
<Aeyrix> _blizzy_: People here like clean and segmented, better.
<Aeyrix> The reason is twofold:
<Aeyrix> A> Easier to read
Igorshp has joined #ruby
<Aeyrix> B> Easier to debug <-- Important for this current situation
<Ox0dea> scripore: That feels "hackish", but all right.
<_blizzy_> Aeyrix, oh.
<Aeyrix> You've been in and out of this channel for a while now with code of varying degrees of similarity. What isn't clicking?
<Aeyrix> Someone isn't telling you something, or someone is telling you something and you're ignoring it.
<Aeyrix> I don't know, I don't pay attention here all the time.
<Ox0dea> The "someone" in there might well be _blizzy_.
<scripore> hmm, I should probably make it better then. I have a lot of time.
Igorshp has quit [Remote host closed the connection]
<Aeyrix> Ox0dea: The someone is anyone *except* _blizzy_, given the context of my statement.
l0oky has quit [Read error: Connection reset by peer]
<_blizzy_> I'm not ignoring anyone.
<Ox0dea> I meant to imply that he might've settled on his laurels, paltry though they may be, far too early.
<Aeyrix> _blizzy_: Whether intentionally or unintentionally, you may well be.
<Aeyrix> How many times have you asked for help with the codebase you've linked?
<Aeyrix> Not today, but over time.
Igorshp has joined #ruby
<_blizzy_> Aeyrix, just today actually.
<Aeyrix> Ah.
<Aeyrix> One thing that struck me is your lack of splitting things out into separate objects.
<Aeyrix> Player should be an object. PlayerTeam should be an object.
<Aeyrix> PlayerTeam should just be Team.
<Aeyrix> A Player should own a Team.
Igorshp has quit [Remote host closed the connection]
greenbagels has joined #ruby
<zenspider> "<_blizzy_> I know what refactoring means." == I'm done with this
<Aeyrix> The Opponent should own a Team.
datanoise has joined #ruby
<Aeyrix> _blizzy_: Do you see what I'm getting at here?
<Aeyrix> Split it down into small, reusable, manageable chunks.
<_blizzy_> Aeyrix, this is using a Pokemon simulator.
<_blizzy_> and it's a bot.
<Aeyrix> I know.
<Aeyrix> I also know.
<_blizzy_> oh.
<Aeyrix> I read the code.
<_blizzy_> atm I'm breaking it down into smaller chunks.
Igorshp has joined #ruby
<Aeyrix> Let me get some lunch, then I'll take a stab at writing a skeleton to help you.
<Aeyrix> If you're still around, I don't know what time it is for you.
<Aeyrix> I'll be about an hour.
nobitanobi has joined #ruby
<_blizzy_> well, it's actually 10 pm where I am, so I'm going to bed soon. but thanks for the offer. :)
<Aeyrix> Okay.
Igorshp has quit [Remote host closed the connection]
<Aeyrix> If you're still around when I get back, I'll page you.
<_blizzy_> ok.
Igorshp has joined #ruby
riskish has quit [Quit: Textual IRC Client: www.textualapp.com]
Igorshp has quit [Remote host closed the connection]
datanoise has quit [Ping timeout: 246 seconds]
Igorshp has joined #ruby
Igorshp has quit [Remote host closed the connection]
<_blizzy_> I'm not done, but would you call this better than what I had? https://gist.github.com/NotBlizzard/81b2b2c3c058b521995f
eggoez has joined #ruby
adamjleonard has joined #ruby
<Ox0dea> _blizzy_: Are you able to elucidate what you feel has been improved?
<zenspider> no
<zenspider> it's still not even remotely testabel
<zenspider> testable
Igorshp has joined #ruby
<_blizzy_> zenspider, oh. ._.
astrobun_ has quit [Remote host closed the connection]
<_blizzy_> well, I tried.
<_blizzy_> Ox0dea, yes.
Igorshp has quit [Remote host closed the connection]
<_blizzy_> I feel like it has improved slightly at best.
jokester has quit [Quit: recharging]
<Ox0dea> How?
Igorshp has joined #ruby
<_blizzy_> well, I've made the battle.rb file smaller by at least half, and I have split up a lot of the big chunks of code into smaller methods.
<_blizzy_> I plan to make each switch/case statement no more than 5 lines.
charliesome has quit [Quit: zzz]
rubie has joined #ruby
astrobun_ has joined #ruby
Igorshp has quit [Remote host closed the connection]
Igorshp has joined #ruby
<Ox0dea> _blizzy_: Why do these lines exist?
aphprentice_ has quit [Remote host closed the connection]
<_blizzy_> Ox0dea, depending on who challenges who, the 'player 1' will be different.
<_blizzy_> like if I challenge you, I'll be p1, but if you challenge me, you'll be p1.
Igorshp has quit [Remote host closed the connection]
<_blizzy_> sorry. I mean the one who is challenged is player 1.
<Ox0dea> _blizzy_: Why not just `@p1 = @challenged`?
<_blizzy_> Ox0dea, thanks. let me change that.
Igorshp has joined #ruby
NeverDie_ has joined #ruby
<Ox0dea> Well, there's still the matter of having two different variables that refer to the exact same thing.
jokester has joined #ruby
<Ox0dea> You should just use one or the other.
Igorshp has quit [Remote host closed the connection]
<_blizzy_> true. well, I need to sleep now. thanks for the help everyone.
<_blizzy_> gn and bye until tomorrow.
<Ox0dea> Good night, _blizzy_.
rubie has quit [Ping timeout: 265 seconds]
Igorshp has joined #ruby
<pontiki> sleep well, _blizzy_
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Igorshp has quit [Remote host closed the connection]
deric_skibotn has quit [Ping timeout: 246 seconds]
NeverDie has quit [Ping timeout: 256 seconds]
swgillespie has joined #ruby
Igorshp has joined #ruby
Rickmasta has joined #ruby
michael_mbp has quit [Excess Flood]
danielpclark has quit [Ping timeout: 246 seconds]
Igorshp has quit [Remote host closed the connection]
NeverDie_ has quit [Read error: Connection reset by peer]
Igorshp has joined #ruby
Igorshp has quit [Remote host closed the connection]
wldcordeiro has quit [Ping timeout: 248 seconds]
NeverDie has joined #ruby
amclain has joined #ruby
Igorshp has joined #ruby
pyon has joined #ruby
michael_mbp has joined #ruby
Igorshp has quit [Remote host closed the connection]
5EXABJCO3 has joined #ruby
<Ox0dea> scripore: How goes?
chinmay_dd has joined #ruby
MacDaddy has joined #ruby
jtdoncas has quit [Ping timeout: 248 seconds]
<zenspider> zomg home made chile colorado OM NOM NOM
<scripore> pretty good, I've revised it. I still need to incorporate uppercase letter translations.
<scripore> took a break because someone started messaging me on Slack
vikaton has quit [Quit: Connection closed for inactivity]
Soda has quit [Remote host closed the connection]
<Ox0dea> zenspider: I didn't know you spoke Spanish.
<Ox0dea> I did know that you spoke lolcat, though.
gaucheph has quit [Read error: Connection reset by peer]
gaucheph has joined #ruby
RegulationD has joined #ruby
danielpclark has joined #ruby
chinmay_dd has quit [Ping timeout: 246 seconds]
scx_ has joined #ruby
<pontiki> welcome to the indianapolis academy of restaurant spanish
n008f4g_ has quit [Ping timeout: 264 seconds]
astrobun_ has quit [Remote host closed the connection]
iamninja has quit [Read error: Connection reset by peer]
charliesome has joined #ruby
iamninja has joined #ruby
scx has quit [Ping timeout: 264 seconds]
RegulationD has quit [Ping timeout: 256 seconds]
bkxd has joined #ruby
braincra- has quit [Quit: bye bye]
astrobun_ has joined #ruby
greenbagels has quit [Quit: Leaving]
yardenbar has quit [Quit: Leaving]
braincras has joined #ruby
solarradiation has joined #ruby
solarradiation has joined #ruby
<solarradiation> why does running 'bundle' ask for my root password? I'm using rbenv
<Ox0dea> You dun goofed.
al2o3-cr has quit [Quit: WeeChat 1.2]
<sevenseacat> aye.
kies has quit [Ping timeout: 264 seconds]
marciotex has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
baroquebobcat has quit [Quit: baroquebobcat]
jpfuentes2 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Radar> solarradiation: What OS?
<solarradiation> ubuntu 14.04
al2o3-cr has joined #ruby
<pontiki> maybe didn't type rehash
<Radar> ?ubuntu
<ruboto> Ubuntu installation guide for Ruby + Rails: http://ryanbigg.com/2014/10/ubuntu-ruby-ruby-install-chruby-and-you/
laurentide has quit [Ping timeout: 248 seconds]
<Radar> You can follow that instead of using rbenv if you're not having any luck with rbenv.
jlast has joined #ruby
jpfuentes2 has joined #ruby
<Aeyrix> welp
<Aeyrix> i got back too late for blizzy
<sevenseacat> thats a shame.
<Radar> How dare you eat food.
nso95 has joined #ruby
<Aeyrix> ;_;
<al2o3-cr> Aeyrix: what did you have?
<Aeyrix> cut my lunch break short and everything lmao
<Aeyrix> i have another 20min
<Aeyrix> al2o3-cr: nando's
<al2o3-cr> nice :)
<sevenseacat> omnomnom
polyrob has quit [Ping timeout: 272 seconds]
mary5030 has joined #ruby
bkxd has quit [Ping timeout: 246 seconds]
jlast has quit [Ping timeout: 250 seconds]
balazs has joined #ruby
bkxd has joined #ruby
geiltalasdair has joined #ruby
<al2o3-cr> can you see colored text?
<Aeyrix> no
<al2o3-cr> :(
theery has quit [Ping timeout: 265 seconds]
artmann_ has quit [Remote host closed the connection]
Zamerick has quit [Quit: Leaving]
theery has joined #ruby
polyrob has joined #ruby
geilt has quit [Ping timeout: 244 seconds]
theery_ has joined #ruby
chinmay_dd has joined #ruby
slumos has joined #ruby
<Ox0dea> RAINBOW
oo_ has quit [Ping timeout: 244 seconds]
shadoi has quit [Quit: Leaving.]
tubuliferous_ has quit [Ping timeout: 276 seconds]
<pontiki> all the way?
<sevenseacat> double rainbow??
<Ox0dea> Doing colors in WeeChat is tedious. :/
<Ox0dea> I suspect I could set up a quicker bind for it, but that way lies trouble.
artmann has joined #ruby
konsolebox has joined #ruby
theery has quit [Ping timeout: 265 seconds]
pontiki has quit [Quit: <poit>]
slumos has left #ruby ["Textual IRC Client: www.textualapp.com"]
geiltalasdair has quit [Quit: Leaving]
chinmay_dd has quit [Ping timeout: 256 seconds]
geiltalasdair has joined #ruby
bkxd has quit [Ping timeout: 246 seconds]
gix has quit [Ping timeout: 252 seconds]
al2o3-cr has quit [Ping timeout: 256 seconds]
al2o3-cr has joined #ruby
al2o3-cr is now known as Guest55661
astrobun_ has quit [Remote host closed the connection]
Guest55661 has quit [Client Quit]
yfeldblum has quit [Quit: Leaving...]
al2o3-cr has joined #ruby
juanpaucar has joined #ruby
yfeldblum has joined #ruby
gix has joined #ruby
Ox0dea has left #ruby ["WeeChat 1.3-dev"]
s2013 has joined #ruby
oo_ has joined #ruby
netmask has quit [Remote host closed the connection]
Sypheren has joined #ruby
wallerdev has joined #ruby
netmask has joined #ruby
theery_ has quit [Remote host closed the connection]
speakingcode has joined #ruby
juanpaucar has quit [Ping timeout: 264 seconds]
astrobun_ has joined #ruby
cpruitt has joined #ruby
GitStud has quit [Read error: Connection reset by peer]
GitStud has joined #ruby
netmask has quit [Ping timeout: 264 seconds]
DoubleMalt has joined #ruby
mrmargolis has quit [Remote host closed the connection]
theery has joined #ruby
hahuang65 has joined #ruby
bigmac__ has joined #ruby
x44x45x41x4E has joined #ruby
kp666 has joined #ruby
arescorpio has joined #ruby
workmad3 has joined #ruby
mary5030 has quit [Remote host closed the connection]
balazs has quit [Remote host closed the connection]
keen___________2 has joined #ruby
balazs has joined #ruby
duderonomy has joined #ruby
frem has quit [Quit: Connection closed for inactivity]
RobertBirnie has joined #ruby
keen___________1 has quit [Ping timeout: 256 seconds]
workmad3 has quit [Ping timeout: 276 seconds]
bruno- has joined #ruby
GitStud has quit [Quit: My name is your name]
netmask has joined #ruby
GitStud has joined #ruby
bruno- has quit [Ping timeout: 276 seconds]
<zenspider> spanish?
<zenspider> ooooh... the foods.
icebourg has joined #ruby
netmask_ has joined #ruby
al2o3-cr has quit [Ping timeout: 272 seconds]
DexterLB has joined #ruby
netmask has quit [Ping timeout: 244 seconds]
<Radar> zenspider is talking to himself again. *phones the asylum*
rubie has joined #ruby
Scroff has joined #ruby
cpruitt has quit [Quit: cpruitt]
oo_ has quit [Remote host closed the connection]
scripore has quit [Quit: This computer has gone to sleep]
<zenspider> it's far too late for that...
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
RobertBirnie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rubie has quit [Ping timeout: 265 seconds]
scripore has joined #ruby
ramfjord has quit [Ping timeout: 250 seconds]
tubuliferous_ has joined #ruby
Scroff has quit [Ping timeout: 264 seconds]
DoubleMalt has quit [Ping timeout: 250 seconds]
Kache4 has quit [Ping timeout: 246 seconds]
charliesome has quit [Quit: zzz]
jlast has joined #ruby
tubuliferous_ has quit [Ping timeout: 265 seconds]
failshell has joined #ruby
findaway has quit [Quit: findaway]
DoubleMalt has joined #ruby
nso95 has quit [Quit: nso95]
jtdoncas has joined #ruby
jlast has quit [Ping timeout: 246 seconds]
geiltalasdair has quit [Quit: Leaving]
scripore has quit [Quit: This computer has gone to sleep]
geiltalasdair has joined #ruby
geiltalasdair has quit [Client Quit]
geiltalasdair has joined #ruby
yeticry has quit [Ping timeout: 264 seconds]
yeticry has joined #ruby
_blizzy_ has quit [Ping timeout: 248 seconds]
kies has joined #ruby
failshell has quit [Remote host closed the connection]
hahuang65 has quit [Ping timeout: 246 seconds]
baweaver has joined #ruby
netmask has joined #ruby
gianlucadv has joined #ruby
netmask_ has quit [Ping timeout: 256 seconds]
5EXABJCO3 is now known as baweaver_
baweaver has quit [Disconnected by services]
ramblinpeck_ is now known as ramblinpeck
baweaver_ is now known as baweaver
peter_paule has joined #ruby
hahuang65 has joined #ruby
deric_skibotn has joined #ruby
hanmac has quit [Ping timeout: 256 seconds]
jenrzzz has quit [Ping timeout: 276 seconds]
djbkd has joined #ruby
bluOxigen has joined #ruby
wallerdev has quit [Quit: wallerdev]
al2o3-cr has joined #ruby
hahuang65 has quit [Ping timeout: 246 seconds]
commondream has joined #ruby
RegulationD has joined #ruby
peter_paule has quit [Ping timeout: 244 seconds]
arescorpio has quit [Quit: Leaving.]
oo_ has joined #ruby
solarradiation has quit [Quit: Leaving]
RegulationD has quit [Ping timeout: 246 seconds]
commondream has quit [Ping timeout: 255 seconds]
devdazed has joined #ruby
wallerdev has joined #ruby
laurentide has joined #ruby
hanmac has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Sembei has joined #ruby
Pisuke has quit [Ping timeout: 255 seconds]
icarus has joined #ruby
s2013 has joined #ruby
jenrzzz has joined #ruby
yardenbar has joined #ruby
ndrei has joined #ruby
bkxd has joined #ruby
netmask has quit []
casadei has quit [Remote host closed the connection]
nveselinov has joined #ruby
jenrzzz has quit [Ping timeout: 264 seconds]
passbe1 has joined #ruby
balazs has quit [Remote host closed the connection]
<passbe1> I'm developing a ruby console program and would like to pause execution until the user hits enter (or they control+c). googling has provided me with highline but would rather something a little simpler
<passbe1> ruby v2.1.1
EllisTAA has joined #ruby
<bnagy> gets
ghostpl has joined #ruby
deric_skibotn has quit [Ping timeout: 246 seconds]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
skade has joined #ruby
psy_ has quit [Ping timeout: 246 seconds]
Deele has joined #ruby
icebourg has quit []
choke has joined #ruby
nateberkope has joined #ruby
nateberkopec has quit [Read error: Connection reset by peer]
jpfuentes2 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jlast has joined #ruby
<shevy> :)
<shevy> don't you love simple questions
<shevy> passbe1 wake up man!
<jtperreault> simple answers even better ;)
jcaho has joined #ruby
<shevy> yeah, if it is possible; well I guess for the most part it will be possible for simple questions, unless it's a domain-specific question like about a rare gem
aryaching has quit [Ping timeout: 276 seconds]
* passbe1 rushes off to the documentation about gets
last_staff has joined #ruby
<passbe1> cheers shevy and bnagy
<baweaver> alo shevy
simplyaubs has joined #ruby
<Radar> alo then wats this we have here now?
<Radar> You just read that in a British accent
jacor has quit [Ping timeout: 248 seconds]
ghostpl has quit [Remote host closed the connection]
ghostpl has joined #ruby
<baweaver> I randomly switch accents on BART to see how many people I can throw off
jlast has quit [Ping timeout: 264 seconds]
nobitanobi has quit [Remote host closed the connection]
juanpaucar has joined #ruby
gauke has joined #ruby
<flughafen> moin
<shevy> flughafen ready for take-off?
<flughafen> shevy: no
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
juanpaucar has quit [Ping timeout: 264 seconds]
EllisTAA has quit [Quit: EllisTAA]
arooni-mobile has joined #ruby
fabrice31 has joined #ruby
psy_ has joined #ruby
djbkd has quit [Quit: My people need me...]
theery has quit [Remote host closed the connection]
EllisTAA has joined #ruby
failshell has joined #ruby
bkxd_ has joined #ruby
datanoise has joined #ruby
bkxd has quit [Ping timeout: 250 seconds]
fabrice31 has quit [Ping timeout: 246 seconds]
jenrzzz has joined #ruby
datanoise has quit [Ping timeout: 252 seconds]
failshell has quit [Ping timeout: 265 seconds]
<shevy> :P
workmad3 has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
ValicekB has quit [Read error: Connection reset by peer]
swgillespie has joined #ruby
khebbie has joined #ruby
freerobby has quit [Quit: Leaving.]
sandstrom has joined #ruby
EllisTAA has quit [Quit: EllisTAA]
tagrudev has joined #ruby
passbe1 has left #ruby ["WeeChat 1.2"]
workmad3 has quit [Ping timeout: 248 seconds]
havenwood has joined #ruby
choke has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bruno- has joined #ruby
saadq has joined #ruby
<saadq> Is there a way to make iTerm be opaque on startup? Usually when I open iTerm, it opens as transparent
<flughafen> saadq: try #rubyonrails
arooni-mobile has quit [Ping timeout: 248 seconds]
<saadq> Alright
lxsameer has joined #ruby
acke has joined #ruby
bruno- has quit [Ping timeout: 244 seconds]
acke has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 264 seconds]
emergion has joined #ruby
<flughafen> saadq: there is an actually an #iterm2
ValicekB has joined #ruby
<saadq> flughafen: yeah, I meant iTerm 2 lol
gauke has quit [Quit: gauke]
krz has joined #ruby
<flughafen> no i mean there is a chatroom #iterm2 with people in it
Scroff has joined #ruby
t0rrieri has quit [Quit: Be back later ...]
jds has joined #ruby
x44x45x41x4E has quit [Ping timeout: 252 seconds]
gaucheph__ has joined #ruby
tubuliferous_ has joined #ruby
balazs has joined #ruby
Scroff has quit [Ping timeout: 265 seconds]
Musashi007 has quit [Quit: Musashi007]
gaucheph has quit [Ping timeout: 248 seconds]
<saadq> flughafen: I feel foolish
codecop has joined #ruby
jenrzzz has joined #ruby
codecop_ has joined #ruby
codecop_ has quit [Remote host closed the connection]
balazs has quit [Ping timeout: 264 seconds]
tubuliferous_ has quit [Ping timeout: 264 seconds]
nahtnam has joined #ruby
Xoro has quit [Read error: Connection reset by peer]
Xoro has joined #ruby
<flughafen> it's ok
<krowv> Is there a commandline way to easily view more information about a function? For example, say I want information on the spawn method. Can I access that easily similar to like a man page for C functions?
ghostpl has quit [Remote host closed the connection]
AlphaAtom has joined #ruby
riotjones has joined #ruby
jtdoncas has quit [Ping timeout: 252 seconds]
noname has quit [Ping timeout: 276 seconds]
chinmay_dd has joined #ruby
<ledestin> krowv ri is slow. what's your OS?
AlphaAtom has quit [Client Quit]
ghostpl has joined #ruby
<krowv> ledestin, ubuntu 15.04
<ledestin> krowv then your best choice is pry
saadq has quit [Remote host closed the connection]
AlphaAtom has joined #ruby
abuzze has joined #ruby
AlphaAtom has quit [Max SendQ exceeded]
ejnahc has quit [Quit: leaving]
AlphaAtom has joined #ruby
ejnahc has joined #ruby
<krowv> ledestin, ok, trying to use either ri or pry to view the spawn method.
ghostpl has quit [Remote host closed the connection]
ghostpl has joined #ruby
<krowv> using ri: >> spawn
<krowv> Nothing known about .spawn
gauke has joined #ruby
<krowv> [1] pry(main)> show-method spawn
<krowv> Error: Cannot locate this method: spawn.
<ledestin> well, it's Process.spawn or something
<krowv> I got the name from pry doing find-method
<krowv> [3] pry(main)> show-method Process.spawn
<krowv> Error: Cannot locate this method: spawn.
jlast has joined #ruby
ndrei has quit [Ping timeout: 276 seconds]
[k- has joined #ruby
<ledestin> can you run it?
ndrei has joined #ruby
<sevenseacat> `ri Kernel.spawn`
fgo has quit [Ping timeout: 244 seconds]
<sevenseacat> or show-method would probably work too. as long as you actually know it's Kernel.spawn.
<krowv> one sec, checking
lavros has joined #ruby
<krowv> ri Kernel.spawn
<krowv> Nothing known about Kernel
yfeldblum has quit [Ping timeout: 248 seconds]
psy_ has quit [Ping timeout: 252 seconds]
<krowv> its weird case find-method lists it
<krowv> [2] pry(main)> find-method spawn
<krowv> Kernel.spawn
<krowv> Process.spawn
<krowv> Kernel
<krowv> Kernel#spawn
<sevenseacat> err, `ri Kernel.spawn` worked here
<krowv> must some distro issue then
<sevenseacat> using ruby 2.1.6
<ledestin> ri docs are optional, dunno about pry
<sevenseacat> also 2.2
<krowv> ruby 2.1.2p95 (2014-05-08) [x86_64-linux-gnu]
jlast has quit [Ping timeout: 248 seconds]
msnyon has quit [Ping timeout: 264 seconds]
<sevenseacat> well if you dont install the docs obviously you won't have them >_>
noname has joined #ruby
Mon_Ouie has joined #ruby
ghostpl has quit [Ping timeout: 256 seconds]
<krowv> stupid question. How do you install the docs?
djellemah_ is now known as djellemah
armyriad has joined #ruby
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
havenwood has quit [Ping timeout: 265 seconds]
<Sypheren> why is it required to create an initialize method inside of a class?
ndrei has quit [Ping timeout: 256 seconds]
<Aeyrix> It isn't.
<Sypheren> My short, newbie code doesn't seem to work without it
<djellemah> krowv: Nope. Exactly the right question ;-) For rvm you say 'rvm docs generate-ri'
<flughafen> Sypheren: gist please
<sevenseacat> Sypheren: it isnt.
<[k-> let's have a gist before we decide
<krowv> djellemah, ok, up to this point I've only installed debs containing ruby on my Ubuntu system
<[k-> yes, you need it because u set the @name
chris2 has quit [Ping timeout: 248 seconds]
<ledestin> krowv I'd google for the error you have and see what's in store
<Sypheren> but if you were to change it to def asdf, the code stops working
<djellemah> krowv: probably there's an additional package. Maybe ruby-dev ?
<Aeyrix> Sypheren: Of course.
<[k-> initialize is called by new
<Aeyrix> Sypheren: Come on, take a guess.
<Aeyrix> Why do you think this happens?
<certainty> moin
<Aeyrix> moin certainty
<Sypheren> What I mean is
duncannz has joined #ruby
gauke has quit [Quit: gauke]
<[k-> Sypheren, try calling asdf before calling say_hi
<Sypheren> Do certain names of methods affect things?
<Aeyrix> Sypheren: Yes.
<Sypheren> asdf is already called before say_hi
<Aeyrix> Greeter.new will call Greeter#initialize automatically.
<Sypheren> Is initialize one of those names?
<Aeyrix> When you call Greeter#initialize, it sets the name.
<Aeyrix> Look at what your code is doing.
ledestin has quit [Read error: Connection reset by peer]
<Aeyrix> Initialize is taking the "name" parameter you passed to it, and assigning it to the class variable @name.
<krowv> djellemah, I'm digging around...
<[k-> Greeter::new*
wallerdev has quit [Quit: wallerdev]
<Aeyrix> say_hi is then using that variable.
<krowv> ruby-dev is already installed. at least I'm on the right path now
<flughafen> Sypheren: you're also passing "will" to Greeter, which is the initializer, every class gets one, either you write it or it's done automatically. you could just remove the initializer and have another function set_name ...
<Aeyrix> global variable, not class variable, but irrelevant
<[k-> instance variable*
wldcordeiro has joined #ruby
<Sypheren> I get what happens after the instance is set up
<flughafen> Sypheren: and then don't pass the name to new()
<Mon_Ouie> Also look at the error message that Ruby gives you
GitStud has quit [Ping timeout: 264 seconds]
<Sypheren> Wrong number of arguments? :>
danielpclark has quit [Ping timeout: 255 seconds]
<Mon_Ouie> Right. You give it one argument, and it expected zero.
<[k-> well well well
armyriad has quit [Quit: Leaving]
<Sypheren> I see
<Aeyrix> [k-: You got your tail back. :>
<[k-> we all jumpws to the wrong conclusion :>
<djellemah> krowv: I'm not familiar enough with ubuntu to know the details. You get the same documentation at http://ruby-doc.org/core-2.2.2/Kernel.html#method-i-spawn
<[k-> yes I did
failshell has joined #ruby
ledestin has joined #ruby
wallerdev has joined #ruby
armyriad has joined #ruby
<krowv> found ruby2.1-doc package
<krowv> ri is working now
<krowv> djellemah, thanks!
<Sypheren> Aeyrix, how would you pass it those arguments without an initialize method?
<Aeyrix> You wouldn't.
<Aeyrix> Or, you can, but you wouldn't in practicality.
<Aeyrix> You keep the initialize method.
<Sypheren> So it is required, if you need the class to have data put into it?
<Aeyrix> #initialize is a constructor.
<krowv> pry is still not cooperating. looking into it further
<sevenseacat> if you want to pass stuff to new, then yes.
<Aeyrix> It's designed to basically "set up" the class instance.
<Aeyrix> It doesn't have to be *all* the data, but it should be as much as you have on hand when you go to initialize the class.
<Mon_Ouie> How would ruby be able to guess that you want to set an instance variable called @name and not do something else in initialize?
<Sypheren> I see!
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
avahey has quit [Quit: Connection closed for inactivity]
al2o3-cr has quit [Ping timeout: 250 seconds]
chris2 has joined #ruby
<krowv> maybe I was just using pry wrong. If I go into the pry shell and then type ri spawn it loads
<krowv> but if I try show-method spawn from the pry shell it fails
<krowv> at any rate I can live with ri
failshell has quit [Ping timeout: 264 seconds]
* krowv hugs #ruby
<djellemah> krowv: show-method doesn't find methods implemented in C which are part of the core.
Xeago has joined #ruby
<Mon_Ouie> It does find some of them (not sure why it doesn't have all of them)
<krowv> djellemah, ok, that makes some sense.
gauke has joined #ruby
arup_r has joined #ruby
Macaveli has joined #ruby
<krowv> I'm still new to ruby but I love staying in the commandline so I knew there had to be a way to view it. I caught myself googling for everything and I try not to do that. I like to know that I'm getting the exact API for the things I'm using
psy_ has joined #ruby
<djellemah> krowv: also, for extra smiles, set up your EDITOR variable, and then in pry use edit instead of show-method. eg require 'csv'; edit CSV
negev has joined #ruby
<djellemah> krowv: Oh. That doesn't work with ; because edit has to at the beginning of the line for pry to recognise it.
swgillespie has joined #ruby
<negev> hi, i'm writing a non-rails application using rack. looking at this page: http://www.rubydoc.info/github/rack/rack/Rack/Static it seems to suggest that i can do: use Rack::Static, :urls => ["/media"] to handle static content automatically, but i can't see where to put this. does my main application class need to extend one of the rack classes in order to make the use method available?
<krowv> djellemah, yeah, noticed an error when I tried
iamninja has quit [Ping timeout: 265 seconds]
Asher has quit [Quit: Leaving.]
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
astrobu__ has joined #ruby
danielpclark has joined #ruby
fabrice31 has joined #ruby
swgillespie has quit [Client Quit]
Asher has joined #ruby
<djellemah> negev: I'm not familiar with Rack, but I'm guessing 'use Rack::Static' needs to go in some kind of config block
astrobun_ has quit [Ping timeout: 265 seconds]
ndrei has joined #ruby
serivich has joined #ruby
fabrice31 has quit [Remote host closed the connection]
commondream has joined #ruby
roolo has joined #ruby
fabrice31 has joined #ruby
wldcordeiro has quit [Quit: Konversation terminated!]
negev has quit [Ping timeout: 272 seconds]
aganov has joined #ruby
x44x45x41x4E has joined #ruby
<djellemah> negev: Seems like you need to put use in a blahblah.ru file, which you then run using rackup https://www.amberbit.com/blog/2011/07/13/introduction-to-rack-middleware/
Or1on has quit [Ping timeout: 255 seconds]
<_mh_> I would've guessed that as well, wasn't sure enough about it to suggest it though. From what I understand of rack, your .ru file kind of serves as a config file.
shredding has joined #ruby
commondream has quit [Ping timeout: 252 seconds]
jenrzzz has quit [Read error: Connection reset by peer]
jenrzzz has joined #ruby
rubie has joined #ruby
troulouliou_dev has joined #ruby
oo_ has quit [Remote host closed the connection]
oo_ has joined #ruby
skade has joined #ruby
AlphaAtom has joined #ruby
wildroman2 has joined #ruby
andikr has joined #ruby
wildroman2 has quit [Remote host closed the connection]
rubie has quit [Ping timeout: 265 seconds]
krandi has joined #ruby
wildroman2 has joined #ruby
skade has quit [Client Quit]
Xeago has quit [Read error: Connection reset by peer]
_ht has joined #ruby
wildroman3 has joined #ruby
skade has joined #ruby
wildroman3 has quit [Remote host closed the connection]
wildroman2 has quit [Read error: No route to host]
saadq has joined #ruby
wildroman2 has joined #ruby
simplyaubs has quit [Ping timeout: 246 seconds]
olistik has quit [Remote host closed the connection]
terlar has joined #ruby
Musashi007 has joined #ruby
simplyaubs has joined #ruby
ndrei has quit [Ping timeout: 264 seconds]
sandstrom has quit [Quit: My computer has gone to sleep.]
ndrei has joined #ruby
workmad3 has joined #ruby
bkxd_ has quit [Ping timeout: 264 seconds]
Xeago has joined #ruby
juanpaucar has joined #ruby
amclain has quit [Quit: Leaving]
ringarin has joined #ruby
Lucky_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sdwrage has quit [Quit: Leaving]
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
workmad3 has quit [Ping timeout: 255 seconds]
Iskarlar has joined #ruby
hmnhf has joined #ruby
laurentide has quit [Quit: Leaving]
Hounddog has joined #ruby
juanpaucar has quit [Ping timeout: 246 seconds]
zeroDivisible has quit [Ping timeout: 255 seconds]
bnizzle has joined #ruby
User458764 has joined #ruby
OrbitalKitten has joined #ruby
iamninja has joined #ruby
jlast has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
alex88 has joined #ruby
baweaver has quit [Remote host closed the connection]
simplyaubs has quit [Quit: simplyaubs]
jenrzzz has quit [Ping timeout: 265 seconds]
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jlast has quit [Ping timeout: 252 seconds]
micmus has joined #ruby
_blizzy_ has joined #ruby
skade has joined #ruby
lsmola has joined #ruby
User458764 has quit [Quit: Textual IRC Client: www.textualapp.com]
sandstrom has joined #ruby
arturaz has quit [Read error: Connection reset by peer]
Xeago has quit [Remote host closed the connection]
DoubleMalt has quit [Ping timeout: 248 seconds]
ta has joined #ruby
_blizzy_ has quit [Ping timeout: 248 seconds]
icarus has quit [Ping timeout: 244 seconds]
arturaz has joined #ruby
balazs has joined #ruby
failshell has joined #ruby
psy_ has quit [Ping timeout: 250 seconds]
datanoise has joined #ruby
balazs has quit [Ping timeout: 256 seconds]
icarus has joined #ruby
michael_mbp has quit [Excess Flood]
Bertg has joined #ruby
Zai00 has joined #ruby
TheHodge has joined #ruby
michael_mbp has joined #ruby
User458764 has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
failshell has quit [Ping timeout: 264 seconds]
lva has joined #ruby
olistik has joined #ruby
sandstrom has quit [Quit: My computer has gone to sleep.]
aryaching has joined #ruby
exadeci has joined #ruby
krz has quit [Quit: WeeChat 1.0.1]
icarus has quit [Ping timeout: 244 seconds]
alex88 has quit []
fantazo has joined #ruby
alex88 has joined #ruby
elia has joined #ruby
bkxd has joined #ruby
aphprentice has quit [Ping timeout: 246 seconds]
krz has joined #ruby
Scroff has joined #ruby
tomphp has joined #ruby
jenrzzz has joined #ruby
w1xz has joined #ruby
tubuliferous_ has joined #ruby
rdark has joined #ruby
dseitz has quit [Quit: Textual IRC Client: www.textualapp.com]
Scroff has quit [Remote host closed the connection]
vasilakisfil has joined #ruby
psy_ has joined #ruby
danielpclark has quit [Ping timeout: 256 seconds]
anisha has joined #ruby
ghostpl has joined #ruby
sandstrom has joined #ruby
Scroff has joined #ruby
w1xz has quit [Ping timeout: 244 seconds]
bkxd has quit [Ping timeout: 264 seconds]
tubuliferous_ has quit [Ping timeout: 265 seconds]
bkxd has joined #ruby
lavros has quit [Ping timeout: 246 seconds]
psy__ has joined #ruby
Xeago has joined #ruby
tomphp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
unshadow has joined #ruby
lavros has joined #ruby
psy_ has quit [Ping timeout: 255 seconds]
sandstrom has quit [Max SendQ exceeded]
Iskarlar has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mandarinkin2 has joined #ruby
mikecmpbll has joined #ruby
aphprentice has joined #ruby
husanu has quit [Remote host closed the connection]
husanu has joined #ruby
Xeago has quit [Remote host closed the connection]
chinmay_dd has quit [Remote host closed the connection]
unshadow has quit [Quit: leaving]
white_bear has joined #ruby
danielpclark has joined #ruby
astrobu__ has quit [Remote host closed the connection]
CloCkWeRX has quit [Quit: Leaving.]
astrobun_ has joined #ruby
saadq has quit [Remote host closed the connection]
j416 has quit [Ping timeout: 256 seconds]
gaucheph has joined #ruby
lavros has quit [Ping timeout: 246 seconds]
Xeago has joined #ruby
tomphp has joined #ruby
datanoise has quit [Ping timeout: 248 seconds]
gaucheph__ has quit [Ping timeout: 248 seconds]
maxshelley has joined #ruby
jack_rabbit has quit [Ping timeout: 248 seconds]
lavros has joined #ruby
sandstrom has joined #ruby
joonty has joined #ruby
skade has joined #ruby
maxshelley has quit [Client Quit]
icarus has joined #ruby
maxshelley has joined #ruby
Xeago has quit [Remote host closed the connection]
mandarinkin2 has quit [Ping timeout: 252 seconds]
Zai00 has quit [Quit: Zai00]
DoubleMalt has joined #ruby
<jokke> hi. Testers wanted! https://github.com/jreinert/autopass
AlexRussia has quit [Ping timeout: 256 seconds]
jds has quit [Quit: Connection closed for inactivity]
Pathfinder has joined #ruby
<[k-> huehuehue
gaucheph has quit [Ping timeout: 246 seconds]
<[k-> I only read code
<[k-> I do not test
gaucheph has joined #ruby
davedev2_ has quit []
Siyfion has joined #ruby
jenrzzz_ has joined #ruby
chinmay_dd has joined #ruby
jenrzzz has quit [Ping timeout: 244 seconds]
bkxd has quit [Ping timeout: 264 seconds]
jlast has joined #ruby
Xeago has joined #ruby
axl_ has joined #ruby
<[k-> what's the purpose of window_regex?
<[k-> you could use Hash#fetch which allows you to specify a default ^^
fabrice31 has quit [Ping timeout: 276 seconds]
yfeldblum has joined #ruby
lavros has quit [Ping timeout: 255 seconds]
jlast has quit [Ping timeout: 248 seconds]
fabrice31 has joined #ruby
axl_ is now known as nuth
lavros has joined #ruby
RegulationD has joined #ruby
nuth is now known as nutha
lkba_ has joined #ruby
jack_rabbit has joined #ruby
tesuji has joined #ruby
Zackio is now known as CaveJohnson
Iskarlar has joined #ruby
workmad3 has joined #ruby
yfeldblu_ has joined #ruby
einarj has joined #ruby
Mon_Ouie has quit [Ping timeout: 252 seconds]
gaucheph__ has joined #ruby
fabrice31 has quit [Remote host closed the connection]
lkba has quit [Ping timeout: 252 seconds]
fabrice31 has joined #ruby
Iskarlar has quit [Client Quit]
mandarinkin2 has joined #ruby
RegulationD has quit [Ping timeout: 256 seconds]
skade has quit [Quit: Computer has gone to sleep.]
zeroDivisible has joined #ruby
yfeldblum has quit [Ping timeout: 256 seconds]
skade has joined #ruby
gaucheph has quit [Ping timeout: 265 seconds]
Xeago has quit [Remote host closed the connection]
workmad3 has quit [Ping timeout: 255 seconds]
Xeago has joined #ruby
pyo_ has joined #ruby
al2o3-cr has joined #ruby
zeroDivisible has quit [Client Quit]
zeroDivisible has joined #ruby
ht__ has joined #ruby
wallerdev has quit [Quit: wallerdev]
jenrzzz_ has quit [Ping timeout: 256 seconds]
_axx has left #ruby [#ruby]
marr has joined #ruby
Xeago has quit [Remote host closed the connection]
AlexRussia has joined #ruby
Xeago has joined #ruby
<User458764> Hi, how do you read the first line of a CSV file? CSV.foreach[0]?
Ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<[k-> using the CSV from the stdlib?
rubie has joined #ruby
Xeago has quit [Remote host closed the connection]
<ljarvis> User458764: you might just want #readline
Pathfinder has quit [Ping timeout: 252 seconds]
<ljarvis> or gets/shift (they're all aliases)
Xeago has joined #ruby
ndrei has quit [Ping timeout: 256 seconds]
krandi has quit [Remote host closed the connection]
<ljarvis> User458764: pretty much everything else will read in all rows (including foreach[0] which would be .to_a[0]), which obviously you want to avoid
rubie has quit [Ping timeout: 265 seconds]
pyo_ has quit []
ndrei has joined #ruby
Xeago has quit [Remote host closed the connection]
astrobun_ has quit [Remote host closed the connection]
commondream has joined #ruby
Xeago has joined #ruby
sinkensabe has joined #ruby
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
SubjectiveBias has joined #ruby
gaucheph has joined #ruby
gaucheph__ has quit [Ping timeout: 248 seconds]
icosa1 has joined #ruby
olistik has quit [Remote host closed the connection]
icosa1 has quit [Remote host closed the connection]
icosa1 has joined #ruby
olistik has joined #ruby
n008f4g_ has joined #ruby
arup_r has quit [Remote host closed the connection]
olistik has quit [Remote host closed the connection]
poguez_ has quit [Quit: Connection closed for inactivity]
commondream has quit [Ping timeout: 256 seconds]
stan has joined #ruby
senayar has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
astrobun_ has joined #ruby
juanpaucar has joined #ruby
skade has joined #ruby
OrbitalKitten has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bruno- has joined #ruby
meph has joined #ruby
quimrstorres has joined #ruby
krz has quit [Ping timeout: 250 seconds]
quimrstorres has quit [Remote host closed the connection]
oo_ has quit [Remote host closed the connection]
lxsameer has quit [Quit: Leaving]
lxsameer has joined #ruby
juanpaucar has quit [Ping timeout: 264 seconds]
tkuchiki has quit [Remote host closed the connection]
oo_ has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
Iskarlar has joined #ruby
A205B064 has quit [Ping timeout: 256 seconds]
bruno- has quit [Ping timeout: 265 seconds]
danielpclark has quit [Ping timeout: 272 seconds]
aryaching has quit []
ndrei has quit [Ping timeout: 276 seconds]
quimrstorres has joined #ruby
ndrei has joined #ruby
Igorshp has joined #ruby
Xeago has quit [Remote host closed the connection]
Bertg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
withnale_ has joined #ruby
krz has joined #ruby
wasamasa is now known as bagelmasa
balazs has joined #ruby
bagelmasa is now known as wasamasa
workmad3 has joined #ruby
mandarinkin2 has quit [Ping timeout: 248 seconds]
nofxx has quit [Ping timeout: 256 seconds]
Zai00 has joined #ruby
balazs has quit [Ping timeout: 265 seconds]
sepp2k has joined #ruby
hakunin has quit []
Bertg has joined #ruby
skade has joined #ruby
terlar has quit [Quit: WeeChat 1.2]
Xeago has joined #ruby
ht__ has quit [Quit: Konversation terminated!]
jlast has joined #ruby
danielpclark has joined #ruby
Igorshp has quit [Remote host closed the connection]
failshell has joined #ruby
tkuchiki has joined #ruby
Iskarlar has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
arup_r has joined #ruby
OrbitalKitten has joined #ruby
Xeago has quit [Remote host closed the connection]
multi_io has quit [Ping timeout: 265 seconds]
Xeago has joined #ruby
jlast has quit [Ping timeout: 250 seconds]
multi_io has joined #ruby
Macaveli has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
emergion has quit [Quit: Connection closed for inactivity]
<yorickpeterse> morning kids
<yorickpeterse> god I love Sequel
mandarinkin2 has joined #ruby
failshell has quit [Ping timeout: 252 seconds]
<yorickpeterse> you want to customize how associations are loaded? You can do that!
<adaedra> so much this
<adaedra> Sequel is life
<yorickpeterse> jeremyevans for president
<adaedra> You should say that in #sequel :D
<shevy> or #french_cuisine
<adaedra> -_-
<shevy> soon it is weekend
<shevy> perhaps then I can write more ruby code again
txdv has quit [Quit: leaving]
OrbitalKitten has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
platzhirsch has joined #ruby
tedstriker has quit [Read error: Connection reset by peer]
olistik has joined #ruby
symm- has joined #ruby
OrbitalKitten has joined #ruby
tubuliferous_ has joined #ruby
nahtnam has quit [Quit: Connection closed for inactivity]
Xeago has quit [Remote host closed the connection]
langlands has joined #ruby
<ljarvis> Jeremy is seriously awesome
lolmaus_ has joined #ruby
<ljarvis> yorickpeterse: how are you customising them?
lolmaus has quit [Ping timeout: 256 seconds]
Macaveli has joined #ruby
tubuliferous_ has quit [Ping timeout: 276 seconds]
RandyT has quit [Ping timeout: 276 seconds]
doertedev has joined #ruby
RandyT has joined #ruby
eksperimental has joined #ruby
<eksperimental> i have gotten segmentation fualts with ruby. does anybody know to deal with this.. it has been since i have updated ruby
dionysus69 has joined #ruby
<adaedra> do a bug report
<apeiros> eksperimental: if you're using native extensions, they might be the cause
<apeiros> I'd try updating those first
<ljarvis> #nocontext
<adaedra> #hashtagsonirc
<apeiros> ?context eksperimental
<ruboto> eksperimental, Please add more context to your question, what are you doing, why are you doing it, which libraries are involved. Post some code to gist if it clarifies your question.
<apeiros> ljarvis: ^
<ljarvis> :(
<apeiros> ;-)
<apeiros> hey! we make it easy for you!
j416 has joined #ruby
<eksperimental> apeiros and ruboto: im running jekyll, im using the github-pages gem
<ljarvis> what ruby version?
<ljarvis> what other gems?
<ljarvis> what platform?
<apeiros> eksperimental: ruboto is a bot
* adaedra feeds ruboto bits
<eksperimental> ljarvis: i was using plain old ruby , and then I updated to rvm, to mimic github version
<apeiros> ?botsnack
<ruboto> nomnomnomnom
<[k-> jhass said some command that triggered an env dump
<ljarvis> yorickpeterse: delightful
<eksperimental> ljarvis: ubuntu 32bits, 14.10, no other gems (but github-pages depends on many gems)
sevenseacat has quit [Quit: Me dun like you no more.]
<ljarvis> eksperimental: what ruby version?
<apeiros> yorickpeterse: what's that? sequel?
<ljarvis> "plain old ruby" is not a version ;)
<[k-> delightful indeed
<[k-> so expressive!
<eksperimental> ljarvis: i was using 2.1.1
<eksperimental> but now it seems it has changed.... weird
<[k-> I read that as one_too_many tho
<eksperimental> /home/x/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/time.rb:672: [BUG] Segmentation fault at 0x646f727c // ruby 2.2.1p85 (2015-02-26 revision 49769) [i686-linux]
<ljarvis> eksperimental: try 2.2.2
<eksperimental> ljarvis: it was happening with 2.2.2
<shevy> apeiros that is now the third guy (eksperimental) who thinks that ruboto is a human rather than a bot
IanV0rn has joined #ruby
<Silex> shevy: that happens with all helper bots in all help channels
<[k-> we can't help it if ruboto is cute
<apeiros> shevy: yupp, I ponder adding a generic "I'm a bot, you don't need to address me" message when it's being addressed by a person the first time
IanV0rn has quit [Max SendQ exceeded]
<shevy> Silex I can't remember the same for eval-in in a similar timespan before
<apeiros> (and no command is matched)
hmnhf_ has joined #ruby
IanV0rn has joined #ruby
<shevy> perhaps the nick appears too human like :)
sandstrom has quit [Quit: My computer has gone to sleep.]
<Silex> shevy: yeah, "eval" bots are easier to recognize than "factoids" bots
OrbitalKitten has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
hmnhf_ has quit [Client Quit]
astrobun_ has quit [Ping timeout: 256 seconds]
<shevy> we have a cloaked ninja bot here
krz has quit [Read error: Connection reset by peer]
IanV0rn has quit [Max SendQ exceeded]
<eksperimental> ljarvis: i'm installing 2.2.2
dionysus69 has quit [Remote host closed the connection]
<ljarvis> eksperimental: "eksperimental> ljarvis: it was happening with 2.2.2"
<eksperimental> ljarvis: i haven't installed it before, i think it was 2.2.1
IanV0rn has joined #ruby
fabrice31_ has joined #ruby
<eksperimental> but look at my log, it's mixxing 2.2.0 with 2.2.1, coul that be the source of the segfault?
hmnhf has quit [Ping timeout: 250 seconds]
<bnagy> >> [0x64, 0x6f, 0x72, 0x7c].map(&:chr).join
<ruboto> bnagy # => "dor|" (https://eval.in/387455)
Scrofff has joined #ruby
IanV0rn has quit [Max SendQ exceeded]
<bnagy> this looks like an amusing bug :)
<eksperimental> this happened after i updated ruby to the latest version available from ubuntu, and then i installed rvm, but the problem persist
datanoise has joined #ruby
<ljarvis> eksperimental: no, 2.2.0 is just the directory name for all 2.2.x releases
sdothum has joined #ruby
astrobun_ has joined #ruby
IanV0rn has joined #ruby
<eksperimental> ljarvis: i see.
Iskarlar has joined #ruby
<ljarvis> yes it's stupid
IanV0rn has quit [Max SendQ exceeded]
aspiers has quit [Ping timeout: 272 seconds]
<eksperimental> i think it should be 2.2 or 2.2.x
IanV0rn has joined #ruby
Jackneill has joined #ruby
fabrice31 has quit [Ping timeout: 252 seconds]
Scroff has quit [Ping timeout: 272 seconds]
<bnagy> eksperimental: don't you get a stack trace when that happens?
decoponio has joined #ruby
khebbie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
scx_ is now known as scx
<bnagy> ie more than just the segfault message?
bluOxigen has quit [Ping timeout: 246 seconds]
<shevy> usually a segfault is a huge blob of text eksperimental
<eksperimental> shevy and bnagy: uploading it
datanoise has quit [Ping timeout: 246 seconds]
nobitanobi has joined #ruby
<shevy> I sometimes get segfaults when I use the ruby-gnome bindings
<eksperimental> it was working fin before
<eksperimental> i updated all packaged in ubuntu
<eksperimental> and now i get this problem.
maasha has joined #ruby
Bertg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
susmus_ has quit [Ping timeout: 264 seconds]
<bnagy> that looks like a jekyll bug to me
<bnagy> format string bug in strftime
pyo_ has joined #ruby
<[k-> but strftime is in time.rb
fabrice31_ has quit [Remote host closed the connection]
<bnagy> which method in time.rb is line 672 in your version?
<bnagy> s/is/contains
<[k-> obv strftime
<bnagy> [k-: why obviously?
<[k-> in `method`
<ljarvis> eksperimental: did you try 2.2.2?
<bnagy> it's a C func that's faulting
gccostabr has quit [Quit: ZZZzzz…]
<bnagy> probably more than one ruby method in time calls strftime, at a guess
phutchins has quit [Ping timeout: 272 seconds]
<yorickpeterse> apeiros: yeah
duncannz has quit [Ping timeout: 265 seconds]
<[k-> *derpface*
Scroff has joined #ruby
<eksperimental> ljarvis: just finished installing.. what is the procedure .. should i install bundlers? or the gems again
<adaedra> 9_6
<ljarvis> eksperimental: install everything again and try it with 2.2.2
Bertg has joined #ruby
<eksperimental> so.. what is everything?
<ljarvis> everything you need to run your program?
OrbitalKitten has joined #ruby
<yorickpeterse> in unrelated news, installing non MRI ruby on distros is a fkn pain in the butt
<[k-> did you mean which method is called?
sfarley has joined #ruby
ghostpl has quit [Remote host closed the connection]
<[k-> by line 672?
Scrofff has quit [Ping timeout: 246 seconds]
<ljarvis> yorickpeterse: lie
<bnagy> I mean which ruby method contains that line
<bnagy> I'm guessing iso8601
<[k-> it hasn't changed in 4 months
<eksperimental> now after installed bundler, i get "Could not find 'bundler' (>= 0) among 13 total gem(s) (Gem::LoadError)
<eksperimental> "
<[k-> no, this one is the actual one ^
<bnagy> sigh, my internet is too slow for github at the moment
<yorickpeterse> we've had this problem before where people install jruby on Poobuntu and it messes up "gem" and such
<ljarvis> yorickpeterse: oh.. I mean, I don't think "installing" them is hard.. making other shit work with them maybe
<eksperimental> should i install bundler via apt-get or gem?
<ljarvis> eksperimental: gem
<[k-> the method is: xmlschema
<eksperimental> ljarvis: ok, i did it with apt-get . should i remove that one then ?
<bnagy> bingo
<[k-> the line is: s << (utc? ? 'Z' : strftime("%:z"))
<bnagy> iso8601 is an alias for that
<[k-> it is?
<adaedra> “Poobuntu” :D
<bnagy> yeah. So my new bet is something something pygments failing, tries to log an error, bad call to iso8601 somehow
<[k-> I guessed something related to iso8601 in hangman
<bnagy> pygments looks pretty new, and it's posix shelling out to some python
<adaedra> :D
khebbie has joined #ruby
<bnagy> which seems like a good area to look for weirdness
iamninja has quit [Read error: Connection reset by peer]
al2o3-cr has quit [Read error: Connection reset by peer]
<bnagy> eksperimental: when you're upgrading and reinstaling everthing, also do same for python and pygments imho
oo_ has quit [Remote host closed the connection]
c0m0 has joined #ruby
husanu2 has joined #ruby
<bnagy> although it should vendor it for you, hopefiulully
<bnagy> thanks, lag
oo_ has joined #ruby
Bertg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ArchRogem has joined #ruby
Rickmasta has joined #ruby
<bnagy> there are two registers there that are ascii, which is usually hilarity
Iskarlar has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<bnagy> also, it looks like a 32 bit ruby. I don't know if that's important.
DoubleMalt has quit [Remote host closed the connection]
serivich has quit [Ping timeout: 272 seconds]
Bertg has joined #ruby
jlast has joined #ruby
oo_ has quit [Remote host closed the connection]
al2o3-cr has joined #ruby
senayar has quit [Remote host closed the connection]
CamonZ has joined #ruby
symm- has quit [Read error: Connection reset by peer]
terlar has joined #ruby
fabrice31 has joined #ruby
<shevy> hehe
chipotle has joined #ruby
<shevy> detective bnagy is on the case
husanu2 has quit [Remote host closed the connection]
husanu2 has joined #ruby
symm- has joined #ruby
<bnagy> actually, no, he's about to go for a run :)
oo_ has joined #ruby
andywww has joined #ruby
<andywww> hi, i’m trying to get my head around the concept of modules.. please can someone take a quick look at this code and let me know if i’m in the right ballpark?
jlast has quit [Ping timeout: 248 seconds]
OrbitalKitten has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
husanu2 has quit [Remote host closed the connection]
<[k-> you can use them like that
<[k-> those are what we call, mixins
<andywww> its not working though, its telling me: undefined method `handle_widget_a' for Tweet:Class
Iskarlar has joined #ruby
husanu1 has joined #ruby
<andywww> yeah i’m just reading about mixins now
lkba has joined #ruby
<[k-> does privates work on modules?
chipotle has quit [Ping timeout: 265 seconds]
<andywww> i’m not sure
<andywww> i’m not entirely sure i need to be using modules
<andywww> i just did so through familiarity with concerns on rails
husanu1 has quit [Remote host closed the connection]
<andywww> NoMethodError: undefined method ‘handle_widget_a’ for Tweet:Class
<andywww> though
<andywww> not entirely sure why
<andywww> it is include isn’t it, not extend?
unshadow has joined #ruby
<adaedra> both do different things
<andywww> with the ultimate aim of being able to accomplish line 45
<andywww> how might i change that code?
<shevy> andywww did you try to use extend yet
<andywww> i’m pretty sure I’m 99% there
lkba_ has quit [Ping timeout: 252 seconds]
<shevy> and you don't have an instance btw, you call a class method there:
<shevy> Tweet.handle_widget_a
OrbitalKitten has joined #ruby
<andywww> I’d like that to be a static method
<shevy> there is no static method in ruby
<[k-> I tried extend just now
<[k-> it didn't work
amerikkka has joined #ruby
<[k-> try class << self
oo_ has quit [Remote host closed the connection]
<andywww> well, okay I’d like to call it on the class
<andywww> rather than an instance of the class
<amerikkka> is there a better language than ruby?
<shevy> andywww, this works: http://pastie.org/10258198
nobitanobi has quit [Remote host closed the connection]
oo_ has joined #ruby
<shevy> amerikkka c-ruby!
<shevy> it is lightning fast
<amerikkka> what is cruby?
khebbie has quit [Ping timeout: 246 seconds]
Bertg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<adaedra> amerikkka: see first answer ruby-community.com/faq
<andywww> shevy: if i needed to have module Foo(s) and then have Foo1, Foo2 etc
Zai00 has quit [Quit: Zai00]
<andywww> but wanted Foo1 and Foo2 in different physical files
<andywww> source files even
<andywww> so pretty much: I need to include a module that includes a load of other modules and makes their functionality available
<shevy> amerikkka just the C part of ruby so you have all of C!
<shevy> andywww whether it is in one file or different ones makes no difference
<shevy> just load them all properly
<shevy> the pastie example already shows you how it works for one module and one class; just add more modules there? and once it all works, space it out into several separate files
<andywww> i was hoping i might be able to do it heirarchically so i didn’t have to litter my AR base class with includes of all the different modules
doertedev has quit [Ping timeout: 264 seconds]
<andywww> so effectively include them all in one ‘umbrella’ module, then include that in my class
<shevy> yeah
<andywww> but i can’t do that
<andywww> it seems
khebbie has joined #ruby
maxshelley has quit [Ping timeout: 250 seconds]
Xeago has joined #ruby
<shevy> andywww there. tested. it works. http://pastie.org/10258207
<shevy> a module and a class is functionally not that much of a difference by the way; you can use methods from both; you can use class methods as well, and you can use @ivars too in both
n008f4g_ has quit [Ping timeout: 256 seconds]
<shevy> I used to think that @ivars are only for classes
<andywww> AH
<andywww> it was the ‘self’ that was killing mine
<andywww> thanks for that
<shevy> I like self
shellie_ has quit [Ping timeout: 256 seconds]
<shevy> I tend to use: def self.foo more often than extend Name
slackbotgz has quit [Remote host closed the connection]
<shevy> it feels as if I am in more minute control when I specify exactly what I need, rather than just use everything globally
<shevy> (though only for extend... include is ok)
<andywww> I’m used to using self. for ‘static’ methods
<andywww> or class methods
<shevy> yeah I prefer that myself :)
<andywww> thats why i put it in the module
<andywww> but clearly thats not cricket
ndrei has quit [Ping timeout: 252 seconds]
<shevy> dunno... I rarely have a complicated use case where I need to combine many different modules in special ways
Bertg has joined #ruby
<shevy> I have some examples of a single method, in one module, and then I use include to extend a class with that
<shevy> like: include SaveFile, just because I don't want to write File.open with the block form
<andywww> mines due to learning rails before properly learning ruby
<shevy> aha
<shevy> I never got into rails :(
Mon_Ouie has joined #ruby
<andywww> need to put some time into learning the foundations really
sandstrom has joined #ruby
krz has joined #ruby
tvw has joined #ruby
ArchRogem has quit [Ping timeout: 265 seconds]
troulouliou_dev has quit [Remote host closed the connection]
al2o3-cr has quit [Ping timeout: 246 seconds]
amerikkka has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
<andywww> so, you can’t have private methods in modules
<andywww> makes sense really
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
andywww has left #ruby [#ruby]
yfeldblu_ has quit [Ping timeout: 248 seconds]
unshadow has quit [Quit: leaving]
thelastinuit has joined #ruby
juanpaucar has joined #ruby
IanV0rn_ has joined #ruby
IanV0rn has quit [Read error: Connection reset by peer]
IanV0rn_ has quit [Max SendQ exceeded]
IanV0rn has joined #ruby
<[k-> class << self failed too
Bertg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
IanV0rn has quit [Max SendQ exceeded]
nettoweb has joined #ruby
Musashi007 has quit [Quit: Musashi007]
al2o3-cr has joined #ruby
Scroff has quit [Remote host closed the connection]
jacor has joined #ruby
al2o3-cr has quit [Client Quit]
al2o3-cr has joined #ruby
juanpaucar has quit [Ping timeout: 256 seconds]
<[k-> (regarding extend didn't work, I used it on the original code plus a line at the end Tweet.extend(WigetHandlerA))
<shevy> class << self is weird
Scroff has joined #ruby
<shevy> the << always trips me up
<shevy> in that context
<shevy> my brain expects an uppercase constant
<apeiros> I got to go in a minute, but I sense confusion regarding modules and class methods
<shevy> bye apeiros!!!
<apeiros> extend adds the *instance methods* of a module *as class methods*
<apeiros> include/extend *never* add class methods of a module
IanV0rn has joined #ruby
<apeiros> I hope that generic piece of knowledge helps with the problem at hand :)
Miron has quit [Ping timeout: 252 seconds]
<apeiros> if not, I'm back in an hour or so :D
<[k-> thxies
* [k- waves
Iskarlar has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jcaho has quit [Ping timeout: 265 seconds]
* shevy waves goodbye to [k-
OrbitalKitten has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<shevy> btw [k- are you actually writing anything serious in ruby? :D
slackbotgz has joined #ruby
<[k-> no.
skade has quit [Quit: Computer has gone to sleep.]
<[k-> I was waving to apeiros
<[k-> but are you leaving shevy?
skade has joined #ruby
<shevy> [k- never
<shevy> I idle to power here
Macaveli has quit [Quit: Textual IRC Client: www.textualapp.com]
<shevy> if I am offline, it is either because my computer crashed or because I set the computer up anew, right now I am on some weird kubuntu thing (don't ask...)
krz has quit [Read error: Connection reset by peer]
Pathfinder has joined #ruby
IanV0rn has quit [Client Quit]
bkxd_ has joined #ruby
IanV0rn has joined #ruby
shredding has quit [Remote host closed the connection]
IanV0rn has quit [Max SendQ exceeded]
OrbitalKitten has joined #ruby
IanV0rn has joined #ruby
axilla has joined #ruby
ndrei has joined #ruby
elia has quit [Quit: Computer has gone to sleep.]
scripore has joined #ruby
zz_Outlastsheep is now known as Outlastsheep
JERKOPS has joined #ruby
<JERKOPS> i'd liek to pwn sum fagz by makeing a rat in ruby is that possible?
<yorickpeterse> what?
<JERKOPS> can you maek a rat in ruby?
<yorickpeterse> what's that in English?
<JERKOPS> rat = tool that lets you controll the computer of another user without them knowing
<yorickpeterse> and you want to do this to "pwn sum fagz"
<JERKOPS> ya
<yorickpeterse> have you tried http://google.com?
<JERKOPS> no
<JERKOPS> google does not work
<shevy> JERKOPS lol are you aiming against jhass again?
<yorickpeterse> but you haven't tried it?
<jhass> !mute JERKOPS
<yorickpeterse> lol
<shevy> this is popcorn worthy :)
<[k-> no longer~
<yorickpeterse> well, it's just a /nick away
<shevy> he'll be back again one day!
<yorickpeterse> or well, a change of username
shellie_ has joined #ruby
<yorickpeterse> either way
ghostpl has joined #ruby
<yorickpeterse> I wonder why some are so hell bent on using terribly broken English
<yorickpeterse> lol m8 l33t is so kewl
<yorickpeterse> ^ probably valid in the UK
<_mh_> That one's a regular?
<adaedra> Don't know if it's him
<shevy> dunno
serivich has joined #ruby
<adaedra> But yes, remembers me someone
<shevy> UK has more style now don't they
al2o3-cr has quit [Quit: WeeChat 1.2]
al2o3-cr has joined #ruby
<jhass> lol
krz has joined #ruby
<jhass> 13:06 <JERKOPS> . /msg NickServ VERIFY REGISTER JERKOPS wdxrjnoqkdnx
diegoviola has joined #ruby
<adaedra> :D
<yorickpeterse> at least it's not hunter2
balazs has joined #ruby
<yorickpeterse> I mean *******
<_mh_> hahaha
pyo_ has quit []
rodfersou has joined #ruby
<eksperimental> hi guys. sorry i had to leave, shevy and ljarvis
<eksperimental> it is still having the same problem, but every time i get a different error
ghostpl has quit [Ping timeout: 272 seconds]
<eksperimental> *** Error in `ruby /home/x/.rvm/gems/ruby-2.2.2/bin/jekyll serve': free(): invalid next size (fast): 0x0a82bf28 ***
Alina-malina has quit [Read error: Connection reset by peer]
oo_ has quit [Remote host closed the connection]
<eksperimental> and then I got: ruby /home/x/.rvm/gems/ruby-2.2.2/bin/jekyll serve: malloc.c:2372: sysmalloc: Assertion `...
<eksperimental> should i uninstall everything and start again
<eksperimental> ?
ghostpl has joined #ruby
Alina-malina has joined #ruby
bruno- has joined #ruby
balazs has quit [Ping timeout: 265 seconds]
codecop has quit [Remote host closed the connection]
<bnagy> so still looks like jekyll
<bnagy> I wonder if you've got a bad binary gem or something
<mikecmpbll> does anyone know of a decent guide/run-down of thread safety rules or common mistakes for ruby libaries?
<bnagy> eksperimental: imho uninstall reinstall from source
<mikecmpbll> want to be more aware of this stuff seeing as everyone always complains most ruby libraries aren't threadsafe.
<eksperimental> gnagy, so...
fabrice31 has quit [Remote host closed the connection]
<mikecmpbll> (when writing my own)
fabrice31 has joined #ruby
<eksperimental> one question, is there any conflict having rvm and ruby installed from ubuntu repos?
<bnagy> mikecmpbll: MRI has the GIL/GVL
<flughafen> mikecmpbll: what do you want to do?
<bnagy> so really it's C extensions that might not be threadsafe, or bindings to C libs
<[k-> doesnt that mean it is threadaafe
<bnagy> jruby uses real threads but java-ishly
<mikecmpbll> flughafen: i want to know whether the code i'm writing is thread safe, and be aware of any patterns that i'm using that aren't threadsafe
<flughafen> what are you threading
<mikecmpbll> bnagy: i know that, like [k- said it doesn't mean the code isn't threadsafe
<mikecmpbll> flughafen: i'm not threading anything, but people using my libraries might be
<[k-> mikecmpbll you misread
<mikecmpbll> is* threadsafe
jlast has joined #ruby
<bnagy> if you're not a C extension you almost certainly don't need to worry
<[k-> you misread
<mikecmpbll> ok.
<flughafen> gil = global interpreter lock, only 1 thread runs even when using threading.
<bnagy> if you're threading from ruby then Queue and Mutex do almost everything you need
JERKOPS has left #ruby [#ruby]
<mikecmpbll> ok cool. so i don't have to worry whether my ruby gem will run in jruby or not unless i'm using a c lib?
dgutierrez1287 has joined #ruby
<mikecmpbll> flughafen: i know what the GIL is.
<[k-> dun dun dun
<bnagy> right, and if you're using native Cexts you will probably have trouble under jruby anyway
<jhass> uh, the GVL/GIL guarantees that there's no corruption in the data structures Ruby core provides, that's pretty much it
<bnagy> if you're using Thread from ruby you can still get yourself into trouble
<jhass> it's still quite easy to write thread unsafe code
<bnagy> but that's why they have those primitives
<bnagy> jhass: but quite hard if you don't use Thread
<jhass> if you don't use Thread you don't have a multi threaded application ?!
<jhass> doesn't mean your code is thread safe
<mikecmpbll> lol :/
tubuliferous_ has joined #ruby
<yorickpeterse> module Whatever; def self.foo; @foo ||= []; end; end
<yorickpeterse> ^ no threads, still not thread safe
<[k-> wait, if you don't use threads, your code could still be unsafe?
<mikecmpbll> yorickpeterse: thank youuu, that's the kinda thing i'm thinking about
<bnagy> it could be unsafe if other people thread it
<yorickpeterse> The code itself can be unsafe yes, it just happens to never be a problem due to the GIL
<[k-> oh *duh*
<yorickpeterse> (or very rarely at least)
<jhass> [k-: yes, you just don't see any of the bugs coming from that until it's used in a multi threaded application
jlast has quit [Ping timeout: 252 seconds]
<[k-> but that is idiomatic Ruby!
<bnagy> not-threadsafe is not the same as 'going to cause real life problems'
<mikecmpbll> so my original question was is there any explanation of the kind of things that yorickpeterse just gave an example of
<mikecmpbll> or do i just need to be on the ball
<yorickpeterse> mikecmpbll: any form of shared mutable state without any locking/synchronization is not safe
<mikecmpbll> i want to write code that people can use safely in concurrent applications.
<yorickpeterse> that includes simple things such as two threads pushing a value into an array
<yorickpeterse> and one reading from it
<bnagy> imho if you're not threading and you write your objects so they're not tempting to use across threads you should be OK
x44x45x41x4E has quit [Ping timeout: 248 seconds]
<mikecmpbll> bnagy: ... yorickpeterse just described an example where you wouldn't be ok
tkuchiki has quit [Remote host closed the connection]
<bnagy> if you write one mega-object where a bad user will access it from two threads you have issues
<mikecmpbll> yorickpeterse: thanks i'll bear that in mind.
<yorickpeterse> size of the object is not relevant
tubuliferous_ has quit [Ping timeout: 250 seconds]
tkuchiki has joined #ruby
<yorickpeterse> if you keep everything specific to instances you can already save yourself the bulk of the problems
<bnagy> mikecmpbll: I'm not sure you're reading us right, because I don't think yorickpeterse and I are really saying different things
<yorickpeterse> if you must share data, either lock or copy the data as a whole
<mikecmpbll> bnagy: i think you are
<yorickpeterse> or use some kind of atomic datastructure (https://github.com/ruby-concurrency/concurrent-ruby is a good Gem for all this)
elia has joined #ruby
<mikecmpbll> yorickpeterse: awesome, ta.
<bnagy> if you write 'normal' objects then those will likely be OK. They will be unsafe if used across threads.
<bnagy> but that's blame the yser
<yorickpeterse> https://github.com/YorickPeterse/oga/blob/master/lib/oga/lru.rb <- example of stuff that uses locks for safety
<ta> mikecmpbll!
<[k-> how to write threadsafe code: go functional
<yorickpeterse> [k-: you can write unsafe code in functional languages
jackjackdripper has joined #ruby
<bnagy> you don't want to write every object so that it's threadsafe if misused
<mikecmpbll> ta: i'm gunna highlight you a lot for having that name :p
<bnagy> because it will be overengineered
jackjackdripper has quit [Client Quit]
<ta> but.. its my initials..
<mikecmpbll> bnagy: when i want to write code that i want to be able to be used by concurrent applications ..
<[k-> go functional != use imperative code in functional languages
<mikecmpbll> ta: it also means 'thanks' in UK
<bnagy> then you write an API that has objects that don't share state
tkuchiki_ has quit [Ping timeout: 250 seconds]
<bnagy> and you're done
<mikecmpbll> so .. threadsafe
<bnagy> not explicitly, no
Soda has joined #ruby
<bnagy> because if a user does access one of them from multiple threads it's not safe
Xeago has quit [Remote host closed the connection]
<mikecmpbll> maybe there's a semantic issue with the way i'm using the term threadsafe, that's probably my mistake
Xeago has joined #ruby
<bnagy> but if you build Queue and Mutex into every single object for access to every @ivar it's a bad idea
<ta> mikecmpbll: never fully understood how ta could be short for "thanks" or "thank you".. shouldn't it be "ty"? :)
<mikecmpbll> ta: it's not an acronym!
pansophical has joined #ruby
tkuchiki has quit [Ping timeout: 265 seconds]
dionysus69 has joined #ruby
<mikecmpbll> it's pronounced "tah" or "tar" :)
rubie has joined #ruby
<ta> oh
<yorickpeterse> bnagy: there's nothing that will "overengineer" things when making objects thread safe
<pansophical> could somebody explain the following line (syntax-wise):
<pansophical> opt_parser = OptionParser.new do |opts|
<bnagy> mikecmpbll: eg one of the javascript scraper things used to be unsafe because even if you instantiated one per thread it would still break
skade has quit [Quit: Computer has gone to sleep.]
<yorickpeterse> Prematurely locking is a problem yes, but you can make things thread-safe without that
<bnagy> that's bad
<yorickpeterse> or without really putting any effort into it in the first place
<bnagy> but writing so it's safe even when misused is not idiomatic ruby
<ljarvis> pansophical: it's an assignment to a new instance of OptionParser of which takes a block
<ta> mikecmpbll: might I suggest "tah" or "tar" then ;)
Igorshp has joined #ruby
<yorickpeterse> bnagy: what?
pontiki has joined #ruby
<pansophical> ljarvis: a block as a parameter?
<yorickpeterse> bnagy: I think you're confusing making something thread-safe with prematurely locking and such
<yorickpeterse> the two are very different
endash has joined #ruby
<mikecmpbll> ta: i prefer to spell words correctly, but i'll try and use "thanks" instead, just for you ;)
<yorickpeterse> also I hate merge conflicts
<bnagy> I don't think I am
<yorickpeterse> especially if they involve dozens of commits
zotherstupidguy has joined #ruby
ledestin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<ljarvis> pansophical: blocks are special in Ruby, but you can think of it much like a parameter
<ddv> more like closures
<pansophical> thank you ;)
<ta> mikecmpbll: sorry, didn't know "ta" was an actual word (I'm danish) - it is not really a problem, but thanks :)
ndrei has quit [Ping timeout: 246 seconds]
<mikecmpbll> ta: heh, no probs, i shall avoid it
rubie has quit [Ping timeout: 265 seconds]
<adaedra> poor ta
<ljarvis> ta: us brits say ta a LOT
<ta> I've noticed .)
Hounddog has quit [Remote host closed the connection]
<[k-> ahhhh you are missing an eye!
* [k- hands ta a .
<ta> left eye was shut actually
vivab0rg has joined #ruby
<ta> cause I was winking at you
gaucheph has quit [Ping timeout: 244 seconds]
<[k-> you should use ;) instead
<[k-> but the right eye was the one that is missing
<adaedra> maybe it's a danish smiley
TheHodge has quit [Quit: Connection closed for inactivity]
vivab0rg has quit [Remote host closed the connection]
gaucheph has joined #ruby
DoubleMalt has joined #ruby
<[k-> I bring you a big word today: homoiconicity
fgo has joined #ruby
<hectortrope> )
<adaedra> noooo an unbalanced parenthesis
<adaedra> we're doomed
<hectortrope> Nope I am blind
<pontiki> this is not #lisp
<adaedra> I was going to link that
<DylanJ> but it was posted in the wrong order.
<DylanJ> ddv: you're making things worse.
<ddv> I guess
<adaedra> we're dooomed
<pontiki> we're ddooooooommmeeed!
Igorshp has quit [Remote host closed the connection]
<DylanJ> /etc/init.d/earth stop # only solution
fantazo has quit [Quit: Verlassend]
<yorickpeterse> (doomed)
<adaedra> the horror!
Zai00 has joined #ruby
<[k-> have you considered my nick
<adaedra> systemctl stop earth
<adaedra> [k-: I give it a K
<[k-> My favourite letter!
<jhass> systemctl isolate adeadra
<[k-> lol
<[k-> adeadra
<jhass> (yes that's a valid command :P )
<ddv> systemctl disable jhass
<adaedra> jhass: you need a ^T
<diegoviola> wow 1023 nicks here, when did we get so many people?
<[k-> we merged with #ruby-lang
<adaedra> soon 1Ki nicks
<diegoviola> [k-: I know :p
<[k-> ‹i know›
<diegoviola> nobody knows anything
<[k-> « another unbalanced bracket
<adaedra> this I can help with
<adaedra> »
<diegoviola> so return can't be called from main because there's nothing to return to?
<[k-> it would take 2²²²² days to resolve them all
<adaedra> diegoviola: main = global scope?
<pontiki> so does someone have to go back and close all the brackets [k- has opened?
senayar has joined #ruby
gaucheph__ has joined #ruby
<[k-> »›” you'll never be done
<diegoviola> what about break or exit then?
<adaedra> exit is fine in the global scope
<diegoviola> and break is mostly to break out of a loop?
<[k-> what do you mean by main
<adaedra> yes
<diegoviola> ok ty
<adaedra> exit stops program execution from anywhere
<adaedra> return from a method
ndrei has joined #ruby
<[k-> not if you inherited from BasicObject only
<adaedra> why would you do that
<[k-> I don't know!
<[k-> to write a threadsafe Ruby from scratch?
gaucheph has quit [Ping timeout: 248 seconds]
<adaedra> wut
TheHodge has joined #ruby
Zai00 has quit [Ping timeout: 255 seconds]
DoubleMalt has quit [Remote host closed the connection]
mdw has joined #ruby
sgambino has joined #ruby
<jhass> diegoviola: it's simply, return returns a value from the current method (= there's none in main hence you can't call it), break returns a value from the method calling the current block (= it only works inside a block), next returns a value from the current block (= it only works inside a block), all three default to nil for the value if you give none
eksperimental has quit [Ping timeout: 264 seconds]
<diegoviola> jhass: thanks
<diegoviola> I see
DoubleMalt has joined #ruby
<[k-> you can't return from a proc
<diegoviola> ok
<[k-> it gives you a localjumperror
<diegoviola> and from a lambda?
<adaedra> er, you can under some conditions, in fact
<diegoviola> well a lambda is just a proc, no?
<jhass> okay, granted, proc / lambda semantics complicate it a bit
<adaedra> >> def foo; loop { return 3 }; end; foo
<ruboto> adaedra # => 3 (https://eval.in/387514)
<jhass> lambda should have the same semantics as being inside a method iirc
Papierkorb has joined #ruby
<jhass> proc has the same semantics as a block actually
centrx has joined #ruby
phutchins has joined #ruby
ndrei has quit [Ping timeout: 246 seconds]
RegulationD has joined #ruby
hck89 has joined #ruby
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
iamninja has joined #ruby
gaucheph has joined #ruby
<[k-> >> def foo; p = proc { return 3 }; p.call ; p('test'); end; foo
<ruboto> [k- # => 3 (https://eval.in/387523)
<[k-> as you can see, p('test') is never reached
gaucheph__ has quit [Ping timeout: 248 seconds]
<jhass> note that returns from the defining scope
<[k-> oh so that's why
<jhass> >> def foo(pr); pr.call; end; def bar; foo(proc { return 1 }); puts "hi"; end; bar
phutchins has quit [Ping timeout: 244 seconds]
<ruboto> jhass # => 1 (https://eval.in/387524)
Iskarlar has joined #ruby
RegulationD has quit [Ping timeout: 248 seconds]
joonty has quit [Quit: joonty]
sophiedeziel has quit [Remote host closed the connection]
Zai00 has joined #ruby
livathinos has joined #ruby
langland_ has joined #ruby
gaucheph__ has joined #ruby
akkad has quit [Excess Flood]
langlands has quit [Ping timeout: 252 seconds]
sfarley has quit [Remote host closed the connection]
gaucheph has quit [Ping timeout: 255 seconds]
[k-_ has joined #ruby
akkad has joined #ruby
Igorshp has joined #ruby
inoic has joined #ruby
skade has joined #ruby
<maloik> Is anyone up to speed on apple developments? Are there any new macbook air's coming out in the next few months, say before october or so?
n008f4g_ has joined #ruby
Iskarlar has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
alkan has joined #ruby
Soda has quit [Remote host closed the connection]
<alkan> ne ayaksınız lan siz
<jhass> ?ot maloik
<ruboto> maloik, this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
<flughafen> is there anyway to not launch a browser with debugging with poltergeist?
<alkan> alayınızın amına korum lan
<jhass> alkan: this channel is English only, I'm sorry
<alkan> hey shat up
<jhass> !mute alkan
jlast has joined #ruby
scripore has quit [Quit: This computer has gone to sleep]
Aswebb_ has joined #ruby
<[k-_> lel
hck89 has quit [Quit: Textual IRC Client: www.textualapp.com]
<flughafen> he probably meant whats up?
Soda has joined #ruby
<yorickpeterse> that would be quite teh typo
<yorickpeterse> heh
<yorickpeterse> heh
<[k-_> benefit of doubt?
hck89 has joined #ruby
<jhass> have fun with google translate and join #ruby-banned if you want to discuss
<[k-_> i *can* make typos like this...
failshell has joined #ruby
<ddv> #ruby-banned.exists?
<ddv> nice
<centrx> maloik, They usually release a lot in the Fall/September/October, but that might be their software cycle, not sure about the hardware cycle
failshell has quit [Client Quit]
quimrstorres has quit [Remote host closed the connection]
<[k-_> google detects that it is inglish
<[k-_> english*
charliesome has joined #ruby
alkan has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
Iskarlar has joined #ruby
<[k-_> ddv: that's a comment, the code wont work
jlast has quit [Ping timeout: 272 seconds]
<jhass> !unmute alkan
<ddv> [k-_: that is the point of a comment
phutchins has joined #ruby
bubbys has joined #ruby
<[k-_> is that the point of your comment tho?
Igorshp has quit [Remote host closed the connection]
pyo_ has joined #ruby
<[k-_> oh it's turkish! silly google
<ddv> [k-_: should you be in the haskell channel instead of here?
<flughafen> [k-_: i knew that ;)
Igorshp has joined #ruby
Igorshp has quit [Remote host closed the connection]
<[k-_> ddv: is there a problem with me?
<[k-_> i am in both channels
<yorickpeterse> ok, lets try dvorak for the day
inoic has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<yorickpeterse> this will be fun
<maloik> define fun
<[k-_> since this is off-topic, feel free to pm me
<yorickpeterse> painful and full of agony
<maloik> :D
<jhass> dvorak is still only two layers though, right?
<jhass> or three
<jhass> yeah, so three
<jhass> there's a nice german one with 6 http://www.neo-layout.org/ (klick on Ebene 1-6)
<jhass> er, click
<yorickpeterse> at least the a is at the same place
<yorickpeterse> also that took me forever to type
Pluto1010 has joined #ruby
x44x45x41x4E has joined #ruby
<ddv> I highly doubt dvorak will make me type faster with 30 years of qwerty experience
Scrofff has joined #ruby
<yorickpeterse> only one way to find out
luzidco has joined #ruby
Igorshp has joined #ruby
* flughafen should try out different layouts now that i have a fancy blank keyboard
djellemah_ has joined #ruby
<ddv> that was not possible with a non blank keyboard flughafen?
<flughafen> it is. but it's weird if i'm looking at the keybboard
<jhass> I agree it makes it easier
<Outlastsheep> flughafen: are you going to sticker it manually when you find a nice layout?
<jhass> flughafen: try neo 2, layer 3 is awesome for programming, in theory
Scroff has quit [Ping timeout: 246 seconds]
<flughafen> Outlastsheep: no, my keyboard has a sorta-weird layout now, i have an image of it, that'll i reference if i get lost. but it's qwerty. but it didn't take my longer than a few days to figure it out
<Outlastsheep> Everything's all dandy and great in theory :P
gaucheph has joined #ruby
<flughafen> i never look at the image since a few days after i had it.
<Outlastsheep> Oh, I already type blind mostly anyway. Blank layout wouldn't hurt to me.
hck89 has quit [Quit: Textual IRC Client: www.textualapp.com]
<flughafen> jhass: i'll look it up, is that what you're using?
senayar has quit [Remote host closed the connection]
<jhass> I tried to learn neo 2 like three times now, but I look too much at the letters subconsciously for it to stick ...
<jhass> should try again though
<flughafen> Outlastsheep: yeah, me too. but, ifi'm not hitting the right key, my first reaction is to look down.
hck89 has joined #ruby
senayar has joined #ruby
<Outlastsheep> flughafen: same here.
<Outlastsheep> That's my que to go, crap.
<Outlastsheep> Seeya all.
djellemah has quit [Ping timeout: 252 seconds]
<flughafen> later
<flughafen> jhass: what kind of keyboard do you use?
<jhass> standard laptop inbuilt
Outlastsheep is now known as zz_Outlastsheep
gaucheph__ has quit [Ping timeout: 248 seconds]
<flughafen> this is my layout: https://i.imgur.com/n41iBwH.jpg qwerty, but with a few changes of control, capslock and so on
husanu2 has joined #ruby
tomphp_ has joined #ruby
juanpaucar has joined #ruby
senayar has quit [Remote host closed the connection]
<pontiki> ooooo your keyboard has a "fun" key!!
<tobiasvl> funky
<pontiki> "we put the fun in computing!"
husanu2 has quit [Remote host closed the connection]
<flughafen> pontiki: jhass [k-_ i should map the "fun" key to debot: !hangman
acke has joined #ruby
husanu5 has joined #ruby
<pontiki> totally
<[k-_> DeBot only responds to DeBot
husanu5 has quit [Remote host closed the connection]
tomphp has quit [Ping timeout: 246 seconds]
<flughafen> well, we should bribe jhass with cookies
* [k-_ looks at source code
husanu1 has joined #ruby
ghostpl has quit [Remote host closed the connection]
<_mh_> bribes in cookies. Everybody got their kryptonite, I suppose.
<flughafen> _mh_: have you had german lebkuchen?
mdw has quit [Remote host closed the connection]
<_mh_> flughafen: sure, I have them every winter.
aryaching has joined #ruby
husanu1 has quit [Remote host closed the connection]
juanpaucar has quit [Ping timeout: 264 seconds]
quimrstorres has joined #ruby
<flughafen> that's everybody's kryptonite
<_mh_> the right ones? oh yes.
husanu4 has joined #ruby
Bertg has joined #ruby
pontiki has quit [Quit: <poit>]
<flughafen> yeah, not the shitty ones, that are like 8 for 1euro, but good oens
IanV0rn has quit [Ping timeout: 255 seconds]
<flughafen> there is a really good place that is open only from septembter to january and that's all they sell is lebkuchen, it's right around the corner from my work
<flughafen> sweet lifecakes
startupality has joined #ruby
senayar has joined #ruby
Iskarlar has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
senayar has quit [Changing host]
senayar has joined #ruby
<_mh_> flughafen: our office orders a big round in november. It's literally impossible to walk past the box when it's there.
aspiers has joined #ruby
<_mh_> flughafen: and damn, now I want lebkuchen in June...
<flughafen> there is a place in nurnberg, in the altstadt that sells good lebkuchen year round
husanu4 has quit [Remote host closed the connection]
<flughafen> ik can't remember the name, not kebkuchenschmidt,
joonty has joined #ruby
<ddv> !ot
<ddv> as you can see I never use the bots in here
nertzy has joined #ruby
<flughafen> ?ot
<ruboto> this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
husanu2 has joined #ruby
<flughafen> ?ot ddv
<ruboto> ddv, this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
<yorickpeterse> ok meh dvorak
<ddv> :)
<yorickpeterse> some keys are at really weird spots
<yorickpeterse> lets try workman
<flughafen> ?ot yorickpeterse
<ruboto> yorickpeterse, this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
<yorickpeterse> oh come on
<flughafen> haha, i command the power!
<[k-_> ?ot ruboto
<ruboto> ruboto, this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
djellemah__ has joined #ruby
<flughafen> can someone ban rubuto?
<[k-_> speaking about offtopic is offtopic!
<ddv> even using the command can be considered offtopic
<centrx> I thought #ruby was all-purposes!
artmann has quit [Quit: http://quassel-irc.org - Chatta smidigt. Överallt.]
husanu2 has quit [Remote host closed the connection]
<centrx> Where else can I speak so freely about PHP!?
artmann has joined #ruby
<[k-_> kek
<centrx> is flughafen a spamtroll
devdazed has quit [Quit: Computer has gone to sleep.]
<[k-_> OMY
charliesome has quit [Quit: zzz]
<[k-_> such accusation!
<[k-_> flughafen is a full-fledge member of #ruby!
<flughafen> centrx: i have some medication to sell you through my dead family members in nigeria that need you to inherit there money or else it'll get taken away by the government
husanu1 has joined #ruby
mdw has joined #ruby
<centrx> Sign me up! Is there a web API I can use to access my account?
<flughafen> yes, i just need your bank account info, original copy of your birth certificate, and passport
<ebarrett> am i right in thinking you can't access variables in the outer scope without declaring them global?
djellemah_ has quit [Ping timeout: 244 seconds]
gaucheph__ has joined #ruby
<ebarrett> or without using a closure...
<[k-_> no
<centrx> ebarrett, Use objects, not global
doertedev has joined #ruby
<flughafen> ebarrett: my father, the king of europe has died. and he had 3 million outer scope variables that we can't keep here.
kies has quit [Ping timeout: 272 seconds]
husanu1 has quit [Remote host closed the connection]
<[k-_> >> a = "hello"; class B; def hello; p a; end; B.new.hello
<ruboto> [k-_ # => /tmp/execpad-7f50b96dbd52/source-7f50b96dbd52:7: syntax error, unexpected end-of-input, expecting ke ...check link for more (https://eval.in/387549)
<[k-_> >> a = "hello"; class B; def hello; p a; end; end; B.new.hello
<ruboto> [k-_ # => undefined local variable or method `a' for #<B:0x412a3f78> (NameError) ...check link for more (https://eval.in/387550)
husanu3 has joined #ruby
<[k-_> thats weird
<jhass> it's not
<jhass> _local_ variables
<[k-_> ._.
<jhass> not randomly into other scopes cascading variables
<[k-_> doesnt ruby cascade if it cant find a variable
gaucheph has quit [Ping timeout: 248 seconds]
<centrx> You're thinking of BASIC
Pluto1010 has quit [Quit: Leaving...]
<ebarrett> so i gess ruby doesn't do lexical scoping.. hrm
<centrx> ebarrett, Might be clearer if you provided a code example
aspiers has quit [Ping timeout: 246 seconds]
chinmay_dd has quit [Remote host closed the connection]
Xeago has quit [Remote host closed the connection]
kp666 has quit [Remote host closed the connection]
Xeago has joined #ruby
husanu3 has quit [Remote host closed the connection]
<ebarrett> centrx: e.g. in python: https://gist.github.com/vext01/b30ac87ef654e4c6f8e6
que__ has joined #ruby
<centrx> Yeah scoping doesn't work like that in Ruby
husanu1 has joined #ruby
<ebarrett> x is not global in this case, it's in module scope
Scroff has joined #ruby
JDiPierro has joined #ruby
Iskarlar has joined #ruby
<centrx> ebarrett, actually, if you do @x = 1 then it would work
husanu1 has quit [Remote host closed the connection]
<que__> i wanna make regexp and choose next word after match $' i saw this as use. but when i test it on https://repl.it/languages/Ruby it gives me nil .
langland_ has quit [Ping timeout: 256 seconds]
endash has quit [Quit: endash]
<que__> is $` soped beeing used ?
husanux0 has joined #ruby
<centrx> ebarrett, as the top-level object is a special object called "main", @x = 1 would define an instance variable on it which would be accessible in the methods
sanguisdex has quit [Quit: Leaving.]
<ebarrett> centrx: ah ha
<al2o3-cr> >> "foo bar baz".match /bar/; [$`, $']
<ruboto> al2o3-cr # => ["foo ", " baz"] (https://eval.in/387561)
<jhass> que__: please share your attempt and sample input via rubular.com (click make permalink)
chinmay_dd has joined #ruby
Iskarlar has quit [Client Quit]
kobain has joined #ruby
Scrofff has quit [Ping timeout: 252 seconds]
<que__> is paste ofcode ok ?
yardenbar has quit [Quit: Leaving]
scripore has joined #ruby
<centrx> Never heard of it before, but it looks super cool
Pathfinder has quit [Ping timeout: 272 seconds]
langlands has joined #ruby
dblessing has joined #ruby
Scrofff has joined #ruby
RegulationD has joined #ruby
Pupeno_ has joined #ruby
konsolebox has quit [Read error: Connection reset by peer]
<[k-_> Note: str =~ regexp is not the same as regexp =~ str. Strings captured from named capture groups are assigned to local variables only in the second case.
<que__> the aaa is simulation of a readed file.
Scroff has quit [Ping timeout: 264 seconds]
JakFrist has joined #ruby
<[k-_> $` is before match, $' is after match
Pupeno has quit [Ping timeout: 246 seconds]
<[k-_> kinda like partition >.>
<pansophical> how to check if a string is in a string "array" like structure
<yorickpeterse> hm, workman layout is not that bad
<centrx> pansophical, Can you be more specific?
nertzy has quit [Quit: This computer has gone to sleep]
<[k-_> centrx++ coolness over 9000!
gaucheph has joined #ruby
<yorickpeterse> _very_ slow at the moment though
sanguisdex has joined #ruby
hck89 has quit [Ping timeout: 276 seconds]
husanux0 has quit [Remote host closed the connection]
<que__> [k-_: so i shold change the place ?
hck89_ has joined #ruby
dgutierrez1287 has quit [Remote host closed the connection]
ghostpl has joined #ruby
<[k-_> try it
<pansophical> centrx: possibly but i'm not entirely familiar with ruby and i *will* sound hilarious likely, a parameter is passed by console and we have to check for validity from a list of possible values..
<centrx> I'm already laughing hysterically!
<pansophical> see? ;)
<ddv> yet another sysadmin who doesn't understand ruby because they use puppet?
<[k-_> pansophical: i dont understand your question
Channel6 has joined #ruby
<mikecmpbll> pansophical: possible_values.include?(actual_value)
RegulationD has quit [Remote host closed the connection]
RegulationD has joined #ruby
<mikecmpbll> (where possible values is an array)
<[k-_> ah, suddenly it sounds so clear!
dionysus69 has quit [Ping timeout: 256 seconds]
gaucheph__ has quit [Ping timeout: 265 seconds]
<pansophical> mikecmpbll: thank you mate ;)
<que__> [k-_: still nothing
<pansophical> interesting how for some the question is ill-defined and for others not so..
<pansophical> different parsers i guess..
charliesome has joined #ruby
<[k-_> que__: try regex.match
icosa1 has quit [Read error: Connection reset by peer]
husanux1 has joined #ruby
<[k-_> pansophical: we come from different backgrounds ;-;
_blizzy_ has joined #ruby
<[k-_> we interpret things differently
havenwood has joined #ruby
husanux1 has quit [Remote host closed the connection]
acovrig has joined #ruby
mattarse has joined #ruby
scripore has quit [Quit: This computer has gone to sleep]
<acovrig> how would I get a nested element’s parent div’s ID in nokogiri?
bigkevmcd has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ljarvis> acovrig: el/../div
bigkevmcd has joined #ruby
codecop has joined #ruby
griffindy has joined #ruby
husanux4 has joined #ruby
tubuliferous_ has joined #ruby
<acovrig> I.E. div div ul li a (I’m iterating through the “a”s), I’m thinking elem.parent.parent.parent.parent.attrib(‘id’) but I get nothing
<que__> [k-_: thx. is there other $' like options to take just take one word on the right ?
<acovrig> ljarvis: el?
<ljarvis> acovrig: yes I didn't know what your element was
<ljarvis> acovrig: ./ancestor::div maybe
<[k-_> que__, you could use capture groups
<ljarvis> acovrig: either way I would use xpath and not css for this
Iskarlar has joined #ruby
* acovrig looks up xpath
<jhass> acovrig: I think you just have a .parent too much
tomphp has joined #ruby
<acovrig> ljarvis: do you think I would be able to look for a parent div that has an id that ends with “-wrapper”?
<jhass> or maybe too few?
<jhass> or xpath, yeah
whippythellama has joined #ruby
psy__ has quit [Ping timeout: 252 seconds]
<jhass> "./ancestor::div[endwith(@id, '-wrapper')]" or whatever the function was
<ljarvis> acovrig: sure
Iskarlar has quit [Client Quit]
husanux4 has quit [Remote host closed the connection]
<jhass> aw, ends-with but it's xpath 2
<ljarvis> ends-withyou could use substring/constains
tomphp_ has quit [Ping timeout: 264 seconds]
husanux8 has joined #ruby
s2013 has joined #ruby
tubuliferous_ has quit [Ping timeout: 272 seconds]
pyo_ has quit []
s2013 has quit [Client Quit]
ldnunes has joined #ruby
husanux8 has quit [Remote host closed the connection]
jlast has joined #ruby
<ljarvis> Nokogiri.HTML("<div id='1'><div id='2-foo'><ul><li><a></a></li></ul></div></div>").at("a").at("./ancestor::div[contains(@id, 'foo')]")[:id]
bodie_ has joined #ruby
<ljarvis> #=> "2-foo"
nettoweb has joined #ruby
denver has joined #ruby
rbennacer has joined #ruby
psy__ has joined #ruby
<ljarvis> Nokogiri.HTML("<div id='1'><div id='2-foo'><ul><li><a></a></li></ul></div></div>").at("a").at("./ancestor::div[substring(@id, string-length(@id) - string-length('foo') + 1) = 'foo']")[:id]
<ljarvis> ^ if you want end-with for xpath 1.0
theery has joined #ruby
konsolebox has joined #ruby
<ljarvis> replace foo with whatever, profit
* ljarvis loves xpath
<bodie_> anyone familiar with using ruby on gentoo? should I be using portage, rvm, chruby, or something else to manage my stuff? I'm leaning towards chruby but I don't know how it will interact with my system install. (and yes I have asked #gentoo)
<ljarvis> ?chruby
<ruboto> I don't know anything about chruby
<havenwood> ruboto: you do too!
<ljarvis> ?install
<ruboto> I don't know anything about install
<que__> [k-_: can You help me out with that rregexp grouping ?
<ljarvis> ruboto: YO
<que__> (aaa2) ^(\S+)$ i thought something like that
jud has quit [Ping timeout: 265 seconds]
<ljarvis> Radar: thought you added those :(
<que__> but guess what i am bad at regexp
hck89_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<ljarvis> ?linuxinstall
<ruboto> I don't know anything about linuxinstall
<bodie_> :P
<bodie_> ?portage
<ruboto> I don't know anything about portage
husanux7 has joined #ruby
<acovrig> ljarvis: thanks, I think I got the div, but how do I get the ID? I have par = i.xpath(“…”), I can’t get anything from par[‘id’] or par[:id]. p par shows an ID though, so it found the div correctly.
<ljarvis> bodie_: use chruby and ruby-install
<[k-_> que__, i think /^aaa2(.*?)$/ will work. You can get the after text with $1
<[k-_> you can also use named groups
<ljarvis> acovrig: .xpath returns a collection iirc, so maybe you want .first[:id] or at_xpath(..).id
<ljarvis> at_xpath(..)[:id] rather
tvw has quit []
rbennacer has quit [Ping timeout: 246 seconds]
whippythellama has quit [Ping timeout: 246 seconds]
<[k-_> que__, eg /^aaa2(?<after>.*?)$/ will work. You can get the after text with regexp.match(string)[:after]
krz has quit [Quit: WeeChat 1.0.1]
Igorshp has quit [Remote host closed the connection]
<que__> will check
ghostpl has quit [Remote host closed the connection]
arturhoo has joined #ruby
rbennacer has joined #ruby
devdazed has joined #ruby
mrmargolis has joined #ruby
<_blizzy_> can anyone help me figure out why after line 41, my @team array resets to 'nil'? I've used byebug, and the @team does have the correct values, however, it resets once it goes back to the beginning of the switch/case (line 32)
husanux7 has quit [Remote host closed the connection]
JakFrist has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Igorshp has joined #ruby
<ljarvis> _blizzy_: instance variables default to nil, so it's probably not set in another branch
<ljarvis> ah you set it in the initializer
<ljarvis> which actually seems odd since you're doing a re-assignment
<ljarvis> are you sure @team should be re-assigned and not simply mutated?
<_blizzy_> can you set an attr_accessor to an array?
skade has quit [Quit: Computer has gone to sleep.]
<_blizzy_> like attr_accessor :team = []
<_blizzy_> or something
<ljarvis> you already set it to []
<ljarvis> line 18
Xeago_ has joined #ruby
<[k-_> is this it?
<[k-_> oh, its a nil
<[k-_> soz
* [k-_ looks again
<_blizzy_> I mean @team in the battle file
<[k-_> you shouldnt use for .. in ..
<_blizzy_> sorry if my code looks shit :c
<que__> [k-_: failed
mdw has quit [Ping timeout: 272 seconds]
<[k-_> que__: paste code
<[k-_> also, return is implicit
ziprar has joined #ruby
ziprar has joined #ruby
<ljarvis> _blizzy_: that's usually a sign you need to refactor
<ljarvis> it would be a lot easier to catch bugs if it didn't look "shit"
<[k-_> que__: your code doesnt look rubyish
<_blizzy_> ljarvis, yeah, I've been doing that atm, so I'll keep going. thanks. :)
<[k-_> indentation is not important to ruby
<[k-_> or significant
<[k-_> your code looks like python
<[k-_> and not ruby
cpruitt has joined #ruby
mattarse has quit [Ping timeout: 272 seconds]
<que__> hehe its ruby, i never used it. I need to add a piece of small script in ruby for plugin to one of the software.
Xeago_ has quit [Remote host closed the connection]
<[k-_> your code doesnt look ruby!
<[k-_> it looks more pythony than ruby-y
Rickmasta has joined #ruby
Xeago has quit [Ping timeout: 272 seconds]
<adaedra> tssk tssk tssk
<_blizzy_> hmm, maybe it's scope?
zipace has quit [Ping timeout: 265 seconds]
<que__> [k-_: i am laughing really hard. all the bosses always complain i make messy code.
ghostpl has joined #ruby
khebbie has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<que__> anyway any help with the regexp ?
djellemah__ is now known as djellemah
JDiPierro has quit [Remote host closed the connection]
<yorickpeterse> meh workman too
theery has quit [Remote host closed the connection]
<yorickpeterse> too annoying to program in
<centrx> que__, What's wrong with it
<yorickpeterse> everything is on the right
Pupeno_ is now known as Pupeno
Pupeno has quit [Changing host]
Pupeno has joined #ruby
<yorickpeterse> next up: programmer's dvorak
* yorickpeterse is very "productive" today
<centrx> Great work yorickpeterse! You're a pro!
<maasha> Iterate over all odd numbers from 11 to 99 ?
<adaedra> “‘«productive»’”
lordkryss has joined #ruby
Iskarlar has joined #ruby
<que__> https://repl.it/languages/Ruby i use this for testing . centrx i just need to take the second parameter and i suck with regexp. http://paste.ofcode.org/Tji7r5BsnKDANHVTKmS3AJ
<que__> second word after a match *
whippythellama has joined #ruby
sarkyniin has joined #ruby
<maasha> (3..7).reject(&:even?)
<maasha> will have to do :o)
<centrx> que__, like /aaa2 (.*?) /m ?
<Mon_Ouie> >> (3..7).step(2).to_a
<ruboto> Mon_Ouie # => [3, 5, 7] (https://eval.in/387611)
<adaedra> (11..99).step(2) do
<adaedra> too slow
<Mon_Ouie> Which has the benefit of working lazily
jtbnyc69 has joined #ruby
<Mon_Ouie> adaedra: Should have used programmer's dvorak!
<que__> yeah it gives also the aaa2
jerius has joined #ruby
<que__> and i dont want that one
<[k-_> there are no matches in the string o_O
malconis has joined #ruby
jahrichie has quit [Quit: Leaving.]
<adaedra> Mon_Ouie: I prefer developer lazyness.
<[k-_> i think i got the named group syntax wrong
<que__> http://paste.ofcode.org/39vreZfgP28tpmf4Rwmi2HM -- no this one takes aaa2 aa and i just want that sexy aa
<centrx> que__, $' gets the entire match, you want $1 for the first match (or matchdata.captures.first)
<havenwood> maasha: 11.step(by: 2, to: 99).to_a
Iskarlar has quit [Client Quit]
<ljarvis> >> "aaa aaa2 aa\naaaa 2 dasda".match(/aaa2 (.+)/).captures
<ruboto> ljarvis # => ["aa"] (https://eval.in/387619)
<ljarvis> why use m when you dont care about it
<que__> ljarvis: multiline
<que__> aaaaa..... line by line
<ljarvis> "when you dont care about it"
<que__> ffuuuu
<al2o3-cr> >> "aaa aaa2 aa\n aaaa 2 dasda".match /aaa2\s(.*)/; $1
<ruboto> al2o3-cr # => "aa" (https://eval.in/387621)
<ljarvis> your example doesn't *want* to capture over newlines
<jhass> >> "aaa aaa2 aa\naaa 2 dasda"[/(?<=aaa2 )\w+/]
<ruboto> jhass # => "aa" (https://eval.in/387622)
<jhass> ?fake
<ljarvis> jhass: nerd
<ruboto> Please show your real code to illustrate your problem. Using fake code often hides it or won't bring up the best possible solution.
<jhass> because I'm sure your example doesn't fit your real problem
Xeago has joined #ruby
<ljarvis> ^ +1
mattarse has joined #ruby
<que__> thank You guys very meny !!!
<ljarvis> :/
<adaedra> :/
<jhass> ljarvis: patience, less than 20 minutes
aryaching has quit [Ping timeout: 265 seconds]
<maasha> gotit thanks
<ljarvis>
sevenseacat has joined #ruby
<[k-_> i gave up
<[k-_> oh its fixed
<[k-_> ok
krz has joined #ruby
jahrichie has joined #ruby
commondream has joined #ruby
malconis has quit [Remote host closed the connection]
<[k-_> _blizzy_: the code is really horrible
Xeago has quit [Remote host closed the connection]
<_blizzy_> [k-_, thanks
<ljarvis> lol
<centrx> On the hand, you're a really nice guy
<sevenseacat> ooh were looking at this code again are we
<ljarvis> again?
<_blizzy_> I've done what people said
tesuji has quit [Read error: Connection reset by peer]
<_blizzy_> and broken up the code into smaller methods
<_blizzy_> it went from 300+ lines to 117
<centrx> Excellent
<[k-_> you didnt do it enough
<sevenseacat> we looked at it this morning
<centrx> There's always more to be done!
<ljarvis> _blizzy_: is the issue still occuring?
<_blizzy_> ljarvis, yes
<ljarvis> _blizzy_: can you paste the new code
<_blizzy_> sevenseacat, what, that was last night
JDiPierro has joined #ruby
<sevenseacat> this morning my time.
<_blizzy_> oh
<ljarvis> #timezones
Iskarlar has joined #ruby
lxsameer has quit [Quit: Leaving]
Macaveli has joined #ruby
<[k-_> ?ugt ljarvis
<ruboto> ljarvis, it's morning, see http://www.total-knowledge.com/~ilya/mips/ugt.html
<adaedra> F*cking timezones, how do they work?
<sevenseacat> adaedra: nfi.
<Aria> With lots of work.
<Aria> And maintenance.
momomomomo has joined #ruby
<Aria> And the olsen database.
<ljarvis> _blizzy_: it's the same
<_blizzy_> magnets, now how do those work
<adaedra> _blizzy_: MAGIC
<ljarvis> _blizzy_: split each of your when branches into separate methods
<[k-_> if m[2].include? "p1a: "
<[k-_> @team.find{|x| x[:nick] == pkmn}[:fainted] = true
<_blizzy_> ljarvis, ok
<[k-_> what is this all about
<sevenseacat> you made it shorter by deleting all of the helpers?
<_blizzy_> no
<_blizzy_> I split the big blocks of code into smaller methods
<_blizzy_> which are in another file
<ljarvis> one we can't see? ;)
<sevenseacat> oh you made it shorter by just not showing those methods :P
<_blizzy_> yes
atomical has joined #ruby
<[k-_> oh! i just got it
<ljarvis> _blizzy_: forgive me if i'm just being ignorant, but do you know the difference between instance variables and local variables?
malconis has joined #ruby
<_blizzy_> ljarvis, yes.
<[k-_> anyways, you also have redundant @team = get_team
blue_deref has joined #ruby
astrobun_ has quit [Remote host closed the connection]
<[k-_> since get_team already modifies @team
<ljarvis> _blizzy_: in your get_team method, you use an instance variable for @team even though it makes no sense, why is that?
<_blizzy_> ljarvis, ..I can't answer that tbh. it was late at night, so IDK.
<_blizzy_> so let me fix that real quick
<ljarvis> ok
<al2o3-cr> programming/coding is hard
<adaedra> ^
<_blizzy_> yep
<_blizzy_> but I like it
<[k-_> dont just fix that code
<adaedra> hopefully there's PHP which makes everything simple!
* adaedra runs
<[k-_> refactor the whole thing!
<_blizzy_> I actually like php
<_blizzy_> ._.
<ljarvis> :)
<adaedra> some people do
<centrx> ALERT ALERT PHP ALERT ALERT
endash has joined #ruby
* [k-_ sounds the alarm
<[k-_> LEVEL 3 BREACH
<[k-_> CODE RED
<adaedra> ok, next time I will try not to throw that
fmcgeough has joined #ruby
prestorium has joined #ruby
<ljarvis> _blizzy_: You should also separate team into a separate class imo
ghostpl has quit [Remote host closed the connection]
<ljarvis> (that's what I'd do)
<[k-_> imo if @moves is to capture history, you should have a BattleHistory class
<[k-_> You should also do what ljarvis said
gaucheph has quit [Ping timeout: 248 seconds]
<[k-_> you should also name your variables properly
<[k-_> in short, refactoring is in order!
<[k-_> or you could rewrite
<ljarvis> ^ that's also a good point, don't use short names unless they make absolute sense
<_blizzy_> so if this runs, https://gist.github.com/NotBlizzard/e0be537992daee920717, @bar will equal [1,2,3,4] after I run 'run()'
<sevenseacat> keystrokes are cheap.
<adaedra> but muh free disk space
Scrofff has quit [Remote host closed the connection]
<_blizzy_> [k-_, it's to capture the current moves a Pokemon can use
<Aria> \o _blizzy_.
<ljarvis> _blizzy_: should that be "class Foo"
nfk has joined #ruby
<[k-_> well then, a Pokemon class is in order
<_blizzy_> .. ljarvis, yes
jahrichie has quit [Quit: Leaving.]
<_blizzy_> hi Aria \o
senayar has quit [Remote host closed the connection]
mrmargol_ has joined #ruby
<_blizzy_> I think I'll keep it without the Pokemon class
<[k-_> if we had def Foo instead of class Foo, might as well just call it javascriptv7 TvT
fabrice31_ has joined #ruby
theahindle has joined #ruby
<ljarvis> _blizzy_: @bar is private to @foo and local to any instance of it, the one you define in "run" is local to the main scope, which is why you generally shouldn't define instance variables like that
<ljarvis> private to Foo*
<_blizzy_> ljarvis, oh ok.
<theahindle> Hi - I'm trying to parse a qif file, if I do puts transaction.payee it works, but if I do transaction.payee.downcase it says 'downcase doesn't exist for nil.Nil' - Is there a way of capturing the 'string' of transaction.payee so I can use it with downcase and include?
kobain has quit [Ping timeout: 252 seconds]
slumos has joined #ruby
<havenwood> >> nil.to_s
<ruboto> havenwood # => "" (https://eval.in/387633)
Xeago has joined #ruby
<[k-_> theahindle: i read blah blah blah blah blah, please paste a gist and the error then describe your problem
que__ has quit [Quit: Page closed]
<[k-_> :>
<havenwood> theahindle: You could ensure it's a String: transaction.payee.to_s
fabrice31_ has quit [Remote host closed the connection]
<theahindle> havenwood: That works perfectly, thankyou :)
<havenwood> theahindle: de nada
<theahindle> I'm still a Ruby noob
msnyon has joined #ruby
<_blizzy_> we all are
mfranzwa has joined #ruby
<theahindle> I've been learning for 20 minutes or so though
fabrice31_ has joined #ruby
<[k-_> i still read blah <.<
Scroff has joined #ruby
<[k-_> i think my head is woozy
fabrice31 has quit [Ping timeout: 246 seconds]
momomomomo has quit [Quit: momomomomo]
arup_r has quit [Remote host closed the connection]
<[k-_> i should go to bed
dopie has joined #ruby
mrmargolis has quit [Ping timeout: 246 seconds]
ringarin has quit [Ping timeout: 265 seconds]
[k-_ has left #ruby ["Be back later ..."]
mfranzwa has quit [Client Quit]
mfranzwa has joined #ruby
poguez_ has joined #ruby
<_blizzy_> I'm still still refactoring, making stuff into smaller methods, but I still keep getting nil for the array
<_blizzy_> :/
<centrx> Teenage Mutant Ninja Turtles is better
<ddv> show code
coderhs has joined #ruby
mrmargolis has joined #ruby
tagrudev has quit [Remote host closed the connection]
<_blizzy_> https://gist.github.com/NotBlizzard/709caa2d1a2d8c50dd2e I'm still refactoring. line 32
coderhs has quit [Client Quit]
<_blizzy_> at the byebug stop, it has the correct values, however, once it returns back to the beginning of the switch/case, its value is nil
<ddv> _blizzy_: please name stuff normally
<_blizzy_> ddv, may you name an example?
<ddv> p1, ws, m is not very descriptive
<ljarvis> pkmn = m[2].split(': ')[1]; @p1; m[2]; @you; @ws
<ljarvis> those are a few
bubbys has quit [Ping timeout: 252 seconds]
<_blizzy_> ok, I'll just add comments
Igorshp_ has joined #ruby
<ljarvis> no
<ljarvis> comments are not made for that
bubbys has joined #ruby
<_blizzy_> but comments are there for a reason
<ljarvis> yes, not this
<ddv> _blizzy_: gigantic switch structures are bad
<_blizzy_> comments are for why
<ljarvis> .. exactly
<havenwood> _blizzy_: When there's something worth commenting upon.
<ljarvis> you want to use them for "what"
<ddv> _blizzy_: your code is the documentation
<ljarvis> which they are not for
<_blizzy_> I'd rather type 'ws' # web socket
<ljarvis> :|
<ljarvis> seriously?
<_blizzy_> yes
ghostpl has joined #ruby
<_blizzy_> but that's just me
<ljarvis> that's the most insane thing I've heard this year
<ljarvis> web_socket # this doesn't need a comment
mrmargol_ has quit [Ping timeout: 264 seconds]
<_blizzy_> also @you kind of makes sense
senayar has joined #ruby
senayar has quit [Changing host]
senayar has joined #ruby
<_blizzy_> it's, well, you
<_mh_> _blizzy_: Also, you might want to do some input sanitisation on your get_team method, you parse stuff from JSON and just assume it's the format you expect it to be
Macaveli has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<_blizzy_> _mh_, because I've checked it multiple times
Soda has quit [Remote host closed the connection]
<_blizzy_> and it's the same format
<havenwood> _blizzy_: In a month you'll still know what `web_socket` means. We'd know what it means now. Name things nicely!
<ljarvis> :D
anne-marie_ has joined #ruby
<_blizzy_> even the documentation uses 'ws' instead of websocket :/ https://github.com/faye/faye-websocket-ruby
Igorshp has quit [Ping timeout: 252 seconds]
<ljarvis> the entire library has websocket in the name... it's a bit obvious what "ws" means in that sense
<_mh_> _blizzy_: it get's it's input from some array you create by splitting some user data... ?
x44x45x41x4E has quit [Remote host closed the connection]
<havenwood> _blizzy_: What is `m`?
<ddv> _blizzy_: the person who wrote that is an idiot
<_blizzy_> havenwood, ok that I can change
<_blizzy_> ok well I'll just keep ws and put a comment
<ljarvis> havenwood: what is @p1
<ljarvis> oops
<ljarvis> _blizzy_: ^
<havenwood> ljarvis: Dunno!
<_blizzy_> got it, I'll change it
<ljarvis> ;P
<sevenseacat> lmao
rjno has joined #ruby
<_mh_> _blizzy_: likely your integer x would need to be string x, as you are likely not receiving web data (what I suppose it is) as integers...
centrx has quit [Quit: Shutting down, Please wait...]
<_blizzy_> _mh_, I've checked it, it's integers
<sevenseacat> lol
<_blizzy_> since it's 'pokemon' is an array
<_blizzy_> also how does @you not make sense
<sevenseacat> we need five other people to say the same thing, then _blizzy_ will consider it, say they'll implement it, then not do it.
<_blizzy_> it's basically referring to the bot itself
<ljarvis> oh this is a bot?
<_blizzy_> yes
<ljarvis> ... see?
<sevenseacat> then name it @bot or something meaningful!
<ljarvis> ^!
<_blizzy_> ok, done
<_blizzy_> :)
<sevenseacat> so many of the same things being said now that we said this morning
<ddv> _blizzy_: run does way more than just running
<_blizzy_> ddv, I know.
<_blizzy_> why is it ok to have big methods in javascript but not in ruby
<_blizzy_> :/
<ljarvis> it's not ok
<_blizzy_> big != bad
<ljarvis> people do it in Ruby too, that doesn't make it ok
<ljarvis> right, bad, exactly
<_blizzy_> I said !=
yardenbar has joined #ruby
<_blizzy_> meaning not equals
<ljarvis> lol
ReD-BoY_ has joined #ruby
jahrichie has joined #ruby
<_blizzy_> :/
<ljarvis> yes, big IS bad
<_blizzy_> how is big bad?
Kricir has joined #ruby
<ljarvis> how is big not bad?
<_blizzy_> this will keep circling
ndrei has joined #ruby
<ljarvis> correct
<ljarvis> so lets get back to your code
<_blizzy_> also, I'll keep my switch case
<adaedra> You spin me right round ♪
<ljarvis> that's fine, just extract the branches
<_blizzy_> I'll still divide it up into little methods however.
<_blizzy_> ok
<ddv> _blizzy_: you should completely remove the gigantic switch mess
<_blizzy_> ddv, I'll keep it and change it until it's better
<ljarvis> ^ disagree (at least, for refactoring)
gambl0re has joined #ruby
scripore has joined #ruby
<ljarvis> pretty much everything in ruby is mutable so i shouldn't have to say this, but the mutable stuff happening in this code scares me
gambl0re has quit [Client Quit]
<_blizzy_> I can't write perfect ruby code, and I know it's not to everyone's liking. I'm just trying to find this bug.
<adaedra> freeze everything :o
freerobby has joined #ruby
<ljarvis> yep, and we're helping
<ddv> _blizzy_: there is no such thing as perfect code
<ljarvis> lies
<ddv> _blizzy_: well unless I wrote it obviously
<_blizzy_> ddv, I know.
<_blizzy_> ddv, pls
<adaedra> There is perfect code
acovrig has quit [Quit: acovrig]
<adaedra> It lies in /dev/null
<_blizzy_> p "Hello World"
gambl0re has joined #ruby
<_blizzy_> prefect ruby code
<ljarvis> _blizzy_: not really, those pesky quotes.. perfect score 6/10
<_blizzy_> heh
<havenwood> _blizzy_: Only use `p` for debugging.
<_blizzy_> havenwood, oh
<ljarvis> p(obj) == puts(obj.inspect)
<ljarvis> (basically)
<ReD-BoY_> hi
<ljarvis> hi
<_blizzy_> hi
<ddv> hi
<havenwood> hi
<_blizzy_> bye
<ddv> combobreaker^
<adaedra> aïe
<ReD-BoY_> I would be happy if someone have exp with Hotel Booking Systems and PayPal
[k- has left #ruby [#ruby]
<ddv> ReD-BoY_: ok cool
<ljarvis> what a general question
<ReD-BoY_> i don't need help for programming, just to help me understand some problem
<ReD-BoY_> that i have with developer company
<ReD-BoY_> and PayPal
tkuchiki has joined #ruby
<havenwood> ReD-BoY_: Ruby?
<ReD-BoY_> it's a common
<ReD-BoY_> for hotel booking
<ddv> ask the damn question
<havenwood> ReD-BoY_: Ruby-related?
riotjones has quit [Quit: Leaving...]
<ReD-BoY_> no, sorry, but i had no chance at other places
<ddv> ask the damn question
jlast has quit [Read error: Connection reset by peer]
<havenwood> ReD-BoY_: Say how this relates to Ruby or off with you! :)
penzur has joined #ruby
<ReD-BoY_> Developer company tell me when they generate booking, the send directly booking to supplier or hotel and cannot handle
<ReD-BoY_> if paypal
tkuchiki has quit [Remote host closed the connection]
<havenwood> ReD-BoY_: There's a #ruby-offtopic channel if it doesn't relate to Ruby.
<ReD-BoY_> responso with Pending status
<ReD-BoY_> on the payment
<havenwood> ?ot ReD-BoY_
<ruboto> ReD-BoY_, this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
<adaedra> the damn question you should ask
susmus has joined #ruby
jlast has joined #ruby
rubie has joined #ruby
Iskarlar has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
troulouliou_dev has joined #ruby
<izzol> hmm, there is any useful gem for testing NS records? I'm tyring to do this by rspec-dns but it has lot of issues :(
aganov has quit [Remote host closed the connection]
msgodf has joined #ruby
ponga has joined #ruby
juanpaucar has joined #ruby
<ljarvis> izzol: what exactly are you trying to do?
<ddv> testing NS records
<ljarvis> i.e stdlib has resolv for this kind of stuff but hard to tell exactly what you want
kobain has joined #ruby
<ljarvis> testing them for what?
<_blizzy_> I have a question. https://gist.github.com/NotBlizzard/ad6b9e6d55e143617e5d would foo equal 2?
rubie has quit [Ping timeout: 265 seconds]
<adaedra> no
<ddv> _blizzy_: nope
<adaedra> did you test it?
<izzol> ljarvis: I want to check all NS records to see if they are ok, if there is no one missing or different
<ddv> foo_var is local to the method foo
Channel6 has quit [Quit: Leaving]
NeverDie has joined #ruby
CaveJohnson is now known as Zackio
<_blizzy_> ddv, then how would I make it so foo would now equal 2?
<ddv> err, bar
<_blizzy_> if this was in a class, would I pass instance variables?
<adaedra> you could
<ljarvis> izzol: I would just use resolv, you can perform DNS queries quite easily
<_blizzy_> and they would then change?
<izzol> ljarvis: what do you mean resolv ?
phat4life has quit [Ping timeout: 248 seconds]
<ljarvis> _blizzy_: yes, but in generally it's pointless to pass ivars
<_blizzy_> ljarvis, oh.
<ljarvis> since their scope is the entire instance of a class already
<adaedra> _blizzy_: when you call bar, a copy of foo is made into foo_var, so if you modify foo_var, foo is not modified. It's passing by value.
<_blizzy_> adaedra, oh ok. thxs.
<izzol> ljarvis: ahh, ok, I will check it
<adaedra> er wait, I'm saying shit
juanpaucar has quit [Ping timeout: 246 seconds]
<ddv> lol
thelastinuit has quit [Ping timeout: 252 seconds]
pdoherty has joined #ruby
arturaz has quit [Ping timeout: 256 seconds]
arturmartins has joined #ruby
tkuchiki has joined #ruby
<ljarvis> adaedra: what you've said is right
<adaedra> uh
phat4life has joined #ruby
<adaedra> ah yes
<adaedra> I need some sleep -_-
<_blizzy_> so this is correct, right? https://gist.github.com/NotBlizzard/ad6b9e6d55e143617e5d
<_blizzy_> as in it would be 2
<adaedra> no
<sevenseacat> thats a syntax error
<ljarvis> ruby is like c, everything is pass by value
<_blizzy_> then I'm confused on how to do this
<sevenseacat> also, no
<ljarvis> _blizzy_: you know you can run the code locally right?
<_blizzy_> ljarvis, IK.
<ljarvis> why don't you?
<sevenseacat> youre not even calling change_foo_to_two
<adaedra> because ivars are local to a class, and your change_foo_to_two is outside the class
mrmargolis has quit []
<havenwood> ?pry _blizzy_
<ruboto> _blizzy_, Pry, the better IRB. Includes easy object inspection via `ls`, `history`, docs view with `?`, source view with `$` and syntax highlighting, among other features (see `help` for more). It can also be used for easy debugging by putting ’binding.pry’ directy in your source code. Visit https://pryrepl.org/ or get it now with gem install pry pry-doc
juanpaucar has joined #ruby
<havenwood> _blizzy_: SyntaxError: unexpected ':', expecting keyword_end
<havenwood> _blizzy_: :attr_accessor
<_blizzy_> whoops
<havenwood> _blizzy_: Use irb or better yet pry!
<sevenseacat> also yes, IRC is not IRB.
<ljarvis> _blizzy_: you're setting an instance variable inside the class scope and not the instance scope
<ljarvis> therefor the variable is an instance variable of class Foo
<adaedra> _blizzy_: you know object principles?
<_blizzy_> hmm, ok.
<ljarvis> in Ruby, every class is an instance of Class
<_blizzy_> no.
findaway has joined #ruby
jpfuentes2 has joined #ruby
mattarse has quit [Ping timeout: 250 seconds]
<ljarvis> even Class
<adaedra> you should read on that, it's a vague subject, not really explainable over IRC
<adaedra> mh
mary5030 has joined #ruby
Iskarlar has joined #ruby
<adaedra> vague => large
<ljarvis> (but also fun/interesting)
<ljarvis> or maybe that's just me
<adaedra> some people hate oop
mary5030 has quit [Remote host closed the connection]
datanoise has joined #ruby
mary5030 has joined #ruby
sandstro_ has joined #ruby
pengin has joined #ruby
User458764 has joined #ruby
User458764 has quit [Max SendQ exceeded]
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jphenow has joined #ruby
rippa has joined #ruby
User458764 has joined #ruby
<izzol> ljarvis: works nice :-) I will need to do some tests on it but I guess I can simply include minitest.
jphenow has quit [Client Quit]
sandstrom has quit [Ping timeout: 244 seconds]
speakingcode has quit [Ping timeout: 276 seconds]
flughafen_ has joined #ruby
sonOfRa has quit [Remote host closed the connection]
tkuchiki has quit [Remote host closed the connection]
mattarse has joined #ruby
sonOfRa has joined #ruby
<_blizzy_> yes, I have ran this in the console. https://gist.github.com/NotBlizzard/0aef98ea062afeeb485a I've tried different things, and I still cant' figure out how I would change the instance variable using an outside method.
jahrichie has quit [Quit: Leaving.]
momomomomo has joined #ruby
ixti has joined #ruby
tkuchiki has joined #ruby
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
casadei has joined #ruby
sinkensabe has quit [Remote host closed the connection]
gauke has quit [Quit: gauke]
umgrosscol has joined #ruby
mattarse has quit [Ping timeout: 246 seconds]
davedev24_ has joined #ruby
d10n-work has joined #ruby
juanpaucar has quit [Remote host closed the connection]
pengin has quit [Remote host closed the connection]
chinmay_dd has quit [Remote host closed the connection]
Scrofff has joined #ruby
ghostpl has quit [Remote host closed the connection]
chinmay_dd has joined #ruby
sonOfRa has quit [Remote host closed the connection]
ndrei has quit [Ping timeout: 246 seconds]
<ljarvis> _blizzy_: you can't (without metaprogramming)
catphish has joined #ruby
sonOfRa has joined #ruby
<ljarvis> oh
<ljarvis> it's an accessor derp
<ljarvis> f.foo = ...
juanpaucar has joined #ruby
chinmay_dd has quit [Read error: Connection reset by peer]
<catphish> i have an issue with net/ssh, if it executes a process in a remote server which then forks, the fork seems to receive a HUP when the ssh session closes
<_blizzy_> thanks, ljarvis
<_blizzy_> I feel slow now. c:
<catphish> this doesn't seem to happen when running the same command using a normal ssh session
ndrei has joined #ruby
<adaedra> because it reacts differently if not in a tty, I'd say
Scroff has quit [Ping timeout: 250 seconds]
<adaedra> easy fix: nohup
Iskarlar has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
peter_paule has joined #ruby
sevenseacat has quit [Quit: Me dun like you no more.]
<catphish> i don't think it's the tty
pglombardo has joined #ruby
<catphish> it works correctly if executed remotely over ssh with no tty
<catphish> only seems to get HUPd if it's run from net/ssh
<catphish> nohup is an option, but its messy
soulcake has quit [Ping timeout: 276 seconds]
<_mh_> catphish: if you try to execute it with ssh remotemachine yourforkingcommand (without any -t or similar), do you have the same effect as with Net/SSH ?
soulcake has joined #ruby
<catphish> see above
<adaedra> I don't remember why NOHUP is emitted
<adaedra> s/NO/SIG/
<catphish> it might be the way i'm wrapping net/ssh, i'll double check
bkxd_ has quit [Ping timeout: 272 seconds]
msgodf has quit [Remote host closed the connection]
tomphp_ has joined #ruby
<catphish> ah, it's fine it i run it in net/ssh *without* a pty
slawrence00 has joined #ruby
<catphish> must be something to do with the way ptys are assigned and unassigned
aapole has joined #ruby
peter_paule has quit [Ping timeout: 255 seconds]
<_mh_> any chance you can show us that snippet?
danielpclark has quit [Ping timeout: 276 seconds]
<catphish> thanks :)
<catphish> me?
<_blizzy_> I hope this looks better to you all. https://gist.github.com/NotBlizzard/5d89ab1a5b157b1a1046
<_blizzy_> :/
<_mh_> catphish: yes. Unless you found your problem?
SilasVasconcelos has joined #ruby
<ljarvis> _blizzy_: sure, except now we can't see any of your code
atom3 has quit [Remote host closed the connection]
<ljarvis> _blizzy_: also, you need to rename d and m variables
<_blizzy_> ljarvis, doing it right now.
SilasVasconcelos has left #ruby [#ruby]
acke has quit [Remote host closed the connection]
<catphish> _mh_: i have found my problem, i was calling channel.request_pty on the ssh channel, causing a pty to be assigned, when the pty was closed, it was emitting SIGHUP to the child process
atom3 has joined #ruby
sinkensabe has joined #ruby
<catphish> _mh_: i have no idea why this does not happen when running in an interactive ssh session though
<ljarvis> _blizzy_: also another style thing, for win/lose/tie you can write it like: when "win", "lose", "tie"
livathinos has quit []
tomphp has quit [Ping timeout: 256 seconds]
pocketprotector has quit [Quit: WeeChat 0.4.3]
trouloulious_dev has joined #ruby
findaway has left #ruby [#ruby]
tubuliferous_ has joined #ruby
andikr has quit [Remote host closed the connection]
pocketprotector has joined #ruby
tomphp_ has quit [Ping timeout: 255 seconds]
ndrei has quit [Ping timeout: 252 seconds]
<_mh_> catphish: aaah! Good you did, then.
nettoweb has joined #ruby
<_mh_> afk
troulouliou_dev has quit [Quit: Leaving]
ndrei has joined #ruby
maasha has quit [Ping timeout: 246 seconds]
Iskarlar has joined #ruby
thiagovsk has quit [Quit: Connection closed for inactivity]
Zarthus has quit [Quit: This night will fall like any other, daylight subsides and shadows crawl.]
fabrice31 has joined #ruby
tubuliferous_ has quit [Ping timeout: 252 seconds]
geiltalasdair has quit [Quit: Leaving]
geilt has joined #ruby
User458764 has joined #ruby
<ljarvis> _blizzy_: one thing, data_without_split = data doesn't make much sense. When you split it on the next line, that doesn't change the old value of "data", you simply re-assign the return value of split() so that variable is moot, just refer to it as "data" throughout (or a better name because data is very generic)
fabrice31_ has quit [Ping timeout: 244 seconds]
Zarthus has joined #ruby
Iskarlar has quit [Client Quit]
atom3 has quit [Ping timeout: 276 seconds]
Zarthus has quit [Changing host]
Zarthus has joined #ruby
fabrice31 has quit [Remote host closed the connection]
atom3 has joined #ruby
ghostpl has joined #ruby
danielpclark has joined #ruby
Zarthus has quit [Client Quit]
Sembei has quit [Read error: Connection reset by peer]
Xeago_ has joined #ruby
Zarthus has joined #ruby
Iskarlar has joined #ruby
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
skade has joined #ruby
ddarkpassenger has joined #ruby
Xeago_ has quit [Remote host closed the connection]
skade has quit [Client Quit]
Sembei has joined #ruby
<ljarvis> _blizzy_: here's how I'd write the battle class: https://gist.github.com/leejarvis/e365d8483bc1cdb693b2 separating all logic into separate methods, passing only the thing that changes (in this case, room); stuff like your websocket can be passed into your battle initializer
B1n4r10 has joined #ruby
Xeago has quit [Ping timeout: 272 seconds]
pyo_ has joined #ruby
hectortrope has quit [Quit: WeeChat 0.4.2]
axl_ has joined #ruby
dfockler has joined #ruby
skade has joined #ruby
User458764 has joined #ruby
senayar has quit [Remote host closed the connection]
dgutierrez1287 has joined #ruby
slackbotgz has quit [Remote host closed the connection]
skade has quit [Client Quit]
rubie has joined #ruby
endash has quit [Quit: endash]
OrbitalKitten has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Iskarlar has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
shock_one has joined #ruby
findaway has joined #ruby
MyMind has joined #ruby
dgutierrez1287 has quit [Ping timeout: 248 seconds]
Sembei has quit [Ping timeout: 248 seconds]
<shock_one> Hi. How would I make a single pipe out of this? https://gist.github.com/shockone/64661b47bdb9e7b31490
ta has quit [Remote host closed the connection]
snockerton has joined #ruby
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
jahrichie has joined #ruby
marr has quit []
senayar has joined #ruby
OrbitalKitten has joined #ruby
t0rrieri has joined #ruby
<jhass> you probably can't, however depending on what the patterns for the first select are the second might be redundant (that is it's possible that if the items don't match any of the former two patterns they can't match the latter)
B1n4r10 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
commondream has quit [Remote host closed the connection]
al2o3-cr has quit [Ping timeout: 256 seconds]
ddarkpassenger has quit [Quit: Textual IRC Client: www.textualapp.com]
DexterLB has quit [Ping timeout: 252 seconds]
DexterLB has joined #ruby
ndrei has quit [Ping timeout: 265 seconds]
<_blizzy_> I'm kind of upset because my bot was working
<_blizzy_> but everyone wanted me to change it, now I have to keep fixing bug after bug. :/
<shevy> haha
catphish has left #ruby ["Leaving"]
<slash_nick> ...
<ljarvis> _blizzy_: well, you used version control right?
<_blizzy_> ljarvis, yes.
<ljarvis> so revert it back to "working"
<_blizzy_> but if I change it back to the way it was
<_blizzy_> I won't get help
<_blizzy_> because it's 'shit'
<ljarvis> hey you said that
<_blizzy_> or 'horrible', or 'spaghetti'
ndrei has joined #ruby
<_blizzy_> those two were said however.
<ljarvis> no no, "shit" was correct
<_blizzy_> ..
<ljarvis> but said by yourself
<_blizzy_> so you also think its shit?
<ljarvis> yes
<adaedra> programming is not a straight process
<ljarvis> but that besides the point
<adaedra> errors are made, errors are fixed
<ljarvis> ^
<adaedra> it's the circle of life
<umgrosscol> Oh, hey _blizzy_
<_blizzy_> hi umgrosscol
<umgrosscol> _blizzy_: How is that code refactoring going?
<_blizzy_> umgrosscol, ok.
pagios has left #ruby ["Leaving"]
theery has joined #ruby
<umgrosscol> That's good to hear.
freezevee has joined #ruby
<ljarvis> _blizzy_: so, how's is it not working now?
<ljarvis> all you've done is rename some variables and move some code around
<ljarvis> so it should be easy to identify the issue
<_blizzy_> ljarvis, well, yeah, it's easy bugs, it's just cumbersome
<umgrosscol> ljarvis: I always like to think that myself as well.
<_blizzy_> ^
<adaedra> _blizzy_: it's also a work of patience :)
<umgrosscol> ljarvis: Reality, compilers, and interpreters generally disagree with me.
<_blizzy_> I got 99 bugs but the compiler ain't one
<freezevee> I have a file called run.rb that parses data from a terminal command and exports it to json. Also I have another one web.rb with a sinatra path to show the json data, so I can use it as an API. How can I run the script that fetches the data as a deamon or service (ubuntu service) ?
<freezevee> Should I merge the two files into one ?
flughafen_ has quit [Ping timeout: 255 seconds]
aapole has quit [Remote host closed the connection]
<ljarvis> ?context
<ruboto> Please add more context to your question, what are you doing, why are you doing it, which libraries are involved. Post some code to gist if it clarifies your question.
flughafen_ has joined #ruby
shinnya has joined #ruby
<umgrosscol> freezevee: You could encapsulate the behaviors in classes and have them as part of a single application. Then run that application as a service.
wildroman2 has quit [Remote host closed the connection]
davedev24_ has quit [Read error: Connection reset by peer]
davedev24_ has joined #ruby
<freezevee> umgrosscol: what kind of service ? an O/S service in init.d ? or a Process.daemon ? I don't have previous experience in services so I am researching for the right way
<umgrosscol> freezevee: There are two parts to your application, yes? One that fetches data and the other that exports it?
<freezevee> I'll try gist it
enebo has joined #ruby
<freezevee> Yes the one just grabs data and strips them from a command in terminal and exports it to json
icebourg has joined #ruby
ndrei has quit [Ping timeout: 252 seconds]
BigRonnieRon has joined #ruby
<freezevee> The other simply starts sinatra and just attaches the File.read of the json to a route
BigRonnieRon has quit [Max SendQ exceeded]
<umgrosscol> freezevee: init.d would probably be fine. Make sure the environment has the command from which the data is read.
<freezevee> umgrosscol: it's pretty simple but helps me a lot
EagleDelta has joined #ruby
acke has joined #ruby
shock_one has quit [Remote host closed the connection]
shock_one has joined #ruby
BigRonnieRon has joined #ruby
marr has joined #ruby
<freezevee> umgrosscol: I read the UPS status (in home) which are serial data with a single command
enebo has quit [Client Quit]
<freezevee> then strip them , add them in a hash and save them to json
<freezevee> and I want to read them every 5 seconds
pyo_ has quit []
<freezevee> a cron job will also do the job but I've been reading so many different opinions in various websites that I don't know which to follow
langland_ has joined #ruby
<adaedra> PEOPLE, THEY THINK DIFFERENT THINGS
<dfockler> do what works until it doesn't
<umgrosscol> freezevee: You could update the input data with a cron tab as well. Both are viable options actually. Just depends on where you want the timing mechanism. Do you want the OS or the application to handle it?
<freezevee> umgrosscol: what is the difference ?
langlands has quit [Ping timeout: 252 seconds]
<freezevee> I mean in execution. Is something that really matters ?
<freezevee> What would you do ?
<umgrosscol> freezevee: If you're using jruby, yes.
shock_one has quit [Ping timeout: 248 seconds]
<freezevee> no simply ruby
pyon has quit [Ping timeout: 246 seconds]
<jhass> every 5 seconds I wouldn't do as a cronjob
<umgrosscol> freezevee: I'd probable leave it to the application if it was going to be something frequent. There is some overhead to spinning up ruby.
<jhass> simply because spawning that many process can pollute your system quickly if they start hanging or something
<umgrosscol> jhass: I hadn't thought of that angle.
User458764 has joined #ruby
<freezevee> it makes sense
endash has joined #ruby
<jhass> so ubuntu?
<freezevee> so just leave an infinite loop and sleep for 5'' ?
<freezevee> yes
<jhass> okay, then I'd say call http://ruby-doc.org/core-2.2.2/Process.html#method-c-daemon and do the loop, maybe write a pidfile somewhere
<_blizzy_> ok, let's try this again. for some reason, when the switch/case restarts, team resets back to nil. https://gist.github.com/NotBlizzard/34f68d4d82ac4d0b7be9
eGGsha has joined #ruby
<umgrosscol> freezevee: sleep might not be the best choice. There are probably pre-existing gems that handle some of the idiosyncrasies around timing.
<_blizzy_> may someone help me figure out why team resets to nil after the switch/case goes back to the beginning?
<ljarvis> _blizzy_: we need to see the helpers
<freezevee> umgrosscol: like ruby deamons?
<jhass> freezevee: though if it's critical that it stays running use a supervisor, on ubuntu I'd still choose djb's daemontools
<_blizzy_> ljarvis, I pasted the helper where the team is being called
<jhass> in that case you wouldn't call Process.daemon
<freezevee> jhass: why ?
Iskarlar has joined #ruby
<jhass> freezevee: because a process is bad at supervising itself
<ljarvis> _blizzy_: right but it's an instance variable, meaning it can be changed in any of your helper methods
<jhass> also supervision is actually not a trivial problem you want to reimplement
<ljarvis> _blizzy_: does it still happen if you comment out all other branches except "request"?
<_blizzy_> ljarvis, let me try that
denver has quit [Remote host closed the connection]
darkf has quit [Quit: Leaving]
jpfuentes2 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
commondream has joined #ruby
jpfuentes2 has joined #ruby
<freezevee> jhass: it's really that simple
<freezevee> jhass: but why not use sleep ?
<havenwood> _blizzy_: Put the constants and methods that belong to the Battle class inside the Battle class.
<freezevee> what are the alternatives ?
<_blizzy_> havenwood, ok.
<jhass> freezevee: umgrosscol suggested to not use sleep, idk why
shock_one has joined #ruby
<jhass> if you need precise triggers every 5 seconds it's the wrong tool, I agree
droidburgundy has joined #ruby
<jhass> but if slop of 2-3 seconds doesn't matter I see no issue
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<ljarvis> subtle marketing of slop
<ljarvis> or just use a thread worker
<freezevee> jhass: it doesn't quite matter as it's a fun/personal app
<jhass> ljarvis: bill goes to the usual address?
jlebrech has joined #ruby
<ljarvis> jhass: :P
<havenwood> freezevee: if you don't want to drift for some reason you can use a gem like timers: https://github.com/celluloid/timers
<freezevee> havenwood: thanks
shock_one has quit [Remote host closed the connection]
baweaver has joined #ruby
terlar has quit [Quit: WeeChat 1.2]
<jlebrech> i can do: a ||= b, which will replace a with b if a is nil, but how do i replace a with b if b is not nil.
symm- has quit [Ping timeout: 265 seconds]
shock_one has joined #ruby
<ljarvis> a = b && b
stan has quit [Read error: Connection reset by peer]
<ljarvis> a &= b
<jlebrech> ahh
<freezevee> umgrosscol: will something like that https://gist.github.com/zloydadka/1258463 do the job ?
<jlebrech> i'll play with that.
wallerdev has joined #ruby
<ljarvis> jlebrech: the latter doesn't work i was being silly
<ljarvis> but the former is fine
<jlebrech> ok, yeah just entered that in irb :D
commondream has quit [Ping timeout: 272 seconds]
<ljarvis> jlebrech: it's the same as a = b if b -- no need for fancy operators
<apeiros> ljarvis: huh? sure works. if you use &&
<apeiros> >> a = 1; b = 2; a &&= b; a
<ruboto> apeiros # => 2 (https://eval.in/387700)
<apeiros> >> a = 1; b = nil; a &&= b; a
<ruboto> apeiros # => nil (https://eval.in/387701)
<apeiros> errr… d'oh? :D
s2013 has joined #ruby
hectortrope has joined #ruby
<umgrosscol> freezevee: You might want to utilize a pidfile. I think there is a small wrapper application for that in deb. Lemme look up what one of the other guys here has done.
<ljarvis> I knew I was on to something
<apeiros> ah, silly. since a && b is nil then too…
<jlebrech> if statement for now?
<apeiros> so yeah, must use proper branching then :)
<jlebrech> :D
<apeiros> a = b if b
<jlebrech> that's clean enough, and less magic looking
pcfreak30 has quit [Read error: Connection reset by peer]
hectortrope has quit [Client Quit]
joonty has quit [Quit: joonty]
shock_one has quit [Ping timeout: 276 seconds]
zeroDivisible has quit [Ping timeout: 265 seconds]
<umgrosscol> freezevee: I guess daemons takes care of that for you?
fgo has quit [Ping timeout: 244 seconds]
endash has quit [Quit: endash]
towski_ has joined #ruby
eGGsha is now known as eGGshke
<umgrosscol> freezevee: Yeah. the daemonize gem is handling pidfiles for you. You can check out how it's doing that in the docs.
uptownhr has joined #ruby
eGGshke has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<freezevee> umgrosscol: any way I could do this without an external gem ?
flughafen_ has quit [Ping timeout: 265 seconds]
Xeago has joined #ruby
withnale_ has quit [Ping timeout: 246 seconds]
deric_skibotn has joined #ruby
tkuchiki has quit [Remote host closed the connection]
<Sypheren> Other than initialize, is there a list of special instance names somewhere?
moted has joined #ruby
momomomomo has quit [Ping timeout: 264 seconds]
<ljarvis> Sypheren: initialize is the only special method you need to care about when it comes to class initialization
baweaver has quit [Remote host closed the connection]
<Sypheren> ljarvis, but there aren't enough that there would be a list of them?
Igorshp_ has quit [Remote host closed the connection]
<ljarvis> Sypheren: I'm not sure exactly what you're after, there are "special" methods in Ruby (i.e initialize, and methods that are hooks) but I'm not exactly sure what you want
symm- has joined #ruby
<_blizzy_> sorry, I forgot this. here's the entire helpers.rb file. https://gist.github.com/NotBlizzard/5d89ab1a5b157b1a1046
senayar has quit [Read error: Connection reset by peer]
marciotex has joined #ruby
<ljarvis> _blizzy_: did you try what I said about commenting out branches?
<freezevee> umgrosscol: I could also run the script everytime a user calls the route in sinatra
<_blizzy_> ljarvis, yes.
<ljarvis> _blizzy_: and?
<freezevee> umgrosscol: but I'll need to run sinatra as a service
senayar has joined #ruby
senayar has quit [Changing host]
senayar has joined #ruby
Igorshp has joined #ruby
<_blizzy_> team still returned nil, even if I commented every one of them out
<adaedra> sinatra as a service? It's the new cloud?
<_blizzy_> minus the one that calls the method
<ljarvis> eh, every one of them?
<ljarvis> ah
<ljarvis> so just "request"?
<_blizzy_> yes
<ljarvis> ok, so you know it happens within those 2 lines of code, right?
sinkensabe has quit [Remote host closed the connection]
<_blizzy_> yes.
marciotex has quit [Client Quit]
<ljarvis> this code makes no sense, you're assigning variables that are local to the method
danielpclark has quit [Ping timeout: 246 seconds]
<ljarvis> they won't mutate the variables you pass in
momomomomo has joined #ruby
<_blizzy_> ljarvis, even if I have attr_accessor in my class?
<ljarvis> _blizzy_: yes, you're assigning local variables, they're lost when that method is finished
penzur has quit [Quit: Leaving]
<_blizzy_> ljarvis, so how exactly would I assign them then? I'm confused on how to do this.
<_blizzy_> oh
<_blizzy_> return
symm- has quit [Ping timeout: 265 seconds]
<diegoviola> can someone please give me an ELI5 about finite state machines, is this just another way to describe code that involves events, transitions and states?
iamninja has quit [Read error: Connection reset by peer]
Igorshp has quit [Remote host closed the connection]
<jhass> I'm sure there are excellent blog articles about that if you spent 5 minutes on google
arup_r has joined #ruby
<ljarvis> in 5 minutes you'll find them all
Zai00 has quit [Quit: Zai00]
<diegoviola> so the universe is a finite state machine?
<ljarvis> wow
<ljarvis> you cant ask mere mortals that question
<diegoviola> what?
<diegoviola> ljarvis: why not?
<_blizzy_> the universe is infinite but this battle is finished
<arup_r> any idea if Rubygems.org is down ? https://gist.github.com/aruprakshit/4b2f4a9452204e119888
<umgrosscol> diegoviola: No. Reality is definitively not a finite state machine. See Laplace's Daemon and related materials.
<diegoviola> well, FSM involves an input and an output, I don't think there's such a concept in the universe?
<diegoviola> umgrosscol: ok thanks
spider-mario has joined #ruby
freezevee has quit []
<ljarvis> it doesn't have anything to do with input or output
quimrstorres has quit [Remote host closed the connection]
serivich has quit [Ping timeout: 246 seconds]
<ljarvis> unless you think of the start state as input
<ljarvis> which you shouldn't
<diegoviola> ljarvis: the material I'm reading shows INPUT -> FSM -> OUTPUT
<diegoviola> in a diagram
<_blizzy_> ljarvis, I'm still kind of confused on how I would assign the values then.
<diegoviola> and a clock pointing to the FSM
<ljarvis> diegoviola: right, but that doesn't make up the FSM. The fact they're separate steps should point that out
<umgrosscol> diegoviola: Breifly, finite state machines are a way of modeling the possible states of a system and the transitions between them.
<ljarvis> _blizzy_: sorry I have to go :(
<_blizzy_> ljarvis, it's ok.
<diegoviola> umgrosscol: makes sense
<ljarvis> if you're still struggling in a couple hours I'll be back
<momomomomo> ljarvis: just reading the wiki page will take you a long way
<diegoviola> umgrosscol: so it's just another way to model data
<momomomomo> or whomever is asking
<diegoviola> umgrosscol: and the transitions, states, and so on
vasilakisfil has quit [Ping timeout: 256 seconds]
rjno has quit [Remote host closed the connection]
<momomomomo> diegoviola: not modeling data, but states
<diegoviola> momomomomo: right
<momomomomo> event x happens, which transition the state to Z
<momomomomo> so, if I'm a form, and someone creates me, then I'm at state 1
<umgrosscol> diegoviola: "model data" is an ambiguous and loaded phrase. I'm not sure what you mean there. For example, a light bulb has three states: on, off, and broken.
thiagovsk has joined #ruby
<diegoviola> so me going to get coffee and drinking can be modeled as a state machine
<momomomomo> if someone reviews me and approves me, then maybe I go to state 2
<momomomomo> then someone publishes me, and now I'm at state 3
renderful has joined #ruby
<umgrosscol> diegoviola: On and off tx back and forth, but broken only tx to itself.
<arup_r> any other way to download the gem ? so that I can resume my work :/
<shevy> arup_r you can direct download a gem
<diegoviola> umgrosscol: what do you mean by 'tx'?
<umgrosscol> where tx is shorthand for transition or transfer in this case.
<momomomomo> transaction
<momomomomo> or transition
<diegoviola> thanks
<_blizzy_> may someone help me with instance variables?
<momomomomo> _blizzy_: !ask
<momomomomo> ?ask
<ruboto> Don't ask to ask. Just ask your question, and if anybody can help, they will likely try to do so.
<arup_r> and then where to part what ...... I never install it manually
<shevy> arup_r problem is, no gem called "multiple-dates-picker-rails" exists
<shevy> simpy go to the project homepage at rubygems.org
charliesome has quit [Quit: zzz]
<shevy> click on the "Download" section. That gem though does not exist, so you will have a hard time downloading it :>
<momomomomo> clone it
<_blizzy_> ok then. '@team' is returning nil. however, if I add a byebug to the script after it is assigned, it has the correct values. however, once the switch/case restarts back to the beginning, @team returns nil
<shevy> ah, you must add that repository first
<_blizzy_> line 32
rjno has joined #ruby
<shevy> gem sources --add URL
<shevy> btw a .gem is just an archive, so you can also download that zip from github
<arup_r> shevy: I did it ... I have it in my Gemfile.. and then doing bundle install and getting error
<shevy> whenever you have a .gemspec file, you can build a gem
<shevy> I don't use bundler, why don't you just use "gem" itself
xomp has joined #ruby
<diegoviola> so any program can be seen as a state machine?
GitStud has joined #ruby
RobertBirnie has joined #ruby
<diegoviola> sorry I'll go read now
<umgrosscol> arup_r: What is the error?
<diegoviola> ;)
nobitanobi has joined #ruby
Exuma has joined #ruby
<momomomomo> _blizzy_: where is the get_moves function
Aswebb_ has quit [Remote host closed the connection]
<slash_nick> arup_r: gem name is wrong
<momomomomo> _blizzy_: is it in a module? class?
danielpclark has joined #ruby
<momomomomo> how is get_moves getting access to that helper
acke has quit [Remote host closed the connection]
<_blizzy_> momomomomo, neither. I'm just requiring the file
<umgrosscol> diegoviola: Generally yes, but you're edging into the realm of computer science that diverges from the applied programming aspect of it.
jahrichie has quit [Quit: Leaving.]
<momomomomo> _blizzy_: heads up: that's not a great way to do things
<xomp> Hello, would anyone be able to recommend a text editor that has syntax highlighting for Ruby in Ubuntu by chance? I'm more comfortable learning Ruby in Linux but do miss applications like Notepad++ for Windows with it's nice syntax highlighting.
<_blizzy_> momomomomo, just requiring the file is not a great way?
<umgrosscol> diegoviola: And things might not have a finite number of states, so your modeling may never complete.
<momomomomo> _blizzy_: just defining random functions, with no class / module
<_blizzy_> momomomomo, oh ok.
<_blizzy_> let me put them in modules then
cndiv has joined #ruby
<momomomomo> anyhow, _blizzy_ your issue is probably in your request_helper function
<momomomomo> or get_team
<umgrosscol> diegoviola: It's possible to write a program which only job is to create more states for itself.... in which case, your modeling would never complete. But you could probably heuristically box it in and say it has one state, "create new state" which only tx to itself.
<_blizzy_> momomomomo, ok, let me try that. thanks.
<momomomomo> it's too complex for me to sit and debug, but you might find pry helpful
gloscombe has quit [Read error: Connection reset by peer]
<momomomomo> unless you're paying me, that is
<momomomomo> :P
<momomomomo> and I'm already on the clock for my employer
<slash_nick> arup_r: make sense? you good to go now?
<arup_r> slash_nick: you are right.. there Readme is wrong.. :)
gloscombe has joined #ruby
<slash_nick> arup_r: you should give them a PR to fix things
<arup_r> I am making a PR
<shevy> arup_r I think it is just -add https://github.com
gauke has joined #ruby
<shevy> I am not sure though, I never use non-rubygems.org sites
<slash_nick> it's not a non-rubygems thing... afaik, it just goes by a different name
<diegoviola> umgrosscol: right
<shevy> ah
<arup_r> slash_nick: thanks for the idea to make the PR .. I am doing it right now
gguggi has joined #ruby
<shevy> so it was a fail on arup_r's part?
<shevy> :-)
agent_white has joined #ruby
gauke has quit [Client Quit]
<shevy> all my gems have lowercased _ btw, never -
<slash_nick> shevy: fail on the library's readme...
<agent_white> MORNING
<agent_white> \o/
Exuma has quit []
<shevy> agent_white \o/
<slash_nick> shevy: the - is for namespacing... y'know'wha'i'mean?
<shevy> no idea, I hate to type - through gem install
juanpaucar has quit [Remote host closed the connection]
ghostpl has quit [Remote host closed the connection]
<shevy> we have some odd named gems
bubbys has quit [Ping timeout: 264 seconds]
<shevy> net-http-digest_auth-1.2.1.gem
baweaver has joined #ruby
JoshL has joined #ruby
<slash_nick> shevy: that should be net_http_digest-auth probably... which i'd expect would correspond to something like NetHttpDigest::Auth
<shevy> hehehe
<slash_nick> silly... but if you use bundler to create a new gem, that's the convention it uses
droidburgundy has quit [Ping timeout: 256 seconds]
ponga has quit []
<adaedra> I'm saving dates into a database. So when I save 18:30 UTC+2, it is saved as 16:30 (which seems ok to me)
shinnya has quit [Ping timeout: 252 seconds]
<adaedra> problem is, when I retrieve it, I get 16:30 UTC+2
rdark has quit [Quit: leaving]
<adaedra> I'm not even sure where to look at
<slash_nick> shevy: my bad... net-http-digest_auth aligns with what the author implemented... Net::Http::DigestAuth
icarus has quit [Ping timeout: 244 seconds]
mikecmpbll has quit [Ping timeout: 246 seconds]
das3in has joined #ruby
uptownhr has quit [Quit: uptownhr]
Iskarlar has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
baweaver has quit [Remote host closed the connection]
<adaedra> ok, found it
<arup_r> back to work :)
anisha has quit [Quit: Leaving]
<arup_r> what you found ?
<adaedra> solution to my problem :)
ddarkpassenger has joined #ruby
<diegoviola> I just tried aasm in ruby, it's very cool
<sphex> hey. so, is setting Encoding.default_internal to a Unicode-compatible encoding the best way to make it so that concatenating arbitrary strings mostly works?
pengin has joined #ruby
sandstro_ has quit [Quit: My computer has gone to sleep.]
Xeago has quit [Remote host closed the connection]
<sphex> I guess by default most things end up in the locale encoding and also mostly just works, but as soon as you get strings from elsewhere, concatenations can end up failing... :/
JDiPierro has quit [Remote host closed the connection]
drewo has joined #ruby
yqt has joined #ruby
alex88 has quit []
senayar has quit []
Xeago has joined #ruby
<slash_nick> arup_r: way to go
quimrstorres has joined #ruby
<arup_r> I know :)
nwhirschfeld has quit [Quit: No Ping reply in 180 seconds.]
quimrstorres has quit [Remote host closed the connection]
quimrstorres has joined #ruby
renderfu_ has joined #ruby
<das3in> Hi I'm having a problem using variables in as dot-notation parameters in functions. Kinda new to Ruby, figure I'm missing something easy. Gist is self explanatory https://gist.github.com/das3in/1fa30caed86a64821e86
einarj has quit [Remote host closed the connection]
<apeiros> das3in: we don't know what `event` is
renderful has quit [Ping timeout: 246 seconds]
<sphex> das3in: I think try event.send condition, and make "paid" a symbol instead (:paid).
tubuliferous_ has joined #ruby
<das3in> Sorry here's the corresponding schema https://gist.github.com/das3in/3ba69c86e7883053808b
<adaedra>
<apeiros> ah
<apeiros> sphex figured it correctly
sinkensabe has joined #ruby
<apeiros> but sphex & das3in: use public_send, not send.
mdw has joined #ruby
sinkensabe has quit [Remote host closed the connection]
sinkensabe has joined #ruby
<umgrosscol> das3in: The .paid isn't a variable, it's a method. probably an accessor for a variable.
ddarkpassenger has quit [Quit: Textual IRC Client: www.textualapp.com]
pietr0 has joined #ruby
<Senjai> Always use public send, unless you actually need to send, in which case you're usually wrong :P
<Senjai> Good morning ruby
platzhirsch has left #ruby [#ruby]
<das3in> Hmm, I'm confused what you mean by "send" vs "public_send" - googling now
wallerdev has quit [Quit: wallerdev]
<sphex> ah ok
<umgrosscol> das3in: public_send won't work for "private" methods.
ghostpl has joined #ruby
<umgrosscol> In ruby, private is an note from the developer telling you that you probably shouldn't be calling those methods.
<umgrosscol> You can totally call them, but that's on you.
<apeiros> das3in: method_name = :paid; event.public_send(method_name)
<apeiros> das3in: works with event.send(method_name) too, but it's better to use public_send, as that respects private/protected visibility
shock_one has joined #ruby
tubuliferous_ has quit [Ping timeout: 256 seconds]
rjno has quit [Remote host closed the connection]
arturmartins has quit [Quit: Leaving...]
OrbitalKitten has quit [Quit: Textual IRC Client: www.textualapp.com]
<umgrosscol> ^ yeah. It will break when you're doing something ill advised.... so only use send when you're doing something ill advised intentionally.
woodennails has joined #ruby
jlebrech has quit [Remote host closed the connection]
fgo has joined #ruby
findaway has quit [Ping timeout: 252 seconds]
<das3in> What this told me is that I need to learn more about Ruby haha. I hear that's a common rails trap
findaway has joined #ruby
<das3in> I'm reading up on what "send" is lol. Thanks for your help though, saved this so it'll make sense later
<apeiros> send is core ruby, unrelated to rails
fabrice31 has joined #ruby
deric_skibotn has quit [Read error: Connection reset by peer]
snockerton has quit [Quit: Leaving.]
<das3in> right, why I said I need to learn more about Ruby :p
sandstrom has joined #ruby
elia has quit [Quit: Computer has gone to sleep.]
Bertg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
fgo has quit [Ping timeout: 246 seconds]
davedev24_ has quit [Ping timeout: 248 seconds]
findaway has quit [Ping timeout: 250 seconds]
<das3in> anyway using public_send and making paid a symbol worked. Thanks everyone!
momomomomo_ has joined #ruby
commondream has joined #ruby
<das3in> Can y'all recommend some good Ruby text? Learn Ruby the Hard Way?
nwhirschfeld has joined #ruby
davedev24_ has joined #ruby
fabrice31 has quit [Ping timeout: 256 seconds]
ghostpl has quit [Ping timeout: 264 seconds]
<havenwood> das3in: Here are some links: http://ruby-community.com/pages/links
timonv has joined #ruby
claw has quit [Ping timeout: 256 seconds]
j0n3 has joined #ruby
Agoldfish has joined #ruby
Mon_Ouie has quit [Quit: WeeChat 1.2]
<das3in> Thanks!
drbrain has quit [Ping timeout: 272 seconds]
rjno has joined #ruby
freerobby has quit [Quit: Leaving.]
momomomomo has quit [Ping timeout: 252 seconds]
momomomomo_ is now known as momomomomo
<apeiros> das3in: btw., "paid" as a string will work too (send/public_send both convert to symbol). but :paid is better, then ruby doesn't have to convert.
<shevy> speed trick!!!
MatthewsFace has joined #ruby
nwhirschfeld has quit [Client Quit]
j0n3 has quit [Read error: Connection reset by peer]
elia has joined #ruby
<das3in> I actually had the conditions as strings before - as soon as I used public_send they started working. Good to know about symbols. Performance is waay past where I am now but that's good to know regardless
drbrain has joined #ruby
<das3in> converted them all to symbols
pengin has quit [Remote host closed the connection]
eshy has quit [Ping timeout: 272 seconds]
<shevy> the poor strings :(
mark06 has joined #ruby
<agent_white> ":m"
m8 has joined #ruby
nofxx has joined #ruby
nofxx has joined #ruby
nwhirschfeld has joined #ruby
<shevy> damn
<shevy> that is so sexy
<Sypheren> :>
anne-marie_ has quit [Quit: Leaving]
<shevy> such a pretty girl
eshy has joined #ruby
trouloulious_dev has quit [Quit: Leaving]
choke has joined #ruby
sankaber has joined #ruby
mansel has quit [Max SendQ exceeded]
hck89 has joined #ruby
charliesome has joined #ruby
<atmosx> hello
mansel has joined #ruby
das3in has quit [Ping timeout: 246 seconds]
nwhirschfeld has quit [Client Quit]
choke has quit [Client Quit]
<shevy> yo atmosx
<shevy> everyone is looking at greece these days atmosx!
sandstrom has quit [Quit: My computer has gone to sleep.]
nwhirschfeld has joined #ruby
langlands has joined #ruby
<havenwood> >> {"=>": :"<="}
<ruboto> havenwood # => {:"=>"=>:<=} (https://eval.in/387722)
<Senjai> havenwood: It's not your shift yet!
<agent_white> I do love falafels.
<agent_white> So much.
<havenwood> Senjai: tou·ché
Igorshp has joined #ruby
<Senjai> havenwood: jk ofc <3
wallerdev has joined #ruby
timonv has quit [Read error: No route to host]
benlieb_ has joined #ruby
acke has joined #ruby
langland_ has quit [Ping timeout: 250 seconds]
<havenwood> >> :ف
<ruboto> havenwood # => :ف (https://eval.in/387723)
<havenwood> hrm
rubie has quit [Remote host closed the connection]
<Senjai> interesting
<havenwood> Yeah, I dunno if ruboto is Arabic/Hebrew compatible.
<havenwood> ?ruboto
<ruboto> I'm the channel bot, linker of the rules, adept of the facts, wielder of the banhammer.
gauke has joined #ruby
<havenwood> >> :فلاف
<ruboto> havenwood # => :فلاف (https://eval.in/387724)
hectortrope has joined #ruby
<jhass> something up with your client? displays just fine here http://cloud.aeshna.de/u/mrzyx/screenshots/screenshot_20150625_192301.png
<havenwood> Ah, never mind - pebkac
white_bear has quit [Quit: leaving]
<shevy> havenwood speaks czech
<agent_white> jhass is right, looks like a nose and eyeballs to me.
c0m0 has quit [Ping timeout: 246 seconds]
wildroman2 has joined #ruby
<shevy> yeah
<shevy> it's a smiling arab
<mark06> what happened to #ruby-lang?
hectortrope has quit [Client Quit]
<Senjai> mark06: It was merged
<shevy> mark06 jhass sent everyone to #ruby
<agent_white> \o/ yayay
<jhass> and there I thought we would survive a week without the question :/
<Senjai> s/sent/forced
<Senjai> ftfy
<shevy> haha
momomomomo has quit [Quit: momomomomo]
<havenwood> mark06: It got several characters leaner.
<mark06> Senjai, shevy: cool
<shevy> in the past, people asked why there are two different channels
<Senjai> jhass: does it forward here now?
<shevy> now they ask - what happened to one channel
<shevy> :)
<jhass> Senjai: yeah
<Senjai> shevy: Essentially, the other channel was less noob friendly, and more technical.
<apeiros> ?rubylang
<ruboto> #ruby-lang has been merged with #ruby and redirects here. If you get an "you must be invited" error (or similar) when trying to join #ruby-lang: that's because you're already in #ruby and can't be forwarded.
<Senjai> This kind of has a mix, but now we're forced to talk here, we scare people
<shevy> I disliked the forced-registration-to-talk on #ruby-lang
OrbitalKitten has joined #ruby
elia has quit [Ping timeout: 256 seconds]
<mark06> still there are people in #ruby-lang, better off making redirection to here
OrbitalKitten has quit [Client Quit]
<havenwood> jhass: The output is backwards though.
<apeiros> ?rubylang mark06
<ruboto> mark06, #ruby-lang has been merged with #ruby and redirects here. If you get an "you must be invited" error (or similar) when trying to join #ruby-lang: that's because you're already in #ruby and can't be forwarded.
OrbitalKitten has joined #ruby
<apeiros> *** and redirects here ***, emphasis added…
benlieb_ has left #ruby [#ruby]
<havenwood> jhass: Should be horizontally mirror image of what it is.
GitStud is now known as GitGud
<apeiros> and the only people in #ruby-lang are staffers.
<sphex> Encoding.default_external does not apply to files opened for writes?
t0rrieri has quit [Quit: Be back later ...]
<apeiros> sphex: yes, it does apply
<havenwood> jhass: E.g.: https://imgur.com/iGdfNhy
thelastinuit has joined #ruby
<diegoviola> what's the difference with having a script with #!/usr/bin/env ruby or #!/usr/bin/ruby
Igorshp has quit [Remote host closed the connection]
<diegoviola> ?
<Senjai> diegoviola: env is a system utility that uses your environment to determine what ruby to use
<Senjai> the other is an explicit and absolute path
<havenwood> Ew, I failed at link. Better: https://i.imgur.com/iGdfNhy.png
pglombardo has quit []
Igorshp has joined #ruby
<Senjai> diegoviola: type env in your console
<diegoviola> what does env uses to determine this?
<diegoviola> PATH?
benlieb_ has joined #ruby
<sphex> apeiros: I don't get it... File.open '/dev/null', 'w' do |f| p f.external_encoding end
<diegoviola> err I mean
<agent_white> diegoviola: Like Senjai said, it helps when having different versions of ruby installed to determine which to use.
<Senjai> Yes and no. Other programs, like rvm or chruby can use this to set ruby dynamically
<diegoviola> right
<diegoviola> ty
SolarSailor has joined #ruby
sngeth has joined #ruby
lkba_ has joined #ruby
benlieb_ has quit [Client Quit]
<Senjai> diegoviola: The tldr is, use /usr/bin/env ruby in 99% of cases
benlieb_ has joined #ruby
<atmosx> > "-" * 50000000
mtakkman has joined #ruby
<apeiros> mark06: seems you are right. for some reason forward seems to have dropped. it's back.
<apeiros> mark06: so thanks for telling :)
Igorshp has quit [Ping timeout: 256 seconds]
<atmosx> >> "-" * 50000000
<ruboto> atmosx # => /tmp/execpad-88d89c8d53e8/source-88d89c8d53e8:1:in `inspect': failed to allocate memory (NoMemoryErr ...check link for more (https://eval.in/387737)
<apeiros> !kick atmosx you know the bot isn't for spamming
atmosx was kicked from #ruby by ruboto [you know the bot isn't for spamming]
lkba has quit [Ping timeout: 256 seconds]
<Senjai> I still think ruboto should be open sourced
<diegoviola> Senjai: right, it makes more sense when having multiples rubies installed with chruby,etc
<Senjai> poke, poke
<Senjai> diegoviola: Yes
<Senjai> diegoviola: more specifically, user vs system ruby
benlieb_ has quit [Client Quit]
<diegoviola> yep
<Senjai> not all users can use /usr/bin/ruby for all operations
freerobby has joined #ruby
AugustoCesar has joined #ruby
benlieb_ has joined #ruby
<Senjai> It will essentially just give you the "right" one for the current environment
<diegoviola> what do you mean that not all users can use the system ruby?
duderonomy has quit [Ping timeout: 252 seconds]
<diegoviola> there's nothing preventing you from using /usr/bin/ruby as a user
solars has joined #ruby
towski_ has quit [Remote host closed the connection]
micmus has quit [Ping timeout: 248 seconds]
<agent_white> diegoviola: System binary vs user binary
<sphex> apeiros: was that about the encodings? are you saying that behavior changed between versions?
<wmoxam> ^^^ this discussion illustrates my least favorite thing about interpreters :p
<Senjai> diegoviola: Not by default
ndrei has joined #ruby
<apeiros> sphex: sorry, distracted
<Senjai> diegoviola: I can prevent users from using certain executables in /usr/bin if I want to
<apeiros> sphex: do you have a gist elaborating your problem? kinda lazy to scan the backlog
<nofxx> about rbenv and rvms, we could agree to point all noobs to just use your pkg manager ruby. 3 out of 5 times I come here the issue is someone with multiple ruby envs and no need for it
robustus has quit [Ping timeout: 255 seconds]
<mark06> diegoviola: in general env shebang is used for not relying on fixed paths, so it's more flexible
AugustoCesar has left #ruby ["PONG :wilhelm.freenode.net"]
michael_mbp has quit [Excess Flood]
<sphex> apeiros: sure. I'm just confused why the external encoding is different depending on the file mode: https://gist.github.com/anonymous/a98936d588e33ac14bfc
<Senjai> nofxx: no, people need to ditch rvm and rbenv entirely, and use chruby instead. The only usecase for rvm is gemsets, and thats really only if you're running a ci server
<diegoviola> Senjai: you can do anything on your system, but by default on most distros users can use the system binaries just fine
<nofxx> Senjai, ehehe exactly.. I was writing that: there's no need outside CI
<apeiros> sphex: you forgot the output?
<sphex> I guess it's supposed to be like that. I'm trying to figure out the correct ways to handle the encodings with ruby. :/
<diegoviola> mark06: I see, thanks
<sphex> apeiros: "#<Encoding:UTF-8>" for 'w' mode and nil for 'r' mode
<nofxx> Senjai, even chruby... debian is always the problem with archaic packages... point to brightbox binaries
<Senjai> diegoviola: Do you want something that works 100% of the time, or 99% of the time?
<apeiros> sphex: and your default_external is?
<sphex> apeiros: #<Encoding:UTF-8>
<Senjai> nofxx: Who uses apt, I build all rubies with ruby-install
<Senjai> ruby-install --md5 specifically
robustus|Off has joined #ruby
robustus|Off is now known as robustus
<dfockler> who uses ruby-install, I build all my rubies from source
<nofxx> Senjai, what I usually see here is that. debian or mac ppl struggling with multiple rubies
<nofxx> Senjai, who knows debian sucks know his way around ;)
<Senjai> nofxx: If they use chruby, its not difficult.
<apeiros> sphex: sounds fine? nil means it'll use the default
<Senjai> nofxx: Maybe they just dont understand their operating system? Or how to compile things properly?
<Senjai> It is a skill
<diegoviola> Senjai: neither, Linux works for me every time
<diegoviola> Senjai: I also use chruby / ruby-install btw
<Senjai> diegoviola: I can totally restrict users from using /usr/bin
<diegoviola> Senjai: and?
JDiPierro has joined #ruby
<Senjai> diegoviola: also you cannot install certain gems with the system ruby without root
pansophical has quit [Quit: Leaving.]
michael_mbp has joined #ruby
<diegoviola> Senjai: list which ones
<Senjai> diegoviola: and, just use env, it works 100% of the time
<skyjumper> is anyone else have to get approval from IT to install from homebrew/rubygems?
choke has joined #ruby
<sphex> apeiros: it does not. writing keeps the "internal" encoding of the strings instead of transcoding like reading does.
<skyjumper> just started this job, and it seems ridiculous... should i accept it as normal, or move on?
pengin has joined #ruby
ndrei has quit [Ping timeout: 246 seconds]
skade has joined #ruby
<diegoviola> skyjumper: what is ridiculous about it?
<havenwood> skyjumper: Do you mean in production or on your development machine?
nutha has quit [Ping timeout: 245 seconds]
<nofxx> skyjumper, weird... how can an IT rule prevent you from installing things on ~ ?
Musashi007 has joined #ruby
<skyjumper> diegoviola: i'm not allowed to install anything that hasn't been pre-approved
<apeiros> sphex: transcodes for me (ruby 2.2.2)
<skyjumper> havenwood: dev machine
<diegoviola> skyjumper: move on
<wmoxam> skyjumper: that's very weird :p
<apeiros> sphex: please gist an example which demonstrates the lack of transcoding
dx7 has quit [Read error: Connection reset by peer]
<skyjumper> but the money is really good. heh
mdw has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<apeiros> sphex: i.e., show the binary data which you write, and the binary data in the file
<skyjumper> so that's not at all common?
<diegoviola> skyjumper: what OS?
<skyjumper> diegoviola: OSX
dx7 has joined #ruby
<havenwood> skyjumper: How can they stop you?
<nofxx> also curious
rjno has quit [Remote host closed the connection]
<agent_white> skyjumper: Seems normal. Normally they need to do some risk-management to ensure it won't do anything naughty.
<skyjumper> havenwood: some kind of monitoring software will eventually auto-uninstall anything i install
<agent_white> Go bring them a bottle of whiskey and maybe they'll put you on a whitelist. ;P
<nofxx> skyjumper, in your HOME ? crazy... ask the guy to come with every gem and npm you need... for a common rails project that'l be ~ 1000
<sphex> apeiros: alright. thanks for looking into this! https://gist.github.com/anonymous/2a0d7f68fa74555096e7
<skyjumper> nofxx: yes, that's what they're doing
<diegoviola> skyjumper: they allow you to bring your own laptop?
<mark06> diegoviola: real world example where fixed shebang caused problems: http://bazaar.launchpad.net/~renatosilva/pidgin++/trunk/revision/207
<nofxx> skyjumper, work in something else fun in the laptop in the while
bosma has quit [Ping timeout: 265 seconds]
<skyjumper> diegoviola: nope
<diegoviola> skyjumper: they're idiots, move on
<sphex> apeiros: this writes a single byte. but if I make the mode 'w:default", then it transcodes to UTF-8 and writes the 2 bytes.
<wmoxam> skyjumper: what do other developers there do?
User458764 has joined #ruby
<skyjumper> wmoxam: there are 10 or so other rails devs... and they're accepting the restrictions as if that's totally normal
shadoi has joined #ruby
postmodern has quit [Quit: Leaving]
<agent_white> skyjumper: Still not unheard of. Kinda like DBA's getting pissed at devs trying out new ORM's that reck db performance.
<skyjumper> hence why i'm asking
pocketprotector has quit [Ping timeout: 264 seconds]
<wmoxam> skyjumper: I'd ask them for what their workarounds are
<Senjai> skyjumper: If you work at like walmart, when your systems have access to the servers locally. Sure
<shevy> walmart
<Senjai> skyjumper: Otherwise, that's crazy
<shevy> now let's not say something we can not take back!
<Senjai> shevy: Yeah, it's the only other place that I know of that does that.
<skyjumper> it's bureaucracy. corporate IT says "no unauthed software" and even the little dev teams have to comply
<Senjai> So quit
<Senjai> If corporate IT has anything to do with the development team, something wrong is going on
<Senjai> IT shouldn't have to be involved with dev at all
rubie has joined #ruby
<shevy> he has 8 kids to feed
tacit7 has joined #ruby
<skyjumper> hah... they have gitlab and github firewalled
<skyjumper> we use a 3rd party server to proxy around it
<shevy> you live in a prison!
<shevy> aha so you try to break free (freddie mercury song!)
<Senjai> Wow, I'd quit in a heartbeat
<apeiros> sphex: your gist is lacking :) but well, let me amend it
<nofxx> this remember me a friend, first day he is called in the office: "we're watching you in the camera and you dont type too much, you're fired"
<agent_white> Team Ruby, assemble! We have a rescue mission!
<nofxx> he was not suppose to think, just type...
<shevy> nofxx lol sounds quite psycho
<shevy> did he quit?
<skyjumper> maybe they're keylogging this and will just fire me instead
postmodern has joined #ruby
<shevy> ah wait
<shevy> he was fired
<nofxx> shevy, one of the two, can't quite recall... guess it was a warning and he quit, yeah
<shevy> yeah understandable
<sphex> apeiros: oh ok.. sorry, I should've made it more like a real test-case thing?
mark06 has left #ruby ["http://pidgin.renatosilva.me - Pidgin++"]
<shevy> I would not want to work under psychopaths
<nofxx> shevy, first day, they were generous
ayonkhan has joined #ruby
<shevy> :\
<apeiros> sphex: something which shows your code, expectation, and actual result
ixti has quit [Ping timeout: 244 seconds]
yqt has quit [Ping timeout: 276 seconds]
OrbitalKitten has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<apeiros> sphex: otherwise you leave me guessing… I mean from what you said before I can puzzle it together. but in general, if you want help, you make sure all puzzle pieces are around ;-)
<nofxx> skyjumper, is it some financial company? bank? military?
<skyjumper> nofxx: mega corp
allomov has joined #ruby
t0rrieri has joined #ruby
<shevy> MICROSOFT
rubie has quit [Ping timeout: 265 seconds]
BigRonnieRon has quit [Quit: Textual IRC Client: www.textualapp.com]
<skyjumper> even microsoft couldn't be that stupid
<agent_white> skyjumper: I still vote bringing them a liquor-gift in exchange for freedom. Sysadmins love whiskey.
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<apeiros> plerp. up to new horizons! figuring how to do a good API for composite adaptors/validators/processors :D
<sphex> apeiros: ok yes. running that, I get one latin-1 byte in the file. and then it attemps to read it as UTF-8 and fails to convert it.
<skyjumper> agent_white: the decision makers are probably 1500 miles away
<apeiros> sphex: ok, then let me repeat - what ruby version?
<sphex> apeiros: 2.1.6
<skyjumper> the input is appreciated... /me feels justified now
<apeiros> sphex: ok, only have 2.1.5 installed. but that runs the given piece of code correctly and fits expectation
bosma has joined #ruby
<diegoviola> skyjumper: I honestly don't understand why some corporate environments do this, how do they exepct people to get the work done when they restrict everything?
griffindy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<apeiros> so I'm a bit at a loss where it is going wrong for you
rbowlby has joined #ruby
griffindy has joined #ruby
<diegoviola> expect*
<skyjumper> diegoviola: they aren't thinking about dev teams. they're thinking about the Accounts Payable with some windows machine
<diegoviola> yes, so in other words, they're stupid
<skyjumper> and dev teams, they probably expect to just use the microsoft suite with everything included
<sphex> apeiros: oh.. so it's definitively supposed to transcode to default_encoding on writes too? well damn.. gotta figure out what is happening here. :/
t0rrieri has quit [Quit: Be back later ...]
<skyjumper> every company > 50 people i've worked for has been a mess of stupidity
fgo has joined #ruby
<apeiros> sphex: yes
baweaver has joined #ruby
<diegoviola> I work at a company where I'm supposed to use a Windows machine for work (and I do) and initially Windows was set up in such a way that I couldn't access or install anything, some coworker however gave me admin rights on Windows and I installed VBox and Arch inside of the VM, so I full screen Arch and I never get to use Windows, evne though it's running as the host OS
Muhannad has joined #ruby
<diegoviola> even*
<shevy> damn
<shevy> you conformed to them
<skyjumper> diegoviola: ruby dev job?
Muhannad has quit [Max SendQ exceeded]
<shevy> you have become a windows developer now diegoviola
baweaver has quit [Remote host closed the connection]
micmus has joined #ruby
<diegoviola> shevy: negative
lva has quit [Remote host closed the connection]
<dfockler> diegoviola: I had to do that once
<sphex> apeiros: thanks! at first I through ruby was opening files being written to in binary mode by design to preserve whatever internal encoding of the written strings. must be something wrong with my setup I guess. :/
<shevy> and you are even in denial now :)
simplyianm has joined #ruby
<diegoviola> skyjumper: they write php and js, I'm still insisting to them that I want to write Ruby, but they have a server that doesn't have ruby support
<diegoviola> shevy: not in denial, I'm using Arch
pocketprotector has joined #ruby
<shevy> on windows
<skyjumper> diegoviola: "but php runs everything"
<shevy> you painted your prison pink
husanu1 has joined #ruby
<diegoviola> shevy: it doesn't matter, I'm using arch
<shevy> on windows
<diegoviola> shevy: I get to see windows when I resume from suspend, then Arch is fullscreen
<diegoviola> and I don't see windows anymore
Muhannad has joined #ruby
Muhannad has quit [Max SendQ exceeded]
<shevy> ;P
<apeiros> naming question:
<diegoviola> shevy: yes but at some point I'll be able to run ARch on bare metal here, I doubt they'll stop me
<diegoviola> shevy: I just need an external HDD
<shevy> apeiros pick the swiss name
<apeiros> a method which does what `foo[a][b][c]` does, but `foo.NAME(a, b, c)`
<shevy> gruetzlibuetzli
claw has joined #ruby
fgo has quit [Ping timeout: 246 seconds]
<shevy> hmm
<shevy> you mean you need a name now, rather than [] ?
<apeiros> I don't like deep_fetch :-/
<shevy> how about... matrix_fetch !
<apeiros> shevy: the point is that it does a nested lookup
arup_r_ has joined #ruby
exadeci has quit [Quit: Connection closed for inactivity]
<apeiros> i.e. what you'd have to use multiple chained [] calls
<heftig> just overload []?
<simplyianm> apeiros: yes
<shevy> .deep_look .good_look .superfetch .multifetch .paren_fetch .quote_fetch .gimme
<simplyianm> law of demeter my friend
<simplyianm> law of demeter
<apeiros> heftig: I'd prefer it named
<simplyianm> it should be named
<shevy> lol
<simplyianm> !g law of demeter
<shevy> simplyianm what name would you assign?
<simplyianm> shevy: What does it look up?
mesamoo has joined #ruby
<simplyianm> what data is it supposed to get
findaway has joined #ruby
fg_ has joined #ruby
<apeiros> heftig: though defining [] as [](*keys) would be an option, as in the given case, an array will never be the key. it's either an (integer) index or a string-key.
<simplyianm> apeiros: name it depending on what the data you want is
jahrichie has joined #ruby
<shevy> how about .triple_fetch
<simplyianm> no
peter_paule has joined #ruby
<simplyianm> don't call it something like that
<simplyianm> What does your function do?
Contigi has quit [Quit: Leaving]
<shevy> but hash also has .fetch for []
<simplyianm> name it very explicitly as to what the point of its behavior is
<apeiros> simplyianm: it gets you the validation/adaptation/processing result of a composite
<simplyianm> ok
<simplyianm> so
<shevy> call it .validate_adapt_process
<simplyianm> get_validation_result(name, title, etc)
<simplyianm> or something
<heftig> simplyianm: just see the regular []/.at/.fetch as a special case of the multi-parameter one
<simplyianm> name it based on its purpose
<simplyianm> not on what the code does
jahrichie has quit [Client Quit]
arup_r_ has quit [Ping timeout: 252 seconds]
chipotle has joined #ruby
ixti has joined #ruby
symm- has joined #ruby
<_blizzy_> hello, I'm confused on how I would do this https://gist.github.com/NotBlizzard/592fb74f74f79afe200c
<simplyianm> _blizzy_: fizz
<havenwood> _blizzy_: Try it in Pry.
<simplyianm> just say fizz
<_blizzy_> simplyianm, oh, that's all? ok.
<_blizzy_> havenwood, I use irb. c:
<_blizzy_> but ok.
simplyianm has quit [Read error: Connection reset by peer]
pengin has quit [Remote host closed the connection]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
gguggi has quit [Ping timeout: 246 seconds]
simplyianm has joined #ruby
workmad3 has quit [Ping timeout: 264 seconds]
OrbitalKitten has joined #ruby
blaines has quit [Ping timeout: 250 seconds]
mtakkman has quit [Ping timeout: 276 seconds]
mandarinkin2 has quit [Ping timeout: 276 seconds]
itsmynick has joined #ruby
husanu1 has quit [Remote host closed the connection]
chipotle has quit [Quit: cheerio]
annette has joined #ruby
mandarinkin2 has joined #ruby
annette has left #ruby [#ruby]
annette has joined #ruby
baweaver has joined #ruby
<baweaver> are we going over this entire thing again? If you don't like your job then leave
<baweaver> no need to extol us on every detail and every hardship
OrbitalKitten has quit [Ping timeout: 264 seconds]
<_blizzy_> um.
ta has joined #ruby
Muhannad has joined #ruby
AlphaAtom has joined #ruby
Muhannad has quit [Max SendQ exceeded]
simplyianm has quit [Read error: Connection reset by peer]
<baweaver> referring to diegoviola's incessant complaining
<_blizzy_> oh.
simplyianm has joined #ruby
<baweaver> context helps
<jhass> baweaver: lag?
<baweaver> forgetting that I logged out for a while
<_blizzy_> because you know I'm all about that lag.
pocketprotector has quit [Ping timeout: 248 seconds]
lsmola has quit [Ping timeout: 264 seconds]
mikecmpbll has joined #ruby
Casty has joined #ruby
fg_ has quit [Ping timeout: 246 seconds]
pengin has joined #ruby
Soda has joined #ruby
micmus has quit [Ping timeout: 264 seconds]
itsmynick has quit [Quit: leaving]
pingveno_ is now known as pingveno
dgutierrez1287 has joined #ruby
bf4 has joined #ruby
t0rrieri has joined #ruby
<diegoviola> baweaver: what? when did I complain about anything?
<_blizzy_> may someone help with why @team is returning to nil? explained in the comment. https://gist.github.com/NotBlizzard/34f68d4d82ac4d0b7be9#file-battle-rb-L26
<Senjai> diegoviola: You complain enough to the point where I remember what you complained about
<Senjai> _blizzy_: You asked that yesterday
<diegoviola> Senjai: I might have complained about having to use windows but that's it
<_blizzy_> Senjai, yeah, I never figured it out.
<Senjai> _blizzy_: Wow
<Senjai> _blizzy_: Your code has gotten a lot better
<_blizzy_> Senjai, thanks.
<_blizzy_> :)
<Senjai> _blizzy_: There's still a lot more room for improvement, but don't you feel better about that?
<_blizzy_> I thought you was about to say something negative c:
<_blizzy_> yes, I do.
rjno has joined #ruby
rjno has quit [Remote host closed the connection]
cmisenas has joined #ruby
<Senjai> Everything is iterative. I told you I wasn't bashing you ..
<diegoviola> who wouldn't complain about having to use windows?
lkba has joined #ruby
<_blizzy_> Senjai, I know. I said it the wrong way.
<_blizzy_> I actually like windows
<Senjai> diegoviola: I thought it was about not getting source code
<Senjai> diegoviola: Install a vm
towski_ has joined #ruby
prestorium has quit [Ping timeout: 246 seconds]
Agoldfish has quit [Quit: G'Bye]
Xeago has quit [Remote host closed the connection]
Agoldfish has joined #ruby
<diegoviola> Senjai: no, I don't think I've complained about this, sorry in any case
lkba_ has quit [Ping timeout: 244 seconds]
TheHodge has quit [Quit: Connection closed for inactivity]
OrbitalKitten has joined #ruby
<jhass> diegoviola: to clarify, it's not about the particular issues but the general "my work sucks so much" theme
<Senjai> ^
dgutierrez1287 has quit [Ping timeout: 264 seconds]
<Senjai> diegoviola: If you're looking for empathy, I empathize. It's hard for me to console you when I would just quit in that situation and save my sanity
<Senjai> Because that's the right thing to do in that situation
<diegoviola> Senjai: I'm not looking for any of that
Or1on has joined #ruby
<Senjai> IF you dont do it, and keep complaining, it's frustrating
<Senjai> :P
<Senjai> << My point of view
Guest25 has joined #ruby
<diegoviola> jhass: someone else was complaining about his job
bubbys has joined #ruby
<apeiros> well
Guest25 is now known as gabhart
<apeiros> ?ot diegoviola
<ruboto> diegoviola, this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
<Senjai> _blizzy_: Want my suggestion on what you could do next?
<_blizzy_> Senjai, sure.
<Senjai> _blizzy_: refactoring wise? (I cant look into @team atm)
<_blizzy_> Senjai, ok.
Musashi007 has quit [Quit: Musashi007]
xomp has quit [Quit: Leaving]
<Senjai> _blizzy_: Start removing duplication. If you see three or four lines that are similar, with only one change, remove that duplication
<Senjai> _blizzy_: Get rid of the m variable
DoubleMalt has quit [Ping timeout: 246 seconds]
<_blizzy_> I actually changed the m var to message
<_blizzy_> I just forgot to update the gist
<Senjai> _blizzy_: read: http://objology.blogspot.ca/2011/09/one-of-best-bits-of-programming-advice.html and apply that to function names too
jahrichie has joined #ruby
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Senjai> Those would be my next suggestions
<_blizzy_> Senjai, ok.
<diegoviola> apeiros: ok sorry
<_blizzy_> now I gotta figure out this team bug
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Kricir has quit []
frem has joined #ruby
Agoldfish has quit [Quit: G'Bye]
OrbitalKitten has quit [Ping timeout: 264 seconds]
bf4 has quit [Quit: leaving]
swgillespie has joined #ruby
Agoldfish has joined #ruby
baweaver has quit [Remote host closed the connection]
Rickmasta has joined #ruby
hinbody has joined #ruby
bf4 has joined #ruby
gauke has quit [Quit: gauke]
pocketprotector has joined #ruby
bf4 is now known as Guest92750
DLSteve has joined #ruby
Guest92750 has quit [Client Quit]
Alina-malina has quit [Ping timeout: 248 seconds]
mansel has quit [Max SendQ exceeded]
mansel has joined #ruby
kirun has joined #ruby
OrbitalKitten has joined #ruby
x1337807x has joined #ruby
wookiehangover has quit [Ping timeout: 248 seconds]
Helheim has joined #ruby
Siyfion has quit [Quit: Textual IRC Client: www.textualapp.com]
bf4_ has joined #ruby
malconis has joined #ruby
Musashi007 has joined #ruby
<benlieb_> setting up a new mac machine. You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.
<benlieb_> should I need sudo for gem install bundler?
krz has quit [Quit: WeeChat 1.0.1]
<Senjai> benlieb_: ask diegoviola ;)
<benlieb_> diegoviola: ^
<shevy> diegoviola ^^^
<benlieb_> :)
tubuliferous_ has joined #ruby
<Senjai> benlieb_: I'm just bugging diegoviola, he argued sudo isn't required for certain gem installs.
hahuang65 has joined #ruby
<skyjumper> benlieb_: are you using the system ruby?
zendrix has joined #ruby
<Senjai> benlieb_: If you're using the system ruby, then yes. If you're using a user ruby then you wouldn't need to
<havenwood> benlieb_: You can install to your user home directory: gem install bundler --user-install
<slash_nick> am i mistaken, or can't you just enter a login shell and install... /bin/bash --login;gem install bundler ?
<diegoviola> Senjai: I never install gems as root
<Senjai> havenwood: I would recommend chruby or the like to get user specific rubies. But that also works
<diegoviola> Senjai: I don't have sudo installed either
kraljev11 has joined #ruby
<Senjai> sudo is... fantastic.
<havenwood> benlieb_: You can add to your .gemrc if you like: gem: "--user-install"
<havenwood> benlieb_: Are you a Homebrew user?
<Senjai> havenwood: Does sudo run on Mac? (serious question)
<diegoviola> actually I have sudo installed
<diegoviola> but I don't use it
<havenwood> Senjai: Yes, BSDs have sudo.
<Senjai> diegoviola: What OS?
<Senjai> havenwood: TIL
<diegoviola> Senjai: arch
<Senjai> diegoviola: Oh.
wookiehangover has joined #ruby
<Senjai> diegoviola: Sudo is fantastic. There is no downside. You should never be able to login as root, or su root
AlphaAtom has joined #ruby
<Senjai> besides sudo -i
<diegoviola> yeah I know sudo
Aswebb_ has joined #ruby
<diegoviola> I've been using linux for half my life
mcclurmc has joined #ruby
droidburgundy has joined #ruby
<Senjai> I've only used it for the past 4 years or so
<Senjai> beyond being a router, or a nfs
<sphex> apeiros: BTW, found what my problem was I think. apparently default_external doesn't work for files opened in write modes unless default_internal is also set (and this is not a bug). https://bugs.ruby-lang.org/issues/3533
tubuliferous_ has quit [Ping timeout: 276 seconds]
arooni-mobile has joined #ruby
freezevee has joined #ruby
kraljev11 has quit [Quit: kraljev11]
<freezevee> can anyone please tell me why I can't start any of my daemonized services ? https://github.com/chrisvel/apc_ups_api ?
Muhannad has joined #ruby
<apeiros> sphex: oh wow. I didn't know that. this makes so little sense.
kraljev11 has joined #ruby
OrbitalKitten has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<benlieb_> I use homebrew and chruby
<apeiros> sphex: thanks for telling!
<havenwood> benlieb_: Ah, great.
<apeiros> /sharing
<havenwood> benlieb_: Why are you using system Ruby? Just curious.
<benlieb_> I’m just setting this new work machine up and though I work from a mac personally, it’s been years since I’ve had to set it up, and things were different then
<benlieb_> havenwood: there’s only one ruby right now, so I guess so
towski_ has quit [Remote host closed the connection]
<benlieb_> I have a .ruby-version in this project, but it only says 2.0.0
<benlieb_> How would I specify a “user” ruby?
toretore has joined #ruby
<benlieb_> I used to use RVM
bronson has joined #ruby
<Senjai> benlieb_: Set up chruby :)
<benlieb_> Senjai: I just installed that.
<Senjai> Oaky
<Senjai> also install ruby-install
hck89 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<havenwood> benlieb_: The sister tool of chruby that installs Rubies is ruby-install.
cmisenas has quit [Quit: cmisenas]
<havenwood> benlieb_: Another way to install latest stable Ruby is: brew install ruby
<Senjai> Butttttt, ruby-install is the way to go
<havenwood> benlieb_: Which doesn't have to compile because they've "poured a bottle."
fabrice31 has joined #ruby
hck89 has joined #ruby
<Senjai> If you learn how to use ruby-install, your life becomes easier
<sphex> apeiros: I think they really wanted the string's encodings to be preserved when writing *by default*. default_external is set to the locale, and default_internal to nil, so these are the conditions to decided on to let writes preserve the encoding.
<skyjumper> is chruby picking up momentum against rvm/rbenv?
<Senjai> Because if you get like me, and now have 12 different ruby versions installed
<_blizzy_> could anyone help with my team problem?
<benlieb_> I have ruby-install as well
<Senjai> skyjumper: rvm is for ci servers. Chruby is for sane people. :P
<benlieb_> but I don’t see a way to specify that I use a “user” level ruby
<Senjai> benlieb_: If you install a ruby with ruby-install, chruby will pick it up automatically next time it is sourced (e.g. close and reopen your terminal, or source the chruby script manually)
<skyjumper> why not chruby everywhere then?
<Senjai> skyjumper: The same reason people still use php
<skyjumper> i switched from rvm to rbenv and it worked essentially the same
<benlieb_> so chruby will give preference to user rubies, even of the same version?
<Senjai> chruby will detect the system ruby to
<skyjumper> Senjai: because wordpress uses it, and you can hire offshore devs at $8/hr?
hck89 has quit [Client Quit]
<skyjumper> ...why people use php
<Senjai> skyjumper: Mostly because people dont like change, even if it's good for them.
Muhannad has quit [Ping timeout: 246 seconds]
<havenwood> benlieb_: It will by default remain with system Ruby. If you use auto-switching and set a default it will use that: https://github.com/postmodern/chruby#auto-switching
bronson has quit [Ping timeout: 248 seconds]
hck89 has joined #ruby
segfalt has joined #ruby
<havenwood> I haven't actually tested this but I put together instructions for using brew's Ruby with chruby: https://gist.github.com/havenwood/ba31f67c1d89ac236400
<_blizzy_> may anyone help me with line 37. https://gist.github.com/NotBlizzard/34f68d4d82ac4d0b7be9#file-battle-rb-L37 I'm desperate atm. ._.
Igorshp has joined #ruby
fabrice31 has quit [Ping timeout: 246 seconds]
<havenwood> benlieb_: ^ you could be a guinea pig and let me know if those instructions work ;)
<benlieb_> I’m trying right now
<benlieb_> It’s a bit convoluted.
<benlieb_> I don’t want to install gems with sudo, and I want to switch rubies automatically
<benlieb_> I’m trying some things out right now
podman has quit [Quit: Connection closed for inactivity]
Vols has joined #ruby
peter_paule has quit [Ping timeout: 246 seconds]
choke has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
zendrix has quit [Remote host closed the connection]
<shevy> if you install into your home dir, the gems, won't they be available to different rubies anyway?
<_blizzy_> eh, I might have to use global variables. lets try that.
<benlieb_> havenwood: it seems the easiest thing was to set a default ruby by calling chruby in my bash_profile
zendrix has joined #ruby
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
DoubleMalt has joined #ruby
<benlieb_> the ruby in ruby-version is generic (ruby.2.0.0) with no patch level
senayar has joined #ruby
senayar has joined #ruby
fgo has joined #ruby
snockerton has joined #ruby
konsolebox has quit [Quit: Leaving]
<tacit7> Does chruby have something like gemsets? Or something to mange gems across projects?
segfalt has quit [Quit: segfalt]
<postmodern> tacit7, use bundler
<postmodern> tacit7, there's also gem_home which lets you manipulate GEM_HOME to isolate gems to directories
<postmodern> tacit7, but bundler is probably what you want
serivich has joined #ruby
<tacit7> Cool, thanks.
fgo has quit [Ping timeout: 252 seconds]
danielpclark has quit [Ping timeout: 255 seconds]
Papierkorb has quit [Quit: ArchLinux completes an endless loop faster than any other distro!]
langlands has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
icarus has joined #ruby
annette has quit [Ping timeout: 265 seconds]
dopie has quit [Quit: This computer has gone to sleep]
Contigi has joined #ruby
annette has joined #ruby
benlieb_ has quit [Quit: benlieb_]
sngeth has quit [Ping timeout: 256 seconds]
<havenwood> tacit7: For non-Rails apps the main functionality that Bundler provides has even been incorporated into modern RubyGems itself. For example, to install deps relative to you app in vendor/bundle and create a Gemfile.lock you can run: gem i -g -i vendor/bundle
<havenwood> your* app
woodennails has quit [Quit: Textual IRC Client: www.textualapp.com]
bigkevmcd has quit [Ping timeout: 252 seconds]
<havenwood> Or long-form: gem install --file --install-dir vendor/bundle
bigkevmcd has joined #ruby
duderonomy has joined #ruby
rubie has joined #ruby
<havenwood> Recent CVEs so update your RubyGems in any case!: gem update --system
<_blizzy_> so, I don't want to keep asking the same question over and over.
Musashi007 has quit [Quit: Musashi007]
<_blizzy_> so I'll wait a while. ._.
mcclurmc has quit [Remote host closed the connection]
workmad3 has joined #ruby
arturmartins has joined #ruby
danielpclark has joined #ruby
<havenwood> _blizzy_: Is the gist updated with your latest code?
dopie has joined #ruby
choke has joined #ruby
<_blizzy_> let me update it
Xeago has joined #ruby
kraljev11 has quit [Ping timeout: 246 seconds]
Musashi007 has joined #ruby
ItSANgo has quit [Ping timeout: 250 seconds]
workmad3 has quit [Ping timeout: 272 seconds]
ItSANgo__ has joined #ruby
quimrstorres has quit [Remote host closed the connection]
jackjackdripper has joined #ruby
yqt has joined #ruby
sandstrom has joined #ruby
B1n4r10 has joined #ruby
serivich has quit [Ping timeout: 265 seconds]
benlieb_ has joined #ruby
allomov has quit [Ping timeout: 265 seconds]
agent_white has quit [Read error: Connection reset by peer]
benlieb_ has quit [Client Quit]
RazorX has quit [Read error: Connection reset by peer]
RazorX_ has joined #ruby
agent_white has joined #ruby
<claw> mh...
<claw> i have a ruby script which uses net/http to download a file
<claw> this works fine on linux
<claw> if i use rubyinstaller on windows the files are corrupted
rubie has quit [Remote host closed the connection]
nelsonsozinho has joined #ruby
<toretore> define corrupted
allomov has joined #ruby
jahrichie has quit [Quit: Leaving.]
<claw> toretore: gzip and webm for example: file size matches but vlc does not play the webm and 7z does not unzip the gzips and says "corrupted"
towski_ has joined #ruby
<claw> the downloaded gz files should be uncompressed by ruby but it says: invalid distance set
Igorshp has quit [Remote host closed the connection]
<claw> thats why i noticed the corruption on windows
<toretore> probably not read/written in binary mode
Igorshp has joined #ruby
baweaver has joined #ruby
charliesome has quit [Ping timeout: 256 seconds]
<claw> meeeh toretore you are right
k3asd` has joined #ruby
<claw> thank you
dorei has joined #ruby
Mellett68 has quit [Remote host closed the connection]
Xeago has quit [Read error: Connection reset by peer]
baweaver has quit [Ping timeout: 255 seconds]
aryaching has joined #ruby
simplyianm has quit [Remote host closed the connection]
charliesome has joined #ruby
cmisenas has joined #ruby
arup_r has quit [Quit: ChatZilla 0.9.91.1 [Firefox 38.0.1/2015051400]]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ndrei has joined #ruby
icarus has quit [Ping timeout: 276 seconds]
casadei has quit [Remote host closed the connection]
zendrix has quit [Remote host closed the connection]
Lucky___ has joined #ruby
revath has joined #ruby
Muhannad has joined #ruby
<_blizzy_> so, havenwood, uh.
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
griffindy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<havenwood> _blizzy_: Okay, looking.
<_blizzy_> havenwood, no rush. I was just curious if you found anything.
<havenwood> _blizzy_: Move your constants inside your class.
<_blizzy_> havenwood, ok.
Kellin has joined #ruby
<havenwood> _blizzy_: Remove all the other returns then meditate on that one ^.
pocketprotector has quit [Ping timeout: 246 seconds]
tvw has joined #ruby
<_blizzy_> havenwood, but there are multiple outcomes.
arturmartins has quit [Quit: Leaving...]
Muhannad has quit [Read error: No route to host]
dfockler has quit [Remote host closed the connection]
<havenwood> _blizzy_: Are you talking about the `return` during iteration or the other ones?
<_blizzy_> havenwood, both.
Muhannad has joined #ruby
mcclurmc has joined #ruby
soulcake has quit [Ping timeout: 276 seconds]
Muhannad has quit [Read error: Connection reset by peer]
arturmartins has joined #ruby
soulcake has joined #ruby
Muhannad has joined #ruby
<havenwood> _blizzy_: The last line of the method is implicitly returned. Remove them unless they are actually returning early.
<_blizzy_> havenwood, oh ok.
Lucky___ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<havenwood> _blizzy_: Are you really meaning to stop the iteration and return abruptly from the method with that String?
<_blizzy_> havenwood, yes.
ndrei has quit [Ping timeout: 272 seconds]
simplyianm has joined #ruby
<havenwood> _blizzy_: Look at #find and friends.
<_blizzy_> havenwood, ok.
<_blizzy_> are you talking about the @team thing?
<_blizzy_> because I still haven't figured that one out yet.
Xeago has joined #ruby
sarkyniin has quit [Ping timeout: 256 seconds]
<havenwood> _blizzy_: Show the code you're using to run it, verbatim.
mdw has joined #ruby
flughafen_ has joined #ruby
scripore has quit [Quit: This computer has gone to sleep]
Pupeno has quit [Remote host closed the connection]
<_blizzy_> havenwood, ok. it's the parser.rb file. https://gist.github.com/NotBlizzard/68e02fe04a3864787f36
Igorshp has quit [Remote host closed the connection]
sepp2k has quit [Quit: Leaving.]
Pumukel has joined #ruby
Pupeno has joined #ruby
kraljev11 has joined #ruby
Igorshp has joined #ruby
revath has quit [Ping timeout: 255 seconds]
scripore has joined #ruby
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
Scroff has joined #ruby
arturmartins has quit [Quit: Leaving...]
Scroff has quit [Remote host closed the connection]
rehat_ has joined #ruby
ndrei has joined #ruby
<rehat_> are modules like singleton classes
aapole has joined #ruby
<rehat_> ?
meph has quit [Quit: Leaving.]
<jhass> no
Yiota has joined #ruby
thelastinuit has quit [Quit: Textual IRC Client: www.textualapp.com]
ayonkhan has quit []
scripore has quit [Client Quit]
dcarmich has joined #ruby
<jhass> how did you get that impression?
<rehat_> no idea, new to ruby
pocketprotector has joined #ruby
Igorshp has quit [Ping timeout: 246 seconds]
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Scrofff has quit [Ping timeout: 244 seconds]
<jhass> well, you must've read something about them that made you come to that thought ;)
<rehat_> so modules are like a library of classes
<rehat_> I just read that you can't instantiate them
<jhass> modules can be used as namespaces, but classes can too
<rehat_> ahh
snockerton has quit [Quit: Leaving.]
<jhass> ah, but you can instantiate singleton classes, just only once
rbennacer has quit [Ping timeout: 276 seconds]
Alina-malina has joined #ruby
atomical has joined #ruby
<rehat_> thanks
mdw has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
_ht has quit [Quit: Konversation terminated!]
Pupeno has quit [Remote host closed the connection]
dblessing has quit [Ping timeout: 256 seconds]
cpruitt has quit [Quit: cpruitt]
droidburgundy has quit [Read error: Connection reset by peer]
droidburgundy has joined #ruby
x1337807x has joined #ruby
towski_ has quit [Remote host closed the connection]
freezevee has quit [Ping timeout: 252 seconds]
mdw has joined #ruby
snockerton has joined #ruby
gabhart has quit [Ping timeout: 265 seconds]
atom3 has quit [Ping timeout: 276 seconds]
dopie has quit [Quit: This computer has gone to sleep]
atom3 has joined #ruby
mary5030 has quit [Read error: Connection reset by peer]
chinmay_dd has joined #ruby
crankharder has joined #ruby
haroldwu_ has quit [Ping timeout: 252 seconds]
Musashi007 has quit [Quit: Musashi007]
pocketprotector has quit [Ping timeout: 272 seconds]
mary5030 has joined #ruby
choke has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Musashi007 has joined #ruby
jlast has quit [Remote host closed the connection]
Scroff has joined #ruby
mcclurmc has quit [Remote host closed the connection]
<havenwood> _blizzy_: Add the output you get when you run it to the gist?
<havenwood> _blizzy_: Scatter a few `p`s in there around where you run it to check what is being run when you get the output that's confusing you.
<_blizzy_> havenwood, just the output in general?
<_blizzy_> havenwood, I recently used byebug
chinmay_dd has quit [Ping timeout: 252 seconds]
mdw has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Pupeno has joined #ruby
Papierkorb has joined #ruby
commondream has quit [Remote host closed the connection]
<_blizzy_> this bug is getting on my nerves
<havenwood> _blizzy_: As in you think something is `nil`, where'd you read that? The output printed to the screen when you run this?
<_blizzy_> havenwood, I used byebug to step through it.
charliesome has quit [Ping timeout: 272 seconds]
mdw has joined #ruby
<_blizzy_> I put a byebug right after 'get_team()' is called
<_blizzy_> at that point, it has the correct values.
<havenwood> _blizzy_: And at some point in your stepping it look like `@team` is `nil`? You're likely just not inside the instance of the Battle.
baweaver has joined #ruby
<_blizzy_> havenwood, I know I'm inside battle because it takes me back to the beginning of the switch case.
<havenwood> _blizzy_: Put some `p`'s in your code and see what's happening when you actually run it.
<_blizzy_> let me try again real quick
<_blizzy_> ok
charliesome has joined #ruby
Pupeno has quit [Remote host closed the connection]
choke has joined #ruby
freezeve_ has joined #ruby
<freezeve_> can anyone help me with my daemons scripts ?
choke has quit [Client Quit]
<toretore> there is already a good answer on your so q
acke has quit [Remote host closed the connection]
<GarethAdams> Hi, is there a good convention for stopping my unit tests having side effects when I'm testing class-level attributes?
bubbys has quit [Ping timeout: 246 seconds]
<toretore> don't use class level attributes?
vickleton has joined #ruby
peter_paule has joined #ruby
<toretore> tests reveal weaknesses in the design of a program
t0rrieri has quit [Quit: Be back later ...]
<toretore> and the solution is not to work around them but to fix them
yfeldblum has joined #ruby
bubbys has joined #ruby
<freezeve_> can someone tell me what am I doing wrong ? https://github.com/chrisvel/apc_ups_api My code is pretty small
commondream has joined #ruby
vipaca has joined #ruby
<GarethAdams> so for example, rather than write a configurable module, I should write a class which is instantiated with config?
snockerton has quit [Quit: Leaving.]
Xeago has quit [Remote host closed the connection]
cpruitt has joined #ruby
<toretore> GarethAdams: it's hard to give advice without seeing the code, but something like that yes
<jhass> freezeve_: it'd help to describe what's not working/where your expectations are not met
<vipaca> @channel Does anyone know if its possible to attach a debugger to a remote ruby process without pausing the process first?
sarkyniin has joined #ruby
dopie has joined #ruby
yayfoxes has joined #ruby
<havenwood> vipaca: Maybe try pry-remote: https://github.com/Mon-Ouie/pry-remote
SolarSailor has quit [Quit: My Turing machine has gone to sleep. ZZZzzz…]
<GarethAdams> toretore: I don't have the code because I'm writing the tests first, but it's along the lines of a utility module with a MyModule.logger accessor (I realise that hypothetical code is almost as bad as no code)
<toretore> GarethAdams: gist the test code?
pocketprotector has joined #ruby
chinmay_dd has joined #ruby
<jhass> GarethAdams: new object seems easier to get right, but you could also write a reset method that sets the defaults and call it in an after each hook
<toretore> any code is better than no code
crazydiamond has joined #ruby
B1n4r10 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
wallerdev has quit [Quit: wallerdev]
<freezeve_> jhass: first of all I run ruby parse_ser.rb run and I get a permissions error
<toretore> GarethAdams: class/module level accessors are basically global variables, with everything that that brings
<freezeve_> jhass: /apc_ups_parse/parse.rb:21:in `initialize': Permission denied @ rb_sysopen - upsdata.json (Errno::EACCES)
blaines has joined #ruby
pyon has joined #ruby
<_blizzy_> havenwood, I figured it out.
senayar has quit [Remote host closed the connection]
<freezeve_> jhass: and my files are all 777 and chowned to me
<_blizzy_> I wasn't passing the team to the switch_helper
<_blizzy_> thanks for the help, havenwood :)
iamninja has joined #ruby
<jhass> freezeve_: print Dir.pwd in parse.rb, maybe it changes the working directory?
<GarethAdams> toretore: That makes total sense. I'll try removing them and make it work properly, and come back if I get stuck
<freezeve_> secondly, ruby web_ser.rb run says process with pid xxxx started but it does not run at all
swgillespie has joined #ruby
<toretore> GarethAdams: my dislike for generic "utility modules" aside, try writing it as a class which you instantiate and then pass to whatever other objects need it
<GarethAdams> :)
<toretore> logger = MyLogger.new(io: STDOUT); ContinuumTransfunctioner.new(logger: logger)
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
x1337807x has joined #ruby
<freezeve_> jhass: you're right, the ruby parse.rb runs in the current folder but with the daemon it goes to the /
mdw has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<havenwood> _blizzy_: ah, nice - you're welcome
zendrix has joined #ruby
<freezeve_> jhass: ok I entered the full path and it's ok !
pengin has quit [Remote host closed the connection]
jlast has joined #ruby
<freezeve_> jhass: ruby ups_ws.rb starts sinatra but "ruby web_ser.rb run" says "process with xxx pid started" and it doesn't
tubuliferous_ has joined #ruby
FernandoBasso has joined #ruby
simplyianm has quit [Read error: Connection reset by peer]
<freezeve_> jhass: it could be the same issue
chinmay_dd has quit [Ping timeout: 256 seconds]
vasilakisfil has joined #ruby
simplyianm has joined #ruby
<toretore> freezeve_: did you read the linked article about not daemonizing your processes?
tacit7 has quit [Quit: ERC (IRC client for Emacs 25.0.50.1)]
<freezeve_> toretore: where ?
cvtsx has joined #ruby
<toretore> [12:37:25] <havenwood> freezevee: http://www.mikeperham.com/2014/09/22/dont-daemonize-your-daemons/
<freezeve_> ah yeah I did
nelsonsozinho has quit [Remote host closed the connection]
<jhass> freezeve_: so that's your only assertion of "not working"? did you check if you can access it nonetheless?
tacit7 has joined #ruby
<toretore> and then you decided that you're going to ignore that and daemonize anyway?
chipotle has joined #ruby
<freezeve_> toretore: I am not sure I understand the author's point
lavros has quit [Quit: leaving]
cvtsx1 has quit [Ping timeout: 244 seconds]
tubuliferous_ has quit [Ping timeout: 246 seconds]
kraljev11_ has joined #ruby
<radens> Hello, I have written a fair amount of ruby, but when I write ruby I just write python and change the syntax until it works (I'm exaggerating). This is not ideal. What's a good book or site to read and learn the ins and outs of ruby itself? A lot of the books and sites about ruby are geared towards absolute beginners.
kraljev11 has quit [Ping timeout: 272 seconds]
yfeldblu_ has joined #ruby
<Senjai> radens: Pragprog
<Aria> ^
Musashi007 has quit [Quit: Musashi007]
<freezeve_> jhass: yes
<Senjai> It covers almost everything in ruby, and the ruby way of doing things. But it is not meant for "advanced" developers
<freezeve_> it runs as ruby ups_ws.rb and I can access it
<Senjai> You can skim through a lot if you know python
<freezeve_> jhass: but it doesn't If I call it from the daemon script
<Senjai> There is nothing wrong with daemonizing your daemons. Do what ever feels the most appropriate
<freezeve_> jhass: I changed the path also there
<Senjai> I usually care less
Cyclohexane has joined #ruby
wildroman2 has quit [Remote host closed the connection]
<jhass> freezeve_: "it doesn't" is not helpful
<jhass> you get a connection refused trying to make a request?
<freezeve_> no
yfeldblum has quit [Ping timeout: 264 seconds]
<jhass> then it fails how?
<freezeve_> it doesn't find the webpage
<freezeve_> at all
<jhass> use curl, not your browser
<freezeve_> like the web server isn't running
<jhass> to get a proper error message
gianlucadv has quit [Ping timeout: 264 seconds]
doertedev has quit [Quit: leaving]
<freezeve_> jhass: curl: (7) Failed to connect to 192.168.1.2 port 4567: Connection refused
fabrice31 has joined #ruby
towski_ has joined #ruby
<jhass> see, it is a connection refused after all
<jhass> does it work if you try the debug mode?
<jhass> run instead of start
<toretore> if you didn't daemonize the process you'd see the errors in your console
<freezeve_> I am calling it with run
<radens> Senjai: thanks
<freezeve_> toretore: actually it says ups_ws.rb: process with pid 2722 started.
<radens> A bit expensive though
<freezeve_> If I run it again
<freezeve_> toretore: it says another pid
simplyianm has quit [Remote host closed the connection]
<Senjai> radens: Just get the ebook. It's worth it IMO
<freezeve_> and If I execute it with "status"
<freezeve_> ups_ws.rb: no instances running
<Senjai> radens: You -can- pirate it, but if you found it good you should most certainly purchase it
<toretore> no, get rid of the daemon bs
<ljarvis> moin
<Senjai> radens: Every pragprog book is good
<toretore> `ruby ups_ws.rb`
<toretore> then watch the output in the terminal
<freezeve_> toretore: If I run it like that it works OK
<freezeve_> I can see the page and everything
<toretore> define works ok
<toretore> ok
pdoherty has quit [Quit: Leaving]
<freezeve_> it fails when running through the daemon script
<toretore> so then just do that
t0rrieri has joined #ruby
<toretore> don't try to daemonize
<freezeve_> why ?
<toretore> it's bs
kraljev11_ has quit [Ping timeout: 264 seconds]
<freezeve_> that's a nice reason
<freezeve_> lol
<toretore> why do you need it?
mcclurmc has joined #ruby
<freezeve_> I don't want to run manually the sinatra web server every time
<freezeve_> I just want both processes running in the background and on every boot
arturhoo has quit [Quit: arturhoo]
<toretore> and your web_ser.rb file achieves this how?
peter_paule has quit [Ping timeout: 265 seconds]
mcclurmc has quit [Remote host closed the connection]
fabrice31 has quit [Ping timeout: 272 seconds]
peter_paule has joined #ruby
<toretore> it doesn't magically get run on boot any more than the other file
<freezeve_> first step, make it a daemon, second step make it a service in ubuntu server that I am running
mcclurmc has joined #ruby
<toretore> the first step is unnecessary
<freezeve_> what do you suggest ?
sdwrage has joined #ruby
<toretore> if you'd read the article you'd know that upstart and systemd, which ubuntu uses, doesn't expect you to daemonize your process manually
rubie has joined #ruby
annette has quit [Quit: annette]
<Senjai> toretore: You would only use that for a server wide process.
<toretore> what
rubie has quit [Remote host closed the connection]
<Senjai> toretore: Some daemons need to be ran by a user. and only for that user
rubie has joined #ruby
<Senjai> e.g. www running unicorn daemons
atom3 has quit [Ping timeout: 277 seconds]
<freezeve_> toretore: I've read about upstart... do you think it's a right way to achieve what I want ?
<toretore> how's that any different?
<toretore> yes, upstart will do what you want
<toretore> forget about this daemonizing bs
<adaedra> Senjai: in my memory, unicorn knows how to setuid itself, no?
jlast has quit [Remote host closed the connection]
<Senjai> adaedra: You would probably still want a script for starting stopping etc.
atom3 has joined #ruby
<adaedra> yes, the systemd unit/upstart whatever
yayfoxes has quit [Ping timeout: 265 seconds]
<Senjai> right, but sudo.
jfury has joined #ruby
adamjleonard has quit [Quit: Leaving...]
<Senjai> the www user should not have access to unit/upstart
<adaedra> and it doesn't...?
dgutierrez1287 has joined #ruby
pengin has joined #ruby
<Senjai> toretore: I see.
<Senjai> toretore: Hmm, we might just be doing it a different way. We use monit to manage our processes and things.
danielpclark has quit [Ping timeout: 256 seconds]
<Senjai> monit restarts them using scripts in the application shared directory
<adaedra> It seems normal to me that the init system manages daemons
<Senjai> Also, when you have multiple applications on a box, there's the issue of "which" unicorn to restart
<adaedra> it's its /job/
bronson has joined #ruby
ReD-BoY_ has quit [Ping timeout: 264 seconds]
<toretore> well, monit is not upstart
<Senjai> I know..
<Senjai> 'not saying it is
<Senjai> We use both.
<toretore> so whatever rules you're applying to it don't apply to upstart
A205B064 has joined #ruby
simplyianm has joined #ruby
shinnya has joined #ruby
droidburgundy has quit []
peter_paule has quit [Ping timeout: 246 seconds]
<toretore> monit is good if you want additional checks on process status, but honestly i believe that upstart or systemd is enough
Soda has quit [Remote host closed the connection]
ryba has joined #ruby
flughafen_ has quit [Ping timeout: 246 seconds]
<toretore> systemd has support for arbitrary "status checks"
GitGud has quit [Ping timeout: 272 seconds]
<Senjai> again, how do you manage multiple applications with upstart?
<Senjai> e.g. what if I want to stop one application
revath has joined #ruby
<toretore> one conf per app?
<toretore> `stop app1`
<toretore> `stop app2`
centrx has joined #ruby
<toretore> simple as that
dgutierrez1287 has quit [Ping timeout: 264 seconds]
baweaver has quit [Remote host closed the connection]
<bougyman> we've used runit for ruby apps for 13 years.
<Senjai> I must be really out of my knowledge on upstart, or I just haven't written it in a long as stime
__butch__ has joined #ruby
vdamewood has joined #ruby
jfury has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
<Senjai> bougyman: Aye I remember you mentioning
dfockler has joined #ruby
<bougyman> it works under systemd or upstart, too
<bougyman> if you just want dead-simple supervision (as an unprivved user, too)
<adaedra> I don't know upstart and know badly systemd, but init scripts used (and are still under BSD) shell scripts
bronson has quit [Ping timeout: 244 seconds]
<adaedra> I hope they kept the flexibility it gave
jtbnyc69 has quit [Quit: ERC (IRC client for Emacs 24.5.1)]
<Senjai> Wasn't it just a shell script that had to respond to a certain set of commands?
<adaedra> yes
Voker57 has joined #ruby
<Senjai> I would be shocked if they didn't
<adaedra> FreeBSD init system was simple yet powerfull
<adaedra> s/was/is/
<toretore> except every single init script was shitty
Xeago has joined #ruby
<toretore> good in theory, not so good in practice
<adaedra> that's what systemd tries to fix, no?
<toretore> systemd may be a monster, but it does a good job
<adaedra> I didn't say it didn't
quimrstorres has joined #ruby
jlast has joined #ruby
revath has quit [Ping timeout: 255 seconds]
<toretore> most people, me included, are simply not knowledgeable enough to write good init scripts and do things the unix way
wallerdev has joined #ruby
<adaedra> mh
jenrzzz has joined #ruby
<shevy> huh
Zai00 has joined #ruby
<shevy> I am not knowledgable either but that never stops me!
Rickmasta has joined #ruby
simplyianm has quit [Read error: Connection reset by peer]
<toretore> bougyman: i imagine runit to be good as a pid 1 for containers like docker, when you need to run multiple processes
baweaver has joined #ruby
yayfoxes has joined #ruby
agent_white has quit [Quit: back in a bit]
<shevy> ra ra ra undeadra ra ra
simplyianm has joined #ruby
quimrstorres has quit [Remote host closed the connection]
<adaedra> --__--
ZoanthusR has joined #ruby
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
codecop has quit [Remote host closed the connection]
danielpclark has joined #ruby
quimrsto_ has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
yfeldblu_ has quit [Remote host closed the connection]
yfeldblum has joined #ruby
yayfoxes has quit [Ping timeout: 256 seconds]
j4cknewt has joined #ruby
quimrsto_ has quit [Remote host closed the connection]
workmad3 has joined #ruby
bf4_ has quit [Quit: leaving]
langlands has joined #ruby
dopie has quit [Quit: This computer has gone to sleep]
diegoviola has quit [Quit: WeeChat 1.2]
<radens> Hey, what's the difference between these two examples? https://pastebin.osuosl.org/27416/
workmad3 has quit [Ping timeout: 256 seconds]
jlast has quit [Remote host closed the connection]
bf4 has joined #ruby
quimrstorres has joined #ruby
<radens> Also, is `handles :class` a method call where you're passing in a symbol?
<adaedra> In one you define #process, in the second you call .process with a block
<adaedra> yes, you call .handles
dblessing has joined #ruby
FernandoBasso has quit [Quit: WeeChat 1.2]
jpfuentes2 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
simplyianm has quit [Read error: Connection reset by peer]
<radens> Okay, what's the difference between using a method and a block here?
<Senjai> radens: process do uses the class method process, the other one defines an instance method
ldnunes has quit [Quit: Leaving]
simplyianm has joined #ruby
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
langland_ has joined #ruby
Chemist has joined #ruby
Carnage\ has joined #ruby
benlieb_ has joined #ruby
B1n4r10 has joined #ruby
skade has quit [Quit: Computer has gone to sleep.]
acke has joined #ruby
yayfoxes has joined #ruby
<_blizzy_> ugh
<_blizzy_> this is still returning nil
<ljarvis> radens: it's semantics, depends on how the superclass handles it
langlands has quit [Ping timeout: 252 seconds]
<ljarvis> _blizzy_: you've had quite the day
JDiPierro has quit [Remote host closed the connection]
snsei has joined #ruby
<_blizzy_> ljarvis, yep.
<_blizzy_> this bug
<_blizzy_> is killing me
<_blizzy_> from the inside
<adaedra> good good.
<ljarvis> _blizzy_: I think the best thing to do is really try and delete as much code as possible until you have the smallest failing example
<adaedra> let the hate flow through you.
Scroff has quit [Remote host closed the connection]
<hal_9000> ljarvis: that is a good general principle
vickleton has quit [Remote host closed the connection]
hck89 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sarkyniin has quit [Ping timeout: 252 seconds]
slawrence00 has quit [Ping timeout: 264 seconds]
Pupeno has joined #ruby
Pupeno has joined #ruby
skade has joined #ruby
<ljarvis> in other news I've spent a good 20 minutes on api design of 3 C functions and a struct
<ljarvis> fml i'm so pedantic
<_blizzy_> I'm so mad
<Senjai> ljarvis: That's nothing
<_blizzy_> because I can't find this bug
<_blizzy_> I
<Senjai> ljarvis: I've spent an entire day on structure for a problem
<_blizzy_> *i'm going to post one last time
<_blizzy_> then I give up
<ljarvis> Senjai: this wasn't a problem, it's new code :(
hck89 has joined #ruby
<ljarvis> _blizzy_: don't give up
<Senjai> ljarvis: Code is meant to solve a problem :P
<ljarvis> Senjai: touche
<_blizzy_> ljarvis, but giving up is easy.
<_blizzy_> :<
<ljarvis> you've spent longer than most would on it already
<ljarvis> so you're doing well
<hal_9000> Senjai: ohhh, is that it? i thought i was supposed to *create* problems...
<Senjai> hal_9000: It does that too
acke has quit [Ping timeout: 272 seconds]
<ljarvis> hal_9000: it's a nice side effect
<ljarvis> i need to stop writing parsers
<hal_9000> next you’ll tell me it’s not “survival of the fattest”
<Senjai> Hey man, being fat is a choice :P
<Senjai> Unless it isnt, but it rarely isnt
<toretore> _blizzy_: you're trying to do way too much at once, too fast, that's how you get bugs
snockerton has joined #ruby
<ljarvis> #truth
<Senjai> _blizzy_: ^
Pupeno_ has joined #ruby
<toretore> you end up with a house of cards
<_blizzy_> so what should I do now
<Senjai> _blizzy_: You should design your program iteratively. Start by only handling one message
<_blizzy_> I can't continue if this part doesn't work
<Senjai> then handle each other message iteratively
<adaedra> ljarvis: I spend so much time trying to make database schemas :<
<ljarvis> adaedra: :D in raw SQL?
rodfersou has quit [Quit: leaving]
<_blizzy_> Senjai, I've did that
<ljarvis> adaedra: ah, design them?
<_blizzy_> I'm stuck at 'switch'
<Senjai> adaedra: Why can't they just denormalize themselves, i mean come on
<_blizzy_> because @team returns an empty array
<adaedra> ljarvis: yep, designing
<Senjai> _blizzy_: Dont use switch :)
quimrstorres has quit [Remote host closed the connection]
<_blizzy_> Senjai, I mean the name of the message
<ljarvis> adaedra: I do that a lot too
Pupeno_ has quit [Remote host closed the connection]
<_blizzy_> is named switch
<toretore> _blizzy_: problem solving: divide each problem into smaller problems until you can't divide any more, then solve each of these problems on their own
simplyianm has quit [Read error: Connection reset by peer]
<Senjai> Also what toretore said, but I know you've been working on that
tommylom1ykins is now known as tommylommykins
<toretore> _blizzy_: where's your code?
Pupeno has quit [Ping timeout: 256 seconds]
simplyianm has joined #ruby
yayfoxes has quit [Ping timeout: 246 seconds]
j4cknewt has quit [Remote host closed the connection]
x1337807x has joined #ruby
j4cknewt has joined #ruby
<_blizzy_> toretore, at line https://gist.github.com/NotBlizzard/cf8bfeda56f181f9a672#file-battle-rb-L60, @team is [], however at line 37, @team is a full array.
<_blizzy_> the array keeps getting reset somewhere.
yayfoxes has joined #ruby
zendrix has quit [Remote host closed the connection]
cmisenas has quit [Quit: cmisenas]
<Senjai> eh
<Senjai> nvm
xelkarin has joined #ruby
<Senjai> _blizzy_: Freeze the team
m8 has quit [Ping timeout: 256 seconds]
<Senjai> _blizzy_: @team = [].freeze
<_blizzy_> Senjai, heh.
<_blizzy_> I was thinking of that
<Senjai> whenever its modified, you'll get an exception
<Senjai> I still think this is a byebug issue though. unless its showing up in your actuial code
sarkyniin has joined #ruby
sarkyniin has quit [Remote host closed the connection]
sarkyniin has joined #ruby
<havenwood> _blizzy_: What are you doing in byebug? You're probably just checking an instance variable outside of the scope of the instance.
<Senjai> ^
<_blizzy_> havenwood, yeah, but I'm also running the code.
Pupeno has joined #ruby
<Senjai> I've mentioned byebug is terrible all the time
<Senjai> but
<_blizzy_> when I backtrace, it goes back to the line
<havenwood> _blizzy_: What's the output from running the code that makes you think something is wrong?
<Senjai> _blizzy_: change line 36 and 37 to: @team = get_team(message[2], @have_team).flatten.freeze
<_blizzy_> Senjai, ok, let's try that
<ljarvis> I don't think that'll help, if team is "nil" it means the var is being modified, not the object
<ljarvis> i.e meaning freezing won't make a difference
<_blizzy_> it's not nil anymore
<_blizzy_> it's returning [] now
<ljarvis> since you froze it?
<_blizzy_> no
<ljarvis> since when?
devdazed has quit [Ping timeout: 255 seconds]
<_blizzy_> since like 2 hours ago
<_blizzy_> let me pastie the error
<adaedra> *blinks*
workmad3 has joined #ruby
<Senjai> Ugh
<Senjai> I wrote so much code for this feature
simplyianm has quit [Read error: Connection reset by peer]
<hal_9000> it’s still nil
<ljarvis> no it's not @team being nil
<hal_9000> you’re trying to invoke [] on nil
<ljarvis> one of those messy lines is not returning what you think it is
<Senjai> _blizzy_: I'll take a look at this after work if you're still around
<_blizzy_> Senjai, ok.
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Senjai> _blizzy_: You'll have to provide me with a working application
<_blizzy_> Senjai, ok
<Senjai> Or one I can run
bf4 has quit [Ping timeout: 265 seconds]
<Senjai> though
<ljarvis> eh
AlphaAtom has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
simplyianm has joined #ruby
rubie has quit [Remote host closed the connection]
EagleDelta has quit [Read error: Connection reset by peer]
<ljarvis> _blizzy_: why do you download POKEDEX_URL twice, both with different http libraries?
<ljarvis> both in the same method
<ljarvis> like.. everywhere
<_blizzy_> ljarvis, I was switching from RestClient to Faraday, and I forgot to remvoe the RC lines
dblessing has quit [Quit: Textual IRC Client: www.textualapp.com]
<_blizzy_> let me do that now
<_blizzy_> while its on my mind
<Senjai> _blizzy_: What's your timezone
<_blizzy_> EST
<Senjai> k, I'm off at 5 PST.
<ljarvis> _blizzy_: ok, you realise you download and parse the same http response in almost all of your methods, right?
<Senjai> it's 2:30 ish atm
<ljarvis> Senjai: seriously? people are helping
<Senjai> ljarvis: I'm not saying don't help :P
quimrstorres has joined #ruby
workmad3 has quit [Ping timeout: 246 seconds]
<shevy> Senjai I just misread this from:
<shevy> "<Senjai> I wrote so much code for this feature"
<shevy> to
<ljarvis> _blizzy_: I'm confused about this line: "JSON.parse(Faraday.get(POKEDEX_URL).body)[opponent[:name]]['baseStats']['spe']"
<shevy> "<Senjai> I wrote so much code for the future"
skade has quit [Quit: Computer has gone to sleep.]
<Senjai> lol
<shevy> which totally confused me for a moment
<_blizzy_> time traveling code
<_blizzy_> new movie
<Senjai> shevy: <3
langland_ has quit [Ping timeout: 272 seconds]
<_blizzy_> ljarvis, it gets the speed based off of the name of the Pokemon
<_blizzy_> what I'm going to do is just get them all once, then store it in a variable
workmad3 has joined #ruby
<ljarvis> _blizzy_: great, this is the kind of refactoring that will help dig up the bug
<ljarvis> as toretore mentioned, you need to break it down until it can't be broken down anymore
quimrstorres has quit [Remote host closed the connection]
<toretore> your class shouldn't know anything about downloading and parsing json
fmcgeough has quit [Quit: fmcgeough]
malconis has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<Senjai> shevy: It's okay, someone once sent this: http://imgur.com/hqDNw4t and asked me to review it. I will never forget that moment
findaway has quit [Ping timeout: 256 seconds]
<shevy> wow
revath has joined #ruby
kadoppe has quit [Ping timeout: 246 seconds]
<Senjai> Needless to say we dont work with them anymore ;)
<jhass> Senjai: let me guess, all whitespace?
<Senjai> jhass: No, this is an actual feature branch
<Senjai> It's all code
<Senjai> Here's the funny thing: IT was a wip
<jhass> derp
kirun has quit [Quit: Client exiting]
Casty has quit [Ping timeout: 255 seconds]
<Senjai> he wanted to merge it because it was getting big
<Senjai> instead of incremental PR's behind a feature gate
<Senjai> So it wasn't even finished or fully functional when it was merged
kadoppe has joined #ruby
pengin has quit [Remote host closed the connection]
ndrei has quit [Ping timeout: 246 seconds]
hahuang6_ has joined #ruby
<shevy> ah well
<shevy> a flawed codebase is a bad codebase
<shevy> a naughty codebase
<Senjai> It was a new developer for a client
<Senjai> the codebase was fine ish before he got there
<Senjai> I wish I could name the guy for the lols, but I can't
quimrstorres has joined #ruby
<Senjai> :(
aapole has quit [Ping timeout: 265 seconds]
<toretore> what's the opposite of ancestor?
<ljarvis> toretore: descendant
<toretore> right, thanks
rjno has joined #ruby
ndrei has joined #ruby
choke has joined #ruby
ItSANgo__ has quit [Ping timeout: 252 seconds]
revath has quit [Ping timeout: 256 seconds]
quimrstorres has quit [Ping timeout: 252 seconds]
yayfoxes has quit [Ping timeout: 252 seconds]
simplyianm has quit [Read error: Connection reset by peer]
decoponio has quit [Quit: Leaving...]
FernandoBasso has joined #ruby
simplyianm has joined #ruby
Carnage\ has quit []
rbowlby has quit [Ping timeout: 252 seconds]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
baweaver has quit [Remote host closed the connection]
theery has quit []
s2013 has joined #ruby
shock_one has quit [Remote host closed the connection]
jenrzzz has joined #ruby
j4cknewt has quit [Remote host closed the connection]
Aswebb_ has quit [Remote host closed the connection]
B1n4r10 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rehat_ has quit []
rbowlby has joined #ruby
nertzy has joined #ruby
jlast has joined #ruby
umgrosscol has quit [Quit: Quit]
rjno has quit []
kloeri has quit [Ping timeout: 612 seconds]
j4cknewt has joined #ruby
revath has joined #ruby
sngeth has joined #ruby
Scrofff has joined #ruby
freezeve_ has quit []
jlast_ has joined #ruby
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jlast has quit [Read error: Connection reset by peer]
maciejczyzewski has joined #ruby
hahuang6_ has quit [Quit: Textual IRC Client: www.textualapp.com]
qhartman has quit [Quit: Ex-Chat]
olistik has quit [Remote host closed the connection]
pengin has joined #ruby
Xeago has quit [Remote host closed the connection]
mfranzwa has quit [Quit: mfranzwa]
jenrzzz has quit [Ping timeout: 256 seconds]
endash has joined #ruby
zendrix has joined #ruby
snsei has quit [Remote host closed the connection]
<_blizzy_> so
<_blizzy_> I find this weird
<_blizzy_> about my problem, I froze the array, and checked it with byebug using @team.frozen?. it returned true
<_blizzy_> however, when the switch case restarted, it was unfrozen
<_blizzy_> I thought arrays can't be unfrozen
jerius has quit [Quit: /quit]
<Senjai> _blizzy_: It was probably reassigned, and not modified
<Senjai> _blizzy_: Compare the object_ids
Scroff has joined #ruby
<Senjai> >> a = []; print a.object_id + " "; a << 2; print a.object_id;
<ruboto> Senjai # => String can't be coerced into Fixnum (TypeError) ...check link for more (https://eval.in/387864)
Pupeno has quit [Remote host closed the connection]
<Senjai> >> a = []; print "#{a.object_id} "; a << 2; print a.object_id;
<ruboto> Senjai # => 547459230 547459230nil (https://eval.in/387865)
j4cknewt has quit [Remote host closed the connection]
<_blizzy_> ok then
solars has quit [Ping timeout: 264 seconds]
baweaver has joined #ruby
maciejczyzewski has quit [Quit: leaving]
<_blizzy_> hmm, the object_ids are different
<_blizzy_> however I don't see where it is being reassigned
<ljarvis> you re-assign it on every call
mfranzwa has joined #ruby
Scroff_ has joined #ruby
simplyianm has quit [Read error: Connection reset by peer]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<_blizzy_> so how would I not re-assign it every call?
<_blizzy_> also, the method should only run once
<_blizzy_> since the boolean switches to true after the first run
simplyianm has joined #ruby
Scrofff has quit [Ping timeout: 244 seconds]
Jackneill has quit [Remote host closed the connection]
rubie has joined #ruby
Scrofff has joined #ruby
Scroff has quit [Read error: Connection reset by peer]
atom3 has quit [Ping timeout: 276 seconds]
atom3 has joined #ruby
chouhoulis has joined #ruby
totimkopf has quit [Quit: WeeChat 0.4.3]
mary5030 has quit [Remote host closed the connection]
dopie has joined #ruby
j4cknewt has joined #ruby
Scroff_ has quit [Ping timeout: 276 seconds]
RegulationD has quit [Remote host closed the connection]
tubuliferous_ has joined #ruby
nettoweb has quit [Read error: Connection reset by peer]
Pupeno has joined #ruby
chouhoulis has quit [Ping timeout: 246 seconds]
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Zai00 has quit [Quit: Zai00]
pengin has quit [Remote host closed the connection]
Scroff has joined #ruby
workmad3 has quit [Ping timeout: 256 seconds]
<ljarvis> _blizzy_: you could have written a smallest possible reproduction of your code 5 times over by now
blue_deref has quit [Quit: bbn]
pengin has joined #ruby
chipotle has quit [Quit: cheerio]
tubuliferous_ has quit [Ping timeout: 272 seconds]
phizzbuzz has joined #ruby
icarus has joined #ruby
ruv has quit [Ping timeout: 248 seconds]
<shevy> not if he lacks the skills :)
simplyianm has quit [Read error: Connection reset by peer]
Scroff_ has joined #ruby
Scrofff has quit [Ping timeout: 272 seconds]
<ljarvis> s/he doesn't lack the skills
icarus has quit [Client Quit]
<toretore> _blizzy_: can you gist all the files in their current state?
icarus has joined #ruby
simplyianm has joined #ruby
CamonZ has quit [Quit: Textual IRC Client: www.textualapp.com]
icarus has quit [Client Quit]
maciejczyzewski has joined #ruby
icarus has joined #ruby
<maciejczyzewski> hi folks!
Rickmasta has joined #ruby
ndrei has quit [Ping timeout: 252 seconds]
geiltalasdair has joined #ruby
fabrice31 has joined #ruby
Scrofff has joined #ruby
Scroff has quit [Ping timeout: 244 seconds]
Xiti has quit [Ping timeout: 272 seconds]
drewo has quit [Quit: WeeChat 1.2]
wallerdev has quit [Quit: wallerdev]
<jhass> hi
Scroff_ has quit [Ping timeout: 250 seconds]
drewo has joined #ruby
nertzy has quit [Quit: This computer has gone to sleep]
jlast_ has quit [Remote host closed the connection]
geilt has quit [Ping timeout: 255 seconds]
simplyianm has quit [Read error: Connection reset by peer]
<Senjai> what jhass said
fabrice31 has quit [Ping timeout: 252 seconds]
x1337807x has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
michael_mbp has quit [Excess Flood]
avahey has joined #ruby
simplyianm has joined #ruby
Evan- is now known as EvanGuru
workmad3 has joined #ruby
Pupeno has quit [Remote host closed the connection]
tacit7 has quit [Ping timeout: 255 seconds]
sinkensabe has quit [Remote host closed the connection]
swgillespie has joined #ruby
michael_mbp has joined #ruby
<_blizzy_> toretore, I can do one better. https://github.com/NotBlizzard/blizzybotrb
Pumukel has quit [Ping timeout: 252 seconds]
olistik has joined #ruby
workmad3 has quit [Ping timeout: 246 seconds]
mikecmpbll has quit [Quit: i've nodded off.]
Xiti has joined #ruby
Alina-malina has quit [Ping timeout: 246 seconds]
simplyianm has quit [Read error: Connection reset by peer]
<maciejczyzewski> _blizzy_: fancy project ;)
<_blizzy_> maciejczyzewski, thanks. :)
rubie has quit [Remote host closed the connection]
ZoanthusR has quit [Quit: Linkinus - http://linkinus.com]
simplyianm has joined #ruby
sandstrom has quit [Quit: My computer has gone to sleep.]
Ropeney has joined #ruby
olistik has quit [Remote host closed the connection]
shoutsid has joined #ruby
datanoise has quit [Ping timeout: 265 seconds]
hck89 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
hck89 has joined #ruby
cpruitt has quit [Read error: Connection reset by peer]
centrx has quit [Quit: Shutting down, Please wait...]
JDiPierro has joined #ruby
Rickmast_ has joined #ruby
bnizzle1 has joined #ruby
cpruitt has joined #ruby
geiltalasdair has quit [Ping timeout: 272 seconds]
Scroff has joined #ruby
mesamoo has quit [Excess Flood]
chussenot has joined #ruby
Scrofff has quit [Ping timeout: 264 seconds]
kadoppe has quit [Ping timeout: 250 seconds]
bnizzle has quit [Ping timeout: 250 seconds]
mesamoo has joined #ruby
dcarmich has quit [Quit: Textual IRC Client: www.textualapp.com]
sdwrage_ has joined #ruby
fgo has joined #ruby
icebourg has quit []
sdwrage has quit [Ping timeout: 250 seconds]
bigkevmcd has quit [Ping timeout: 250 seconds]
Pupeno has joined #ruby
Pupeno has joined #ruby
<Senjai> Note: This is a personal project, so all git requests will be ignored.
<Senjai> Lol
kadoppe has joined #ruby
Rickmasta has quit [Ping timeout: 256 seconds]
cpruitt has quit [Client Quit]
simplyianm has quit [Read error: Connection reset by peer]
PaulCapestany has quit [Quit: .]
simplyianm has joined #ruby
jfarmer has joined #ruby
serivich has joined #ruby
hinbody has quit [Quit: leaving]
bronson has joined #ruby
fgo has quit [Ping timeout: 256 seconds]
icarus has quit [Quit: Lost terminal]
Igorshp has joined #ruby
shock_one has joined #ruby
serivich has quit [Ping timeout: 248 seconds]
<_blizzy_> why is that funny. c:
<Senjai> Why wouldnt you accept PR's
tvw has quit [Ping timeout: 252 seconds]
<Senjai> if someone wanted to send one in :P
bronson has quit [Ping timeout: 250 seconds]
baweaver has quit [Remote host closed the connection]
<_blizzy_> reasons I'd rather not talk about.
xelkarin has quit [Ping timeout: 264 seconds]
charliesome has quit [Quit: zzz]
<Senjai> umm, ok
Igorshp has quit [Ping timeout: 248 seconds]
shock_one has quit [Ping timeout: 244 seconds]
allomov has quit [Remote host closed the connection]
dopie has quit [Quit: This computer has gone to sleep]
MatthewsFace has quit [Remote host closed the connection]
casadei has joined #ruby
whippythellama has quit [Quit: WeeChat 1.2]
mfranzwa has quit [Quit: mfranzwa]
arooni-mobile has quit [Ping timeout: 248 seconds]
casadei has quit [Ping timeout: 252 seconds]
hck89 has quit [Quit: Textual IRC Client: www.textualapp.com]
Janusz1_ is now known as Janusz1
wallerdev has joined #ruby
zendrix has quit [Remote host closed the connection]
Xeago has joined #ruby
freerobby has quit [Quit: Leaving.]
zendrix has joined #ruby
zeroDivisible has joined #ruby
__butch__ has quit [Quit: Linkinus - http://linkinus.com]
revath has quit [Ping timeout: 265 seconds]
revath has joined #ruby
mfranzwa has joined #ruby
jenrzzz has joined #ruby
<havenwood> Maybe to tempt us to Pull Request some tests since we're not allowed!
<havenwood> Clever, clever...
chouhoulis has joined #ruby
GitGud has joined #ruby
Xeago has quit [Ping timeout: 246 seconds]
Takasm has joined #ruby
RegulationD has joined #ruby
mfranzwa has quit [Client Quit]
tvw has joined #ruby
snsei has joined #ruby
t0rrieri has quit [Quit: Be back later ...]
JoshL has quit []
DLSteve has quit [Quit: Leaving]
chouhoulis has quit [Ping timeout: 272 seconds]
chipotle has joined #ruby
rbowlby_ has joined #ruby
bronson has joined #ruby
dfockler has quit [Remote host closed the connection]
RegulationD has quit [Ping timeout: 276 seconds]
rbowlby has quit [Ping timeout: 246 seconds]
tvw has quit [Client Quit]
rbowlby has joined #ruby
Scroff has quit [Remote host closed the connection]
serivich has joined #ruby
tvw has joined #ruby
pietr0 has quit [Quit: pietr0]
mary5030 has joined #ruby
rbowlby_ has quit [Ping timeout: 252 seconds]
blackmesa has joined #ruby
sngeth_ has joined #ruby
<sphex> refine/using seem pretty neat. are they used a lot?
rubie has joined #ruby
<Senjai> sphex: ?
pietr0 has joined #ruby
<drbrain> sphex: they're still pretty new and people haven't decided how best to use them yet
ZoanthusR has joined #ruby
<jhass> or if at all
<sphex> drbrain: oh ok
sngeth has quit [Ping timeout: 276 seconds]
<jhass> http://rubyzucker.info/ looks neat though
k3asd` has quit [Ping timeout: 252 seconds]
mary5030 has quit [Ping timeout: 244 seconds]
<jhass> drbrain: got my pings over in #ruby-lang ?
scripore has joined #ruby
<drbrain> it could use some better typography
<sphex> Senjai: lets you modify arbitrary classes in a way that is only effective over a certain lexical scope
<drbrain> jhass: done and done
<jhass> cool, thx
<drbrain> my window is only so tall, and I have sooo many work channels
<jhass> hehe, weechat/buffers.pl detach option is pretty neat for that
PaulCapestany has joined #ruby
datanoise has joined #ruby
mfranzwa has joined #ruby
spider-mario has quit [Remote host closed the connection]
NeverDie has joined #ruby
sinkensabe has joined #ruby
MatthewsFace has joined #ruby
axl_ has quit [Quit: axl_]
pietr0 has quit [Quit: pietr0]
dseitz has joined #ruby
Rickmast_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
nickfausnight has joined #ruby
renderfu_ has quit [Remote host closed the connection]
<zenspider> drbrain: oi. I'm looking at your RRT patch
<zenspider> for some reason I can't fathom, setting a method to private makes it warn about duplicate methods?
Soda has joined #ruby
sinkensabe has quit [Ping timeout: 276 seconds]
<drbrain> zenspider: link?
roolo has quit [Remote host closed the connection]
<zenspider> it's the oddest thing. comment out the send :private, and tests run clean
<zenspider> add send :private and tests run dirty
<zenspider> no clue in the world as to the why of it
_blizzy_ has quit [Ping timeout: 248 seconds]
<drbrain> hrm
<drbrain> give me a few minutes to look
aphprentice has quit [Remote host closed the connection]
<zenspider> anyone have a clue on how/why making a method private might change whether it has a redefined warning?
Aswebb_ has joined #ruby
<drbrain> I wonder if its because each test run you recreate the method
<zenspider> on a new object tho, no?
<drbrain> … but why it doesn't warn for non-private I'm unsure
<zenspider> oh, no... it's always set on Object
<zenspider> I add some prints in there, turn off the private and I should be getting the exact same sequence
ruv has joined #ruby
<zenspider> I'm wondering if it has to do with the aliasing as well
<zenspider> EXTRA CLUE: it's only on domain, not rake_cmd and others
<zenspider> that's.... I dunno.
<zenspider> odd
<zenspider> I lied. it's 95% domain. some_variable hits once. as does can_set_nil
<zenspider> so, setup vs non,
Aswebb_ has quit [Ping timeout: 248 seconds]
<zenspider> and pushing down to Rake::Task to define the methods has no effect
RobertBirnie has quit [Ping timeout: 264 seconds]
gccostabr has joined #ruby
GitGud has quit [Read error: Connection reset by peer]
GitGud has joined #ruby
<drbrain> there's a teardown for removing old_domain based on Object.public_instance_methods, but changing that seems to have no effect
benlieb_ has quit [Quit: benlieb_]
FernandoBasso has quit [Quit: WeeChat 1.2]
lolmaus_ has quit [Remote host closed the connection]
Takasm has quit [Remote host closed the connection]
n008f4g_ has quit [Ping timeout: 265 seconds]
<zenspider> AH HAH
<zenspider> thank you for that clue
<zenspider> if I put a send :public in the teardown things are clean
dorei has quit []
lolmaus_ has joined #ruby
<zenspider> I'm still befuddled
RobertBirnie has joined #ruby
<zenspider> esp given that I had 2 other warnings before
<zenspider> wait... what? now things run clean without it. wtf
tvw has quit []
<zenspider> I'm confusing myself. terribly
baweaver has joined #ruby
RobertBirnie has quit [Client Quit]
MatthewsFace has quit [Remote host closed the connection]
<drbrain> I have a fix, please hold
allomov has joined #ruby
<drbrain> I pushed a commit, have to use private_instance_methods in two places
<zenspider> haha. oops
<zenspider> I guessed them correctly. :)
<zenspider> cool. thanks
yqt has quit [Quit: KVIrc 4.0.4 Insomnia http://www.kvirc.net/]