« Back to channel list

#ruby - 21 July 2015

« Back 1 day Forward 1 day »
[00:55:21] helpa: has joined #ruby
[00:55:35] helpa: has joined #ruby
[00:56:24] Muhannad: has joined #ruby
[00:56:46] linuxboytoo: has joined #ruby
[00:56:53] jbwiv: has joined #ruby
[00:57:31] hololeap: has joined #ruby
[00:58:20] chipotle: has joined #ruby
[00:58:46] aaeron: @Ox0dea: Shoot. I totally missed it. Thanks a lot for pointing out.
[00:58:51] aaeron: Running again
[00:58:54] aaeron: Will update
[00:58:59] Ox0dea: Standing by.
[00:59:02] Muhannad: has joined #ruby
[01:01:39] aaeron: I think it works. But this time the json object failed
[01:01:52] aaeron: I think u solved the jar issue for me.
[01:01:59] aaeron: Thanks Ox0dea
[01:02:20] aaeron: I'll update once the full request is posted
[01:02:22] Muhannad: has joined #ruby
[01:02:38] mikenovikov: has joined #ruby
[01:03:01] casadei_: has joined #ruby
[01:06:11] Muhannad: has joined #ruby
[01:06:30] Thomas-0725: has joined #ruby
[01:07:24] hatzopoulos: has joined #ruby
[01:08:35] shazaum: has joined #ruby
[01:09:49] user1138: has joined #ruby
[01:10:27] gwendall: has joined #ruby
[01:12:11] Musashi007: has joined #ruby
[01:14:38] Scripore: has joined #ruby
[01:18:11] tmtwd: has joined #ruby
[01:19:36] cassioscabral: has joined #ruby
[01:21:02] dgutierrez1287: has joined #ruby
[01:24:10] Thomas-0725: has joined #ruby
[01:26:04] Lucky_: has joined #ruby
[01:26:47] avahey: has joined #ruby
[01:27:43] lannonbr: has joined #ruby
[01:29:23] DEA7TH: has joined #ruby
[01:30:12] Channel6: has joined #ruby
[01:30:18] freerobby: has joined #ruby
[01:31:10] Soda: has joined #ruby
[01:32:02] michael_mbp: has joined #ruby
[01:33:26] imkj: has joined #ruby
[01:34:27] pengin: has joined #ruby
[01:35:23] Ox0dea: aaeron: Happy to help. :)
[01:36:21] aaeron: @Ox0dea: U have easily saved several hours for me.
[01:36:41] annihilannic: has left #ruby: ()
[01:36:42] aaeron: I am not done yet though. Have to donwload the jar file from some location before I post it
[01:39:35] Musashi007: has joined #ruby
[01:40:46] jaycee: has joined #ruby
[01:42:26] davedev24: has joined #ruby
[01:42:41] tkuchiki: has joined #ruby
[01:42:52] choke: has joined #ruby
[01:43:28] user1138_: has joined #ruby
[01:44:12] GitGud: has joined #ruby
[01:44:42] GitGud: has joined #ruby
[01:44:50] pico-pete: has joined #ruby
[01:45:20] j4cknewt: has joined #ruby
[01:46:13] sharpmachine: has joined #ruby
[01:49:02] Lucky_: has joined #ruby
[01:50:28] qiukun: has joined #ruby
[01:51:17] code1o6: has joined #ruby
[01:51:32] fumihiro: has joined #ruby
[01:51:34] GitGud: has left #ruby: ("Leaving")
[01:52:51] [H]unt3r: has joined #ruby
[01:52:58] Stratege___: has joined #ruby
[01:54:09] fgo: has joined #ruby
[01:54:37] Oog: has joined #ruby
[01:54:38] pico-pete: has joined #ruby
[01:57:34] linuxboytoo: has joined #ruby
[02:01:46] Musashi007: has joined #ruby
[02:05:04] Vile`: has joined #ruby
[02:06:31] eggoez: has joined #ruby
[02:10:37] benlovell: has joined #ruby
[02:15:29] mleung: has joined #ruby
[02:17:04] Spami: has joined #ruby
[02:17:40] Oog: has joined #ruby
[02:19:26] hololeap: has joined #ruby
[02:20:32] chipotle: has joined #ruby
[02:21:17] dopie: has joined #ruby
[02:23:16] pullphinger: has joined #ruby
[02:24:10] avitzurel: has joined #ruby
[02:26:16] benlovell: has joined #ruby
[02:26:47] balazs_: has joined #ruby
[02:27:45] blkperl: has left #ruby: ()
[02:28:11] Mendenhall: has joined #ruby
[02:28:26] mistermocha: has joined #ruby
[02:29:14] mistermocha: has joined #ruby
[02:29:51] workmad3: has joined #ruby
[02:32:29] charliesome: has joined #ruby
[02:32:34] xcesariox: has joined #ruby
[02:32:44] hahuang65: has joined #ruby
[02:33:00] avitzurel: has joined #ruby
[02:34:46] dented42: has joined #ruby
[02:35:01] dfockler: has joined #ruby
[02:35:01] Xiti: has joined #ruby
[02:36:01] dopie: has joined #ruby
[02:36:14] bronson: has joined #ruby
[02:36:35] willharrison: has joined #ruby
[02:37:41] mistermo_: has joined #ruby
[02:39:06] aaeron: has joined #ruby
[02:40:09] aaeron: Ox0dea: Done. Thanks a lot for your help
[02:40:59] aaeron: used open-uri for download a jar
[02:42:00] jackjackdripper: has joined #ruby
[02:42:52] allomov: has joined #ruby
[02:43:42] Ox0dea: aaeron: My pleasure. open-uri is definitely one way to do it.
[02:44:04] aaeron: thanks :)
[02:44:07] michaeldeol: has joined #ruby
[02:44:14] gix-: has joined #ruby
[02:44:26] Ox0dea: aaeron: I trust you're not downloading from and uploading to the same server, right?
[02:44:44] aaeron: thanks for checking
[02:44:46] Ox0dea: Okay. Otherwise it'd probably make more sense to reuse the connection.
[02:45:23] mistermocha: has joined #ruby
[02:47:19] dimasg: has joined #ruby
[02:48:09] rcvalle: has joined #ruby
[02:49:09] sharpmachine: has joined #ruby
[02:49:10] Lucky_: has joined #ruby
[02:51:04] mistermocha: has joined #ruby
[02:56:04] baweaver: has joined #ruby
[02:56:26] swgillespie: has joined #ruby
[02:58:20] linuxboytoo: has joined #ruby
[02:59:44] miwood: has joined #ruby
[03:01:26] uris: has joined #ruby
[03:02:21] desigx: has joined #ruby
[03:03:22] _blizzy_: has joined #ruby
[03:05:24] bronson: has joined #ruby
[03:09:03] linuxboytoo: has joined #ruby
[03:09:49] braincrash: has joined #ruby
[03:11:29] _blizzy_: has joined #ruby
[03:12:35] fromthedepths1: has left #ruby: ()
[03:15:16] uris: has joined #ruby
[03:23:45] htmldrum: has joined #ruby
[03:25:49] lkba: has joined #ruby
[03:28:10] RobertBirnie: has joined #ruby
[03:28:43] dwithers: has joined #ruby
[03:29:14] RobertBirnie: has joined #ruby
[03:29:56] crdpink: has joined #ruby
[03:30:21] dwithers1: has joined #ruby
[03:30:36] Eminence_: has joined #ruby
[03:32:58] charliesome: has joined #ruby
[03:33:01] rhm50_: has joined #ruby
[03:33:09] cassioscabral: has joined #ruby
[03:34:48] jpfuentes2: has joined #ruby
[03:35:13] finisherr: has joined #ruby
[03:37:36] duncannz: has joined #ruby
[03:38:01] MatrixBridge: has joined #ruby
[03:38:29] finisherr: has joined #ruby
[03:41:26] devbug: has joined #ruby
[03:42:04] devbug: has joined #ruby
[03:42:39] eggoez: has joined #ruby
[03:42:59] RobertBirnie: has joined #ruby
[03:44:59] ecksit: has joined #ruby
[03:47:30] qiukun_: has joined #ruby
[03:48:00] dgutierrez1287: has joined #ruby
[03:48:37] jbw: has joined #ruby
[03:52:22] cats: has joined #ruby
[03:53:00] gix: has joined #ruby
[03:54:06] tsou: has joined #ruby
[03:56:34] ohaibbq: has joined #ruby
[03:57:05] CloCkWeRX: has joined #ruby
[04:01:26] kp666: has joined #ruby
[04:01:56] kp666: has joined #ruby
[04:02:02] xxneolithicxx: anyone know any good websites for technical conference listings?
[04:02:09] Oog: has joined #ruby
[04:02:28] Igorshp_: has joined #ruby
[04:02:52] tjbiddle: has joined #ruby
[04:03:03] dented42: has joined #ruby
[04:03:08] fgo: has joined #ruby
[04:07:51] uri__: has joined #ruby
[04:08:53] pwnz0r: has joined #ruby
[04:12:05] christiandsg: has joined #ruby
[04:13:45] yfeldblum: has joined #ruby
[04:18:45] workmad3: has joined #ruby
[04:18:50] finisherr: has joined #ruby
[04:19:07] arescorpio: has joined #ruby
[04:20:33] pengin: has joined #ruby
[04:22:18] sevenseacat: has joined #ruby
[04:26:43] Ox0dea: has joined #ruby
[04:26:54] Ox0dea: xxneolithicxx: Are you trying to learn Ruby by absorbing talks?
[04:26:54] revath: has joined #ruby
[04:27:59] xxneolithicxx: lol Ox0dea ... I dont think it works that way
[04:28:11] Ox0dea: You're right, it doesn't.
[04:28:24] Ox0dea: Were you looking to find a conference at which to speak, then
[04:28:44] Ox0dea: But not Ruby-centric?
[04:28:51] xxneolithicxx: no not specifically
[04:29:01] xxneolithicxx: anything dev/devops
[04:29:21] Ox0dea: xxneolithicxx: lanyrd.com would probably be a very good place to start.
[04:30:07] Ox0dea: This page (http://www.techmeme.com/events) also looks to be reasonably comprehensive.
[04:30:14] RobertBirnie: has joined #ruby
[04:30:24] Ox0dea: Go to DEFCON. :)
[04:30:39] aaeron: has joined #ruby
[04:32:28] xxneolithicxx: :-) see, this is why I ask you guys. That site is gold, ty.
[04:32:48] baweaver: has joined #ruby
[04:32:52] astrobunny: has joined #ruby
[04:33:12] xxneolithicxx: id need to get a faraday cell phone/laptop bag first before i consider going
[04:34:32] Ox0dea: xxneolithicxx: Where's the fun in that? :P
[04:34:38] zacstewart: has joined #ruby
[04:34:51] Ox0dea: DEFCON is for testing your setup. ^_^
[04:35:43] user1138: has joined #ruby
[04:35:47] xxneolithicxx: luckily i already have a protective wallet for my cards so im good there. id be more worried about my cell phone than my laptop.
[04:37:02] Scripore: has joined #ruby
[04:37:40] benlovell: has joined #ruby
[04:37:50] peter_paule: has joined #ruby
[04:38:31] swgillespie: has joined #ruby
[04:42:21] kies^: has joined #ruby
[04:42:35] gwendall: has joined #ruby
[04:43:05] Aeyrix: Taking any device into DEFCON is an idiot move.
[04:43:25] aaeron1: has joined #ruby
[04:43:30] Aeyrix: Take a pencil and a notepad.
[04:43:35] toretore: what if they hack ur brain
[04:43:58] Aeyrix: You're fukt anyway.
[04:45:17] bnagy: defcon mystique amuses me
[04:46:21] hahuang65: has joined #ruby
[04:46:31] Ox0dea: bnagy: When did you last attend?
[04:46:54] bnagy: not sure.
[04:47:30] bnagy: 2010, apparently
[04:47:58] Ox0dea: Did you bring any of your daily drivers?
[04:49:31] fumihiro: has joined #ruby
[04:49:46] Musashi007: has joined #ruby
[04:49:55] bnagy: wow.. I have been vegas free for 5 years? \o/
[04:50:33] bnagy: I think I went every year from 04 :/
[04:52:04] duderonomy: has joined #ruby
[04:52:05] Aeyrix: I refrain from attending.
[04:52:33] bnagy: the numbers now are just nuts
[04:52:52] bnagy: even last year I went it was claustrophobic as hell
[04:53:30] xxneolithicxx: err, claustrophobic geeks = no bueno
[04:53:51] bnagy: too many scene people and not enough actual hackers
[04:57:47] jenrzzz: has joined #ruby
[04:59:45] darkf: has joined #ruby
[05:00:44] casadei_: has joined #ruby
[05:01:13] gwendall: has joined #ruby
[05:02:26] gwendall: has joined #ruby
[05:05:42] fabrice31: has joined #ruby
[05:05:52] doctorly: has joined #ruby
[05:06:08] poguez_: has joined #ruby
[05:06:36] enders: has joined #ruby
[05:08:39] martinium: has joined #ruby
[05:08:54] Musashi007: has joined #ruby
[05:09:13] lxsameer: has joined #ruby
[05:09:13] lxsameer: has joined #ruby
[05:09:41] ChasedSpade: has joined #ruby
[05:10:33] michael_mbp: has joined #ruby
[05:10:57] martinium: has joined #ruby
[05:13:33] sp1rs: has joined #ruby
[05:13:40] martinium: has joined #ruby
[05:13:40] martinium: has joined #ruby
[05:13:55] astrobunny: has joined #ruby
[05:15:41] hisso: has joined #ruby
[05:23:06] sevenseacat: has joined #ruby
[05:24:45] jenrzzz: has joined #ruby
[05:24:54] cornerma1: has joined #ruby
[05:29:23] aganov: has joined #ruby
[05:30:29] riotjones: has joined #ruby
[05:31:27] senayar: has joined #ruby
[05:31:27] senayar: has joined #ruby
[05:32:20] roolo: has joined #ruby
[05:33:44] Violentr: has joined #ruby
[05:33:51] finisherr: has joined #ruby
[05:35:41] desigx: has joined #ruby
[05:36:11] tagrudev: has joined #ruby
[05:38:08] Mendenhall: has joined #ruby
[05:38:16] Ox0dea: >> class Integer; include Enumerable; def each; bit_length.times { |i| yield self[i] } end end; 0x0dea.each_slice(4).to_a
[05:38:17] ruboto: Ox0dea # => [[0, 1, 0, 1], [0, 1, 1, 1], [1, 0, 1, 1]] (https://eval.in/401955)
[05:38:55] Ox0dea: Would making Integers enumerable be a breaking change?
[05:39:02] zacstewart: has joined #ruby
[05:39:27] cassioscabral: has joined #ruby
[05:40:28] jbw_: has joined #ruby
[05:41:31] arooni-mobile: has joined #ruby
[05:41:48] dhjondoh: has joined #ruby
[05:42:29] Rubie: has joined #ruby
[05:44:16] ulises: has joined #ruby
[05:46:44] railsraider: has joined #ruby
[05:48:25] CloCkWeRX: has joined #ruby
[05:50:14] lokulin: has joined #ruby
[05:50:28] railsraider_: has joined #ruby
[05:50:45] rickmasta: has joined #ruby
[05:53:01] dseitz: has joined #ruby
[05:55:03] last_staff: has joined #ruby
[05:55:15] rht: has joined #ruby
[05:55:32] fgo: has joined #ruby
[05:55:55] certainty: bah it's raining like hell here
[05:56:03] zenspider: I'm jealous
[05:56:31] NightMonkey: has joined #ruby
[05:56:42] Muhannad: has joined #ruby
[05:58:02] ScriptGeek: has joined #ruby
[05:59:14] Muhannad: has joined #ruby
[05:59:32] ScriptGeek: Is there any way to create a string that references variables that can change at any moment while not having to reinterpolate the string into a static object?
[06:01:45] zenspider: this sounds like a bad idea...
[06:01:54] Ox0dea: ScriptGeek: Sounds like you want a closure.
[06:02:02] zenspider: but, wrap it in a lambda and call that everytime you want the string
[06:02:16] Ox0dea: zenspider: Not in Seattle at the moment, then?
[06:02:27] zenspider: I'm totally in Seattle
[06:02:37] zenspider: looking at it right now
[06:02:40] Ox0dea: Ah, couple hours till the rain, then.
[06:02:50] Muhannad: has joined #ruby
[06:02:54] gwendall: has joined #ruby
[06:03:05] zenspider: I'll believe it when I see it. but most likely it's just gonna make tomorrow muggy
[06:03:06] ScriptGeek: I've used lambdas before, but not sure how to use it in this instance
[06:03:22] zenspider: y = lambda { "my #{x} string" }
[06:03:41] Ox0dea: ->/[] or lambda/call; don't cross the streams.
[06:03:42] Musashi007: has joined #ruby
[06:03:49] zenspider: >> x = 42; y = lambda { "my #{x} string" }; p y[]; x = 24; p y[]
[06:03:50] ruboto: zenspider # => "my 42 string" ...check link for more (https://eval.in/401969)
[06:04:09] Ox0dea: You seem to support this "bad idea".
[06:04:25] zenspider: I'm currently working in scheme. everything is wrapped in a lambda
[06:05:12] dgutierrez1287: has joined #ruby
[06:05:25] ScriptGeek: Taking all perspectives into consideration, I'm sure my code is nothing but one giant bad idea, line by line.
[06:05:42] Ox0dea: How does one go about taking all perspectives into consideration?
[06:05:45] Oog: has joined #ruby
[06:06:00] ScriptGeek: By never getting a damned thing accomplished. lol
[06:06:33] Muhannad: has joined #ruby
[06:07:05] ScriptGeek: So, I wrote a console menu system, for the command line console, in ruby.
[06:07:27] workmad3: has joined #ruby
[06:07:27] Ox0dea: Using io/console?
[06:07:37] ScriptGeek: It's most certainly another wheel invention
[06:07:43] zenspider: getting kicked out of my cafe...
[06:07:46] ScriptGeek: But I made it for a project
[06:08:04] Ox0dea: >> class Integer; include Enumerable; def each; bit_length.times { |i| yield self[i] } end end; 0xcafe.each_slice(4).to_a
[06:08:05] ruboto: Ox0dea # => [[0, 1, 1, 1], [1, 1, 1, 1], [0, 1, 0, 1], [0, 0, 1, 1]] (https://eval.in/401970)
[06:08:15] ScriptGeek: Ox0dea: yeah, I used io/console
[06:08:20] Ox0dea: ScriptGeek: And TTY?
[06:08:46] Ox0dea: Ah, never mind; you mentioned you're reinventing a wheel.
[06:09:08] revath: has joined #ruby
[06:09:20] ScriptGeek: Ox0dea: yeah, it's a command line application, no internetworking
[06:09:36] sinkensabe: has joined #ruby
[06:09:37] Ox0dea: TTY is a TUI toolkit.
[06:09:53] ScriptGeek: nope, I wrote everything
[06:10:09] j4cknewt: has joined #ruby
[06:10:24] Muhannad: has joined #ruby
[06:10:36] ScriptGeek: I took the Ruby course on Treehouse and I'm working through the requirements in their career program to help me find a job
[06:11:08] Oog: has joined #ruby
[06:11:12] Ox0dea: What's the menu for?
[06:11:24] revath: has joined #ruby
[06:11:46] Ox0dea: Oh, it's a menu factory?
[06:11:50] ScriptGeek: The menu system can be used for all kinds of other stuff
[06:12:06] chussenot: has joined #ruby
[06:12:08] ScriptGeek: Yeah, it's a factory, makes the menu creation system easier
[06:12:10] djbkd_: has joined #ruby
[06:12:18] Ox0dea: I can has combo boxes?
[06:12:22] ScriptGeek: It's very simple
[06:12:28] ScriptGeek: no, it's all text based
[06:12:32] Ox0dea: Not how I meant.
[06:12:41] Ox0dea: Does selecting one option open up more options?
[06:12:47] Radar: ScriptGeek: You should go through the lessons on Exercism.io too. They're quite good.
[06:12:59] ScriptGeek: it's recursive
[06:13:06] yardenbar: has joined #ruby
[06:13:26] ScriptGeek: you can navigate through a complicated tree of menus if you want to define each of those menus
[06:13:49] Ox0dea: Why "kinda"? Why "complicated"?
[06:14:11] ScriptGeek: Thanks, Radar, I'll check it out sometime
[06:14:21] Muhannad: has joined #ruby
[06:14:26] havenwood: has joined #ruby
[06:14:53] ScriptGeek: complicated or simple, just depends on how many levels of menus are needed
[06:15:56] Ox0dea: Do menus interact with each other?
[06:15:57] ScriptGeek: So I'm using this menu system in a simple drug wars game clone
[06:16:25] ScriptGeek: I don't think so
[06:16:32] Ox0dea: Then whence complication?
[06:16:44] ScriptGeek: Just by levels of menus
[06:16:53] Ox0dea: That's called "nesting", not "complexity".
[06:17:24] rickmasta: has joined #ruby
[06:17:40] ScriptGeek: I suppose if you wanted you could add in a method in the event handler of an option that gets something from another menu
[06:17:43] lxsameer: has joined #ruby
[06:17:55] Ox0dea: Do you make that easy or difficult?
[06:18:15] Muhannad: has joined #ruby
[06:18:26] ScriptGeek: I don't have to do that for my project, so not sure. I wouldn't imagine it to be difficult
[06:18:35] revath: has left #ruby: ()
[06:19:15] Igorshp: has joined #ruby
[06:19:16] Ox0dea: Numbers to select, or button-mashing and Enter?
[06:20:14] ScriptGeek: It's user definable, based on key strokes, right now.
[06:20:23] Ox0dea: What's the default?
[06:21:22] ScriptGeek: Well, there's no hitting Enter, just hit a key and another menu displays or a menu option executes
[06:21:30] arup_r: has joined #ruby
[06:21:53] Muhannad: has joined #ruby
[06:21:57] Igorshp: has joined #ruby
[06:22:06] Ox0dea: Labels must be explicitly defined, then?
[06:22:21] ScriptGeek: There's an input validation system, so that it checks the input against a set of user-defined rules before executing an option
[06:22:33] ScriptGeek: Yeah, it has to be explicitly defined
[06:22:46] ScriptGeek: It's just a crappy little framework
[06:23:01] ScriptGeek: but it's better than hard coding every single menu and option
[06:23:16] arup_r1: has joined #ruby
[06:23:26] Ox0dea: Then why's it crappy?
[06:23:50] ScriptGeek: cause there's probably 20 other libraries that do the same thing, only better
[06:24:32] Ox0dea: Doesn't there being a single best one make the other nineteen just as "crappy", by that logic?
[06:25:11] arup_r1: has joined #ruby
[06:25:17] Muhannad: has joined #ruby
[06:25:35] ScriptGeek: Hmm... well, crappy meaning a wide range of lacking aspects from code design to feature set
[06:25:46] arup_r1: has joined #ruby
[06:26:09] schaerli: has joined #ruby
[06:26:13] Ox0dea: Are you okay with your library being crappy?
[06:26:36] ScriptGeek: everything has to start somewhere
[06:26:40] Ox0dea: Then the project has met its design goals.
[06:26:44] tno: has joined #ruby
[06:27:17] ScriptGeek: I made it entirely from my own fingertips, no copying or using any other libraries aside from the standard ruby ones
[06:28:00] ScriptGeek: And the point of the library is to make it easier to finish my project, which is a drug wars game clone
[06:29:00] alphaatom: has joined #ruby
[06:29:27] Ox0dea: Thus, an improvement to the library would improve your game.
[06:29:32] ScriptGeek: The menu library is 95 lines of code, with a decent amount of comments
[06:30:01] Ox0dea: You've gone from calling $thing "crappy" to defending it, and I'm afraid I can't follow the logic.
[06:31:17] riotjones: has joined #ruby
[06:31:21] Ox0dea: It's a little confusing is all.
[06:32:26] bayed: has joined #ruby
[06:32:38] ScriptGeek: So it's not crappy if it meets design goals, even though it lacks a lot of "nice to have" features?
[06:32:56] rdark: has joined #ruby
[06:33:53] fumihiro: has joined #ruby
[06:36:19] markholmes: has joined #ruby
[06:36:26] ScriptGeek: I think I'm going to use the lambda suggestion presented earlier, for menu content creation.
[06:36:35] calleerlandsson: has joined #ruby
[06:37:34] ScriptGeek: Then I can use it for dynamic data
[06:40:53] riotjones: has joined #ruby
[06:41:40] fabrice31: has joined #ruby
[06:43:32] ScriptGeek: Ox0dea: thanks for chatting
[06:43:52] Rubie: has joined #ruby
[06:43:52] Ox0dea: ScriptGeek: Sure thing. Good luck with Treehouse.
[06:44:11] andikr: has joined #ruby
[06:45:02] railsraider: has joined #ruby
[06:48:03] zacstewart: has joined #ruby
[06:48:49] Philipp_: has joined #ruby
[06:49:28] charliesome: has joined #ruby
[06:50:24] Stan: has joined #ruby
[06:51:17] troulouliou_div2: has joined #ruby
[06:51:19] charliesome: has joined #ruby
[06:52:07] xkickflip: has joined #ruby
[06:55:12] baweaver: has joined #ruby
[06:58:11] codecop: has joined #ruby
[06:59:54] jack_rabbit: has joined #ruby
[07:01:36] aaeron: has joined #ruby
[07:01:57] howdoi_: has joined #ruby
[07:02:00] Violentr: has joined #ruby
[07:03:51] joonty: has joined #ruby
[07:04:36] Musashi007: has joined #ruby
[07:05:21] JohnBat26: has joined #ruby
[07:09:03] NightMonkey: has joined #ruby
[07:09:27] Ox0dea: RAWR is the perfect name for a reddit API wrapper in Ruby, but alas.
[07:10:36] dumdedum: has joined #ruby
[07:12:24] schaerli: has joined #ruby
[07:13:00] awk: Hello, please advise (ruby noob) say I have $blah = '' ... then I do for example puts "hello" ... puts "goodbye" how do I pipe both hello and goodbye to $blah so I can call $blah later.. $blah < puts... ?
[07:13:20] sp1rs: has joined #ruby
[07:13:47] Ox0dea: awk: You want to... append to a String?
[07:15:10] Ox0dea: Do you want to print *and* capture the output, or just capture the output for printing later?
[07:15:15] awk: Ox0dea: well i'm writing different classes and instead of sending an e-mail in each class I want to store each output in a variable and then later I can send_email( "Backup successsful for ${$blah}" )
[07:15:23] fabrice31: has joined #ruby
[07:15:40] Ox0dea: awk: Then just use String#<< to "shovel" data into the string.
[07:15:50] awk: perfecto, thanks
[07:15:55] Ox0dea: Sure thing.
[07:17:18] TomyWork: has joined #ruby
[07:17:25] Ox0dea: >> s = ''; s << 'foo'; s << 98; s << 'ar'; s # awk
[07:17:26] ruboto: Ox0dea # => "foobar" (https://eval.in/401980)
[07:17:28] Ox0dea: Something to be mindful of.
[07:19:18] astrobunny: has joined #ruby
[07:19:55] CloCkWeRX: has joined #ruby
[07:21:49] Iskarlar: has joined #ruby
[07:22:18] Ox0dea: Any takeoffs?
[07:23:20] yfeldblum: has joined #ruby
[07:23:23] Ilyas: has joined #ruby
[07:26:21] apeiros: awk: note that $vars are *globals*. you don't want globals. ever.
[07:26:58] msgodf: has joined #ruby
[07:27:16] arup_r: has joined #ruby
[07:28:39] senayar: has joined #ruby
[07:29:37] benlovell: has joined #ruby
[07:29:45] DukeDave: has joined #ruby
[07:29:49] tonini: has joined #ruby
[07:30:39] SebastianThorn: apeiros: i sometime use a global variable for loggin-level, that bad aswell?
[07:30:52] allomov: has joined #ruby
[07:31:35] Ox0dea: apeiros: What do you suppose was the rationale behind making Hash#select/#reject behave differently from all the other Enumerable methods when passed a single-argument block?
[07:31:44] keen__________27: has joined #ruby
[07:33:59] zacstewart: has joined #ruby
[07:36:02] white_bear: has joined #ruby
[07:39:26] Ox0dea: has joined #ruby
[07:39:52] last_staff: has joined #ruby
[07:40:54] bove: has joined #ruby
[07:41:44] fgo: has joined #ruby
[07:42:05] duncannz: has joined #ruby
[07:43:14] duncannz: has joined #ruby
[07:44:32] rails733: has joined #ruby
[07:44:51] Hounddog: has joined #ruby
[07:46:52] krz: has joined #ruby
[07:49:09] anisha: has joined #ruby
[07:49:25] fabrice31: has joined #ruby
[07:50:08] christiandsg: has joined #ruby
[07:51:27] matcouto: has joined #ruby
[07:51:35] troulouliou_div2: has joined #ruby
[07:51:47] matcouto: has joined #ruby
[07:52:14] ironhide_604: has joined #ruby
[07:52:31] matcouto: has joined #ruby
[07:53:40] exadeci: has joined #ruby
[07:54:05] matcouto: has joined #ruby
[07:54:15] MiracleBlue: has joined #ruby
[07:54:37] neersighted: has joined #ruby
[07:54:46] schaerli: has joined #ruby
[07:54:52] matcouto: has joined #ruby
[07:55:50] CloCkWeRX: has left #ruby: ()
[07:56:06] yo61: has joined #ruby
[07:56:09] workmad3: has joined #ruby
[07:56:26] matcouto: has joined #ruby
[07:56:34] apfeluser: has joined #ruby
[07:57:56] matcouto: has joined #ruby
[07:58:46] matcouto: has joined #ruby
[07:59:01] blackmes1: has joined #ruby
[08:00:17] matcouto: has joined #ruby
[08:00:47] ruurd: has joined #ruby
[08:00:47] Soda: has joined #ruby
[08:01:18] senayar: has joined #ruby
[08:01:49] matcouto: has joined #ruby
[08:02:35] matcouto: has joined #ruby
[08:02:47] mikecmpbll: has joined #ruby
[08:03:23] matcouto: has joined #ruby
[08:04:09] matcouto: has joined #ruby
[08:04:59] matcouto: has joined #ruby
[08:06:28] matcouto: has joined #ruby
[08:07:14] matcouto: has joined #ruby
[08:07:18] tsujp: has joined #ruby
[08:08:01] matcouto: has joined #ruby
[08:08:26] ledestin: has joined #ruby
[08:08:44] gwendall: has joined #ruby
[08:08:50] matcouto: has joined #ruby
[08:09:37] matcouto: has joined #ruby
[08:09:47] stardiviner: has joined #ruby
[08:11:09] matcouto: has joined #ruby
[08:11:10] ruurd: has joined #ruby
[08:11:31] ScriptGeek: has joined #ruby
[08:11:51] KJF: has joined #ruby
[08:12:19] KJF: hello m getting error while getting rails in my ubuntu
[08:12:24] senayar: has joined #ruby
[08:12:31] ljarvis: ?rails kj_
[08:12:31] ruboto: kj_, Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[08:12:34] KJF: says Failed to connect to get.rvm.io port 443: No route to host
[08:12:39] matcouto: has joined #ruby
[08:13:13] charliesome: has joined #ruby
[08:13:22] adaedra: this looked like a network issue
[08:14:02] michael_mbp: has joined #ruby
[08:14:12] matcouto: has joined #ruby
[08:14:15] tomphp: has joined #ruby
[08:14:43] fgo: has joined #ruby
[08:15:10] awk: Ox0dea: another question please... I define a hostname eg... $hostname="blah" ... then I have a whole lot of things it does... what I want to do is if #{$hostname} == '' then puts "no hostname" exit 1 ... or abort... else do this...
[08:15:24] awk: What happens is I get the no hostname but it doesnt exit or abort it carries on with the else ?
[08:15:45] matcouto: has joined #ruby
[08:16:16] Ox0dea: awk: Would you mind posting the offending code?
[08:16:35] chussenot: has joined #ruby
[08:16:36] Ox0dea: It must be that you're not putting the call to `exit` in the right place.
[08:17:07] Igorshp: has joined #ruby
[08:17:09] axl_: has joined #ruby
[08:17:14] matcouto: has joined #ruby
[08:18:05] matcouto: has joined #ruby
[08:18:53] matcouto: has joined #ruby
[08:19:01] Musashi007: has joined #ruby
[08:19:59] iateadonut: has joined #ruby
[08:20:22] matcouto: has joined #ruby
[08:20:49] Zai00: has joined #ruby
[08:21:09] matcouto: has joined #ruby
[08:21:17] acke: has joined #ruby
[08:21:22] casadei_: has joined #ruby
[08:22:41] matcouto: has joined #ruby
[08:23:26] matcouto: has joined #ruby
[08:24:15] matcouto: has joined #ruby
[08:24:36] gwendall: has joined #ruby
[08:24:51] Sert: has joined #ruby
[08:25:01] einarj: has joined #ruby
[08:25:50] matcouto: has joined #ruby
[08:27:23] matcouto: has joined #ruby
[08:27:32] Iskarlar: has joined #ruby
[08:27:42] Sert: Can someone help me converting some code to an Class ? i dont understand how the inheritance works, i want to extend the google api.
[08:28:04] marr: has joined #ruby
[08:28:52] matcouto: has joined #ruby
[08:29:13] izzol: Sert: the best will be to show us what you have now ;-)
[08:30:22] matcouto: has joined #ruby
[08:30:39] zacstewart: has joined #ruby
[08:31:13] matcouto: has joined #ruby
[08:31:28] jamesaxl: has joined #ruby
[08:31:45] Feyn: has joined #ruby
[08:31:56] matcouto: has joined #ruby
[08:32:21] DoubleMalt: has joined #ruby
[08:32:48] matcouto: has joined #ruby
[08:32:59] tkuchiki: has joined #ruby
[08:33:11] tkuchiki: has joined #ruby
[08:33:54] Sert: izzol: ok
[08:34:16] matcouto: has joined #ruby
[08:34:53] devbug: has joined #ruby
[08:35:02] fabrice31_: has joined #ruby
[08:35:02] matcouto: has joined #ruby
[08:35:35] TheHodge: has joined #ruby
[08:35:50] matcouto: has joined #ruby
[08:36:15] mikecmpbll: do classes get garbage collected? for instance if I create a bunch of junk classes inside a loop tmp_sub_class = Class.new(OtherClass)
[08:36:39] matcouto: has joined #ruby
[08:37:11] al2o3-cr: has joined #ruby
[08:37:13] schaerli: has joined #ruby
[08:37:26] matcouto: has joined #ruby
[08:37:32] Sert2: has joined #ruby
[08:37:38] railsraider_: has joined #ruby
[08:37:43] mikecmpbll: i assume tmp_sub_class just gets garbage collected like anything else, now that i think about it
[08:37:53] mikecmpbll: not as though i'm defining it in the global scope
[08:38:11] matcouto: has joined #ruby
[08:38:57] matcouto: has joined #ruby
[08:39:05] Eminence_: has joined #ruby
[08:39:48] matcouto: has joined #ruby
[08:39:52] Sert2: https://gist.github.com/anonymous/9cc99c48505e02e22230
[08:40:31] matcouto: has joined #ruby
[08:40:54] apeiros: SebastianThorn: yupp
[08:41:08] apeiros: Ox0dea: no idea. what exactly do you mean?
[08:41:21] matcouto: has joined #ruby
[08:41:22] RTG`: has joined #ruby
[08:41:23] Sert2: can someone help me getting the Class working ?
[08:41:38] Pupeno: has joined #ruby
[08:41:39] apeiros: +b matcouto!*@*$#ruby-fix-your-connection
[08:41:42] apeiros: -o apeiros
[08:42:18] apeiros: ?code Sert2
[08:42:18] ruboto: Sert2, We can't help you without your code, please post it to https://gist.github.com
[08:42:23] sp1rs: has joined #ruby
[08:43:06] ljarvis: apeiros: their code is above
[08:43:15] Sert2: https://gist.github.com/anonymous/9cc99c48505e02e22230
[08:43:20] apeiros: ah. sorry.
[08:43:22] Sert2: Here u go
[08:43:31] Sert2: its some basic stuff.
[08:43:40] Sert2: think its easy to fix for u :/
[08:44:05] meow: has joined #ruby
[08:44:13] meow: has left #ruby: ()
[08:44:25] apeiros: ok, so we have the code gisted - but what's the problem with running the code?
[08:45:07] fabrice31: has joined #ruby
[08:46:21] Sert2: ok apeiros the problem is i want to extend the google api as you can see
[08:46:28] Sert2: i dont know how to init the basic stuff
[08:46:43] Sert2: the last line 60
[08:47:14] tkuchiki: has joined #ruby
[08:47:16] arup_r: has joined #ruby
[08:50:43] apeiros: Sert2: you'd pass that as an argument to Mcalendar.new
[08:50:55] apeiros: i.e. m = Mcalendar.new(:application_name => APPLICATION_NAME)
[08:51:21] apeiros: Mcalendar.new will create a new Mcalendar instance and call initialize on it, passing the same arguments on
[08:51:52] ChanServ: -b Andreas-Jx!*@*
[08:52:01] Sert2: i know but how apeiros :p i dont understand it
[08:52:01] apeiros: you can then do e.g.: def initialize(application_name:); @application_name = application_name; end
[08:52:13] apeiros: I can't help with "I don't understand it".
[08:52:49] adaedra: it would be nice to have something like def initialize(@application_name)
[08:53:04] apeiros: adaedra: yes. has been petitioned too, but afaik was rejected.
[08:53:08] apeiros: don't remember the reason
[08:53:11] apeiros: funny enough:
[08:53:27] apeiros: 18>> proc { |@x, $y| }.call(1,2); [@x, $y]
[08:53:28] ruboto: apeiros # => [1, 2] (https://eval.in/402087)
[08:53:48] Sert2: adaedra: ok my last problem is, how can i use the last line code
[08:53:56] Sert2: . /root/.gem/ruby/2.2.0/gems/google-api-client-0.8.6/lib/google/api_client.rb:411:in `discovered_api': undefined method `[]' for nil:NilClass (NoMethodError)
[08:56:30] Igorshp: has joined #ruby
[08:56:33] arturmartins: has joined #ruby
[08:59:21] Igorshp: has joined #ruby
[08:59:53] nikhgupta: has joined #ruby
[09:02:01] zenguy_pc: has joined #ruby
[09:03:52] mhib: has joined #ruby
[09:04:02] awk: Ox0dea: here is what i'm trying to do https://gist.github.com/tripolitrax/34fc3fae4e7821f8e465
[09:04:34] stamina: has joined #ruby
[09:04:55] awk: It runs the puts "Not running synchronization for DB02 as no hostname specified" but it doesn't abort or exit or anything, it goes straight to the else
[09:07:54] gagrio: has joined #ruby
[09:08:46] Iskarlar: has joined #ruby
[09:10:13] tomphp: has joined #ruby
[09:11:27] safeforge: has joined #ruby
[09:12:21] senayar: has joined #ruby
[09:14:27] schaerli: has joined #ruby
[09:15:57] krz: has joined #ruby
[09:16:25] gizmore: has joined #ruby
[09:16:46] safeforge: has joined #ruby
[09:17:15] Oog: has joined #ruby
[09:17:47] seansith: has joined #ruby
[09:19:27] msgodf: has joined #ruby
[09:19:32] krz: has joined #ruby
[09:20:31] Sert2: adaedra: my problem was only adding super in front of constructor
[09:20:59] zenspider: awk: if #{$db02DestDir} == nil
[09:21:02] zenspider: # is a comment
[09:21:08] zenspider: that's nonsensical code
[09:21:26] krz: has joined #ruby
[09:21:29] zenspider: so it's really saying "if puts ..."
[09:21:43] jbwiv: has joined #ruby
[09:21:45] bodgix: has joined #ruby
[09:21:52] zenspider: it doesn't even make sense if it was supposed to be a string w/ interpolation
[09:24:29] awk: got it thanks, working now
[09:24:57] apeiros: "the fuck 2.0" looks like a tool I need: https://twitter.com/nvbn/status/622852907424174080/photo/1
[09:25:12] apeiros: (safe for work)
[09:25:25] dtcristo: has joined #ruby
[09:26:31] senayar: has joined #ruby
[09:27:19] quimrstorres: has joined #ruby
[09:27:21] fantazo: has joined #ruby
[09:27:28] allomov: has joined #ruby
[09:28:44] lkba: has joined #ruby
[09:29:12] ruurd: has joined #ruby
[09:29:19] zacstewart: has joined #ruby
[09:29:34] workmad3: has joined #ruby
[09:29:53] zenspider: apeiros: oh holy fucking shit I **need** that
[09:31:13] emilkarl: has joined #ruby
[09:31:29] shevy: hilarious animation
[09:34:24] chussenot: has joined #ruby
[09:34:54] relix: has joined #ruby
[09:35:04] quimrstorres: has joined #ruby
[09:35:11] ph8: has joined #ruby
[09:35:11] Oog: has joined #ruby
[09:35:14] axl_: has joined #ruby
[09:38:07] ndrei: has joined #ruby
[09:38:34] jhass: old idea though, there are two or three that map that two a keyboard shortcut :P
[09:42:18] xkickflip_: has joined #ruby
[09:45:28] chussenot: has joined #ruby
[09:46:55] schaerli: has joined #ruby
[09:47:02] fabrice31: has joined #ruby
[09:47:10] quimrstorres: has joined #ruby
[09:47:20] benlovell: has joined #ruby
[09:48:05] axl_: has joined #ruby
[09:48:08] krz: has joined #ruby
[09:49:03] krz: has joined #ruby
[09:50:26] dfockler: has joined #ruby
[09:50:26] Sert2: how can i create a multi level (2 level) array and push date and time in these levels ?
[09:51:15] adaedra: It's funny, I already read that somewhere
[09:51:51] krz: has joined #ruby
[09:52:47] DEA7TH: has joined #ruby
[09:53:15] [k-: has joined #ruby
[09:53:16] CustosLimen: has joined #ruby
[09:53:26] anisha: has joined #ruby
[09:54:52] [k-: work work work
[09:55:03] [k-: all I have now is work, like we all do :(
[09:55:16] [k-: I don't like this work :(
[09:56:13] [k-: I realised if I actually read a book about Ruby instead of mashing my knowledge together, I would probably have written better code
[09:56:54] xkickflip: has joined #ruby
[09:57:32] krz: has joined #ruby
[09:57:52] shevy: you will become a railroad tycoon in Singapore - the only one who can write Ruby code
[09:58:27] [k-: actually there are a lot of people who can write Ruby code in Singapore
[09:58:46] [k-: we have the red dot conference (Ruby) here in singapore
[09:58:56] [k-: I didn't go tho
[09:59:22] adaedra: [k-: writing good code requires knowledge, practice, and feedback.
[09:59:27] [k-: it's such a pity that I write bad code
[09:59:37] adaedra: Everyone did once.
[09:59:45] sp1rs: has joined #ruby
[09:59:47] workmad3: adaedra: not me!
[09:59:56] adaedra: workmad3: right, you still do.
[10:00:41] Sert2: how can i create 2 level array ?
[10:01:40] ruurd: has joined #ruby
[10:02:24] ddv: i'm not at level yet, Sert2, so I can't tell
[10:02:30] fabrice31_: has joined #ruby
[10:02:52] Iskarlar: has joined #ruby
[10:02:53] shevy: Sert2 do you know how to create a normal array?
[10:02:55] adaedra: ACTION puts ddv in a lift
[10:03:05] shevy: ACTION presses the shredder-button
[10:03:28] workmad3: shevy: I worry about your place of work, if the lifts have shredder buttons....
[10:03:32] shevy: you can stack arrays in arrays like those matroshka puppets
[10:03:44] ddv: array inception
[10:03:45] Sert2: i want to create 2 levels, like Date => Time and create one more array and compare these arrays if same Date, check if time is conflicting like between?
[10:04:16] adaedra: Sert2: that was already discussed yesterday, did you not got answers?
[10:04:19] shevy: Sert2 well if you have a Date => Time association, that more sounds like a hash actually
[10:04:19] CustosLimen: has joined #ruby
[10:04:52] Sert2: shevy: ok so what u think
[10:04:55] shevy: but you can store like [[date1, time1],[date2,time2]] etc..
[10:04:57] Sert2: adaedra: yes we had :p
[10:05:08] shevy: I normally don't think :)
[10:05:09] Sert2: shevy: yes thats the way i want it
[10:05:31] felixr: has joined #ruby
[10:05:58] shevy: yeah, that is the literal ruby array syntax there [], you can use as many [] as you like. though it is usually best to keep your data structures as simple as possible
[10:06:23] [k-: >> [[[[[[?h]]]]]]
[10:06:24] ruboto: [k- # => [[[[[["h"]]]]]] (https://eval.in/402188)
[10:06:35] [k-: I didn't even count!
[10:06:46] Igorshp_: has joined #ruby
[10:07:26] lkba_: has joined #ruby
[10:07:26] Sert2: can i do it like test.push([#{event.date}, #{event.time}]) ?!
[10:07:34] [k-: Sert2, what do you want to do with the array
[10:08:04] [k-: you can drop the #{} since it isn't a string
[10:08:09] Sert2: i want to create 2 arrays with 2 levels (date, time) and then compare these two arrays if there are events which conflicts, like same date and time .
[10:08:32] [k-: 2 hashes will work too
[10:08:42] Sert2: okay can you explain me how ?
[10:08:43] [k-: and they are designed for that purpose
[10:09:09] [k-: { Date => Time, Date2 => Time2
[10:09:20] [k-: you need to close the }
[10:09:36] Sert2: which function
[10:09:39] mandarinkin: has joined #ruby
[10:11:28] [k-: .Equality???Two hashes are equal if they each contain the same number of keys and if each key-value pair is equal to (according toObject#==) the corresponding elements in the other hash.
[10:11:56] c355E3B: has joined #ruby
[10:12:03] chussenot: has joined #ruby
[10:12:03] [k-: the order doesn't matter unlike an array, right
[10:12:22] chussenot: has left #ruby: ()
[10:13:00] arup_r1: has joined #ruby
[10:13:10] Sert2: hm want to check overlaping events
[10:13:26] Sert2: like (StartA >= EndB) and (EndA >= StartB)
[10:13:45] adaedra: I swear, if I find solution in the logs
[10:14:48] ruurd: adaedra what was that again?
[10:15:17] shevy: adaedra yeah what was the solution!
[10:16:28] adaedra: 08:27 <jhass> and then by_status["needs_action"].each do |important_event| by_status["accepted"].select {|event| event.start.dateTime.between?(important_event.start.dateTime, important_event.end.dateTime) || event.end.between?(...) }.each do |conflicting_event| stuff(conflicting_event); or whatever
[10:17:00] allomov: has joined #ruby
[10:17:00] [k-: ugly code >.>
[10:17:06] adaedra: what was wrong with that?
[10:17:23] [k-: end is reserved in my brain
[10:17:37] [k-: also, snake case
[10:17:53] [k-: also, important_event vs event?
[10:18:01] ddv: what brain, [k-
[10:18:14] ruurd: BURRRRRRRRN
[10:18:27] [k-: that's rude :(
[10:18:42] [k-: I don't take nasty comments from just anyone
[10:18:49] adaedra: [k-: iirc, it was based on external JSON data, hence the snake case and "end"
[10:19:10] valkyrka: has joined #ruby
[10:19:25] [k-: I'm fine with adaedra calling me things but not you, ddv
[10:19:32] Sert2: i stuck :D
[10:19:45] Rubie: has joined #ruby
[10:19:46] ddv: s/stuck/suck
[10:20:07] ddv: [k-: just a little joke man
[10:20:13] ddv: mangggg
[10:20:23] [k-: I don't believe so.
[10:21:14] adaedra: i_want_to_believe.jpg
[10:21:17] shevy: are you saying that jhass code is ugly [k- :(
[10:22:13] [k-: it happens to the best of us sometimes
[10:22:26] [k-: you know, inheriting a ugly codebase
[10:22:37] ddv: thats awesome
[10:22:39] arup_r: has joined #ruby
[10:23:02] bubbys: has joined #ruby
[10:23:04] adaedra: you got out of your shredding lift?
[10:23:06] shevy: ugly code should be replaced by beautiful code
[10:24:20] emilkarl: has joined #ruby
[10:25:05] msgodf: has joined #ruby
[10:25:17] shevy: the less optimal programming language should be replaced by the more optimal programming language
[10:25:30] shevy: I am preaching from the shevy bible here ddv
[10:25:32] ruboto: "Best" and "better" are subjective. Try to use a different term.
[10:25:46] ruboto: I don't know anything about gooder
[10:25:48] ddv: dont drag me into this
[10:25:55] shevy: ?ruboto is dumb
[10:25:55] ruboto: is, I'm the channel bot, linker of the rules, adept of the facts, wielder of the banhammer.
[10:26:26] [k-: ?but_i_am_dumb
[10:26:26] ruboto: I don't know anything about but_i_am_dumb
[10:26:29] saeid: has joined #ruby
[10:26:38] `derpy: ACTION pats ruboto 
[10:26:40] dangerousdave: has joined #ruby
[10:26:48] astrobunny: has joined #ruby
[10:27:17] ddv: ?'[ke- is dumb'
[10:27:31] adaedra: dat failure
[10:27:38] ddv: ?ke- is dumb
[10:27:39] ruboto: I don't know anything about ke
[10:27:46] ddv: i failz
[10:27:54] shevy: the nick is a hard one
[10:27:57] adaedra: but we should stop with the insults now.
[10:28:02] [k-: as I said, I don't appreciate such comments coming from you.
[10:28:03] adaedra: peace and love, brothers.
[10:28:04] ddv: why adaedra?
[10:28:12] adaedra: and sisters, of course.
[10:28:15] sdothum: has joined #ruby
[10:28:16] livathinos: has joined #ruby
[10:28:29] fumihiro: has joined #ruby
[10:28:31] dangerousdave: Comparing two csv files with cmp -b returns me https://gist.github.com/deathwishdave/3e18a0b37f93430d4549
[10:28:34] ddv: haha dangerousdave
[10:28:35] saeid: has joined #ruby
[10:28:55] ddv: dave is pretty dangerousdave mangggg
[10:29:07] dangerousdave: the two files appear to have the same contents, but one is twice the size
[10:29:20] fgo: has joined #ruby
[10:29:40] dangerousdave: what are the "0 ^@" in the cmp results?
[10:29:50] dangerousdave: adaedra, that could be it
[10:29:55] adaedra: yep, looks like it
[10:30:05] dangerousdave: adaedra, would that account for size difference?
[10:30:21] adaedra: well, since all characters would be twice the size...
[10:30:28] adaedra: what does file says about your files?
[10:30:39] dangerousdave: if one is UTF-16, would the other be UTF-8?
[10:30:41] fg3: has joined #ruby
[10:31:03] fg3: installing rails is difficult
[10:31:07] adaedra: ?rails fg_
[10:31:08] ruboto: fg_, Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[10:31:37] dangerousdave: adaedra, spot on! one is 8, one is 16, thanks for your help!
[10:31:38] schaerli: has joined #ruby
[10:31:43] zacstewart: has joined #ruby
[10:32:03] fabrice31: has joined #ruby
[10:32:15] bruno-: has joined #ruby
[10:32:17] ArchRogem: has joined #ruby
[10:32:35] fg3: ruboto there is says to register nickserver means?
[10:32:46] ruboto: fg_, I don't know anything about bot
[10:32:47] shevy: you have to register once at freenode
[10:32:50] adaedra: ?ruboto fg_
[10:32:50] ruboto: fg_, I'm the channel bot, linker of the rules, adept of the facts, wielder of the banhammer.
[10:32:55] apeiros: ?justabot fg_
[10:32:55] ruboto: fg_, I'm just a bot. You don't need to address me.
[10:32:55] adaedra: hello apeiros
[10:32:59] shevy: afterwards you can join the channel there
[10:33:15] adaedra: fg_: #RubyOnRails is accessible only if you registered your nick.
[10:33:23] Philipp_: has joined #ruby
[10:33:24] ddv: we got that
[10:33:57] fg3: how to get registered
[10:34:13] monstordh: has joined #ruby
[10:34:15] adaedra: /msg NickServ HELP
[10:34:28] senayar: has joined #ruby
[10:34:28] senayar: has joined #ruby
[10:34:39] adaedra: then read what it says to you
[10:34:39] jhass: apeiros: if we only had aliases now... :P
[10:34:56] adaedra: ACTION brings cold water
[10:35:14] apeiros: ACTION walks away, head hanging in shame
[10:35:42] jhass: !fact mk freenode Please join #freenode for help with this IRC network.
[10:35:42] ruboto: jhass, I will remember that freenode is Please join #freenode for help with this IRC network.
[10:35:51] jhass: ?freenode fg_
[10:35:51] ruboto: fg_, Please join #freenode for help with this IRC network.
[10:36:07] ruurd: reading... that's a novel concept...
[10:36:10] ruurd: I must try that.
[10:37:01] ruurd: http://www.freenode.net/faq.shtml
[10:37:33] apeiros: jhass: IMO start with lower case letter, as it comes after addressing a person ("mrfoobar, please ???" instead of "mrfoobar, Please ???")
[10:37:35] Scripore: has joined #ruby
[10:37:58] dtcristo: has joined #ruby
[10:38:19] adaedra: or just write in CAPS LOCK MODE
[10:38:25] jhass: !fact ed freenode please join #freenode for help with this IRC network.
[10:38:26] ruboto: jhass, I stand corrected that freenode is please join #freenode for help with this IRC network.
[10:38:32] ruurd: Hey! Mind my ears please!
[10:38:59] bl4ckdu5t: has joined #ruby
[10:39:03] adaedra: ACTION tickles ruurd ears
[10:39:19] ruurd: hmmmmm... continue please....
[10:39:20] Sert2: man ich verstehe es nicht
[10:40:01] adaedra: Wir sprechen English hier, Sert2
[10:40:04] jhass: Sert2: this channel is English only, join #ruby-de for german help
[10:41:39] ddv: but jhass will understand you :)
[10:42:09] shevy: ddv eh I think he forgot german
[10:42:24] adaedra: jhass is the chan's Polizei
[10:42:33] ddv: op stands for oppression
[10:42:51] shevy: ddv is so eager today...
[10:44:00] rao_: has joined #ruby
[10:53:52] zenspider: has joined #ruby
[10:54:30] nettoweb: has joined #ruby
[10:55:02] Olipro: has joined #ruby
[10:56:52] Sert2: Okay i guess i make progress
[10:58:08] Sert2: https://gist.github.com/anonymous/425a677fd0fff1a043cc
[10:58:14] Sert2: here is sample output and code
[10:58:21] Sert2: may someone can help me solving the final step now
[10:59:54] adaedra: what's the "final step"
[11:00:05] Sert2: last line in paste
[11:00:15] Sert2: #{:sData=>"2015-07-24 12:00:00 +0200", :eData=>"2015-07-24 13:00:00 +0200"} #EXAMPLE OUTPUT! how to compare for overlapping events ?!
[11:00:18] [k-: that's quite a nice progress you have made
[11:00:37] [k-: s is start?
[11:00:53] Sert2: sData is start and eData is end
[11:00:55] Sert2: of an event
[11:01:15] [k-: now it's just logic then
[11:01:22] Sert2: if an needaction conflicts with an already accepted one i want to drop the shit
[11:01:41] [k-: (sData..eData).include? sData2
[11:01:56] Sert2: thats it lol ?
[11:02:01] [k-: I would advise you to rename sData to start_date tho
[11:02:20] SebastianThorn: [k-: ruby is beautiful
[11:02:25] bnagy: I don't think include? is right. The logic that is commented out but broken is better
[11:02:40] [k-: :o it doesn't work?
[11:03:00] bnagy: conflicts are when e1.start is inside e2 or e1.end is inside e2, no?
[11:03:34] bnagy: and yes, please don't name ruby variables like that :)
[11:04:26] Sert2: so bnagy what do you advise me to do
[11:04:27] _blizzy_: has joined #ruby
[11:04:30] Sert2: for comparing operation
[11:04:40] emilkarl: has joined #ruby
[11:05:14] bnagy: write a small method called conflicting? e1, e2 maybe
[11:05:46] anisha: has joined #ruby
[11:06:00] allcentury: has joined #ruby
[11:06:03] Sert2: but how :D
[11:06:23] endash: has joined #ruby
[11:06:59] bnagy: by typing code into your editor
[11:07:50] [k-: Sert2, if you don't get the logic right, you will not be a very good programmer :(
[11:07:53] Ilyas: has joined #ruby
[11:07:55] bnagy: e1.start_time.between? e2.start, e2.end or e1.end_time.between? e2.start, e2.end
[11:08:04] [k-: as a programmer, we have to solve problems
[11:08:10] bnagy: that is not actual code, but close enough
[11:08:34] allomov: has joined #ruby
[11:09:32] ecksit: has joined #ruby
[11:10:08] tmtwd: has joined #ruby
[11:10:13] workmad3: [k-: I thought the job of a programmer was to create problems?
[11:10:56] adaedra: to better solve them my child
[11:11:05] v0n: has joined #ruby
[11:11:16] Igorshp: has joined #ruby
[11:11:46] ccooke: workmad3: no, no. The job of a programmer is to solve just enough of the problems they create to remain employable
[11:12:23] _blizzy_: has joined #ruby
[11:14:02] Igorshp: has joined #ruby
[11:17:08] lkba: has joined #ruby
[11:17:17] Aswebb_: has joined #ruby
[11:18:36] lxsameer: is it possible to find out what class raised the current exception?
[11:18:44] Igorshp: has joined #ruby
[11:19:17] adaedra: exception don't always come from a class, but you could be able to find that in the exception stacktrace
[11:19:55] lxsameer: adaedra: thanks
[11:21:06] dangerousdave: has joined #ruby
[11:21:07] bnagy: I thought $@ was just line number based
[11:21:26] ruurd: lxsameer nope.
[11:21:33] bnagy: I think this is actually pretty tricky
[11:21:48] ruurd: unless you derive your own Exception type and pass self when throwing one
[11:22:16] diegoviola: has joined #ruby
[11:22:45] ecksit: has joined #ruby
[11:23:49] JeramyRR: has joined #ruby
[11:24:38] apeiros: lxsameer: you could redefine Kernel#raise and ::raise, and set an additional attribute
[11:25:44] [k-: that wouldn't be wise
[11:26:32] apeiros: it wouldn't?
[11:26:40] jamesaxl|2: has joined #ruby
[11:26:45] schaerli: has joined #ruby
[11:27:12] cccc: has joined #ruby
[11:27:38] schaerli: has joined #ruby
[11:27:48] [k-: what do you mean by additional attribute
[11:28:51] Tritone: has joined #ruby
[11:30:16] jhass: for debugging I'd just use pry-rescue & pry-stack_explorer
[11:30:25] lordkryss: has joined #ruby
[11:30:30] fgo: has joined #ruby
[11:30:52] cccc: is there anyway to delegate a method to an Enumerator's items? e.g. `enum.send` to be delegated to run `enum.each(&:send)`?
[11:32:36] [k-: could you elaborate further
[11:33:09] senayar: has joined #ruby
[11:33:57] sarkyniin: has joined #ruby
[11:34:18] [k-: cccc: ^
[11:34:32] tvw: has joined #ruby
[11:34:37] jhass: I don't think writing enum.each(&:foo) is too bad
[11:35:15] jhass: but also could do something like https://github.com/tomstuart/monads/blob/master/lib/monads/many.rb
[11:35:27] lxsameer: apeiros: thanks
[11:35:29] [k-: I'm not sure why he stated a solution to his problem without clarifying why it's bad
[11:36:16] relix: has joined #ruby
[11:36:23] jhass: call it delegator or proxy if you like :P
[11:37:22] Oog: has joined #ruby
[11:37:49] casadei_: has joined #ruby
[11:38:16] davedev24: has joined #ruby
[11:39:08] but3k4: has joined #ruby
[11:39:47] arup_r: has joined #ruby
[11:39:49] cccc: thanks! :+1:
[11:39:50] apeiros: [k-: class Exception; attr_accessor :raising_object; end
[11:40:22] apeiros: [k-: then in the redefined raise: exc.raising_object = self; end # only in Kernel#raise, though, Kernel::raise can't
[11:41:09] [k-: wouldn't the stack trace have this info
[11:41:32] apeiros: stack trace is a piece of text
[11:42:01] [k-: but it violates encapsulation!
[11:42:12] [k-: why do you want to access the object anyway
[11:42:13] Encapsulation: don't violate me =S
[11:42:16] adaedra: poor Encapsulation
[11:42:29] jhass: ?cookie Encapsulation
[11:42:29] ruboto: Encapsulation, here's your cookie: ????
[11:44:08] Sert2: if (event.start.dateTime || event.end.dateTime).include?(aAccepted)
[11:44:20] Sert2: aAccpted is the 2 level array
[11:44:22] adaedra: won't work like that
[11:44:30] Sert2: okay can u help me ? :D
[11:45:00] adaedra: event.start.dateTime || envent.end.dateTime will always be only event.start.dateTime (except if you have a startless event)
[11:45:16] [k-: Sert2, can 12/7 include 13/4?
[11:45:23] senayar: has joined #ruby
[11:45:37] ljarvis: death by camel case
[11:45:46] T3: has joined #ruby
[11:45:51] jhass: ljarvis: worse, it's hungarian notation
[11:46:09] ldnunes: has joined #ruby
[11:46:33] schaerli: has joined #ruby
[11:46:38] ljarvis: dateTimeStringWidget
[11:47:01] jhass: ...FactoryBean
[11:47:14] [k-: Sert2, that's a logic question :/
[11:47:23] [k-: I'm not sure why you are saying hmmm
[11:47:25] senayar: has joined #ruby
[11:47:36] [k-: it's like, can an apple include an orange?
[11:47:45] [k-: include here means contain
[11:47:46] Iskarlar: has joined #ruby
[11:47:57] ljarvis: ACTION cuts open an apple and puts an orange inside
[11:48:04] pengin: has joined #ruby
[11:48:06] jhass: with science everything is possible!
[11:48:11] bougyman: ACTION cross breeds and apple and orange
[11:48:30] jhass: Isn't there a tree that has like a dozen different fruits?
[11:49:06] adaedra: You know how many apples grow on a tree?
[11:49:10] jhass: http://www.treeof40fruit.com/
[11:50:17] [k-: Sert2: this is a basic question!
[11:51:16] fabrice31: has joined #ruby
[11:53:26] [k-: Sert2: is 12/7/2015 the same as 13/4/2015?
[11:53:41] chussenot: has joined #ruby
[11:54:41] DoubleMalt: has joined #ruby
[11:54:46] nettoweb_: has joined #ruby
[11:55:09] adaedra: use YYYY-MM-DD please.
[11:55:41] last_staff: has joined #ruby
[11:55:45] [k-: I live in Singapore :/
[11:55:48] konsolebox: has joined #ruby
[11:56:14] ruboto: I don't know anything about iso8601
[11:56:16] [k-: I use DD/MM/YYYY
[11:56:21] adaedra: https://xkcd.com/1179/
[11:56:27] [k-: I don't care about iso8601!
[11:57:09] adaedra: you're wrong, it's the standard.
[11:57:22] zacstewart: has joined #ruby
[11:57:23] tagrudev: has joined #ruby
[11:57:43] shevy: standard eh? https://xkcd.com/927/
[11:57:54] apeiros: it's too hot, damit. doing stupid stuff like .gsub(Regexp.escape(some_str), ???)
[11:58:04] shevy: yeah it is damn hot :(
[11:58:12] syath: has joined #ruby
[11:58:50] ndrei: has joined #ruby
[11:59:26] dede: has joined #ruby
[12:01:07] arup_r1: has joined #ruby
[12:01:20] SebastianThorn: apeiros: not in sweden :S
[12:01:26] adaedra: SebastianThorn: hej
[12:01:37] aganov: has joined #ruby
[12:01:40] apeiros: SebastianThorn: why ":-S" then? wanna trade places?
[12:02:15] SebastianThorn: apeiros: not really, went to tukey a cpuo??ple of years ago, got 2nd degree skinburn :S
[12:02:24] stamina: has joined #ruby
[12:02:26] adaedra: We got 26??C :/
[12:03:08] apeiros: I bet we have 30??+ in the office here
[12:03:19] apeiros: ACTION drips
[12:03:29] izzol: I have a string: "(...) TTi ZYRE954BB88003 for (...)" and I need just the value between the "TTi" and "for".
[12:03:37] adaedra: ACTION sends some air in apeiros general direction
[12:03:39] izzol: So I guess sub will do this?
[12:03:45] apeiros: izzol: that's one way, yes
[12:03:54] apeiros: izzol: alternatively String#[] in one of its many forms
[12:04:47] [k-: or a regexl
[12:04:53] quazimodo: has joined #ruby
[12:05:04] izzol: I need something which is fast :-)
[12:05:41] vondruch: has joined #ruby
[12:05:50] wottam: has joined #ruby
[12:05:55] mandarinkin: has joined #ruby
[12:06:00] rideh: has joined #ruby
[12:06:09] [k-: optimise your Regexp to make it do less backtracking?
[12:07:32] apeiros: [k-: String#[] takes a regex
[12:07:49] apeiros: izzol: so?
[12:07:58] [k-: he rejected it anyway
[12:08:20] apeiros: izzol: are you saying regex is not fast?
[12:08:27] Rubie: has joined #ruby
[12:08:32] [k-: String#[] does all the things!
[12:08:41] Voxxit: has joined #ruby
[12:09:47] quimrstorres: has joined #ruby
[12:10:25] izzol: apeiros: no, I'm just asking :-)
[12:11:32] [k-: I reduced something from ~160min to a few seconds
[12:11:54] [k-: and the few seconds had regexp in them
[12:12:00] [k-: it's not slow!
[12:12:14] izzol: hmm, ok I did something like: match('ESMTP id (.*)for')[1]
[12:12:18] SebastianThorn: [k-: what did the slow version have?
[12:12:20] izzol: and I have the result.
[12:12:23] Igorshp: has joined #ruby
[12:12:33] hahuang65: has joined #ruby
[12:12:51] [k-: SebastianThorn I forgot
[12:12:59] [k-: wasn't my code anyway
[12:12:59] apeiros: izzol: str.match('ESMTP id (.*)for')[1] --> str[/ESMTP id (.*)for/, 1]
[12:13:12] SebastianThorn: [k-: well, prolly not worth remebering hu? ;)
[12:13:24] apeiros: personally I'd probably use [^ ]* instead of .*
[12:13:31] [k-: it had arrays for large amount of unique data
[12:13:34] [k-: soooooooo
[12:13:49] [k-: and it was checking if the data included something as well
[12:13:50] apeiros: but then again, you didn't say anything about the form of your data. and it doesn't follow from a single example.
[12:13:53] blackmes1: has joined #ruby
[12:13:58] [k-: (probably not the best idea)
[12:15:20] izzol: apeiros: thanks :)
[12:15:20] [k-: izzol: yeah I'm confused too
[12:15:38] [k-: why do you have 2 different examples
[12:15:44] SebastianThorn: [k-: love looking at my own old code, feels alot lite this http://devopsreactions.tumblr.com/post/120682285491/reading-your-own-code
[12:16:21] white_bear: SebastianThorn: rofl
[12:16:33] [k-: but you didn't fix it!
[12:16:39] [k-: shevy: he didn't fix it!
[12:17:47] shevy: well I also don't fix everything in my own code :\
[12:18:16] [k-: am disappointed with your previous claims
[12:18:34] shevy: I would if I would have enough time!
[12:18:51] chussenot: has joined #ruby
[12:19:26] thiagovsk: has joined #ruby
[12:19:32] lapide_viridi: has joined #ruby
[12:19:32] SebastianThorn: you never have the time you wont to program..
[12:19:39] Sert2: if aAccepted.any? {|di| di.include? event.start.dateTime.to_date || (di.include? event.end.dateTime.to_date)}
[12:20:00] Sert2: dateInterval = event.start.dateTime.to_date..event.end.dateTime.to_date
[12:20:21] Sert2: question how to say does NOT include ?
[12:20:31] Sert2: simply adding ! infront of if !( XXX ?
[12:20:44] konsolebox: has joined #ruby
[12:20:45] yardenbar: has joined #ruby
[12:21:49] [k-: I hate code that says unless user.not_alive?
[12:22:44] arup_r: has joined #ruby
[12:23:56] sgambino: has joined #ruby
[12:24:19] nateberkopec: has joined #ruby
[12:24:52] segfalt: has joined #ruby
[12:26:21] jhass: izzol: if you want to read up on the no/less backtracking: http://www.regular-expressions.info/possessive.html http://www.regular-expressions.info/atomic.html
[12:26:23] SebastianThorn: [k-: i dont mind it
[12:26:44] CloCkWeRX: has joined #ruby
[12:27:06] izzol: [k-: https://gist.github.com/wolfedale/afd04cf37de550c1d541
[12:27:11] izzol: This is what I want to do.
[12:27:26] izzol: I did it by match but I'm not sure if this is the best way.
[12:27:33] [k-: unless !user.not_alive?.nil?
[12:27:43] izzol: All waht i want do check is ESMTP id.
[12:28:46] Silvr: has joined #ruby
[12:28:53] jhass: izzol: you should make (.*) as specific as possible, (.*) is basically never the best way
[12:29:06] fabrice31: has joined #ruby
[12:29:36] [k-: you are getting it from #inspect? :(
[12:30:01] workmad3: Sert2: if aAccepted.non?
[12:30:01] jhass: oh yeah, that's horrible too
[12:30:06] workmad3: Sert2: if aAccepted.none? even
[12:30:13] workmad3: (with the same block)
[12:30:47] [k-: you could do .*?
[12:30:58] [k-: I think it is the non-greedy version
[12:30:58] shevy: Sert2 rescue Death
[12:31:09] sankaber: has joined #ruby
[12:31:19] [k-: #=> Death
[12:31:26] [k-: shevy you killed him!
[12:31:43] jhass: izzol: http://www.rubydoc.info/gems/mail/Mail/Message#[]-instance_method
[12:32:06] [k-: I did not expect a yeah :/
[12:32:13] shevy: [k- in games I like to use: if game_over?
[12:32:19] rbennacer: has joined #ruby
[12:32:36] shevy: Death is not useful. Have you ever seen him write any documentation at all, that lazy bum?
[12:32:45] lxsameer: guys, what's the difference between 'raise Exception, "asdad"' and 'raise Excetion.new "zxczxc"'
[12:33:35] [k-: one creates an exception with "asdad", another with " zxczxc"
[12:33:36] victortyau: has joined #ruby
[12:33:37] izzol: jhass: I'm already using mail gem. But there is no option such as ESMTP id, so I'm getting it from mail.header.to_s[/ESMTP id (.*)for/, 1]
[12:34:07] [k-: izzol replace .* with .*?
[12:34:15] Sert2: https://gist.github.com/anonymous/46ac64de93a422184b93
[12:34:19] Kully3xf: has joined #ruby
[12:34:29] Sert2: i want to execute the drop shit if di include stuff
[12:34:40] Sert2: or must i add the dorp shit on other place
[12:34:50] jhass: izzol: that's in the Received header
[12:35:07] jhass: [k-: still way too open IMO, the empty match is not valid here
[12:35:18] jhass: nor are spaces for instances. Or snowmans
[12:35:22] victortyau: has joined #ruby
[12:36:00] but3k4: has joined #ruby
[12:36:15] arup_r1: has joined #ruby
[12:36:23] havenwood: has joined #ruby
[12:36:25] [k-: how about `[^ ]*? for`
[12:36:25] d10n-work: has joined #ruby
[12:36:30] shevy: the unicode snowman rules
[12:36:40] emilkarl: has joined #ruby
[12:36:49] [k-: more Regexp training!
[12:36:53] workmad3: [k-: s/*/+/
[12:37:09] workmad3: [k-: any time you use '*', you're allowing the complete absence of a match
[12:37:39] [k-: ah, yes, that be an important change!
[12:39:14] [k-: `ESMTP id ([^ ]+?) for`
[12:39:40] sinkensabe: has joined #ruby
[12:39:42] workmad3: [k-: no particular need to use +? there now... + is fine
[12:40:03] lxsameer: can i have access to caller object inside a Exception subclass?
[12:40:11] chussenot: has joined #ruby
[12:40:50] juanpaucar: has joined #ruby
[12:41:03] [k-: lxsameer: any particular reason for doing that?
[12:41:14] juanpaucar: has joined #ruby
[12:41:27] schaerli: has joined #ruby
[12:41:33] LoBoGoL: has joined #ruby
[12:41:47] lxsameer: [k-: I wat to call method on caller and fetch some info
[12:42:38] [k-: what kind of info?
[12:42:50] pontiki: lxsameer: only if you rescue the exception inside that object
[12:43:00] Zai00: has joined #ruby
[12:43:02] pontiki: then it's on self
[12:43:06] [k-: why do you need this info during an exception
[12:43:19] lxsameer: [k-: for example current 'name' on a person class
[12:43:41] [k-: logging purposes?
[12:44:01] lxsameer: pontiki: so no luck in Exception it self?
[12:44:01] lxsameer: [k-: yeah kind of
[12:44:29] [k-: the person should log it itself
[12:44:38] pontiki: lxsameer: no
[12:44:41] [k-: it shouldnt leak its variables
[12:45:02] pontiki: if you are raising the exception yourself, you can put as much information as you wish into the exception message
[12:45:10] pontiki: it all has to be a string, tho
[12:46:19] lxsameer: I see, but Since I have lots of code doing this, I just wanted a shortcut :P
[12:46:19] shredding: has joined #ruby
[12:46:26] lxsameer: but It seems that I'm ran out of luck
[12:46:37] malconis: has joined #ruby
[12:46:50] [k-: that is not a good way
[12:46:59] workmad3: pontiki: you can create your own subclass of exception and pass it anything you want
[12:47:10] tmtwd: has joined #ruby
[12:47:21] pontiki: workmad3: that is brilliant
[12:47:28] [k-: but it leaks!
[12:47:50] pontiki: [k-: it isn't leaking
[12:48:10] pontiki: you still cannot affect the internals of that object
[12:48:51] [k-: I do not like this though
[12:49:05] pontiki: then don't do it
[12:49:11] xkickflip: has joined #ruby
[12:49:21] [k-: exactly!
[12:49:31] pontiki: no one is saying you have to
[12:49:38] alemi: has joined #ruby
[12:50:02] [k-: I'm just advising lxsameer
[12:51:05] workmad3: pontiki: the ActiveRecord::RecordInvalid exception has a method 'record' that gives you the record that was invalid
[12:52:10] ruurd: has joined #ruby
[12:52:45] v0n: has joined #ruby
[12:53:41] lxsameer: thanks guys
[12:53:59] pullphinger: has joined #ruby
[12:54:46] serivich: has joined #ruby
[12:54:50] skyrocker: has joined #ruby
[12:54:58] skyrocker: has left #ruby: ()
[12:55:29] alemi: Hi, I am new to ruby just learnt about modules. I have these two files 'domain_extractor.rb' and 'test_domain.rb' in same directory. The contents of this file are http://dpaste.com/24VCT7F and http://dpaste.com/1B8VE4F respectively. But when I do 'ruby test.rb' it gives error. How to fix this?
[12:55:52] Hanmac1: has joined #ruby
[12:55:56] charliesome: has joined #ruby
[12:55:59] Hanmac1: shevy look: https://bugs.ruby-lang.org/issues/11379
[12:56:24] shevy: nobu is drunk :>
[12:56:32] [k-: alemi: and what would the error be?
[12:56:35] shevy: "Not a bug."
[12:56:42] shevy: "Sorry, it is not a stability issue."
[12:56:46] alemi: error is : test_domain.rb:1:in `<main>': uninitialized constant DomainExtractor (NameError)
[12:56:47] shevy: "It is a stability issue."
[12:57:01] al2o3-cr: alemi: have you required the file first?
[12:58:57] [k-: al2o3-cr finally stopped playing hangman!
[12:59:27] ItSANgo: has joined #ruby
[12:59:43] alemi: al2o3-cr: you mean adding 'require 'domain_extractor'' ? yes I did it. It shows error as http://dpaste.com/0M52SAS
[12:59:47] [k-: what is a stability issue
[12:59:56] shevy: good question :)
[13:00:09] al2o3-cr: alemi: require_relative 'domain_extractor.rb'
[13:00:16] stantonnet: has joined #ruby
[13:00:23] shevy: hanmac1 nobu is the most active core dev right now right?
[13:00:24] [k-: don't need the .rb!
[13:00:38] al2o3-cr: [k-: i just do it anyway :)
[13:00:45] Hanmac1: shevy hm yeah i think ;P
[13:00:52] shevy: Koichi Sasada is also very active
[13:01:04] [k-: ah the GC guy
[13:01:18] alemi: al2o3-cr: thanks
[13:01:28] shevy: interesting that only nobu has an email appended at @ruby-lang.org
[13:02:02] [k-: you are welcome al2o3-cr!
[13:02:17] al2o3-cr: well, thanks you [k- :)
[13:02:30] Igorshp: has joined #ruby
[13:02:37] atomical: has joined #ruby
[13:02:57] mhib: has joined #ruby
[13:03:20] yeticry: has joined #ruby
[13:03:53] albedoa: has joined #ruby
[13:03:54] senayar: has joined #ruby
[13:03:54] bmurt: has joined #ruby
[13:05:15] malconis: has joined #ruby
[13:05:26] failshell: has joined #ruby
[13:05:45] Spami: has joined #ruby
[13:06:15] troulouliou_div2: has joined #ruby
[13:06:56] eggoez: has joined #ruby
[13:07:29] alienaut: has joined #ruby
[13:07:39] lavros: has joined #ruby
[13:08:09] Mon_Ouie: has joined #ruby
[13:09:05] Rubie: has joined #ruby
[13:09:25] jgpawletko: has joined #ruby
[13:09:27] bungoman: has joined #ruby
[13:10:07] bungoman: has joined #ruby
[13:10:32] Kully3xf_: has joined #ruby
[13:10:45] chinmay_dd: has joined #ruby
[13:12:29] dorei: has joined #ruby
[13:12:42] schaerli: has joined #ruby
[13:14:05] senayar: has joined #ruby
[13:15:18] tagrudev: has joined #ruby
[13:17:44] sp1rs: has joined #ruby
[13:18:30] tkuchiki: has joined #ruby
[13:18:50] blackmes1: has joined #ruby
[13:19:01] [k-: has joined #ruby
[13:19:25] Kully3xf: has joined #ruby
[13:20:29] rideh^: has joined #ruby
[13:21:01] jpfuentes2: has joined #ruby
[13:21:09] Juanchito: has joined #ruby
[13:21:26] aganov: has joined #ruby
[13:21:45] fabrice31: has joined #ruby
[13:22:11] JoshL: has joined #ruby
[13:22:14] kies^: has joined #ruby
[13:22:31] nettoweb: has joined #ruby
[13:23:49] jonee: has joined #ruby
[13:24:00] shevy: [k- I am learning C :(
[13:24:53] chinmay_dd: has joined #ruby
[13:25:01] [k-: In Soviet Russia, c learns you
[13:25:36] [k-: in Soviet Russia, c am you
[13:25:49] adaedra: [k-: why the bad face? That's not such a bad thing.
[13:25:51] dhjondoh: has joined #ruby
[13:26:10] [k-: you mean shevy?
[13:26:19] allcentury: has joined #ruby
[13:26:26] adaedra: yes, sorry
[13:26:29] sevenseacat: has joined #ruby
[13:26:43] dhjondoh: has joined #ruby
[13:26:43] shevy: [k- may have a bad face :)
[13:27:04] adaedra: [k- is a broken face
[13:27:09] shevy: but I see, the nicks are similar... shevy ... [k- ...
[13:27:11] adaedra: with an helmet
[13:27:50] shevy: adaedra biggest problem I have so far is how boring C is compared to ruby
[13:28:08] adaedra: A language is not "boring".
[13:28:53] blackmes1: has joined #ruby
[13:29:19] jhass: ?ot shevy
[13:29:19] ruboto: shevy, this seems to be off-topic. Please move your discussion to #ruby-offtopic, to keep this channel free for Ruby related problems. Thanks!
[13:29:38] [k-: jhass has spoken!
[13:29:39] jhass: we also got C hangman over there!
[13:29:58] [k-: he doesn't like hangman at all :/
[13:31:43] j4cknewt: has joined #ruby
[13:31:59] Kully3xf_: has joined #ruby
[13:35:35] hahuang65: has joined #ruby
[13:35:52] user1138: has joined #ruby
[13:35:54] quimrstorres: has joined #ruby
[13:37:02] fabrice31: has joined #ruby
[13:37:48] lxsameer: has joined #ruby
[13:39:32] michael_mbp: has joined #ruby
[13:39:47] aryaching: has joined #ruby
[13:40:00] BTRE: has joined #ruby
[13:41:37] chussenot: has joined #ruby
[13:42:12] dblessing: has joined #ruby
[13:42:19] mary5030: has joined #ruby
[13:42:27] shevy: hangman is offtopic
[13:42:46] [k-: oooooo burn
[13:43:00] mary5030: has joined #ruby
[13:43:07] fabrice31_: has joined #ruby
[13:43:09] bffff_: has joined #ruby
[13:43:13] Mon_Ouie: C hangman? So hangman without vowels? :p
[13:43:53] wottam: has joined #ruby
[13:43:55] prefixed: has joined #ruby
[13:44:01] ljarvis: Mon_Ouie: join #ruby-offtopic and be forever broken
[13:44:08] freerobby: has joined #ruby
[13:44:58] khando: has joined #ruby
[13:45:13] endash: has joined #ruby
[13:46:27] shevy: what would jquery $() look like in ruby?
[13:46:56] adaedra: what do you mean
[13:47:04] adaedra: it's a function named $, which is not possible
[13:47:04] fgo: has joined #ruby
[13:47:17] adaedra: well, not directly at least
[13:47:18] jxf: shevy: like, an omnibus object with a lot of methods?
[13:47:32] shevy: jxf lol... omnibus :D that cracked me up
[13:47:37] schaerli: has joined #ruby
[13:48:13] ljarvis: what about using an uppercase $
[13:48:15] adaedra: In js, var $ = jQuery;
[13:48:21] wasamasa: there is no uppercase $
[13:48:24] jxf: "$" is a legal method name in Ruby
[13:48:31] shevy: adaedra ah so there was a prior assignment
[13:48:36] ljarvis: so wasamasa is the easy target
[13:48:38] wasamasa: the only reason javascript people have resorted to undercores and dollars is because they have no namespaces
[13:48:57] adaedra: why do you need namespaces when you have objects
[13:48:58] wasamasa: so they went for using the shortest possible name and assigning it a boatload of functionality
[13:49:00] cpruitt: has joined #ruby
[13:49:05] shevy: omnibus objects :D
[13:49:35] diego_k: has joined #ruby
[13:49:35] wasamasa: ACTION wonders whether this kind of approach would work in C
[13:50:09] Hanmac1: wasamasa: tones of macros? ;P
[13:50:31] wasamasa: hanmac1: ugh
[13:50:41] wasamasa: well, in elisp there's utility libraries with short names
[13:50:45] wasamasa: like the infamous dash.el
[13:50:55] wasamasa: which has -filter and -zip and whatnot
[13:51:29] moritzs: has joined #ruby
[13:51:56] Casty: has joined #ruby
[13:52:20] allomov: has joined #ruby
[13:52:35] diego_k: has joined #ruby
[13:54:06] momomomomo: has joined #ruby
[13:54:13] iamvery: has joined #ruby
[13:54:40] zenguy_pc: has joined #ruby
[13:55:29] Stratege: has joined #ruby
[13:55:54] Yiota: has joined #ruby
[13:56:35] choppington: has joined #ruby
[13:57:27] athos_diddy: has joined #ruby
[13:57:48] jxf: which account is the Ruby bot here?
[13:57:59] ruboto: I don't know anything about bot
[13:58:06] ruboto: I'm the channel bot, linker of the rules, adept of the facts, wielder of the banhammer.
[13:58:08] [k-: ?justabot
[13:58:08] ruboto: I'm just a bot. You don't need to address me.
[13:58:47] senayar: has joined #ruby
[13:59:45] Rubie: has joined #ruby
[13:59:55] willywos: has joined #ruby
[13:59:57] icebourg: has joined #ruby
[14:00:32] [H]unt3r: has joined #ruby
[14:00:50] miwood: has joined #ruby
[14:00:58] senayar: has joined #ruby
[14:01:48] jxf: >> jQuery = Class.new { def foo; "123"; end; def bar; "456"; end }; define_method(:"$") { jQuery.new }; self.send(:"$").foo
[14:01:49] ruboto: jxf # => "123" (https://eval.in/402408)
[14:01:55] jxf: shevy: now look what you did
[14:02:07] paulcsmith: has joined #ruby
[14:02:17] jxf: horrible, terrible jQuery in Ruby ;)
[14:02:51] ruurd: has joined #ruby
[14:02:55] joonty: has joined #ruby
[14:03:20] relix: has joined #ruby
[14:03:35] allomov: has joined #ruby
[14:03:40] shevy: can we have a variable such as $_ that is also a method? e. g. .send(:"$_")
[14:03:42] [k-: >> Fixnum.send.define_method(:'$') { 'hello' }; $$.$
[14:03:43] ruboto: [k- # => /tmp/execpad-7457571dd40e/source-7457571dd40e:2: `$ ...check link for more (https://eval.in/402409)
[14:03:55] chouhoulis: has joined #ruby
[14:04:06] [k-: $ is not allowed
[14:04:21] ljarvis: $_ is already a usable variable
[14:05:20] [k-: >> def $_ *args; args end; $_(1,2)
[14:05:21] ruboto: [k- # => /tmp/execpad-f7f6488b73bd/source-f7f6488b73bd:2: syntax error, unexpected '*', expecting :: or '.' ...check link for more (https://eval.in/402410)
[14:05:47] [k-: we can def $_.method tho :/
[14:06:00] havenwood: >> define_method :$_, ->{ :nooo }; send :$_
[14:06:01] ruboto: havenwood # => :nooo (https://eval.in/402411)
[14:06:28] havenwood: shevy: Don't be doing these things! :P
[14:07:01] havenwood: But if you must, do a lot of them!
[14:07:08] adaedra: >> define_method :$, ->{ :noooo }; send :$
[14:07:09] ruboto: adaedra # => /tmp/execpad-6ce180e3d94a/source-6ce180e3d94a:2: syntax error, unexpected ->, expecting keyword_end ...check link for more (https://eval.in/402412)
[14:07:24] [k-: using libobf: $-o[?+][self, [:$_,1,2]]
[14:07:42] [k-: that is if $_ was already a method
[14:08:15] shevy: this is really really ugly
[14:08:27] ljarvis: also $_ and $~ aren't actually global variables
[14:08:33] aaeron: has joined #ruby
[14:08:44] ljarvis: just to throw some fun out there #lolruby
[14:08:46] [k-: 1,2 are just placeholder arguments?
[14:08:50] codecop: has joined #ruby
[14:08:56] [k-: they aren't globals?
[14:09:03] ljarvis: no they're locally scoped
[14:09:05] werelivinginthef: has joined #ruby
[14:09:13] ljarvis: the prefixed $ is convenience
[14:09:17] DEA7TH: has joined #ruby
[14:09:21] havenwood: [k-: the $$ is a lie!
[14:09:28] prefixed: has joined #ruby
[14:09:37] havenwood: Now how can we trust that there will really be cake?
[14:09:47] Hanmac1: in the C api they are defined as "virtual" variables ;P
[14:09:52] zpr: has joined #ruby
[14:09:57] zpr: has left #ruby: ()
[14:10:00] [k-: everyone got sad today :(
[14:10:04] ljarvis: aren't all variables virtual
[14:10:19] havenwood: Then have a slice of virtual cake to go along with your virtual global variables: ????
[14:10:22] Igorshp: has joined #ruby
[14:10:25] [k-: First there was unviolated encapsulation
[14:10:29] ruboto: here's your cookie: ????
[14:10:49] [k-: (but you can't eat it)
[14:10:55] ljarvis: !fact cake here's your cake: ????
[14:10:56] ruboto: here's, I don't know anything about cake
[14:11:02] ljarvis: !fact add cake here's your cake: ????
[14:11:02] ruboto: ljarvis, I will remember that cake is here's your cake: ????
[14:11:20] [k-: uhhhhhhh
[14:11:23] [k-: uhhhhhhhhhhh
[14:11:41] [k-: ACTION searches for pizza
[14:11:50] prefixed: is there a simple way to ignore "named pipes" with the File module?
[14:12:12] [k-: :( I wanted the honour!
[14:12:22] ljarvis: first you must earn it
[14:12:33] ljarvis: prefixed: how so?
[14:12:46] [k-: ???????????????????????????????????
[14:12:50] Hanmac1: [k-: funny there is red apple ???? and green apple ???? ;P
[14:13:15] [k-: they are equally important!
[14:13:18] prefixed: ljarvis I am listing all files in a directory, and when i come across named pipes, everything goes to hell
[14:13:40] quimrstorres: has joined #ruby
[14:13:57] The_Phoenix: has joined #ruby
[14:14:03] Iskarlar: has joined #ruby
[14:14:47] The_Phoenix: has joined #ruby
[14:15:15] Hanmac1: prefixed: show us a gist of your stuff ... for checking you can use File.file? or !File.pipe?
[14:15:31] jgpawletko: has joined #ruby
[14:15:42] The_Phoenix: has joined #ruby
[14:15:49] Igorshp: has joined #ruby
[14:15:56] prefixed: hanmac perfect. I knew there would be a way to detect pipes!
[14:16:11] treehug88: has joined #ruby
[14:16:36] Hanmac1: ACTION equips itself now with a "metal detector" to detect pipes
[14:16:43] sp1rs: has joined #ruby
[14:16:47] The_Phoenix: has joined #ruby
[14:17:28] [k-_: has joined #ruby
[14:17:41] The_Phoenix: has joined #ruby
[14:18:42] The_Phoenix: has joined #ruby
[14:18:45] The_Phoenix: has joined #ruby
[14:19:22] pullphinger15: has joined #ruby
[14:21:23] _blizzy_: has joined #ruby
[14:21:57] Kully3xf: has joined #ruby
[14:22:06] allomov_: has joined #ruby
[14:23:05] IceyEC: has joined #ruby
[14:25:01] pullphinger: has joined #ruby
[14:25:08] shevy: I found one working on pipes here. pipework
[14:25:13] dopie: has joined #ruby
[14:25:45] Kully3xf_: has joined #ruby
[14:26:00] jgpawletko: has joined #ruby
[14:28:40] gwendall: has joined #ruby
[14:28:45] mase-chatter: has joined #ruby
[14:29:06] imanzarrabian: has joined #ruby
[14:29:43] jgpawletko_: has joined #ruby
[14:30:07] _blizzy_: has joined #ruby
[14:30:13] grill: has joined #ruby
[14:30:20] ruboto: I don't know anything about badumtss
[14:30:20] grill: has joined #ruby
[14:32:16] The_Phoenix: has joined #ruby
[14:33:14] charliesome: has joined #ruby
[14:33:43] decoponio: has joined #ruby
[14:34:06] tennis: has joined #ruby
[14:36:24] ndrei: has joined #ruby
[14:36:56] schaerli: has joined #ruby
[14:37:04] Hanmac1: has left #ruby: ()
[14:38:09] dangerousdave: has joined #ruby
[14:39:20] Papierkorb: has joined #ruby
[14:39:32] freerobby: has joined #ruby
[14:39:56] fabrice31: has joined #ruby
[14:40:50] fabrice31: has joined #ruby
[14:42:04] casadei_: has joined #ruby
[14:42:05] Casty: has joined #ruby
[14:46:02] apfeluser: has joined #ruby
[14:47:29] quimrstorres: has joined #ruby
[14:48:23] Rodya_: has joined #ruby
[14:49:48] Rubie: has joined #ruby
[14:51:35] cassioscabral: has joined #ruby
[14:53:54] casadei_: has joined #ruby
[14:54:08] shevy: adaedra what are you doing
[14:55:19] quimrstorres: has joined #ruby
[14:55:28] leat1: has joined #ruby
[14:56:38] gagrio: has joined #ruby
[14:57:41] dfockler: has joined #ruby
[14:57:42] [k-_: adaedra what are you doing
[14:58:55] dangerousdave: has joined #ruby
[14:59:35] pengin: has joined #ruby
[15:00:06] yorickpeterse: adaedra what are you wearing
[15:00:33] havenn: has joined #ruby
[15:00:34] dfockler: what's going on?
[15:00:37] khando_: has joined #ruby
[15:00:43] Stratege_: has joined #ruby
[15:00:44] yorickpeterse: adaedra: ANSWER THE QUESTION
[15:00:48] Kully3xf: has joined #ruby
[15:00:51] miwood_: has joined #ruby
[15:00:52] yorickpeterse: dfockler: nothing to see here, move along
[15:01:06] adaedra: come and see by yourself, yorickpeterse :3
[15:01:06] Igorshp: has joined #ruby
[15:01:09] iateadonut: has joined #ruby
[15:01:14] j4cknewt_: has joined #ruby
[15:01:49] sharpmachine: has joined #ruby
[15:02:03] relix_: has joined #ruby
[15:02:12] dented42: has joined #ruby
[15:02:29] MiracleBlue_: has joined #ruby
[15:02:31] Juanchito_: has joined #ruby
[15:02:41] tonini_: has joined #ruby
[15:03:20] jxf_: has joined #ruby
[15:03:22] cbednarski_: has joined #ruby
[15:03:40] crdpink2: has joined #ruby
[15:03:46] redteam: has joined #ruby
[15:03:48] allomov: has joined #ruby
[15:04:45] fumihiro1: has joined #ruby
[15:04:48] lavros_: has joined #ruby
[15:04:53] charliesome_: has joined #ruby
[15:04:56] allomov: has joined #ruby
[15:04:58] Derasi: has joined #ruby
[15:05:42] leat1: has joined #ruby
[15:06:16] hostess_: has joined #ruby
[15:06:30] drewdavis_: has joined #ruby
[15:06:55] balazs_: has joined #ruby
[15:08:18] leslie1: has joined #ruby
[15:08:22] mighty_gorilla: has joined #ruby
[15:08:26] C0deMaver1ck_: has joined #ruby
[15:08:59] prestorium: has joined #ruby
[15:09:03] chinmay_dd: has joined #ruby
[15:09:47] hahuang65: has joined #ruby
[15:10:19] douglasssss: has joined #ruby
[15:10:26] [k-_: adaedra invites yorickpeterse :o
[15:10:59] shevy: the heat is making the people funny
[15:11:27] acke: has joined #ruby
[15:11:40] shevy: adaedra admit it
[15:12:29] dcunliffe: has joined #ruby
[15:12:47] adaedra: we have A/C
[15:13:55] shevy: soon you have to go home
[15:13:56] NeverDie: has joined #ruby
[15:14:59] allomov: has joined #ruby
[15:15:17] [k-_: hsinoos!
[15:15:18] monstordh: has joined #ruby
[15:15:34] pyrotecnix: has joined #ruby
[15:15:35] martinium: has joined #ruby
[15:15:50] fumihiro: has joined #ruby
[15:15:51] troulouliou_div2: has joined #ruby
[15:15:57] leat1: has joined #ruby
[15:15:57] v0n: has joined #ruby
[15:16:39] gamename: has joined #ruby
[15:16:44] al2o3-cr: has joined #ruby
[15:16:59] krz: has joined #ruby
[15:17:19] dudedudeman: has joined #ruby
[15:17:30] dudedudeman: has joined #ruby
[15:17:31] gagrio: has joined #ruby
[15:17:58] kriskropd: has joined #ruby
[15:18:02] volsus: has joined #ruby
[15:18:08] mase-chatter: has joined #ruby
[15:18:25] startupality: has joined #ruby
[15:18:32] yorickpeterse: adaedra: sure babez
[15:18:34] yorickpeterse: adaedra: now just tell me
[15:18:37] yorickpeterse: too lazy to get up
[15:18:53] Maletor: has joined #ruby
[15:19:10] DrCode: has joined #ruby
[15:19:32] startupality: When implementing file upload functionality locally and using heroku server for production do you think its better that the code uses local machine storage for files when in development or it should use aws s3 for development, staging and production? What would be the standard/best way?
[15:20:19] Iskarlar: has joined #ruby
[15:20:25] LiquidInsect: has joined #ruby
[15:20:39] yorickpeterse: we just use S3 during development
[15:20:46] yorickpeterse: we prefix our bucket names with "development-" in that case
[15:20:56] rehat: has joined #ruby
[15:21:00] RegulationD: has joined #ruby
[15:21:46] startupality: @yorickpeterse thanks for feedback. wouldnt suffixing make more sense?
[15:21:56] yorickpeterse: doesn't really matter, depends on what you prefer
[15:22:03] hobodave_: has joined #ruby
[15:22:07] endash: has joined #ruby
[15:22:14] Igorshp: has joined #ruby
[15:22:48] unshadow: has joined #ruby
[15:22:59] cassioscabral: has joined #ruby
[15:23:08] hobodave_: has joined #ruby
[15:23:16] startupality: @yorickpeterse ok, btw can you rename the existing bucket?
[15:23:22] yorickpeterse: Don't think so
[15:26:28] shevy: if you have a .rb file, where the user can give basic instructions such as "help" or "create", would you check the user input as string or symbol?
[15:26:41] Mon_Ouie: has joined #ruby
[15:26:57] monstordh: I'm trying to get a SASS environment set up. I just found out that sass-globbing 1.1.1 has issues with relative paths and breaks for projects using things like: @import "../../variables/**/*". I have uninstalled and reinstalled -v 1.1.0, which works by all testimonies I have read. However, whenever I do a bundle install sass-globbing 1.1.1 is automatically RE-installed. How do I get this to stop? Am I using a version of sass version that can only use
[15:26:57] monstordh: sass-globbing 1.1.1? Currently using 3.4.16 (Selective Steve)
[15:27:08] dangerousdave: has joined #ruby
[15:27:53] grill: why is "else if" spelled "elsif" in ruby?
[15:28:06] ElSif: because of me :D
[15:28:06] shevy: grill I think because it is shorter
[15:28:13] ElSif: (ok not true)
[15:28:15] grill: why not elif then?
[15:28:31] shevy: because the s would be missing
[15:28:47] [k-_: the s is important!
[15:28:52] [k-_: it stands for shevy!
[15:29:28] shevy: people here can be nuts
[15:29:39] adaedra: ACTION throws shevy nuts
[15:29:49] dudedudeman: nucking futs i tell you!
[15:29:50] ElSif: honestly i think it has to do with what Matz was used to, perl, etc (that may be also not true)
[15:30:06] hectortrope: has joined #ruby
[15:30:21] [k-_: ACTION shines a cold hard light at ELSif
[15:30:32] [k-_: we want nothing but the truth, ELSif!
[15:30:47] ElSif: ACTION blinks in confusion
[15:31:08] ElSif: but... i can only occur if something wasnt true!
[15:31:31] senayar: has joined #ruby
[15:31:55] [k-_: :o touch??
[15:32:12] shevy: I just realized the ElSif nick
[15:32:28] shevy: those upcased letters tricked my brain before
[15:33:06] grill: does ruby have java-type enums?
[15:33:24] [k-_: java enums? what's that
[15:33:42] senayar: has joined #ruby
[15:33:45] senayar: has joined #ruby
[15:33:52] Channel6: has joined #ruby
[15:35:14] shevy: only constants, arrays, hashes, strings... Struct.new ...
[15:35:29] presto: has joined #ruby
[15:35:35] gwendall: has joined #ruby
[15:36:01] hackeron: has joined #ruby
[15:36:53] grill: thats too bad. i like java enums
[15:38:17] jhass: grill: we mostly use symbols for those usecases
[15:38:31] drewo: has joined #ruby
[15:38:48] jhass: :foo, :bar, :baz
[15:39:04] jhass: if color == :red
[15:39:15] [k-_: is it READ_WRITE = 1, 2, 3 that sort of thing
[15:39:50] jackjackdripper: has joined #ruby
[15:40:47] freerobby: has joined #ruby
[15:40:56] hahuang65: has joined #ruby
[15:41:03] freerobby: has joined #ruby
[15:41:24] vimz: if I have a class that excepts a block argument, and the block argument is prepended with a &, then to_proc is automatically called on that block. to_proc is a method inside the class that you can override by writing it manually right? | class MyClass def to_proc end end | anyway, how to I pass an argument to that to_proc method?
[15:43:47] [k-_: to_proc should not accept any arguments
[15:43:49] grill: perhaps I want to use constants then
[15:43:58] [k-_: you send arguments to the created proc
[15:44:39] ArchRogem: has joined #ruby
[15:44:41] riotjones: has joined #ruby
[15:44:56] shevy: vimz the short notation will only work with no-arguments-required, so [:a, :b, :c].map(&:to_s)
[15:44:58] shevy: >> [:a, :b, :c].map(&:to_s)
[15:44:59] ruboto: shevy # => ["a", "b", "c"] (https://eval.in/402462)
[15:45:05] iamvery: has joined #ruby
[15:45:11] shevy: although I think there were proposals to allow arguments
[15:45:19] Igorshp: has joined #ruby
[15:45:21] shevy: but matz says ... ruby 3.0 days
[15:46:07] linc01n: has joined #ruby
[15:46:46] sepp2k: has joined #ruby
[15:47:54] vimz: shevy haha I think they should. but okay.
[15:48:01] ruurd: has joined #ruby
[15:48:04] wprice: has joined #ruby
[15:48:38] centrx: has joined #ruby
[15:48:51] towski_: has joined #ruby
[15:48:52] SkNix: has joined #ruby
[15:49:06] shevy: I even read one proposal which had a nice syntax
[15:49:50] shevy: and I think I read it on #ruby too so one of the people here suggested it :)
[15:50:55] Kully3xf_: has joined #ruby
[15:51:29] safeforge: has joined #ruby
[15:51:37] hobodave_: has joined #ruby
[15:51:51] SkNix: can anyone help me please.
[15:52:21] adaedra: Not if you don't ask your question.
[15:52:52] SkNix: how do I delete a key / value of a hash?
[15:53:03] adaedra: &ri Hash#delete
[15:53:03] `derpy: https://devdocs.io/ruby/hash#method-i-delete
[15:54:09] SkNix: I will test here
[15:54:16] gambl0re: has joined #ruby
[15:55:46] jaycee: has joined #ruby
[15:56:32] Cache_Money: has joined #ruby
[15:57:39] Maletor: has joined #ruby
[15:58:35] pengin: has joined #ruby
[15:59:48] xcesariox: has joined #ruby
[16:00:32] amclain: has joined #ruby
[16:00:50] Igorshp: has joined #ruby
[16:03:20] sdothum: has joined #ruby
[16:04:51] hahuang65: has joined #ruby
[16:07:01] arup_r: has joined #ruby
[16:07:42] gambl0re: has joined #ruby
[16:09:38] lannonbr: has joined #ruby
[16:09:56] sphex: has joined #ruby
[16:11:30] melter: has joined #ruby
[16:11:55] dangerousdave: has joined #ruby
[16:15:15] iamvery: has joined #ruby
[16:17:07] ryanpc: has joined #ruby
[16:18:22] yqt: has joined #ruby
[16:18:25] balazs: has joined #ruby
[16:19:07] imperator: has joined #ruby
[16:19:14] paulcsmith: has joined #ruby
[16:19:23] ruby-lang460: has joined #ruby
[16:20:09] ruby-lang460: ["EssenceText: cheddar cheese", "EssenceText: with your bagels", "EssenceText: 4.99"]
[16:20:11] adaedra: hablas ingles
[16:20:28] ruby-lang460: how can you convert the strings to hashes?
[16:20:45] ruby-lang460: eval(["EssenceText: cheddar cheese", "EssenceText: with your bagels", "EssenceText: 4.99"]) doesn't work :(
[16:20:56] adaedra: use Array#map and String#split, then Array#to_h
[16:21:18] adaedra: Better, String#partition
[16:21:32] jpfuentes2: has joined #ruby
[16:21:47] ruurd: has joined #ruby
[16:22:31] Lucky_: has joined #ruby
[16:22:59] adaedra: mh, take that back. split's more suited, as it won't return the separator. I though partition didn't.
[16:23:19] ruby-lang460: arr.map{|x| x.split}
[16:23:19] adaedra: also, avoid eval as much as you can.
[16:23:32] adaedra: split(': ', 2) rather.
[16:23:35] ruby-lang460: I've heard that eval is dangerous
[16:23:49] adaedra: I won't say it's dangourous
[16:24:07] adaedra: It's more close to evil hitler with a fire chainsaw
[16:24:16] fgo: has joined #ruby
[16:25:06] ruby-lang460: Because it evaluates any and every string it recieves
[16:25:33] Aswebb_: has joined #ruby
[16:25:36] adaedra: Because using it is the first step to inject user input in it
[16:25:55] sarkyniin: has joined #ruby
[16:26:14] adaedra: And most of the time, it's not needed
[16:26:31] [k-_: its also slow
[16:28:45] ruby-lang460: use Array#map and String#split, then Array#to_h
[16:28:57] ruby-lang460: arr.map{|x| x.split(' ', 2).to_h}
[16:29:11] adaedra: this will give you an array of hashes
[16:29:31] adaedra: ah, didn't looked well, seems to be what you want
[16:29:43] ruby-lang460: thats what I'm expecting
[16:29:48] adaedra: you'll have the : in the keys though
[16:29:59] Scripore: has joined #ruby
[16:31:28] ruby-lang460: thanks adaedra
[16:31:39] nveselinov: has joined #ruby
[16:32:10] ruby-lang460: so irc is like a ruby playground?
[16:32:19] aaeron: has joined #ruby
[16:32:31] miah: Irrational Ruby Chatting
[16:32:38] adaedra: no, it's like anonymous programmers
[16:32:56] adaedra: I'm adaedra, and I write PHP code
[16:32:58] miah: _this_ channel is, not all of IRC is =)
[16:32:59] adaedra: HELLO ADAEDRA
[16:33:08] centrx: IRC is the real Internet
[16:33:16] ruurd: has joined #ruby
[16:33:18] miah: Internets Real Chat
[16:33:30] centrx: ever since AOL took over
[16:33:51] RobertBirnie: has joined #ruby
[16:33:56] adaedra: ruby-lang460: we're here to discuss ruby: issues, projects, ideas, etc.
[16:34:16] adaedra: we also hang out for more diverse topics (also see: #ruby-offtopic )
[16:34:23] ruby-lang460: Im interested in all of those things
[16:34:27] michaeldeol: has joined #ruby
[16:34:39] ndrei: has joined #ruby
[16:34:46] adaedra: But yeah, this is for #ruby, this channel. IRC is not only this channel or even this server :)
[16:34:57] dopie: has joined #ruby
[16:35:38] ruby-lang460: I've been developing in rails
[16:35:45] shinnya: has joined #ruby
[16:35:47] ruboto: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[16:36:23] ruby-lang460: rails is amazing
[16:36:37] ruby-lang460: but I'm at the point where rails can't really help me to much
[16:37:00] ruby-lang460: Im mostly dealing with ruby and js
[16:37:11] dudedudeman: he said the dreaded word
[16:37:12] gambl0re: has joined #ruby
[16:37:14] dudedudeman: ACTION hides
[16:37:33] DEA7TH: has joined #ruby
[16:37:42] dangerousdave: has joined #ruby
[16:37:57] adaedra: ACTION finds and puts dudedudeman in the middle of the room for all to look at
[16:38:11] dudedudeman: ACTION wears the cone of shame
[16:38:15] miah: ACTION looks and converts dudedudeman into a npm module
[16:38:17] jackjackdripper: has joined #ruby
[16:38:54] ruby-lang460: got to go to target guys
[16:38:54] adaedra: dudedudejs
[16:38:59] hectortrope: has joined #ruby
[16:39:03] ruby-lang460: thanks for the insight adeadra
[16:39:20] bricker: has joined #ruby
[16:39:24] havenn: ACTION reminesces on the good 'ole days before dudedudeman was turned into an npm module
[16:39:38] rdark: has joined #ruby
[16:39:51] Alayde: has joined #ruby
[16:40:02] prettiestPony11: has joined #ruby
[16:40:10] miah: but just think of the performance we'll get out of dudedudeman now while running on node!
[16:40:33] dudedudeman: ACTION bustles with excitement at the possibility of being a performer
[16:40:45] miah: well, you'll only be a microservice
[16:40:51] adaedra: dudedudeman had a problem. Now he is converted to nodejs and async and problem he has a now new.
[16:42:12] pengin: has joined #ruby
[16:42:14] polpak: has joined #ruby
[16:42:48] dudedudeman: console.log("Hello World");
[16:42:59] adaedra: undefined is not a function
[16:43:38] adaedra: now I'm tempted to go to js channel, throw "That's because undefined is not a function", and quit.
[16:45:01] charliesome: has joined #ruby
[16:46:13] rippa: has joined #ruby
[16:47:06] Rubie: has joined #ruby
[16:48:48] rdark: has joined #ruby
[16:49:53] jackjackdripper: has joined #ruby
[16:50:48] Rubie: has joined #ruby
[16:51:30] shadoi: has joined #ruby
[16:53:40] adaedra: That would be trolling, dudedudeman. You know I'm not like that.
[16:54:10] dudedudeman: i've been doing some js reading and such lately
[16:54:36] flak: has joined #ruby
[16:54:38] dudedudeman: i need to understand it better. as much as we like to hate it, it has it's place for client interaction. and, because i for some bloody reason enjoy creating client experiences, javascript is a must :/
[16:55:16] cassioscabral: has joined #ruby
[16:55:24] _djbkd: has joined #ruby
[16:55:36] adaedra: rip dudedudeman
[16:55:43] tuelz: has joined #ruby
[16:55:51] Igorshp: has joined #ruby
[16:56:09] sdothum: has joined #ruby
[16:56:34] aryaching: has joined #ruby
[16:57:41] cassioscabral: has joined #ruby
[16:57:56] kies^: has joined #ruby
[16:58:01] adaedra: time to go
[16:58:59] kohgpat: has joined #ruby
[16:59:49] spider-mario: has joined #ruby
[17:00:22] howdoicomputer: has joined #ruby
[17:00:28] bubbys: has joined #ruby
[17:01:52] blaines: has joined #ruby
[17:02:59] shadoi: has joined #ruby
[17:06:06] dseitz: has joined #ruby
[17:06:10] emilkarl: has joined #ruby
[17:06:28] quimrstorres: has joined #ruby
[17:06:29] rcvalle: has joined #ruby
[17:06:53] presto: has joined #ruby
[17:07:24] quimrsto_: has joined #ruby
[17:07:36] gambl0re: has joined #ruby
[17:08:06] wallerdev: has joined #ruby
[17:10:30] RegulationD: has joined #ruby
[17:11:04] devbug: has joined #ruby
[17:12:48] cnngimenez: has joined #ruby
[17:12:55] Kully3xf: has joined #ruby
[17:12:57] phoo1234567: has joined #ruby
[17:13:23] ruurd: has joined #ruby
[17:15:27] grill: is it possible to remove a key + value pair from a hash by key?
[17:15:58] iamvery: has joined #ruby
[17:16:21] ccooke: grill: hash.delete(key), which returns the value
[17:17:27] bubbys: has joined #ruby
[17:18:37] k3asd`: has joined #ruby
[17:18:42] allomov: has joined #ruby
[17:18:45] k3asd`: has joined #ruby
[17:19:03] ndrei: has joined #ruby
[17:19:35] phoo1234567: has joined #ruby
[17:20:41] Eminence_: has joined #ruby
[17:23:05] zly: has joined #ruby
[17:23:58] mikecmpbll: has joined #ruby
[17:24:05] cassioscabral: has joined #ruby
[17:24:08] Jackneill: has joined #ruby
[17:24:11] blaines: has joined #ruby
[17:24:56] failshell: has joined #ruby
[17:25:38] benlieb: has joined #ruby
[17:27:25] RegulationD: has joined #ruby
[17:27:39] dfockler: grill and ccooke!
[17:28:08] grill: ccooke! ?
[17:28:13] balazs: has joined #ruby
[17:29:06] clocKwize: has joined #ruby
[17:29:56] schaerli: has joined #ruby
[17:29:58] shevy: >> hash = { cat: 'tom', mouse: 'jerry' }; hash.delete :cat; hash
[17:29:59] ruboto: shevy # => {:mouse=>"jerry"} (https://eval.in/402524)
[17:30:00] shevy: grill ^^^
[17:32:02] startupality: has joined #ruby
[17:34:51] jhack32: has joined #ruby
[17:36:45] NeverDie: has joined #ruby
[17:36:47] postmodern: has joined #ruby
[17:37:27] quimrstorres: has joined #ruby
[17:38:37] towski_: has joined #ruby
[17:38:47] yfeldblum: has joined #ruby
[17:40:10] solars: has joined #ruby
[17:40:44] simplyianm: has joined #ruby
[17:40:46] NeverDie: has joined #ruby
[17:40:47] sharpmachine: has joined #ruby
[17:40:50] imperator: has left #ruby: ("Leaving")
[17:41:16] dstarh: has joined #ruby
[17:41:57] bungoman: has joined #ruby
[17:42:20] failshell: has joined #ruby
[17:43:53] alphaatom: has joined #ruby
[17:45:05] jerius: has joined #ruby
[17:45:12] simplyianm: has joined #ruby
[17:47:34] startupality: has joined #ruby
[17:47:55] axl_: has joined #ruby
[17:49:42] ruurd: has joined #ruby
[17:50:08] gambl0re: has joined #ruby
[17:50:48] fantazo: has joined #ruby
[17:50:50] Esya: has joined #ruby
[17:52:02] baweaver: has joined #ruby
[17:52:48] _blizzy_: has joined #ruby
[17:53:05] _sillymarketing: has joined #ruby
[17:53:14] bruno-: has joined #ruby
[17:54:11] baweaver: has joined #ruby
[17:54:24] cornerma1: has joined #ruby
[17:54:52] baweaver_: has joined #ruby
[17:54:54] sillymarketing: has left #ruby: ()
[17:55:05] sillymarkets: has joined #ruby
[17:55:38] sillymarkets: has left #ruby: ()
[17:56:10] _sillymarkets: has joined #ruby
[17:56:23] aaeron: has joined #ruby
[17:56:40] pengin: has joined #ruby
[17:56:55] fullofcaffeine: has joined #ruby
[17:57:38] _sillymarkets: anyone work with MongoDB with Ruby?
[17:57:48] stef204: has joined #ruby
[17:58:10] mhib: has joined #ruby
[17:58:34] lkba: has joined #ruby
[17:59:56] simplyianm: has joined #ruby
[18:00:47] apeiros: wow, my laziness reached new levels.
[18:00:55] apeiros: I'm too lazy to write my setup script in ruby :-O
[18:01:09] apeiros: _sillymarkets: yorickpeterse works with mongodb :D
[18:01:29] quimrstorres: has joined #ruby
[18:01:40] dfockler: I get lazy setting up JSON config files, :(
[18:01:44] hobodave: has joined #ruby
[18:02:00] _sillymarkets: thanks apeiros, i'll see if he is available
[18:02:07] _sillymarkets: yorickpeterse: are you around? ;)
[18:02:08] aaeron: has joined #ruby
[18:03:21] reset: has joined #ruby
[18:04:52] jhass: apeiros: isn't it kinda mean to direct all mongo questions to yorickpeterse? :D
[18:05:01] jhass: not that I don't participate...
[18:05:14] apeiros: jhass: but that's not what I did
[18:05:24] endash: has joined #ruby
[18:05:34] Alayde: has joined #ruby
[18:05:39] jhass: semantics...
[18:06:12] apeiros: anyway, I'm sure yorick has excellent insights into *how exactly* to use mongo. with or without ruby.
[18:06:34] _sillymarkets: I'm having trouble on the aggregation pipeline
[18:06:39] simplyianm: has joined #ruby
[18:06:45] _sillymarkets: when I use Mongo shell, I get my aggregation result. But can't get the same thing from my ruby script
[18:07:17] hahuang65: has joined #ruby
[18:07:39] howdoicomputer: has joined #ruby
[18:08:10] crazydiamond: has joined #ruby
[18:08:18] safeforge: has joined #ruby
[18:08:26] Olipro_: has joined #ruby
[18:08:48] Ox0dea: >> wtf = {}; foo = {a: 1, b: 2}; Enumerable.instance_methods.each { |m| next if m == :cycle; foo.send(m) { |x| break wtf[m] = x } rescue nil }; [wtf.size, wtf.select { |k, v| Symbol === v }]
[18:08:49] ruboto: Ox0dea # => [33, {:select=>:a, :reject=>:a}] (https://eval.in/402549)
[18:08:51] Ox0dea: apeiros: That.
[18:08:56] andikr: has joined #ruby
[18:09:06] Ox0dea: Hash#select/#reject behave differently from all the other Enumerable methods on Hash.
[18:09:50] sarkyniin: has joined #ruby
[18:10:54] wookiehangover: has joined #ruby
[18:11:16] hfp: has joined #ruby
[18:11:20] Silox|: has joined #ruby
[18:11:22] hfp_work: has joined #ruby
[18:11:33] baweaver_: they're the only ones to actually return a hash
[18:11:39] epochwolf: has joined #ruby
[18:11:42] apeiros: they are also not on Enumerable :)
[18:11:43] mjmac: has joined #ruby
[18:11:46] gambl0re: has joined #ruby
[18:12:02] apeiros: >> {}.method(:select).owner
[18:12:03] ruboto: apeiros # => Hash (https://eval.in/402558)
[18:12:06] Nightmare: has joined #ruby
[18:12:12] jalcine: has joined #ruby
[18:12:17] universa1: has joined #ruby
[18:12:18] baweaver_: they are, but overridden. Semantics though.
[18:12:33] mistym: has joined #ruby
[18:12:35] sfr^: has joined #ruby
[18:12:49] apeiros: the one thing I find interesting is that each_pair doesn't work that way
[18:13:08] apeiros: baweaver_: a method being overridden is not just semantics.
[18:13:38] nullwarp: has joined #ruby
[18:13:41] Ox0dea: apeiros: By "Enumerable methods on Hash", I refer to the results of `{}.methods & Enumerable.instance_methods`.
[18:13:44] baweaver_: I'm saying that me stating it is a bit pedantic.
[18:13:58] tylersmith: has joined #ruby
[18:14:05] Seich: has joined #ruby
[18:14:58] Klumben: has joined #ruby
[18:15:01] Blaguvest: has joined #ruby
[18:15:33] bungoman: has joined #ruby
[18:15:45] larissa: has joined #ruby
[18:15:48] skarn: has joined #ruby
[18:15:51] girakrok: has joined #ruby
[18:15:56] Ox0dea: baweaver_: They are the only ones that return Hashes, but why should that have any bearing on what gets yielded to the block?
[18:15:56] LBRapid: has joined #ruby
[18:16:13] george2: has joined #ruby
[18:16:20] baweaver_: still waking up a bit
[18:16:26] baweaver_: ignore me for the next hour or so
[18:17:21] quimrstorres: has joined #ruby
[18:17:31] baweaver_: bricker: oh?
[18:18:55] allomov: has joined #ruby
[18:19:41] shevy: great conversation between bricker and the old beaver :D
[18:19:47] hfp: has joined #ruby
[18:20:17] hfp_work: has joined #ruby
[18:20:43] baweaver_: This time next week I'll be over in Seattle saying hi
[18:21:09] msnyon: has joined #ruby
[18:22:05] quimrstorres: has joined #ruby
[18:22:05] fullofcaffeine: has joined #ruby
[18:23:24] Esya: has joined #ruby
[18:23:37] danzilio: has joined #ruby
[18:23:48] blackjid: has joined #ruby
[18:24:17] hfp_: has joined #ruby
[18:24:17] AccordLTN: halp, I'm a newbie and I'm going insane because rspec isn't loading up my Array class extension despite requiring the file with said extensions :I I just threw a new function in there and that gets loaded by rspec just fine, but not my Array extensionsss
[18:24:40] fgo_: has joined #ruby
[18:24:51] charliesome: has joined #ruby
[18:25:14] jhass: ?code AccordLTN
[18:25:14] ruboto: AccordLTN, We can't help you without your code, please post it to https://gist.github.com
[18:25:16] baweaver_: gist the spec file
[18:25:24] jhass: no, gist everything
[18:26:06] miwood: has joined #ruby
[18:26:06] A-ron: has joined #ruby
[18:26:22] Liam`: has joined #ruby
[18:26:33] AccordLTN: can I separate it into multiple files in a gist orrr...
[18:26:50] terrellt_: has joined #ruby
[18:27:25] AccordLTN: https://gist.github.com/AccordLTN/319c36ef67eea3e033cc
[18:27:41] cassioscabral: has joined #ruby
[18:27:51] A-ron: has joined #ruby
[18:27:51] Yiota: has joined #ruby
[18:28:01] yorickpeterse: You do not talk about Mongo and me behind my back
[18:28:04] apeiros: HI yorickpeterse! :D
[18:28:18] yorickpeterse: also I only have a tiny mongo cluster remaining
[18:28:22] yorickpeterse: which basically does nothing all day
[18:28:23] apeiros: right. I don't ^^
[18:28:30] yorickpeterse: _sillymarkets: I am now
[18:28:30] jhass: AccordLTN: yes, click edit and Add file at the bottom
[18:28:48] hfp_work: has joined #ruby
[18:29:25] baweaver_: Honestly I wouldn't use core extensions for that.
[18:30:18] yorickpeterse: _sillymarkets: please don't PM me for Ruby questions, ask them in here
[18:30:28] jhass: AccordLTN: spec run output would be great too
[18:30:30] safeforge: has joined #ruby
[18:30:39] Ox0dea: AccordLTN: #all_same? should just be uniq.size == 1, for what that's worth.
[18:30:43] jerius: has joined #ruby
[18:30:48] gambl0re: has joined #ruby
[18:31:11] _sillymarkets: sure, having problems with the aggregation pipeline when using my ruby script. It works fine when I'm in mongo shell
[18:31:31] yorickpeterse: without an example there's not much to help with
[18:31:35] relix: has joined #ruby
[18:31:46] AccordLTN: updated with rspec output
[18:32:16] jhass: AccordLTN: it's be true, not be_true
[18:32:27] jhass: if you read the output that sort of hints that
[18:32:27] AccordLTN: oh my gosh I'm retarded
[18:32:28] NeverDie: has joined #ruby
[18:32:38] AccordLTN: It was erroring for a different reason just a bit ago
[18:32:55] AccordLTN: where it wasn't recognizing the new array methods
[18:33:05] AccordLTN: welp uh, thank you and sorry :D
[18:33:11] avat: has joined #ruby
[18:33:18] jhass: nothing to worry about, yw
[18:33:44] jhass: btw I agree that I'm not sure they're worth to have as core exts
[18:34:04] _sillymarkets: yorickpeterse: https://gist.github.com/anonymous/6254abad506461cd1cb4 | sorry I was putting the example in gist
[18:34:08] simplyianm: has joined #ruby
[18:34:11] AccordLTN: I'm following a tutorial that places them there, but noted for the future
[18:34:26] Mendenhall: has joined #ruby
[18:34:45] eggoez: has joined #ruby
[18:35:15] avat: Hey guys, I want to write a MQTT broker in Rails, is it possible? All gems are clients as far as I understand
[18:35:15] ruurd: has joined #ruby
[18:35:18] AccordLTN: but my spec_helper still isn't loading up core_extensions.rb for some reason
[18:35:18] toretore: has joined #ruby
[18:35:23] jhack32: has joined #ruby
[18:35:30] baweaver_: #RubyOnRails Avat
[18:35:33] jackjackdripper: has joined #ruby
[18:35:55] yorickpeterse: _sillymarkets: your two queries are very different
[18:36:12] aaeron: has joined #ruby
[18:36:12] yorickpeterse: In the mongo shell you're grouping on "$date" but in Ruby you're grouping on the sum
[18:36:22] AccordLTN: and I fixed that too now, welp
[18:36:30] corpsicle: has left #ruby: ()
[18:36:32] lannonbr: has joined #ruby
[18:37:48] hfp_work: has joined #ruby
[18:38:15] cnngimenez: has joined #ruby
[18:38:18] hfp: has joined #ruby
[18:39:22] werelivinginthef: has joined #ruby
[18:40:03] _sillymarkets: yorickpeterse: i tried the same query multiple times, ruby script wont even run with regular mongo. Says undefined method "aggregate". When I convert it into Moped, I get an empty array for the same query in mongo shell that works
[18:40:17] _sillymarkets: yorickpeterse: I checked my mongo gem versions to make sure they were up to date for aggregation pipeline, should be fine
[18:40:25] _sillymarkets: yorickpeterse: https://gist.github.com/anonymous/84806a5a4db86bf990f2
[18:40:27] doctorly: has joined #ruby
[18:40:34] jhack32: where can i post a small snippet of my code?
[18:40:38] jhack32: for some help
[18:40:40] kirun: has joined #ruby
[18:41:45] jhass: ?gist jhack32
[18:41:45] ruboto: jhack32, https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
[18:41:57] ruboto: https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
[18:42:08] baweaver_: oho, so I can use that. I'll need to remember it
[18:42:12] werelivinginthef: has joined #ruby
[18:42:12] ruby-lang282: has joined #ruby
[18:42:25] jhass: ?rails baweaver_
[18:42:25] ruboto: baweaver_, Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[18:42:40] baweaver_: nifty jhack32
[18:42:41] jhass: ruby-lang282: welcome to the english Ruby channel
[18:42:42] hobodave: has joined #ruby
[18:42:45] DLSteve: has joined #ruby
[18:43:00] yorickpeterse: _sillymarkets: Moped only supports the aggregation framework since newer versions, the Ruby mongo driver has supported it for a while now IIRC
[18:43:17] ruby-lang282: is there a spanish ruby channel that i can migrate to
[18:43:25] jhass: ?channels
[18:43:26] ruboto: I don't know anything about channels
[18:43:43] _sillymarkets: yorickpeterse: yeah, but i keep getting undefined method "aggregate" for mongo ruby driver. Even though im on 2.0.6, and my db version is higher than 2.2
[18:43:51] yorickpeterse: _sillymarkets: you might want to ask in whatever IRC channel MongoDB operates
[18:44:02] jhass: !fact mk channels see http://ruby-community.com/pages/channels for a list of Ruby related channels on Freenode
[18:44:03] ruboto: jhass, I will remember that channels is see http://ruby-community.com/pages/channels for a list of Ruby related channels on Freenode
[18:44:10] Rubie: has joined #ruby
[18:44:10] jhass: ?channels ruby-lang282
[18:44:10] ruboto: ruby-lang282, see http://ruby-community.com/pages/channels for a list of Ruby related channels on Freenode
[18:44:12] DLSteve: has joined #ruby
[18:44:35] yorickpeterse: _sillymarkets: as I'm unsure why this wouldn't work
[18:44:57] _sillymarkets: yorickpeterse: okay, thanks for taking a look
[18:45:31] ruby-lang282: ["hello: joe", "im: looking"]
[18:46:23] ruby-lang282: i want an array of hashes. but i have strings
[18:46:42] jhass: ruby-lang282: what would the hash look like?
[18:47:05] workmad3: has joined #ruby
[18:47:07] ruby-lang282: [hello: joe, im: looking]
[18:47:15] yorickpeterse: ruby-lang282: you'll need to parse it
[18:47:45] ruby-lang282: or even [:hello => "joe", :I'm =>'looking' ]
[18:47:46] jhass: >> ["hello: "joe", "im: looking"].map {|item| item.split(": ") }.to_h
[18:47:47] ruboto: jhass # => /tmp/execpad-e7126e7cce43/source-e7126e7cce43:2: syntax error, unexpected tIDENTIFIER, expecting ']' ...check link for more (https://eval.in/402565)
[18:47:50] clamstar: has joined #ruby
[18:48:22] jhass: >> ["hello: joe", "im: looking"].map {|item| item.split(": ") }.to_h
[18:48:23] ruboto: jhass # => {"hello"=>"joe", "im"=>"looking"} (https://eval.in/402566)
[18:48:46] ruby-lang282: that only returns the last value as the transformed in www.repl.it
[18:48:58] shevy: ruby-lang282 you can decompose it
[18:49:13] jhass: ruby-lang282: we don't see what you enter on repl.it
[18:49:14] gambl0re: has joined #ruby
[18:49:33] shevy: :I'm seems like an invalid symbol
[18:49:39] swgillespie: has joined #ruby
[18:50:13] ruby-lang282: r = arr.map{|x| x.split(': ', 2)} this is what i ran before
[18:50:15] jhass: >> :"I'm"
[18:50:16] ruboto: jhass # => :"I'm" (https://eval.in/402567)
[18:50:26] kevb: has joined #ruby
[18:50:35] kevb: has left #ruby: ()
[18:51:05] benlieb: has joined #ruby
[18:51:49] kidoz: has joined #ruby
[18:52:00] baweaver: has joined #ruby
[18:52:02] kevb: has joined #ruby
[18:52:06] kevb: has left #ruby: ()
[18:52:18] podman: has joined #ruby
[18:53:02] johnhamelink: has joined #ruby
[18:54:57] albedoa: has left #ruby: ("Textual IRC Client: www.textualapp.com")
[18:55:52] jpfuentes2: has joined #ruby
[18:56:00] davedev24: has joined #ruby
[18:56:53] monod: has joined #ruby
[18:57:36] aaeron1: has joined #ruby
[18:57:54] poguez_: has joined #ruby
[18:58:19] ndrei: has joined #ruby
[18:58:29] tuelz: has joined #ruby
[19:00:06] _sillymarkets: yorickpeterse: I figured it out. I need "collection.find.aggregate([match, group])"
[19:00:28] _sillymarkets: yorickpeterse: I was missing find, and thought aggregate was a direct method under collection
[19:00:32] _sillymarkets: collectionView
[19:02:21] centrx: has joined #ruby
[19:02:24] f3ttX]: has joined #ruby
[19:02:25] nofxx: has joined #ruby
[19:03:18] waxjar: has joined #ruby
[19:03:37] relix: has joined #ruby
[19:03:39] bf4: has joined #ruby
[19:03:52] DoubleMalt: has joined #ruby
[19:04:23] autrilla: has joined #ruby
[19:05:22] lkba: has joined #ruby
[19:06:00] sphex: has joined #ruby
[19:06:27] mary5030_: has joined #ruby
[19:07:10] prestorium: has joined #ruby
[19:07:16] emilkarl: has joined #ruby
[19:08:06] kadoppe: has joined #ruby
[19:09:13] rehat: has joined #ruby
[19:09:23] iamvery_: has joined #ruby
[19:13:16] hashrocket: has joined #ruby
[19:14:26] girakrok: has joined #ruby
[19:16:44] icebourg: has joined #ruby
[19:17:30] icebourg: has joined #ruby
[19:17:44] last_staff: has joined #ruby
[19:18:17] icebourg: has joined #ruby
[19:18:57] jerius: has joined #ruby
[19:19:02] allomov: has joined #ruby
[19:19:04] icebourg: has joined #ruby
[19:19:05] jenrzzz: has joined #ruby
[19:26:52] startupality: has joined #ruby
[19:27:52] benlieb: how can I get rspec to fail when an error occurs in a method it calls?
[19:28:25] benlieb: right now it only fails when an expectation fails specifically
[19:29:46] bruno-: has joined #ruby
[19:30:14] yqt: has joined #ruby
[19:30:36] Scripore: has joined #ruby
[19:30:36] doug_f: has joined #ruby
[19:31:00] aaeron: has joined #ruby
[19:32:21] adaedra: expect(...).to raise_error(ExceptionClass)
[19:33:10] wallerdev: has joined #ruby
[19:34:15] doug_f: I am installing ruby to a docker/progrium/busybox and get the error when running it that "/usr/lib/ruby/ruby2.2-bin: not found" ls shows it there and executable.
[19:34:30] doug_f: Any ideas to further troubleshoot?
[19:35:26] jhass: benlieb: huh? it should fail if there's an uncatched exception bubbling up
[19:36:00] kies^: has joined #ruby
[19:36:50] jhack32: has joined #ruby
[19:37:28] havenwood: has joined #ruby
[19:39:10] DarkBushido: has joined #ruby
[19:39:41] benlieb: jhass: it doesn???t. if I have get :create as the only thing in the test, and there is an exception in the create method, it doesn???t fail. It only fails on exceptions that don???t match
[19:39:58] fullofcaffeine: has joined #ruby
[19:40:24] jhass: ah, I guess for a controller test rails catches it and the response turns into not being success
[19:40:35] jhass: like it would be in the real app
[19:40:40] jhass: it wouldn't crash your appserver
[19:42:42] dimasg: has joined #ruby
[19:43:02] sanguisdex: has joined #ruby
[19:43:12] jhass: that's why you have expect(response).to be_success as a common controller spec
[19:43:14] Asher1: has joined #ruby
[19:45:01] A-ron: has joined #ruby
[19:46:39] Asher: has joined #ruby
[19:46:50] ruurd: has joined #ruby
[19:47:40] tercenya: has joined #ruby
[19:47:44] Rubie: has joined #ruby
[19:47:46] u3d4dd: has joined #ruby
[19:48:00] pengin: has joined #ruby
[19:48:22] allomov: has joined #ruby
[19:49:22] Kully3xf: can you have a hash where only some keys have a value?
[19:49:25] havenwood: has joined #ruby
[19:49:44] peter_paule: has joined #ruby
[19:49:49] jxf: Kully3xf: sure: {:x => 'foo', :y => nil}
[19:49:53] dseitz: has joined #ruby
[19:50:14] n008f4g_: has joined #ruby
[19:50:15] Kully3xf: thank ya much
[19:51:06] vdamewood: has joined #ruby
[19:51:32] chipotle: has joined #ruby
[19:52:40] navs_: has left #ruby: ()
[19:52:47] rehat_: has joined #ruby
[19:52:53] baweaver: has joined #ruby
[19:54:40] Ox0dea: >> defined?({}[:foo])
[19:54:41] ruboto: Ox0dea # => "method" (https://eval.in/402580)
[19:54:49] reset: has joined #ruby
[19:55:00] Bloodshot: has joined #ruby
[19:56:12] ruurd: has joined #ruby
[19:56:42] jhack32: has joined #ruby
[19:56:55] lala: has joined #ruby
[19:57:06] ruurd: has joined #ruby
[19:57:33] jhack32: so i'm creating a tic tac toe game
[19:58:13] jhack32: im a little stuck on how to check to see if the player wins? I have created an array for the possible wins
[19:58:47] benlieb: has joined #ruby
[19:58:49] j4cknewt: has joined #ruby
[19:58:50] dimasg: has joined #ruby
[19:59:04] apeiros: jhack32: normal 3x3 tictactoe?
[19:59:14] jhack32: apeiros: yes
[19:59:17] user1138: has joined #ruby
[19:59:42] apeiros: you test 3 rows + 3 cols + 2 diagonals whether all of them have the same sign??? if any has, you have a winner
[20:00:56] miwood: has joined #ruby
[20:03:05] shevy: jhack32 you know how to query your array?
[20:03:12] shevy: every slot should have a state
[20:03:27] shevy: empty-one_colour-other_colour
[20:03:48] jhack32: the board is created as a hash
[20:03:49] shevy: so now you can query whether it'll be the same colour/token
[20:04:29] shevy: how does the hash store the board slots?
[20:05:31] CustosLimen: has joined #ruby
[20:06:19] fgo_: has joined #ruby
[20:07:01] doug_f: has left #ruby: ()
[20:08:07] jhack32: its something like this: @board = { "1" => " ", "2" => " ", etc
[20:08:16] iamvery_: has joined #ruby
[20:09:13] jhack32: im assuming i would check to see if the spaces to win are occupied by using .each commands or something like that?
[20:09:16] apeiros: jhack32: if all your keys are integers, contiguous and start at 0 - just use an array, not a hash.
[20:09:38] apeiros: and I'd definitively represent a TTT board as a 9 slot array
[20:09:50] ruurd: has joined #ruby
[20:10:17] nfk: has joined #ruby
[20:10:51] Musashi007: has joined #ruby
[20:11:20] alphaatom: has joined #ruby
[20:11:27] apeiros: s/represent/store/ (I'd use a custom class to represent it, which in turn stores the data in an array)
[20:12:47] robbyoconnor: has joined #ruby
[20:15:43] iamvery: has joined #ruby
[20:16:06] bricker: has joined #ruby
[20:16:14] Ox0dea: I'd use an 81-bit integer.
[20:16:38] dangerousdave: has joined #ruby
[20:17:02] peter_paule: has joined #ruby
[20:17:04] Ox0dea: Erm, no, a 15-bit integer could be used to represent the entire state of the board.
[20:17:26] apeiros: Ox0dea: 3 states for 9 fields? that's 27bit ;-)
[20:17:40] Ox0dea: >> '222222222'.to_i(3).bit_length
[20:17:40] ruboto: Ox0dea # => 15 (https://eval.in/402584)
[20:17:58] apeiros: 3**9 states
[20:18:11] Kully3xf: if I have a has of 1100 items, and then another hash of ~100 items, is best practice to do a a.includes?(b) do |k,v| puts k puts v
[20:18:15] apeiros: so indeed, 15bit is sufficient
[20:18:42] apeiros: Kully3xf: that question makes no sense
[20:18:51] Kully3xf: wording is off - my bad.
[20:19:09] apeiros: a) because there's no Hash#includes? (I assume you meant #include?) and b) because #include? does not take a block
[20:19:11] bruno-: has joined #ruby
[20:19:20] apeiros: sooo??? what are you asking really?
[20:20:02] Kully3xf: basically have a list of 1100 plugins (all available for this program) so if I want to allow jus tthese 100 to be installed it's best to just loop through the smaller one and see if it's included, if it is install it, if not uninstall
[20:21:01] Rubie: has joined #ruby
[20:21:06] apeiros: Kully3xf: I still don't follow. you say you have 2 inputs (1100 plugins, whitelist of 100), but it sounds like you had a third input ("please install those N plugins") - is that correct?
[20:21:08] swgillespie: has joined #ruby
[20:21:36] Kully3xf: so the end result is that if a user installs a plugin not allowed on the white list, it is uninstalled
[20:21:54] apeiros: so the 1100 plugins list is irrelevant
[20:22:08] apeiros: relevant is only that 1 plugin the user installs and that 100 whitelisted plugins???
[20:22:25] apeiros: and you can test inclusion in a hash with a single .include? call
[20:22:34] jerius: has joined #ruby
[20:22:43] Kully3xf: nah because there's no clean way to get the installed plugins listed
[20:22:44] apeiros: uninstall(plugin) unless whitelisted_plugins.include?(plugin)
[20:22:45] ruurd: has joined #ruby
[20:22:59] baweaver: has joined #ruby
[20:23:15] apeiros: ok, I can't really make sense of your question. maybe somebody else can.
[20:23:38] Kully3xf: I'll try to be more explicit.
[20:24:02] apeiros: but it seems to me like Array#&, #| and #- are methods you want to look into
[20:24:12] apeiros: also Hash#include? of course.
[20:25:05] Eminence_: has joined #ruby
[20:25:46] Ox0dea: Kully3xf: What are `a` and `b` actually called in your code?
[20:26:50] Kully3xf: i'm using chef to install plugins on jenkins. Jenkins currently has 1100 available plugins. I currently have a list of ~100 approved plugins. I want it to be so that if a dev installs a plugin, chef will delete it. Unfortunaltey there's no clean way to pulldown the currently installed plugins and compare against the current list. So my idea was create a hash of all available plugins, create a hash of all approved plugins, default is uninstall, so chef
[20:27:01] _blizzy_: has joined #ruby
[20:27:12] sypheren: has joined #ruby
[20:27:31] Kully3xf: and if we want to install a new plugin, just flip the action: uninstall switch to action: install
[20:27:36] blaines: has joined #ruby
[20:27:52] Kully3xf: say with an if statement and a corresponding value to the key "name of the plugin"
[20:28:26] Kully3xf: so hash "name_of_plugin" => "install" if we want it uninstalled and if value == "install" then run thhrough install, else uninstall
[20:29:19] Ox0dea: Kully3xf: You should find out how to get the list of installed plugins.
[20:29:32] Scripore: has joined #ruby
[20:29:52] blaines_: has joined #ruby
[20:30:12] baweaver: has joined #ruby
[20:31:16] Ox0dea: If you want to remove non-whitelisted plugins without the list of installed ones, then you have to iterate over all ~1100, no?
[20:32:04] jenrzzz: has joined #ruby
[20:32:12] baweaver_: has joined #ruby
[20:32:13] ruurd: Kully3xf maybe you should let the stupid devs maintain their own Jenkins?
[20:32:53] ruurd: Or allow them to maintain the current one to begin with.
[20:33:15] CustosLimen: has joined #ruby
[20:33:23] Kully3xf: they can - but I want chef to maintain the plugins
[20:33:43] ruurd: Don't. Just do what your devs want.
[20:34:39] _blizzy_: has joined #ruby
[20:35:39] werelivinginthef: has joined #ruby
[20:35:53] workmad3: has joined #ruby
[20:35:59] nettoweb: has joined #ruby
[20:36:56] j4cknewt: has joined #ruby
[20:37:18] shevy: they want chocolate and cheese
[20:37:30] snockerton: has joined #ruby
[20:38:07] Ox0dea: They want faster horses.
[20:38:43] snockerton: i'm trying to find an object in an array of hashes based on a subset string in one of the values of the object, what's the best way to do this?
[20:38:58] shevy: perhaps .select ?
[20:39:06] shevy: and an .include?
[20:39:10] snockerton: h[:images].select { |x| x[:name].include?("ubuntu") }
[20:39:27] snockerton: i'm trying that, but it throws an error if comes across an object where :name is nil
[20:39:33] yfeldblum: has joined #ruby
[20:39:57] snockerton: NoMethodError: undefined method `include?' for nil:NilClass
[20:40:30] snockerton: h[:images].select { |x| x[:name].include?("ubuntu") unless x[:name] == nil }
[20:40:38] snockerton: seems to work but there has to be a better way
[20:41:20] roolo: has joined #ruby
[20:41:44] Ox0dea: >> nil.to_s # snockerton
[20:41:45] ruboto: Ox0dea # => "" (https://eval.in/402594)
[20:43:12] snockerton: h[:images].select { |x| x[:name].to_s.include?("ubuntu") }
[20:43:19] Ox0dea: Looks fine to me.
[20:43:21] grill: yo. do Dir file matchers support regex or just glob?
[20:43:34] Ox0dea: grill: Just globs, and not as powerful as the shell's. :/
[20:43:51] snockerton: shevy: Ox0dea: thx
[20:43:59] Ox0dea: Sure thing.
[20:44:04] Ox0dea: Because reasons.
[20:44:24] grill: bad ones?
[20:44:29] Ox0dea: Old ones.
[20:45:03] shevy: yeah Ox0dea's solution is shorter than the earlier one
[20:45:34] Ox0dea: shevy: It's not just shorter, it's easier to read and probably slightly more performant.
[20:45:56] shevy: oh a triple win
[20:46:38] Musashi007: has joined #ruby
[20:46:39] apeiros: Ox0dea: (I fully believe you) what kind of globs does the shell allow which ruby's glob doesn't?
[20:46:53] pengin: has joined #ruby
[20:47:43] Ox0dea: Well, zsh's
[20:47:49] Ox0dea: zsh's ^ isn't supported.
[20:48:11] Ox0dea: Also, exclusion with ! doesn't appear to work like it does at the shell.
[20:48:23] hololeap: has joined #ruby
[20:48:51] apeiros: what does ^ do there? negation?
[20:49:13] jhack32: apeiros: can you explain to me why it would be better to use an array instead of a hash in a tictactoe game? I currently have everything under one class. Wouldn't i be able to push the X/O into hashes easier than arrays? or am i not understanding something correctly
[20:49:17] Hanmac: has joined #ruby
[20:49:39] Rubie: has joined #ruby
[20:49:45] dfockler: because you have a fixed amount of slots you need to deal with
[20:49:56] apeiros: jhack32: with an array, you have 9 slots at index 0-8. you put the X/O into those.
[20:50:07] FernandoBasso: has joined #ruby
[20:50:08] apeiros: the hash just adds indirection
[20:50:29] dfockler: and you are only dealing with storing a boolean
[20:50:40] apeiros: dfockler: incorrect. it's tri-state.
[20:50:41] Ox0dea: apeiros: Hm, no, I suppose ^ doesn't participate in globs, but ! exclusion is definitely different.
[20:51:05] dfockler: apeiros: ahh yeah X/O/Blank
[20:51:23] apeiros: exactly :)
[20:51:24] Ox0dea: A while back, Senjai wanted to exclude a single directory matching a static string, and answers weren't forthcoming. :/
[20:51:45] decoponio: has joined #ruby
[20:51:45] mdcox: has joined #ruby
[20:51:50] apeiros: Ox0dea: and zsh's globs can do that? nice.
[20:52:05] apeiros: my way in ruby is to use Array#- on the result. but that's of course cumbersome.
[20:52:12] mdcox: Does anyone know if default arguments to methods are evaluated everytime it's called?
[20:52:21] apeiros: mdcox: somebody knows, yes.
[20:52:37] apeiros: mdcox: try Time.now as a default value
[20:52:50] mdcox: Awesome. Totally didn't think of that.
[20:52:51] apeiros: would show with ruboto, but long running code is not allowed :)
[20:53:09] apeiros: (and spoiler alert: yes, they are evaluated every time)
[20:53:17] Ox0dea: >> def foo x = Time.now; x end; [foo, foo]
[20:53:18] ruboto: Ox0dea # => [2015-07-21 20:53:17 +0000, 2015-07-21 20:53:17 +0000] (https://eval.in/402606)
[20:53:22] apeiros: (and second spoiler alert: they are evaluated in the method's context)
[20:53:44] wmoxam: apeiros: great, you just ruined the movie
[20:53:46] mdcox: apeiros: Just to clarify, they are evaluated even if something else is passed in right?
[20:53:52] Ox0dea: mdcox: No.
[20:53:56] apeiros: wmoxam: I'm awesome this way :D
[20:54:02] mdcox: Oh really? Awesome!
[20:54:09] howdoicomputer: has joined #ruby
[20:54:10] apeiros: mdcox: as Ox0dea says
[20:54:15] Ox0dea: mdcox: They are evaluated at the time you define the method; that's why apeiros suggested Time.now.
[20:54:22] Ox0dea: >> def foo x = Time.now; x.to_f end; [foo, foo]
[20:54:23] ruboto: Ox0dea # => [1437512063.077658, 1437512063.0777125] (https://eval.in/402607)
[20:54:32] apeiros: Ox0dea: eh, no
[20:54:42] Ox0dea: That's not what I expected. :/
[20:54:49] apeiros: Ox0dea: they are not evaluated if a value is passed in. but they are evaluated every time if nothing is passed in.
[20:55:13] swgillespie: has joined #ruby
[20:55:14] apeiros: the former you can test by having e.g. puts("hi") as default value
[20:55:14] mdcox: Oh...only when defined? Darn. I'm trying to get around a very expensive method call that I don't always have to call depending on what's passed in. Guess I'll just have some really ugly if statements.
[20:55:22] finisherr: has joined #ruby
[20:55:31] mdcox: Thanks for the help :)
[20:55:37] Ox0dea: mdcox: ||= to the rescue?
[20:55:38] apeiros: mdcox: no. see what I wrote. ignore Ox0dea :-p
[20:56:08] Kully3xf_: has joined #ruby
[20:56:12] apeiros: mdcox: also if it's that expensive, be explicit? but IMO: show real code??? (the relevant part)
[20:58:22] mdcox: Yeah, explicit is better, so I'll just go through and have some crazy conditionals. It's hitting a database table that's crazy huge and running a silly query. But if we are already working with the value where the caller is I'd rather just pass it in.
[20:58:35] mdcox: Probably just split it into a different method. It'd be clearer
[20:59:54] charliesome: has joined #ruby
[21:00:21] ndrei: has joined #ruby
[21:02:17] bigbadbear: has joined #ruby
[21:04:17] dawkirst: has joined #ruby
[21:05:57] dawkirst: Hi - does duck typing implicitly imply that the object to which the duck type is sent returns in a uniform way?
[21:06:42] dawkirst: Would not returning in a uniform way not make it a duck type?
[21:06:50] Ox0dea: mdcox: It's hard to go wrong with Extract Method, but instance variable + ||= is pretty idiomatic.
[21:07:04] drbrain: dawkirst: maybe
[21:07:19] drbrain: part of duck typing is that types are fuzzy
[21:07:19] Ox0dea: dawkirst: You would be violating Liskov's Substitution Principle, which is pretty much always a Bad Thing.
[21:08:00] Jarboe: has joined #ruby
[21:08:21] drbrain: ??? there are excellent reasons that you do similar reasons as the other implementors
[21:08:44] dawkirst: drbrain: I understand that types of classes are fuzzy, but surely the method name and the form of what it returns need to be uniform across the duck type, right?
[21:08:48] drbrain: but raising an exception when the other objects do not is probably ok
[21:09:54] drbrain: in order to work uniformly you must return uniformly
[21:10:10] drbrain: but in order for your implementation to match the others you must have a clear specification to work from
[21:10:18] drbrain: without one it's hard to say if you're doing something too-strange
[21:10:42] codecop: has joined #ruby
[21:11:15] sdothum: has joined #ruby
[21:11:21] cyrus_: has joined #ruby
[21:12:55] ascarter: has joined #ruby
[21:13:15] dseitz: has joined #ruby
[21:13:18] LoBoGoL: has joined #ruby
[21:13:33] cyrus_: Very newbie on ruby (outside of basic syntax). Trying to troubleshoot a puppet issue. Could not autoload puppet/provider/cisco_vlan/cisco_ios: no such file to load -- puppet/provider/cisco_ios. https://gist.github.com/cyrus-mc/64641a7b8b30ad112fdd. As you can see the file puppet/provider/cisco_ios.rb exists and defines a new class Cisco_ios. My question is, is the capital (Cisco_ios) the possible cause of the issue?
[21:13:52] Igorshp: has joined #ruby
[21:14:22] CloCkWeRX: has joined #ruby
[21:15:34] solars: has joined #ruby
[21:15:48] drbrain: cyrus_: yes, the cases should match
[21:16:49] cyrus_: k will try
[21:18:35] finisherr: anyone know how i can translate a \n character to a literal \n
[21:18:36] mfp: has joined #ruby
[21:19:10] weemsledeux: has joined #ruby
[21:19:27] Ox0dea: finisherr: You have to use eval. :(
[21:19:31] adaedra: gsub('\n', "\n")
[21:19:41] finisherr: i was doing it the other way wround
[21:19:54] gamename: has joined #ruby
[21:20:01] adaedra: meh, don't know if it would work, never remember which languages do \n inside of ''
[21:20:14] adaedra: "Hello\\nWorld".gsub('\n', "\n")
[21:20:19] adaedra: >> "Hello\\nWorld".gsub('\n', "\n")
[21:20:20] ruboto: adaedra # => "Hello\nWorld" (https://eval.in/402612)
[21:20:49] adaedra: wait finisherr
[21:20:57] adaedra: which way you want it?
[21:21:12] shevy: the other way
[21:21:13] Ox0dea: finisherr: Is it only '\n' that you want to translate, or also other escape characters like '\r' and '\t'?
[21:21:18] finisherr: I want the string to end up like ???yada yada\nyada yada\n???
[21:21:47] finisherr: I???m trying to make a string json compiant
[21:21:53] finisherr: can't type today
[21:22:00] adaedra: string.to_json
[21:22:03] shmilan: has joined #ruby
[21:22:08] finisherr: haha, so simple
[21:22:13] monod: has joined #ruby
[21:22:43] Ox0dea: JSON strings can't contain literal newlines?
[21:23:05] adaedra: but if it's in a data structure, just .to_json the structure above
[21:23:09] finisherr: the to_json call worked just great
[21:24:30] workmad3: has joined #ruby
[21:24:56] dangerousdave: has joined #ruby
[21:25:59] gamename: has joined #ruby
[21:28:24] neanderslob: has joined #ruby
[21:30:38] guest343: has joined #ruby
[21:30:48] guest343: How can I make a custom rails SQL query chainable? Model.find_by_sql("...").order("...")
[21:31:10] alphaatom: has joined #ruby
[21:31:16] mfp: has joined #ruby
[21:31:53] ellisTAA: has joined #ruby
[21:32:11] shinnya: has joined #ruby
[21:32:41] howdoicomputer: has joined #ruby
[21:33:31] mhf: has joined #ruby
[21:39:29] RickHull: has joined #ruby
[21:39:40] RickHull: is there a good way to render an erb template via command line?
[21:39:57] RickHull: e.g. erb --foo bar --baz qux
[21:40:11] pyon: has joined #ruby
[21:40:11] RickHull: oops, erb --foo bar --baz qux template.erb
[21:42:18] joshbamboo1: has joined #ruby
[21:44:27] apfeluser: has joined #ruby
[21:45:01] htmldrum: has joined #ruby
[21:47:11] Soda: has joined #ruby
[21:47:14] phutchins: has joined #ruby
[21:49:13] Rutix: has joined #ruby
[21:49:13] Rutix: has joined #ruby
[21:50:32] lannonbr: has joined #ruby
[21:50:33] michael_mbp: has joined #ruby
[21:53:13] LoBoGoL: has joined #ruby
[21:53:15] mrmargolis: has joined #ruby
[21:53:39] RobertBirnie: has joined #ruby
[21:55:15] baweaver: has joined #ruby
[21:56:23] workmad3: has joined #ruby
[21:58:10] nymous: has joined #ruby
[21:58:18] nymous: hey folks
[21:58:36] nymous: do you know a way to compare debian package versions?
[21:58:48] user1138: has joined #ruby
[22:00:03] adaedra: Satan.invoke
[22:00:08] ellisTAA: has joined #ruby
[22:00:39] Ox0dea: nymous: Would piggybacking on Gem::Version suffice?
[22:00:51] Ox0dea: >> Gem::Version.new('1.0') < Gem::Version.new('1.0.1')
[22:00:52] ruboto: Ox0dea # => true (https://eval.in/402625)
[22:01:05] nymous: letme check
[22:01:53] decoponyo: has joined #ruby
[22:02:07] nymous: >> Gem::Version.new('0.4.22') < Gem::Version.new('0.4.22~2.g60d88fa')
[22:02:08] ruboto: nymous # => Malformed version number string 0.4.22~2.g60d88fa (ArgumentError) ...check link for more (https://eval.in/402626)
[22:02:28] Ox0dea: What if you tr('~', '-')?
[22:02:47] nymous: >> Gem::Version.new('0.4.22') < Gem::Version.new('0.4.22-2.g60d88fa')
[22:02:48] ruboto: nymous # => false (https://eval.in/402627)
[22:03:05] rapha: has joined #ruby
[22:03:11] baroquebobcat: has joined #ruby
[22:03:13] adaedra: debian package versions are based on software versions, no?
[22:03:32] adaedra: there are even svn/git/hg/whatever versions in it
[22:03:37] adaedra: it's pretty unmanageable
[22:03:46] nymous: the problem is that 0.4.22~2 precedes 0.4.22
[22:04:03] nymous: it's like pre 0.4.22
[22:04:21] xsdg: has joined #ruby
[22:04:26] adaedra: debian, fun for the whole family
[22:04:40] cccc: has joined #ruby
[22:04:46] nymous: i've seen a python lib for managing that
[22:04:53] Ox0dea: nymous: In any case, you'd have to fetch (or at least query) the relevant git repository to determine if one SHA "precedes" another.
[22:04:54] nymous: but not for ruby(
[22:05:20] nymous: it's nothing to do with git
[22:05:24] bruno-: has joined #ruby
[22:05:27] sn0wb1rd: has joined #ruby
[22:05:35] Ox0dea: What's the "g60d88fa"?
[22:05:51] wsterling: has joined #ruby
[22:06:26] nymous: 0.4.22~2.g60d88fa reads as 2 commits after 0.4.21 with sha 60d88fa
[22:06:29] crankharder: has joined #ruby
[22:06:34] eggoez: has joined #ruby
[22:06:41] ellisTAA: has joined #ruby
[22:06:51] dangerousdave: has joined #ruby
[22:06:54] nymous: so 0.4.22~3.g71a2950 would be next and so on
[22:06:58] Nuck: has joined #ruby
[22:07:05] nymous: until tagged 0.4.22 commit
[22:07:30] Ox0dea: So only the number immediately following the tilde is relevant for comparison.
[22:07:52] nymous: technically, yes
[22:07:55] sash_: has joined #ruby
[22:08:01] bungoman: has joined #ruby
[22:08:21] Ox0dea: Are there edge cases where tr('~', '.') would fail?
[22:08:33] bronson: has joined #ruby
[22:08:44] joneshf-laptop: has joined #ruby
[22:08:50] Ox0dea: s/fail/not suffice/
[22:08:52] nymous: 0.4.22 is after 0.4.22.2
[22:08:57] nymous: not before
[22:09:02] Ox0dea: Ah, right.
[22:09:08] Ox0dea: Have fun. :P
[22:09:22] nymous: debian version number are quite complicated
[22:09:26] adaedra: Mh, isn't there pre in some gem versions?
[22:09:37] entropie: has joined #ruby
[22:09:56] nymous: they might be something like 1:0.4.22~5+debian7.7 whatever
[22:10:10] Ox0dea: >> Gem::Version.new('4.22-pre2') < Gem::Version.new('4.22')
[22:10:11] ruboto: Ox0dea # => true (https://eval.in/402630)
[22:10:43] nymous: maybe there a gem which implements full version compare of debian versions?
[22:10:50] jenrzzz: has joined #ruby
[22:11:22] crankharder: has joined #ruby
[22:11:30] Ox0dea: nymous: Is shelling out to `dpkg` out of the question?
[22:12:10] tomphp: has joined #ruby
[22:13:18] marr: has joined #ruby
[22:13:26] nymous: it would make script too slow
[22:13:53] Ox0dea: Shell out from within a C extension. :P
[22:13:59] zacts: has joined #ruby
[22:14:09] nymous: i recently redid such a script which usually run 40 minutes before, now it runs for just 1 second
[22:14:24] nymous: it was shelling some commands too
[22:14:27] Ox0dea: Well, there doesn't appear to be a Ruby equivalent for Python's apt package.
[22:14:32] devbug: has joined #ruby
[22:14:35] Ox0dea: "Be the change you wish to see in the world."
[22:14:45] shinnya: has joined #ruby
[22:14:56] Ox0dea: Or finagle your strings until Gem::Version knows what to do with them. :/
[22:15:15] linuxboytoo: has joined #ruby
[22:15:15] nymous: debian has much more cases to deal with
[22:15:20] gamename: has joined #ruby
[22:15:53] tuelz: has joined #ruby
[22:17:38] Ox0dea: nymous: I guess you'll probably have to wrap libapt-pkg if you don't want to rewrite the version comparison logic.
[22:17:50] bruno-: has joined #ruby
[22:18:00] julieeharshaw: has joined #ruby
[22:18:08] sevin: has joined #ruby
[22:18:17] Alayde: has joined #ruby
[22:18:27] nymous: well, i've seen a C implementation of comparison algorithm, i can try to rewrite it
[22:18:31] fullofcaffeine: has joined #ruby
[22:18:46] nymous: or i can just use my silly edge case and to bother about others
[22:19:16] rafaelsales: has joined #ruby
[22:20:23] centrx: has joined #ruby
[22:21:09] Ox0dea: nymous: https://bitbucket.org/excid3/winlibre/src/00458f7e8856/wpkg/vercmp.py
[22:21:29] Ox0dea: I don't know whether that code is correct, but it's likely to be easier to port than the equivalent C.
[22:22:58] nymous: i guess so
[22:23:20] [H]unt3r: has joined #ruby
[22:23:22] Ox0dea: The deb-version manpage is pretty thorough.
[22:25:58] robbyoconnor: has joined #ruby
[22:30:02] swgillespie: has joined #ruby
[22:30:41] livcd: has joined #ruby
[22:31:58] contradictioned: has joined #ruby
[22:32:24] bhaak: has joined #ruby
[22:33:42] tdy: has joined #ruby
[22:34:01] bungoman_: has joined #ruby
[22:34:29] tmtwd: has joined #ruby
[22:34:49] Agoldfish: has joined #ruby
[22:35:06] DEac-: has joined #ruby
[22:35:08] duoi: has joined #ruby
[22:35:27] mleung: has joined #ruby
[22:35:46] drizz: has joined #ruby
[22:36:03] ellisTAA: has joined #ruby
[22:36:34] Kero: has joined #ruby
[22:36:58] Rubie: has joined #ruby
[22:37:44] ujjain: has joined #ruby
[22:37:44] ujjain: has joined #ruby
[22:37:48] tomphp: has joined #ruby
[22:38:37] workmad3: has joined #ruby
[22:40:36] Regulati_: has joined #ruby
[22:42:49] Ropeney: has joined #ruby
[22:43:21] jhack32: has joined #ruby
[22:50:10] shevy: has joined #ruby
[22:51:07] dimasg: has joined #ruby
[22:52:00] shadeslayer: has joined #ruby
[22:52:25] endash: has joined #ruby
[22:53:30] duoi: has joined #ruby
[22:54:22] failshell: has joined #ruby
[22:54:37] darix: Ox0dea: that looks more like rpm's algorithm
[22:54:53] T3: has joined #ruby
[22:56:41] acl_: has joined #ruby
[22:57:03] shevy: has joined #ruby
[22:57:05] lele|w: has joined #ruby
[22:57:10] swgillespie: has joined #ruby
[22:57:30] Ox0dea: darix: Are you able to tell by the absence of a check for '+'?
[22:57:52] malconis: has joined #ruby
[22:58:15] Cache_Money: has joined #ruby
[22:58:16] [k-: Ox0dea!
[22:59:20] Ox0dea: darix: Debian uses epochs.
[23:00:08] Ox0dea: [k-: I'm trying to come up with the best non-alphanumeric encoding.
[23:00:39] Ox0dea: I'll use two symbols to represent each ASCII character, and then some sentinel value for UTF-8 codepoints.
[23:01:05] Ox0dea: But I'm trying to improve on Perl's ACME::EyeDrops, so I want the characters to "naturally" fit well in ASCII art.
[23:01:35] christiandsg: has joined #ruby
[23:01:42] [k-: I don't have any knowledge on encodings tho
[23:01:51] Ox0dea: "Mapping" is probably the better term here.
[23:02:24] [k-: seems expensive
[23:02:48] Ox0dea: It's essentially just a different represenation of hexadecimal in most cases.
[23:03:12] tmtwd: has joined #ruby
[23:03:36] [k-: but it would look nice?
[23:03:53] Ox0dea: It's easy to make whitespace completely insignificant.
[23:04:05] Ox0dea: The only issue would be ensuring that the "prelude" could contain arbitrary whitespace.
[23:04:54] ruby-lang747: has joined #ruby
[23:07:23] [k-: the prelude?
[23:08:11] bronson: has joined #ruby
[23:08:20] ascarter: has joined #ruby
[23:09:11] [k-: ah got to leave, bye bye
[23:15:42] mary5030: has joined #ruby
[23:17:30] chrishough: has joined #ruby
[23:18:10] Tritone: has joined #ruby
[23:18:24] mike___1234: has joined #ruby
[23:19:12] slawrence00: has joined #ruby
[23:21:06] CloCkWeRX: has joined #ruby
[23:21:35] jesterfraud: has joined #ruby
[23:29:23] pietr0_: has joined #ruby
[23:30:28] shmilan: has joined #ruby
[23:33:48] Caldmann: has joined #ruby
[23:35:39] Ox0dea: Caldmann: Please explain.
[23:35:54] Ox0dea: wcalderipe: Are you still awesome?
[23:36:16] Olipro: has joined #ruby
[23:36:34] wcalderipe: i don't feel that way haha
[23:36:45] [H]unt3r: has joined #ruby
[23:37:00] wcalderipe: just miss clicked `i` by mistake
[23:37:09] jbw_: has joined #ruby
[23:37:12] ellisTAA: has joined #ruby
[23:37:22] mrmargolis: has joined #ruby
[23:37:27] Ox0dea: Yeah, something's definitely gone pear-shaped if you find yourself clicking your keyboard.
[23:37:53] RickHull: it's a touchscreen
[23:38:09] Thomas-0725: has joined #ruby
[23:38:31] drbrain: my keyboard clicks
[23:38:38] Ox0dea: But do *you* click your keyboard?
[23:38:40] eam: >> def !; 123; end; send :!
[23:38:41] ruboto: eam # => 123 (https://eval.in/402671)
[23:38:51] wcalderipe: *miss taped.. if you will feel better! :)
[23:38:54] RickHull: in soviet russia
[23:38:54] Ox0dea: >> define_method('') { :ok }; send('')
[23:38:55] ruboto: Ox0dea # => :ok (https://eval.in/402672)
[23:38:56] drbrain: that's what my fingers feel, so I guess you could say that?
[23:39:10] eam: Ox0dea: aka the shortest ruby method
[23:39:15] RickHull: was clicking a verb before mice?
[23:39:32] eam: Ox0dea: but in this case it changes !
[23:39:48] Ox0dea: RickHull: People have been "clicking their tongues" for centuries.
[23:40:03] eam: >> def !; 123; end; send :!; !1
[23:40:04] ruboto: eam # => private method `!' called for 1:Fixnum (NoMethodError) ...check link for more (https://eval.in/402673)
[23:40:04] RickHull: so to click is to produce a clicking sound
[23:40:09] RickHull: so i'm definitely clicking my keyboard
[23:40:17] shevy: I hammer into it
[23:40:19] allcentury: has joined #ruby
[23:40:24] RickHull: swan dive ftw
[23:40:29] Ox0dea: I use my noses.
[23:40:53] shevy: how many of them?
[23:41:07] Ox0dea: It varies.
[23:41:09] eam: as many as necessary
[23:42:50] nitenq: has joined #ruby
[23:43:00] Ox0dea: >> class Fixnum; %w[+@ -@ ! ~].each { |m| alias_method m, :itself } end; +~---+!!++~~+42 # eam
[23:43:01] ruboto: Ox0dea # => 42 (https://eval.in/402674)
[23:43:07] Ox0dea: Unary is best -ary.
[23:43:08] christiandsg: has joined #ruby
[23:43:40] nitenq: hi, is there a way to convert the string ???0xffffff00??? to a int to be able to use NetAddr.i_to_bits()
[23:44:11] zeroklain: has joined #ruby
[23:44:28] zeroklain: has left #ruby: ()
[23:44:38] xkickflip: has joined #ruby
[23:45:03] shevy: Ox0dea is writing not code but atrocities
[23:45:08] eam: my favorite fixnum unary trick is:
[23:45:12] eam: >> class Fixnum; def -@; 5; end; end; x = 7; [-7, -(7), - 7, -x]
[23:45:13] ruboto: eam # => [-7, 5, 5, 5] (https://eval.in/402675)
[23:45:37] rafaelsales: has joined #ruby
[23:45:45] eam: in ruby everything is a method (except when it's hardcoded in the parser)
[23:46:31] ruby470: has joined #ruby
[23:47:54] quazimodo: has joined #ruby
[23:48:39] Ox0dea: >> 'ff'.to_i(16) # nitenq
[23:48:40] ruboto: Ox0dea # => 255 (https://eval.in/402676)
[23:49:47] nitenq: Ox0dea: that???s not what I am trying to do
[23:50:15] nitenq: Ox0dea: I want to do this
[23:50:17] nitenq: ip = NetAddr.i_to_bits(0xffffff00)
[23:50:39] Ox0dea: nitenq: Then my advice is sound.
[23:51:13] Ox0dea: >> '0xffffff00'.to_i(16) == 0xffffff00
[23:51:13] shmilan: has joined #ruby
[23:51:14] ruboto: Ox0dea # => true (https://eval.in/402677)
[23:51:23] nitenq: oh ok thanks
[23:51:52] Ox0dea: >> class Fixnum; def bits; bit_length.pred.downto(0).map { |i| self[i] } end end; 0x0dea.bits
[23:51:53] ruboto: Ox0dea # => [1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0] (https://eval.in/402678)
[23:51:55] Ox0dea: For what that's worth.
[23:55:03] zenspider: >> 0x0dea.to_s(2).split(//).map(&:to_i)
[23:55:04] ruboto: zenspider # => [1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0] (https://eval.in/402679)
[23:55:51] Ox0dea: split(//) > chars?
[23:56:38] eggoez: has joined #ruby
[23:59:34] T3: has joined #ruby