« Back to channel list

#ruby - 22 October 2015

« Back 1 day Forward 1 day »
[00:00:14] chopin: VeryBewitching: Definitely, just a sec
[00:01:22] hadees: has joined #ruby
[00:01:26] symbole: has joined #ruby
[00:01:48] mistermocha: has joined #ruby
[00:02:54] Musashi007: has joined #ruby
[00:03:30] chopin: VeryBewitching: https://gist.github.com/BradleyJohnson/896d386d0959e8362a13
[00:04:14] `tim`: has joined #ruby
[00:09:19] VeryBewitching: There's no stack trace from any part of this?
[00:09:31] hadees: has joined #ruby
[00:10:01] s00pcan: has joined #ruby
[00:10:07] chopin: VeryBewitching: 200 comes back from google :(
[00:10:28] VeryBewitching: I think it's weird that you get a bounce, but no notification in the API as to why.
[00:11:00] VeryBewitching: Can you show what result would be afterwards?
[00:11:15] bollullera: has left #ruby: ()
[00:11:17] VeryBewitching: https://gist.github.com/BradleyJohnson/896d386d0959e8362a13#file-mail_service-rb-L18 that line
[00:12:14] ericjphillips: has joined #ruby
[00:13:01] jinie: has joined #ruby
[00:13:12] tenderlove: has joined #ruby
[00:14:19] chopin: Sending HTTP post https://www.googleapis.com/gmail/v1/users/bdjohnso8%40gmail.com/messages/send?
[00:14:19] chopin: #<Hurley::Response POST https://www.googleapis.com/gmail/v1/users/bdjohnso8%40gmail.com/messages/send == 200 (63 bytes) 620ms>
[00:14:21] chopin: Success - #<Google::Apis::GmailV1::Message:0x007f88214ba068
[00:14:23] chopin: @id="1508ce401f6cdb12",
[00:14:25] chopin: @thread_id="1508ce401f6cdb12">
[00:14:28] chopin: VeryBewitching: ^
[00:14:44] VeryBewitching: Watch the spam :D
[00:15:20] hadees: has joined #ruby
[00:15:22] chopin: VeryBewitching: Oops, sorry. Just started trying freenode the other day. Still learning ettiqutte
[00:18:08] jgt1: has joined #ruby
[00:18:08] VeryBewitching: 1) If it's giving you a success result, but it's bouncing, then I don't think it has to do with authentication. Google clearly responded that what you did was OK. I would make the assumption that it has to do with the message and it's formatting.
[00:18:16] VeryBewitching: 2) That's weird.
[00:19:18] VeryBewitching: Do you control the account it's sending to?
[00:19:28] _djbkd: has joined #ruby
[00:21:04] chopin: VeryBewitching: Yes, it's to another account of mine
[00:22:20] VeryBewitching: So it's both is never received, and you get a bounce, but the API says 'OK' I would assume the message maybe missing something.
[00:23:26] PaulCapestany: has joined #ruby
[00:23:41] inteq: has joined #ruby
[00:24:12] chopin: VeryBewitching: That's what I was thinking... That it wasn't picking up the recipient. I just can't figure out how to check the request that it's sending
[00:24:25] benjito_: has joined #ruby
[00:24:38] dravine: any of you people work in Perl at all?
[00:24:40] dravine: or want too?
[00:24:46] eam: dravine: sure
[00:25:04] VeryBewitching: Well if it's failing now and the API is giving you a 200 response, that's curious.
[00:25:08] dravine: www.pragprog.com has Modern Perl fourth edition in ebook format for free
[00:25:43] willharrison: has joined #ruby
[00:26:29] dravine: also, wrong channel, but still a cool deal :D
[00:26:47] chopin: VeryBewitching: Yeah, driving me crazy.
[00:27:04] rehat: trying to create a ruby script to automate something we do a lot in git. What is the benefit of using a gem like Rugged over calling STDOUT backtick commands?
[00:27:36] hadees: has joined #ruby
[00:27:54] houhoulis: has joined #ruby
[00:28:34] allcentury: has joined #ruby
[00:30:13] bmurt: has joined #ruby
[00:30:45] _djbkd: has joined #ruby
[00:32:00] VeryBewitching: chopin: Does Google have development logs about API use?
[00:32:38] VeryBewitching: chopin: I'd be curious to see what's actually going on.
[00:32:44] chopin: VeryBewitching: I just checked on that and it doesn't seem to be active. Just keeps showing me the "Read about Logs" pop up
[00:34:11] jhass: rehat: git doesn't need to be installed or the scripts PATH
[00:34:19] jhass: *or in the
[00:34:35] nateberkopec: has joined #ruby
[00:36:29] tenderlove: has joined #ruby
[00:37:37] rehat: jhass: ok thanks
[00:41:18] Maletor: has joined #ruby
[00:43:10] workmad3: has joined #ruby
[00:43:11] riotjones: has joined #ruby
[00:44:04] uber: has joined #ruby
[00:44:29] martin290: has joined #ruby
[00:44:29] ebbflowgo: has joined #ruby
[00:44:32] martin290: hey everyone
[00:44:34] ebbflowgo: has left #ruby: ()
[00:44:40] ja: hi martin290
[00:44:47] martin290: how are ya?
[00:44:52] ja: i'm great thanks. you?
[00:45:08] martin290: doing well, thanks!
[00:45:19] Ox0dea: has joined #ruby
[00:45:22] BTRE: has joined #ruby
[00:45:28] martin290: ja, you like ruby, huh?
[00:45:31] ja: do you like ruby? ???????
[00:45:45] martin290: i actually haven't used it...
[00:45:50] ja: really?
[00:45:55] martin290: been trying to learn c#.net MVC
[00:46:01] martin290: kind of have a headache lol
[00:46:12] martin290: i know php a bit though
[00:46:18] ja: yeeeah, I can imagine, although I've never tried it
[00:46:20] EminenceHC: has joined #ruby
[00:46:22] martin290: trying to look for a "good" server side languag
[00:46:23] ja: C# looks good, though, I'd say
[00:46:36] ja: Ruby should be a good bet for "good"
[00:46:40] martin290: yeah, it's an awesome language to program in
[00:46:48] martin290: web stuff just kills me though
[00:46:55] ja: Yeah, me too
[00:47:08] martin290: ruby is only for web, right??
[00:47:11] ja: It's the worst, but it pays my bills so I try not to complain
[00:47:16] ja: No way! You're thinking of Ruby on Rails, maybe
[00:47:21] ja: the web framework
[00:47:24] ja: Ruby is general purpose
[00:47:25] havenwood: martin290: nope
[00:47:34] martin290: is Ruby like python?
[00:47:45] ja: pretty much, yeah, depending on how you define "like"
[00:47:46] Ox0dea: havenwood: Thoughts on the "safe navigation" operator having made it into Ruby?
[00:48:07] martin290: like as in... dynamically typed
[00:48:11] ja: only better if you ask me ^_^ foo.bar.baz reads a lot better than baz(bar(foo))
[00:48:50] martin290: so you can create applications with ruby??
[00:48:54] martin290: like... desktop apps?
[00:49:16] ja: it's possible if you use some GUI toolkit
[00:49:18] GriffinHeart: has joined #ruby
[00:49:24] ja: but I don't know if I'd recommend it
[00:49:40] martin290: so do you do web stuff, usually?
[00:49:49] ja: and command-line scripts
[00:50:18] martin290: it's the "statelessness" of the web that totally kills
[00:50:35] martin290: refresh the page.. poof.. form data goes away
[00:50:43] ja: hm, yeah, that can be a bit weird if you're used to "stateness"
[00:51:04] Ox0dea: martin290: LocalStorage is a thing.
[00:51:15] martin290: Ox0dea: what do you mean
[00:51:16] ja: a good thing
[00:51:22] martin290: like cookies?
[00:51:23] hadees: has joined #ruby
[00:51:41] ja: like cookies on steroids
[00:53:10] ja: martin290: its API is very easy: https://en.wikipedia.org/wiki/Web_storage#localStorage
[00:53:21] EminenceHC: has joined #ruby
[00:53:55] martin290: javascript... cringe....
[00:54:25] martin290: such a messy language lol
[00:54:35] Ox0dea: What year is it?
[00:54:38] _djbkd: has joined #ruby
[00:54:47] martin290: it's not messy?
[00:54:53] Ox0dea: You're the authority.
[00:55:31] tenderlove: has joined #ruby
[00:55:31] tenderlove: has joined #ruby
[00:55:39] bruno-: has joined #ruby
[00:55:39] Ox0dea: Are you referring to the language Eich was forced to shit out in <2 weeks, or the language it has become over the past two decades?
[00:55:48] ledestin: has joined #ruby
[00:55:50] PaulCapestany: has joined #ruby
[00:56:00] Ox0dea: Crucially, observe that the two are different entities.
[00:56:25] martin290: because a language has been "around" for years doesn't make it pretty
[00:56:40] Ox0dea: Oh, we're talking about surface syntax now?
[00:57:23] eam: arguably a language is only "surface syntax," the rest is just a particular implementation's details
[00:57:26] martin290: i just mean with it being a dynamic type (no type of live-error checking) and the convention of using anonymous functions everywhere
[00:57:40] RobertBirnie: has joined #ruby
[00:57:44] Ox0dea: martin290: You're in #ruby.
[00:57:52] mistermocha: has joined #ruby
[00:57:52] andersoldahl: has joined #ruby
[00:58:00] martin290: has left #ruby: ()
[00:59:05] baweaver: well they ran off either way.
[00:59:08] CloCkWeRX: has joined #ruby
[00:59:26] CloCkWeRX: has left #ruby: ()
[00:59:30] havenwood: Ox0dea: Oops, connection here is so bad my response didn't go through.
[00:59:39] havenwood: Ox0dea: Hadn't seen it'd been accepted!
[00:59:43] havenwood: nil.?omgwtfbbq #>> nil
[01:00:03] Ox0dea: I think it's ugly, but it's nicer than #try chains.
[01:00:04] noodle: has joined #ruby
[01:00:56] baweaver: we have elvis in ruby now?
[01:00:58] GriffinHeart: has joined #ruby
[01:01:22] Ox0dea: https://bugs.ruby-lang.org/issues/11537#note-11
[01:01:30] ja: ???elvis????
[01:01:43] Ox0dea: https://en.wikipedia.org/wiki/Elvis_operator
[01:02:51] RobertBirnie: has joined #ruby
[01:03:05] ja: haha wtf, nice operator name
[01:03:26] ja: omg, matz greenlighted it!
[01:03:56] Ox0dea: ja: We have better: http://ruby-operators.herokuapp.com/
[01:04:47] ja: ACTION lols out loud
[01:04:52] diegoaguilar: has joined #ruby
[01:04:55] Ox0dea: !~ is missing, and I challenge you to beat "bangarang".
[01:05:08] rickmasta: has joined #ruby
[01:05:17] s2013: has joined #ruby
[01:05:45] ecksit: has joined #ruby
[01:06:08] ja: haha, "bangarang" is perfect! I can't beat that
[01:06:26] ja: wait wat, `~>` is a ruby operator?!
[01:07:41] ecksit: has joined #ruby
[01:08:01] havenwood: pessimistic operator
[01:08:19] havenwood: ja: think RubyGems
[01:08:24] Maletor: has joined #ruby
[01:08:32] ja: havenwood: oooh, of course
[01:08:43] Ox0dea: ja: https://github.com/jicksta/superators
[01:08:50] Ox0dea: And then I'll stop overloading you with operator lore.
[01:09:15] s00pcan: has joined #ruby
[01:09:22] d34th4ck3r: has joined #ruby
[01:11:18] ICantCook: has joined #ruby
[01:11:51] BTRE: has joined #ruby
[01:12:03] hadees: has joined #ruby
[01:13:14] ja: Ox0dea: aah, good ol' Superators! I wonder if it still works in recent versions of Ruby
[01:13:41] abbe: has joined #ruby
[01:14:08] unreal: has joined #ruby
[01:17:30] Kyle__: has joined #ruby
[01:17:47] dain: has joined #ruby
[01:18:03] spuk: has joined #ruby
[01:18:17] tenderlove: has joined #ruby
[01:18:39] ecksit: has joined #ruby
[01:20:46] MrSamuel: has joined #ruby
[01:20:54] pipework: Ox0dea: ho ho, overloading us with operator oration.
[01:21:23] Ox0dea: pipework: I appreciate your vigilance.
[01:21:57] NeverDie: has joined #ruby
[01:24:48] benjito: has joined #ruby
[01:26:28] dmolina: has joined #ruby
[01:28:24] mistermocha: has joined #ruby
[01:31:36] CanTonic: has joined #ruby
[01:33:40] `tim`: has joined #ruby
[01:34:31] cdg: has joined #ruby
[01:37:41] tenderlove: has joined #ruby
[01:40:10] capin: anyone here have experience using the refile gem? and if so, how could i preserve the file name of an uploaded file.
[01:40:43] atomical: has joined #ruby
[01:42:44] Ox0dea: capin: https://github.com/refile/refile#additional-metadata
[01:42:51] GriffinHeart: has joined #ruby
[01:43:36] rehat: has joined #ruby
[01:43:54] capin: Ox0dea: yeah i read that, my code looks like the following, https://gist.github.com/ipatch/024782637ce0ff7c25a1
[01:44:00] riotjones: has joined #ruby
[01:44:41] nkts: has joined #ruby
[01:45:29] beast: has joined #ruby
[01:47:17] Bellthoven: has joined #ruby
[01:48:18] Gustavo: has joined #ruby
[01:50:01] sunya7a: has joined #ruby
[01:54:07] finisherr_: has joined #ruby
[01:55:05] danman: has joined #ruby
[01:56:20] bruno-: has joined #ruby
[01:56:39] tenderlove: has joined #ruby
[01:57:30] finisherr: has joined #ruby
[02:00:23] tjbiddle: has joined #ruby
[02:06:26] barhum2013: has joined #ruby
[02:06:30] v4n: has joined #ruby
[02:08:29] bmurt: has joined #ruby
[02:09:21] jenrzzz: has joined #ruby
[02:09:44] bonhoeffer: has joined #ruby
[02:10:01] tkuchiki: has joined #ruby
[02:10:11] RobertBirnie: has joined #ruby
[02:11:05] RobertBirnie: has joined #ruby
[02:11:20] roshanavand: has joined #ruby
[02:12:13] zenguy_pc: has joined #ruby
[02:12:21] GriffinHeart: has joined #ruby
[02:12:28] RobertBirnie: has joined #ruby
[02:13:03] hmsimha: has joined #ruby
[02:13:33] pathrocle: has joined #ruby
[02:13:35] nateberkopec: has joined #ruby
[02:14:02] mistermocha: has joined #ruby
[02:15:01] mistermocha: has joined #ruby
[02:17:06] shinnya: has joined #ruby
[02:17:38] tmtwd: has joined #ruby
[02:19:03] tenderlove: has joined #ruby
[02:20:08] `tim`: has joined #ruby
[02:21:48] swgillespie: has joined #ruby
[02:26:25] moeabdol: has joined #ruby
[02:27:11] hays: has joined #ruby
[02:27:34] mistermocha: has joined #ruby
[02:28:36] leafybasil: has joined #ruby
[02:29:40] EmeraldExplorer: has joined #ruby
[02:31:15] sankaber: has joined #ruby
[02:31:26] workmad3: has joined #ruby
[02:31:54] `tim`: has joined #ruby
[02:32:10] mistermo_: has joined #ruby
[02:32:11] Asher: has joined #ruby
[02:32:58] danman_: has joined #ruby
[02:33:33] sankaber: has joined #ruby
[02:35:30] tenderlove: has joined #ruby
[02:37:53] tubuliferous_: has joined #ruby
[02:41:32] epochwolf: has joined #ruby
[02:44:00] zenguy_pc: has joined #ruby
[02:48:13] GriffinHeart: has joined #ruby
[02:48:19] favadi: has joined #ruby
[02:48:20] Nahra: has joined #ruby
[02:50:04] Eiam_: has joined #ruby
[02:50:09] Jameser: has joined #ruby
[02:50:43] Musashi007: has joined #ruby
[02:50:56] RegulationD: has joined #ruby
[02:52:08] nettoweb: has joined #ruby
[02:52:16] s2013: has joined #ruby
[02:53:09] rbowlby: has joined #ruby
[02:53:15] towski_: has joined #ruby
[02:53:29] tenderlove: has joined #ruby
[02:54:53] seventoes: has joined #ruby
[02:54:53] seventoes: has left #ruby: ()
[02:55:02] moeabdol: has joined #ruby
[02:55:45] tjbiddle: has joined #ruby
[02:56:09] baweaver: has joined #ruby
[02:57:49] tvon: has joined #ruby
[02:58:43] NeverDie: has joined #ruby
[02:58:56] levifig_: has joined #ruby
[03:01:00] gener1c: has joined #ruby
[03:02:03] sankaber: has joined #ruby
[03:02:15] greedo: has joined #ruby
[03:02:58] bmn: has joined #ruby
[03:03:55] towski_: has joined #ruby
[03:04:07] Soda: has joined #ruby
[03:04:15] Trieste: has joined #ruby
[03:04:19] NeverDie: has joined #ruby
[03:06:03] dfinninger: has joined #ruby
[03:06:47] tubuliferous_: has joined #ruby
[03:07:22] zenguy_pc: has joined #ruby
[03:09:10] Kyle__: has joined #ruby
[03:09:29] tenderlove: has joined #ruby
[03:09:29] tenderlove: has joined #ruby
[03:10:17] braincrash: has joined #ruby
[03:13:12] devoldmx: has joined #ruby
[03:14:00] rehat: new to ruby is there a better way to programmatically increment a line of text like "pod 'Alamofire', '~> 2.0.0'" to "pod 'Alamofire', '~> 2.0.1'" ? This is what I have so far lol https://gist.github.com/rehat/4cd713023853a72ca4ab
[03:16:07] blt: has joined #ruby
[03:16:54] momo-reina: has joined #ruby
[03:16:56] Ox0dea: >> '2.0.0'.next # rehat
[03:16:57] ruboto: Ox0dea # => "2.0.1" (https://eval.in/455148)
[03:17:44] rehat: Ox0dea: lol thanks dude
[03:17:48] Ox0dea: Sure thing.
[03:18:04] rgb-one: has joined #ruby
[03:18:44] freerobby: has joined #ruby
[03:21:58] techietrash: has joined #ruby
[03:22:44] rabbit7: has joined #ruby
[03:23:44] rehat: wow, so I even use next on the full string "Alamofire', '~> 2.0.0'" and it worked. Ruby is so magical :)
[03:23:48] cwong_on_irc: has joined #ruby
[03:23:50] rabbit7: hello, i was wondering if ruby would be a good language for game programming,i have experience in java c and c++
[03:24:28] cwong_on_irc: has joined #ruby
[03:25:02] cwong_on_irc: has joined #ruby
[03:26:01] cwong_on_irc: has joined #ruby
[03:26:59] Ox0dea: >> 'z'.next # rehat: Almost too magical.
[03:27:00] ruboto: Ox0dea # => "aa" (https://eval.in/455150)
[03:27:00] weemsledeux: has joined #ruby
[03:27:43] kies^: has joined #ruby
[03:28:17] tenderlove: has joined #ruby
[03:29:05] leafybasil: has joined #ruby
[03:31:09] pawanspace: has joined #ruby
[03:32:54] d34th4ck3r: Is there an inbuilt function to get the day of week from Time variable ?
[03:34:02] d34th4ck3r: I know about verifying a day like: Time.now.Thursday?
[03:35:10] gix: has joined #ruby
[03:35:21] CloCkWeRX: has joined #ruby
[03:36:44] Ox0dea: >> require 'date'; Date::DAYNAMES[Time.now.wday] # d34th4ck3r
[03:36:45] ruboto: Ox0dea # => "Thursday" (https://eval.in/455151)
[03:37:00] Gustavo: has joined #ruby
[03:37:21] Motoservo: has joined #ruby
[03:37:55] d34th4ck3r: pawanspace: That prints the number, not the day.
[03:38:19] darkf: has joined #ruby
[03:41:16] solocshaw: has joined #ruby
[03:41:30] duncannz: has joined #ruby
[03:43:19] wldcordeiro: has joined #ruby
[03:44:47] riotjones: has joined #ruby
[03:45:17] tenderlove: has joined #ruby
[03:45:21] symm-: has joined #ruby
[03:46:46] Oatmeal: has joined #ruby
[03:48:07] mistermocha: has joined #ruby
[03:49:39] Musashi007: has joined #ruby
[03:50:47] astrobun_: has joined #ruby
[03:52:27] mistermo_: has joined #ruby
[03:56:04] mistermo_: has joined #ruby
[03:57:05] devbug: has joined #ruby
[03:58:35] bruno-: has joined #ruby
[03:58:39] tenderlove: has joined #ruby
[03:59:28] s00pcan: has joined #ruby
[04:01:06] auzty: has joined #ruby
[04:01:40] EminenceHC: has joined #ruby
[04:01:49] Pupp3tm4st3r: has joined #ruby
[04:05:31] z3uS: has joined #ruby
[04:06:19] sunya7a: has joined #ruby
[04:09:06] wldcordeiro: has joined #ruby
[04:11:24] mistermo_: has joined #ruby
[04:13:47] GriffinHeart: has joined #ruby
[04:14:40] tenderlove: has joined #ruby
[04:15:54] molly: has left #ruby: ()
[04:19:28] workmad3: has joined #ruby
[04:19:34] sdwrage: has joined #ruby
[04:20:35] devbug_: has joined #ruby
[04:22:33] Gnomethrower: has joined #ruby
[04:24:55] matp: has joined #ruby
[04:26:37] tenderlove: has joined #ruby
[04:27:05] rgb-one: Anyone have a list of projects using optparse?
[04:32:14] tenderlove: has joined #ruby
[04:35:18] favadi: has joined #ruby
[04:38:30] Ox0dea: rgb-one: http://git.io/vWG6c
[04:39:02] rgb-one: Ox0dea: Clever :)
[04:39:16] silverdust: has joined #ruby
[04:39:19] Ox0dea: I didn't know how else to answer your question.
[04:40:01] rgb-one: Ox0dea: Good answer. It didn't cross my mind to do that.
[04:41:36] benjito: has joined #ruby
[04:41:40] tenderlove: has joined #ruby
[04:42:38] arup_r: has joined #ruby
[04:46:20] beauby: has joined #ruby
[04:46:21] krz: has joined #ruby
[04:46:29] nemo_: has joined #ruby
[04:47:10] dain: /join #jekyl
[04:47:39] subscope: has joined #ruby
[04:47:39] Ox0dea: /part #ruby
[04:49:21] tenderlove: has joined #ruby
[04:49:48] Ox0dea: dain: I'm certain you could configure Emacs to prevent you from doing that in future.
[04:50:03] dain: Amazing that you know I'm using emacs
[04:50:14] Ox0dea: On the other hand, maybe it happened to begin with because you're using Emacs for IRC. :P
[04:50:15] trosborn: has joined #ruby
[04:50:27] dain: That's totally true, if I was normal that wouldn't have happened ;)
[04:50:54] Ox0dea: /ctcp foo version, for reference.
[04:51:10] dain: ah, interesting
[04:51:11] RobertBirnie: has joined #ruby
[04:51:38] RegulationD: has joined #ruby
[04:53:48] favadi: has joined #ruby
[04:55:05] GriffinHeart: has joined #ruby
[04:55:44] hadees: has joined #ruby
[04:55:52] roshanavand: has joined #ruby
[04:58:16] ruurd: has joined #ruby
[04:59:52] nemo__: has joined #ruby
[04:59:59] Xeago: has joined #ruby
[05:00:56] wldcordeiro: has joined #ruby
[05:01:49] nemo_: has joined #ruby
[05:02:35] kies^: has joined #ruby
[05:05:30] CloCkWeRX: has joined #ruby
[05:06:23] dopamean_: has joined #ruby
[05:06:50] mistermocha: has joined #ruby
[05:07:07] GriffinHeart: has joined #ruby
[05:07:35] blueOxigen: has joined #ruby
[05:07:46] wldcordeiro: has joined #ruby
[05:08:11] wldcordeiro: has joined #ruby
[05:08:23] patdohere: has joined #ruby
[05:08:46] haraoka: has joined #ruby
[05:08:51] mistermocha: has joined #ruby
[05:09:22] pontiki: has joined #ruby
[05:13:07] tenderlove: has joined #ruby
[05:15:57] Morrolan: has joined #ruby
[05:18:31] Chaoborid: has joined #ruby
[05:19:39] lxsameer: has joined #ruby
[05:22:27] stardiviner: has joined #ruby
[05:22:35] devbug: has joined #ruby
[05:23:07] CloCkWeRX: has joined #ruby
[05:23:21] blt: has left #ruby: ("WeeChat 1.3")
[05:23:26] jonee: has joined #ruby
[05:24:17] chrissonar: has joined #ruby
[05:24:44] moeabdol: has joined #ruby
[05:25:18] arup_r: How to beautify the if? tips please: https://gist.github.com/aruprakshit/b1f6309547ba05705c82#file-beautify-rb-L2
[05:25:52] Gustavo: has joined #ruby
[05:25:58] arup_r: sometimes distribution_lists_params[:external_users] can be `nil` or `[nil]`
[05:26:06] beauby: has joined #ruby
[05:26:36] arup_r: In either case I will return []
[05:28:01] Darryl___: has joined #ruby
[05:28:06] Ox0dea: arup_r: I'd use `return [] if Array(foo).compact == []`.
[05:28:41] arup_r: let me see.. in IRB
[05:28:44] Ox0dea: I suppose you'd prefer #empty?, but the Array method is the trick you were looking for.
[05:29:20] arup_r: yes, Kernel#Array() is what I needed.
[05:29:45] Ox0dea: `[*foo] == Array(foo)`, for what that's worth.
[05:30:36] tenderlove: has joined #ruby
[05:31:03] hostess: has joined #ruby
[05:32:06] nemo_: has joined #ruby
[05:32:26] arup_r: Ox0dea: thanks
[05:32:48] Ox0dea: arup_r: Sure thing.
[05:33:39] toy: has joined #ruby
[05:34:17] riotjones: has joined #ruby
[05:34:30] skade: has joined #ruby
[05:34:51] trautwein: has joined #ruby
[05:36:07] nemo__: has joined #ruby
[05:36:39] GriffinHeart: has joined #ruby
[05:37:30] rodfersou: has joined #ruby
[05:38:26] d34th4ck3r: has joined #ruby
[05:38:53] danman: has joined #ruby
[05:39:15] ruurd: has joined #ruby
[05:39:52] hadees: has joined #ruby
[05:40:25] tagrudev: has joined #ruby
[05:40:53] jenrzzz: has joined #ruby
[05:41:45] techsethi: has joined #ruby
[05:42:49] wldcordeiro: has joined #ruby
[05:45:48] AnoHito: has joined #ruby
[05:45:50] astrobun_: has joined #ruby
[05:46:28] tubuliferous_: has joined #ruby
[05:47:49] balazs: has joined #ruby
[05:48:17] moeabdol: has joined #ruby
[05:48:22] kraljev11: has joined #ruby
[05:48:32] nemo_: has joined #ruby
[05:49:36] tenderlove: has joined #ruby
[05:49:38] krz: has joined #ruby
[05:49:43] beauby: has joined #ruby
[05:54:46] techsethi: has joined #ruby
[05:55:42] zenguy_pc: has joined #ruby
[05:58:37] firstdayonthejob: has joined #ruby
[05:58:50] yardenbar: has joined #ruby
[05:59:01] _djbkd: has joined #ruby
[06:00:29] Pupp3tm4st3r: has joined #ruby
[06:01:27] dhjondoh: has joined #ruby
[06:03:40] Jameser`: has joined #ruby
[06:03:56] tenderlove: has joined #ruby
[06:04:02] ryez: has joined #ruby
[06:07:20] dhjondoh: has joined #ruby
[06:07:23] norc: has joined #ruby
[06:07:32] workmad3: has joined #ruby
[06:07:52] norc: Hi, Im trying to figure out how to decently stop a consumer in a producer/consumer problem.
[06:08:01] norc: This is what I have at the moment, but it feels so unclean: http://pastie.org/10499192
[06:08:24] norc: (I know that Ruby 2.3 might introduce a Queue#close that will elegantly solve this problem, but we are not there yet)
[06:08:48] norc: (thread/pool comes from the thread gem)
[06:08:53] rbennacer: has joined #ruby
[06:10:35] norc: Oh well, and its not even thread safe.
[06:11:23] astrobun_: has joined #ruby
[06:13:56] GriffinHeart: has joined #ruby
[06:17:39] davedev24: has joined #ruby
[06:18:00] favadi: has joined #ruby
[06:18:20] unshadow: has joined #ruby
[06:19:26] acke: has joined #ruby
[06:20:57] certainty: has joined #ruby
[06:22:02] tomaz_b: has joined #ruby
[06:22:21] petems: has left #ruby: ()
[06:22:28] zapata: has joined #ruby
[06:23:44] Ox0dea: has joined #ruby
[06:24:33] Jameser`: has joined #ruby
[06:24:33] based_pdev_: has joined #ruby
[06:24:45] tenderlo_: has joined #ruby
[06:24:51] devbug: has joined #ruby
[06:25:22] favadi: has joined #ruby
[06:26:38] tjbiddle: has joined #ruby
[06:27:28] Musashi007: has joined #ruby
[06:30:09] zenguy_pc: has joined #ruby
[06:31:29] dmolina: has joined #ruby
[06:31:40] relix: has joined #ruby
[06:32:57] stannard: has joined #ruby
[06:33:46] arup_r: has joined #ruby
[06:34:03] majjoha: has joined #ruby
[06:34:36] luckyruby: has joined #ruby
[06:35:01] andikr: has joined #ruby
[06:35:24] jenrzzz: has joined #ruby
[06:35:28] Sigma00: has joined #ruby
[06:36:00] jtperreault: has joined #ruby
[06:36:02] camt: has joined #ruby
[06:36:23] gsingh93: has joined #ruby
[06:36:37] bodie_: has joined #ruby
[06:36:52] alexblom: has joined #ruby
[06:37:58] Davey: has joined #ruby
[06:37:58] Davey: has joined #ruby
[06:39:47] tenderlove: has joined #ruby
[06:40:52] clamstar: has joined #ruby
[06:40:54] astrobun_: has joined #ruby
[06:41:11] dcarmich: has joined #ruby
[06:41:22] gnarf: has joined #ruby
[06:41:58] norc: This would be the better example of what I mean: http://pastie.org/10499213
[06:43:09] krz: has joined #ruby
[06:43:56] O47m341: has joined #ruby
[06:44:30] yardenbar: Hi all, I'm trying to install rjb gem on Mac OS X El Capitan, getting an error that I'm missing JavaVM.framework/Home/Headers
[06:44:44] yardenbar: Nothing on the internet to solve it, please help
[06:44:58] solars: has joined #ruby
[06:46:07] lkba: has joined #ruby
[06:48:01] ruurd: has joined #ruby
[06:48:05] eGGsha: has joined #ruby
[06:52:29] RegulationD: has joined #ruby
[06:53:27] tenderlove: has joined #ruby
[06:54:04] last_staff: has joined #ruby
[06:54:11] ruurd: has joined #ruby
[06:55:31] herbst: has joined #ruby
[06:55:48] kp666: has joined #ruby
[06:56:06] nhhagen: has joined #ruby
[06:57:41] nfk|laptop: has joined #ruby
[06:58:33] trosborn: has joined #ruby
[06:59:23] GriffinHeart: has joined #ruby
[07:00:30] swgillespie: has joined #ruby
[07:03:34] Ox0dea: > obj.?attr += 1
[07:04:28] trosborn: has joined #ruby
[07:05:24] aufi: has joined #ruby
[07:05:51] TomyWork: has joined #ruby
[07:06:53] gavit: has joined #ruby
[07:07:57] lsmola_: has joined #ruby
[07:08:37] Didac: has joined #ruby
[07:09:11] Ilyes512: has joined #ruby
[07:09:43] GriffinHeart: has joined #ruby
[07:11:01] codecop: has joined #ruby
[07:11:37] Gustavo: has joined #ruby
[07:11:51] Radar: yardenbar: why not just use JRuby?
[07:12:19] jas02: has joined #ruby
[07:13:59] tenderlove: has joined #ruby
[07:14:49] subscope: has joined #ruby
[07:15:04] leafybasil: has joined #ruby
[07:15:13] adac: has joined #ruby
[07:16:20] wpp: has joined #ruby
[07:16:42] yardenbar: Skipped that
[07:18:46] davedev24: has joined #ruby
[07:19:55] SCHAAP137: has joined #ruby
[07:22:53] aganov: has joined #ruby
[07:23:17] sameerynho: has joined #ruby
[07:23:36] trosborn: has joined #ruby
[07:24:59] moeabdol: has joined #ruby
[07:27:16] tenderlove: has joined #ruby
[07:27:28] zenguy_pc: has joined #ruby
[07:27:31] DEA7TH: has joined #ruby
[07:27:37] karapetyan: has joined #ruby
[07:27:41] trosborn: has joined #ruby
[07:28:30] Xeago: has joined #ruby
[07:29:15] but3k4: has joined #ruby
[07:32:09] devbug_: has joined #ruby
[07:34:12] Couch: has joined #ruby
[07:35:27] karapetyan: has joined #ruby
[07:36:10] jenrzzz: has joined #ruby
[07:36:57] tjbiddle: has joined #ruby
[07:37:02] senayar: has joined #ruby
[07:37:02] senayar: has joined #ruby
[07:38:31] chipotle: has joined #ruby
[07:38:56] trosborn: has joined #ruby
[07:40:26] keen______: has joined #ruby
[07:42:02] roshanavand: has joined #ruby
[07:42:57] trosborn: has joined #ruby
[07:43:42] ibouvousaime: has joined #ruby
[07:44:22] Jackneill: has joined #ruby
[07:44:44] tenderlove: has joined #ruby
[07:45:32] tjbiddle: has joined #ruby
[07:45:40] araujo_: has joined #ruby
[07:49:37] Gnomethrower: has joined #ruby
[07:49:45] SylarRuby: has joined #ruby
[07:50:23] sinkensabe: has joined #ruby
[07:51:16] sundhell: has joined #ruby
[07:53:46] sanjayu: has joined #ruby
[07:54:43] dravine: has joined #ruby
[07:55:13] skade: has joined #ruby
[07:55:18] kalusn: has joined #ruby
[07:55:40] workmad3: has joined #ruby
[07:56:23] soosfarm: has left #ruby: ()
[07:57:06] jxs_: has joined #ruby
[07:58:13] dmolina: has joined #ruby
[07:58:37] teclator: has joined #ruby
[07:58:58] SylarRuby: has joined #ruby
[07:59:01] mikecmpbll: has joined #ruby
[07:59:57] Gustavo: has joined #ruby
[08:00:03] vigintas: has joined #ruby
[08:01:24] Peg-leg: has joined #ruby
[08:01:44] ndrei: has joined #ruby
[08:04:07] CrazyEddy: has joined #ruby
[08:04:27] tenderlove: has joined #ruby
[08:05:12] nemo_: has joined #ruby
[08:05:27] Xeago: has joined #ruby
[08:08:25] livcd: has joined #ruby
[08:08:40] lipoqil: has joined #ruby
[08:09:31] kimegede: has joined #ruby
[08:09:56] Hounddog: has joined #ruby
[08:10:43] Ox0dea: Christmas came a little early: http://git.io/vWZm1
[08:11:25] blaxter: has joined #ruby
[08:11:38] Ox0dea: Do you think nobu would be cross if I pointed out that `::?` should probably work also?
[08:12:45] mark2: has joined #ruby
[08:13:59] apeiros: I would hope nobu would say that :: should not be used for method invocation anymore.
[08:14:21] but3k4: has joined #ruby
[08:14:22] adaedra: So a.?b.c would not call c if b return nil, but directly return nil?
[08:14:27] apeiros: but cool, do I read this correctly that we will have .? soon?
[08:14:31] Gnomethrower: has joined #ruby
[08:15:30] joonty: has joined #ruby
[08:15:32] apeiros: a.?[](key).?[](key) will be ugly, but well, still less ugly than && chains
[08:15:38] Takumo: has joined #ruby
[08:15:38] Takumo: has joined #ruby
[08:15:58] Hounddog: has joined #ruby
[08:16:31] Ox0dea: adaedra: No, you have to explicitly chain it.
[08:17:05] adaedra: So a.?b.?c
[08:17:31] adaedra: And it's not calling b if a is nil
[08:17:38] adaedra: Ok, I see it
[08:18:42] Ox0dea: It doesn't even evaluate the arguments in that case.
[08:19:41] davedev24: has joined #ruby
[08:20:18] adaedra: So we can have a.?b?
[08:20:27] davedev24: has joined #ruby
[08:20:52] howdoicomputer: has joined #ruby
[08:21:06] Ox0dea: (I'm trying to break it. :P)
[08:21:27] adaedra: I didn't expect any less from you.
[08:21:45] Ox0dea: I'm sure if nobu wanted he could've defined the new DOTQ token in terms of dot_or_colon, so maybe the lack of ::? isn't an oversight after all.
[08:22:20] tenderlove: has joined #ruby
[08:22:36] tkuchiki: has joined #ruby
[08:23:09] rbowlby: has joined #ruby
[08:26:53] astrobun_: has joined #ruby
[08:28:04] benjito_: has joined #ruby
[08:28:08] trosborn: has joined #ruby
[08:28:33] yfeldblum: has joined #ruby
[08:28:44] Xeago: has joined #ruby
[08:30:22] Ox0dea: I have a new favorite.
[08:31:28] Ox0dea: >> !true.!
[08:31:29] ruboto: Ox0dea # => true (https://eval.in/455271)
[08:31:30] kraljev11: has joined #ruby
[08:31:34] Ox0dea: Still not entirely sure what's going on there.
[08:32:07] roshanavand: has joined #ruby
[08:32:43] marr: has joined #ruby
[08:33:59] jxs_: has joined #ruby
[08:36:17] ndrei: has joined #ruby
[08:36:33] dmolina: has joined #ruby
[08:37:10] c0m0: has joined #ruby
[08:38:06] Gustavo: has joined #ruby
[08:38:30] Gnomethrower: has joined #ruby
[08:39:34] adaedra: well, it's !!true, no?
[08:40:36] tenderlove: has joined #ruby
[08:41:36] trosborn: has joined #ruby
[08:41:43] Pumukel: has joined #ruby
[08:43:13] Ox0dea: It is, but #! is the only unary method which can be called that way.
[08:44:29] GriffinHeart: has joined #ruby
[08:44:47] Ox0dea: It wouldn't make sense for #+@ and #-@, of course, but #~ is an anomaly.
[08:46:20] matp: has joined #ruby
[08:46:43] voker57: has joined #ruby
[08:47:32] matp: has joined #ruby
[08:47:51] emilkarl: has joined #ruby
[08:50:01] Gnomethrower: has joined #ruby
[08:50:47] DEA7TH: has joined #ruby
[08:51:27] bmalum: has joined #ruby
[08:53:20] RegulationD: has joined #ruby
[08:54:24] trosborn: has joined #ruby
[08:54:28] arup_r: has joined #ruby
[08:54:36] Gnomethrower: has joined #ruby
[08:54:55] tvw: has joined #ruby
[08:55:43] Xeago: Ox0dea: would you perhaps know how to calculate https://gist.github.com/Xeago/4e58c40edbc0b459dd5c ?
[08:55:52] Xeago: I'm still stuck on it and cost me some sleep :|
[08:55:54] Ox0dea: Xeago: You should stop that.
[08:56:20] Xeago: I've tried ##math - without luck - I can try them again.
[08:56:32] sanjayu: has joined #ruby
[08:57:05] BaroMeter: has joined #ruby
[08:58:15] Ox0dea: Xeago: What is the sum of the interior angles of any triangle?
[08:59:02] TheBrayn: hint: it's neither 179?? nor 181??
[08:59:29] Xeago: Ox0dea: 180??
[08:59:55] Ox0dea: Xeago: Now draw the rest of the owl.
[08:59:55] Xeago: so the all angles inside of the ABE triangle are 60??
[08:59:59] tenderlove: has joined #ruby
[09:00:06] Gnomethrower: has joined #ruby
[09:00:19] araujo: has joined #ruby
[09:00:20] araujo: has joined #ruby
[09:00:31] eGGsha: has joined #ruby
[09:00:53] Xeago: E in ABE is 60??, that tells me that it is 300 around, but that is not E in CED
[09:01:00] Ox0dea: > [T]he vast majority of the [process] is left unexplained for comedic effect.
[09:01:07] Ox0dea: http://knowyourmeme.com/memes/how-to-draw-an-owl
[09:01:10] Xeago: As I don't E in AED
[09:01:30] jgt1: has joined #ruby
[09:01:41] lkba: has joined #ruby
[09:01:50] adaedra: Wait, I didn't want to join #homework
[09:01:53] Ox0dea: Xeago: Do you know about complementary angles?
[09:02:04] jxs_: has joined #ruby
[09:02:42] Xeago: rings a bell
[09:03:09] apeiros: Xeago: the height of even sided triangles is known
[09:03:16] apeiros: I think from that you can solve the rest
[09:03:20] slawrence00: has joined #ruby
[09:04:15] Ox0dea: >> 3.even?
[09:04:16] ruboto: Ox0dea # => false (https://eval.in/455292)
[09:04:55] dionysus69: has joined #ruby
[09:05:39] apeiros: Xeago: if you want to "cheat", assume the length of AB=1, since the size doesn't matter. then use trig functions.
[09:06:47] workmad3: has joined #ruby
[09:07:09] apeiros: Xeago: btw., better suited for #ruby-offtopic ;-)
[09:07:41] Xeago: has joined #ruby
[09:08:08] Ox0dea: Xeago: What is angle CBE?
[09:08:09] Xeago: It's not even my homework, not even my gf's homework
[09:08:13] subscope: has joined #ruby
[09:08:16] apeiros: Xeago: hm, got my messages?
[09:08:25] Xeago: I'll read it on http://irclog.whitequark.org/ruby/
[09:08:35] Ox0dea: Xeago: You previously stated that this is in fact your girlfriend's homework.
[09:08:40] chipotle: has joined #ruby
[09:08:51] Xeago: Ox0dea: no, exercises for a test
[09:08:57] Xeago: test != homework
[09:09:15] Ox0dea: I wanted to help too.
[09:09:19] adaedra: homework = work you do home?
[09:09:23] Xeago: she isn't in school???
[09:09:29] Gnomethrower: has left #ruby: ("Textual IRC Client: www.textualapp.com")
[09:09:39] TheBrayn: in kindergarten?
[09:09:50] Xeago: so if I work from home I do homework? :>
[09:09:58] Xeago: She's just studying
[09:10:12] Xeago: And takes tests online, that's it.
[09:10:26] Ox0dea: I like the part where subtracting from 90 and 180 is giving her hell.
[09:10:30] norc: Is there a better way to stop a consumer in this producer/consumer pattern than this? http://pastie.org/10499409
[09:10:39] norc: (Aside from Queue#close which might appear in 2.3)
[09:11:00] Xeago: apeiros: assuming length of 1 and using trigonometric functions is difficult to do without a calculator, which is the setting for these exercises
[09:11:19] chris2: you can do it in the head
[09:11:25] Xeago: I've my equations to solve it as such, it doesn't help me explain to her how to solve it without one
[09:11:36] apeiros: Xeago: a couple of values are well known, and I'd bet for the angle in question it's one of those
[09:11:42] adaedra: Psst, now that we have ruby questions, it may be a good time to move it to oddtopic, people
[09:11:47] adaedra: err, offtopic
[09:11:58] Eternal: has left #ruby: ()
[09:12:03] Xeago: chris2: then I'd get an answer represented in cos(???)*n
[09:12:19] Xeago: adaedra: sure, will do!
[09:12:41] TheBrayn: Xeago: what's the length of EB?
[09:12:47] Ox0dea: ?ot TheBrayn
[09:12:47] ruboto: TheBrayn, this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related topics. Thanks!
[09:14:12] lee-jon: has joined #ruby
[09:15:47] shevy: what is EB
[09:15:55] norc: shevy. Look - I wrote code!
[09:16:01] adaedra: norc: I suppose you want to be able to wait on an empty queue so Queue#empty? would be out of question
[09:16:05] shevy: norc in C?
[09:16:09] norc: shevy: :(
[09:16:15] norc: adaedra: Yeah.
[09:17:26] norc: adaedra: The producers access "sluggish" resources on a network, so it is possible that at times the consumer might empty the queue fast enough.
[09:17:30] tenderlove: has joined #ruby
[09:17:40] moeabdol: has joined #ruby
[09:17:59] Pupeno: has joined #ruby
[09:18:20] Jackneill_: has joined #ruby
[09:18:20] adaedra: norc: unrelated to you issue, but while(true) => loop do
[09:18:43] roshanavand: has joined #ruby
[09:18:44] norc: adaedra: Oh neat thanks.
[09:18:52] twe4ked: has joined #ruby
[09:19:11] adaedra: And I think you want ==, not ===
[09:19:21] TheBrayn: Xeago: query
[09:19:31] adaedra: leave === to which
[09:19:39] norc: adaedra: Ah that was a mispaste from the wrong buffer. Im instantiating the Stop class. But either way yeah
[09:20:24] adaedra: Otherwise, you can also have a variable that your process sets to true at the end and check for this variable in your loop, maybe as a class attribute somewhere.
[09:20:52] norc: adaedra: Updated. :) http://pastie.org/10499426
[09:21:12] adaedra: obj.is_a? Stop
[09:21:45] armyriad: has joined #ruby
[09:22:09] adaedra: I suppose that producer_pool.shutdown ensures that your processes have finished producing before adding the Stop in your queue
[09:22:45] norc: adaedra: Indeed. Thread::Pool#shutdown blocks until all workers have finished, and then destroys the pool.
[09:22:54] adaedra: So yeah, the "global" switch works too. I don't know if one is better.
[09:23:13] norc: adaedra: The issue with the "global switch" is queue.pop.
[09:23:29] adaedra: Ah, because it will block
[09:24:01] lkba_: has joined #ruby
[09:24:27] norc: This would be the perfect thing for this: https://bugs.ruby-lang.org/issues/10600 *sigh*
[09:25:34] shevy: you always have to convince nobu and matz first!
[09:25:44] Ox0dea: The bar's been lowered.
[09:26:46] norc: Ox0dea: You mean you only have to convince matz now?
[09:27:21] adaedra: norc: you now have to bring your PR into Mordor.
[09:27:22] Ox0dea: Well, matz had to greenlight .? before nobu committed his patch.
[09:28:52] Ox0dea: I do wish he'd voice his opposition to #grep-like #all? and friends.
[09:30:06] GriffinHeart: has joined #ruby
[09:30:28] roshanavand: has joined #ruby
[09:30:37] twe4ked: has joined #ruby
[09:31:19] naftilos76: has joined #ruby
[09:31:47] GriffinHeart: has joined #ruby
[09:32:34] Xeago: has joined #ruby
[09:32:57] Ox0dea: To be fair, I don't actually know how he feels about it.
[09:33:21] Ox0dea: But the issue got directly assigned to him the day I proposed it, and it's just kinda languished since. :<
[09:33:33] tenderlove: has joined #ruby
[09:33:39] twe4ked: has joined #ruby
[09:33:44] TPBallbag: has joined #ruby
[09:34:00] Ox0dea: strs.all?(/foo/) looks so "Ruby", does it not?
[09:34:28] joonty: has joined #ruby
[09:35:42] sameerynho: has joined #ruby
[09:37:41] rodfersou: has joined #ruby
[09:40:53] shevy: this must be rejected!
[09:41:15] shevy: actually, what is .all? doing?
[09:41:33] shevy: if all elements have the pattern match
[09:42:07] Ox0dea: #all? and #any? are very handy.
[09:42:15] Ox0dea: #one? and #none?, not so much.
[09:42:28] Ox0dea: But having to open an explicit block for them is eww.
[09:42:51] shevy: you are using enumerators in a different way there right?
[09:43:17] shevy: the .all?(/foo/)
[09:43:21] shevy: that would be new right?
[09:43:37] shevy: now I can understand the opposition in ruby-core :-)
[09:43:41] Ox0dea: As it stands, we have to say `strs.all? { |s| /foo/ === s }`.
[09:43:49] moeabdol: has joined #ruby
[09:44:04] Ox0dea: Syntactic noise, an arbitrary name, and just general unpleasantness.
[09:44:25] shevy: ruby core sorta became sleepier from what I could see when matz went to invest time into mruby
[09:44:52] Ox0dea: shevy: What opposition?
[09:45:10] shevy: to new syntax variants!
[09:45:17] shevy: like the .all?(/foo/) without block
[09:45:30] Ox0dea: It's not new syntax, though.
[09:45:43] Ox0dea: It's just properly leveraging case equality.
[09:46:55] psycho_one: has joined #ruby
[09:49:15] Igorshp: has joined #ruby
[09:50:41] psycho_one: has joined #ruby
[09:51:41] jenrzzz: has joined #ruby
[09:53:11] tenderlove: has joined #ruby
[09:53:27] joonty: has joined #ruby
[09:53:37] andykingking: has joined #ruby
[09:54:34] Xeago: has joined #ruby
[09:56:08] darthdeus: has joined #ruby
[09:56:23] subscope: has joined #ruby
[09:57:10] darthdeus: hey guys, when trying to bundle my repo, I'm getting the following: https://gist.github.com/darthdeus/1cf71d8af57a582741d7 ... which is weird because my ruby install is using rbenv (confirmed that `which ruby` and `which gem` both point to the rbenv shims)
[09:57:21] darthdeus: and `rbenv versions` shows 2.2.3 instead of the system one as well
[09:57:25] darthdeus: (I'm on arch linux)
[09:57:33] spider-mario: has joined #ruby
[09:58:07] shevy: the same distribution that jhass uses \o/ now he only has to wake up ...
[09:58:50] jhass: well, I don't use rbenv
[09:58:56] vigintas: has joined #ruby
[09:59:02] jhass: which bundle ?
[09:59:22] darthdeus: bundler version 1.10.6
[09:59:33] darthdeus: it's a fairly clear install of everything
[09:59:35] jhass: nah, `which bundle`
[09:59:58] darthdeus: hmm, that points to $HOME/.gem/ruby/2.2.0/bin/bundle
[10:00:03] darthdeus: I guess that's the issue :D
[10:00:04] krz: has joined #ruby
[10:00:15] jhass: gem install bundler
[10:00:36] darthdeus: thanks, now stuff works :)
[10:00:38] jhass: perhaps after a echo "gem: --no-user-instal" > ~/.gemrc
[10:00:46] jhass: ah, then nvm
[10:00:59] darthdeus: I actually did a user install on purpose before, because I didn't want to use rbenv for simple things
[10:01:13] darthdeus: but I guess I forgot to update my path :\
[10:01:27] jhass: https://gist.github.com/jhass/8839655bb038e829fba1 in case you're curious
[10:01:30] TPBallbag: has joined #ruby
[10:01:58] darthdeus: hmm :O I'll check that out, thanks
[10:02:25] jhass: though I bundle install --path vendor/bundle most of the time still
[10:02:38] jhass: since then you can just rm -rf a project and its gone for good
[10:03:12] darthdeus: btw any reason why you're using yaourt in particular? just curious
[10:03:25] shevy: jhass how many different ruby versions do you use on your system these days?
[10:03:56] jhass: I got 1.9, 2.0, 2.1, 2.2 installed but really using I'm only 2.1 and 2.2, with 2.2 90% of the time
[10:04:07] nhhagen: has joined #ruby
[10:04:08] TheHodge: has joined #ruby
[10:06:20] bruno-: has joined #ruby
[10:08:08] beauby: has joined #ruby
[10:10:24] Ox0dea: darthdeus: Which AUR helper Kool-Aid did you end up drinking, if you don't mind my prying?
[10:10:39] teclator: has joined #ruby
[10:10:55] dmolina: has joined #ruby
[10:10:56] moeabdol: has joined #ruby
[10:11:07] darthdeus: Ox0dea: cower
[10:11:21] darthdeus: but basically I only use it to search and download
[10:11:30] Ox0dea: That's... all it does?
[10:11:56] darthdeus: Ox0dea: I guess :P
[10:12:16] adaedra: Ox0dea: you're one of these AUR helpers haters?
[10:12:27] Ox0dea: adaedra: No, but pacaur is objectively best.
[10:12:51] darthdeus: Ox0dea: tbh the only reason why I have cower is because I don't want to open a browser every time I need something
[10:13:05] Ox0dea: I like the part where your browser is ever closed.
[10:13:08] Ox0dea: What year is it?
[10:13:42] tenderlove: has joined #ruby
[10:13:42] tenderlove: has joined #ruby
[10:14:00] rdark: has joined #ruby
[10:14:03] darthdeus: even with custom search for aur I still have to open a tab, type in the name, search for the donwload, click on it and unpack the download
[10:14:26] chthon: has joined #ruby
[10:15:50] GriffinHeart: has joined #ruby
[10:16:00] Ox0dea: darthdeus: Pretty much every AUR helper has decent search functionality, pacaur's being second-to-none.
[10:16:12] Ox0dea: Do you enjoy manually issuing `makepkg` or something...?
[10:16:41] darthdeus: erm, I was argumenting on the case that cower is way better than doing it manually using a browser
[10:16:48] darthdeus: not that it is some ultra solution that is the bestest in the whole world
[10:16:49] bruno-: has joined #ruby
[10:18:09] caliostro: has joined #ruby
[10:18:43] Ox0dea: $ pacaur -S `pacaur -Ssq ttf`
[10:18:56] Ox0dea: darthdeus: That'll install every single TTF font package in the AUR.
[10:18:58] davedev24: has joined #ruby
[10:19:43] Ox0dea: I feel the need to clarify that it's only a demonstration.
[10:20:23] rickmasta: has joined #ruby
[10:20:31] shevy: oooooh so Ox0dea is also an archie like jhass
[10:20:41] Ox0dea: You knew that, though.
[10:21:24] shevy: don't remember really
[10:22:21] bruno-: has joined #ruby
[10:22:44] Ox0dea: http://logs.ryanbigg.com/p/shevy?page=45#3547884
[10:23:46] nfk|laptop: has joined #ruby
[10:23:54] symbole: has joined #ruby
[10:24:43] Jackneill: has joined #ruby
[10:24:56] Gustavo: has joined #ruby
[10:26:30] blackmesa: has joined #ruby
[10:27:01] shevy: oh yes now I remember
[10:27:49] bruno-: has joined #ruby
[10:28:24] Ox0dea: [k- had asked me how large the GHC package was.
[10:28:30] Ox0dea: $ pacman -Qql ghc | xargs stat -c %s | paste -sd + | bc
[10:28:30] ldnunes: has joined #ruby
[10:28:31] Ox0dea: 946864281
[10:29:24] tenderlove: has joined #ruby
[10:29:28] trosborn: has joined #ruby
[10:29:44] krz: has joined #ruby
[10:31:56] cornerma1: has joined #ruby
[10:33:13] mostlybadfly: has joined #ruby
[10:34:09] norc: shevy: But, as a matter of fact - I have actually written some C code today. So you were not that far from the truth.
[10:35:07] leafybasil: has joined #ruby
[10:36:26] yfeldblum: has joined #ruby
[10:37:28] shevy: norc your C prowess is visible in your ruby!
[10:40:53] Nahra: has joined #ruby
[10:41:19] Rollabunna: has joined #ruby
[10:41:30] unshadow: has joined #ruby
[10:41:35] pwnd_nfsw: has joined #ruby
[10:42:17] aswen: has joined #ruby
[10:42:23] unshadow: This string "\x00\x00\x00\x10" represents the number 16, how can I pack\unpack it to return 16 ? as in "\x00\x00\x00\x10".pack(?) == 16
[10:42:24] Ilyes512: has joined #ruby
[10:42:47] leafybasil: has joined #ruby
[10:42:54] eikood: has joined #ruby
[10:43:37] bruno-: has joined #ruby
[10:44:35] krz: has joined #ruby
[10:44:35] Ox0dea: unshadow: ? = 'L>'
[10:44:50] canton7: "stuff".unpack("L>") yep
[10:44:56] canton7: see http://ruby-doc.org/core-2.2.3/String.html#method-i-unpack
[10:45:18] unshadow: very cool, thanks
[10:45:27] unshadow: what does the '>' means ?
[10:46:04] canton7: unshadow, see the doc page I linked
[10:46:51] Ox0dea: canton7: But there are 382 instances of '>' on that page!
[10:47:06] Gustavo: has joined #ruby
[10:47:19] unshadow: well, it says in the table : "same as the directives without ">" except" and doesnt go on
[10:47:25] canton7: but I linked to a specific section on that page ><
[10:47:31] canton7: unshadow, read the next line..... ;)
[10:47:42] zotherstupidguy: has joined #ruby
[10:47:53] canton7: line breaks man, how do they work?
[10:48:09] Ox0dea: It's complicated.
[10:48:16] nateberkopec: has joined #ruby
[10:49:10] tenderlove: has joined #ruby
[10:49:57] joonty: has joined #ruby
[10:50:24] astrobun_: has joined #ruby
[10:51:29] senayar: has joined #ruby
[10:51:29] senayar: has joined #ruby
[10:51:53] shevy: don't break things
[10:53:22] mnzaki: has joined #ruby
[10:53:31] Ox0dea: > The world breaks everyone, and afterward, some are strong at the broken places.
[10:53:52] Xeago: has joined #ruby
[10:54:15] RegulationD: has joined #ruby
[10:54:37] ibouvousaime: hello how can I put screenshots here ?
[10:54:50] Ox0dea: ibouvousaime: Convert them to ASCII and flood the channel.
[10:55:09] ibouvousaime: is imgur allowed ?
[10:57:59] TPBallbag: has joined #ruby
[10:58:06] Zarthus: if it's a picture of your code: use gist.github.com or whatever instead
[11:00:52] solocshaw: has joined #ruby
[11:01:35] monq: has joined #ruby
[11:02:26] ljarvis: https://bugs.ruby-lang.org/issues/11537
[11:03:19] workmad3: ljarvis: yeah, that's pretty much my reaction too
[11:04:02] shevy: u.?profile.?thumbnails.?large could be extended into u.?profile?.?thumbnails?.?large?
[11:04:28] shevy: and then it would be unfair to prefer only ? so we would also need u.!profile!.!thumbnails!.!large!
[11:04:40] Ox0dea: > would be unfair
[11:04:43] workmad3: shevy: haha
[11:04:49] jhass: workmad3: ljarvis so who wants to PR to bbatsov and disallow it everywhere? :P
[11:05:11] Ox0dea: That'd be a laugh.
[11:05:33] workmad3: shevy: unless someone is writing pretty bad code, `u.?profile?.?thumbnails` would error (because TrueClass and FalseClass don't support a `thumbnails` method)
[11:06:01] moeabdol: has joined #ruby
[11:06:27] arthurnn: has joined #ruby
[11:07:04] bruno-: has joined #ruby
[11:07:08] ibouvousaime: hello can someone help me get rid of that thing in red http://i.imgur.com/ScYVTGY.png
[11:07:14] ljarvis: yeah needs that really
[11:07:21] weihan: has joined #ruby
[11:08:28] Ox0dea: ibouvousaime: Use the "fill" option instead of "stroke" on your shape tool.
[11:08:28] tenderlove: has joined #ruby
[11:08:55] adaedra: ibouvousaime: here you go friend http://i.imgur.com/RTII3Q8.png
[11:09:35] Pupp3tm4st3r: has joined #ruby
[11:10:25] adaedra: ibouvousaime: more seriously, it seems that's the thing you use to execute the script that adds the last return at the end. How do you run it?
[11:10:26] joonty: has joined #ruby
[11:10:48] ibouvousaime: hehe its on codeacademy
[11:11:01] adaedra: So it's totally possible that it prints the last result.
[11:12:31] trampi: has joined #ruby
[11:12:39] Ox0dea: ibouvousaime: The Codecademy REPL is showing you the value of the last expression (as REPLs are wont to do).
[11:12:53] Ox0dea: In this case, that's the return value of `words.each`, which is `words`.
[11:14:02] ibouvousaime: ohh yeah it worked there wanted to add a space after the "letters"
[11:15:03] ibouvousaime: they wanted me*
[11:15:27] but3k4: has joined #ruby
[11:16:58] Ox0dea: ibouvousaime: http://i.imgur.com/UlsFWfY.png
[11:17:08] Ox0dea: Codecademy is the MyMathLab of programming, apparently.
[11:17:12] stamina: has joined #ruby
[11:17:34] allcentury: has joined #ruby
[11:17:40] jhass: Ox0dea: haha, reminds me of some system we had to use at university
[11:17:55] Hanmac: has joined #ruby
[11:17:57] dmolina: has joined #ruby
[11:18:08] mengu: has joined #ruby
[11:18:08] mengu: has joined #ruby
[11:19:09] adaedra: Ox0dea: ahah
[11:20:19] purplexed^: has joined #ruby
[11:21:17] linocisco: has joined #ruby
[11:21:23] linocisco: khon ni chi wa
[11:22:13] sdothum: has joined #ruby
[11:22:57] Tuxist: has joined #ruby
[11:23:45] mbeasley: has left #ruby: ("WeeChat 0.4.2")
[11:25:15] blackmesa: has joined #ruby
[11:25:40] ibouvousaime: Ox0dea, thats so frustrating xD
[11:26:27] Ox0dea: ibouvousaime: It builds character.
[11:26:29] tenderlove: has joined #ruby
[11:27:22] ericjphillips: has joined #ruby
[11:27:22] Ox0dea: > For all its power, the computer is a harsh taskmaster. Its programs must be correct, and what we wish to say must be said accurately in every detail.
[11:27:32] Ox0dea: Welcome to the Thunderdome.
[11:28:47] prestorium: has joined #ruby
[11:28:51] dmolina: has joined #ruby
[11:29:07] linocisco: is somebody using ruby with digium asterisk framework for mobile payment solution?
[11:31:21] shevy: workmad3 ah right, I forgot that it would call methods on true or false
[11:32:17] nhhagen: has joined #ruby
[11:33:28] mollusk_: has joined #ruby
[11:33:35] beauby: has joined #ruby
[11:34:08] mollusk_: is it possible to do variable functions in ruby like in php?
[11:34:28] purplexed^: did you try asking google ? :)
[11:34:44] mollusk_: purplexed^, google keeps giving me unrelated results
[11:34:52] Ox0dea: Stupid Google.
[11:34:53] mollusk_: no matter how I search
[11:34:58] Ox0dea: Google so dumb.
[11:35:10] mollusk_: tried putting "variable functions" ruby
[11:35:20] mollusk_: then it gave me infor for php
[11:35:28] Ox0dea: It's a sign.
[11:35:36] mollusk_: ruby probably can't do it
[11:35:47] adaedra: mollusk_: it all depends on what you want to do.
[11:36:00] sts: has left #ruby: ()
[11:36:05] mollusk_: var = "hello"
[11:36:07] purplexed^: mollusk, maybe it's called something else in Ruby
[11:36:17] Ox0dea: mollusk_: We have #send.
[11:36:23] adaedra: &ri Object#send
[11:36:23] `derpy: http://www.rubydoc.info/stdlib/core/Object#send-instance_method
[11:36:48] atzorvas: has joined #ruby
[11:37:04] mollusk_: I want to avoid creating a class
[11:37:06] Ox0dea: >> def foo; 42; end; help = 'foo'; send help # mollusk_
[11:37:07] ruboto: Ox0dea # => 42 (https://eval.in/455413)
[11:37:14] adaedra: But there's other ways (maybe more suited to what you want) to have it, like Object#method
[11:37:25] adaedra: mollusk_: no need. Everything's already an object.
[11:37:32] Ox0dea: Except methods.
[11:37:57] mollusk_: right, like puts "hi".chomp
[11:38:08] mollusk_: everything is a method
[11:38:23] Ox0dea: 42 is not a method.
[11:38:57] jds: has joined #ruby
[11:39:21] adaedra: >> def foo; 42; end; help = method(:foo); help.call
[11:39:22] ruboto: adaedra # => 42 (https://eval.in/455414)
[11:39:36] adaedra: So many ways,
[11:39:59] Ox0dea: We must keep telling ourselves it's a good thing.
[11:40:13] shevy: java is good
[11:40:14] shevy: java is good
[11:40:20] mollusk_: is "method" something generic or just a place holder?
[11:40:26] mollusk_: is it actual syntax
[11:40:28] adaedra: no, it's Object#method
[11:40:38] shevy: everything is a method!
[11:40:39] apeiros: method is a method
[11:40:52] apeiros: just like Class is a Class :)
[11:40:58] Ox0dea: >> method(:method).class # mollusk_
[11:40:59] ruboto: Ox0dea # => Method (https://eval.in/455415)
[11:40:59] adaedra: >> "hello".method(:itself).call
[11:41:00] ruboto: adaedra # => "hello" (https://eval.in/455416)
[11:41:03] purplexed^: method is a method is a method .. how poetic
[11:41:10] adaedra: mh, miss a thing
[11:41:23] adaedra: >> "hello".method(:method).call(:itself).call
[11:41:24] ruboto: adaedra # => "hello" (https://eval.in/455417)
[11:41:33] mollusk_: too bad it's not as easy as $variable()
[11:41:36] shevy: mollusk_ you can return an object that has bound a method in ruby; have a look at http://ruby-doc.org/core-2.2.0/UnboundMethod.html
[11:41:41] ldnunes: has joined #ruby
[11:42:01] adaedra: mollusk_: send and method are rather easy.
[11:42:04] Ox0dea: mollusk_: How do you send a dynamic message to an object in PHP?
[11:42:12] ljarvis: also you should use public_send
[11:43:06] pathrocle: has joined #ruby
[11:43:12] Ox0dea: ljarvis: So I should stop invoking `public(*private_methods)` before I use a given class in anger?
[11:43:33] adaedra: I wonder why the short one is not the public one.
[11:43:40] pathrocle: has joined #ruby
[11:43:41] Ox0dea: This is #ruby.
[11:43:44] ljarvis: as a side note, i would *happily* take method objects over optional parens
[11:43:47] ljarvis: adaedra: because Ruby
[11:43:55] shevy: probably because .send is older
[11:44:00] Ox0dea: And better.
[11:44:04] Ox0dea: And more MINASWAN.
[11:44:09] shevy: definitely it is shorter
[11:44:28] adaedra: `Object.minaswan`?
[11:44:43] tenderlove: has joined #ruby
[11:44:48] Ox0dea: We need #safe_send for parity with `.?`, methinks.
[11:44:54] shevy: minaswan sounds like the name of a samurai
[11:45:05] adaedra: minaswan lake
[11:45:13] Ox0dea: #try! nearly made it in, but matz doesn't like the name.
[11:45:15] shevy: lol there is a lake called that way?
[11:45:33] Ox0dea: shevy << :some_culture
[11:46:01] snebel: has joined #ruby
[11:47:40] Ox0dea: ACTION << ASWAN
[11:47:45] Ox0dea: Sorry, shevy.
[11:47:53] Ox0dea: adaedra was punning: https://en.wikipedia.org/wiki/Swan_Lake
[11:48:36] Ox0dea: ASWAN has my tongue.
[11:49:06] shevy: nobody understands Ox0dea except for Ox0dea
[11:49:21] Ox0dea: I kinda like it this way.
[11:49:35] shevy: mina the swan
[11:49:37] shevy: alot the beast
[11:50:07] pwnd_nsfw: has joined #ruby
[11:51:23] Ox0dea: The former would make for a great mascot.
[11:51:52] adaedra: So Mina the Swan is our new Ruby mascot?
[11:51:56] adaedra: I'm okay with this.
[11:52:33] beauby: has joined #ruby
[11:52:55] shevy: I <3 alot http://goo.gl/J19wyu
[11:53:04] atzorvas: has joined #ruby
[11:53:08] jenrzzz: has joined #ruby
[11:53:20] Ox0dea: shevy: Have you by chance read her book?
[11:53:51] Ox0dea: Allie Brosh, the creator of the Alot.
[11:54:00] shevy: never heard that name before
[11:54:34] adaedra: shevy: do you <3 alot a lot?
[11:54:35] shevy: I don't read alot of books anymore :<
[11:54:57] shevy: adaedra I think the idea is awesome, we need something like this for ruby too. the ruby logo is not cute enough
[11:55:04] subscope: has joined #ruby
[11:55:16] shevy: a cold, dead ruby ... http://img3.wikia.nocookie.net/__cb20130122221837/logopedia/images/c/c9/Ruby-language.png
[11:55:18] adaedra: shevy: great! So you should ask matz.
[11:55:31] shevy: crystal also has this problem but at least you can rotate the crystal logo with the mouse
[11:55:39] araujo_: has joined #ruby
[11:57:00] nhhagen: has joined #ruby
[11:57:01] senayar: has joined #ruby
[11:57:18] decoponio: has joined #ruby
[11:57:31] shevy: I think someone once drew a ruby hydra ... let me first google for it though, my memory isn't the best
[11:57:39] aryaching: has joined #ruby
[11:57:39] joncol: has joined #ruby
[11:57:58] mollusk_: Thanks for the links, I created a gist to explain exactly what I want to do. https://gist.github.com/silvernode/7f32d8838ca0a7cc65e3
[11:58:08] joncol: Hi, I'm having some difficulties with RSpec: how can I
[11:58:14] shevy: oh yes, http://pow.cx/
[11:58:19] TheBrayn: yes you can
[11:58:25] adaedra: mollusk_: don't use for.
[11:59:03] shevy: I tried to make it better by giving it colours, but I actually managed to make it worse :( http://shevegen.square7.ch/RUBY_HYDRA.png
[11:59:08] adaedra: Because there's rubyier ways. Like pkgMgrs.each do |i|
[11:59:27] ibouvousaime: on text.split does one needs to precise (" ") when the text is being split according to spaces?
[11:59:41] adaedra: &ri String#split
[11:59:41] `derpy: http://www.rubydoc.info/stdlib/core/String#split-instance_method
[12:00:03] shevy: ibouvousaime I usually give an argument to .split because I can't remember the default, but you should be able to omit it
[12:00:06] tenderlove: has joined #ruby
[12:00:15] adaedra: [docs intensifies]
[12:00:15] mollusk_: adaedra, same difference though
[12:00:19] symbole: has joined #ruby
[12:00:21] ibouvousaime: ohh okay thanks
[12:00:25] adaedra: mollusk_: that was for style
[12:00:40] adaedra: you can send(pkgMgr)
[12:01:23] mollusk_: adaedra, not sure how that would be what I want
[12:01:39] adaedra: You want to call a method which name is store into pkgMgr, right?
[12:01:44] adaedra: is stored*
[12:01:48] joncol: Hi, I'm having some difficulties with RSpec: how can I verify that a callback (a Proc) is invoked? I pass the callback to the invoker by using `obj.register_listener(listener.method(:callback_name))`. My callback is actually invoked, but I don't know how to make RSpec verify this. Doing `expect(listener).to receive(:callback_name)` doesn't work (I guess since the proc is not called via the `listener` object,
[12:01:54] joncol: but directly using `Proc#call`. Can anyone help?
[12:02:28] shevy: "I have functions already made: apt-get()"
[12:02:29] adaedra: `expect(callback).to be_called`, iirc
[12:02:30] SOLDIERz: has joined #ruby
[12:02:36] shevy: are you sure you have a method called apt-get made mollusk_
[12:02:47] adaedra: Ah, didn't catch that :D
[12:03:24] adaedra: Mh, I have `.to receive(:call)` in my code
[12:03:56] mollusk_: shevy, it's in another file, also, functions are called methods in ruby right?
[12:04:13] adaedra: methods are defined with def
[12:04:19] mollusk_: I get caught up with the syntax and terminology in ruby a lot
[12:04:26] mollusk_: vs other languages
[12:04:30] adaedra: A method is a function bound to an object.
[12:04:41] Ox0dea: >> "foo \s\t\n bar \s\t\n baz".split # ibouvousaime
[12:04:42] ruboto: Ox0dea # => ["foo", "bar", "baz"] (https://eval.in/455436)
[12:05:03] joncol: adaedra: I've tried `.to receive(:call)` but that doesn't work, since the method is not called via the object.
[12:05:14] symbol: has joined #ruby
[12:05:23] adaedra: ah, it worked in my case
[12:06:26] joncol: adaedra: Did you call the method using normal obj.call(...) syntax?
[12:06:46] kalusn: has joined #ruby
[12:06:59] Igorshp: has joined #ruby
[12:07:55] Gustavo: has joined #ruby
[12:08:15] jgpawletko: has joined #ruby
[12:08:23] mollusk_: adaedra, send("#pkgMgr") worked, but looking at it, I can't understand what I am reading, which is why I wasn't sure if it would help me. Is it just looking for a method named 'pacman()' and then calling it?
[12:08:53] adaedra: `send(pkgMgr)` was sufficient.
[12:09:03] adaedra: also, like ljarvis said, public_send
[12:09:12] Ox0dea: joncol: You'll need to attach the expectation to the Proc itself; do you know how to get hold of it?
[12:09:41] adaedra: So yes, it tries to call a method named "pacman" on the current object (here main) and run it
[12:09:54] chop1n: has joined #ruby
[12:10:00] dionysus69: has joined #ruby
[12:10:00] Ox0dea: adaedra: That's not quite right.
[12:10:11] mollusk_: adaedra, public_send, is like like local vs global variables?
[12:10:18] mollusk_: same concept?
[12:10:20] adaedra: no, public vs private
[12:10:28] adaedra: Ox0dea: which part?
[12:10:37] Ox0dea: >> def foo; end; method(:foo).owner # adaedra
[12:10:38] ruboto: Ox0dea # => Object (https://eval.in/455447)
[12:10:42] mollusk_: would I need to have it private if it was in main?
[12:10:42] Ox0dea: Not `main`.
[12:11:05] mollusk_: public I mean
[12:11:25] adaedra: Ox0dea: ah
[12:11:52] Ox0dea: Excessive pedantry in the current context, certainly, but top-level methods don't go on `main`.
[12:11:55] bruno-: has joined #ruby
[12:12:03] adaedra: mollusk_: methods are by default public.
[12:12:12] adaedra: Ox0dea: that's good to know anyway.
[12:12:31] adaedra: mollusk_: how well do you know ruby?
[12:12:43] Rollabunna: has joined #ruby
[12:13:04] atomical: has joined #ruby
[12:13:28] blaxter: has joined #ruby
[12:13:40] Ox0dea: >> def foo; end; 1.public_methods.include?(:foo) # adaedra
[12:13:41] ruboto: Ox0dea # => false (https://eval.in/455480)
[12:13:44] Ox0dea: (I'll stop.)
[12:14:13] Ox0dea: >> def foo; end; 1.private_methods.include?(:foo)
[12:14:14] ruboto: Ox0dea # => true (https://eval.in/455483)
[12:14:25] Ox0dea: The default visibility of a method is contextual.
[12:15:38] tenderlove: has joined #ruby
[12:15:44] mollusk_: adaedra, not well at all
[12:16:01] Ox0dea: mollusk_: What made you decide to ditch PHP?
[12:16:23] mollusk_: Ox0dea, never used php, it just came up in google
[12:16:41] mollusk_: I did a lot of bash scripting, some lua and a tiny bit of python before ruby
[12:16:57] mollusk_: I wanted a python without whitespace
[12:16:58] adaedra: mollusk_: don't try to do a parallel with PHP. They are not the same languages and do not work the same way.
[12:17:16] Ox0dea: s/PHP/Bash/, now that we know.
[12:17:24] cantaberry: has joined #ruby
[12:17:39] mollusk_: adaedra, I figured that, but I thought php wouldn't be the only one to have variable functions
[12:17:54] mollusk_: it seems to be the only one
[12:18:00] adaedra: What you described above is not really variable functions though.
[12:18:03] adaedra: It's a cheap trick.
[12:18:05] mollusk_: well, syntax wise
[12:18:15] Ox0dea: mollusk_: Is that the important part?
[12:18:33] adaedra: And once again, I don't remember how it is called.
[12:18:39] synthroid: has joined #ruby
[12:18:41] Ox0dea: Dynamic dispatch.
[12:18:45] mollusk_: Ox0dea, pretty much, I get confused with ruby because there are ruby ways of doing things
[12:18:49] shevy: ruby is php on elegant steroids
[12:19:04] Rollabunna: has joined #ruby
[12:19:06] adaedra: That's not the term I'm looking for, Ox0dea. I'm talking about having functions in variables directly.
[12:19:07] shevy: there are simple ways in ruby
[12:19:25] Ox0dea: adaedra: First-class citizenship?
[12:19:33] adaedra: Ox0dea: danke sch??n.
[12:19:50] mollusk_: var.each |i| vs for i, seems pretty straight forward but if I say it for the first time I would go....what the heck?
[12:19:55] zwdr: Ruby is infinitely more fun than PHP
[12:20:24] adaedra: mollusk_: you can't save a method itself in a variable in Ruby. However, you can get Method object which you can call, through method, you can have Proc objects for anonymous functions, or you can use (public_)send if you just have the name.
[12:20:40] shevy: .each is the object-centric variant, think of an inventory like a backpack, then you shuffle through its content via .each
[12:21:12] micw: has joined #ruby
[12:21:30] mollusk_: adaedra, so I can't do: myvar = methodName() ?
[12:21:43] Ox0dea: No, that'll invoke the method.
[12:21:45] adaedra: No, but you can myvar = method(:methodName)
[12:21:57] dmolina: has joined #ruby
[12:22:08] Gustavo: has joined #ruby
[12:22:22] adaedra: ri:Object#method will create a Method object that you can call, which will forward to the real method.
[12:22:34] adaedra: er, I didn't deploy that yet.
[12:23:12] Kamilion: has joined #ruby
[12:23:17] n008f4g_: has joined #ruby
[12:23:19] adaedra: >> def foo; "hello"; end; myvar = method(:foo); myvar.call # mollusk_
[12:23:20] ruboto: adaedra # => "hello" (https://eval.in/455492)
[12:23:25] skade: has joined #ruby
[12:23:49] micw: Is this a ruby data structure? http://pastebin.com/2uTwqb9q
[12:23:50] ruboto: micw, we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/b285c85540fa506c5b02
[12:23:50] ruboto: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[12:24:14] adaedra: micw: looks like ruby code.
[12:24:15] Ox0dea: micw: Yes, that's a Hash.
[12:24:56] sgambino: has joined #ruby
[12:24:56] ibouvousaime: Ox0dea, it worked xD
[12:25:50] Ox0dea: mollusk_: Do you know why shell languages tend to be considered "stringly typed" (a pejorative pun on "strongly")?
[12:25:53] JJM: has joined #ruby
[12:25:54] micw: I'd like to convert this to: http://pastebin.com/7jcWQVgY
[12:25:54] ruboto: micw, as I told you already, please use https://gist.github.com
[12:26:09] mollusk_: Ox0dea, nope
[12:26:14] Ox0dea: mollusk_: Look into it.
[12:26:32] adaedra: ACTION is out
[12:26:39] joncol: Ox0dea: Ah, you mean like `expect(my_proc).to receive(:call)`?
[12:26:44] micw: I could do it using sed/grep/tr but probably that can easyly be done with a few ruby lines?
[12:26:45] Ox0dea: joncol: Just so.
[12:26:57] joncol: Ox0dea: cool, thx
[12:27:23] Ox0dea: micw: hash#each { |key, value| puts ... }
[12:27:29] Ox0dea: *hash.each
[12:27:43] micw: how can i read the hash from command line arg?
[12:27:53] Ox0dea: Where is it now?
[12:27:58] Ox0dea: In a file?
[12:29:02] micw: environment variable
[12:29:10] micw: $ANSIBLE_GROUPS
[12:29:15] Ox0dea: You have a Ruby Hash in an environment variable...?
[12:29:22] micw: no, i put it there
[12:29:28] Ox0dea: Reconsider.
[12:29:30] micw: orinately it's part of a vargantfile
[12:29:37] benjito: has joined #ruby
[12:29:46] micw: i can have it where I like to have it ;-)
[12:29:59] pwnd_nsfw: has joined #ruby
[12:30:09] micw: e.g. as 1st command line arg of my script
[12:30:26] nertzy: has joined #ruby
[12:30:27] ericjphillips: has joined #ruby
[12:30:29] Ox0dea: Why does it need to be passed in on the command line if it's already in the environment?
[12:31:42] micw: Ox0dea, it would take a while do explain all the stuff around and would not help with my ruby problem
[12:31:49] mollusk_: I'll share my program with everyone soon. It's just a simple package manager wrapper. If I end up getting pull requests, that's cool :)
[12:31:58] Ox0dea: >> ENV['SHELL'] # micw
[12:31:59] ruboto: Ox0dea # => nil (https://eval.in/455493)
[12:32:11] Ox0dea: Dammit. Anyway, Ruby gives you ENV.
[12:32:13] micw: short summary: I need to do something that normally Vagrant (a ruby tool) does for me
[12:32:27] micw: Ox0dea, I found ARGV
[12:33:19] Ox0dea: micw: Yeah, definitely copy it over from ENV to ARGV; you can never be too careful.
[12:33:29] Ox0dea: I've heard of environment variables sneaking off at odd hours.
[12:34:07] tagrudev: https://gist.github.com/tagrudev/725223ba51c4e2318240
[12:34:15] tagrudev: any ideas - ruby installation on ubuntu 14.04
[12:34:24] mollusk_: heh, I just realized that methods won't work for my purpose. can't use a hyphen in method names
[12:34:25] micw: unfortunately $ARGV[0] is a string, not a hash...
[12:34:53] mollusk_: if pkgMgr = "apt-get", I can't have it call a method called apt-get
[12:35:25] teclator: has joined #ruby
[12:35:45] Gustavo: has joined #ruby
[12:35:53] mollusk_: the way I had it before was apt-get.rb, require_relative "#{pkgMgr}"
[12:36:01] marr: has joined #ruby
[12:36:39] gustav__: has joined #ruby
[12:37:11] mag42c: has joined #ruby
[12:37:21] tvw: has joined #ruby
[12:38:08] micw: solved (eval)
[12:38:09] jxs_: has joined #ruby
[12:38:31] Gustavo: has joined #ruby
[12:38:43] micw: how cn i write the "puts..." part of "hash.each { |key, value| puts ... }" as block with several lines?
[12:39:04] rbennacer: has joined #ruby
[12:39:20] Ox0dea: mollusk_: Name your methods with underscores as appropriate and use `send pkgMgr.tr('-', '_')`.
[12:39:25] gusTester: has joined #ruby
[12:39:50] dorei: has joined #ruby
[12:40:22] mollusk_: send(pkgMgr.tr('-', '_'))
[12:40:34] micw: ah, do...end. solved
[12:40:44] micw: thank you for advise. problem solved ;-)
[12:41:15] mollusk_: Ox0dea, ok, so ruby made that really easy to solve :P
[12:41:20] micw: https://gist.github.com/micw/e10ab9c62268f007c604
[12:41:37] Ox0dea: mollusk_: So much more whence that came.
[12:41:38] mollusk_: I was afraid I would have to use something like sed
[12:43:31] mollusk_: Ox0dea, there is a problem though, since pacman doesn't have a hyphen like apt-get does, the ruby script crashes when pkgMgr is set to pacman.
[12:43:48] Ox0dea: >> 'pacman'.tr('-', '_')
[12:43:49] ruboto: Ox0dea # => "pacman" (https://eval.in/455496)
[12:43:51] rwilcox_: has joined #ruby
[12:44:22] sdfgsdfg: has joined #ruby
[12:45:08] sdfgsdfg: has joined #ruby
[12:45:40] mollusk_: Ox0dea, This is what I had: send(pkgMgr.tr('-', '_'))
[12:45:41] ibouvousaime: if number%3 ==0 return true
[12:45:41] ibouvousaime: else return false
[12:46:00] ibouvousaime: I get as error (ruby):7: warning: else without rescue is useless
[12:46:25] ibouvousaime: any idea of what is causing that ?
[12:46:30] Ox0dea: ibouvousaime: You're missing an `end`.
[12:47:21] apeiros: ibouvousaime: also after the condition in the if you either need a newline or a `then`
[12:47:27] ibouvousaime: I wrote end after than but that end is said to be unexpected
[12:48:16] Ox0dea: ibouvousaime: http://i.imgur.com/ScYVTGY.png
[12:48:21] Ox0dea: Why do you write your code like that?
[12:48:35] Ox0dea: Are you trying to make it look like some other language?
[12:49:19] astrobun_: has joined #ruby
[12:49:35] ibouvousaime: it s a random style I guess :/
[12:49:36] mollusk_: Ox0dea, nevermind it worked, I had an unrelated error
[12:49:54] ibouvousaime: the "then" fixed it
[12:50:32] rickmasta: has joined #ruby
[12:51:27] hfp_work: has joined #ruby
[12:51:50] caliostro: i am playing a bit with thread, i don't understand how abort_on_exception works
[12:51:52] caliostro: http://ix.io/lxW/ruby
[12:52:29] caliostro: GameOverException stop the main thread
[12:53:00] nemo_: has joined #ruby
[12:55:05] RegulationD: has joined #ruby
[12:57:28] rwilcox: has joined #ruby
[12:58:16] bruno-: has joined #ruby
[12:58:44] TPBallbag: has joined #ruby
[12:59:20] JDiPierro: has joined #ruby
[13:00:39] t_mmyv: has joined #ruby
[13:00:44] sankaber: has joined #ruby
[13:01:38] imperator: has joined #ruby
[13:01:48] ajafo: has joined #ruby
[13:01:49] sankaber: has joined #ruby
[13:02:06] Pupeno: has joined #ruby
[13:03:06] Igorshp: has joined #ruby
[13:03:15] sonOfRa: When I add a gem via git to my bundle, and it contains native extensions, does it build the whole thing on bundle install or do I need to do additional things (arguments?) for that?
[13:03:21] vifino: has joined #ruby
[13:03:25] e1senhorn: has joined #ruby
[13:03:39] Guest50: has joined #ruby
[13:04:39] gyre007: has left #ruby: ()
[13:04:41] wldcordeiro: has joined #ruby
[13:05:29] e1senhorn: has joined #ruby
[13:05:45] sonOfRa: looks like the .so is present. nevermind :)
[13:06:29] araujo: has joined #ruby
[13:08:24] mnzaki: has joined #ruby
[13:08:40] TheTime: has joined #ruby
[13:09:04] dionysus69: has joined #ruby
[13:11:17] aryaching: has joined #ruby
[13:14:07] chouhoul_: has joined #ruby
[13:14:11] davedev24: has joined #ruby
[13:15:45] syath: has joined #ruby
[13:15:50] `tim`: has joined #ruby
[13:19:21] joncol: has joined #ruby
[13:19:25] justbleed: has joined #ruby
[13:20:19] dravine: has joined #ruby
[13:21:00] caliostro: i am realy sure how abort_on_exception works
[13:21:08] caliostro: http://ix.io/lxW/ruby
[13:21:19] joncol: When using RSpec and doing `expect(obj).to receive(:fun_name)` it seems RSpec overwrites my `fun_name` method with an empty mock. Must I use `.and_call_original` to get it to work with my defined method?
[13:21:23] caliostro: an unhandled exception kill the main thread too
[13:22:04] Rollabunna: has joined #ruby
[13:23:25] jgt1: has joined #ruby
[13:23:51] atzorvas: has joined #ruby
[13:24:05] mollusk_: so I got everything working correctly and made a git repo
[13:24:07] mollusk_: https://github.com/silvernode/tux
[13:24:33] mollusk_: just need to work on a readme
[13:25:27] mollusk_: just supports, void linux, arch linux and debian based systems. Run this script and it should pick up your package manager
[13:26:07] mollusk_: it's just a wrapper :)
[13:26:47] adaedra: That code style is really strange.
[13:27:24] mollusk_: I didn't want to use case either but I also don't feel like learning a gem right now
[13:27:32] mollusk_: or ption parser
[13:27:40] mollusk_: optionparser*
[13:28:44] mollusk_: a friend of mine was working on this with me. We figure out that ruby has the shift command.
[13:29:08] sepp2k: has joined #ruby
[13:29:38] adaedra: Urgh globals
[13:30:01] dionysus69: has joined #ruby
[13:30:19] benjito: has joined #ruby
[13:30:56] mollusk_: adaedra, yeah I should fix that
[13:31:30] charliesome: has joined #ruby
[13:31:46] adaedra: imo, it would be better if you did modules representing your package manager, with constants inside these modules defining what you do with your globals. Then, in your main code, find the right module and call the constants on it.
[13:32:04] pdoherty: has joined #ruby
[13:32:26] mollusk_: adaedra, that is wayyy beyond my level right now which is why I hacked this together.
[13:32:56] mollusk_: right now I am just happy that it works
[13:33:01] Igorshp: has joined #ruby
[13:33:11] adaedra: that's an enhancement proposition, for you to consider, if you want to push things further.
[13:33:34] idefine: has joined #ruby
[13:34:19] wldcordeiro: has joined #ruby
[13:35:31] sdwrage: has joined #ruby
[13:37:32] Ox0dea: >> methods.select { |m| method(m).owner == self }
[13:37:33] ruboto: Ox0dea # => [] (https://eval.in/455516)
[13:37:35] Ox0dea: Poor `main`.
[13:37:47] Gustavo: has joined #ruby
[13:37:49] Ox0dea: Of course, it's not a class, so it can't have any methods.
[13:37:54] Ox0dea: >> methods.select { |m| method(m).owner == singleton_class }
[13:37:55] ruboto: Ox0dea # => [:to_s, :inspect] (https://eval.in/455517)
[13:38:03] Ox0dea: All it knows how to do is print "main".
[13:38:15] adaedra: It knows who it is, it's already something.
[13:38:28] Ox0dea: >> '2deep4me'.gsub(/d\/, &:next)
[13:38:29] ruboto: Ox0dea # => /tmp/execpad-080d38c449a7/source-080d38c449a7:2: unterminated regexp meets end of file ...check link for more (https://eval.in/455518)
[13:38:37] Ox0dea: >> '2deep4me'.gsub(/\d/, &:next)
[13:38:38] ruboto: Ox0dea # => "3deep5me" (https://eval.in/455519)
[13:39:08] tkuchiki: has joined #ruby
[13:39:33] pathrocle: has joined #ruby
[13:40:06] TomyWork: has joined #ruby
[13:40:17] prestorium: has joined #ruby
[13:40:45] allcentury: has joined #ruby
[13:40:59] Xeago: has joined #ruby
[13:41:16] Ox0dea: mollusk_: I thought you said you don't like `sed`?
[13:41:16] araujo: has joined #ruby
[13:41:42] gustav__: has joined #ruby
[13:41:54] araujo: has joined #ruby
[13:42:32] mollusk_: Ox0dea, sed is scary, I do like it but always have trouble understanding what is going in just by reading it at first glance.
[13:42:42] RobertBirnie: has joined #ruby
[13:43:03] Ox0dea: Are you saying `tux` *wasn't* generated by a Bash-to-Ruby translation program? :P
[13:43:28] araujo: has joined #ruby
[13:43:32] ferr: has joined #ruby
[13:43:35] mollusk_: Ox0dea, like I said, I spent a lot of time in bash :P
[13:43:52] adaedra: Ox0dea: there's such tools?
[13:44:36] mollusk_: I actually made something pretty big in bash as if it was your standard programming language
[13:44:40] mollusk_: https://github.com/silvernode/zymp3
[13:44:42] Encapsulation: has joined #ruby
[13:44:50] mollusk_: I spent a lot of time on that
[13:45:03] beauby: has joined #ruby
[13:45:09] Ox0dea: adaedra: It's not outside the realm of possibility.
[13:45:21] symbol: has joined #ruby
[13:45:26] stardiviner: has joined #ruby
[13:45:42] lkba: has joined #ruby
[13:46:02] mollusk_: I think people would find use in zymp3 but so far I don't think anyone besides me has used it
[13:46:55] Ox0dea: mp{d,v} = <3
[13:47:36] mollusk_: I always have trouble with mpd
[13:47:45] adaedra: instead of if [ -f /usr/bin/xxx ] to check of a binary, it would be better to use which and check for the return value. This way, it works for people who have these binaries at other places, i.e. /usr/local/bin/xxx
[13:47:56] adaedra: how do I English
[13:48:14] Ox0dea: Just keep putting one letter in front of another.
[13:48:29] mollusk_: adaedra, yeah I didn't know about which then
[13:48:35] Ox0dea: http://i.imgur.com/Ufbr5ej.gif
[13:48:37] mollusk_: I should update zymp3
[13:48:54] ponga: has joined #ruby
[13:49:05] adaedra: Ox0dea: like this? jkhdscjkewkjfhuue
[13:49:10] ibouvousaime: do you see something wrong here
[13:49:11] ibouvousaime: def welcome(name)
[13:49:12] ibouvousaime: returns "Welcome to Ruby, #{name}"end
[13:49:12] ibouvousaime: welcome("star")
[13:49:31] ibouvousaime: I know I made another stupid mistake
[13:49:33] Ox0dea: >> require 'digest/bubblebabble'; Digest.bubblebabble 'justlikethat' # adaedra
[13:49:34] ruboto: Ox0dea # => "xipil-hesol-gurok-nepik-hytuk-memol-goxux" (https://eval.in/455525)
[13:49:40] adaedra: yes, the end should be on a line alone, ibouvousaime
[13:49:51] adaedra: Ox0dea: haha
[13:50:10] ibouvousaime: undefined method `returns' for #<Context:0x10aa1e4>
[13:50:15] adaedra: And it's 'return', not 'returns'
[13:50:15] mollusk_: #{name};end
[13:50:26] Igorshp: has joined #ruby
[13:50:26] adaedra: mollusk_: unterminated string.
[13:50:34] imperator: Ox0dea, agree (regarding new_ostruct_member behavior)
[13:50:37] adaedra: But try not to abuse ;.
[13:50:48] Ox0dea: ibouvousaime: I don't know that I've ever encountered a syntactical masochist, but here you are.
[13:50:51] mollusk_: puts "Hello #{name}";end
[13:51:00] Ox0dea: imperator: Definitely too late to change it. :<
[13:51:10] Ox0dea: For <3.0, anyhow.
[13:51:16] imperator: trying to figure out a way around it
[13:51:19] adaedra: each thing on its line and each line its thing.
[13:51:29] teclator: has joined #ruby
[13:51:41] ibouvousaime: I was blind to that error
[13:51:59] mollusk_: ibouvousaime, my point was, if you don't want to put end of another line you can use a semicolon between end
[13:52:04] imperator: Ox0dea, there's ostruct2 I suppose
[13:52:12] Ox0dea: I was not aware.
[13:52:31] adaedra: mollusk_: you can != you should.
[13:52:33] Ox0dea: imperator: Opposed on principle to monkey-patching #new_ostruct_member?
[13:52:54] adaedra: (and ibouvousaime too)
[13:53:02] imperator: well, this is part of a large code base, not sure what effect that would have
[13:53:19] Ox0dea: I think you'll just have to rename the member, then.
[13:53:21] imperator: of course, i wouldn't be in this mess but for someone reopening Object
[13:53:23] balazs: has joined #ruby
[13:53:23] mollusk_: adaedra, it does tend to not look good at all
[13:53:28] rbennacer: has joined #ruby
[13:53:36] synthroid: has joined #ruby
[13:53:36] Taha_The_Hacker: has joined #ruby
[13:53:45] mollusk_: but not always
[13:53:52] banister: has joined #ruby
[13:53:55] imperator: I was like, nah, there's no way these azure resource keys would ever conflict with ruby core method names
[13:54:16] imperator: then someone went and added a "namespace" method to Object - d'oh!
[13:55:30] JDiPierro: has joined #ruby
[13:55:37] emilkarl: has joined #ruby
[13:56:02] RegulationD: has joined #ruby
[13:57:16] imperator: welp, ostruct2 seems to have its own issues
[13:57:18] wprice: has joined #ruby
[13:57:52] adaedra: Time to start ostruct3
[13:58:26] cdg: has joined #ruby
[13:58:53] imperator: "I built an ostruct library and it sank into the swamp."
[13:59:04] Ilyes512: has joined #ruby
[13:59:19] Igorshp: has joined #ruby
[13:59:21] anisha: has joined #ruby
[13:59:57] anisha_: has joined #ruby
[14:00:10] shredding: has joined #ruby
[14:00:12] momo-reina: Anyone seen the latest Ruby commit? How do you the dereferencing operator? https://t.co/qzw4GnDXCE
[14:00:18] 64MAD4ZDZ: has joined #ruby
[14:00:57] Ox0dea: momo-reina: It's a "null coalescing" operator.
[14:01:24] Ox0dea: nil.?foo.?bar == nil
[14:01:25] jlevine: has joined #ruby
[14:01:30] Ox0dea: Instead of an explosion.
[14:01:48] chop1n: has joined #ruby
[14:02:21] havenwood: nil.?nil? #=> true
[14:02:37] GriffinHeart: has joined #ruby
[14:02:40] imperator: that looks horrible
[14:03:00] momo-reina: Ox0dea: you mean instead of checking for nil during ternary expressions?
[14:03:13] but3k4: has joined #ruby
[14:03:47] Ox0dea: momo-reina: Or &&, but yes.
[14:03:58] adaedra: havenwood: I don't understand where the true comes from.
[14:04:45] momo-reina: Ox0dea: thanks
[14:04:47] Ox0dea: imperator: How do you feel about this? https://eval.in/455530
[14:04:50] Ox0dea: momo-reina: Sure thing.
[14:05:21] imperator: Ox0dea, hmm....this looks....promising
[14:05:29] Ox0dea: adaedra: `nil` still behaves like `nil` if it responds to the method.
[14:05:46] adaedra: Ox0dea: yeah, but since it's nil, it should stops at the .? ?
[14:05:55] mistermocha: has joined #ruby
[14:06:18] Ox0dea: It's the arguments that don't get evaluated.
[14:06:34] Ox0dea: `nil.?foo(exit)` won't terminate your program.
[14:07:09] Ox0dea: Wait, no.
[14:07:16] Ox0dea: havenwood: `nil.?nil?` is `nil`.
[14:07:20] johnny56: has joined #ruby
[14:07:22] havenwood: Ox0dea: aha...
[14:07:37] Ox0dea: It is, isn't it?
[14:07:38] imperator: damn, i think Delegator is fighting me
[14:07:59] adaedra: Ox0dea: that sounds more logical to me.
[14:08:13] freerobby: has joined #ruby
[14:08:44] imperator: Ox0dea, https://gist.github.com/djberg96/ed691457ce659e3ff192
[14:08:50] Ox0dea: I feel like `nil.?to_s` should be "nil".
[14:09:14] mistermocha: has joined #ruby
[14:09:24] havenwood: Ox0dea: That was my expectation. Hem.
[14:11:46] imperator: tried OpenStruct.prepend OpenStructOverride before the call to JSON.parse, too - no joy
[14:12:22] bigmac_: has joined #ruby
[14:12:33] araujo: has joined #ruby
[14:12:34] araujo: has joined #ruby
[14:12:41] umgrosscol: has joined #ruby
[14:13:05] idefine: has joined #ruby
[14:13:26] absolutejam: has joined #ruby
[14:13:33] Ox0dea: imperator: Aye, Delegator is managing to insert itself between Foo and OpenStructOverride.
[14:14:39] doublemalt_: has joined #ruby
[14:15:18] Ox0dea: https://github.com/banister/remix#full-list-of-functions
[14:15:37] diegoaguilar: has joined #ruby
[14:15:46] anisha: has joined #ruby
[14:15:58] chop1n_: has joined #ruby
[14:16:07] Ox0dea: It doesn't work on recent Rubies, but it's at least theoretically possible to organize the lookup chain however you please.
[14:18:36] karapetyan: has joined #ruby
[14:19:39] zotherstupidguy: has joined #ruby
[14:21:18] sharkman: has joined #ruby
[14:21:29] dravine_: has joined #ruby
[14:21:32] mollusk_: installed ruby on another machine, I am getting: undefined method 'tr' for nil:NilClass (NoMethoderror)
[14:21:48] Xeago: has joined #ruby
[14:21:49] dionysus69: has joined #ruby
[14:21:50] canton7: mollusk_, you're calling .tr on something that's nil
[14:22:02] canton7: that's literally all that we can say right now, with the information you've given us
[14:22:07] ruboto: havenwood # => undefined method `tr' for nil:NilClass (NoMethodError) ...check link for more (https://eval.in/455558)
[14:22:24] mollusk_: canton7, Oh I know why now
[14:22:43] mollusk_: canton7, thanks for getting my brain going
[14:23:59] Ox0dea: mollusk_: Was it because you don't have any of the package managers installed?
[14:24:15] Ox0dea: Consider using `tar` as a fallback.
[14:24:27] imperator: ACTION needs to look at Delegator
[14:26:46] The_Phoenix: has joined #ruby
[14:27:49] Ox0dea: imperator: It'd be interesting if #inherit were a method.
[14:28:16] Ox0dea: Then `Foo.prepend(Override).inherit(Delegator)` might do the trick.
[14:28:19] dopamean_: has joined #ruby
[14:28:41] sl33k: has joined #ruby
[14:29:06] Ox0dea: sl33k: Well, hey there, little lady.
[14:29:11] sl33k: can anyone recommend a fine book to learn ruby? not too beginner focus would be helpful as I have a strong CS and Java background
[14:29:28] ruboto: You can find a list of recommended books at http://ruby-community.com/pages/links
[14:29:46] sl33k: goal is to pick up rails next, but want to have more than solid grasp of ruby as I may give it some of my future scripting task
[14:30:07] Ox0dea: > more than solid
[14:30:10] sl33k: jhass: which one would you recommend?
[14:30:22] jhass: dunno, didn't read any
[14:30:27] dionysus69: has joined #ruby
[14:30:33] adaedra: Ox0dea: he wants to be the Iron Rubyist.
[14:30:58] macowie: has joined #ruby
[14:31:05] EmeraldExplorer: has joined #ruby
[14:31:05] jhass: isn't IronRuby a thing?
[14:31:06] solars: hey, what gem to use for quick mysql access to dump to csv?
[14:31:14] adaedra: jhass: dead, I'm afraid.
[14:31:48] jxl180: has joined #ruby
[14:31:49] adaedra: solars: mysql, mysql2. But I think it's totally achievable with mysql cli.
[14:32:18] solars: yes but I need to do some processing
[14:33:22] sl33k: jhass: so i'll just scheme through a few till i get comfy then
[14:33:57] jhass: solars: check sequel
[14:34:02] troulouliou_div2: has joined #ruby
[14:34:04] ksteck: has joined #ruby
[14:34:05] tkuchiki_: has joined #ruby
[14:35:25] elektronaut: has joined #ruby
[14:35:43] TDJACR: has joined #ruby
[14:37:21] Ox0dea: sl33k: http://learnxinyminutes.com/docs/ruby/
[14:37:24] mordocai: has joined #ruby
[14:37:41] Channel6: has joined #ruby
[14:38:23] dfockler: has joined #ruby
[14:38:37] chipotle: has joined #ruby
[14:39:14] banister: has joined #ruby
[14:39:57] sl33k: Ox0dea: thanks mate
[14:40:12] sl33k: Ox0dea: no shit with that?
[14:40:38] sl33k: One more thing, I'm stuck to windows at work...so would want a setup on it. Is this possible and sane
[14:40:42] kies^: has joined #ruby
[14:40:51] imperator: this seems to suggest you can work around it, but I'm not seeing how: http://devblog.orgsync.com/2013/03/22/decorate-your-ruby-objects-like-a-boss/
[14:41:02] zwdr: yea, that's possible. The official website recommends RubyInstaller afaik
[14:41:08] hfp_work: has joined #ruby
[14:41:11] jhass: sl33k: ymmv on sane, but http://rubyinstaller.org/
[14:41:20] zwdr: I use the same setup on my desktop at home, and it works OK
[14:41:35] sl33k: zwdr: you have a windows at home? ewww
[14:41:39] ibouvousaime: I got another question, when you got a method with rev=false and you want to call that method, do you just need toput true as argument or rev=true as argument?
[14:41:46] sl33k: i only use windows at work. cos work and zero choice
[14:41:53] zwdr: sl33k: I like to play video games :s
[14:42:02] jobewan: has joined #ruby
[14:42:03] sl33k: zwdr: well...
[14:42:08] jhass: ibouvousaime: the former, foo(rev=true) is the same as rev=true; foo(rev)
[14:42:16] zwdr: I mostly dev on my laptop tho, with proper linux
[14:42:16] jhass: ibouvousaime: that is you just assign a local
[14:42:32] ibouvousaime: here is the method def alphabetize (arr, rev=false)
[14:42:39] adaedra: sl33k: if the windows setup is not for you, you can try to setup a Linux VM.
[14:42:55] ibouvousaime: so it should be alphabetize (something, true) if I wanted to call it ?
[14:43:11] jhass: ibouvousaime: without the spaces before the ( in both cases, but yes
[14:43:51] p0wn3d: has joined #ruby
[14:43:58] segfalt: has joined #ruby
[14:44:03] dravine_: has joined #ruby
[14:44:21] sl33k: adaedra: i dont want a full VM (bad experience with those) want something lighter
[14:44:31] sl33k: adaedra: not sure if docket plays in that space?
[14:44:38] jhass: sl33k: boot from a thumb drive? :P
[14:44:57] adaedra: It would need a vm under windows, afaik
[14:45:21] sl33k: how about cygwin ?
[14:45:32] nickjj: sl33k, docker will run in a light weight VM on windows
[14:45:44] but3k4: has joined #ruby
[14:45:48] nickjj: it's just abstracted from you with docker-machine
[14:45:57] darix: it is not a VM
[14:45:58] sl33k: nickjj: ruby -v gives me ruby 2.2 on my windows
[14:46:11] sl33k: think i might be good
[14:47:00] sl33k: so to launch the interpeter? ruby command doesnt do it on cygwin
[14:47:16] jhass: you mean the repl? irb
[14:47:27] sl33k: typing python gives me the repl though
[14:47:28] ruboto: sl33k, 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` directly in your source code. Visit https://pryrepl.org/ or get it now with: gem install pry pry-doc
[14:47:30] nickjj: darix, sure it is
[14:47:38] hfp_work: has joined #ruby
[14:48:16] sl33k: bleh. would just use the first link...
[14:48:39] sl33k: download and install a full setup
[14:48:43] sl33k: thanks guys
[14:49:08] sunya7a: has joined #ruby
[14:49:16] jhass: ?guys sl33k
[14:49:16] ruboto: sl33k, Though inclusion was probably intended, not everyone relates to being "one of the guys". Maybe consider using "folks", "all", "y'all", or "everyone" instead?
[14:49:36] sl33k: thanks folks
[14:49:39] sl33k: ruboto: seen
[14:49:52] jhass: ?justabot
[14:49:52] ruboto: I'm just a bot. You don't need to address me.
[14:49:59] havenwood: ruboto: good mornin'
[14:50:39] sl33k: jhass: i didnt see your mention. would have guessed
[14:50:57] havenwood: Probably a good idea to go ahead and get on the good side of our future robotic overlords.
[14:51:01] polishdub: has joined #ruby
[14:51:13] havenwood: Likely lead by ruboto.
[14:51:23] jhass: yeah yeah, you promised that so many times now
[14:52:50] rippa: has joined #ruby
[14:53:16] karapetyan: has joined #ruby
[14:55:06] dopie: has joined #ruby
[14:56:02] decoponyo: has joined #ruby
[14:56:07] kaleido: has joined #ruby
[14:56:21] codecop: has joined #ruby
[14:56:25] devoldmx_: has joined #ruby
[14:56:57] bruno-_: has joined #ruby
[14:56:58] mollusk_: Ox0dea, I was passing the wrong thing to which
[14:57:53] ibouvousaime: I really dont know what codeacademy wants me to do now it looks like its working http://i.imgur.com/BRNNUHR.png http://i.imgur.com/vL5sU0K.png but they dont accept it
[14:57:54] mollusk_: xbps didn't exist but xbps-install does
[14:57:59] rservant_: has joined #ruby
[14:58:00] cbetta_: has joined #ruby
[14:58:02] jmhmccr_: has joined #ruby
[14:58:15] mollusk_: ibouvousaime, oh god, code academy
[14:58:29] NaN|2: has joined #ruby
[14:58:29] jaygen: has joined #ruby
[14:59:00] mollusk_: it always made whatever language I was trying to learn, more confusing than it was.
[14:59:06] Dreamer3_: has joined #ruby
[14:59:12] MVPhelp_: has joined #ruby
[14:59:15] perrier_: has joined #ruby
[14:59:34] jobewan: has joined #ruby
[14:59:55] ELCALOR_: has joined #ruby
[15:00:34] ammar: has joined #ruby
[15:00:41] speaking2ode: has joined #ruby
[15:00:45] Skelz0r_: has joined #ruby
[15:00:46] rtl_: has joined #ruby
[15:00:46] shadeslayer_: has joined #ruby
[15:00:48] peterhu_: has joined #ruby
[15:00:51] benjito: has joined #ruby
[15:01:05] hostess_: has joined #ruby
[15:01:07] lucasr: has joined #ruby
[15:01:10] tomaz_b: has joined #ruby
[15:01:25] y0da: has joined #ruby
[15:01:35] pdoherty: has joined #ruby
[15:01:41] funnel_: has joined #ruby
[15:01:41] kobain: has joined #ruby
[15:01:51] verdoc_: has joined #ruby
[15:02:39] iamvery_: has joined #ruby
[15:03:18] twodayslate_: has joined #ruby
[15:03:28] rfv_: has joined #ruby
[15:03:37] giuseppesolinas: has joined #ruby
[15:03:53] epochwolf|2: has joined #ruby
[15:03:56] Seich_: has joined #ruby
[15:03:57] DanKnox^: has joined #ruby
[15:03:58] linc01n_: has joined #ruby
[15:03:59] veloutin_: has joined #ruby
[15:04:01] ujjain-: has joined #ruby
[15:04:02] Gnubie_: has joined #ruby
[15:04:03] nullwarp_: has joined #ruby
[15:04:04] jhass|off: has joined #ruby
[15:04:07] Derasi: has joined #ruby
[15:04:09] LBRapid_: has joined #ruby
[15:04:11] omninonsense: has joined #ruby
[15:04:12] Sigma01: has joined #ruby
[15:04:15] Ankhers_: has joined #ruby
[15:04:17] iooner-: has joined #ruby
[15:04:18] mgorbach_: has joined #ruby
[15:04:18] CustosLimen: has joined #ruby
[15:04:21] Olipro_: has joined #ruby
[15:05:09] twe4ked_: has joined #ruby
[15:05:20] jimeh_: has joined #ruby
[15:05:20] chopin: has joined #ruby
[15:05:24] Gustavo: has joined #ruby
[15:05:37] an0ma1y: has joined #ruby
[15:05:52] korolyov: has joined #ruby
[15:05:55] larissa_: has joined #ruby
[15:06:06] Billias_: has joined #ruby
[15:06:07] teotwaki_: has joined #ruby
[15:06:08] sl33k: thing about learning new language is staying long enough to use it
[15:06:17] zzak_: has joined #ruby
[15:06:19] rideh-: has joined #ruby
[15:06:25] TheBrayn: and actually finding practical applications
[15:06:42] sl33k: angularjs is interesting. gives me something new. ruby on rails however is same request-response cycle
[15:06:57] universal: has joined #ruby
[15:06:57] sl33k: server generates resonse from templates
[15:07:02] m_shir: has joined #ruby
[15:07:19] tkuchiki: has joined #ruby
[15:07:26] Miron: has joined #ruby
[15:07:28] darkf: has joined #ruby
[15:07:30] sl33k: business as usual
[15:07:30] sl33k: at the end of the day backend is boring without EIPs etc
[15:07:40] ggherdov_: has joined #ruby
[15:08:38] george2: has joined #ruby
[15:08:39] joncol: has joined #ruby
[15:09:04] RegulationD: has joined #ruby
[15:09:21] centrx: has joined #ruby
[15:09:42] bryanray: has joined #ruby
[15:09:53] dfinninger: has joined #ruby
[15:10:13] sl33k: hate net splits
[15:10:21] tubbo: sl33k: it's part of why rails is a lot better now than it used to be :P
[15:10:28] jaxxstorm: has joined #ruby
[15:10:44] sl33k: tubbo: i dont follow
[15:10:45] tubbo: even though most people would disagree with me, rails is a lot more stable and people hear "no" a lot more than they hear "yes" when they ask if it can do something. that's a good thing. it means rails has a place in the world.
[15:11:00] rmrrn: has joined #ruby
[15:11:00] rmrrn: has joined #ruby
[15:11:04] jwang: has joined #ruby
[15:11:13] ghr: has joined #ruby
[15:11:14] Guest7778: has joined #ruby
[15:11:16] amitchellbullard: has joined #ruby
[15:11:21] tubbo: rails is *really* good at building full stack web applications that serve HTML. it's also pretty damn good at building API-only web applications that serve JSON.
[15:11:22] sunya7a: has joined #ruby
[15:12:00] Davey: has joined #ruby
[15:12:00] Davey: has joined #ruby
[15:12:13] sl33k: tubbo: hmm...have you used other web stacks? I have. So it would be interesting learning and comparing notes
[15:12:15] centrx: It's also excellent at getting you from railroad station A to railroad station B
[15:12:39] bluntman: has joined #ruby
[15:12:43] sl33k: tubbo: i'm also learning rails cos most of my younger friends prefer it and I cant do projects opensource with them in Java :'(
[15:12:48] Guest85414______: has joined #ruby
[15:12:49] tubbo: sl33k: yes, i've built stuff with python and php using various web frameworks.
[15:12:53] tubbo: as well as ruby
[15:13:02] duoi: has joined #ruby
[15:13:05] tubbo: sl33k: haha, why not? are they too cool for java or something?
[15:13:18] tubbo: you can really stick it to them by using jruby
[15:13:28] Klumben: has joined #ruby
[15:13:29] sl33k: tubbo: they are silly i guess.
[15:13:47] sl33k: tubbo: but seriously though the wind has blown albeit strongly. ruby and rails cant be ignored
[15:14:14] Igorshp: has joined #ruby
[15:14:21] Bugboy1028: has joined #ruby
[15:14:33] sl33k: so many fun projects within my community in ruby/rails. moved to Sheffield recently. NO Java User group. But I found a ruby one; shrub
[15:14:35] tubbo: sl33k: definitely. if you have a bunch of java/CS experience i would suggest maybe just jumping right in? :()
[15:14:47] towler: has joined #ruby
[15:15:06] Asher: has joined #ruby
[15:15:06] xxneolithicxx: has joined #ruby
[15:15:08] ghr: has joined #ruby
[15:15:18] tubbo: like, start the hartl rails tutorial and see how lost you get...if you need to get some references on ruby...but you'd probably be right at home building classes/modules/et. al.
[15:15:22] segmond: has joined #ruby
[15:15:26] tubbo: typically java devs who get started with ruby make "too many classes" :)
[15:15:38] skmp: has joined #ruby
[15:15:43] tubbo: because they don't realize how much ruby actually provides for them (since java didn't)
[15:15:46] TDJACR_: has joined #ruby
[15:15:54] catbusters: has joined #ruby
[15:16:10] sl33k: and ruby guys just use too many gems
[15:16:13] sfr^: has joined #ruby
[15:16:24] tubbo: hah, well...that's kind-of the big win of ruby right?
[15:16:36] skade: has joined #ruby
[15:16:36] havenwood: sl33k: no trolling.
[15:16:45] tubbo: too many gems in my Gemfile (too many gems)
[15:16:58] sl33k: tubbo: i just implement an apache camel solution at work. i wonder what the ruby solution would be.
[15:17:07] Igorshp: has joined #ruby
[15:17:17] tubbo: sl33k: is that a new cigarette or something?
[15:17:24] sl33k: so matured enterprise languages would always have their place
[15:17:27] syath: has joined #ruby
[15:17:53] mark2: has left #ruby: ("PART #RubyOnRails :PART #jquery :PART #reactjs :PART ##javascript :PART #elixir-lang :PART #debian :PART #zsh :PART #nethunter :PONG :wolfe.freenode.net")
[15:17:59] frankS2: has joined #ruby
[15:18:11] xxneolithicxx: has joined #ruby
[15:18:21] sl33k: tubbo: well the team that built camel named it after a cigarette so i heard. Its an Enterprise Integration framework
[15:18:27] sl33k: havenwood: i am not
[15:18:31] tubbo: haha cool
[15:18:53] sl33k: tubbo: i should get to my learning...you'll see me around in the next few weeks
[15:19:12] tubbo: my favorite rails tutorial is `rails new` :)
[15:19:33] havenwood: rails new tutorial
[15:19:47] adaedra: rails new bloat
[15:19:51] teclator: has joined #ruby
[15:20:17] havenwood: adaedra: then `cd bloat` and `rails new bloat`, rinse and repeat
[15:20:21] jsrn: has joined #ruby
[15:20:47] adaedra: havenwood: can barely do that 3 times on a 1TB drive before you're out of free space.
[15:20:49] larissa: has left #ruby: ("Leaving")
[15:21:03] drbrain: has joined #ruby
[15:22:32] Nightmare: has joined #ruby
[15:22:51] dionysus69: has joined #ruby
[15:22:52] cdg: has joined #ruby
[15:22:53] nemo__: has joined #ruby
[15:23:49] Outlastsheep: has joined #ruby
[15:25:29] riotjones: has joined #ruby
[15:25:54] b3nt_pin: has joined #ruby
[15:26:15] kaleido: has joined #ruby
[15:26:27] gusTester: has left #ruby: ()
[15:26:35] waxjar: has joined #ruby
[15:27:09] mary5030: has joined #ruby
[15:27:30] karapetyan: has joined #ruby
[15:27:57] bf4: has joined #ruby
[15:27:59] a2z: has joined #ruby
[15:28:06] atomical: has joined #ruby
[15:28:50] Ox0dea: has joined #ruby
[15:29:15] jobewan: has joined #ruby
[15:29:31] mary5030: has joined #ruby
[15:29:56] beauby: has joined #ruby
[15:30:34] nemo_: has joined #ruby
[15:30:58] imperator: Ox0dea, https://github.com/rubyworks/ostruct2/issues/7 :)
[15:33:40] Cache_Money: has joined #ruby
[15:33:50] Ox0dea: imperator: In many jurisdictions, gravedigging isn't technically illegal unless one subsequently exhumes a body, so I think you should be good.
[15:33:59] nemo__: has joined #ruby
[15:34:05] bb010g: has joined #ruby
[15:34:24] rehat: has joined #ruby
[15:34:58] Jardayn: has joined #ruby
[15:35:02] tkuchiki: has joined #ruby
[15:35:17] baroquebobcat: has joined #ruby
[15:35:40] imperator: so it hasn't seen an update in 2 years...
[15:36:14] romero: has joined #ruby
[15:36:15] A124: has joined #ruby
[15:38:29] cwong_on_irc: has joined #ruby
[15:38:44] ceej: has joined #ruby
[15:39:09] baroquebobcat: has joined #ruby
[15:39:12] moss: has joined #ruby
[15:40:14] RobertBirnie: has joined #ruby
[15:41:47] ceej: morning. I'm trying to improve my ruby code. I came up with a way to recursively turn a flat keyed hash into a nested one. What would be a better more efficient way to do it? https://gist.github.com/800e0cdeea2e361dae25
[15:42:44] HoloIRCUser: has joined #ruby
[15:43:20] dionysus69: has joined #ruby
[15:43:30] johnhamelink: has joined #ruby
[15:44:10] kraljev11: has joined #ruby
[15:44:15] A124: has joined #ruby
[15:44:38] jpfuentes2: has joined #ruby
[15:44:40] slawrence00: has joined #ruby
[15:44:47] Silex: has joined #ruby
[15:45:01] Igorshp: has joined #ruby
[15:45:11] absolutejam: has joined #ruby
[15:45:54] shevy: you make a simple hash more complicated than it was before?
[15:46:01] skarn: has joined #ruby
[15:46:06] step1step2: has joined #ruby
[15:46:31] blackjid: has joined #ruby
[15:46:47] rcvalle: has joined #ruby
[15:46:57] ericjphillips: has joined #ruby
[15:47:17] ricer2: has joined #ruby
[15:47:22] kaleido: has joined #ruby
[15:49:24] gregf__: shevy: the flat was originally too complex ;)
[15:49:32] gregf__: oops: hash i meant
[15:49:33] daxroc: Anyone know an issue with net:http where it would truncate get requests 16384 chars in length but others of larger would succeed doesn't seem to be any rhyme or reason.
[15:50:03] 16WAAK2ZI: has joined #ruby
[15:50:03] Senjai: has joined #ruby
[15:50:04] symm-: has joined #ruby
[15:50:10] romero_: has joined #ruby
[15:50:11] Ox0dea: ceej: I trust this is just for fun?
[15:50:32] daxroc: *plain curl requests doesn't seem to truncate the body
[15:50:39] adaedra: daxroc: you mean that get requests longer than 16384 chars pass?
[15:50:41] Ox0dea: daxroc: Are you on a really old machine?
[15:50:52] rwilcox_: has joined #ruby
[15:50:54] tpendragon_: has joined #ruby
[15:50:54] j416: has joined #ruby
[15:51:22] daxroc: adaedra: no the truncated all seem to be that length
[15:51:36] adaedra: there may be a limit in the HTTP request length.
[15:51:42] daxroc: Ox0dea: no modern vms
[15:52:20] daxroc: adaedra: other requests return larger body contents
[15:52:30] adaedra: body != address
[15:52:31] nanoz: has joined #ruby
[15:52:38] ldnunes: has joined #ruby
[15:52:43] ceej: shevy: I'm just wanting it to be a nested hash. Ox0dea: yes
[15:52:55] Ox0dea: daxroc: Well, that it's a power of 2 is obviously pertinent; I thought perhaps your `sizeof(long)` was really small or something.
[15:53:02] Ox0dea: ceej: Do you know about autovivification?
[15:53:15] wprice: has joined #ruby
[15:53:31] ceej: Ox0dea: like using #tap on a hash?
[15:53:34] Fredrich010: has joined #ruby
[15:53:42] Ox0dea: ceej: No, not at all.
[15:53:54] absolutejam: has joined #ruby
[15:53:58] Ox0dea: "Autovivify" means "to spring into existence" in this case.
[15:54:07] adaedra: Wise Ox0dea
[15:54:11] johnny56: has joined #ruby
[15:54:22] jenrzzz: has joined #ruby
[15:54:33] ankhers: How can I create a function within a class that does not require the use of dot syntax? e.g., my_func(hash) instead of instance.my_func(hash)
[15:54:51] ceej: Ox0dea: ok... just reading up on it
[15:55:06] Ox0dea: ceej: The Ruby example on Wikipedia leaves something to be desired.
[15:55:32] adempus: has joined #ruby
[15:56:15] Ox0dea: Ankhers: Could you clarify?
[15:56:19] daxroc: Ox0dea: ? Not following
[15:56:30] nemo_: has joined #ruby
[15:56:44] `based_pdev`: has joined #ruby
[15:56:55] Ox0dea: daxroc: Ignore me on this one; I was almost certainly barking in the wrong forest.
[15:57:54] SCHAAP137: has joined #ruby
[15:57:55] SCHAAP137: has joined #ruby
[15:58:36] nanoz]: has joined #ruby
[15:58:49] wldcordeiro: has joined #ruby
[16:00:03] tubuliferous_: has joined #ruby
[16:00:13] rservant_: has joined #ruby
[16:00:44] ankhers: http://lpaste.net/143619 (I realize this should be some kind of class hierarchy, but this is what I have to deal with at the moment.)
[16:00:53] rservant_: has joined #ruby
[16:01:01] amclain: has joined #ruby
[16:02:37] towski_: has joined #ruby
[16:02:39] dionysus69: has joined #ruby
[16:03:07] Ox0dea: Ankhers: And which dots are you wanting to remove?
[16:03:27] ericjphillips: has joined #ruby
[16:04:07] ankhers: Ox0dea: I'm getting complaints that it can't find the different build_my_class_* functions. I assumed it was because they are instance methods, which would require me to already have an instance of MyClass?
[16:04:12] Ox0dea: >> auto = Hash.new { |h, k| h[k] = Hash.new &h.default_proc }; auto[1][2][3] = 4; auto # ceej
[16:04:13] ruboto: Ox0dea # => {1=>{2=>{3=>4}}} (https://eval.in/455594)
[16:05:35] v4n: has joined #ruby
[16:05:54] Ox0dea: Ankhers: Yes, that's right. Do you know how to define class methods?
[16:05:59] snockerton: has joined #ruby
[16:06:05] trabulmonkee: has joined #ruby
[16:06:17] ankhers: def self.foo, but I don't really want to do that if I don't have to.
[16:06:48] dionysus69: has joined #ruby
[16:07:02] ankhers: Because I would need to call MyClass.build_my_class_foo
[16:07:16] m_shir: has left #ruby: ("ERC Version 5.3 (IRC client for Emacs)")
[16:07:42] ankhers: I just thought there may be some way to only need to call build_my_class_* without having an instance or making it a class method.
[16:07:43] jxs_: has joined #ruby
[16:07:56] ankhers: Ox0dea: ^^
[16:08:19] Ox0dea: Ankhers: You probably want MyClass to be a module, and then you can `include` it where appropriate to "import" its instance methods.
[16:09:06] ankhers: Ox0dea: Are they still going to be instance methods or would I be able to call them as a "regular" function.
[16:09:12] NeverDie: has joined #ruby
[16:09:33] ankhers: Actually, instance methods in that case may be alright.
[16:09:36] Ox0dea: Ankhers: They would remain instance methods of the module, but they would become class methods where you included them.
[16:09:46] Ox0dea: Sorry, you'll want #extend, not #include.
[16:09:56] ankhers: Ox0dea: I'll look into that. Thanks.
[16:09:59] mistermocha: has joined #ruby
[16:10:04] ankhers: It has been too long since I have done ruby :(
[16:10:11] Ox0dea: Ankhers: For clarity: https://eval.in/455595
[16:10:41] ankhers: Ox0dea: Thanks.
[16:10:44] Ox0dea: Sure thing.
[16:10:52] shevy: Ankhers so you came back to ruby! \o/
[16:11:29] Ox0dea: Ruby is the Hotel California.
[16:11:44] mehwork: how come this prints :foo instead of 'B': def foo(a: 'A', b: 'B') p b end
[16:12:07] mehwork: I know i should just be doing foo(whatever) and passing the dict in during call time, but still curious
[16:12:23] workmad3: >> def foo(a: 'A', b: 'B') p b end foo
[16:12:24] ruboto: workmad3 # => /tmp/execpad-ced2521b0f97/source-ced2521b0f97:2: syntax error, unexpected tIDENTIFIER, expecting key ...check link for more (https://eval.in/455596)
[16:12:30] workmad3: >> def foo(a: 'A', b: 'B') p b end; foo
[16:12:31] Azure|dc: has joined #ruby
[16:12:31] ruboto: workmad3 # => "B" ...check link for more (https://eval.in/455597)
[16:12:38] workmad3: mehwork: it does print 'B'
[16:12:48] Ox0dea: mehwork: Method definitions evaluate to the name of the method being defined.
[16:12:51] workmad3: mehwork: but you're not calling it... so maybe you're just seeing the result of defining the method? :)
[16:12:57] tjohnson: has joined #ruby
[16:12:58] adaedra: Welcome to the Ruby language ???
[16:12:59] adaedra: Such a lovely place ???
[16:13:15] rwilcox: has joined #ruby
[16:13:17] Ox0dea: mehwork: You're defining a method #foo that takes two keyword arguments, and then its body prints the `b` parameter.
[16:13:26] Channel6: has joined #ruby
[16:13:33] shevy: perhaps he is drunk!
[16:13:36] Ox0dea: >> foo = def bar; end; foo # mehwork
[16:13:37] ruboto: Ox0dea # => :bar (https://eval.in/455598)
[16:13:40] adempus: has left #ruby: ("Leaving")
[16:14:12] Ox0dea: He can check out any time he likes.
[16:14:21] canton7: but he can never leave....
[16:15:08] mr_r: has joined #ruby
[16:15:37] mr_r: At the top level, is the currently open class Object?
[16:15:38] shevy: hotel california sucks
[16:15:43] _djbkd: has joined #ruby
[16:16:30] jhass: mr_r: yes
[16:16:36] Ox0dea: jhass: Is it not main's singleton class?
[16:16:36] benjito_: has joined #ruby
[16:16:54] jhass: Ox0dea: given the definee is Object ...
[16:16:54] shevy: >> self.class
[16:16:55] ruboto: shevy # => Object (https://eval.in/455599)
[16:17:54] Xeago: has joined #ruby
[16:17:55] mr_r: jhass: So when a constant is looked up, it's looked up in the currently open class, which is Object? Correct?
[16:18:42] Ox0dea: >> TOPLEVEL_BINDING.receiver
[16:18:43] ruboto: Ox0dea # => main (https://eval.in/455600)
[16:19:22] rehat: is there a way to conditionally require a gem if it exists on the system?
[16:19:42] jhass: rehat: only by rescuing LoadError
[16:19:52] mg^^: rehat: begin; require "foo"; rescue LoadError; end
[16:20:13] rehat: jhass: ahh right
[16:20:17] rehat: mg^^: thanks
[16:20:19] dionysus69: has joined #ruby
[16:20:21] mg^^: I've done that a few times to provide optional functionality
[16:20:45] n008f4g_: has joined #ruby
[16:21:34] Guest50: has joined #ruby
[16:22:00] Ox0dea: >> $top == __id__; class Object; __id__ == $top; end # mr_r
[16:22:01] ruboto: Ox0dea # => false (https://eval.in/455602)
[16:22:24] mehwork: workmad3: woops, you're right. I thought i called it in the repl, but hadn't
[16:22:37] Ox0dea: It's unlikely to be of any significant relevance at this stage of your learning, but Object is not "the currently open class" at program start.
[16:22:50] SylarRuby: has joined #ruby
[16:23:20] Ox0dea: Scope and constant/method resolution are different things.
[16:23:36] imperator: I shall never give up, I shall never surrender: https://gist.github.com/djberg96/4ac8719663047e270170
[16:23:39] Salve: has joined #ruby
[16:23:54] vondruch: has joined #ruby
[16:24:19] Ox0dea: I half-expected that to work.
[16:24:21] dionysus69: has joined #ruby
[16:24:49] Guest50: has joined #ruby
[16:24:56] XV: has joined #ruby
[16:25:12] mr_r: Ox0dea: They're different objects. Main is an instance of Object. They can't have the same ids.
[16:26:05] Ox0dea: mr_r: If we were "inside Object" at program start, `TOPLEVEL_BINDING.receiver` would be Object.
[16:26:34] mwlang: has joined #ruby
[16:26:49] mr_r: Ox0dea: We must be inside Object since all method definitions at the top level become private instance methods of Object.
[16:26:59] naztharune: has joined #ruby
[16:27:01] XV: Anyone know of any gems that work with assembly or of a way to combine assembly with ruby? I know how in C, but I haven't found anything conclusive yet.
[16:27:11] dmitch: has joined #ruby
[16:27:24] Ox0dea: >> singleton_class.send(:define_method, :foo) { 42 }; Object.foo rescue $! # mr_r
[16:27:25] ruboto: Ox0dea # => #<NoMethodError: undefined method `foo' for Object:Class> (https://eval.in/455603)
[16:27:58] Ox0dea: That really ought to settle the matter.
[16:28:00] araujo: has joined #ruby
[16:28:46] p0wn3d: has joined #ruby
[16:29:18] maasha: has joined #ruby
[16:29:42] maasha: Do anyone know if there is a Ruby gem for parsing text files and generate C++ code ala flex/bison?
[16:30:13] Ox0dea: maasha: SWIG goes the other way. :<
[16:30:35] maasha: I need a C++ code generator - and for some stupid reason such are written in C or C++
[16:30:51] maasha: when makes it difficult and error prone at all levels.
[16:30:56] mr_r: Ox0dea: You're defining a singleton method for main there not for Object. Obviously Object is not going to respond to foo.
[16:31:11] Ox0dea: mr_r: But where did I specify `main`?
[16:31:28] mr_r: Ox0dea: singleton_class is the singleton class for main.
[16:31:35] Alayde: has joined #ruby
[16:31:50] Ox0dea: mr_r: #singleton_class is a method that gives you the receiver's singleton class.
[16:32:09] mr_r: Ox0dea: Yes. And the receiver in this case is self. Aka, main.
[16:32:19] gustav__: has joined #ruby
[16:32:25] Ox0dea: Thus, we are inside `main`, and not Object, at program start.
[16:33:14] Ox0dea: mr_r: If we were in Object at program start, it would've responded to `foo` just fine back there.
[16:33:27] mr_r: There are two different implicit contexts. We are inside `main` in the sense that all implicit method invocations are executed on main. But all method definitions are defined inside Object, as private instance methods.
[16:33:50] bonhoeffer: has joined #ruby
[16:33:59] pdoherty: has joined #ruby
[16:34:06] Ox0dea: mr_r: It is only my intent to disabuse you of the misconception that there is an implicit `class Object; ...; end` wrapped around your program.
[16:34:30] EminenceHC: has joined #ruby
[16:34:39] mr_r: If it wasn't then how are methods being defined in the Object class?
[16:34:52] Ox0dea: That's an implementation detail.
[16:35:27] Ox0dea: It could just as well have been `main` at the top of the resolution trees, but that would be kind of silly.
[16:35:29] XV: has left #ruby: ("ERC (IRC client for Emacs 24.5.1)")
[16:35:47] mr_r: Ox0dea: And how would you explain constant lookups then? Is there a special case in the context of the top level?
[16:36:33] Ox0dea: mr_r: I'm not sure how you mean.
[16:36:41] synthroid: has joined #ruby
[16:36:42] acke: has joined #ruby
[16:37:10] mr_r: Ox0dea: Constants get looked up in the lexically enclosing scope first, then ancestors.
[16:37:16] RobertBirnie: has joined #ruby
[16:37:31] Ox0dea: Without explicit use of the scope resolution operator, yes.
[16:37:46] Soda: has joined #ruby
[16:38:05] Ox0dea: I trust you know that everything on which you can call a method or look up a constant descends from Object?
[16:38:11] jhass: Ox0dea: mr_r we're neither inside main nor inside Object. class changes self and the definee to the same thing. At the toplevel self is main, the definee is Object, thus the toplevel is not equivalent to class Object; ...; end; nor class << main; ...; end
[16:38:13] mr_r: Ox0dea: Yes, and we don't use the scope resolution operator at the top level. So the lexically enclosing scope must be Object since all top level constants are defined there.
[16:38:50] Ox0dea: jhass: "Definee" is new for me.
[16:39:08] jhass: Ox0dea: it's where def places methods
[16:39:14] mr_r: Ox0dea: The default definee is where instance methods get defined.
[16:39:35] mr_r: Ox0dea: http://yugui.jp/articles/846
[16:40:53] Pupp3tm4st3r: has joined #ruby
[16:41:26] atomical: has joined #ruby
[16:42:02] idefine: has joined #ruby
[16:46:09] ngscheurich: has joined #ruby
[16:46:56] karapetyan: has joined #ruby
[16:47:10] mr_r: jhass: Why doesn't Object appear here? https://eval.in/455610
[16:47:52] A124: has joined #ruby
[16:47:55] psye: has joined #ruby
[16:47:56] jhass: because you're not actually inside anything
[16:48:12] jhass: I tried to point out that all analogies regarding you're inside something fail
[16:48:44] DEA7TH: has joined #ruby
[16:48:53] jhass: toplevel is not equivalent to anything like class ???; ...; end; or module ???; ...; end, or even ???_eval { ... }
[16:48:55] hadees: has joined #ruby
[16:48:58] mr_r: jhass: So ruby does not follow its regular constant lookup algorithm when at the top level. It just looks in Object, right? (As a special case)
[16:49:29] Kamilion: has joined #ruby
[16:49:29] jhass: Object is always the last item
[16:49:33] jhass: implicitly
[16:49:44] jhass: nesting is empty? -> Object
[16:50:02] zotherstupidguy: has joined #ruby
[16:50:47] jhass: (Module.nesting + [Object]).find {|namespace| namespace.const_get(constant) } basically
[16:52:21] arthurix: has joined #ruby
[16:52:29] araujo: has joined #ruby
[16:52:39] mr_r: jhass: What about inside a module itself, say M? Module.nesting inside a module is the module itself and a module does not have any superclasses, cause it isnt a class. It just looks in Object?
[16:52:48] OS-18137: has joined #ruby
[16:53:19] jhass: .nesting is orthogonal to inheritance
[16:53:26] jhass: another thing you shouldn't mix up
[16:53:34] mikecmpbll: has joined #ruby
[16:53:46] jhass: and no, the above applies, it first looks into M and then in Object
[16:53:49] freerobby: has joined #ruby
[16:53:51] steffkes: has joined #ruby
[16:54:30] Pupeno: has joined #ruby
[16:54:47] jhass: >> FOO = 1; BAR = 1; module M; FOO = 2; end; [module M; FOO; end, module M; BAR; end]
[16:54:48] ruboto: jhass # => [2, 1] (https://eval.in/455611)
[16:55:31] EminenceHC: has joined #ruby
[16:55:49] mr_r: jhass: Right. So first in the module itself, then any included modules, then Object.
[16:55:54] nemo__: has joined #ruby
[16:56:05] blackmesa: has joined #ruby
[16:56:16] jhass: mr_r: it goes to all of .nesting first
[16:56:39] mr_r: jhass: Yeah of course.
[16:56:59] jhass: so if we refine the above
[16:57:02] Maletor: has joined #ruby
[16:57:09] jhass: (ancestors + Module.nesting + [Object]).find {|namespace| namespace.const_get(constant) } basically
[16:58:02] mr_r: jhass: Shouldn't it be (Module.nesting + ancestors + [Object]) ?
[16:58:27] jhass: I'm not sure, let's find out
[16:59:03] workmad3: ancestors then nesting ;)
[16:59:04] jhass: >> class A; FOO = 1; end; module B; FOO = 2; class C < A; FOO; end; end;
[16:59:05] ruboto: jhass # => 2 (https://eval.in/455612)
[16:59:18] TomyWork: I'm looking for a ruby library that can be used to traverse a git repository as a graph
[16:59:20] workmad3: hmm, weird...
[16:59:25] jhass: no, apparently nesting wins indeed
[16:59:39] jhass: TomyWork: looked into rugged yet?
[16:59:54] mr_r: jhass: Yeah.
[17:00:17] TomyWork: looks promising
[17:00:43] workmad3: >> class A; FOO = 1; end; module B; FOO = 2; class C < A; FOO; end; end; B::C::Foo
[17:00:44] ruboto: workmad3 # => uninitialized constant B::C::Foo (NameError) ...check link for more (https://eval.in/455613)
[17:00:47] workmad3: >> class A; FOO = 1; end; module B; FOO = 2; class C < A; FOO; end; end; B::C::FOO
[17:00:48] ruboto: workmad3 # => 1 (https://eval.in/455614)
[17:00:55] bryanray: has joined #ruby
[17:00:58] workmad3: jhass: ^ that's what I checked :/
[17:01:16] jhass: workmad3: well, nesting is empty/not considered there
[17:01:18] bojanuana: has joined #ruby
[17:01:21] workmad3: jhass: ah, true
[17:01:59] TomyWork: jhass what i need is to list the heads and find the parent for a commit
[17:02:38] jhass: I think rugged should be capable of that
[17:03:19] mr_r: I'm off. Later.
[17:03:21] mr_r: has left #ruby: ()
[17:03:35] ceej: Ox0dea: sorry my internet net connection died :/
[17:03:40] jessemcgilallen: has joined #ruby
[17:03:55] Ox0dea: ceej: Unfortunate; did you see my hint about how to create an autovivifying Hash?
[17:04:54] ceej: I did, so I'd just use that so I don't need ||= {}
[17:05:18] Ox0dea: ceej: Oh, the benefits are much more than that.
[17:05:29] firstdayonthejob: has joined #ruby
[17:05:53] Ox0dea: Do you know how to #reduce?
[17:06:21] jxl180: has joined #ruby
[17:06:23] ceej: I haven't used #reduce/inject that much no...
[17:06:45] Ox0dea: Ah, well, autovivification plus reduce(:[]) makes for a very neat solution here.
[17:07:21] pipework: Mmm, reduce
[17:09:29] Ox0dea: ceej: Well, don't peek if you don't want to be spoiled. :P https://eval.in/455622
[17:09:36] VeryBewitching: has joined #ruby
[17:10:08] Ox0dea: I wish there were a way to not have to explicitly assign to the final key, but assignment isn't a method, and that's really to the good.
[17:11:24] ceej: Ox0dea: wow, that is a lot better using those methods....
[17:11:31] Ox0dea: Yay, Ruby!
[17:11:46] lkba: has joined #ruby
[17:12:10] ceej: thank you, I'm going to use these methods a lot more now :)
[17:12:49] yardenbar: has joined #ruby
[17:13:13] arthurix_: has joined #ruby
[17:13:40] weemsledeux: has joined #ruby
[17:13:58] ceej: Ox0dea: what would you recommend as some good online reading to better learn to use these methods day to day?
[17:14:11] shevy: I just found rand($.) in old code
[17:14:21] Ox0dea: shevy: That's dastardly.
[17:14:45] JDiPierro: has joined #ruby
[17:15:22] Ox0dea: ceej: The only two "fancy" methods there are Hash#default_proc (which is scarcely so useful as it was here), and #reduce, which is covered in just about every corner of the Web. :P
[17:15:35] CooloutAC: has left #ruby: ("Selakem Shalom, PEACE")
[17:15:51] TomyWork: jhass looks like it does. thanks for the suggestion
[17:16:10] Ox0dea: Really, try not to see it as "magic"; it's all simple building blocks combined to form convenient abstractions.
[17:16:18] pipework: Ox0dea: What are you talking about, willis? I love using default_proc
[17:16:36] Ox0dea: pipework: Self-referentially, though?
[17:17:01] hakunin: has joined #ruby
[17:17:12] vigintas: has joined #ruby
[17:17:18] benjito: has joined #ruby
[17:17:23] TomyWork: i'm making a project and the only pre-requirement i want is rvm. How do I go about doing that, preferably without telling the user to run a mile of shellcode?
[17:17:42] TomyWork: prerequisite*
[17:17:53] agent_white: has joined #ruby
[17:17:57] shevy: Ox0dea I also just had a funny other error... when you set an environment variable called CSRC, pointing to a directory, compiling exiv2 from source will fail
[17:18:13] TomyWork: a project with gems and such and they should be fetched when the project is first run
[17:19:01] shevy: TomyWork have you not just described what bundler is doing?
[17:19:22] TomyWork: bundler manages ruby versions too?
[17:19:49] shevy: you can probably specify some mandatory ruby version
[17:19:58] shevy: I am sure you don't want to control the ruby version that your user has
[17:20:00] kidoz: has joined #ruby
[17:20:11] shevy: "We will now install ruby 1.8.7"
[17:21:03] jxl180: well, does having a .ruby-version file with rvm force a user to have that specific version of ruby, or just a comparable version?
[17:21:10] rbennacer: has joined #ruby
[17:21:14] pipework: TomyWork: Look into packaging your app up with traveling ruby.
[17:21:16] ceej: Ox0dea: I see how to use #default_proc here http://ruby-doc.org/core-1.9.3/Hash.html#method-i-default_proc-3D, in your pastie though I can't figure out how it's being set... is it just automatically set and recursively calls the Hash.new you defined on ret?
[17:21:23] nemo_: has joined #ruby
[17:21:25] pipework: Unless you really want them to have to install a development toolchain.
[17:22:33] dionysus69: has joined #ruby
[17:23:07] Ox0dea: ceej: That's right; ret's default_proc specifies that non-existent keys should map to a Hash with ret's default_proc which specifies that...
[17:23:25] steffkes: i'm curious, did a bit of research but i'm still not entirely satisfied with the answers - what you guys & girls use for a json api which is going to be written in ruby? having worked mainly with php in the past, i'm seeing different frameworks like sanatra that look rather small but already things like templating and stuff. on the other hand grape, which seems to be more a one-man show over the years ;)
[17:23:46] ceej: Ox0dea: ah, I see that now looking at this example http://apidock.com/ruby/Hash/default_proc
[17:24:21] iamvery: has joined #ruby
[17:24:23] TomyWork: shevy well ideally i would like to make sure they're using the ruby version i developed against
[17:26:38] shevy: yeah, that is why you'd have to specify a version. In normal gems, via .gemspec, this is done via an entry such as: s.required_ruby_version = '>= 2.2.3', I am sure bundler has similar ways, see what jxl180 wrote
[17:26:43] TomyWork: oh well... rvm 2.2 do bundle exec ./myscript.rb isnt so bad after all
[17:27:30] Xiti: has joined #ruby
[17:29:02] mistermocha: has joined #ruby
[17:31:31] DoubleMalt: has joined #ruby
[17:32:47] based_pdev_: has joined #ruby
[17:33:14] ekleog: has joined #ruby
[17:33:54] EminenceHC: has joined #ruby
[17:33:58] Caseh: has joined #ruby
[17:34:31] Caseh: Please, I'm looking for a channel for Ruby on Rails
[17:34:55] pipework: Caseh: We have those! #ruby, and #rubyonrails
[17:35:11] pipework: For the latter, you may need to read the topic and follow instructions to be heard.
[17:35:39] ddv: has joined #ruby
[17:35:48] InternetFriend: has joined #ruby
[17:39:50] Ox0dea: Damn. I meant to give this to XV who asked about doing Assembly in Ruby: https://eval.in/455629
[17:39:55] bricker: has joined #ruby
[17:40:03] `tim`: has joined #ruby
[17:40:07] dfinninger: has joined #ruby
[17:40:16] Ox0dea: I've gotta skedaddle; somebody kindly hand it off to them if they return.
[17:40:18] segfalt: has joined #ruby
[17:40:23] steffkes: hm, i guess my question was a bit too generic and we need more specific ones that can be answered with y/n? ;>
[17:42:31] jhass: steffkes: well, JSON API is kind of generic, those can get quite complex or stay really simple
[17:42:35] pocketprotector-: has joined #ruby
[17:43:19] symbol: has joined #ruby
[17:44:06] Ox0dea: steffkes: In any case, this question almost always boils down to choosing the HTTP library which most tickles your fancy.
[17:44:35] shevy: tickling his fancy!
[17:44:48] jxl180: has joined #ruby
[17:46:22] Ox0dea: Got shellacked whizbangs, you say?
[17:46:40] kies^: has joined #ruby
[17:49:12] steffkes: jhass: i'd like to keep it simple for now ;) getting to know the screwdriver first - if it gets more fancy, and i know what part of the library/framework i quite like or don't like .. it's easier to decide where to go next
[17:49:41] jhass: well, it was meant as a "tell us what you actually want to do"
[17:49:46] rwilcox: has joined #ruby
[17:50:27] jhass: and then we can tell what tool we would choose for that job
[17:50:39] The_Phoenix: has joined #ruby
[17:50:41] blackjid: has joined #ruby
[17:51:01] TomyWork: gem_make.out
[17:51:13] TomyWork: nice file name
[17:51:32] jhass: shevy: I can +b shevy!*@*$#php if you wish
[17:51:45] steffkes: jhass: sure :) one endpoint that expects a given json structure (version information) and a few endpoints (max five) to retrieve that information again. we're talking about systems that report their versions and a UI that will retrieve it afterwards. for now, nothing fancy for authorization & stuff - JWT might be used later on.
[17:51:55] shevy: TomyWork fun fact, I am having strainge appearances of gmon.out files
[17:51:57] pipework: Insert joke about banning everyone from that channel being in everyone's best interests.
[17:52:15] tigarcia: has joined #ruby
[17:52:29] steffkes: nothing fancy as in "probably a static api key" maybe even just one, not one per account or something like that.
[17:52:40] jhass: steffkes: okay, lightweight sounds good for that, sinatra is the most popular on the pretty lightweight side (good learning resources), sequel should get you along for the DB interface
[17:52:59] devoldmx: has joined #ruby
[17:53:06] steffkes: just want to play around with it. i'd know what i'd do in a language like php - but before i use something random in ruby, i though i'd come here first to ask for advice (:
[17:53:31] willardg: has joined #ruby
[17:53:49] dmitch: has joined #ruby
[17:53:50] shevy: yeah... things ought to be simple
[17:53:54] pipework: steffkes: Depending on how many endpoints and the complexity, you might just use rack.
[17:54:04] eikood: has joined #ruby
[17:54:09] steffkes: jhass: kk, was wondering because sinatra already brings all the template stuff with it
[17:54:09] pipework: But sinatra is a nice DSL though.
[17:54:13] devoldmx_: has joined #ruby
[17:54:26] Pupp3tm4st3r: has joined #ruby
[17:54:36] jhass: steffkes: that should impose any overhead if you don't call into it
[17:54:41] jhass: *should not, sigh
[17:55:09] pipework: Negligible overhead at load time, but probably nothing even noticeable after.
[17:55:44] EminenceHC: has joined #ruby
[17:56:12] steffkes: if one is already concerned with runtime-overhead for a (just said) "simple thing" .. not sure :D i thought that it might influence the way it's used. so that you have to _disable_ it if you don't want to have it, something like that :)
[17:56:18] steffkes: just not using it .. sound's good to me
[17:56:41] jhass: sinatra works by returning a string from your handler basically
[17:56:57] jhass: the templatiing integration simply provides helpers to return a rendered template there
[17:57:17] codecop: has joined #ruby
[17:57:53] steffkes: got it. will give it a try. has been a few hours since my last ruby project
[17:58:15] steffkes: ty jhass, pipework
[17:58:38] pipework: steffkes: A few hours? That's like years in software time, which is like decades in real time.
[17:58:49] pipework: Godspeed, steffkes.
[17:59:03] baweaver: has joined #ruby
[17:59:05] steffkes: that should have been years, obviously :D
[17:59:14] jhass: mh, software time, real time, what kind of time is the hours then?
[17:59:14] TomyWork: is there anything that automatically pulls in dependencies like cmake or libs via apt-get and such??
[17:59:31] steffkes: a few hours ago was clojure-time .. still a bit puzzled by that
[17:59:31] TomyWork: gem dependencies*
[18:00:36] solars: has joined #ruby
[18:01:26] shevy: TomyWork not really, normally; gem is primarily a dependency-manager for gems written in ruby, or for gem-addons (e. g. written in C, and then you can compile the ruby bindings to that C code)
[18:01:50] steffkes: doh, someone just mentioned grape - any thoughts on that? propably even compared to sinatra?
[18:02:05] shevy: it's usually the responsibility of the user to get the required components, such as nokogiri requires some .h files which are often in the devel-package on a linux distribution
[18:02:38] steffkes: well, i just give it a try in one of them :)
[18:03:22] leafybas_: has joined #ruby
[18:04:21] tigarcia: has joined #ruby
[18:04:22] yeticry: has joined #ruby
[18:04:39] bryanray: has joined #ruby
[18:04:44] barhum2013: has joined #ruby
[18:04:58] barhum2013: has left #ruby: ()
[18:05:29] tigarcia: has joined #ruby
[18:06:14] nemo__: has joined #ruby
[18:08:46] ramfjord: has joined #ruby
[18:09:26] benjito_: has joined #ruby
[18:14:32] polishdub_: has joined #ruby
[18:15:34] choke: has joined #ruby
[18:15:51] arup_r: has joined #ruby
[18:17:17] SenpaiSilver: has joined #ruby
[18:19:08] baweaver: has joined #ruby
[18:21:03] JJM: has joined #ruby
[18:22:13] Synthead: has joined #ruby
[18:23:20] Fredrich010: has joined #ruby
[18:24:32] howdoicomputer: has joined #ruby
[18:25:01] ryotarai: has joined #ruby
[18:25:52] cpruitt: has joined #ruby
[18:27:21] choke: has joined #ruby
[18:28:11] loc22: has joined #ruby
[18:29:44] barhum2013: has joined #ruby
[18:30:31] Ainieco: has joined #ruby
[18:30:48] havenwood: Ainieco: hi
[18:30:54] EminenceHC: has joined #ruby
[18:31:26] VeryBewitching: has joined #ruby
[18:31:45] Ainieco: what the point of Mutex#try_lock if it doesn't locks if it's possible? i'd like to lock only if it's possible immediatley otherwise don't lock at all
[18:32:12] kadoppe: has joined #ruby
[18:32:35] krz: has joined #ruby
[18:33:12] The_Phoenix: has joined #ruby
[18:33:20] jhass: >> m = Mutex.new; m.try_lock; m.locked?
[18:33:21] ruboto: jhass # => true (https://eval.in/455639)
[18:33:58] Ainieco: jhass: oh, it actually locks, great
[18:34:03] agent_white: has joined #ruby
[18:34:43] baweaver: has joined #ruby
[18:34:46] cyle: has joined #ruby
[18:37:36] dfinninger: has joined #ruby
[18:39:33] Pupeno: has joined #ruby
[18:40:02] OS-18137: has joined #ruby
[18:40:09] Galas: has joined #ruby
[18:41:01] choke: has joined #ruby
[18:41:20] jenrzzz: has joined #ruby
[18:42:23] aryaching: has joined #ruby
[18:42:50] dopie: has joined #ruby
[18:43:55] symbol: has joined #ruby
[18:44:02] romero: has joined #ruby
[18:46:31] SCHAAP137: has joined #ruby
[18:46:32] SCHAAP137: has joined #ruby
[18:49:48] idefine: has joined #ruby
[18:49:55] polishdub: has joined #ruby
[18:50:18] idefine_: has joined #ruby
[18:50:28] chopin: has joined #ruby
[18:52:32] ericjphillips: has joined #ruby
[18:52:43] `based_pdev`: has joined #ruby
[18:52:49] arthurix: has joined #ruby
[18:53:36] rails090: has joined #ruby
[18:53:42] devoldmx: has joined #ruby
[18:55:13] weaksauce: has joined #ruby
[18:55:22] brendan-: has joined #ruby
[18:56:28] macowie: has joined #ruby
[18:57:57] bonhoeffer: has joined #ruby
[19:01:48] diegoviola: has joined #ruby
[19:01:48] matp: has joined #ruby
[19:02:37] macowie: has joined #ruby
[19:03:04] diego3: has joined #ruby
[19:03:24] yeticry: has joined #ruby
[19:04:39] segfalt: has joined #ruby
[19:05:40] jackjackdripper: has joined #ruby
[19:05:58] skcin7: has joined #ruby
[19:05:59] shevy: surrender
[19:07:19] SCHAAP137: has joined #ruby
[19:07:20] SCHAAP137: has joined #ruby
[19:08:01] yfeldblum: has joined #ruby
[19:08:13] al2o3-cr: has joined #ruby
[19:08:17] dikaio: has joined #ruby
[19:08:17] TomyWork: jhass is rugged supposed to segfault if i do something wrong?
[19:08:31] TomyWork: or might it be incompatible with the bleeding edge git version i have? :)
[19:08:35] dfinninger: has joined #ruby
[19:08:35] EminenceHC: has joined #ruby
[19:08:38] jhass: I don't think so
[19:08:51] jhass: I generally consider any segfault instead of error message a bug
[19:09:12] jhass: I'm on 2.6.1 and didn't notice any issues
[19:09:18] jhass: it's using libgit2 anyhow
[19:09:24] loc22: has joined #ruby
[19:09:31] jhass: so maybe open an issue
[19:09:32] mg^^: Yeah, segfaults are (almost) never intended behavior.
[19:09:38] atmosx: has joined #ruby
[19:09:46] TomyWork: do_segfault()
[19:09:54] TomyWork: repo = Rugged::Repository.new('testrepo/.git') <-- it's segfaulting here
[19:12:40] tubuliferous_: has joined #ruby
[19:12:41] TomyWork: https://gist.github.com/TomyLobo/75cf092b1ea998bc62c0
[19:14:49] based_pdev_: has joined #ruby
[19:16:03] scpike: has joined #ruby
[19:16:04] shevy: libruby-1.9.1.so.1.9
[19:16:43] willardg: has joined #ruby
[19:17:08] Cyther: has joined #ruby
[19:19:42] arup_r: shevy: new syntax is coming ... :) https://bugs.ruby-lang.org/issues/11537?utm_source=rubyweekly&utm_medium=email
[19:19:43] TomyWork: how did that get in there
[19:20:19] TomyWork: i'll try #!/usr/bin/env ruby
[19:20:54] TomyWork: thanks shevy, that was the problem
[19:21:22] dnomyar: has joined #ruby
[19:21:49] macowie: has joined #ruby
[19:22:15] d5sx43: has joined #ruby
[19:23:19] nfk|laptop: has joined #ruby
[19:24:59] marr: has joined #ruby
[19:28:51] janelleb: has joined #ruby
[19:29:10] dmitch: has joined #ruby
[19:30:51] dnomyar: has joined #ruby
[19:31:34] InternetFriend: has joined #ruby
[19:32:03] dnomyar: has joined #ruby
[19:32:49] imperator: arup_r, that is fugly
[19:33:17] niemcu: has joined #ruby
[19:33:20] Fredrich010: has joined #ruby
[19:33:23] shevy: arup_r yeah Ox0dea already disapproved of it :D
[19:34:27] opensource_ninja: has joined #ruby
[19:36:47] dnomyar: has left #ruby: ()
[19:37:11] acke: has joined #ruby
[19:37:26] TomyWork: can i pass a non-member function to array.each?
[19:37:47] TomyWork: def traverse ..... refs.each &:traverse doesn't seem to work
[19:38:37] diego2: has joined #ruby
[19:39:07] stannard_: has joined #ruby
[19:39:36] diego2: has joined #ruby
[19:39:40] TomyWork: shevy with the general notion or the specific syntax?
[19:39:41] ja: TomyWork: Yes
[19:39:47] ja: refs.each &method(:traverse)
[19:39:52] leafybasil: has joined #ruby
[19:40:08] Fredrich010: has joined #ruby
[19:40:35] shevy: TomyWork I think he disliked the syntax
[19:40:41] postmodern: has joined #ruby
[19:41:11] lifeonmars: has joined #ruby
[19:41:11] shevy: the good thing about ruby is that I don't have to use crappy syntax
[19:41:36] TomyWork: ja thanks, but for some reason that makes the local function unable to access its enclosing scope
[19:42:02] TomyWork: shevy what's a better syntax?
[19:42:19] shevy: the currently existing one for instance!
[19:42:29] TomyWork: what's that?
[19:42:42] MrJoshua: has joined #ruby
[19:42:42] jgt1: has joined #ruby
[19:42:45] TomyWork: u && u.profile && u.profile.thumbnails && u.profiles.thumbnails.large?
[19:42:58] shevy: now I don't write code like this myself
[19:43:06] shevy: but it's better than
[19:43:07] adaedra: that's not really neat
[19:43:08] shevy: if u.try!(:profile).try!(:thumbnails).try!(:large)
[19:43:35] shevy: why does he propose the ! there?
[19:43:38] TomyWork: shevy i thought this safe navigation operator did away with that
[19:43:48] TomyWork: u.?profile.?thumbnails.?large
[19:43:56] shevy: that's even worse!
[19:44:19] `tim`: has joined #ruby
[19:44:24] dnomyar: has joined #ruby
[19:44:36] stamina: has joined #ruby
[19:44:50] TomyWork: shevy so you disagree with the general notion of having a safe navigation operator and not just the specific syntax?
[19:44:55] dnomyar: has left #ruby: ()
[19:45:30] jhass: shevyOS doesn't need safe navigation
[19:45:32] shevy: I disagree with ?method
[19:45:39] dnomyar: has joined #ruby
[19:45:44] TomyWork: it's not really ?method
[19:45:59] shevy: the . is part of the method name?
[19:46:08] adaedra: no, it's part of the syntax
[19:46:13] adaedra: it's .? in place of .
[19:46:28] shevy: that is absolutely terrible
[19:46:34] ibouvousaime: What are the best ressouces that have helped you guys personnally with ruby and ruby on rails? (Im doing my own reseach too, im just new to it thats why im asking )
[19:46:51] adaedra: shevy: why?
[19:46:54] TomyWork: a.?b is roughly the same as a && a.b
[19:47:04] shevy: adaedra because we generally use . for methods
[19:47:15] shevy: what and?
[19:47:31] adaedra: I don't see the problem, so I thought there was a follow up
[19:47:37] TomyWork: shevy so .? is "check if left hand side isnt nil/false and then whatever . does"
[19:47:37] shevy: that is the problem
[19:47:54] adaedra: it's a specialized case of method call
[19:48:07] dfockler: has joined #ruby
[19:48:18] asad_: has joined #ruby
[19:48:34] asad_: Hi. I want to install the latest version of ruby on ubuntu. How do I go about doing that?
[19:48:40] jhass: TomyWork: only nil
[19:48:46] TomyWork: asad_ http://rvm.io
[19:48:56] TomyWork: jhass only nil? even better
[19:48:58] jhass: asad_: for dev or for production?
[19:49:05] asad_: TomyWork: There's also rbenv. What should I use?
[19:49:11] symbol: has joined #ruby
[19:49:14] TomyWork: i dont know rbenv
[19:49:15] asad_: jhass: For dev.
[19:49:15] dnomyar: has joined #ruby
[19:49:18] jhass: there's also chruby and none of that
[19:49:24] adaedra: asad_: there's also chruby and ruby-install
[19:49:26] macowie: has joined #ruby
[19:50:16] havenwood: asad_: +1 chruby
[19:50:18] al2o3-cr: has joined #ruby
[19:50:25] baweaver: has joined #ruby
[19:50:38] ja: shevy: it looks a bit weird, but is it really that bad, you think?
[19:50:54] ja: TomyWork: weird, hmm???
[19:51:12] bhegel: has joined #ruby
[19:51:13] EminenceHC: has joined #ruby
[19:51:25] TomyWork: ja odd, i cant access that top scope variable no matter what
[19:51:34] ankhers: If I have a lazy enum, does asking for its length evaluate it/
[19:51:40] Fredrich010: has joined #ruby
[19:51:44] ankhers: nevermind. Apparently you can't ask for the length.
[19:51:49] dnomyar: has left #ruby: ()
[19:52:28] cdg: has joined #ruby
[19:52:56] ja: TomyWork: can I see the full source in a gist?
[19:53:01] kraljev11: has joined #ruby
[19:53:02] adaedra: ja: shevy doesn't like change.
[19:53:04] asad_: Should I install the main system ruby that's in the ubuntu packages? The problem with that is that it's too old...
[19:53:10] pontiki: has joined #ruby
[19:53:40] dnomyar: has joined #ruby
[19:53:44] acke: has joined #ruby
[19:54:48] adaedra: asad_: how old?
[19:55:00] shinnya: has joined #ruby
[19:55:01] asad_: adaedra: 1.9.x
[19:55:02] jhass: asad_: for dev? nah
[19:55:10] ceej: in ruby >= 2.2 should I be using strings or symbols as keys in hashes?
[19:55:13] jhass: go with RVM, install it as user not as root
[19:55:25] adaedra: ceej: depends on your needs.
[19:55:38] adaedra: but I think general case is symbols.
[19:55:46] TomyWork: ja: a = ''; def b; a; end; b
[19:55:46] asad_: Alright I'll go with RVM then...
[19:55:50] jhass: unless you call #to_sym
[19:56:00] jhass: ceej: in doubt strings actually
[19:56:03] imperator: shevy, you might not have to use it, but you might have to maintain it if someone else wrote it ;)
[19:56:10] jhass: but if all your symbols are literals, symbols are fine
[19:56:13] havenwood: asad_: Are you very familiar with the command line?
[19:56:19] DoubleMalt: has joined #ruby
[19:56:20] ceej: adaedra: that's my issue, I've been seeing blog posts for both sides lol.... I'm dynamically creating a nested hash
[19:56:23] TomyWork: >> a = ''; def b; a; end; b
[19:56:24] ruboto: TomyWork # => undefined local variable or method `a' for main:Object (NameError) ...check link for more (https://eval.in/455659)
[19:56:36] jhass: ceej: so dynamic keys? use strings
[19:56:41] asad_: havenwood: Yup.
[19:56:44] havenwood: asad_: If you're comfortable with dotfiles and env vars etc I'd recommend ruby-install with chruby. If not so much RVM may be easier.
[19:57:01] havenwood: asad_: chruby is ~100 lines of shell and RVM is >10,000 lines of shell.
[19:57:19] atmosx: Kernel.abort("No configuration directory found! Please run 'argosnap -i config'\n") <-- this doesn't add a new line after abort
[19:57:40] atmosx: of course I can't put a 'puts ""' after abort, since it doesn't get executed, any ideas on how to add a new line there?
[19:58:03] havenwood: asad_: http://ryanbigg.com/2015/06/mac-os-x-ruby-ruby-install-chruby-and-you/
[19:58:09] `based_pdev`: has joined #ruby
[19:58:09] ceej: jhass: ret = Hash.new { |h, k| h[k] = Hash.new &h.default_proc } or ret = Hash.new { |h, k| h[:"#{key}"] = Hash.new &h.default_proc }
[19:58:10] havenwood: asad_: oops, wrong link
[19:58:11] jhass: atmosx: it does for me, even without the explicit \n
[19:58:19] TomyWork: atmosx add another \n
[19:58:22] havenwood: asad_: right link: http://ryanbigg.com/2014/10/ubuntu-ruby-ruby-install-chruby-and-you/
[19:58:43] jhass: ceej: definitely the former
[19:58:43] TomyWork: jhass i think he wants 2 \n
[19:58:55] devoldmx: has joined #ruby
[19:59:34] devoldmx_: has joined #ruby
[19:59:43] willardg: has joined #ruby
[19:59:46] davispuh: has joined #ruby
[19:59:47] ceej: jhass: so when building up a hash use strings still
[20:00:21] blackjid: has joined #ruby
[20:00:21] adaedra: ceej: it doesn't really care, as long as the keys are hashable.
[20:00:24] jhass: ceej: it's not wrong to use dynamic symbols with 2.2 but it'll still feel odd to most rubyists
[20:00:31] prestorium: has joined #ruby
[20:00:49] atmosx: jhass: it adds 1 I want ... yes
[20:00:59] atmosx: TomyWork: ty
[20:01:10] Fredrich010: has joined #ruby
[20:01:11] jhass: especially since most of the time if you have dynamic keys chances are good your keys are actually data
[20:01:16] sharkman: has joined #ruby
[20:01:27] mwlang: has joined #ruby
[20:01:29] ceej: so in ruby 2.2 doing this isn't bad ret = Hash.new { |h, k| h[:"#{key}"] = Hash.new &h.default_proc } but most rubyists will be used to it just being strings?
[20:01:30] jhass: and symbols shouldn't be used for data you'll process
[20:02:21] jhass: ceej: it's not a bug. Whether it makes sense depends on the larger context
[20:02:25] ankhers: How does Ruby's Enumerator::Lazy work? If I `map` over the data inside it, does it just evaluate the thunks and still hold onto that memory even if the enum or value inside the enum is not used later?
[20:02:32] jhass: ceej: most of the time it doesn't IME
[20:02:39] ankhers: Basically, does GC clean it up in a realtively decent time frame.
[20:02:50] psye: has joined #ruby
[20:02:54] GregUK: has joined #ruby
[20:03:00] TomyWork: ja did you get the code?
[20:03:03] ankhers: Or does it wait until the entire enum has been read before the GC can clean it up?
[20:03:16] acke: has joined #ruby
[20:03:50] ceej: jhass: I get it... thank you
[20:03:52] psye: has joined #ruby
[20:04:06] arthurix_: has joined #ruby
[20:04:36] Alayde: has joined #ruby
[20:05:23] dmitch: has joined #ruby
[20:06:10] dnomyar: has joined #ruby
[20:06:14] dnomyar: has left #ruby: ()
[20:06:46] TomyWork: from a function, can i access variables in enclosing scopes somehow?
[20:06:54] dopie: has joined #ruby
[20:07:05] dnomyar: has joined #ruby
[20:07:16] jhass: "function"?
[20:07:16] havenwood: TomyWork: Do you know about instance variables?
[20:07:25] TomyWork: jhass def at file scope
[20:07:31] havenwood: TomyWork: methods
[20:07:33] jhass: that's a method
[20:07:47] TomyWork: ok, i'll make a class then :)
[20:08:09] kirun: has joined #ruby
[20:08:14] jhass: well, could access instance vars defined at the toplevel too, but it would be odd
[20:08:40] havenwood: just clicked for me that's what was being asked
[20:09:40] tercenya: has joined #ruby
[20:09:51] diego1: has joined #ruby
[20:10:05] TomyWork: pythonisms are being asked :)
[20:10:11] trautwein: has joined #ruby
[20:10:58] nfk|laptop: has joined #ruby
[20:11:03] idefine: has joined #ruby
[20:11:07] Fredrich010: has joined #ruby
[20:11:29] dnomyar: has left #ruby: ()
[20:12:16] imperator: class instance variable?
[20:12:22] freerobby: has joined #ruby
[20:12:51] dnomyar: has joined #ruby
[20:12:54] TomyWork: i was looking for the equivalent of a lua upvalue
[20:13:11] TomyWork: since that isn't there, i'll go for proper OO instead :)
[20:15:59] dmitch: has joined #ruby
[20:16:18] trautwein: has joined #ruby
[20:18:06] bonhoeffer: has joined #ruby
[20:18:11] TomyWork: so now i've got a ruby script that prints all the reachable commits in a git repo
[20:18:11] devoldmx_: has joined #ruby
[20:18:11] spuk: has joined #ruby
[20:18:22] TomyWork: enough for today, i'm going home
[20:18:26] TomyWork: bye and thanks for the help
[20:18:40] _djbkd: has joined #ruby
[20:19:13] jessemcgilallen: has joined #ruby
[20:19:38] ramfjord_: has joined #ruby
[20:22:16] relix: has joined #ruby
[20:22:42] ngscheur1: has joined #ruby
[20:25:01] drocsid: has joined #ruby
[20:25:10] baweaver: has joined #ruby
[20:25:14] devoldmx: has joined #ruby
[20:25:32] Taha_The_Hacker: has joined #ruby
[20:25:52] tw1sted: has joined #ruby
[20:26:56] drocsid: anybody pretty familiar with using the rye module with sudo to upload files to a remote server?
[20:27:50] Coldblackice: has joined #ruby
[20:32:09] acke: has joined #ruby
[20:33:34] mustmodify: has joined #ruby
[20:33:43] gains: has joined #ruby
[20:35:01] mustmodify: I realize there are some rails-isms here, but at heart it's a Ruby question. I want to know if you folks think this is an effective place to use tap, or whether I should do it the alternate way proposed, or some third option, possibly involving an instance method? https://gist.github.com/mustmodify/0d379d54f525a0a6fdae
[20:35:40] mustmodify: has left #ruby: ()
[20:36:18] baweaver: It's a User concern
[20:36:40] baweaver: also, find_by
[20:37:08] baweaver: and why are you using a variable manager_id instead of a symbol?
[20:37:18] baweaver: anyways, definitely a Rails question
[20:37:26] baweaver: look into #RubyOnRails
[20:38:40] `based_pdev`: has joined #ruby
[20:38:41] wharr: has joined #ruby
[20:38:53] jackjackdripper: has joined #ruby
[20:39:05] arup_r: atmosx: Hi
[20:39:09] arup_r: you there ?
[20:40:50] leafybasil: has joined #ruby
[20:41:55] mary5030: has joined #ruby
[20:42:01] dnomyar: has joined #ruby
[20:42:24] yqt: has joined #ruby
[20:42:41] arthurix: has joined #ruby
[20:42:46] dnomyar: has left #ruby: ()
[20:42:57] al2o3-cr: has joined #ruby
[20:43:02] ReK2: has joined #ruby
[20:43:02] ReK2: has joined #ruby
[20:43:16] atomical_: has joined #ruby
[20:43:26] jgt1: has joined #ruby
[20:43:52] dnomyar: has joined #ruby
[20:44:11] dnomyar: has left #ruby: ()
[20:44:23] EdwardIII: has joined #ruby
[20:44:36] robbyoconnor: has joined #ruby
[20:48:40] bonhoeffer: has joined #ruby
[20:49:06] atmosx: arup_r: yes
[20:49:57] atmosx: hm, if I have hash = {name: 'john', age: 21} ... I can check hash[:name].empty? but how do I check if the hash[:age] entry is filled?
[20:50:01] atmosx: with true/false?
[20:50:45] adaedra: depends what you mean by 'filled'
[20:51:03] adaedra: if the key don't exist when not filled, just hash.key?(:age)
[20:51:30] adaedra: otherwise, you'll have to look at the value you have when 'not filled' (i.e. nil)
[20:52:03] mengu: has joined #ruby
[20:52:27] bonhoeffer: has joined #ruby
[20:52:37] adaedra: (Also, if your name key disappears or its value is nil when "not filled", your method will fail.)
[20:53:44] diegoviola: has joined #ruby
[20:53:59] FernandoBasso: has joined #ruby
[20:54:56] wldcordeiro: has joined #ruby
[20:56:00] `tim`: has joined #ruby
[20:56:42] benjito: has joined #ruby
[20:57:04] GregUK: has left #ruby: ()
[20:57:07] alcipir: has joined #ruby
[20:58:34] polishdub_: has joined #ruby
[20:58:49] diegoviola: has joined #ruby
[20:58:50] atmosx: adaedra: ty
[20:58:53] pietr0: has joined #ruby
[20:59:34] dmitch: has joined #ruby
[20:59:55] ItSANgo: has joined #ruby
[20:59:58] bkxd: has joined #ruby
[21:05:10] bl00d: has joined #ruby
[21:05:46] blackmesa: has joined #ruby
[21:09:23] zenguy_pc: has joined #ruby
[21:09:54] polishdub: has joined #ruby
[21:10:46] leafybasil: has joined #ruby
[21:12:08] KensoDev: has joined #ruby
[21:13:29] yfeldblum: has joined #ruby
[21:14:12] Fredrich010: has joined #ruby
[21:14:13] symbol: has joined #ruby
[21:14:20] Pupeno: has joined #ruby
[21:16:34] jessemcgilallen: has joined #ruby
[21:16:37] Tuxero: has joined #ruby
[21:18:31] tvw: has joined #ruby
[21:18:34] ajb: has joined #ruby
[21:20:09] ajb: has joined #ruby
[21:22:12] choke: has joined #ruby
[21:22:14] steffkes: has joined #ruby
[21:22:15] steffkes: has joined #ruby
[21:22:57] kies^: has joined #ruby
[21:23:03] acke_: has joined #ruby
[21:23:08] aryaching: has joined #ruby
[21:24:14] Fredrich010: has joined #ruby
[21:24:23] Maletor: has joined #ruby
[21:25:33] opensource_ninja: has joined #ruby
[21:25:42] Pupeno: has joined #ruby
[21:27:12] bruno-: has joined #ruby
[21:31:09] zenguy_pc: has joined #ruby
[21:31:43] d5sx43: has joined #ruby
[21:33:39] baweaver: has joined #ruby
[21:33:50] SHyx0rmZ: has joined #ruby
[21:34:17] htmldrum: has joined #ruby
[21:35:57] chipotle: has joined #ruby
[21:38:20] jobewan: has joined #ruby
[21:40:05] karapetyan: has joined #ruby
[21:40:41] sepp2k: has joined #ruby
[21:41:16] pontiki: has joined #ruby
[21:42:59] jenrzzz: has joined #ruby
[21:44:05] EminenceHC: has joined #ruby
[21:44:06] jgt1: has joined #ruby
[21:44:18] Pupeno: has joined #ruby
[21:44:18] Pupeno: has joined #ruby
[21:44:19] dfinninger: has joined #ruby
[21:44:40] mary5030: has joined #ruby
[21:46:42] diegoviola: has joined #ruby
[21:46:46] mary5030: has joined #ruby
[21:47:01] aryaching: has joined #ruby
[21:47:23] mary5030_: has joined #ruby
[21:48:53] mois3x: has joined #ruby
[21:49:23] mary5030_: has joined #ruby
[21:54:16] diegoaguilar: has joined #ruby
[21:54:39] jgt1: has joined #ruby
[21:55:01] simi: has joined #ruby
[21:55:35] s00pcan: has joined #ruby
[21:56:17] MrJoshua_: has joined #ruby
[21:58:04] Fredrich010: has joined #ruby
[21:58:25] benjito_: has joined #ruby
[21:58:47] _djbkd: has joined #ruby
[21:59:04] zenguy_pc: has joined #ruby
[21:59:46] bhegel: has joined #ruby
[21:59:51] rodfersou: has joined #ruby
[21:59:57] tigarcia: has joined #ruby
[22:01:08] tubuliferous_: has joined #ruby
[22:01:23] dikaio: has joined #ruby
[22:01:24] andykingking: has joined #ruby
[22:02:22] yfeldblum: has joined #ruby
[22:02:33] jgpawletko: has joined #ruby
[22:06:45] cooperlebrun: has joined #ruby
[22:07:42] bhegel: has joined #ruby
[22:07:53] willardg: has joined #ruby
[22:08:27] tigarcia: has joined #ruby
[22:09:44] baweaver: has joined #ruby
[22:11:57] dfockler: has joined #ruby
[22:13:03] ebbflowgo: has joined #ruby
[22:13:07] cooperlebrun: why doesn't this work? http://pastebin.com/PNbKNJrj
[22:13:08] ruboto: cooperlebrun, we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/2b463239b440d03ff253
[22:13:08] ruboto: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[22:13:47] cooperlebrun: rubuto aside, trying to take a hash and get an array of keys that had nil values
[22:13:54] robbyoconnor: has joined #ruby
[22:14:34] cooperlebrun: also, whats a good pastebin alternative that isn't gist? I find gist a bit cumbersome when I don't necessarily want to link to my github
[22:14:59] _djbkd: has joined #ruby
[22:15:03] weaksauce: i just use gist in a private window
[22:15:09] havenwood: cooperlebrun: You can do an anonymous gist.
[22:15:12] weaksauce: makes it anon
[22:15:31] ibouvousaime: has joined #ruby
[22:15:31] _djbkd: has joined #ruby
[22:16:06] mois3x: has joined #ruby
[22:16:18] devoldmx_: has joined #ruby
[22:16:36] weaksauce: cooperlebrun inject puts the result of the last thing in the block inside acc
[22:16:37] havenwood: cooperlebrun: select { |_, v| v.nil? }.keys
[22:16:45] riotjones: has joined #ruby
[22:17:02] Zarthus: gem install gist; cat output.txt | gist -a # :P
[22:17:02] ebbflowgo: has joined #ruby
[22:17:03] bricker: cooperlebrun: first of all, that's an unnecessary use of inject. Second of all, it's not working because you're using inject incorrectly.
[22:17:22] willardg: has joined #ruby
[22:17:52] drbrain: >> f = {foo: nil, fiz: 0, bar: ''}; f.keys.reject { |k| f[k] }
[22:17:53] ruboto: drbrain # => [:foo] (https://eval.in/455699)
[22:17:55] symbol: has joined #ruby
[22:18:17] drbrain: fixed inject:
[22:18:27] robbyoconnor: has joined #ruby
[22:18:33] robbyoconnor: has joined #ruby
[22:18:39] havenwood: >> {foo: nil, fiz: 0, bar: ''}.select { |_, v| v.nil? }.keys
[22:18:40] ruboto: havenwood # => [:foo] (https://eval.in/455700)
[22:18:43] drbrain: >> f = {foo: nil, fiz: 0, bar: ''}; f .inject([]) { |acc, (k, v)| acc << k if v.nil?; acc }
[22:18:44] ruboto: drbrain # => [:foo] (https://eval.in/455701)
[22:19:12] drbrain: each_key.reject is probably best since you don't loop twice
[22:19:20] cooperlebrun: hmm, drbrain I thought .inject auto returned whatever the val of acc was?
[22:19:28] devoldmx: has joined #ruby
[22:19:35] drbrain: cooperlebrun: no, whatever is last (like weaksauce said)
[22:20:03] havenwood: and #each_with_object too:
[22:20:04] havenwood: >> {foo: nil, fiz: 0, bar: ''}.each_with_object([]) { |(k, v), a| a << k if v.nil? }
[22:20:05] ruboto: havenwood # => [:foo] (https://eval.in/455702)
[22:20:08] cooperlebrun: Zarthus: thanks, not only anon, but an easy command line tool. :thumbsup:
[22:22:25] s00pcan: has joined #ruby
[22:25:14] cooperlebrun: now to decide which one of these to use :P
[22:26:06] WillAmes: has joined #ruby
[22:26:15] rickmasta: has joined #ruby
[22:26:32] drbrain: cooperlebrun: I don't like the each_with_object version because you, the user, have to build the result
[22:26:51] drbrain: the others let ruby do that which I find more pleasing to the eye
[22:27:12] drbrain: the others say "I'm going to transform from this to that" much more cleanly to me
[22:27:26] kraljev11: has joined #ruby
[22:27:40] chris2: has joined #ruby
[22:29:10] cooperlebrun: I honestly still like the .inject version the most
[22:29:20] cooperlebrun: because thats what it says to me
[22:29:23] robbyoconnor: has joined #ruby
[22:29:24] nizmow: has joined #ruby
[22:29:34] cooperlebrun: + doesn't go over it twice, right?
[22:29:37] blue_deref: has joined #ruby
[22:29:54] bricker: `f.select { |k,v| v.nil? }.keys` is best imo
[22:30:03] drbrain: f.each_key.reject would only iterate once
[22:30:36] drbrain: but if your Hash only has a dozen or two keys you'll never notice
[22:30:45] drbrain: ??? any performance issues
[22:30:59] cooperlebrun: true, but this is getting run on potentially 10-100s of thousands of hashes
[22:31:25] drbrain: do the simple readable thing, finish your program, then benchmark and profile when you're done
[22:31:53] cooperlebrun: weaksauce: not often, but at the most once a week
[22:31:58] drbrain: you'll find where you should be spending your optimization time instead of using it up guessing in the early stages
[22:32:17] cooperlebrun: drbrain: much sensible, very pragmatic
[22:33:01] weaksauce: once a week on a few hundred thousand entries shouldn't cost too much imo.
[22:33:13] weaksauce: but yeah don't prematurely optimize
[22:33:29] drbrain: also, inject can be used as a base method for implementing all the other enumerables
[22:35:12] FernandoBasso: has joined #ruby
[22:36:50] chipotle: has joined #ruby
[22:37:27] arthurix_: has joined #ruby
[22:38:40] Musashi007: has joined #ruby
[22:39:27] zenspider: ironically, the annoying bot response about pastebin vs gist is false for me. pastebin is measurably faster here than gist
[22:39:41] willardg: has joined #ruby
[22:40:31] cooperle1run: has joined #ruby
[22:40:32] Yzguy: has joined #ruby
[22:41:25] Taha_The_Hacker: has joined #ruby
[22:41:33] zenspider: cooperlebrun: 100s of thousands isn't much
[22:42:00] mistermocha: has joined #ruby
[22:42:29] baweaver: has joined #ruby
[22:43:00] mistermocha: has joined #ruby
[22:43:11] OS-18137: has joined #ruby
[22:43:15] Bellthoven: has joined #ruby
[22:43:29] zenspider: fwiw, I'd use keys.reject or keys.select
[22:43:39] CloCkWeRX: has joined #ruby
[22:45:10] cooperle1run: zenspider: inject just seems clearer to me ATM, but I'll probably change it before production
[22:45:35] Alayde: has joined #ruby
[22:46:11] nettoweb: has joined #ruby
[22:47:26] weemsledeux: has joined #ruby
[22:48:51] yfeldblum: has joined #ruby
[22:49:31] howdoicomputer: has joined #ruby
[22:51:47] charliesome: has joined #ruby
[22:52:37] jessemcgilallen: has joined #ruby
[22:55:12] OS-18137: has joined #ruby
[22:55:32] OS-18137: has left #ruby: ()
[22:55:38] devoldmx: has joined #ruby
[22:55:48] dotrb: has joined #ruby
[22:55:56] v4n: has joined #ruby
[22:58:42] freerobby: has joined #ruby
[22:59:01] niftylettuce: has joined #ruby
[23:00:24] benjito_: has joined #ruby
[23:03:00] bollullera: has joined #ruby
[23:04:26] bollullera: has left #ruby: ()
[23:04:56] Lucky5: has joined #ruby
[23:06:33] uilton: has joined #ruby
[23:07:13] IlSeparatio: has joined #ruby
[23:07:14] dotrb: has joined #ruby
[23:07:32] KnownSyntax_: has joined #ruby
[23:10:02] IlSeparatio: has joined #ruby
[23:10:37] Yzguy: has joined #ruby
[23:10:59] bonhoeffer: has joined #ruby
[23:15:32] edaaa__: has joined #ruby
[23:16:49] Synthead: has joined #ruby
[23:18:04] Elysia: has joined #ruby
[23:18:41] solocshaw: has joined #ruby
[23:18:43] Maletor: has joined #ruby
[23:18:45] Ox0dea: has joined #ruby
[23:20:39] `tim`: has joined #ruby
[23:21:11] bonhoeffer: has joined #ruby
[23:21:30] zenspider: I have no idea how one can consider inject to be clearer.. but ok
[23:22:06] saddad: has joined #ruby
[23:22:42] freerobby: has joined #ruby
[23:22:55] baweaver: zenspider: do you mean to say you.... reject that idea? :D
[23:23:07] vigintas: has joined #ruby
[23:23:23] allcentury: has joined #ruby
[23:25:27] swgillespie: has joined #ruby
[23:25:41] mary5030: has joined #ruby
[23:25:50] `tim`: has joined #ruby
[23:25:55] iamjarvo_: has joined #ruby
[23:27:49] dopamean_: has joined #ruby
[23:28:37] _whitelogger: has joined #ruby
[23:29:41] Ropeney: has joined #ruby
[23:30:08] EminenceHC: has joined #ruby
[23:32:42] _blizzy_: has joined #ruby
[23:34:19] cyle: has joined #ruby
[23:35:04] al2o3-cr: has joined #ruby
[23:36:04] djbender: has joined #ruby
[23:36:20] symbol: has joined #ruby
[23:37:19] devoldmx: has joined #ruby
[23:37:44] freerobby: has joined #ruby
[23:38:17] Emmanuel_Chanel: has joined #ruby
[23:38:42] Emmanuel_Chanel: has joined #ruby
[23:39:46] Tuxero: has left #ruby: ()
[23:40:51] CloCkWeRX: has joined #ruby
[23:42:03] daffy_duck: has joined #ruby
[23:42:24] KnownSyntax: has joined #ruby
[23:42:24] KnownSyntax: has joined #ruby
[23:43:58] baweaver: has joined #ruby
[23:45:05] BraddPitt: is rubygems included with ruby distributions?
[23:45:33] bricker: BraddPitt: yes
[23:45:39] BraddPitt: great, thanks
[23:45:49] Yzguy: has joined #ruby
[23:47:14] EminenceHC: has joined #ruby
[23:47:16] finisherr: has joined #ruby
[23:47:52] Musashi007: has joined #ruby
[23:48:58] atomical: has joined #ruby
[23:50:04] minimalism: has joined #ruby
[23:51:08] mengu: has joined #ruby
[23:52:13] nettoweb: has joined #ruby
[23:54:22] EminenceHC: has joined #ruby
[23:54:56] bungoman: has joined #ruby
[23:56:10] `tim`: has joined #ruby
[23:57:50] XxionxX: has joined #ruby
[23:58:19] rickmasta: has joined #ruby
[23:58:57] willardg: has joined #ruby
[23:59:10] patdohere: has joined #ruby