« Back to channel list

#ruby - 03 December 2015

« Back 1 day Forward 1 day »
[00:00:03] devbug: has joined #ruby
[00:00:48] gusTester: has joined #ruby
[00:01:21] Someone_Else: ripper doesn't compile
[00:01:29] havenwood: Someone_Else: Huh?
[00:01:46] dotix: has joined #ruby
[00:01:54] dotix: has joined #ruby
[00:02:26] finisherr: has joined #ruby
[00:02:51] Someone_Else: havenwood: http://pastebin.com/Fgh69KCC
[00:02:52] ruboto: Someone_Else, we in #ruby do not like pastebin.com, it loads slowly for most, has ads which are distracting and has terrible formatting. Please use https://gist.github.com
[00:03:25] jessemcgilallen: has joined #ruby
[00:03:32] havenwood: amincd: The docs actually probably don't make much sense if you don't already know what a capture group is. :)
[00:03:47] finisherr__: has joined #ruby
[00:03:51] amincd: havenwood: yeah I'm still trying to make snese of it
[00:03:52] havenwood: amincd: Maybe try playing with Rubular, here's a simple example to start with: http://rubular.com/r/5TGwRZ85tM
[00:04:20] Someone_Else: havenwood: Excuse me for pastbin, but I don't like to have things online forever (pastebin allows a time limit)
[00:04:21] havenwood: Someone_Else: Ripper is in the stdlib.
[00:04:33] havenwood: Someone_Else: You can delete a Gist.
[00:04:36] diego2: has joined #ruby
[00:04:56] amincd: havenwood: thanks
[00:05:09] ur5us: has joined #ruby
[00:05:10] Someone_Else: havenwood: By default within ruby?
[00:05:27] al2o3-cr: Someone_Else: yeah
[00:05:35] havenwood: Someone_Else: Yeah, it's in the standard library so just: require 'ripper'
[00:06:50] diego3: has joined #ruby
[00:07:02] rakm: has left #ruby: ("Textual IRC Client: www.textualapp.com")
[00:07:25] h99h9h88: has joined #ruby
[00:07:38] diego3: has joined #ruby
[00:08:55] al2o3-cr1: has joined #ruby
[00:10:54] al2o3-cr: has joined #ruby
[00:16:03] skade: has joined #ruby
[00:19:26] chamby: has joined #ruby
[00:20:19] chamby: has joined #ruby
[00:20:20] baweaver: has joined #ruby
[00:20:46] jhass: ethe: = is assignment, a = b creates/assigns the local variable a, always, a.b = c calls the method named b= on the object a and passes it c as parameter. << is always a method call, a << b calls the method named << on a and passes it b as first parameter
[00:20:58] chamby: has joined #ruby
[00:21:13] simplyianm: has joined #ruby
[00:21:48] heftig: is there some kind of terrible bug with sprintf in ruby 2.2? look at this: https://repl.it/B51M/0 It's full of \u0000
[00:22:14] snowy: has joined #ruby
[00:22:19] heftig: so far repl.it is the only service that replicates local ruby (ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]) behavior here
[00:22:45] KnownSyntax_: has joined #ruby
[00:23:07] Radar: heftig: I can also reproduce locally.
[00:23:29] havenwood: heftig: I'm not seeing it happen in 2.1 but am seeing it happen in 2.2 locally as well.
[00:23:48] Radar: Looks like you might've found a bug.
[00:23:54] heftig: aww, thanks
[00:24:11] iateadonut: has joined #ruby
[00:24:23] havenwood: Still \u0000s in ruby-2.3.0-preview1
[00:24:34] agent_white: Radar: Noticed your latest posting on your site just earlier today. Thank you for all your hard work in OSS :)
[00:24:45] Radar: agent_white: aw, thanks :)
[00:24:49] diegoviola: has joined #ruby
[00:24:54] Radar: agent_white: It was a hard decision to make but a necessary one.
[00:25:08] agent_white: No doubt. Life stops for nobody!
[00:25:33] phreakocious: has joined #ruby
[00:26:47] alindeman: has joined #ruby
[00:26:47] amincd: havenwood: I finally got it, thank you again
[00:26:56] diegoviola: has joined #ruby
[00:27:41] havenwood: amclain: nice, you're welcome!
[00:28:17] havenwood: amclain: Oops, misstell.
[00:30:12] RegulationD: has joined #ruby
[00:32:53] DLSteve: has joined #ruby
[00:33:33] ICantCook: has joined #ruby
[00:36:17] h99h9h88: has joined #ruby
[00:36:36] bronson: has joined #ruby
[00:36:39] heftig: >> "%8.1f %8.1f" % [1r, 1r]
[00:36:40] ruboto: heftig # => " \u0000\u0000\u0000" (https://eval.in/479487)
[00:36:47] lemur: has joined #ruby
[00:38:13] karapetyan: has joined #ruby
[00:41:46] bronson: has joined #ruby
[00:44:18] ledestin: has joined #ruby
[00:44:33] infernix: has joined #ruby
[00:45:58] cryptsting: has joined #ruby
[00:46:17] rickmasta: has joined #ruby
[00:49:44] wldcordeiro: has joined #ruby
[00:49:55] djbkd: has joined #ruby
[00:50:22] allcentury: has joined #ruby
[00:51:00] ascarter: has joined #ruby
[00:51:13] diegoviola: does the benchmark module has a way to tell me if the interval/value of a benchmark is seconds, milliseconds, and so on?
[00:51:19] diegoviola: I didn't found that in the docs
[00:52:29] krobzaur: has joined #ruby
[00:54:51] vikaton: has joined #ruby
[00:55:08] diegoviola: how can I figure that out?
[00:56:45] jackjackdripper: has joined #ruby
[00:56:46] Bellthoven: has joined #ruby
[00:57:03] davedev24: has joined #ruby
[01:01:53] B1n4r10: has joined #ruby
[01:02:24] dotix: has joined #ruby
[01:02:29] h99h9h88: has joined #ruby
[01:03:04] jackjackdripper: has joined #ruby
[01:04:26] simplyianm: has joined #ruby
[01:06:47] nateberkopec: has joined #ruby
[01:06:56] diego1: has joined #ruby
[01:07:00] replay: has joined #ruby
[01:07:20] diego1: has joined #ruby
[01:07:44] unreal: has joined #ruby
[01:09:50] djbkd: has joined #ruby
[01:09:55] porfa: has joined #ruby
[01:11:00] chamby: has joined #ruby
[01:12:13] ethe: jhass thank you
[01:12:20] Ruby_Rocks_007: has joined #ruby
[01:15:10] dlitvak: has joined #ruby
[01:17:22] danielpclark: has joined #ruby
[01:18:01] yonatankoren_: has joined #ruby
[01:19:48] porfa: has joined #ruby
[01:20:04] zapata: has joined #ruby
[01:20:45] robert45: has joined #ruby
[01:25:05] opencard: has joined #ruby
[01:25:06] skweek: has joined #ruby
[01:26:54] maloik: has joined #ruby
[01:27:14] waynerade: has joined #ruby
[01:27:29] Yzguy: has joined #ruby
[01:29:56] akem: has joined #ruby
[01:34:54] krobzaur: has joined #ruby
[01:35:12] rontec76_: has joined #ruby
[01:37:43] alindeman: has joined #ruby
[01:38:40] vivekananda: has joined #ruby
[01:42:53] pdoherty: has joined #ruby
[01:43:41] ascarter: has joined #ruby
[01:43:45] replay_: has joined #ruby
[01:44:32] replay_: has joined #ruby
[01:46:03] ascarter: has joined #ruby
[01:47:14] freerobby: has joined #ruby
[01:49:11] allcentury: has joined #ruby
[01:51:21] sondr3: has joined #ruby
[01:52:40] sankaber: has joined #ruby
[01:53:21] sfmk: has left #ruby: ()
[01:56:12] argoneus: I suppose this isn't a channel to ask about db schemas, right
[01:57:34] peterhil`: has joined #ruby
[01:57:54] mary5030: has joined #ruby
[01:59:27] colegatron: has joined #ruby
[02:00:28] shevy: give it a try!
[02:00:42] NeverDie: has joined #ruby
[02:01:30] argoneus: basically, I have an event, that can have n users
[02:01:44] argoneus: and the event can also have sub-events, which can have a subset of these users
[02:01:53] argoneus: and I'm not sure how I'm supposed to put this in a schema
[02:02:12] myztic: has joined #ruby
[02:02:19] argoneus: I want to do queries like "find all users on this event who haven't been to any sub-events"
[02:02:29] argoneus: and the reverse "find all users on this event who've been to at least 1 sub-event"
[02:02:51] avahey: has joined #ruby
[02:03:33] dotix: has joined #ruby
[02:03:34] dotix: has joined #ruby
[02:05:53] gf3: has joined #ruby
[02:07:32] nateberkopec: has joined #ruby
[02:08:49] lacuna_: has joined #ruby
[02:09:41] davedev24: has joined #ruby
[02:14:07] grzegorz: has joined #ruby
[02:14:20] poguez_: has joined #ruby
[02:14:43] jessemcgilallen: has joined #ruby
[02:15:22] auzty: has joined #ruby
[02:17:20] robert45: has joined #ruby
[02:17:32] davedev24: has joined #ruby
[02:18:06] peterhil`: has joined #ruby
[02:18:07] RobertBirnie: has joined #ruby
[02:19:45] s00pcan: has joined #ruby
[02:19:59] paradisaeidae: has joined #ruby
[02:21:23] houhoulis: has joined #ruby
[02:21:33] _djbkd: has joined #ruby
[02:21:56] Asher: has joined #ruby
[02:23:44] NeverDie: has joined #ruby
[02:24:42] dlitvak: has joined #ruby
[02:26:58] symbol: has joined #ruby
[02:29:08] robert45: has joined #ruby
[02:29:33] TheBloke-: has joined #ruby
[02:29:41] wldcordeiro: has joined #ruby
[02:31:02] rickmasta: has joined #ruby
[02:31:07] Xeago: has joined #ruby
[02:31:37] RegulationD: has joined #ruby
[02:32:28] Oog: has joined #ruby
[02:32:46] vdamewood: has joined #ruby
[02:33:12] csguest: has joined #ruby
[02:33:44] durstburger: has joined #ruby
[02:33:54] minimalism: has joined #ruby
[02:34:07] csguest: how can I have a hash map that the same different keys point to the same database
[02:34:14] csguest: database being an array
[02:34:22] shevy: the same different keys?
[02:35:02] csguest: "this" & "theirs" would point to the same array [1, 2, 3]
[02:35:19] csguest: instead of them both containing their own same copy of the array
[02:35:43] aadam21_: has joined #ruby
[02:35:46] ChanServ: -b ExterminatesweJ!*@*
[02:36:48] saddad: has joined #ruby
[02:37:31] baweaver: has joined #ruby
[02:37:42] csguest: is that even possible
[02:40:08] wldcordeiro: has joined #ruby
[02:41:23] Hanmac: has joined #ruby
[02:42:10] cantaberry: has joined #ruby
[02:47:08] rgrmatt: has joined #ruby
[02:47:10] agent_white: I... think I understand metaclasses and metaprogramming a bit.
[02:47:15] agent_white: ACTION squeels
[02:49:24] Gnut: has joined #ruby
[02:50:42] csguest: weird question
[02:51:07] csguest: http://pastebin.com/RPEafd3z
[02:51:08] ruboto: csguest, we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/229a20e71d6bf3b8a9b4
[02:51:08] ruboto: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[02:51:25] csguest: hear me out ruboto.
[02:51:40] csguest: seriously, when I type first and then type random stuff that does not match
[02:51:57] csguest: it still returns stuff as if it's correct matched
[02:52:03] bb010g: has joined #ruby
[02:56:11] simplyianm: has joined #ruby
[02:58:43] elton: has joined #ruby
[02:59:31] slash_nick: csguest: ruboto is a bot
[02:59:47] csguest: but why is this?
[02:59:50] slash_nick: oh, proceed then
[03:00:04] csguest: none of the variables are remaining the same
[03:01:08] slash_nick: Proceed. whoa, cool, i just realized ruboto gisted your pastebin...
[03:02:26] csguest: do you have any idea why this is so?
[03:03:13] cwong_on_irc: has joined #ruby
[03:03:23] elton: has joined #ruby
[03:04:24] dotix: has joined #ruby
[03:04:56] Trynemjoel: has joined #ruby
[03:05:07] wprice: has joined #ruby
[03:05:28] slash_nick: csguest: what do you mean? what is "it" in it still returns stuff as if it's correct?
[03:05:54] csguest: when it should hedge
[03:08:03] devbug: has joined #ruby
[03:08:04] csguest: so if you type "hey"
[03:08:07] csguest: itll return hedges
[03:08:11] csguest: once you send first
[03:08:20] csguest: itll only return one, two and three even if say hey
[03:08:24] nateberkopec: has joined #ruby
[03:09:21] devbug: has joined #ruby
[03:10:51] solocshaw: has joined #ruby
[03:11:58] slash_nick: csguest: these lines look fishy https://gist.github.com/anonymous/229a20e71d6bf3b8a9b4#file-ruby-rb-L48-L49
[03:12:05] IrishGringo: has joined #ruby
[03:13:55] slash_nick: what's that method supposed to do?
[03:14:23] maloik: has joined #ruby
[03:16:47] Ishido: has joined #ruby
[03:17:45] rakm: has joined #ruby
[03:17:45] slash_nick: csguest: are we solving your interview questions for you or something?
[03:17:55] hahuang61: has joined #ruby
[03:18:15] csguest: why do they look fishy
[03:18:19] csguest: not really
[03:18:28] csguest: i wrote it in scheme and need to convert it to ruby
[03:18:29] slash_nick: csguest: well, what is that line supposed to do?
[03:18:50] csguest: its supposed to see if you wrote first, second, or third
[03:18:53] slash_nick: lines 48 and 49 in the gist ruboto was kind enough to regist for you... i linked just above
[03:18:56] csguest: then tell weak-cues that you did it
[03:20:06] slash_nick: csguest: it looks like it's supposed to take two arguments... it also looks like it only uses one.
[03:20:10] s00pcan: has joined #ruby
[03:20:28] Miron: has joined #ruby
[03:20:32] slash_nick: csguest: that's fishy :)
[03:20:40] vdamewood: has joined #ruby
[03:20:55] csguest: get_context(costellos_words, old_context)
[03:21:00] csguest: it takes two though
[03:21:01] krobzaur: has joined #ruby
[03:21:14] slash_nick: it does... what's it do with "old_context"?
[03:21:34] csguest: good point
[03:21:44] elton: has joined #ruby
[03:21:55] csguest: no if there was no context
[03:21:59] csguest: no new context
[03:22:03] csguest: you return the old one
[03:22:10] csguest: that was recursed from last time
[03:22:38] csguest: im an idiot
[03:22:58] csguest: its supposed to do this isnt it
[03:23:12] csguest: let me pull out the scheme version
[03:24:10] slash_nick: csguest: what happens if you leave that method's contents the same, but change it's signature from `def get_context(costellos_words, old_context)` to `def get_context(costellos_words, context)`
[03:24:28] slash_nick: notice, no "old_" before `contect` at the end there
[03:24:40] Yzguy: has joined #ruby
[03:25:00] B1n4r10: has joined #ruby
[03:25:24] csguest: you go through the context array
[03:25:27] csguest: theyre different
[03:25:38] hxegon: has joined #ruby
[03:25:54] slash_nick: lol... does that just fix a different bug?
[03:26:27] arescorpio: has joined #ruby
[03:28:05] csguest: i just realized why I use old context
[03:28:20] slash_nick: but you weren't using it lol
[03:29:33] senayar: has joined #ruby
[03:29:59] csguest: what do you mean?
[03:30:05] csguest: its late ive been programming all day
[03:32:22] csguest: ruby.rb:82:in `try_weak_cues': undefined method `length' for nil:NilClass (NoMethodError)
[03:32:26] csguest: what is a nomethoderror
[03:32:53] edj: has joined #ruby
[03:33:18] edj: did anyone here learn ruby as their first language?
[03:33:26] slash_nick: http://rubykoans.com/ there is no nomethoderror
[03:36:02] arup_r: has joined #ruby
[03:39:01] waynerade: has joined #ruby
[03:43:42] InvGhost: has joined #ruby
[03:45:02] shinenelson: has joined #ruby
[03:45:28] B1n4r10: has joined #ruby
[03:47:56] krobzaur: has joined #ruby
[03:48:24] nbdy: has joined #ruby
[03:48:30] baweaver: has joined #ruby
[03:50:31] nbdy: has joined #ruby
[03:51:20] maloik: has joined #ruby
[03:53:41] howdoicomputer: has joined #ruby
[03:55:06] JammyHammy: has joined #ruby
[03:55:25] edj: as a first language how long should ruby take to learn?
[03:55:33] devbug: has joined #ruby
[03:56:02] jhass: that's very individual. Also it's hard to define a point where you ever "learned" a language
[03:58:18] hahuang61: has joined #ruby
[03:58:24] robert45: has joined #ruby
[03:59:26] akem: has joined #ruby
[04:02:27] rgrmatt: has joined #ruby
[04:03:38] stannard_: has joined #ruby
[04:03:50] dlitvak: has joined #ruby
[04:03:53] pontiki: it might take a while, otoh, you might be productive in weeks. with you're first language you are actually learning two very different things: how to write in the language and how to solve problems programmatically
[04:05:13] dotix: has joined #ruby
[04:05:49] Trynemjoel: has joined #ruby
[04:06:58] maloik: has joined #ruby
[04:07:21] shanemcd: has joined #ruby
[04:09:15] TheCompWiz: norc & apeiros: thanks much for pointing me to Kernel.switch. That's exactly what I needed... I guess.
[04:09:59] TheCompWiz: I was able to spawn 500 processes... (consuming 96gb RAM and 24 CPU cores) ... and all the data was returned properly.
[04:10:07] devoldmx: has joined #ruby
[04:10:10] edj: ive been dabling for a while but now im getting more serious about it. is "well grounded rubyist" going to teach me enough?
[04:10:44] pontiki: none of us could say, edj
[04:11:17] pontiki: it is a great place to start
[04:12:12] pontiki: WGR's early incarnation was wonderful for me, but ruby was far from my first language. WGR is an excellent book, black is an excellent author and guide
[04:12:46] pontiki: the process and practice of learning is highly individual, however
[04:13:53] zast: has joined #ruby
[04:13:55] edj: yea i think im trying to rush and make too much of a plan for learning
[04:14:11] chamby: has joined #ruby
[04:14:31] pontiki: maybe. but at the beginning, don't think too much at all about "how long is this going to take me" and "i need to carefully plan it out"
[04:14:48] braincrash: has joined #ruby
[04:15:19] pontiki: just keep practicing what you read, work the koans someone mentioned above, try out exercism.io, rubymonks, etc.
[04:15:29] kp666: has joined #ruby
[04:16:20] pontiki: i just bought a book last night that contains a bunch of problems to solve when you're beyond the initial steps; highly useful to apply to any new language
[04:16:46] edj: whats it called?
[04:16:47] pontiki: but, yeah, you can't learn it all in a day or a week
[04:16:55] pontiki: i have to go look :)
[04:16:59] skweek: has joined #ruby
[04:17:04] edj: so one monthish?
[04:17:31] pontiki: "exercises for programmers"
[04:18:19] pontiki: i wouldn't expect someone stepping out for the first time to be productive in a month. but being able to know enough to keep going? sure
[04:18:46] edj: how many hours a week should i devote?
[04:18:58] edj: is 12 hours a day unreasonable?
[04:19:22] pontiki: just seems like a lot to devote to any single practice
[04:19:54] pontiki: a person needs time to obsorb their learning, too
[04:20:39] edj: so this 1000 page book should take me a month or so?
[04:20:52] edj: i was aiming at a week but thats unrealistic
[04:20:55] pontiki: you keep asking these questions which are not answerable
[04:21:08] edj: i dont know why i do that
[04:21:24] pontiki: it's okay, it's not like we don't all do that
[04:21:48] edj: i try to make an equation and a plan out of absolutely everything
[04:21:58] jhass: edj: Chris Pine's "Learn to program" is generally recommended and might be an easier start before you head into the well grounded rubyist
[04:22:16] pontiki: i've only made your acquaintance, what, 10 minutes ago? i can't possibly know what you're capable of
[04:22:32] pontiki: really excellent book, too, edj; thanks jhass
[04:22:40] edj: pontiki: i know lmao
[04:23:15] edj: jhass: ive already gone through a track on treehouse and a few paths on code academy. would you still advise i read the book?
[04:23:39] edj: jhass: will it give a better foundation regaurdless?
[04:23:45] jhass: it can't harm, just speed through the stuff that's already clear to you
[04:24:29] edj: jhass: ok ill order it
[04:24:48] pontiki: i'd also say treehouse and code academy are covering that first part of first-language learning. pine's book actually covers a lot of the second part: the actual part about learning how to solve problems programmatically
[04:25:06] jhass: as pontiki pointed out so well earlier, your learning your first language is less about the language but more about learning to think like a programmer
[04:25:20] jhass: and beat me to it
[04:25:28] pontiki: how to break down a problem, how to know what algorithms and data structures to bring to a problem, how to organize your thoughts, your code
[04:25:48] pontiki: how to debug, how to test, etc
[04:26:58] pontiki: there's another book that's devoted just to that second part, sproul's "how to think like a programmer"
[04:27:05] pontiki: but i'd go with pine
[04:30:32] elton: has joined #ruby
[04:31:17] TheBloke: has joined #ruby
[04:35:06] elton: has joined #ruby
[04:38:08] nateberkopec: has joined #ruby
[04:40:44] mary5030: has joined #ruby
[04:41:29] Xeago: has joined #ruby
[04:41:31] gix: has joined #ruby
[04:44:54] tomchapin: has joined #ruby
[04:45:17] TheBloke: has joined #ruby
[04:48:51] krz: has joined #ruby
[04:52:02] jivemeat: has joined #ruby
[04:52:11] jivemeat: how does one gets an entire line from console?
[04:52:18] TheBloke-: has joined #ruby
[04:53:13] Radar: jivemeat: What have you tried?
[04:53:44] jivemeat: its how i coded my problem
[04:55:27] astrobun_: has joined #ruby
[04:56:14] sarkis: has joined #ruby
[04:56:43] maloik: has joined #ruby
[04:57:34] Radar: happy to help
[05:01:03] skweek: has joined #ruby
[05:06:05] sarkis: has joined #ruby
[05:06:56] dotix: has joined #ruby
[05:07:29] Eiam_: has joined #ruby
[05:10:01] yfeldblum: has joined #ruby
[05:11:01] davedev24: has joined #ruby
[05:12:18] maloik: has joined #ruby
[05:12:28] akem: has joined #ruby
[05:17:07] sarkis: has joined #ruby
[05:17:13] ur5us: has joined #ruby
[05:20:57] psye: has joined #ruby
[05:23:07] jameswatling: has joined #ruby
[05:23:35] dlitvak: has joined #ruby
[05:24:44] deepu: has joined #ruby
[05:26:41] deepu: I'm a student of ruby and wanted to learn how to create .to_<something>. I'm trying to search for .to_<something>
[05:26:53] deepu: but not sure what to search for
[05:27:10] sarkis: has joined #ruby
[05:27:16] deepu: what do you call .to_someting. It is a method correct?
[05:27:36] robbyoconnor: has joined #ruby
[05:30:55] ss_much: has joined #ruby
[05:31:53] davedev24: has joined #ruby
[05:32:20] baweaver: class Fixnum; def to_reddit; 42 end end; 1.to_reddit
[05:32:23] baweaver: >> class Fixnum; def to_reddit; 42 end end; 1.to_reddit
[05:32:24] ruboto: baweaver # => 42 (https://eval.in/479509)
[05:32:30] baweaver: it's a method
[05:32:41] baweaver: just like anything else
[05:32:58] baweaver: there's nothing special about to_s or to_h or anything else, all methods
[05:33:00] davedev24: has joined #ruby
[05:33:12] deepu: baweaver: but you call a method like method() correct?
[05:33:20] baweaver: don't need to
[05:33:27] baweaver: ruby is fairly paren free
[05:33:39] baweaver: so method and method() are the same thing
[05:33:52] kies: has joined #ruby
[05:33:59] baweaver: I would consider reading through a basic ruby tutorial or two, perhaps get a book if I were you
[05:34:00] deepu: so I can do def to_hi; puts hi; end
[05:34:30] baweaver: though remember I only use semicolons for oneliners on IRC
[05:34:36] baweaver: I would avoid doing that in actual code
[05:34:41] deepu: baweaver: ok thank you...
[05:37:22] sarkis: has joined #ruby
[05:37:44] deepu: baweaver: def to_hello(name); puts "hello {name}"; end
[05:37:59] Arnvald: has joined #ruby
[05:38:02] deepu: baweaver: deepu.to_hello NameError: undefined local variable or method `deepu' for main:Object
[05:38:25] baweaver: you have to define it on a class for it to work with that
[05:38:38] baweaver: read a ruby book
[05:38:57] deepu: baweaver: ok.. just trying to understand
[05:39:00] baweaver: it'll answer far more questions far faster than asking on here at this stage of your experience
[05:39:47] djbkd: has joined #ruby
[05:39:50] payload: has joined #ruby
[05:39:52] mooe: has joined #ruby
[05:43:18] Xeago: has joined #ruby
[05:45:20] Asher: has joined #ruby
[05:45:27] colegatron: has joined #ruby
[05:45:56] rghose: has joined #ruby
[05:47:26] sarkis: has joined #ruby
[05:47:29] darkf: has joined #ruby
[05:48:23] pontiki: https://twitter.com/bphogan/status/672284328953585664
[05:49:15] ayaz_: has joined #ruby
[05:49:37] baweaver: pontiki: shiny
[05:49:49] baweaver: will read after Doctor Who
[05:50:12] erbesharat: has joined #ruby
[05:50:21] ohaibbq: has joined #ruby
[05:51:02] hxegon_: has joined #ruby
[05:53:46] hxegon_: hi! in erb, is there a way to give tags of a css selector an attribute? for example, give_attr('body #list-name li', 'onclick="alert('foo')')
[05:54:15] hxegon_: minus the quote escaping nightmare of course
[05:54:48] skweek: has joined #ruby
[05:55:31] hxegon_: tried googling, but I'm pretty new to frontend stuff so not sure what to search for.
[05:57:35] sarkis: has joined #ruby
[05:58:32] lxsameer: has joined #ruby
[05:58:33] lxsameer: has joined #ruby
[05:58:33] devbug: has joined #ruby
[05:58:55] maloik: has joined #ruby
[06:00:13] yes`r: has joined #ruby
[06:00:49] arup_r: has joined #ruby
[06:02:06] EveryNickIsTaken: has joined #ruby
[06:02:48] hxegon: has joined #ruby
[06:05:12] slucx: has joined #ruby
[06:05:29] payload: has left #ruby: ()
[06:07:36] RobertBirnie: has joined #ruby
[06:07:46] sarkis: has joined #ruby
[06:09:20] troys: has joined #ruby
[06:10:14] ur5us: has joined #ruby
[06:12:33] TheBloke: has joined #ruby
[06:12:51] arup_r: has joined #ruby
[06:13:23] elton: has joined #ruby
[06:14:12] maloik: has joined #ruby
[06:16:50] tildes: has joined #ruby
[06:17:50] sarkis: has joined #ruby
[06:21:50] penzur: has joined #ruby
[06:23:45] crazydiamond: has joined #ruby
[06:24:27] elton: has joined #ruby
[06:24:50] skade: has joined #ruby
[06:24:53] Macaveli: has joined #ruby
[06:26:02] Gnut: has joined #ruby
[06:27:01] nateberkopec: has joined #ruby
[06:27:59] sarkis: has joined #ruby
[06:28:25] ibouvousaime: has joined #ruby
[06:28:30] sekrit: has joined #ruby
[06:29:47] maloik: has joined #ruby
[06:31:55] sigurding: has joined #ruby
[06:33:01] cscheib: has joined #ruby
[06:33:05] RegulationD: has joined #ruby
[06:38:10] sarkis: has joined #ruby
[06:39:59] prasselpikachu: has joined #ruby
[06:43:58] trautwein: has joined #ruby
[06:47:49] SOLDIERz: has joined #ruby
[06:47:57] rakm: has joined #ruby
[06:48:17] sarkis: has joined #ruby
[06:49:57] jetpackjoe: has joined #ruby
[06:55:29] Pupp3tm4st3r: has joined #ruby
[06:55:52] maloik: has joined #ruby
[06:57:08] kxc0re: has joined #ruby
[06:57:40] aufi: has joined #ruby
[06:57:47] codecop: has joined #ruby
[06:58:02] slucx: has left #ruby: ("ERC (IRC client for Emacs 24.5.1)")
[06:58:14] durstburger: has joined #ruby
[06:58:28] sarkis: has joined #ruby
[07:03:49] desmondhume: has joined #ruby
[07:04:34] SolarSailor: has joined #ruby
[07:05:11] sandstrom: has joined #ruby
[07:05:29] juddey: has joined #ruby
[07:07:07] tvw: has joined #ruby
[07:07:30] gaussblurinc1: has joined #ruby
[07:08:19] favadi: has joined #ruby
[07:08:32] sarkis: has joined #ruby
[07:08:40] dotix: has joined #ruby
[07:08:41] dotix: has joined #ruby
[07:09:33] escape_: has joined #ruby
[07:10:15] moeSeth: has joined #ruby
[07:11:32] maloik: has joined #ruby
[07:12:04] dlitvak: has joined #ruby
[07:13:20] SCHAAP137: has joined #ruby
[07:13:50] ur5us: has joined #ruby
[07:18:42] sarkis: has joined #ruby
[07:20:53] Pupp3tm4st3r: has joined #ruby
[07:21:10] solars: has joined #ruby
[07:22:54] penzur: has joined #ruby
[07:23:13] DoubleMalt: has joined #ruby
[07:23:15] solars: has joined #ruby
[07:27:35] tomaz_b: has joined #ruby
[07:27:44] nateberkopec: has joined #ruby
[07:28:04] joneshf-laptop: has joined #ruby
[07:28:19] SolarSailor: has joined #ruby
[07:28:54] sarkis: has joined #ruby
[07:30:32] cubicme: has joined #ruby
[07:30:43] yardenbar: has joined #ruby
[07:30:52] lubekpl: has joined #ruby
[07:31:07] gamer: has joined #ruby
[07:31:12] gamer: given code variable named "longestTurnInterval" what would you name it?
[07:33:14] desmondhume: has joined #ruby
[07:35:32] bluOxigen: has joined #ruby
[07:36:25] Anderson69s: has joined #ruby
[07:36:55] devoldmx: has joined #ruby
[07:37:55] yardenbar: has joined #ruby
[07:38:52] vdamewood: has joined #ruby
[07:38:58] sarkis: has joined #ruby
[07:39:19] ruby-lang217: has joined #ruby
[07:39:35] ruby-lang217: is anyone here
[07:39:44] TheBloke-: has joined #ruby
[07:40:01] ruby-lang217: what kind of chatroom is this?
[07:40:27] ruby-lang217: i needed some help
[07:40:31] ruby-lang217: with ruby code
[07:41:15] anisha: has joined #ruby
[07:41:25] ruby-lang217: can anyone help me
[07:41:29] ruby-lang217: with ruby code?
[07:42:03] ruby-lang217: has left #ruby: ()
[07:43:46] skade: has joined #ruby
[07:44:29] ruby-lang757: has joined #ruby
[07:45:58] User458764: has joined #ruby
[07:48:36] h99h9h88: has joined #ruby
[07:49:47] norc: has joined #ruby
[07:50:35] yardenbar: has joined #ruby
[07:50:55] sarkis: has joined #ruby
[07:51:06] minimalism: has joined #ruby
[07:51:21] andikr: has joined #ruby
[07:52:19] TomyWork: has joined #ruby
[07:53:49] karapetyan: has joined #ruby
[07:55:14] ta: has joined #ruby
[07:56:37] jack: has joined #ruby
[07:58:31] Guest79105: i needed help with ruby
[07:58:41] Guest79105: would you be able to help me?
[07:58:42] duckson: That's not a lot of replies out of 967 people in this channel. :)
[07:58:48] h99h9h88: has joined #ruby
[07:58:51] andersh: has joined #ruby
[07:59:01] duckson: Depends on the question, I'll try to have a look
[07:59:14] howdoicomputer: has joined #ruby
[07:59:17] Guest79105: well so I have to do this basic ruby challenge
[07:59:29] Guest79105: I'm a beginner
[07:59:46] Guest79105: I have to write a code which when the user enters 5 words
[07:59:59] Guest79105: arranges the words in alphabetical order
[08:00:25] Guest79105: and then every word is capitalized
[08:00:34] Guest79105: and every other word is lowercase
[08:01:06] sarkis: has joined #ruby
[08:01:56] Guest79105: this is the code i have so far words = [] 5.times do puts "Please enter a word" words << gets.chomp end puts words.sort.upcase.downcase
[08:02:10] maloik: has joined #ruby
[08:02:20] slash_nick: lots of people asking stdin questions tonight
[08:02:36] tagrudev: has joined #ruby
[08:02:46] slash_nick: standard in...
[08:02:56] Guest79105: sorry, new to all this
[08:03:43] duckson: It's fine. :) Your code doesn't work because upcase/downcase can't be called on the array itself. They must be called on the array elements
[08:03:56] duckson: You can use a loop, or array.map to do that
[08:04:16] Guest79105: how would i use a loop to do that?
[08:04:28] timonv: has joined #ruby
[08:05:19] astrobun_: has joined #ruby
[08:05:51] ruby-lang139: has joined #ruby
[08:05:55] duckson: Guest79105: Using a for-loop like "for element in array"
[08:05:55] Arnvald: has joined #ruby
[08:06:20] duckson: But a common way in ruby is array.each { |element| }
[08:06:48] norc: has joined #ruby
[08:06:54] dlitvak: has joined #ruby
[08:07:02] duckson: So words.sort.each { |word| word.upcase }
[08:07:03] rgrmatt: has joined #ruby
[08:07:46] slash_nick: >> words = []; 5.times {|i| words << (i % 2 == 0 ? 'aaa'.upcase : 'aaa'.downcase) }; words
[08:07:47] ruboto: slash_nick # => ["AAA", "aaa", "AAA", "aaa", "AAA"] (https://eval.in/479597)
[08:08:18] e7d: has joined #ruby
[08:09:02] duckson: You could use something like words.each_with_index.map { |word,i| if (i % 2 == 0) word.upcase else word.downcase end }
[08:09:35] slash_nick: >> 5.times.map {|i| i % 2 == 0 ? 'aaa'.upcase : 'aaa'.downcase }
[08:09:36] ruboto: slash_nick # => ["AAA", "aaa", "AAA", "aaa", "AAA"] (https://eval.in/479598)
[08:11:15] sarkis: has joined #ruby
[08:11:23] slash_nick: just replace those 'aaa's with your `gets.chomp`
[08:12:44] Pupp3tm4_: has joined #ruby
[08:13:01] elton: has joined #ruby
[08:13:03] slash_nick: Guest79105: 5.times.map {|i| i % 2 == 0 ? gets.chomp.upcase : gets.chomp.downcase }...
[08:13:44] slash_nick: (that doesn't do the sort)
[08:14:24] Guest79105: slash_nick: being completely honest, i am a complete newb at this and my instructor gave me the assignment to finish using the very basics of ruby
[08:14:32] unsymbol: has joined #ruby
[08:14:53] monthy: has joined #ruby
[08:16:38] Guest79105: so i need to be able to complete it using basic loops, methods, conditionals, objects,
[08:16:50] Guest79105: but thank you
[08:17:12] ljarvis: yes that's exactly how it should be done if you're learning
[08:17:33] ljarvis: what's wrong with your original code?
[08:17:49] brunto: has joined #ruby
[08:17:49] slash_nick: Guest79105: 5.times.map { gets.chomp }.sort.map {|x| x % 2 == 0 ? x.upcase : x.downcase }
[08:17:59] Guest79105: i've gotten to this so far words = [] 5.times do puts "Please enter a word" words << gets.chomp end words.each do |word|
[08:18:09] ljarvis: ok, does it work?
[08:18:21] Guest79105: halfway there
[08:18:27] Guest79105: a little more than halfway
[08:18:29] ljarvis: great, half way is good
[08:18:36] ljarvis: are you stuck?
[08:18:50] Guest79105: but still don't know how to get every other word to be in complete uppercase
[08:19:04] Guest79105: and every other word to be lower case
[08:19:08] Guest79105: yes im stuck
[08:19:20] slash_nick: ahhah: 5.times.map { gets.chomp }.sort.map.with_index {|x,i| i % 2 == 0 ? x.upcase : x.downcase }
[08:19:20] ljarvis: do you know about Array#map?
[08:19:29] desmondhume: has joined #ruby
[08:19:42] ljarvis: &ri Array#map
[08:19:43] `derpy: method `Array#map`: Invokes the given block once for each element of +self+. Creates a new array con??? ??? http://rubydoc.info/stdlib/core/Array#map-instance_method
[08:20:05] ljarvis: check out that link, maybe map would be useful here?
[08:20:06] slash_nick: >> 5.times.map { 'abc' }.sort.map.with_index {|x,i| i % 2 == 0 ? x.upcase : x.downcase }
[08:20:07] ruboto: slash_nick # => ["ABC", "abc", "ABC", "abc", "ABC"] (https://eval.in/479609)
[08:20:10] ljarvis: slash_nick: seriously?
[08:20:55] Guest79105: thanks a lot i will one sec
[08:21:24] sarkis: has joined #ruby
[08:21:24] Janno: has joined #ruby
[08:22:15] ljarvis: Guest79105: also, since you already know the format that you need, you can preemtively either downcase or upcase the input as it's received. That way you only need to do one more operation
[08:22:44] slash_nick: ljarvis: gotta upcase or downcase based on the sorted position, so gotta have all inputs first
[08:23:02] ljarvis: ah ok thanks, scrub that suggestion then
[08:23:09] ljarvis: I didn't see that requirement
[08:23:11] cscheib: has left #ruby: ()
[08:23:32] blaxter: has joined #ruby
[08:23:51] slash_nick: ljarvis: i was serious about the solution... and didn't mean to be unhelpful. it's time for me to say goodnight now though
[08:24:36] ljarvis: slash_nick: your solution is fine, i was just trying to talk through the problem so it was a bit annoying :) -- goodnight!
[08:25:17] slash_nick: ljarvis: ah... didn't mean to interrupt. had been iterating on the solution myself
[08:25:33] araujo: has joined #ruby
[08:26:14] sandstrom: has joined #ruby
[08:26:27] aspiers: has joined #ruby
[08:26:54] Macaveli: has joined #ruby
[08:27:36] gaussblurinc1: has joined #ruby
[08:27:39] karapetyan: has joined #ruby
[08:29:06] rattatmatt: has joined #ruby
[08:29:39] huyderman: has joined #ruby
[08:31:14] Hounddog: has joined #ruby
[08:31:28] sarkis: has joined #ruby
[08:31:59] rickmasta: has joined #ruby
[08:33:30] jas02: has joined #ruby
[08:33:48] SegFaultAX: has joined #ruby
[08:33:56] RegulationD: has joined #ruby
[08:34:00] norc: Hi. I have the need to display various versions of a GET /cities (one version displays additional associated data, others include extra columns).
[08:34:00] nettoweb: has joined #ruby
[08:34:06] norc: And wrong channel
[08:36:03] blackjid: has joined #ruby
[08:36:31] aps: has joined #ruby
[08:36:31] skarn: has joined #ruby
[08:42:08] alem0lars: has joined #ruby
[08:43:23] Pumukel: has joined #ruby
[08:43:27] sarkis: has joined #ruby
[08:43:45] Fredrich010: has joined #ruby
[08:44:52] boxrick1: has joined #ruby
[08:47:51] symm-: has joined #ruby
[08:49:58] Cohedrin: has joined #ruby
[08:50:30] passerine: has joined #ruby
[08:52:16] krz: has joined #ruby
[08:52:39] agent_white: has joined #ruby
[08:52:39] Cohedrin: has joined #ruby
[08:53:29] smokey: has joined #ruby
[08:53:35] sarkis: has joined #ruby
[08:54:03] testetest: has joined #ruby
[08:54:26] minimalism: has joined #ruby
[08:57:10] zast: has left #ruby: ()
[08:59:24] edwinvdgraaf: has joined #ruby
[08:59:29] bhaveshletter: has joined #ruby
[09:00:31] sigurding: has joined #ruby
[09:01:24] howdoicomputer: has joined #ruby
[09:02:21] jinie: has joined #ruby
[09:02:54] testetest: has joined #ruby
[09:03:46] sarkis: has joined #ruby
[09:04:54] joonty: has joined #ruby
[09:04:56] tulak: has joined #ruby
[09:05:39] skade: has joined #ruby
[09:05:42] yes`r: has joined #ruby
[09:06:25] testetest: has joined #ruby
[09:06:53] ismaelga: has joined #ruby
[09:07:53] rgrmatt: has joined #ruby
[09:08:21] c0m0: has joined #ruby
[09:08:26] howdoi: has joined #ruby
[09:10:20] danielpclark: has joined #ruby
[09:11:28] sorah: has joined #ruby
[09:14:04] lkba: has joined #ruby
[09:15:43] TheBloke: has joined #ruby
[09:16:34] nateberkopec: has joined #ruby
[09:16:40] marr: has joined #ruby
[09:16:45] opencard: has joined #ruby
[09:17:22] sarkis: has joined #ruby
[09:17:51] last_staff: has joined #ruby
[09:18:44] yfeldblum: has joined #ruby
[09:19:54] joonty: has joined #ruby
[09:23:22] gener1c: has joined #ruby
[09:23:28] Hounddog: has joined #ruby
[09:23:54] ur5us: has joined #ruby
[09:27:43] sarkis: has joined #ruby
[09:28:09] SCHAAP137: has joined #ruby
[09:28:45] escape_: has left #ruby: ()
[09:30:56] snowy: has joined #ruby
[09:32:47] InvGhost: has joined #ruby
[09:33:19] casadei: has joined #ruby
[09:33:23] senayar: has joined #ruby
[09:33:24] senayar: has joined #ruby
[09:34:24] troulouliou_div2: has joined #ruby
[09:36:06] rdark: has joined #ruby
[09:36:06] rdark: has joined #ruby
[09:37:39] devoldmx: has joined #ruby
[09:38:22] gaussblurinc1: has joined #ruby
[09:38:37] xfbs: has joined #ruby
[09:39:23] Bish: hello my friends!
[09:39:38] sarkis: has joined #ruby
[09:39:52] xfbs: has joined #ruby
[09:40:16] shanemcd: has joined #ruby
[09:44:19] Bish: i missed you guys, time to annoy you with stupid ruby related questions!
[09:44:57] apeiros: ey girl, missed you too ;-)
[09:45:22] Bish: im totally :male
[09:47:07] apeiros: eh, from the "guys" I figured it didn't matter :)
[09:48:37] baweaver: has joined #ruby
[09:48:55] Bish: im not a native speaker, never got whats gay about that
[09:48:56] Macaveli: has joined #ruby
[09:49:44] sarkis: has joined #ruby
[09:49:54] apeiros: oh, it's not gay. it's just in many cultural contexts understood as men only. i.e. you only greet half the channel.
[09:49:55] banister: has joined #ruby
[09:50:21] Papierkorb: *it may result in ^
[09:51:02] Bish: ohhh right i forgot about all the women in cs /irony
[09:51:09] peterhil`: has joined #ruby
[09:51:20] Papierkorb: ACTION zZzZzZ
[09:51:30] Bish: well, you can't say im wrong about that
[09:51:40] apeiros: I can say you're being an asshole about it.
[09:52:03] apeiros: but well, I shall call you girl henceforth.
[09:52:36] Macaveli: has joined #ruby
[09:53:11] Bish: well i actually didn't mean men-only with guys
[09:53:33] apeiros: oh, don't worry. girl in my cultural context isn't women only either.
[09:53:39] apeiros: it totes includes men.
[09:54:02] Papierkorb: Bish: don't even try to argue, neither side will even care enough to move a single inch in any direction
[09:54:12] adaedra: Unfortunately.
[09:54:15] apeiros: Papierkorb: wrong.
[09:54:26] apeiros: I learned guys as universal and changed.
[09:54:31] Bish: which direction? people in the internet are asexual for me, neither do i just mean men with "guys"
[09:54:42] Bish: don't try to push me somewhere, what the f is wrong with you
[09:55:02] adaedra: tssk tssk tssk.
[09:55:05] apeiros: Bish: see, then you have no problem calling you girl.
[09:55:17] apeiros: otherwise you'd push me somewhere.
[09:55:17] Bish: yeah, well and i am the asshole. right?
[09:55:22] cornerman: has joined #ruby
[09:55:27] Bish: okay, you win
[09:55:45] apeiros: hey, I'm just following your logic.
[09:55:52] Papierkorb: apeiros: this is the only channel where I don't use "guys" because of that, nowhere else. I'm just being honest.
[09:56:06] apeiros: Papierkorb: thank you.
[09:56:34] Jackneill: has joined #ruby
[09:56:45] ljarvis: please take this talk to #ruby-offtopic if it's likely to continue
[09:58:22] Arnvald: has joined #ruby
[09:59:12] Diabolik: how can i run an rspec test that isn't for a specific class?
[09:59:24] Diabolik: i get uninitialized constant for whatever i put in the describe at the top
[09:59:36] Papierkorb: Diabolik: just use a string for the describe method
[09:59:53] sarkis: has joined #ruby
[10:00:22] Bish: there is no logic, you're just having anger issues connected with gender somehow, i don't care what sexuality people in irc have, while you do
[10:00:24] Papierkorb: Diabolik: if it's a feature-test esque thing you can also use 'scenario' instead of 'context' in the spec
[10:00:27] ljarvis: yeah describe just casts the name to a string anyway, so it's only really used for the `described_class` macro
[10:00:46] ljarvis: Bish: again, for a second (and last) time, please take it to #ruby-offtopic
[10:01:00] Bish: well.. sorry for making the mistake of greeting people, im done
[10:01:24] Oog: has joined #ruby
[10:02:02] howdoicomputer: has joined #ruby
[10:05:04] Arnvald: has joined #ruby
[10:06:10] symm-: has joined #ruby
[10:06:34] GreatSUN: has joined #ruby
[10:07:54] ljarvis: this looks interesting https://github.com/clearwater-rb/clearwater
[10:08:01] ljarvis: in before yet another
[10:08:03] rikkipitt: has joined #ruby
[10:10:06] sarkis: has joined #ruby
[10:10:17] symm-_: has joined #ruby
[10:11:00] Hounddog: has joined #ruby
[10:12:30] nhhagen: has joined #ruby
[10:12:40] Peg-leg: has joined #ruby
[10:12:48] Papierkorb: ljarvis: I do something similar, though I'm using HAML. Feels way more natural to me
[10:13:02] ljarvis: yeah I'm a HAML fan
[10:13:23] apeiros: ACTION moved on from haml to slim
[10:13:43] Hounddog: has joined #ruby
[10:14:13] shevy: from haml to slim to thin to anorexia
[10:14:34] rodfersou: has joined #ruby
[10:14:42] adaedra: ACTION moved from HAML to Slim and moved back
[10:14:55] apeiros: adaedra: oh? interesting. why's that?
[10:14:56] shevy: yeah adaedra don't give in to less cuisine!
[10:15:06] workmad3: has joined #ruby
[10:15:19] Papierkorb: I used Haml from the get-go. a friend recommended it, and I don't have a reason to switch.
[10:15:33] norc: >> o = Object.new; def o.call; puts "called"; end; o.()
[10:15:34] ruboto: norc # => called ...check link for more (https://eval.in/479690)
[10:15:40] adaedra: apeiros: I kept forgetting the ' in the text-lines, and HAML hash-like attributes are nice.
[10:15:48] norc: Fancy. Has this always been there?
[10:16:14] adaedra: 18>> o = Object.new; def o.call; puts "called"; end; o.()
[10:16:15] ruboto: adaedra # => /tmp/execpad-406f76439e50/source-406f76439e50:2: syntax error, unexpected '(' ...check link for more (https://eval.in/479691)
[10:16:22] elton: has joined #ruby
[10:16:23] adaedra: seems not.
[10:16:42] ljarvis: yeah it's new, like the stabby operator
[10:16:44] Hounddog: has joined #ruby
[10:16:49] ljarvis: >> -> {}.()
[10:16:50] platzhirsch: has joined #ruby
[10:16:50] ruboto: ljarvis # => nil (https://eval.in/479692)
[10:16:57] norc: Interesting because I was sad the other day that we don't have op(). Seems like we do after all.
[10:16:59] norc: Sort of at least. :-)
[10:17:12] apeiros: we have op[]
[10:17:14] Papierkorb: thank god we've got more magic
[10:17:29] ljarvis: yeah methods in ruby aren't first class. It's my wish list item for Ruby that'll never happen
[10:17:40] apeiros: eh, any sufficiently analyzed magic is indistinguishable from science
[10:17:42] nocontrol: has joined #ruby
[10:17:56] Papierkorb: ljarvis: you mean just typing "some_variable" would invoke it if it's a method?
[10:18:09] ljarvis: Papierkorb: correct
[10:18:11] norc: Papierkorb: Depends on what the parser has in its cache.
[10:18:13] apeiros: problem is - you can't have sigil-less method calls and callable variables
[10:18:16] adaedra: Science ALL the things!
[10:18:19] apeiros: you have to sacrifice one
[10:18:59] ljarvis: also people seem to like optional parens over that feature. Satanists
[10:19:13] apeiros: yep. parens would be one kind of sigils.
[10:19:29] apeiros: I chose another route in my toy language. I use .foo
[10:19:33] norc: ljarvis: My head hurts from all the strange and bizarre parser errors you get when leaving out parens all the time.
[10:19:44] Hounddog: has joined #ruby
[10:19:45] norc: They are optional. Sometimes. In trivial cases.
[10:19:45] apeiros: so it's got a prefixed sigil, but no mandatory parens.
[10:20:04] adaedra: I dislike the idea of "remove all parenthesis you can"
[10:20:08] ljarvis: everything is "callable" in my language. "foo"() []() 1()
[10:20:09] norc: apeiros: Im wondering whether this is just a tool to give more options for writing DSL
[10:20:12] norc: op.() I mean
[10:20:15] sarkis: has joined #ruby
[10:20:17] shevy: adaedra there we go to meme it up http://shevegen.square7.ch/SCIENCE_ALL_THE_THINGS.png
[10:20:32] adaedra: shevy: those pixels.
[10:20:36] apeiros: norc: it's because people didn't like the look of op.call()
[10:20:44] shevy: adaedra beautiful isn't it
[10:21:02] norc: apeiros: ?
[10:21:06] adaedra: vade retro, 20th century.
[10:21:19] Papierkorb: well I guess your image converter wasn't so sciency with its use of pixels
[10:21:59] apeiros: norc: I mean it's not a tool providing more options, it's a cosmetic "trick"
[10:22:12] apeiros: the options have already been there. they just looked a bit less nice.
[10:22:23] apeiros: since .() is just syntax "sugar" for .call()
[10:23:22] norc: apeiros: Oh. Method#call you mean?
[10:23:45] apeiros: .() is .call(). literally. in every sense. it's not (necessarily) Method#call.
[10:23:57] apeiros: just like a + b is a.+(b)
[10:24:34] norc: apeiros: Think it's just a misunderstanding. :)
[10:28:06] ismaelga: has joined #ruby
[10:29:51] sarkis: has joined #ruby
[10:31:55] Tempesta: has joined #ruby
[10:33:12] banister: has joined #ruby
[10:34:19] spt0: has joined #ruby
[10:34:47] Hounddog: has joined #ruby
[10:35:07] Takumo: Hi all, I'm using Savon to call a SOAP API but I'm getting an error: "Server was unable to read request. ---> There is an error in XML document (1, 598). ---> The string '24 Jun 2016' is not a valid AllXsd value."
[10:35:20] Takumo: How do I inspect the serialized request to check the issue?
[10:36:42] ibouvousaime: has joined #ruby
[10:38:19] aswen: has joined #ruby
[10:38:41] lkba: has joined #ruby
[10:39:37] AlexRussia: has joined #ruby
[10:39:46] tvw: has joined #ruby
[10:40:02] sarkis: has joined #ruby
[10:40:23] Hounddog: has joined #ruby
[10:40:49] ldnunes: has joined #ruby
[10:44:02] nixmaniack: has joined #ruby
[10:44:22] luca768: has left #ruby: ("undefined")
[10:44:38] bkxd: has joined #ruby
[10:44:50] rikkipitt: has joined #ruby
[10:44:59] Hounddog: has joined #ruby
[10:46:23] aswen: has joined #ruby
[10:46:40] agit0: has joined #ruby
[10:46:49] Hounddog: has joined #ruby
[10:49:02] aswen: has joined #ruby
[10:50:04] Hounddog: has joined #ruby
[10:50:06] sarkis: has joined #ruby
[10:53:05] kam270: has joined #ruby
[10:53:54] SolarSailor: has joined #ruby
[10:53:55] Arnvald: has joined #ruby
[10:54:00] bronson: has joined #ruby
[10:54:51] solocshaw: has joined #ruby
[10:56:34] TheBloke-: has joined #ruby
[10:57:59] EbokianKnight: has joined #ruby
[10:58:27] dlitvak: has joined #ruby
[10:58:37] dravine_: has joined #ruby
[11:00:03] TheBloke: has joined #ruby
[11:00:14] sarkis: has joined #ruby
[11:01:27] ereslibre: has joined #ruby
[11:01:27] ereslibre: has joined #ruby
[11:01:46] ruby-lang558: has joined #ruby
[11:02:09] dlitvak: has joined #ruby
[11:02:32] nfk|laptop: has joined #ruby
[11:02:47] howdoicomputer: has joined #ruby
[11:03:52] hostess_: has joined #ruby
[11:05:13] nateberkopec: has joined #ruby
[11:05:32] othll0: has joined #ruby
[11:06:40] pwnd_nsfw: has joined #ruby
[11:07:49] Hounddog: has joined #ruby
[11:08:24] waynerade: has joined #ruby
[11:09:14] krz: has joined #ruby
[11:09:16] rgrmatt: has joined #ruby
[11:10:26] sarkis: has joined #ruby
[11:14:21] TheHodge: has joined #ruby
[11:15:07] waynerade: has joined #ruby
[11:15:54] gix: has joined #ruby
[11:17:04] tulak: has joined #ruby
[11:17:06] dravine_: has joined #ruby
[11:17:13] elton: has joined #ruby
[11:18:08] norc: apeiros: Did you got ruby-oci8 working on El Capitan eventually?
[11:18:35] kam270: has joined #ruby
[11:20:05] goodcodeguy: has joined #ruby
[11:20:31] dmcp: has joined #ruby
[11:20:37] sarkis: has joined #ruby
[11:21:27] x0F: has joined #ruby
[11:21:56] peterhil`: has joined #ruby
[11:22:28] tulak: has joined #ruby
[11:24:59] hfp__work: has joined #ruby
[11:26:55] CoderPuppy: has joined #ruby
[11:27:04] edwinvdgraaf: has joined #ruby
[11:27:32] sdothum: has joined #ruby
[11:27:49] karapetyan: has joined #ruby
[11:28:03] toretore: has joined #ruby
[11:29:15] azgil: has joined #ruby
[11:30:41] sarkis: has joined #ruby
[11:30:43] tulak_: has joined #ruby
[11:32:14] rsc___: has joined #ruby
[11:33:43] roshanavand: has joined #ruby
[11:35:26] Rotwang: has joined #ruby
[11:35:36] Mon_Ouie: has joined #ruby
[11:35:39] Rotwang: I have a bundler question, hope it is the right place to ask
[11:36:01] Rotwang: can I somehow add an additional path to bundler to look for gems?
[11:36:04] tulak: has joined #ruby
[11:36:24] adaedra: yep, using source
[11:36:29] Rotwang: the exact problem I have is that I'm trying to add a gem to the gitlab omnibus package (which I already have installed)
[11:36:40] Rotwang: adaedra: could you elaborate a bit more?
[11:36:52] danielpclark: has joined #ruby
[11:38:24] devoldmx: has joined #ruby
[11:39:03] adaedra: Rotwang: http://bundler.io/man/gemfile.5.html#BLOCK-FORM-OF-SOURCE-GIT-PATH-GROUP-and-PLATFORMS
[11:39:13] DoubleMalt: has joined #ruby
[11:39:46] adaedra: Or, for only one gem, the path/git/github/bitbucket options
[11:40:25] opencard: has joined #ruby
[11:40:25] IrishGringo: has joined #ruby
[11:40:51] sarkis: has joined #ruby
[11:41:44] testetest: has joined #ruby
[11:44:33] allcentury: has joined #ruby
[11:45:12] B5X: has joined #ruby
[11:49:17] colegatron: has joined #ruby
[11:49:49] Rotwang: adaedra: thanks, somehow gitlab omnibus doesn't want to cooperate, but I'm at least a step closer
[11:50:20] sarkis: has joined #ruby
[11:52:31] testetest: has left #ruby: ()
[11:52:52] test: has joined #ruby
[11:54:47] bronson: has joined #ruby
[11:54:48] aibot: has joined #ruby
[11:57:52] rikkipitt: has joined #ruby
[11:58:18] vdamewood: has joined #ruby
[12:00:53] entropie: has joined #ruby
[12:02:11] Bish: has joined #ruby
[12:02:22] Xeago: has joined #ruby
[12:03:14] durstburger: has joined #ruby
[12:03:33] howdoicomputer: has joined #ruby
[12:04:28] davedev24: has joined #ruby
[12:04:43] prestorium: has joined #ruby
[12:06:12] Guest75404: has left #ruby: ()
[12:06:47] smokey: has joined #ruby
[12:07:32] dionysus69: has joined #ruby
[12:07:45] pwnd_nsfw: has joined #ruby
[12:09:03] peterhil`: has joined #ruby
[12:10:39] symm-: has joined #ruby
[12:10:44] sepp2k: has joined #ruby
[12:12:43] xfbs: has joined #ruby
[12:14:04] brunto: has joined #ruby
[12:14:34] ismaelga: has joined #ruby
[12:15:53] testBot_1234_518: has joined #ruby
[12:16:08] rickmasta: has joined #ruby
[12:16:54] robert45: has joined #ruby
[12:17:59] elton: has joined #ruby
[12:18:51] sarkis: has joined #ruby
[12:19:32] Luna_Moonfang: has joined #ruby
[12:19:42] cantaberry: has joined #ruby
[12:20:39] bigkevmcd: has joined #ruby
[12:21:07] ismaelga: has joined #ruby
[12:22:37] krobzaur: has joined #ruby
[12:29:09] sarkis: has joined #ruby
[12:29:09] nateberkopec: has joined #ruby
[12:29:42] ruid: has joined #ruby
[12:29:42] ruid: has joined #ruby
[12:30:58] sandstrom: has joined #ruby
[12:31:09] Jet4Fire: has joined #ruby
[12:31:41] InvGhost: has joined #ruby
[12:33:35] x0F: has joined #ruby
[12:33:49] Jet4Fire: how is going?
[12:34:59] RegulationD: has joined #ruby
[12:36:10] jhass: we ask you!
[12:38:18] jhass: well, I just did
[12:38:34] adaedra: he did, didn't he?
[12:39:34] sigurding: has joined #ruby
[12:39:37] yessir: has joined #ruby
[12:39:47] startupality: has joined #ruby
[12:40:34] yessir: question, can I dynamically add "?" to a method whose name is passed as a variable to the method? Or is .send("#{name}?") the right way?
[12:41:06] sarkis: has joined #ruby
[12:41:07] apeiros: .send(:"#{name}?") is dynamically adding a ? to the name ;-)
[12:41:13] apeiros: also, use public_send, not send.
[12:41:33] jackcom: has joined #ruby
[12:41:41] yessir: yes I realize it is :) but is there another way or is that the 'best' way?
[12:41:42] jackcom: has left #ruby: ()
[12:41:50] apeiros: or put differently: there's no dynamic method names. yes, public_send/send is the name to go with variable method names.
[12:42:03] yessir: thanks apeiros
[12:44:04] dmcp: has joined #ruby
[12:44:23] Lena: has joined #ruby
[12:45:21] Pumukel: has joined #ruby
[12:45:21] tulak: has joined #ruby
[12:45:50] davedev24: has joined #ruby
[12:46:01] waynerade: has joined #ruby
[12:48:54] tulak: has joined #ruby
[12:49:18] loechel: has joined #ruby
[12:49:24] sankaber: has joined #ruby
[12:49:29] wprice: has joined #ruby
[12:51:32] Icey: has joined #ruby
[12:52:35] shevy: hehe kinda funny that the first example to come up is .send() and then the very next line says to not use .send() but .public_send() instead; I wonder if the brain just likes the shorter variant more :D
[12:53:06] sarkis: has joined #ruby
[12:53:48] jhass: shevy: no, public_send is still comparably new and all the stuff on the internet just refers to send still
[12:54:20] bronson: has joined #ruby
[12:54:58] startupality: has joined #ruby
[12:55:39] decoponio: has joined #ruby
[12:58:00] arian0n: has joined #ruby
[12:59:13] ibouvousaime: has joined #ruby
[13:01:16] chrisco: has joined #ruby
[13:01:31] chrisco: has left #ruby: ()
[13:03:14] Pupp3tm4st3r: has joined #ruby
[13:03:27] casadei: has joined #ruby
[13:04:01] durstburger: has joined #ruby
[13:04:16] howdoicomputer: has joined #ruby
[13:05:25] civil_: has joined #ruby
[13:07:16] chamby: has joined #ruby
[13:09:22] Xeago: has joined #ruby
[13:10:30] danielpclark: has joined #ruby
[13:12:06] dlitvak: has joined #ruby
[13:13:06] febre: has joined #ruby
[13:14:40] danzilio: has joined #ruby
[13:15:35] febre: i have no sperience with ruby ... some one knows why i can run a programm inside the /opt folder and when i run in my home folder i get a error?
[13:15:59] apeiros: febre: if you tell us *what* error you get, we might have a chance.
[13:16:36] gusTester: has joined #ruby
[13:16:58] gusTester: has left #ruby: ()
[13:17:44] tulak_: has joined #ruby
[13:18:23] febre: sorry for my bad writing. I don??t speak inglish. My error is: .rvm/rubies/ruby-2.1.6/lib/ruby/site_ruby/2.1.0/rubygems/dependency.rb:315:in `to_specs': Could not find 'metasploit-framework' (>= 0) among 136 total gem(s) (Gem::LoadError)
[13:18:26] febre: Checked in 'GEM_PATH=/home/motoko/.rvm/gems/ruby-2.1.6:/home/motoko/.rvm/gems/ruby-2.1.6@global', execute `gem env` for more information
[13:18:28] febre: from /home/motoko/.rvm/rubies/ruby-2.1.6/lib/ruby/site_ruby/2.1.0/rubygems/dependency.rb:324:in `to_spec'
[13:18:30] febre: from /home/motoko/.rvm/rubies/ruby-2.1.6/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_gem.rb:64:in `gem'
[13:18:32] febre: from /home/motoko/.rvm/gems/ruby-2.1.6/bin/msfconsole:22:in `<main>'
[13:18:34] febre: from /home/motoko/.rvm/gems/ruby-2.1.6/bin/ruby_executable_hooks:15:in `eval'
[13:18:36] febre: from /home/motoko/.rvm/gems/ruby-2.1.6/bin/ruby_executable_hooks:15:in `<main>'
[13:19:05] shanemcd: has joined #ruby
[13:19:24] gusTester: has joined #ruby
[13:19:46] apeiros: and you say you can run (msfconsole, I assume) with the same user in /opt?
[13:20:02] febre: with the same user
[13:20:22] moei: has joined #ruby
[13:20:26] elton: has joined #ruby
[13:20:34] tulak_: has joined #ruby
[13:20:49] apeiros: when you're in /opt, what does `which ruby` and `which msfconsole` say? and what does it say when you're in ~?
[13:20:58] sulky: has joined #ruby
[13:21:18] febre: i have to go to /opt and use the 'rvm use 2.1.6 --default' inside the folder
[13:21:31] febre: the i run the msfconsole
[13:21:54] jhass: do you run the rvm use command in your home folder too?
[13:21:54] apeiros: well, if you did 'rvm use 2.1.6 --default' once, then you shouldn't have to use rvm anymore.
[13:22:02] apeiros: (as it sets 2.1.6 as the default ruby)
[13:22:20] febre: metasploit-framework git:(master) which ruby
[13:22:23] febre: /home/motoko/.rvm/rubies/ruby-2.1.6/bin/ruby
[13:22:25] febre: ??? metasploit-framework git:(master) which msfconsole
[13:22:27] febre: /home/motoko/.rvm/gems/ruby-2.1.6/bin/msfconsole
[13:22:27] jhass: anyway, probably a topic for #metasploit
[13:22:29] febre: ??? metasploit-framework git:(master)
[13:22:48] ruboto: Please use https://gist.github.com for more than three lines of text!
[13:23:25] brujoand: has joined #ruby
[13:24:02] testBot_1234_824: has joined #ruby
[13:24:45] apeiros: eeep, sorry, afk
[13:26:00] YP-QMUL-W: has joined #ruby
[13:26:23] brujoand: hi, I usually don't work with ruby so I'll hope you'll excuse my ignorance. But I often find my self in need of a particular ruby gem and/or ruby version. So I tried rvm. And sky grew dark, whilst all life withered and died. So I went for rbenv. But at that point I was exhausted. So in stead of trying all the things, I wanted to ask someone who actually works with ruby. How do you manage your ruby env with
[13:26:29] brujoand: regards to version, gems etc?
[13:27:37] jhass: RVM is probably still the most popular but chruby is gaining marketshare rapidly. Rbenv is the least popular
[13:27:48] chocho: has joined #ruby
[13:27:51] tulak: has joined #ruby
[13:28:09] allcentury: has joined #ruby
[13:28:12] testBot_1234_329: has joined #ruby
[13:29:22] chocho: I am trying to learn Ruby long time, I red 3 different books, but in terms of understanding how to write and think of designing program I suck
[13:29:28] CloCkWeRX: has joined #ruby
[13:30:02] chocho: when I reach some level in Programming Ruby book i stop understanding what is there, so i want to ask
[13:30:12] testBot_1234_304: has joined #ruby
[13:30:19] chocho: please give me a book that I can read and will help me to bring my ideas in code
[13:30:24] d0nn1e: has joined #ruby
[13:30:40] darix: chocho: Sandy Metz
[13:30:43] chocho: book that i may read 3 times, but that will bring me inside real programming
[13:30:59] brujoand: jhass: thanks. I'll have a look at chruby
[13:31:19] chocho: darix, object oriented design ?
[13:31:43] darix: chocho: https://www.youtube.com/watch?v=OMPfEXIlTVE
[13:32:07] darix: chocho: https://www.youtube.com/watch?v=8bZh5LMaSmE
[13:33:41] chocho: since I am young I use computers, now I am 25 i don't see my future in another place, and ruby make me feel i can really do it, but i really feel like i am very stupid sometimes(even if i know it's not right)
[13:34:02] darix: chocho: but yes start with her book
[13:34:06] chocho: tnx, please let me know whatever you think can help me
[13:34:29] skweek: has joined #ruby
[13:34:32] chocho: something else you know that will bring me in practice with learning?
[13:35:02] goodcodeguy: has joined #ruby
[13:35:47] moeSeth: has joined #ruby
[13:36:02] shevy: just write as much code as possible, trivial code at first
[13:36:09] darix: what he said
[13:36:16] darix: chocho: and install pry
[13:36:20] darix: and learn about binding.pry
[13:36:36] darix: which gives you a nice way to play with your code and data
[13:37:07] shevy: I got all sorts of weird things on my todo list ... "write a libtool-fix script" ... another thing is to re-look into what apeiros wrote (that thing that turns strings like "[1,2,3]" into ruby array object), ... actually I have way too many things to do and not enough time :(
[13:37:37] chocho: i have joomla website, the company using it is making big amount of money
[13:37:52] chocho: i have wordpress website, and my sister is making good money on it as well
[13:37:57] chocho: but I want do more, a lot more
[13:38:27] chocho: and i really get sad sometimes, because i want, but I somehow cant find the way ..
[13:38:39] chocho: tnx for help guys rly
[13:39:09] devoldmx: has joined #ruby
[13:39:31] Pupp3tm4_: has joined #ruby
[13:39:41] Tempesta: has joined #ruby
[13:41:19] Jet4Fire: chocho: "i have wordpress website, and my sister is making good money on it as well" >> link please!
[13:41:38] kobain: has joined #ruby
[13:43:22] nixmaniack: has joined #ruby
[13:44:02] chocho: Jet4Fire, it's wp + theme + customization, but let me know why you ask for link
[13:46:31] Trynemjoel: has joined #ruby
[13:46:42] ismaelga: has joined #ruby
[13:47:03] sankaber: has joined #ruby
[13:49:41] GinoManWorks: has joined #ruby
[13:51:21] alcy: has joined #ruby
[13:51:48] alcy: hello folks, why does "azz".succ return "baa" instead of "aaa" ?
[13:51:50] tjad: has joined #ruby
[13:52:13] Jet4Fire: chocho: just interesting to look
[13:53:29] cwong_on_irc: has joined #ruby
[13:53:32] canton7: alcy, why would it return "aaa"?
[13:53:38] nixmaniack: has joined #ruby
[13:53:54] cwong_on_irc: has joined #ruby
[13:54:02] canton7: alcy, why happens when you do 099 + 1? Do you get 000, or 100?
[13:54:07] canton7: *what happens
[13:55:04] alcy: canton7: trying to wrap my head around string incrementation ... so, does it do ascii code math underneath ?
[13:55:10] haylon: has joined #ruby
[13:55:22] bkxd: has joined #ruby
[13:55:47] canton7: documented here: http://ruby-doc.org/core-2.2.3/String.html#method-i-succ
[13:55:55] sgambino: has joined #ruby
[13:56:11] canton7: so incrementing "a" results in a "carry", as indicated by the doc
[13:56:46] canton7: *incrementing "z", rather
[14:00:19] Macaveli_: has joined #ruby
[14:01:37] rsc___: has joined #ruby
[14:01:53] Arnvald: has joined #ruby
[14:02:14] cdg: has joined #ruby
[14:05:23] lurch_: has joined #ruby
[14:06:52] moeabdol: has joined #ruby
[14:07:42] DukeDave: has joined #ruby
[14:09:59] The_Phoenix: has joined #ruby
[14:10:48] jhill: has joined #ruby
[14:11:01] ismaelga: has joined #ruby
[14:11:22] atomical: has joined #ruby
[14:13:13] mroth: has joined #ruby
[14:13:39] durstburger: has joined #ruby
[14:14:05] adac: has joined #ruby
[14:14:20] InvGhost: has joined #ruby
[14:14:26] Xeago: has joined #ruby
[14:14:51] Anderson69s: has joined #ruby
[14:15:38] adac: What is the best way to check if there are values in "options[:keywords]" and only then add them to a string array?
[14:15:41] adac: %w[keyword1 keyword2 keyword3 ] << options[:keywords]
[14:15:59] kappy: has joined #ruby
[14:16:52] Vitor_: has joined #ruby
[14:17:55] nateberkopec: has joined #ruby
[14:18:12] kramsee: I'd say the simplest way is to add it to the array and doing a array.uniq afterwards
[14:18:18] tvon: has joined #ruby
[14:18:21] linocisco: has joined #ruby
[14:18:22] brujoand: has left #ruby: ()
[14:18:27] krobzaur: has joined #ruby
[14:18:42] linocisco: how to learn ruby quickly for ruby and rails?
[14:19:24] adaedra: By practicing.
[14:19:28] TomPeed: has joined #ruby
[14:19:55] kramsee: adac: see above
[14:20:00] radgeRayden: has joined #ruby
[14:20:38] adac: kramsee, yes that sounds nice
[14:20:42] ICantCook: has joined #ruby
[14:21:43] kramsee: check out uniq! as well. maybe that suits you better
[14:21:46] mustmodify: has joined #ruby
[14:21:51] elton: has joined #ruby
[14:22:43] adaedra: >> %w[keyword1 keyword2 keyword3] | %w[keyword2 keyword4] # adac
[14:22:44] ruboto: adaedra # => ["keyword1", "keyword2", "keyword3", "keyword4"] (https://eval.in/479842)
[14:23:17] nateberkopec: has joined #ruby
[14:23:17] adaedra: you can use Hash#fetch to have an empty array if :keywords is not set
[14:23:39] adac: thanks kramsee and adaedra!
[14:23:52] maikowblue: has joined #ruby
[14:23:56] kramsee: oh adaedra, that's more elegant! :>
[14:24:09] mustmodify: I'm doing something dumb. I swear I've been using Ruby forever, though it obviously isn't showing right now. Why am I getting back an enumerator instead of a list here? https://gist.github.com/mustmodify/1b8f0fdfa7a0c09a1109
[14:24:49] adaedra: because the do acts on puts and not map, I'd say.
[14:24:49] rikkipitt: has joined #ruby
[14:24:50] apeiros: mustmodify: because the do/end block belongs to puts
[14:24:58] adaedra: Use {} instead of do end for a quick fix.
[14:25:03] apeiros: ^5 adaedra
[14:25:07] mustmodify: apeiros: d'Oh!
[14:25:14] ItSANgo: has joined #ruby
[14:25:15] ItSANgo_: has joined #ruby
[14:25:19] arup_r: has joined #ruby
[14:25:26] gizmore: has joined #ruby
[14:26:13] krz: has joined #ruby
[14:26:42] nixmaniack: has joined #ruby
[14:26:45] mustmodify: apeiros: looks like that was it. Thanks very much.
[14:26:59] mustmodify: That's what happens on Monday mornings. I mean, Thursday mornings.
[14:27:20] ir2ivps3: has joined #ruby
[14:27:51] adac: adaedra, hmm wondering hwo this Hash#fetch does work
[14:27:51] casadei: has joined #ruby
[14:28:13] adaedra: adac: look at ri:Hash#fetch documetation?
[14:28:14] `derpy: adac: method `Hash#fetch`: Returns a value from the hash for the given key. If the key can't be found, ther??? ??? http://rubydoc.info/stdlib/core/Hash#fetch-instance_method
[14:28:49] adac: ah there is an example! very good, thanks adaedra
[14:28:50] allcentury: has joined #ruby
[14:29:11] lukeasrodgers: has joined #ruby
[14:30:09] opencard: has joined #ruby
[14:30:38] sarkis: has joined #ruby
[14:31:12] InvGhost: has joined #ruby
[14:31:56] skweek: has joined #ruby
[14:33:39] rsc___: has joined #ruby
[14:34:05] danielpclark: has joined #ruby
[14:35:41] Stan: has joined #ruby
[14:37:49] malconis: has joined #ruby
[14:38:11] B1n4r10: has joined #ruby
[14:38:54] freerobby: has joined #ruby
[14:38:58] norc: >> Process.kill(:SEGV, $$)
[14:38:59] ruboto: norc # => (https://eval.in/479853)
[14:39:01] p0wn3d: has joined #ruby
[14:39:27] norc: Why doesn't this produce the standard seg fault screen?
[14:39:39] adaedra: You mean "Segmentation fault" message?
[14:39:49] adaedra: This one is outputted by your shell
[14:40:13] norc: ruboto does it too if it crashes
[14:40:25] norc: >> require 'fiddle'; Fiddle::Pointer.new(0)[0]
[14:40:26] ruboto: norc # => NULL pointer dereference (Fiddle::DLError) ...check link for more (https://eval.in/479854)
[14:40:31] norc: >> require 'fiddle'; Fiddle::Pointer.new(1)[0]
[14:40:32] ruboto: norc # => /tmp/execpad-4bbdd5e1775f/source-4bbdd5e1775f:2: [BUG] Segmentation fault at 0x000001 ...check link for more (https://eval.in/479855)
[14:40:35] benlovell: has joined #ruby
[14:41:17] norc: But not with SIGSEGV, which is weird since the same signal should be sent in both instances
[14:41:42] tvw: has joined #ruby
[14:41:55] adaedra: That's strange indeed
[14:42:49] bkxd: has joined #ruby
[14:43:32] Xeago: has joined #ruby
[14:44:48] norc: adaedra: Is it possible that this might have something to do with ruboto forking for each >> statement?
[14:45:50] adaedra: That's eval-in and ruby internals
[14:46:19] adac: within my ruby console merging two arrays just works fine: i.e. (testarray1 + ['test']).uniq
[14:46:32] adac: however in rails helper it does not
[14:46:36] adac: any ideas why?
[14:46:44] adac: it is the exact same code
[14:47:06] adaedra: are you sure the source objects are the same (i.e. Model result vs Array) ?
[14:47:19] pandaant: has joined #ruby
[14:47:25] mustmodify: has left #ruby: ()
[14:47:30] norc: adaedra: Im just thinking that the only reasonable explanation is that both are handled by different signal handlers for SEGV - and the only way this makes sense is if they get sent to different processes.
[14:48:02] norc: Because afaik a segmentation fault is just the linux kernel sending SIGSEGV to the offending process.
[14:48:03] babblebre: has joined #ruby
[14:48:40] Pumukel: has joined #ruby
[14:48:53] adaedra: Sending a SIGSEGV, either from an external process than from Ruby itself shows the [BUG] screen for me. (OS X, tho)
[14:49:48] norc: Same on Ubuntu Linux.
[14:50:38] norc: adaedra: But then again it should be possible to recover it from it using Charlie Somervilles hack.
[14:50:50] bigkevmcd: has joined #ruby
[14:50:57] norc: Which does not work if I sent a SIGSEGV in ruboto
[14:51:08] norc: (Or eval.in rather)
[14:51:40] roxtrongo: has joined #ruby
[14:52:41] whippythellama: has joined #ruby
[14:52:45] based_pdev_: has joined #ruby
[14:53:48] borodin: has joined #ruby
[14:53:50] aryaching: has joined #ruby
[14:56:04] bronson: has joined #ruby
[14:57:52] NeverDie: has joined #ruby
[14:58:04] ja: How would I get ['january', 'february', 'march', ???] in the cleanest way possible?
[14:58:43] adaedra: %w[january february march ...]
[14:59:07] adaedra: mh, give me a second.
[15:00:00] imperator: has joined #ruby
[15:00:18] ja: >> (1..12).map { |i| Date.new(Date.current.year, i).strftime('%B').downcase }
[15:00:19] ruboto: ja # => uninitialized constant Date (NameError) ...check link for more (https://eval.in/479866)
[15:00:35] ja: >> require 'rails'; (1..12).map { |i| Date.new(Date.current.year, i).strftime('%B').downcase } # :???P
[15:00:36] ruboto: ja # => cannot load such file -- rails (LoadError) ...check link for more (https://eval.in/479867)
[15:00:42] ja: adaedra: Can you beat that though?
[15:00:57] havenwood: >> require 'date'; Date::MONTHNAMES.drop(1).map(&:downcase)
[15:00:58] ruboto: havenwood # => ["january", "february", "march", "april", "may", "june", "july", "august", "september", "october", " ...check link for more (https://eval.in/479868)
[15:01:27] ja: havenwood: whoa, thanks!
[15:01:38] adaedra: >> require 'date'; 7.times.each_with_object(Date.new(2007, 1, 1)) { |d| d.strftime('%B'); d << 1 }
[15:01:39] ruboto: adaedra # => undefined method `strftime' for 0:Fixnum (NoMethodError) ...check link for more (https://eval.in/479869)
[15:02:26] ja: haha, thanks for your effort, adaedra
[15:03:08] hxegon: has joined #ruby
[15:03:28] mostlybadfly: has joined #ruby
[15:03:46] karapetyan: has joined #ruby
[15:04:21] peterhil`: has joined #ruby
[15:04:21] dhollinger: has joined #ruby
[15:04:58] Frem: has joined #ruby
[15:05:45] allcentury: has joined #ruby
[15:06:02] howdoicomputer: has joined #ruby
[15:06:19] tvon: has joined #ruby
[15:07:02] imperator: has left #ruby: ("Leaving")
[15:07:11] lubarch: has joined #ruby
[15:07:48] roxtrongo: has joined #ruby
[15:10:10] Gamer-Pro: has joined #ruby
[15:10:46] momomomomo: has joined #ruby
[15:11:44] devbug: has joined #ruby
[15:13:28] c0ncealed: has joined #ruby
[15:15:35] yes`r: has joined #ruby
[15:15:43] Hanmac: has joined #ruby
[15:17:44] atomical_: has joined #ruby
[15:21:50] i: has joined #ruby
[15:22:40] elton: has joined #ruby
[15:26:10] aibot: has joined #ruby
[15:26:24] ethe: has joined #ruby
[15:29:59] Arnvald: has joined #ruby
[15:30:53] lubekpl: has joined #ruby
[15:31:51] robbyoconnor: has joined #ruby
[15:32:58] psye: has joined #ruby
[15:33:53] nixmaniack: has joined #ruby
[15:34:24] shanemcd: has joined #ruby
[15:34:27] gusTester1: has joined #ruby
[15:35:41] Azulinho: has joined #ruby
[15:37:33] treehug88: has joined #ruby
[15:39:29] Laaw: has joined #ruby
[15:39:56] devoldmx: has joined #ruby
[15:40:43] xfbs: has joined #ruby
[15:41:30] Fluent: has joined #ruby
[15:42:19] last_staff: has joined #ruby
[15:42:30] Fluent_: has joined #ruby
[15:42:54] ismaelga: has joined #ruby
[15:43:11] baweaver: has joined #ruby
[15:43:36] Jardayn: has joined #ruby
[15:43:59] kies: has joined #ruby
[15:45:21] iateadonut: has joined #ruby
[15:45:48] varunwachaspati: has joined #ruby
[15:46:04] entropie: has joined #ruby
[15:46:40] joonty: has joined #ruby
[15:46:42] danielpclark: has joined #ruby
[15:48:17] RegulationD: has joined #ruby
[15:50:07] grotewold: has joined #ruby
[15:52:01] casadei: has joined #ruby
[15:54:25] jds: has joined #ruby
[15:57:28] howdoicomputer: has joined #ruby
[15:58:39] demonlove: has joined #ruby
[15:58:52] arup_r: has joined #ruby
[15:59:49] theery: has joined #ruby
[16:00:42] x0F: has joined #ruby
[16:01:21] lubekpl: has joined #ruby
[16:01:26] favadi: has joined #ruby
[16:01:51] gusTester: has joined #ruby
[16:02:23] momomomomo: has joined #ruby
[16:04:28] saddad: has joined #ruby
[16:06:00] johnzorn: has joined #ruby
[16:08:51] peterhil`: has joined #ruby
[16:10:06] momomomomo: has joined #ruby
[16:10:07] maikowblue: has joined #ruby
[16:10:58] lurch_: has joined #ruby
[16:11:04] last_staff: has joined #ruby
[16:12:34] grill: has joined #ruby
[16:13:42] B1n4r10: has joined #ruby
[16:14:19] johnny56: has joined #ruby
[16:14:46] devoldmx: has joined #ruby
[16:17:09] jobewan: has joined #ruby
[16:18:27] arup_r: has joined #ruby
[16:18:44] theery: has joined #ruby
[16:19:10] skweek: has joined #ruby
[16:19:30] IrishGringo: has joined #ruby
[16:22:10] geekbri: has joined #ruby
[16:22:30] Gnut: has joined #ruby
[16:22:44] dmcp: has joined #ruby
[16:23:03] tvon: has joined #ruby
[16:25:11] Anderson69s: has joined #ruby
[16:25:32] maloik: has joined #ruby
[16:27:05] Arnvald: has joined #ruby
[16:27:32] Macaveli: has joined #ruby
[16:28:04] Zai00: has joined #ruby
[16:28:41] jackjackdripper: has joined #ruby
[16:28:51] wildlander: has joined #ruby
[16:29:21] karapetyan: has joined #ruby
[16:30:20] djstorm: has joined #ruby
[16:30:25] atm0sphere: has joined #ruby
[16:30:53] simplyia_: has joined #ruby
[16:32:59] Jet4Fire: has joined #ruby
[16:33:16] mary5030: has joined #ruby
[16:34:47] nbdy: has joined #ruby
[16:34:53] i: has joined #ruby
[16:34:54] demonlove: has joined #ruby
[16:35:26] ethe: has joined #ruby
[16:35:44] ArgylePwnage: has joined #ruby
[16:35:47] jgorak_: has joined #ruby
[16:35:49] cwong_on_irc: has joined #ruby
[16:36:52] dlitvak: has joined #ruby
[16:39:02] wsewolod: has joined #ruby
[16:40:20] peterhil`: has joined #ruby
[16:42:46] Jet4Fire: has joined #ruby
[16:42:52] Hounddog: has joined #ruby
[16:45:36] Hounddog: has joined #ruby
[16:46:44] Macaveli: has joined #ruby
[16:47:06] moeabdol: has joined #ruby
[16:47:27] hobodave: has joined #ruby
[16:47:29] Hounddog: has joined #ruby
[16:48:06] waynerade: has joined #ruby
[16:48:47] nixmaniack: has joined #ruby
[16:49:00] TheCompWiz: apeiros: Just wanted to say thanks for yesterday... I've never used Kernel.switch before... and it did the trick. (I know norc suggested it initially... but he's not here... )
[16:49:15] apeiros: Kernel.select, I assume? :)
[16:49:18] apeiros: you're welcome
[16:49:34] TheCompWiz: yeah... /sigh. It has been a day. :D
[16:49:59] Hounddog: has joined #ruby
[16:50:02] cubicme: has joined #ruby
[16:50:07] apeiros: and nope, it was indeed me to suggest it
[16:50:14] apeiros: unless norc suggested it a whole day earlier ;-)
[16:50:20] roshanavand: has joined #ruby
[16:50:32] jottr: has joined #ruby
[16:50:44] WizJin: has joined #ruby
[16:50:54] apeiros: but norc started a lot earlier than I helping you
[16:51:27] apeiros: all I did at the beginning was snarky comments related to threads vs. processes ;D
[16:51:37] TheCompWiz: o.O I wasn't here on Tuesday. I guess someone else was also persuing something similar ...
[16:51:40] jmhmccr: has joined #ruby
[16:51:53] [Butch]: has joined #ruby
[16:52:04] B1n4r10: has joined #ruby
[16:52:15] apeiros: "unless". I didn't check a day earlier. I only checked yesterday :)
[16:52:56] Jet4Fire: has joined #ruby
[16:53:02] TheCompWiz: yeah.... but I still contend that the differences between threads and attached processes are very minimal... unless you're wanting to use shared memory.
[16:53:03] apeiros: http://irclog.whitequark.org/ruby/2015-12-02#;select
[16:53:09] agentmeerkat: has joined #ruby
[16:53:34] Macaveli_: has joined #ruby
[16:53:46] apeiros: ok, I guess we disagree on that then. I see no point in discussing it :D
[16:54:09] apeiros: so: glad you solved your problem! :)
[16:54:29] eam: TheCompWiz: be aware that ruby threads inherently have issues with shared memory whether you're using it or not
[16:54:55] havenwood: TheCompWiz: The differences are real.
[16:55:15] havenwood: More different than soup and cereal.
[16:55:23] eam: the interpreter needs to worry about how things are or aren't shared too
[16:55:38] TheCompWiz: eam: no desire to attack shared memory... today. but yes... I'm aware.
[16:56:25] eam: it's true that conceptually they're kinda similar -- at an abstract level removed from say, a ruby implementation :)
[16:56:40] elliottcable: has joined #ruby
[16:56:42] Hounddog: has joined #ruby
[16:56:51] eam: it's all clone() on linux
[16:57:11] havenwood: I maintain that cereal is a cold soup!
[16:57:15] [Butch]_: has joined #ruby
[16:57:16] entropie: has joined #ruby
[16:57:18] eam: havenwood: it is
[16:57:23] havenwood: eam: Agreed.
[16:57:32] poguez_: has joined #ruby
[16:57:41] bronson: has joined #ruby
[16:57:52] shinenelson: has joined #ruby
[16:57:52] eam: fondue is a dipping sauce
[16:58:01] apeiros: but it is!
[16:58:10] apeiros: tasty yummi dipping sauce
[16:58:13] chrisarcand: has joined #ruby
[16:58:18] TheCompWiz: what do you call a fondue when you dump a bunch of "dipping items" into it?
[16:58:41] havenwood: TheCompWiz: Cereal?
[16:58:52] TheCompWiz: but it still is delicious.
[16:59:10] apeiros: if you dump it in? wasted.
[16:59:21] apeiros: you don't *dump* stuff into a fondue.
[16:59:42] TheCompWiz: I'm more of a steak kinda guy.
[17:00:06] sepp2k: has joined #ruby
[17:00:27] eam: fon-do's and fon-don'ts
[17:01:01] apeiros: a fendant is certainly not wrong to a fondue.
[17:01:13] adaedra: apeiros is swiss, don't mess with fondue
[17:01:18] karapety_: has joined #ruby
[17:01:26] apeiros: our warriors did well to invent it :D
[17:01:41] adaedra: ACTION dips baguette in fondue
[17:01:55] towski_: has joined #ruby
[17:02:50] eam: what's your stance on chocolate fondue
[17:02:58] Jet4Fire: has joined #ruby
[17:03:18] adaedra: Wait, this is #ruby, i thought this was #ruby-offtopic
[17:03:20] TheCompWiz: depends... do you qualify "white chocolate" as chocolate?
[17:03:30] adaedra: TheCompWiz: stop your racism.
[17:03:47] apeiros: chocolates don't have races
[17:03:55] apeiros: anyway, off to #ruby-offtopic with us!
[17:03:59] Anderson69s: has joined #ruby
[17:04:10] TheCompWiz: ACTION is going back to banging face on keyboard.
[17:04:34] frog0909_: has joined #ruby
[17:04:49] Hounddog: has joined #ruby
[17:04:51] apeiros: TheCompWiz: I hear that's the fastest way to produce good code. confirm?
[17:05:07] TheCompWiz: only if it is perl.
[17:05:59] gregf_: >> "Perl" == "perl"
[17:06:03] ruboto: gregf_ # => false (https://eval.in/479918)
[17:06:11] gregf_: we're good!
[17:06:41] adaedra: >> class String; def ==; true; end; end; "Perl" == "perl"
[17:06:42] ruboto: adaedra # => wrong number of arguments (1 for 0) (ArgumentError) ...check link for more (https://eval.in/479919)
[17:06:58] Papierkorb: perl is a hard nut to crack
[17:07:05] adaedra: adaedra.failures += 1
[17:07:06] rghose: has joined #ruby
[17:07:38] gregf_: class String; def == other; false; end; end; "Perl" == "perl"
[17:07:41] rghose: has joined #ruby
[17:07:59] apeiros: 18>> $= = true; "Perl" == "perl"
[17:08:00] ruboto: apeiros # => /tmp/execpad-1ebf0ca460f1/source-1ebf0ca460f1:2: warning: modifying $= is deprecated ...check link for more (https://eval.in/479920)
[17:08:09] rghose: has joined #ruby
[17:08:11] nofxx: has joined #ruby
[17:08:12] nofxx: has joined #ruby
[17:08:22] adaedra: >> "Perl" =~ /perl/i
[17:08:23] ruboto: adaedra # => 0 (https://eval.in/479922)
[17:08:31] rghose: has joined #ruby
[17:08:36] apeiros: 18>> require 'stringio'; $stderr=StringIO.new; $= = true; "Perl" == "perl"
[17:08:36] ruboto: apeiros # => true (https://eval.in/479923)
[17:08:39] gregf_: >> [ $=, $/, $\ ]
[17:08:40] ruboto: gregf_ # => /tmp/execpad-04f877ef40bb/source-04f877ef40bb:2: warning: variable $= is no longer effective ...check link for more (https://eval.in/479924)
[17:08:43] apeiros: there. got ruby to shut up.
[17:08:56] eam: $VERBOSE = nil oughta do it
[17:08:56] rghose: has joined #ruby
[17:09:13] apeiros: 18>> $VERBOSE=nil; $= = true; "Perl" == "perl"
[17:09:14] ruboto: apeiros # => true (https://eval.in/479925)
[17:09:21] rghose: has joined #ruby
[17:09:29] babblebre: has joined #ruby
[17:09:33] apeiros: nice. keep forgetting that the default `false` has a different effect than `nil`
[17:09:36] ruboto: Papierkorb # => /tmp/execpad-c7563493ecd5/source-c7563493ecd5:2: warning: variable $= is no longer effective ...check link for more (https://eval.in/479926)
[17:09:42] adaedra: >> $stdout.close; "Perl" == "perl"
[17:09:43] ruboto: adaedra # => /tmp/execpad-945d5747a6d4/source-945d5747a6d4:1:in `p': closed stream (IOError) ...check link for more (https://eval.in/479927)
[17:09:46] rghose: has joined #ruby
[17:10:11] rghose: has joined #ruby
[17:10:12] adaedra: >> $stdout.close; $stderr.close; "Perl" == "perl"
[17:10:12] ruboto: adaedra # => /tmp/execpad-e029174ed2e9/source-e029174ed2e9:1:in `p': closed stream (IOError) ...check link for more (https://eval.in/479928)
[17:10:22] adaedra: But where does it outputs :o
[17:10:36] rghose: has joined #ruby
[17:10:42] ethe: I wonder if you could modify the ruby interpreter to make it interpret perl (with a ruby script)
[17:10:59] eam: >> $stderr.reopen "/dev/null"; $stdout.reopen "/dev/null"; "Perl" == "perl"
[17:11:00] ruboto: eam # => (https://eval.in/479929)
[17:11:01] rghose: has joined #ruby
[17:11:11] adaedra: `exec('perl')`, ethe.
[17:11:26] rghose: has joined #ruby
[17:11:44] adaedra: Ah, I would have thought eval.in would not allow reopens.
[17:11:51] rghose: has joined #ruby
[17:12:05] ethe: adaedra, not that :P I mean like, changing operators, builtins and whatnot to make it interpret perl
[17:12:11] rghose: has joined #ruby
[17:12:31] rghose: has joined #ruby
[17:12:51] Jet4Fire: has joined #ruby
[17:14:16] devbug: has joined #ruby
[17:14:16] rgrmatt: has joined #ruby
[17:16:57] eam: adaedra: I don't see why it should care, dup() isn't any more dangerous than open()
[17:17:32] adaedra: I was remembering it for not allowing open() in fact.
[17:17:52] adaedra: >> File.open('/dev/null').tap(&:read)
[17:17:53] ruboto: adaedra # => #<File:/dev/null> (https://eval.in/479937)
[17:18:01] dorei: has joined #ruby
[17:18:12] adaedra: ACTION launches a memtest on his brain
[17:18:20] eam: >> File.open('/dev/zero').tap(&:read)
[17:18:22] ruboto: eam # => failed to allocate memory (NoMemoryError) ...check link for more (https://eval.in/479939)
[17:19:03] justinweiss: has joined #ruby
[17:22:20] Jet4Fire: has joined #ruby
[17:22:33] momomomomo: has joined #ruby
[17:22:51] psye: has joined #ruby
[17:23:02] rsc___: has joined #ruby
[17:23:20] karapetyan: has joined #ruby
[17:23:26] ruby-lang250: has joined #ruby
[17:23:56] SCHAAP137: has joined #ruby
[17:25:30] imperator: has joined #ruby
[17:25:46] amclain: has joined #ruby
[17:25:57] cpup: has joined #ruby
[17:26:19] howdoicomputer: has joined #ruby
[17:28:31] norc: has joined #ruby
[17:29:03] Guest23257: Hi. Is there
[17:29:03] Guest23257: has left #ruby: ()
[17:29:27] acidrainfall: has joined #ruby
[17:30:12] acidrainfall: Hey all. I'm creating a config file via .erb template, using an iterated hash value for each conf section
[17:30:25] acidrainfall: But the config expects integers to be non-quoted
[17:30:54] acidrainfall: So I did <% if value.is_a?(Integer) || value.is_a?(TrueClass) || value.is_a?(FalseClass) %>
[17:31:11] jetpackjoe: has joined #ruby
[17:31:14] acidrainfall: This works *perfectly* except for `max-wal-size = "104857600"`
[17:31:20] acidrainfall: Is 104857600 too big for int?
[17:31:28] devoldmx: has joined #ruby
[17:31:46] acidrainfall: Why would it not match (Integer) when all the others do?
[17:31:51] apeiros: >> 121034823105342305812031481234 + 12475367385726466278212417
[17:31:52] ruboto: apeiros # => 121047298472728032278309693651 (https://eval.in/479968)
[17:31:58] Hanmac: eam & adaedra i think you guys does like File::NULL too ;P
[17:32:11] apeiros: acidrainfall: you probably have a string in there?
[17:32:18] Hanmac: >> File::NULL
[17:32:20] ruboto: hanmac # => "/dev/null" (https://eval.in/479971)
[17:32:20] apeiros: i.e. you don't have it as an integer in your hash
[17:32:23] gregf_: >> 104857600 + 1
[17:32:24] ruboto: gregf_ # => 104857601 (https://eval.in/479973)
[17:32:33] Jet4Fire: has joined #ruby
[17:33:25] acidrainfall: Oh weird that's not coming from yaml
[17:33:33] jottr_: has joined #ruby
[17:33:40] johnny56_: has joined #ruby
[17:34:04] acidrainfall: Oh I see, it's coming from default params. I'm doing a hash merge
[17:34:19] aphprentice: has joined #ruby
[17:34:31] acidrainfall: and this is how it looks in the params: max-wal-size => 104857600,
[17:34:34] norc: has joined #ruby
[17:34:38] acidrainfall: So maybe my merge is actually turning it into a string...
[17:34:39] hxegon: has joined #ruby
[17:34:53] apeiros: um, it certainly doesn't look like that
[17:35:00] opencard: has joined #ruby
[17:35:06] apeiros: max-wal-size is not a valid bareword
[17:35:19] apeiros: and merge doesn't turn values into something
[17:35:35] acidrainfall: This is coming out of a puppet file
[17:35:39] apeiros: but without meaningful information I won't be able to help.
[17:35:39] acidrainfall: it accepts max-wal-size...
[17:36:00] minimalism: has joined #ruby
[17:36:06] acidrainfall: apeiros: what do you need?
[17:36:42] apeiros: code & inspects of the relevant values
[17:37:04] threh: has joined #ruby
[17:37:22] acidrainfall: http://fpaste.org/297114/64224144/
[17:37:26] acidrainfall: There's the code at least
[17:37:40] acidrainfall: I'm not a ruby guy :/
[17:38:14] ismaelga: has joined #ruby
[17:39:03] Amnez777-: has joined #ruby
[17:39:24] nettoweb: has joined #ruby
[17:39:55] n1x: has joined #ruby
[17:40:07] banister: has joined #ruby
[17:40:21] Amnez777: has joined #ruby
[17:40:21] Amnez777: has joined #ruby
[17:40:22] lkba: has joined #ruby
[17:40:47] aryaching: has joined #ruby
[17:40:56] edwinvdgraaf: has joined #ruby
[17:42:01] User458764: has joined #ruby
[17:42:31] Jet4Fire: has joined #ruby
[17:43:00] acidrainfall: apeiros: am I supposed to quote those barewords?
[17:43:30] apeiros: acidrainfall: sorry, missed your paste. that first file is a puppet file you say?
[17:44:00] apeiros: ah, when you said "merge" you were not talking about ruby
[17:44:07] apeiros: I think you should take this to #puppet
[17:44:22] rontec76: has joined #ruby
[17:44:56] acidrainfall: I figured I had made a mistake in my erb file
[17:44:59] acidrainfall: sorry that was why I came here
[17:45:02] acidrainfall: I'll ask in Puppet thanks
[17:47:00] ledestin: has joined #ruby
[17:47:01] bronson: has joined #ruby
[17:47:03] benlieb: has joined #ruby
[17:47:28] norc: >> Signal.trap(:SEGV)
[17:47:29] ruboto: norc # => can't trap reserved signal: SIGSEGV (ArgumentError) ...check link for more (https://eval.in/480010)
[17:47:41] momomomomo: has joined #ruby
[17:47:42] norc: Anyone know a hack from the top off their head how I can trap it regardless?
[17:47:51] baweaver: has joined #ruby
[17:48:09] jackjackdripper: has joined #ruby
[17:48:47] eam: norc: you could always use FFI to wrap the libc calls
[17:48:58] jessemcgilallen: has joined #ruby
[17:49:16] norc: eam: That will be difficult in eval.in :-)
[17:49:16] eam: I imagine SEGV is blocked because some implementations may use it -- like for example SEGV is used by the GC on java/jruby
[17:49:35] colegatron: has joined #ruby
[17:49:41] eam: if you watch a jvm you'll see it constantly segfaulting
[17:49:48] norc: Or maybe I can mmm
[17:49:54] norc: eam: Really?
[17:50:02] eam: yup, try it
[17:51:31] B1n4r10: has joined #ruby
[17:51:52] Jet4Fire: has joined #ruby
[17:51:55] Eiam: has joined #ruby
[17:52:14] zast: has joined #ruby
[17:52:44] jbrhbr: has joined #ruby
[17:53:17] solocshaw: has joined #ruby
[17:53:21] mrtomme: has joined #ruby
[17:53:40] acidrainfall: apeiros: Ok yeah it's a puppet problem, but now back to you
[17:53:55] acidrainfall: puppet does turn it into a string, but I need it to be an integer in the file
[17:53:56] nettoweb: has joined #ruby
[17:54:01] norc: eam: Yeah I think I might. And just realized that eval.in does not come with FFI sadly.
[17:54:18] norc: eam: Which leaves me only with Fiddle to somehow achieve my goal.
[17:58:11] freerobby: has joined #ruby
[17:58:27] freerobby: has joined #ruby
[17:58:54] freerobby: has joined #ruby
[17:59:39] freerobby: has joined #ruby
[17:59:48] skade: has joined #ruby
[18:00:34] calderonroberto: has joined #ruby
[18:00:47] h99h9h88: has joined #ruby
[18:00:57] rakm: has joined #ruby
[18:01:01] acidrainfall: Basically if I have a string "100001111001" and I need to detect that what's inside the quotes is a valid int format, what's the best way? Regez?
[18:01:30] jmonreal: jhass: how are you?
[18:01:51] Jet4Fire: has joined #ruby
[18:01:56] jhass: huh, why?
[18:02:44] jmonreal: just asking
[18:02:48] Papierkorb: acidrainfall: either a regex, or you can parse it with Integer(the_value) which raises if it's invalid
[18:03:58] acidrainfall: how would that look in if statement format?
[18:04:15] last_staff: has joined #ruby
[18:06:44] baweaver: has joined #ruby
[18:06:51] Eiam_: has joined #ruby
[18:08:31] djbkd: has joined #ruby
[18:08:55] bodgix: has left #ruby: ()
[18:08:56] lukeasrodgers: Integer(the_value) might incorrectly handle some cases, e.g. if you want to fail on '3000' because the_value should only be a binary string
[18:09:09] philtr: has joined #ruby
[18:09:27] last_staff: has joined #ruby
[18:09:56] acidrainfall: no that was just an example number
[18:10:24] cmoneylulz: has joined #ruby
[18:11:32] rsc___: has joined #ruby
[18:11:34] lukeasrodgers: i think Papierkorb is right then
[18:11:48] Jet4Fire: has joined #ruby
[18:12:24] acidrainfall: Papierkorb: hell yes
[18:14:56] rgrmatt: has joined #ruby
[18:15:13] banister: has joined #ruby
[18:15:23] TeresaP: has joined #ruby
[18:15:31] jmonreal: When I run this code https://bpaste.net/show/00df324e9578 without parameters works(without the parameters set) but when I set the parameters I get the error run.rb:41:in `block (2 levels) in parse': undefined method `<<' for nil:NilClass (NoMethodError)
[18:15:42] jmonreal: what am I doing wrong?
[18:15:55] jmonreal: and I am setting just one parameter
[18:16:20] gregf_: >> nil << foo
[18:16:21] ruboto: gregf_ # => undefined local variable or method `foo' for main:Object (NameError) ...check link for more (https://eval.in/480025)
[18:16:25] gregf_: >> nil << "foo"
[18:16:26] ruboto: gregf_ # => undefined method `<<' for nil:NilClass (NoMethodError) ...check link for more (https://eval.in/480026)
[18:16:34] rehat: has joined #ruby
[18:16:43] eam: be aware, Integer() and to_i use different rules - eg "0123" will differ in value
[18:16:54] TeresaP: If I want to embed a module within a class and that module contains a class variable I want to access, how do I get to it? I tried setting attr_accessor to the variable but no dice.
[18:17:06] TeresaP: How do I get to it from outside the class, I mean
[18:18:17] colleenmcguckin: has joined #ruby
[18:18:53] h99h9h88: has joined #ruby
[18:20:22] RegulationD: has joined #ruby
[18:20:22] acidrainfall: Papierkorb: lukeasrodgers: run: parse config: Type mismatch for 'run.Config.data': Type mismatch for 'tsdb.Config.max-wal-size': Expected integer but found 'string'.
[18:20:33] acidrainfall: Detail: can't convert false into Integer
[18:20:41] acidrainfall: So it's performing an action, not asking a questino
[18:20:55] acidrainfall: whatever. Should I do `integer(value)?` ?
[18:21:17] shevy: all those cute little questinos
[18:21:38] acidrainfall: Oh would that work too?
[18:22:21] acidrainfall: Detail: can't convert false into Integer
[18:22:26] acidrainfall: Stupid clipboard
[18:22:37] acidrainfall: Detail: undefined method `to_i?' for false:FalseClass
[18:22:42] TeresaP: Oh you're trying to convert a boolean
[18:22:49] acidrainfall: I'm trying to check for integers
[18:22:58] acidrainfall: But some of the integers (because fuck puppet that's why) come in as strings
[18:23:13] TeresaP: bool_val ? 1 : 0
[18:23:17] acidrainfall: So doing .is_a(Integer)? doesn't work
[18:23:29] acidrainfall: http://fpaste.org/297114/64224144/
[18:23:32] acidrainfall: That's the source data
[18:23:43] acidrainfall: I need to detect bool and int, and place them in the template file unquoted
[18:23:46] acidrainfall: Everything else gets quoted
[18:23:57] diegoviola: has joined #ruby
[18:23:58] lukeasrodgers: i would probably just do .to_i and rescue NoMethodError
[18:24:12] lukeasrodgers: do you want to handle false, or ignore it?
[18:24:26] TeresaP: shevy do you have an answer for my lame question by any chance? :)
[18:24:52] acidrainfall: lukeasrodgers: Well, I am handling booleans
[18:25:01] `based_pdev`: has joined #ruby
[18:25:03] kirun: has joined #ruby
[18:25:15] acidrainfall: lukeasrodgers: http://fpaste.org/297141/67106144/
[18:25:34] RegulationD: has joined #ruby
[18:25:38] karapetyan: has joined #ruby
[18:26:56] shevy: TeresaP hmm
[18:27:14] shevy: TeresaP with class variables you mean @@foo ?
[18:27:32] bryancp: has joined #ruby
[18:28:51] karapetyan: has joined #ruby
[18:28:59] solocshaw: has joined #ruby
[18:29:55] acidrainfall: I'm just going to do a match I think
[18:29:56] shevy: the simplest way is to just use methods to access/query/set it
[18:29:58] TeresaP: So that's my mistake probably
[18:30:00] j0bk: has joined #ruby
[18:30:04] TeresaP: because that's an instance variable
[18:30:09] Ox0dea: has joined #ruby
[18:30:18] SirCmpwn: has joined #ruby
[18:30:33] shevy: so say you h ave: class Foo; module Bar; end; end; if you have @yo in Bar, you could add a Bar.yo method to return it, and just keep on using that method invocation
[18:30:57] Ox0dea: Alternatively, use #instance_variable_get.
[18:31:06] shevy: so in principle, that is the same as when you define instance methods on your class, you just define it via a: def self.yo
[18:31:12] TeresaP: attr_reader wouldn't expose it then?
[18:31:18] Ox0dea: It would.
[18:31:27] hahuang61: has joined #ruby
[18:31:53] shevy: you can if you call it on the right variant, e. g. self.instance_eval { }
[18:31:55] platzhirsch: has left #ruby: ()
[18:32:03] Ox0dea: TeresaP: Oh, sorry, no, not for module-level instance variables.
[18:33:03] TeresaP: Ox0dea if I change it to @@foo, it doesn't seem to affect it either
[18:33:18] Ox0dea: >> module M; @v = 42; singleton_class.send :attr_reader, :v; end; M.v # TeresaP
[18:33:19] ruboto: Ox0dea # => 42 (https://eval.in/480033)
[18:33:19] ec\: has joined #ruby
[18:34:13] Ox0dea: That could also have been `class << self; attr_reader :v; end`, but the principle is the same.
[18:34:28] TeresaP: Hmm I was hoping to be able to call it like UpdateContent::Operation.modify_entity
[18:34:45] Ox0dea: So what you actually want is a singleton method?
[18:35:02] Ox0dea: How did class and instance variables become involved?
[18:35:24] brunto: has joined #ruby
[18:35:41] nertzy: has joined #ruby
[18:35:45] TeresaP: I just want to set some options for a user that happen to map to strings
[18:35:54] shanemcd: has joined #ruby
[18:36:25] toretore: has joined #ruby
[18:36:55] p8952: has left #ruby: ("Leaving")
[18:37:08] shevy: TeresaP just stick to @foo anyway
[18:37:25] shevy: and you can do the above
[18:39:02] shevy: TeresaP http://pastie.org/10602526
[18:39:30] DoubleMalt: has joined #ruby
[18:40:19] TeresaP: Thanks shevy
[18:41:50] ankhers: This works, but is there a more ruby way of doing this? http://lpaste.net/146427
[18:41:51] Ox0dea: TeresaP: Don't you have many of these variables?
[18:43:24] simplyianm: has joined #ruby
[18:43:53] shadoi: has joined #ruby
[18:43:54] Ox0dea: Ankhers: Don't? http://www.rubydoc.info/stdlib/minitest/MiniTest/Unit/TestCase#i_suck_and_my_tests_are_order_dependent%21-class_method
[18:44:36] ankhers: Ox0dea: That isn't order dependent. It is calling a login function and I don't want to write the same test N times for each user type.
[18:44:48] norc: Ox0dea: You probably have the most experience at segfaulting eval.in - why doesn't the standard sigsegv handler kick in?
[18:44:51] p0wn3d: has joined #ruby
[18:44:53] norc: >> Signal.kill(:SEGV, $$)
[18:44:53] xfbs: has joined #ruby
[18:44:54] ruboto: norc # => undefined method `kill' for Signal:Module (NoMethodError) ...check link for more (https://eval.in/480046)
[18:44:58] norc: >> Process.kill(:SEGV, $$)
[18:44:59] ruboto: norc # => (https://eval.in/480047)
[18:45:08] sucks: has joined #ruby
[18:45:17] Ox0dea: norc: Couldn't say. :/
[18:45:30] norc: >> require 'fiddle'; Fiddle::Pointer.new(1)[0]
[18:45:31] ruboto: norc # => /tmp/execpad-36d2418e1cce/source-36d2418e1cce:2: [BUG] Segmentation fault at 0x000001 ...check link for more (https://eval.in/480048)
[18:45:37] testBot_1234_932: has joined #ruby
[18:45:40] norc: Just to show that it does have a handler somewhere.
[18:45:50] jbrhbr: has joined #ruby
[18:46:09] Ox0dea: Because I've never seen an eval.in segfault? :P
[18:46:27] Ox0dea: I suppose it might be to do with however Charlie is sandboxing the execution.
[18:46:30] norc: Looking at my initial reason for asking you... :D
[18:46:41] waynerade: has joined #ruby
[18:46:57] jpfuentes2: has joined #ruby
[18:47:16] Ox0dea: But really, sending SIGSEGV and actually hitting a segfault aren't quite the same operation.
[18:47:17] snockerton: has joined #ruby
[18:47:29] TeresaP: Ox0dea yes one of them has a bunch
[18:47:49] norc: Ox0dea: When you trigger an access violation the kernel just sends a SIGSEGV to the process.
[18:48:21] Ox0dea: TeresaP: And you intend to take shevy's "advice" and write a bunch of explicit accessors?
[18:48:31] goodcodeguy: has joined #ruby
[18:48:42] InvGhostt: has joined #ruby
[18:48:44] lorn: has joined #ruby
[18:48:52] norc: Ox0dea: So I don't see how they are not.
[18:49:04] roshanavand: has joined #ruby
[18:49:17] Ox0dea: norc: What sort of reporting could such a "fake" segfault do?
[18:49:49] toretore: has joined #ruby
[18:49:50] TeresaP: Ox0dea It would be ugly, but I'm considering it.
[18:50:10] norc: Ox0dea: The same as usual. Break execution, show you the current stack trace, registers.
[18:50:13] TeresaP: I suppose I could move the modules out of the class as well
[18:50:16] InvGhosttt: has joined #ruby
[18:50:23] Ox0dea: norc: Aye, but where did the fault occur?
[18:50:32] brunto_: has joined #ruby
[18:50:35] eam: Ox0dea: you can allocate more memory and then re-run the problematic code
[18:50:40] eam: boom fixed it
[18:51:53] norc: Ox0dea: I have no idea. I mean in a regular access violation a cpu interrupt makes this easy.
[18:52:01] smokey: has joined #ruby
[18:52:31] norc: Ox0dea: All I know is that all Ruby implementations I have tried produce the regular Bug/Seg Fault screen when you manually send SIGSEGV
[18:52:37] norc: Except eval.cin
[18:52:37] bot_9474: has joined #ruby
[18:53:12] test_5443: has joined #ruby
[18:53:15] eam: norc: perhaps eval.in masks it
[18:53:23] Mon_Ouie: has joined #ruby
[18:53:25] eam: scratch that, it's not ignorable
[18:53:26] myztic: has joined #ruby
[18:53:29] shanemcd: has joined #ruby
[18:53:41] gaussblurinc1: has joined #ruby
[18:54:47] agent_white: Does segfault raise a "fatal" exception?
[18:54:56] eam: it can be handled
[18:55:05] sandstrom: has joined #ruby
[18:55:14] eam: some memory allocators work by waiting for a segv, then increasing address space
[18:55:15] ascarter: has joined #ruby
[18:55:19] eam: the java JVM does this
[18:55:36] eam: (maybe not exactly like that, but it regularly faults during operation)
[18:55:40] TeresaP: has joined #ruby
[18:56:02] yardenbar: has joined #ruby
[18:56:16] norc: eam: Out of all the signals, why use SEGV for that though?
[18:56:23] dionysus69: has joined #ruby
[18:56:39] eam: because that's the signal you get when you reference outside your address space
[18:56:40] fantazo: has joined #ruby
[18:56:58] testBot_1234_620: has joined #ruby
[18:57:15] eam: norc: imagine for example you have a braindead simple allocator that just uses sbrk() to increase the data segment size
[18:57:18] eam: and a stack machine
[18:57:21] jmonreal: has left #ruby: ()
[18:57:27] craysiii: has joined #ruby
[18:57:39] eam: you just go nuts and when you segv because you went outside the data segment you call sbrk() which makes it bigger, then keep going
[18:58:50] bot_4173: has joined #ruby
[18:59:06] jackjackdripper: has joined #ruby
[18:59:07] nixmaniack: has joined #ruby
[18:59:39] jackjackdripper: has joined #ruby
[19:00:10] test_9182: has joined #ruby
[19:00:37] apeiros: acidrainfall: got your question answered?
[19:00:42] apeiros: TeresaP: got your question answered?
[19:00:52] `based_pdev`: has joined #ruby
[19:01:04] norc: eam: Oh well, I guess it could greatly simplify the allocation process
[19:01:45] testBot_1234_920: has joined #ruby
[19:01:53] shevy: you people got your question answered!!!
[19:01:56] myztic: has joined #ruby
[19:02:44] revengeofbigd: has joined #ruby
[19:03:00] testBot_1234_678: has joined #ruby
[19:03:09] tulak: has joined #ruby
[19:05:05] Zai00: has joined #ruby
[19:05:42] acidrainfall: apeiros: yes thank you, it took ` if ( value =~ /^[\d]+$/ ) || value.is_a?(Integer) || value.is_a?(TrueClass) || value.is_a?(FalseClass) || value.is_a?(Float)`
[19:06:00] acidrainfall: For some reason the regex was still missing some integers, even though they were perfectly formatted. I give up.
[19:06:07] acidrainfall: Trying to debug puppet is just... no.
[19:06:10] apeiros: [\d] is a verbose way to say \d ;-)
[19:06:10] testBot_83753_77: has joined #ruby
[19:06:16] acidrainfall: old habits die hard
[19:06:40] acidrainfall: I'll be damned if I have to do another :%s/// command today
[19:07:08] atomical: has joined #ruby
[19:07:46] testBot_83753: has joined #ruby
[19:10:47] spider-mario: has joined #ruby
[19:11:55] weaksauce: has joined #ruby
[19:12:19] Puppet`: has joined #ruby
[19:12:31] shanemcd: has joined #ruby
[19:12:37] calderonroberto: has joined #ruby
[19:13:14] norc: acidrainfall: You can simply case when for it though.
[19:13:42] acidrainfall: The single if kinda did it
[19:13:47] acidrainfall: It's only two cases
[19:13:53] acidrainfall: If string or if not
[19:14:14] acidrainfall: but like I said, some integer values were being turned into strings by puppet, which was a problem
[19:14:20] norc: >> case "3" when /^[\d]+$/, Integer, TrueClass, FalseClass, Float then true else false end
[19:14:21] ruboto: norc # => true (https://eval.in/480051)
[19:14:42] acidrainfall: What differentiates that from an if?
[19:14:50] norc: acidrainfall: Reads a bit easier when you indent it nicely than a large convoluted if (exp) || (exp) || (exp)
[19:15:02] norc: using is_a? here, and =~ here
[19:15:26] acidrainfall: neat, I'll swap it then
[19:15:30] acidrainfall: you're right it is easier
[19:15:36] rgrmatt: has joined #ruby
[19:15:45] tildes: has joined #ruby
[19:16:28] norc: acidrainfall: https://eval.in/480054
[19:16:54] norc: Also naming it test isn't probably the brightest idea. :-)
[19:19:53] n1x: has joined #ruby
[19:21:45] ankhers: http://lpaste.net/146428 -- normally I would want to call each of these functions lazily. What is the suggested approach in Ruby?
[19:23:01] adaedra: Ankhers: idea you can use: You can use &ri:Object#public_send to call a method dynamically.
[19:23:03] `derpy: Ankhers: method `Object#public_send`: Invokes the method identified by _symbol_, passing it any arguments specified. U??? ??? http://rubydoc.info/stdlib/core/Object#public_send-instance_method
[19:23:04] h99h9h88: has joined #ruby
[19:23:28] ankhers: adaedra, `derpy: Thanks. I will look into that.
[19:24:01] sucks: has joined #ruby
[19:24:14] baweaver: has joined #ruby
[19:24:26] shanemcd: has joined #ruby
[19:26:31] roshanavand: has joined #ruby
[19:26:45] testBot_83753: has joined #ruby
[19:27:02] testBot_83753_25: has joined #ruby
[19:27:07] Xeago: has joined #ruby
[19:27:16] KensoDev: has joined #ruby
[19:27:18] tulak: has joined #ruby
[19:27:55] norc: Seeing how the entire method dispatch uses .send, why do we have Method#call at all?
[19:28:15] sepp2k: has joined #ruby
[19:28:34] adaedra: To have a standard way of calling things
[19:28:53] adaedra: We define a callable object as something that responds to call (hello duck typing)
[19:28:57] juddey: has joined #ruby
[19:29:23] atomical: has joined #ruby
[19:29:49] zeroDivisible: has joined #ruby
[19:30:04] norc: adaedra: That makes sense to me when thinking about JavaScript where functions are first class objects.
[19:30:15] norc: "callable objects" is not something I have heard of in Ruby though.
[19:30:42] norc: Are there parts in the stdlib that invoke obj.call ?
[19:30:43] BlackCoyote: has joined #ruby
[19:30:51] Ishido: has joined #ruby
[19:31:14] norc: Oh wait.
[19:31:17] norc: Damn. Procs. Lambda.
[19:31:41] norc: adaedra: So that basically gives me a unified interface to take a proc, lambda or a method and call it.
[19:31:49] agent_white: >> def is_this_the_krusty_krab?; "No. This is Patrick."; end
[19:31:50] ruboto: agent_white # => :is_this_the_krusty_krab? (https://eval.in/480069)
[19:31:57] adaedra: Procs, lambdas, methods, boundmethods, and everything that has call.
[19:32:13] devoldmx: has joined #ruby
[19:32:23] cmoneylulz: has joined #ruby
[19:32:28] norc: Alright.
[19:32:48] norc: adaedra: And that brings us back to the topic from earlier today (or yesterday?) about .()
[19:32:54] norc: Which now makes sense to me.
[19:33:09] marcosantoniocar: has joined #ruby
[19:33:13] norc: >> proc{ |a| puts a }.(1)
[19:33:14] ruboto: norc # => 1 ...check link for more (https://eval.in/480070)
[19:33:26] norc: That actually looks a ton more beautiful than with #call. :)
[19:33:47] norc: Or just callable.(1)
[19:34:20] Puppet`: has joined #ruby
[19:34:36] apeiros: I don't like it
[19:34:42] adaedra: I just wonder though.
[19:34:45] apeiros: but I didn't like ->{} either, and now I use it
[19:34:59] apeiros: so I guess I'll get used to it.
[19:35:00] testBot_83753: has joined #ruby
[19:35:07] cschneid_: has joined #ruby
[19:35:17] testBot_83753_80: has joined #ruby
[19:35:43] adaedra: >> a = []; def [].call(*); end; def z; yield; end; z &a
[19:35:44] ruboto: adaedra # => /tmp/execpad-6ff5a989b13b/source-6ff5a989b13b:2: syntax error, unexpected '.', expecting ';' or '\n' ...check link for more (https://eval.in/480071)
[19:35:50] testBot_83753: has joined #ruby
[19:35:52] adaedra: what did I do
[19:36:07] testBot_83753_92: has joined #ruby
[19:36:12] adaedra: What is this
[19:36:14] bluOxigen: has joined #ruby
[19:36:53] jessemcgilallen: has joined #ruby
[19:37:30] testBot_83753: has joined #ruby
[19:37:42] calderonroberto: has joined #ruby
[19:37:47] testBot_83753_50: has joined #ruby
[19:38:10] ibouvousaime: has joined #ruby
[19:38:43] adaedra: >> a = []; def a.call(*); end; def z; yield; end; z &a # duh
[19:38:44] ruboto: adaedra # => wrong argument type Array (expected Proc) (TypeError) ...check link for more (https://eval.in/480072)
[19:38:50] pwnd_nsfw: has joined #ruby
[19:38:52] adaedra: ok, that's what I was thinking.
[19:39:53] apeiros: adaedra: you want to_proc, not call
[19:40:37] adaedra: apeiros: no, I did exactly what I wanted. I wanted to see if having #call was sufficient to consider it passable as &arg, but I expected it to be restricted to Procs.
[19:40:37] apeiros: >> a = []; def a.to_proc(*); ->{}; end; def z; yield; end; z &a
[19:40:38] ruboto: apeiros # => nil (https://eval.in/480073)
[19:41:27] adaedra: I guess defining to_proc to `method(:call)` would do the trick to make it work.
[19:41:44] atomical_: has joined #ruby
[19:42:09] apeiros: might, may have to do the .to_proc yourself, though
[19:42:31] shanemcd: has joined #ruby
[19:42:50] dstarh: has joined #ruby
[19:42:57] Dimik: has joined #ruby
[19:42:58] JDiPierro: has joined #ruby
[19:42:58] apeiros: return of the wizards
[19:43:03] adaedra: +b testBot_83753*!*@*$#ruby-fix-your-connection
[19:43:37] maloik: has joined #ruby
[19:43:57] minimalism: has joined #ruby
[19:44:55] grotewold: has joined #ruby
[19:45:38] tvon: has joined #ruby
[19:45:56] bluOxigen: has joined #ruby
[19:46:04] fabrice31: has joined #ruby
[19:46:59] adaedra: -o adaedra
[19:47:48] s00pcan: has joined #ruby
[19:48:52] baweaver: has joined #ruby
[19:49:41] yqt: has joined #ruby
[19:51:59] nettoweb: has joined #ruby
[19:52:36] shanemcd: has joined #ruby
[19:53:01] SolarSailor: has joined #ruby
[19:53:06] TeresaP: apeiros kindof
[19:53:36] TeresaP: basically I need to either create a whole bunch of functions to return strings or pull the modules out of my class
[19:53:49] yardenbar: has joined #ruby
[19:56:09] dionysus69: has joined #ruby
[19:56:59] dionysus69: has joined #ruby
[19:57:21] benlieb_: has joined #ruby
[19:57:32] towski_: has joined #ruby
[19:57:45] ta: has joined #ruby
[19:57:59] gaussblurinc1: has joined #ruby
[20:00:58] atomical: has joined #ruby
[20:01:16] test: has joined #ruby
[20:01:33] solocshaw: has joined #ruby
[20:01:40] Jet4Fire: has joined #ruby
[20:02:41] ur5us: has joined #ruby
[20:03:11] stannard: has joined #ruby
[20:04:38] blarghlarghl: has left #ruby: ()
[20:05:32] yardenbar: has joined #ruby
[20:06:16] roshanavand: has joined #ruby
[20:06:22] duncannz: has joined #ruby
[20:08:03] cjbottaro: has joined #ruby
[20:08:27] othll0: has joined #ruby
[20:09:57] sandstrom: has joined #ruby
[20:10:42] djbkd: has joined #ruby
[20:11:16] p0wn3d: has joined #ruby
[20:11:31] Jet4Fire: has joined #ruby
[20:12:14] testBot: has joined #ruby
[20:12:22] ruid: has joined #ruby
[20:12:23] ruid: has joined #ruby
[20:12:31] ixti: has joined #ruby
[20:12:31] testetset: has joined #ruby
[20:12:33] codecop: has joined #ruby
[20:13:24] testetesteteste: has joined #ruby
[20:13:36] shanemcd: has joined #ruby
[20:15:41] mooe: has joined #ruby
[20:15:46] momomomomo: has joined #ruby
[20:16:24] NeverDie: has joined #ruby
[20:18:12] Jet4Fire: has joined #ruby
[20:18:41] elton: has joined #ruby
[20:18:48] ytti: https://letsencrypt.org/2015/12/03/entering-public-beta.html
[20:20:39] yfeldblum: has joined #ruby
[20:21:27] IrishGringo: has joined #ruby
[20:21:31] Jet4Fire: has joined #ruby
[20:22:14] p0wn3d: has joined #ruby
[20:23:26] djbkd: has joined #ruby
[20:25:30] agit0: has joined #ruby
[20:26:13] duckpuppy: has joined #ruby
[20:27:26] Encapsulation: has joined #ruby
[20:28:57] baweaver: has joined #ruby
[20:32:10] Jet4Fire: has joined #ruby
[20:32:37] Gadgetoid: has joined #ruby
[20:36:34] weemsledeux: has joined #ruby
[20:36:35] VStestat: has joined #ruby
[20:37:07] testetest: has joined #ruby
[20:38:04] blub: hi testetest
[20:38:14] Azulinho: has joined #ruby
[20:38:27] kies: has joined #ruby
[20:39:07] kadoppe: has joined #ruby
[20:39:54] baweaver: has joined #ruby
[20:40:01] al2o3-cr: has joined #ruby
[20:40:48] mary5030_: has joined #ruby
[20:41:36] Jet4Fire: has joined #ruby
[20:42:23] mobson: has joined #ruby
[20:42:45] mobson: why am I getting a negative argument error
[20:42:46] mobson: a= (updist < downdist) ? (('+'*updist)) : (('-'*downdist))
[20:44:47] blub: im guessing either updist or downdist is negative
[20:44:58] blub: why do you have so many brackets
[20:45:15] ruboto: havenwood # => negative argument (ArgumentError) ...check link for more (https://eval.in/480092)
[20:45:31] sdwrage: has joined #ruby
[20:47:36] TeresaP: Well that was dumb. I forgot modules with constants can be accessed with Module::CONSTANT so I don't have to go through making functions to return the strings.
[20:48:23] sucks_: has joined #ruby
[20:48:31] chocho: has joined #ruby
[20:49:08] uri: has joined #ruby
[20:49:47] wsewolod: has joined #ruby
[20:50:09] gusTester: has joined #ruby
[20:51:22] acidrainfall: norc: you'll have to explain what you wrote
[20:51:31] Jet4Fire: has joined #ruby
[20:51:32] acidrainfall: You're defining a function?
[20:51:45] acidrainfall: Interesting... that is way smarter
[20:51:49] acidrainfall: ACTION doesn't think like a programmer :(
[20:51:54] norc: acidrainfall: Just don't name it test. Please. :-P
[20:52:39] tvw: has joined #ruby
[20:55:26] norc: acidrainfall: I'm just using the fact that case compares its object using === knowing that Regexp#=== ends up calling =~ # the whole construct was done to do something exactly like my snippet. Well or maybe with multiple when switches.
[20:56:01] norc: Or let me correct myself it does not end up calling =~ - but it does about the same thing.
[20:56:12] acidrainfall: What's significant about ===?
[20:56:25] weemsledeux: has joined #ruby
[20:56:27] norc: acidrainfall: It is the operator used for case/when :-)
[20:57:11] skade: has joined #ruby
[20:57:12] based_pdev_: has joined #ruby
[20:57:49] norc: acidrainfall: For a Class (like Fixnum) it checks whether the object is a kind of that class. For a Regexp (like /\d/) it tests whether the object matches against that Regexp.
[20:58:02] norc: For symbols/fixnums/strings it tests for equality
[20:58:07] norc: For a range it tests whether its inside
[20:58:16] norc: Basically whatever makes most sense for case/when
[20:58:45] acidrainfall: That's actually really nice
[20:59:14] norc: Generally there never is a reason to call it directly. If you ever see code like Class === object # throw it away.
[20:59:27] luigi: has joined #ruby
[20:59:59] Azulinho: has joined #ruby
[21:00:50] opencard: has joined #ruby
[21:00:53] akem: has joined #ruby
[21:00:54] luigi: I'm writing a C ruby extension, but I'm not sure how garbage collection works
[21:01:17] norc: luigi: mark and sweep.
[21:01:30] nertzy: has joined #ruby
[21:01:44] luigi: I have this snippet of code: VALUE obj = rb_class_new_instance(0, NULL, <class name>);
[21:01:46] Jet4Fire: has joined #ruby
[21:02:46] naftilos76: has joined #ruby
[21:03:10] luigi: if I just keep obj variable in the C side, without assigning it to any Ruby variables, is it gonna be automatically garbage collected?
[21:03:23] luigi: how would I prevent that?
[21:04:30] al2o3-cr: has joined #ruby
[21:04:42] norc: luigi: rb_gc_mark
[21:07:04] luigi: norc: thanks! so obj would be collected only when the ruby program terminates?
[21:07:57] luigi: is there also a way to signal ruby that it's time to collect obj? something like rb_gc_unmark ?
[21:08:07] norc: luigi: Just remember you have to wrap your object with Data_Wrap_Struct
[21:08:11] momomomomo: has joined #ruby
[21:08:51] kies: has joined #ruby
[21:09:13] sankaber: has joined #ruby
[21:09:23] duckpuppy: has joined #ruby
[21:09:29] myztic: has joined #ruby
[21:09:33] luigi: norc: thanks!
[21:09:51] acidrainfall: Say I want to print $key = '$value'
[21:10:03] acidrainfall: would puts "$key = '$value'" not print value because single quotes?
[21:10:08] norc: luigi: http://clalance.blogspot.de/2013/11/writing-ruby-extensions-in-c-part-13.html
[21:10:08] acidrainfall: Or are the single quotes quoted?
[21:10:12] norc: This article might be of interest to you.
[21:10:30] acidrainfall: I guess I should probably just write a test script
[21:10:31] norc: acidrainfall: This is not Perl.
[21:10:41] acidrainfall: hahaha well that's why I was afraid
[21:10:48] acidrainfall: The last language I worked in that was like Ruby was perl a long time ago
[21:10:53] acidrainfall: "long time" being like a couple years
[21:10:56] ankhers: acidrainfall: puts "#{key} = '#{value}'" should be fine.
[21:10:57] acidrainfall: but I'm out of therapy now
[21:11:14] nofxx: has joined #ruby
[21:11:14] nofxx: has joined #ruby
[21:11:20] ItSANgo: has joined #ruby
[21:11:26] norc: acidrainfall: $ as a prefix is a reference to a global variable.
[21:11:27] cdg: has joined #ruby
[21:11:27] ankhers: $ is used in PHP, perl and I'm sure a couple others.
[21:11:38] norc: Ankhers: Ruby too. :-)
[21:11:40] ankhers: Right, I forgot about global vars. I avoid those.
[21:11:46] Jet4Fire: has joined #ruby
[21:11:53] norc: Ankhers: There are some useful ones out there like $LOADED_FEATURES for example
[21:11:58] luigi: norc: great, thanks!
[21:12:13] ankhers: norc: I agree they can be useful. I just don't put everything into a global var.
[21:12:21] norc: Ankhers: Or $$, $!
[21:12:45] acidrainfall: oh interesting
[21:12:52] acidrainfall: Puppet uses $
[21:12:59] acidrainfall: I figured it was a ruby convention
[21:13:15] Pupp3tm4st3r: has joined #ruby
[21:13:20] ankhers: acidrainfall: Only within double quotes though.
[21:13:25] NeverDie: has joined #ruby
[21:13:35] acidrainfall: that much is pretty standard
[21:13:35] ankhers: "#{var}" works, '#{var}' does not.
[21:13:50] aspiers: has joined #ruby
[21:14:05] norc: >> %Q{#{1+1}}
[21:14:06] ruboto: norc # => "2" (https://eval.in/480096)
[21:14:08] norc: This works too. :)
[21:14:19] nixmaniack: has joined #ruby
[21:14:21] acidrainfall: So #{} is what, an evaluate?
[21:14:32] acidrainfall: like $() in bash?
[21:14:33] norc: acidrainfall: No. It is just string interpolation.
[21:14:54] norc: acidrainfall: It is the same as "%s" % (1+1) (which is another form of string interpolation.
[21:15:05] acidrainfall: That's how my friend writes python
[21:15:13] acidrainfall: it's just %s %s %s %s
[21:15:19] acidrainfall: or whatever the python convention is
[21:15:34] acidrainfall: Why do it that way, out of curiosity?
[21:15:35] yardenbar: has joined #ruby
[21:15:42] ankhers: acidrainfall: I've seen people do that in quite a few languages. It becomes really hard to understand what is happening.
[21:16:08] norc: acidrainfall: Generally I follow the guideline that single interpolation is done with #{} - anything more and I use the % syntax.
[21:16:17] norc: (Or when I need formatting)
[21:16:26] acidrainfall: When you say single interpolation
[21:16:34] alakra: has joined #ruby
[21:16:43] norc: You can also to named string interpolation
[21:16:43] acidrainfall: you mean as opposed to ${((1+1)+6)*2} ?
[21:17:07] rgrmatt: has joined #ruby
[21:17:16] norc: >> "Hello %{user} size %{foo}" % {user: "norc", foo: 1}
[21:17:17] ruboto: norc # => "Hello norc size 1" (https://eval.in/480098)
[21:17:26] norc: Not very common, but pretty elegant.
[21:17:51] Xeago: has joined #ruby
[21:18:04] norc: acidrainfall: Nah more like "str #{exp} morestr #{another exp}"
[21:18:12] acidrainfall: So, what I'm doing
[21:18:15] acidrainfall: you'd use %s for
[21:18:21] whippythellama: has joined #ruby
[21:18:25] norc: acidrainfall: think Kernel#sprintf
[21:18:36] acidrainfall: yeah that's what it reminds me of
[21:18:58] acidrainfall: Ruby is quite different from any other language I've scripted in
[21:19:00] acidrainfall: It's fun to learn
[21:20:12] norc: acidrainfall: The important bit is that with String interpolation "#{a}" you are still in the same execution scope around the string
[21:20:17] norc: So something like this is possible>
[21:20:41] norc: >> @foo = "world"; puts "hello #{@foo}"
[21:20:42] ruboto: norc # => hello world ...check link for more (https://eval.in/480099)
[21:20:46] grilled-cheese: has joined #ruby
[21:21:49] Jet4Fire: has joined #ruby
[21:22:11] norc: >> >> arr = [[1],[2,3]]; puts "blah: #{arr.map(&:length) }
[21:22:12] ruboto: norc # => /tmp/execpad-e6b8817800e8/source-e6b8817800e8:2: syntax error, unexpected >> ...check link for more (https://eval.in/480102)
[21:22:13] norc: >> arr = [[1],[2,3]]; puts "blah: #{arr.map(&:length) }
[21:22:14] ruboto: norc # => blah: [1, 2] ...check link for more (https://eval.in/480103)
[21:23:19] myztic: has joined #ruby
[21:23:44] Pupp3tm4st3r: has joined #ruby
[21:26:51] h99h9h88: has joined #ruby
[21:27:13] cpup: has joined #ruby
[21:27:27] bkxd: has joined #ruby
[21:27:35] dlitvak: has joined #ruby
[21:27:43] momomomomo: has joined #ruby
[21:29:13] Encapsulation: has joined #ruby
[21:29:34] tildes: has joined #ruby
[21:30:07] naftilos76: Hi everyone, i am using tcpsocket/server but couldn't find any examples about enabling ssl com. Can anybody help me?
[21:30:26] RobertBirnie: has joined #ruby
[21:31:24] dlitvak: has joined #ruby
[21:31:31] rgtk: has joined #ruby
[21:31:36] norc: naftilos76: http://ruby-doc.org/stdlib-2.2.3/libdoc/openssl/rdoc/OpenSSL/SSL/SSLContext.html
[21:31:37] opencard: has joined #ruby
[21:32:27] norc: http://ruby-doc.org/stdlib-1.9.3/libdoc/openssl/rdoc/OpenSSL/SSL/SSLServer.html
[21:32:28] norc: And that
[21:32:36] devoldmx: has joined #ruby
[21:32:49] SenpaiSilver: has joined #ruby
[21:34:03] h99h9h88: has joined #ruby
[21:34:49] j0bk: has joined #ruby
[21:35:06] diego2: has joined #ruby
[21:36:06] diego2: has joined #ruby
[21:37:35] quaristice: has joined #ruby
[21:38:03] ethe: has joined #ruby
[21:39:11] nhhagen: has joined #ruby
[21:39:12] skweek: has joined #ruby
[21:39:32] Xeago: has joined #ruby
[21:39:54] nhhagen: has joined #ruby
[21:40:38] akem: has joined #ruby
[21:40:59] cmoneylulz: has joined #ruby
[21:43:48] maloik: has joined #ruby
[21:46:09] roshanavand: has joined #ruby
[21:46:57] Azulinho: has joined #ruby
[21:47:57] naftilos76: norc, thanks but i need something more elaborating with examples where i can easily substitute values and strings to match my case. I do not enough experience with ssl internals to know the how-tos
[21:48:55] cashnguns: has joined #ruby
[21:49:07] Xeago: has joined #ruby
[21:50:55] maloik: has joined #ruby
[21:51:03] norc: naftilos76: Have you considered learning it maybe?
[21:51:36] naftilos76: norc, it is very low in my priorities list right now :)
[21:52:06] norc: naftilos76: So your time is more valuable than ours? :-)
[21:52:48] SCHAAP137: has joined #ruby
[21:53:42] roxtrongo: has joined #ruby
[21:54:16] h99h9h88: has joined #ruby
[21:55:07] naftilos76: norc, absolutely not, no offence. It is just that i am struggling on a project that will hopefully help me get a job or even better customers
[21:55:40] norc: naftilos76: The job cannot be that important to you, if learning what you are doing is very low on your priorities.
[21:55:57] maloik_: has joined #ruby
[21:55:59] jpfuentes2: has joined #ruby
[21:56:12] nospam: has joined #ruby
[21:56:26] nospam: is programming while high a good idea?
[21:56:34] norc: nospam: TIAS.
[21:56:42] naftilos76: norc, learning is everything to me but i have to comprimise and prioritise!
[21:57:37] norc: naftilos76: If its crucial to your job, but understanding it very low on your priorities, then you must enjoy your current state.
[21:57:48] nospam: norc: What is a TIAS?
[21:57:57] norc: nospam: Try it and see. ;-)
[21:58:23] nospam: i just did a line of coke behind my manager's back
[21:58:37] norc: Note: You may want to do the review after sobering up before assessing your findings.
[21:58:44] nospam: she turned around when i was snorting and i told her i had to sneeze
[21:58:57] nospam: i'm so high right now
[21:59:11] bigkevmcd: has joined #ruby
[21:59:14] apeiros: ?ot nospam
[21:59:15] ruboto: nospam, this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related topics. Thanks!
[21:59:25] norc: naftilos76: Sorry we don't work for you here. You will have to hire somebody for that.
[22:00:15] norc: I should know, I have buggered apeiros with enough questions that I could have solved myself - now I spend the bulk of my time in the corner - in shame.
[22:00:17] naftilos76: norc, you are being absurd. I ased for a link if handy.
[22:00:39] apeiros: norc: you did? and you do?
[22:00:53] baweaver: naftilos76: we're not here to enable your bad habit
[22:00:55] norc: apeiros: Okay, I may have lied about one part of that sentence.
[22:01:32] naftilos76: baweaver, bad habit? What are you talking about?
[22:01:34] grotewold: has joined #ruby
[22:01:41] momomomomo: has joined #ruby
[22:01:52] norc: naftilos76: You are asking us to spoonfeed you with the resources to just replace your values because its crucial for your job.
[22:02:42] grilled-cheese: Can you write a class which contains another class?
[22:02:47] norc: grilled-cheese: Yes.
[22:03:09] ismaelga: has joined #ruby
[22:03:17] norc: >> class Foo; class Bar; end; end; Foo::Bar.new
[22:03:18] ruboto: norc # => #<Foo::Bar:0x407a3f74> (https://eval.in/480110)
[22:03:18] grilled-cheese: so you can have a fancy container class which contains a validating member class
[22:03:24] norc: grilled-cheese: ^=
[22:03:36] baweaver: normally the container is a module
[22:03:40] norc: grilled-cheese: If you say "container class" you probably want a module.
[22:04:35] grilled-cheese: I basically need a container class to hold an array of a class and to perform some aggregating functions on it, or return specific items as needed
[22:05:13] ruboto: it seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
[22:05:35] nhhagen: has joined #ruby
[22:05:43] hxegon: has joined #ruby
[22:05:57] kappy: has joined #ruby
[22:06:10] baweaver: This seems like a problem of interfaces more than anything, and a class with an array of classes sounds hacky
[22:07:11] baweaver: better solution is to have a common interface in a module (let's call it Actionable) that you put in each class that has an action method it adds
[22:07:26] tomchapin: has joined #ruby
[22:07:43] baweaver: Then just put the objects into an array and use Enumerable methods on them
[22:08:33] jbrhbr: has joined #ruby
[22:09:10] grilled-cheese: not sure I follow
[22:09:25] douglass1: has left #ruby: ()
[22:09:30] douglass1: has joined #ruby
[22:09:34] maikowblue: has joined #ruby
[22:09:45] norc: grilled-cheese: Present your full problem/code in a gist.
[22:10:02] norc: >> Pair = Struct.new(:l, :r) { def self.[](a, b); self.new(a, b); end }; puts Pair[1, 2]
[22:10:03] ruboto: norc # => #<struct Pair l=1, r=2> ...check link for more (https://eval.in/480117)
[22:10:22] ruboto: +q nospam!*@*
[22:10:22] ruboto: -o ruboto
[22:10:26] norc: Struct really is one of the best things in Ruby I think.
[22:10:29] norc: Just downright neat.
[22:10:53] theery: has joined #ruby
[22:11:32] cmoneylulz: has joined #ruby
[22:14:09] lukeasrodgers: norc that's cool, didn't know you could define methods in a block passed to Struct.new
[22:14:29] crdpink: has joined #ruby
[22:15:19] norc: lukeasrodgers: Indeed. Together with OpenStruct you suddenly get to reduce some boiler plate code of initializer and accessor methods. :)
[22:15:44] naftilos76: norc, baweaver : just found a spoonfeeder at : http://docs.ruby-lang.org/en/2.2.0/OpenSSL.html . Thought you might be interested.
[22:16:11] norc: naftilos76: Thanks. It's there to be found. :)
[22:17:20] nettoweb: has joined #ruby
[22:18:33] Glenny: has joined #ruby
[22:19:57] douglass1: has left #ruby: ()
[22:21:40] dlitvak: has joined #ruby
[22:22:52] icedp: has joined #ruby
[22:25:08] chouhoulis: has joined #ruby
[22:25:35] ltp: has joined #ruby
[22:25:56] crdpink2: has joined #ruby
[22:26:43] sdwrage: has joined #ruby
[22:27:08] __fps__: has joined #ruby
[22:27:15] benlieb: has joined #ruby
[22:29:01] __fps__: hello friends, is there a tutorial to convert the c++ binding for python to ruby?
[22:29:41] baweaver: has joined #ruby
[22:29:49] skade: has joined #ruby
[22:29:56] acidrainfall: norc: what does struct do exactly?
[22:29:57] axl_: has joined #ruby
[22:30:54] chouhoulis: has joined #ruby
[22:32:17] Xeago: has joined #ruby
[22:32:26] crdpink: has joined #ruby
[22:32:54] InvGhosttt: has joined #ruby
[22:33:42] bkxd: has joined #ruby
[22:34:18] lukeasrodgers: __fps__ which python c++ binding are you talking about?
[22:34:26] shanemcd: has joined #ruby
[22:34:30] ascarter: has joined #ruby
[22:35:48] yfeldblum: has joined #ruby
[22:35:49] amclain: has joined #ruby
[22:36:38] __fps__: lukeasrodgers: there is a framework called 'Bond' which provide data transfer prototocols. Like 'Protocol Buffers'. They support C++, Python and C# at the moment. I wanted to contribute there for Ruby implementation so we have one more choice in Rails community. :)
[22:36:45] __fps__: here is the code: https://github.com/Microsoft/bond/tree/f800503/python/inc/bond/python
[22:36:58] acidrainfall: norc: still around?
[22:37:05] acidrainfall: norc: sorry I got pulled into meetings
[22:37:36] s2013: has joined #ruby
[22:38:04] allcentury: has joined #ruby
[22:39:19] howdoicomputer: has joined #ruby
[22:39:44] lacuna: has joined #ruby
[22:39:44] lacuna: has joined #ruby
[22:40:19] crdpink: has joined #ruby
[22:40:42] acidrainfall: norc: if you are, this is what I wrote http://fpaste.org/297225/49182206/
[22:40:51] nhhagen: has joined #ruby
[22:41:30] lukeasrodgers: __fps__ i don't know too much about ruby calling other languages, but afaik ruby can generally interface with c-like language through either ffi or fiddle. i don't know c++ but it looks like that bond code is (among other things) just defining method names/signatures that python can call via a dylib or something? if so, a very similar approach would probably work for ruby.
[22:41:57] lukeasrodgers: there's not a lot of tutorials out there on this, though, afaik
[22:42:04] acidrainfall: haha and it... did *not* work
[22:42:23] lukeasrodgers: i have some code that might be informative here: https://github.com/lukeasrodgers/ruby-fortran-ffi-poc
[22:42:32] lukeasrodgers: calling fortran from ruby
[22:42:49] lukeasrodgers: that all uses ffi. i'm also working on doing the same with fiddle
[22:44:16] norc: acidrainfall: Absolutely. You are printing the value to STDOUT.
[22:44:35] momomomomo: has joined #ruby
[22:44:36] __fps__: lukearodgers: thanks alot! I didn't knew about ffi and fiddle stuff. Are they two different calling conventions at ABI level to other languages?
[22:45:02] acidrainfall: norc: oh damn
[22:45:10] norc: __fps__: fiddle is the builtin libffi wrapper
[22:45:55] jbrhbr: suppose i have `d = {}`. is there a shortcut like d.field_with_default(:foo).push(3) that would result in `d[:foo] = [3]` in the case where that key was nil at the start?
[22:46:01] wprice: has joined #ruby
[22:46:46] crdpink2: has joined #ruby
[22:46:46] norc: jbrhbr: Yes. Use ||=
[22:47:16] norc: >> a ||= 1;
[22:47:17] ruboto: norc # => 1 (https://eval.in/480120)
[22:47:31] lukeasrodgers: __fps__: what norc said. ffi is a gem. you may have more luck with ffi ??? afaict it has much greater adoption by other libraries, you will probably have an easier time figuring out how to use it. also it seems to have slightly better ergonomics, and also better documentation
[22:47:34] jbrhbr: that doesn't really do the trick
[22:47:38] ascarter: has joined #ruby
[22:47:52] jbrhbr: since if i run the same code again, it would override the assignment of the array with the next push
[22:48:11] jbrhbr: i want "push with default of [] if the key doesn't exist"
[22:48:25] jbrhbr: not necessary of course :)
[22:48:43] __fps__: norc: thanks. What I envisioned was that ruby might have way to interact with C++ library as Python, so I may get those few .h files for `c++ to python` contract to form a c++ to ruby contract and be a happy rails camper by the end of the day. But seems like a steeper learning curve. :)
[22:48:51] diego2: has joined #ruby
[22:49:09] norc: >> a = { k: 1 }; a[:k] ||= 2; p a
[22:49:11] ruboto: norc # => {:k=>1} ...check link for more (https://eval.in/480123)
[22:49:30] norc: Well it would override nil/false obviously.
[22:49:32] __fps__: lukeasrodgers: i will dig into ffi and thanks for the link to your repo. I will try to do some analogous coding and find a shortcut to cut a PR. otherwise count on someone else :D
[22:49:43] jbrhbr: norc: i wanted the result there to be [1, 2]
[22:49:52] jbrhbr: ie push with a default, not "set if not set"
[22:50:00] norc: jbrhbr: You can define a default value for a Hash.
[22:50:12] jbrhbr: ok i'll stop pestering you
[22:50:14] jbrhbr: that doesn't really fit it either
[22:50:19] jbrhbr: thanks though!
[22:50:35] lukeasrodgers: __fps__ i may be misunderstanding you but: you probably don't want to open a PR on my repo. it's just for my own experiemtnation, basically
[22:50:54] norc: jbrhbr: There is Hash#fetch which does exactly what you want.
[22:51:04] norc: Third one puts the nail in the coffin. :)
[22:51:06] gusTester: has left #ruby: ()
[22:51:19] norc: >> {}.fetch(:foo, 1)
[22:51:20] ruboto: norc # => 1 (https://eval.in/480126)
[22:51:25] adaedra: >> a = Hash.new { |k| 3 }; a[:z] ||= 2; a
[22:51:26] ruboto: adaedra # => {} (https://eval.in/480127)
[22:51:41] aelevadoan: has joined #ruby
[22:51:45] __fps__: lukeasrodgers: nono, i was talking about pr to provide subsitute implementation for ruby against this python binding -> https://github.com/Microsoft/bond/tree/f800503/python/inc/bond/python
[22:51:57] __fps__: (for Bond repo I mean)
[22:52:01] jbrhbr: heh nice, thanks!
[22:52:22] aelevadoan: im trying to install a version of ruby in rbenv but i dont have enough space in /tmp
[22:52:25] lkba: has joined #ruby
[22:52:32] aelevadoan: can i define another dir?
[22:52:52] norc: aelevadoan: rbenv does not care where it resides.
[22:53:44] aelevadoan: norc: when I do 'rbenv install 2.2.3' it generates the file in /tmp
[22:53:52] havenwood: aelevadoan: It looks like you can set the: TMPDIR="/arbitrary/location"
[22:54:00] aelevadoan: havenwood: where?
[22:54:07] havenwood: aelevadoan: ENV var.
[22:54:30] aelevadoan: in .bash_profile, havenwood?
[22:54:39] dlitvak: has joined #ruby
[22:54:40] havenwood: aelevadoan: Just in your terminal before you run the command.
[22:54:51] havenwood: aelevadoan: Or yeah, in your dotfiles if you want it to persist.
[22:54:58] Yzguy: has joined #ruby
[22:55:03] norc: aelevadoan: Just set TMPDIR before running that, which will cause ruby-build to use a different directory for its tmp files.
[22:55:10] dlitvak: has joined #ruby
[22:55:16] aelevadoan: norc: havenwood: thanks
[22:55:39] norc: havenwood: Oh I completely skipped that line.
[22:58:23] h99h9h88: has joined #ruby
[23:00:02] djbkd: has joined #ruby
[23:01:01] s2013: has joined #ruby
[23:02:13] linduxed: has joined #ruby
[23:02:50] duckpuppy: has joined #ruby
[23:03:40] tomchapin: has joined #ruby
[23:04:30] linduxed: has joined #ruby
[23:05:18] Vitor: has joined #ruby
[23:05:59] aelevadoan: norc: havenwood: I put "TMPDIR="/~/TMP" in ~/.bash_profile and it still downloads in /tmp
[23:06:14] norc: aelevadoan: Sigh...
[23:06:39] norc: TMPDIR=/wherever rbenv install 2.2.3
[23:06:48] norc: Just throw that into bash and watch it succeed. :)
[23:07:54] linduxed: has joined #ruby
[23:08:05] Amnez777: has joined #ruby
[23:10:44] jessemcgilallen: has joined #ruby
[23:11:38] linduxed: has joined #ruby
[23:12:04] Keltia: has joined #ruby
[23:13:18] colegatron: has joined #ruby
[23:15:34] mobson: Can I use combination on array without the argument. I want something like a=[1, 2, 3,4] to become [1, 2],[1, 3],[1, 4],[2,3],[2,4],[3,4],[1, 2, 3],[1,2,4],[1,3,4]..and so on
[23:16:45] adaedra: There's ri:Array#combination, but you'll have to work a bit on it for variable size
[23:17:09] adaedra: Mh, bot crashed?
[23:17:28] nertzy: has joined #ruby
[23:17:47] adaedra: &ri Array#combinations
[23:18:31] rgrmatt: has joined #ruby
[23:18:56] adaedra: So it's without s anyway
[23:21:35] gizmore: has joined #ruby
[23:21:39] adaedra: >> a = [1, 2, 3, 4]; (2..a.count).flat_map { |n| a.combination(n).to_a }
[23:21:40] ruboto: adaedra # => [[1, 2], [1, 3], [1, 4], [2, 3], [2, 4], [3, 4], [1, 2, 3], [1, 2, 4], [1, 3, 4], [2, 3, 4], [1, 2, ...check link for more (https://eval.in/480133)
[23:22:03] kies: has joined #ruby
[23:22:33] shanemcd: has joined #ruby
[23:22:56] mobson: cool, thank you
[23:23:43] vdamewood: has joined #ruby
[23:27:23] akem: has joined #ruby
[23:27:28] TomPeed: has joined #ruby
[23:29:59] s00pcan: has joined #ruby
[23:30:30] MTeck: has left #ruby: ()
[23:31:58] ruid: has joined #ruby
[23:31:59] ruid: has joined #ruby
[23:33:24] devoldmx: has joined #ruby
[23:36:15] axl_: has left #ruby: ()
[23:41:48] dmcp: has joined #ruby
[23:43:20] shanemcd: has joined #ruby
[23:45:42] weemsledeux: has joined #ruby
[23:45:50] duncannz: has joined #ruby
[23:46:23] crazydiamond: has joined #ruby
[23:46:59] duncannz: has joined #ruby
[23:48:44] hahuang61: has joined #ruby
[23:49:13] nateberkopec: has joined #ruby
[23:50:08] momomomomo: has joined #ruby
[23:50:23] dkam: has joined #ruby
[23:52:11] howdoicomputer: has joined #ruby
[23:52:56] bronson: has joined #ruby
[23:54:31] colegatron: has joined #ruby
[23:55:27] cmoneylulz: has joined #ruby
[23:55:49] duckpuppy: has joined #ruby
[23:57:30] alindeman: has joined #ruby
[23:59:08] h99h9h88: has joined #ruby