« Back to channel list

#ruby - 25 June 2015

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