« Back to channel list

#ruby - 25 February 2016

« Back 1 day Forward 1 day »
[00:00:16] nogic: has joined #ruby
[00:00:34] cpup: has joined #ruby
[00:00:42] Xeago: has joined #ruby
[00:00:48] havenwood: martin290: One of the popular Rack (http://rack.github.io) adapters: http://www.sinatrarb.com
[00:01:17] Ox0dea: This guy links.
[00:01:42] havenwood: martin290: Here're Hello Worlds in 16 Rack adapters as well as pure Rack: https://github.com/luislavena/bench-micro/tree/master/apps
[00:02:21] havenwood: martin290: I have a soft spot for Roda but Sinatra tutorials are easier to come by: http://roda.jeremyevans.net
[00:05:13] jeanlinux: has joined #ruby
[00:09:25] martin290: cool thanks!
[00:12:55] mostlybadfly: has joined #ruby
[00:14:39] hahuang65: has joined #ruby
[00:15:05] charliesome: has joined #ruby
[00:15:22] jottr: has joined #ruby
[00:17:49] askhat: has joined #ruby
[00:17:55] mattwashere: has joined #ruby
[00:18:06] haylon: has left #ruby: ("WeeChat 1.4")
[00:18:30] rl1: has joined #ruby
[00:18:34] DLSteve: has joined #ruby
[00:18:37] axisys: has joined #ruby
[00:18:38] axisys: has joined #ruby
[00:19:10] rl1: Hey guys I'm trying to replicate Elixir pipeoperator inside ruby. Passing the first argument of a previously evaluated function to the next one.
[00:19:16] rl1: https://gist.github.com/andrelip/7eb985ea327a04bdf171
[00:19:19] rl1: https://gist.github.com/andrelip/a13d5b2db01f4d0d80ad
[00:19:46] askhat: has joined #ruby
[00:19:48] rl1: But I run a lot of trouble when working with external modules like Math.
[00:20:10] rbennacer: has joined #ruby
[00:20:24] rl1: If I delegate Math.sin to a local method it works like a charm but If I call it external it handle that with the same arity. Any clue?
[00:20:34] vF3hNGxc47h8: has joined #ruby
[00:21:13] deimos: has joined #ruby
[00:21:38] askhat: has joined #ruby
[00:22:09] darkf: has joined #ruby
[00:22:11] jottr_: has joined #ruby
[00:22:25] tejasmanohar: has joined #ruby
[00:23:00] askhat: has joined #ruby
[00:24:18] baweaver: has joined #ruby
[00:24:44] askhat: has joined #ruby
[00:26:26] askhat: has joined #ruby
[00:27:32] spuk: has joined #ruby
[00:28:11] askhat: has joined #ruby
[00:28:19] zenspider: too much to look at
[00:28:56] zenspider: !ban askhat !T 1h please fix your connection
[00:28:56] ruby[bot]: +bbb $a:askhat$#ruby-banned askhat!*@*$#ruby-banned *!*@46.101.145.93$#ruby-banned
[00:28:56] ruby[bot]: ruby[bot] kicked askhat: fix your connection
[00:28:58] ruby[bot]: -bb *!*@unaffiliated/evilsushi$#ruby-banned *!*@unaffiliated/lovich$#ruby-banned
[00:30:05] zenspider: I don't get too much of that code to be able to help
[00:31:02] puerile: has joined #ruby
[00:31:32] mfb2: has joined #ruby
[00:33:15] griffindy: has joined #ruby
[00:33:45] Dreamer3: has joined #ruby
[00:34:22] nofacade: has joined #ruby
[00:41:34] darkf: has joined #ruby
[00:42:09] martin290: has left #ruby: ()
[00:43:28] Fezzler: has joined #ruby
[00:45:29] aupadhye: has joined #ruby
[00:46:26] darkf_: has joined #ruby
[00:47:05] jottr_: has joined #ruby
[00:48:10] mattwildig: has joined #ruby
[00:48:26] uglybandersnatc1: has left #ruby: ()
[00:48:27] uglybandersnatc1: has joined #ruby
[00:48:57] uglybandersnatc1: has left #ruby: ()
[00:48:57] uglybandersnatc1: has joined #ruby
[00:49:30] weemsledeux: has joined #ruby
[00:51:38] cyclonis: has joined #ruby
[00:52:42] Strawberrie: has joined #ruby
[00:53:05] griffindy: has joined #ruby
[00:53:09] Strawberrie: Hello there, anyone can help me pls ?
[00:53:23] kirillzh: has joined #ruby
[00:53:24] darkf: has joined #ruby
[00:54:14] Flakes: has joined #ruby
[00:54:28] kirillzh: has joined #ruby
[00:54:56] havenwood: Strawberrie: Pray tell your problem!
[00:55:41] Strawberrie: I really don't know how to use this, but I found this https://gist.github.com/jamiew/1080846
[00:55:45] kies^: has joined #ruby
[00:56:36] havenwood: Strawberrie: https://gist.github.com/jamiew/1080846#file-tumblr-photo-ripper-rb-L2-L3
[00:57:02] nanoz: has joined #ruby
[00:57:08] puerile: has joined #ruby
[00:57:14] havenwood: Strawberrie: ^ once you've downloaded or otherwise created the tumblr-photo-ripper.rb file
[00:57:27] havenwood: Strawberrie: then set your `site` as desired: https://gist.github.com/jamiew/1080846#file-tumblr-photo-ripper-rb-L9
[00:59:16] dcunit3d: has joined #ruby
[01:00:46] tvw: has joined #ruby
[01:00:49] joonty: has joined #ruby
[01:02:16] alexblom: has joined #ruby
[01:02:43] LoneHerm_: has joined #ruby
[01:03:36] darkf: has joined #ruby
[01:03:42] darkf: has joined #ruby
[01:03:54] Dreamer3: has joined #ruby
[01:06:49] darkf: has left #ruby: ()
[01:07:49] havenwood: Strawberrie: profit!
[01:09:19] rkazak: has joined #ruby
[01:11:43] elifoster: has joined #ruby
[01:13:30] jenrzzz: has joined #ruby
[01:14:23] bricker: has joined #ruby
[01:14:53] puerile: has joined #ruby
[01:15:38] Jeremy1023: has joined #ruby
[01:15:58] BTRE: has joined #ruby
[01:18:05] griffindy: has joined #ruby
[01:19:09] cjbottaro: has joined #ruby
[01:19:20] ebertx: has left #ruby: ()
[01:20:21] nolsen-: has joined #ruby
[01:22:57] nolsen-: has joined #ruby
[01:25:28] nolsen-: has joined #ruby
[01:25:56] choke: has joined #ruby
[01:26:08] Coldblackice: has joined #ruby
[01:26:51] shazaum_: has joined #ruby
[01:27:14] puerile: has joined #ruby
[01:27:44] nolsen-: has joined #ruby
[01:29:08] vdamewood: has joined #ruby
[01:29:31] ruby[bot]: -bbb $a:askhat$#ruby-banned askhat!*@*$#ruby-banned *!*@46.101.145.93$#ruby-banned
[01:29:37] puerile: has joined #ruby
[01:30:03] puerile: has joined #ruby
[01:30:45] robbyoconnor: has joined #ruby
[01:31:10] robbyoconnor: has joined #ruby
[01:31:42] skade: has joined #ruby
[01:32:22] Cohedrin: has joined #ruby
[01:32:34] teejayen: has joined #ruby
[01:32:41] Gnut: has joined #ruby
[01:33:38] eregi: has joined #ruby
[01:34:41] johnmilton: has joined #ruby
[01:35:25] hahuang65: has joined #ruby
[01:35:46] nolsen: has joined #ruby
[01:38:54] Noxilex: has joined #ruby
[01:39:07] Noxilex: Hello ruby programmers !
[01:40:20] griffindy: has joined #ruby
[01:42:52] duckpuppy: has joined #ruby
[01:43:32] recycle: has joined #ruby
[01:44:53] recycle: has joined #ruby
[01:45:51] krobzaur_: has joined #ruby
[01:46:14] Rodya_: has joined #ruby
[01:50:22] PaulCapestany: has joined #ruby
[01:51:34] charliesome: has joined #ruby
[01:52:24] htmldrum: has joined #ruby
[01:52:38] KensoDev: has joined #ruby
[01:52:57] robbyoconnor: has joined #ruby
[01:52:58] rkazak: has joined #ruby
[01:53:32] kirillzh: has joined #ruby
[01:53:59] yfeldblum: has joined #ruby
[01:57:22] sucks: has joined #ruby
[01:59:13] stannard: has joined #ruby
[01:59:28] Coldblackice: has joined #ruby
[02:02:18] KensoDev: has joined #ruby
[02:02:49] B1n4r10: has joined #ruby
[02:05:16] pdoherty: has joined #ruby
[02:06:23] Coldblackice: has joined #ruby
[02:10:53] ElFerna: has joined #ruby
[02:12:10] intrigueD: has joined #ruby
[02:12:24] bronson: has joined #ruby
[02:12:30] joe_s: has joined #ruby
[02:13:07] ledestin: has joined #ruby
[02:17:22] Dimik: has joined #ruby
[02:17:57] Coldblackice: has joined #ruby
[02:19:42] Kryptonical: has joined #ruby
[02:20:26] lpvb: has joined #ruby
[02:23:26] eregi: has joined #ruby
[02:26:58] hahuang65: has joined #ruby
[02:27:48] terminalrecluse: has joined #ruby
[02:31:07] x77686d: has joined #ruby
[02:31:20] Kryptonical: has joined #ruby
[02:31:49] stevemackinnon: has joined #ruby
[02:32:45] eregi: has joined #ruby
[02:32:52] Dimik: has joined #ruby
[02:33:11] johnmilton: has joined #ruby
[02:33:55] makenoise: has joined #ruby
[02:36:54] krobzaur_: has joined #ruby
[02:38:47] dcunit3d: has joined #ruby
[02:40:22] tneilen: has joined #ruby
[02:40:27] Channel6: has joined #ruby
[02:44:03] blackmes1: has joined #ruby
[02:45:05] hahuang61: has joined #ruby
[02:49:28] moei: has joined #ruby
[02:51:21] Kensei: has joined #ruby
[02:51:21] Kensei: has joined #ruby
[02:51:29] kam270: has joined #ruby
[02:52:42] bronson: has joined #ruby
[02:53:48] babblebre: has joined #ruby
[02:59:19] duncannz: has joined #ruby
[03:00:07] terminalrecluse: has joined #ruby
[03:01:29] joonty: has joined #ruby
[03:01:32] havenwood: Noxilex: halloooo
[03:02:04] havenwood: Noxilex: I mean, welcome!
[03:02:34] Noxilex: I'm kinda new to IRC, I was looking for a good ruby channel
[03:03:03] sneakerhax: has joined #ruby
[03:03:04] toretore: it's not good, but it's the only one
[03:03:16] havenwood: it's good, but it's not the only one
[03:04:51] cabargas: has joined #ruby
[03:05:49] nando293921: has joined #ruby
[03:09:11] rodolfowtf: has joined #ruby
[03:10:05] tulak: has joined #ruby
[03:10:22] phatso727: has joined #ruby
[03:10:32] nando293921: has joined #ruby
[03:10:38] unreal: has joined #ruby
[03:11:17] uglybandersnatc1: has joined #ruby
[03:11:38] Arcaire: >deprecation warnings when using Kernel methods
[03:11:40] Arcaire: thanks trump
[03:12:00] krobzaur_: has joined #ruby
[03:13:16] DmitryBochkarev: has joined #ruby
[03:13:35] arlek: has joined #ruby
[03:13:38] havenwood: timeout just deprecated itself, sua sponte
[03:14:05] havenwood: musta timed out
[03:14:38] Arcaire: Yeah timeout is the one.
[03:14:43] Arcaire: >warning: constant Kernel::TimeoutError is deprecated
[03:16:59] brijesh: has joined #ruby
[03:18:47] ensyde_: has joined #ruby
[03:19:32] brijesh: has joined #ruby
[03:21:01] weemsledeux: has joined #ruby
[03:23:45] moeabdol2: has joined #ruby
[03:24:31] fedexo: has joined #ruby
[03:27:24] KensoDev: has joined #ruby
[03:28:19] TomPeed: has joined #ruby
[03:28:23] brijesh: has joined #ruby
[03:29:56] Coldblackice_: has joined #ruby
[03:31:27] Musashi007: has joined #ruby
[03:32:02] nando293921: has joined #ruby
[03:32:26] kknight: has joined #ruby
[03:37:07] UtkarshRay: has joined #ruby
[03:37:39] Noxilex: You know other ruby channels ?
[03:40:28] skade: has joined #ruby
[03:40:58] havenwood: Noxilex: ##new2ruby is a "smaller, quieter place for aspiring Rubyists"
[03:41:07] cdg: has joined #ruby
[03:41:27] havenwood: Noxilex: #ruby-community is the perfect channel to discuss ways to improve this community
[03:41:38] havenwood: Noxilex: #ruby-offtopic is for playing hangman
[03:42:53] cdg: has joined #ruby
[03:42:54] havenwood: Noxilex: #ruby-pro, #rubyonrails, #rubygems, channels for various human langs, etc
[03:46:14] blackmes1: has joined #ruby
[03:46:23] dstarh: has joined #ruby
[03:47:27] havenwood: farewell Ruby 2.0!
[03:47:48] havenwood: Ruby 2.0 is dead, long live Ruby 2.3!
[03:48:09] graydot: has joined #ruby
[03:48:20] havenwood: And hello semantic versioning for all supported Rubies.
[03:48:49] havenwood: Refinements.
[03:48:52] makenoise: has joined #ruby
[03:49:21] Jeremy1023: has joined #ruby
[03:49:31] william3: has joined #ruby
[03:52:12] eregi: has joined #ruby
[03:52:40] havenwood: At least Refinements in the less primordial form.
[03:53:44] Jeremy1023: has joined #ruby
[03:54:56] havenwood: https://www.ruby-lang.org/en/news/2016/02/24/support-plan-of-ruby-2-0-0-and-2-1/
[03:55:16] havenwood: "We recommend that you start planning to upgrade to Ruby 2.3 or 2.2."
[03:55:18] Noxilex: Why did you choose to learn ruby ?
[03:55:35] brijesh: has joined #ruby
[03:56:07] havenwood: Noxilex: I started liking it and kept liking it.
[03:56:49] Noxilex: Also beginners tutorial are really great in this language
[03:57:09] devbug: has joined #ruby
[03:57:10] devbug_: has joined #ruby
[03:57:19] Noxilex: Do you know about codingame ?
[03:57:50] havenwood: Noxilex: nope
[03:58:11] Noxilex: How do you speak to me that way ?
[03:58:26] Noxilex: It is a /msg ?
[03:58:36] DmitryBochkarev: has joined #ruby
[03:58:56] Guest34101: has joined #ruby
[03:59:16] mattwildig: has joined #ruby
[03:59:49] havenwood: Noxilex: Nope, I type "Nox" then hit <tab>
[04:00:05] sondr3: has joined #ruby
[04:00:14] Noxilex: I've started ruby on codingame, it's a website where you can improve your skills in any language by solving puzzle or playing at clash of code: a gamemode where you have limited time to solve a problem before other participants
[04:00:28] Noxilex: havenwood: Oh ok
[04:00:59] Noxilex: good to know
[04:01:08] havenwood: Noxilex: Enjoying it so far?
[04:01:23] Mr0riss0: has joined #ruby
[04:01:30] cyclonis: has joined #ruby
[04:01:53] havenwood: Noxilex: codinggame.com
[04:01:56] Noxilex: havenwood: Anybody can see when we talk like that right ?
[04:02:04] havenwood: Noxilex: Reminds me of: https://www.bloc.io/ruby-warrior
[04:02:05] Noxilex: havenwood: Yes I do
[04:02:19] havenwood: Noxilex: Yes, it's just a way to highlight me but everyone can see.
[04:02:48] Noxilex: havenwood: It is nice because it sends me a notification
[04:02:58] havenwood: Noxilex: Ditto.
[04:02:59] Noxilex: havenwood: when you do so
[04:03:16] havenwood: ACTION dings
[04:03:50] gigetoo: has joined #ruby
[04:05:03] bahar: has joined #ruby
[04:05:29] cajone: has joined #ruby
[04:06:02] mattwild_: has joined #ruby
[04:07:36] tulak: has joined #ruby
[04:10:13] cajone: has joined #ruby
[04:10:25] Noxilex: havenwood: bloc.io looks great
[04:10:48] krzkrz: has joined #ruby
[04:11:10] Noxilex: havenwood: It's cool that it saves your progress through the game
[04:11:20] Xeago: has joined #ruby
[04:14:19] kam270: has joined #ruby
[04:16:41] Jeremy1023: has joined #ruby
[04:16:52] goodcodeguy: has joined #ruby
[04:18:03] braincrash: has joined #ruby
[04:18:33] cajone: has joined #ruby
[04:18:41] Hanmac: has joined #ruby
[04:19:22] UtkarshRay: has joined #ruby
[04:20:19] zast: has joined #ruby
[04:20:37] pawnbox: has joined #ruby
[04:21:17] gix: has joined #ruby
[04:21:34] sesquipedalian: has joined #ruby
[04:21:35] pleiosaur: has joined #ruby
[04:21:36] SirCmpwn: has joined #ruby
[04:21:45] skweek: has joined #ruby
[04:23:49] krobzaur: has joined #ruby
[04:25:43] Maxed: has joined #ruby
[04:26:55] tulak_: has joined #ruby
[04:29:10] hahuang65: has joined #ruby
[04:30:23] pawnbox: has joined #ruby
[04:35:15] rakm: has joined #ruby
[04:35:49] bricker: has joined #ruby
[04:37:00] cpup: has joined #ruby
[04:37:56] rbennacer: has joined #ruby
[04:38:00] sneakerhax: has joined #ruby
[04:40:06] cajone: has joined #ruby
[04:42:43] nando293921: has joined #ruby
[04:43:02] s00pcan: has joined #ruby
[04:43:20] chouhoul_: has joined #ruby
[04:44:55] jeanlinux: has joined #ruby
[04:45:09] Musashi007: has joined #ruby
[04:46:46] chouhoulis: has joined #ruby
[04:48:33] DmitryBochkarev: has joined #ruby
[04:49:16] blackmes1: has joined #ruby
[04:52:11] pawnbox: has joined #ruby
[04:56:35] RTG`: has joined #ruby
[04:57:17] dcunit3d: has joined #ruby
[05:02:20] joonty: has joined #ruby
[05:04:24] techietrash: has joined #ruby
[05:06:50] baweaver: has joined #ruby
[05:07:04] brendan-: has joined #ruby
[05:10:24] uglybandersnatch: has joined #ruby
[05:12:10] moeabdol2: has joined #ruby
[05:12:37] pawnbox: has joined #ruby
[05:15:11] skade: has joined #ruby
[05:15:44] znz_jp: has joined #ruby
[05:21:11] uglybandersnatch: has joined #ruby
[05:27:19] p1k: has joined #ruby
[05:27:59] krzkrzkrz: has joined #ruby
[05:28:37] terminalrecluse: has joined #ruby
[05:33:30] nando293921: has joined #ruby
[05:33:44] p1k_: has joined #ruby
[05:35:34] floatingpoint: has joined #ruby
[05:36:59] counterapparatus: has joined #ruby
[05:37:52] uglybandersnatch: has joined #ruby
[05:39:06] rbennacer: has joined #ruby
[05:39:40] johndoetest494: has joined #ruby
[05:41:05] unscrimped: has joined #ruby
[05:44:48] duncannz: has joined #ruby
[05:46:08] counterapparatus: has left #ruby: ()
[05:46:19] djbkd: has joined #ruby
[05:48:52] counterapparatus: has joined #ruby
[05:49:36] wilbert: has joined #ruby
[05:52:18] blackmes1: has joined #ruby
[05:54:03] nando293921: has joined #ruby
[05:56:54] jeanlinux: has joined #ruby
[05:59:35] Guest34101: has joined #ruby
[06:00:37] avenj: has joined #ruby
[06:01:25] nando293921: has joined #ruby
[06:01:45] cajone: has joined #ruby
[06:01:48] bricker: has joined #ruby
[06:10:26] jud: has joined #ruby
[06:12:00] cabargas: has joined #ruby
[06:15:32] nando293921: has joined #ruby
[06:17:48] sauvin: has joined #ruby
[06:19:02] minimalism: has joined #ruby
[06:20:55] avenj: has joined #ruby
[06:21:08] xfbs: has joined #ruby
[06:24:22] s00pcan: has joined #ruby
[06:25:13] dubek: has joined #ruby
[06:26:32] mattwashere: has joined #ruby
[06:27:17] mattwashere: has joined #ruby
[06:28:11] nachoman: has joined #ruby
[06:28:14] RTG`: has joined #ruby
[06:28:47] tulak: has joined #ruby
[06:30:28] sandstrom: has joined #ruby
[06:35:56] ItSANgo__: has joined #ruby
[06:35:58] ur5us: has joined #ruby
[06:36:27] nachoman: hi everyone
[06:37:01] nachoman: any recommended book to learn ruby internals?
[06:37:32] baweaver: Ruby under a microscope
[06:37:46] baweaver: or just start digging into the C source
[06:38:30] nachoman: hmm maybe a combination?
[06:38:34] ledestin: has joined #ruby
[06:39:27] chouhoulis: has joined #ruby
[06:39:33] ledestin: has joined #ruby
[06:39:41] rbennacer: has joined #ruby
[06:42:00] vigilate: has joined #ruby
[06:43:15] mattwildig: has joined #ruby
[06:43:19] statelesscode: has joined #ruby
[06:46:14] eam: nachoman: just start digging in and asking questions right here
[06:48:19] nachoman: ok thanks eam, baweaver :)
[06:48:47] kp666: has joined #ruby
[06:50:36] yardenbar: has joined #ruby
[06:53:15] RTG`: has joined #ruby
[06:53:27] neanderslob: has joined #ruby
[06:54:31] minimalism: has joined #ruby
[06:54:31] blackmes1: has joined #ruby
[06:55:53] solars: has joined #ruby
[06:57:17] counterapparatus: has left #ruby: ("all")
[06:59:26] uglybandersnatc-: has joined #ruby
[07:00:24] Guest34101: has joined #ruby
[07:00:52] norc: has joined #ruby
[07:09:24] charliesome: has joined #ruby
[07:09:41] solars: has joined #ruby
[07:12:16] TomyLobo: has joined #ruby
[07:13:17] gizless: has joined #ruby
[07:13:20] yfeldblum: has joined #ruby
[07:14:13] yfeldblum: has joined #ruby
[07:16:48] charliesome: has joined #ruby
[07:16:48] ur5us: has joined #ruby
[07:18:58] codecop: has joined #ruby
[07:22:20] y2mq37: has joined #ruby
[07:24:33] uglybandersnatch: has joined #ruby
[07:26:02] minimalism: has joined #ruby
[07:26:03] Mon_Ouie: has joined #ruby
[07:26:37] hahuang65: has joined #ruby
[07:27:35] charlemagne: has joined #ruby
[07:28:50] yardenbar: has joined #ruby
[07:31:51] tjbiddle: has joined #ruby
[07:32:17] moeabdol2: has joined #ruby
[07:35:39] skade: has joined #ruby
[07:37:29] amincd: has joined #ruby
[07:38:04] mark1: has joined #ruby
[07:38:41] amincd: hi, how would I write efficient code to sum the values in a range of array elements, e.g. sum(array[4] .. array[25])
[07:39:09] amincd: so I want to add up the value of each element between array[4] and array[25]
[07:39:23] trosborn: has joined #ruby
[07:39:34] amincd: I'm a Ruby beginner, so don't know all the ways to manipulate arrays
[07:40:44] chouhoulis: has joined #ruby
[07:42:23] andikr: has joined #ruby
[07:42:35] amincd: in python it's sum(array[4:26])
[07:42:35] aganov: has joined #ruby
[07:42:42] amincd: anything similar in Ruby?
[07:44:56] firstdayonthejob: has joined #ruby
[07:44:57] soLucien: has joined #ruby
[07:45:32] Garo_: amincd: how about [1,2,3,4,5,6,7][1..3].inject(0) {|sum,x| sum + x}
[07:45:38] DoubleMalt: has joined #ruby
[07:45:45] Garo_: so the [1..3] takes a sub array returning [2,3,4]
[07:45:59] charlemagne: has joined #ruby
[07:46:00] Garo_: amincd: then the inject() is used to evaluate an accumulator
[07:46:12] Garo_: amincd: http://ruby-doc.org/core-2.3.0/Enumerable.html#method-i-inject
[07:46:28] amincd: Garo_: thanks I'll check it out
[07:46:52] soLucien: what does @app.call(something)
[07:46:59] soLucien: what does the @ mean
[07:47:11] soLucien: i understand the rest of the synthax
[07:47:22] william3: has joined #ruby
[07:47:47] vigilate: has joined #ruby
[07:47:48] skade: has joined #ruby
[07:47:59] soLucien: @something - what is it ?
[07:48:36] Garo_: soLucien: https://rubymonk.com/learning/books/4-ruby-primer-ascent/chapters/45-more-classes/lessons/113-class-variables
[07:49:19] soLucien: ok it's the class instance variable
[07:50:20] kspencer: has joined #ruby
[07:51:03] skade: has joined #ruby
[07:51:40] despai: has joined #ruby
[07:53:02] konsolebox: has joined #ruby
[07:53:48] johnny56: has joined #ruby
[07:53:56] KensoDev: has joined #ruby
[07:55:55] blackmes1: has joined #ruby
[07:57:17] vdamewood: has joined #ruby
[07:57:26] toretore: has joined #ruby
[07:57:48] ferr: has joined #ruby
[07:58:39] pawnbox: has joined #ruby
[07:59:24] rdark: has joined #ruby
[08:01:31] mondok: has joined #ruby
[08:02:11] devbug: has joined #ruby
[08:07:04] SCHAAP137: has joined #ruby
[08:07:56] jas02: has joined #ruby
[08:09:44] thevaliantx: has joined #ruby
[08:09:54] smolny: has joined #ruby
[08:10:44] rohit_: has joined #ruby
[08:15:21] flughafen: can i print the current node htmlin capybara? i want to just print out what it sees's the within("#foo")
[08:16:05] sandstrom: has joined #ruby
[08:16:58] aufi: has joined #ruby
[08:23:00] verde: has joined #ruby
[08:23:19] Guest34101: has joined #ruby
[08:24:10] charlemagne: has joined #ruby
[08:24:21] pawnbox: has joined #ruby
[08:26:36] TDJACR: has joined #ruby
[08:26:46] Ropeney: has joined #ruby
[08:26:47] pawnbox: has joined #ruby
[08:26:57] TomyWork: has joined #ruby
[08:27:12] Anderson69s: has joined #ruby
[08:27:44] rohit_: has joined #ruby
[08:28:17] Xeago: has joined #ruby
[08:28:20] PlasmaStar: has joined #ruby
[08:29:07] eregi: has joined #ruby
[08:29:20] vigilate: has joined #ruby
[08:30:15] tulak: has joined #ruby
[08:30:15] pawnbox: has joined #ruby
[08:31:32] charliesome: has joined #ruby
[08:32:48] Pumukel: has joined #ruby
[08:34:24] steffkes: has joined #ruby
[08:34:24] steffkes: has joined #ruby
[08:36:38] skade: has joined #ruby
[08:38:07] rohit_: has joined #ruby
[08:38:09] anisha: has joined #ruby
[08:39:26] sepp2k: has joined #ruby
[08:39:58] krzkrzkrz: has joined #ruby
[08:42:27] rbennacer: has joined #ruby
[08:43:47] stannard: has joined #ruby
[08:43:56] lubekpl: has joined #ruby
[08:43:59] charlemagne: has joined #ruby
[08:44:03] mattwildig: has joined #ruby
[08:44:56] mikecmpbll: has joined #ruby
[08:45:27] jenrzzz: has joined #ruby
[08:47:10] Hounddog: has joined #ruby
[08:47:18] uglybandersnatch: has joined #ruby
[08:50:26] bweston92: has joined #ruby
[08:53:59] jimcroft: has joined #ruby
[08:54:12] xfbs: has joined #ruby
[08:57:18] blackmes1: has joined #ruby
[08:57:39] TDJACR: has joined #ruby
[08:58:57] baweaver: has joined #ruby
[09:01:25] contrastingly: has joined #ruby
[09:01:45] mikecmpbll: has joined #ruby
[09:12:36] tAn: has joined #ruby
[09:14:52] Kang0: has joined #ruby
[09:15:08] Jex: has joined #ruby
[09:16:35] xfbs: has joined #ruby
[09:16:43] blackmes1: has joined #ruby
[09:18:09] Xeago: has joined #ruby
[09:18:45] shredding: has joined #ruby
[09:20:00] blackgoat: has joined #ruby
[09:20:52] laith: has joined #ruby
[09:22:41] tmsbrg: has joined #ruby
[09:22:54] tmsbrg: where is gem's log file?
[09:23:49] william3: has joined #ruby
[09:24:01] tmsbrg: gem tells me "Check the mkmf.log file for more details."
[09:24:06] tmsbrg: and doesn't tell me where it is...
[09:25:05] adaedra: Gist the entire output.
[09:25:27] tmsbrg: wait, I found it
[09:26:11] ben_: has joined #ruby
[09:26:19] lipoqil: has joined #ruby
[09:26:49] tmsbrg: that was stupid, it failed to build native extensions because I have clang instead of GCC, and apparently libffi is hard-programmed to use GCC
[09:27:39] Macaveli: has joined #ruby
[09:29:35] last_staff: has joined #ruby
[09:29:53] william3: has joined #ruby
[09:30:27] apeiros: sombody got general experiences to share with regards to ruby + mssql? (asking over in #rubyonrails too)
[09:30:50] ruby[bot]: adaedra: I don't know anything about somebody
[09:31:10] eregi: has joined #ruby
[09:31:17] apeiros: context: there's a push from our parent company to move to mssql and we're trying to come up with pros&contras
[09:33:21] f4cl3y: has joined #ruby
[09:34:08] charlemagne: has joined #ruby
[09:34:15] djellemah_: has joined #ruby
[09:35:21] mlehrer: has joined #ruby
[09:35:38] william3_: has joined #ruby
[09:37:07] anisha_: has joined #ruby
[09:38:01] charlemagne: has joined #ruby
[09:40:26] william3: has joined #ruby
[09:40:48] FooMunki: has joined #ruby
[09:45:02] dlitvak: has joined #ruby
[09:46:26] FooMunki: has joined #ruby
[09:47:18] gregf: has joined #ruby
[09:47:25] pawnbox: has joined #ruby
[09:48:48] steffkes: has joined #ruby
[09:48:48] steffkes: has joined #ruby
[09:50:36] bruce_lee: has joined #ruby
[09:53:22] araujo: has joined #ruby
[09:53:22] araujo: has joined #ruby
[09:54:38] skade: has joined #ruby
[09:57:33] moeabdol: has joined #ruby
[09:58:26] bruce_lee: has joined #ruby
[09:59:24] kLOs: has joined #ruby
[09:59:50] kLOs: has left #ruby: ()
[10:00:43] chridal: Good morning guys
[10:00:48] nerium: has joined #ruby
[10:00:57] uglybandersnatch: has joined #ruby
[10:01:39] nerium: How do I create a hash from the Hash class (without using the {}-syntax) ? I’ve tried using Hash.new { a: 2 }, but that only returns an empty hash.
[10:01:54] chridal: I need a really high speed async worker queue. Have an API written in Rails, and we're spinning of a worker to hit Pusher (an external API that broadcasts our chat messages over TCP sockets to the clients). The thing is though that the jobs seem to not only take a time to finish, but also to just be taken off the queue
[10:02:04] adaedra: nerium: why?
[10:02:16] nerium: adaedra: Inheritence
[10:02:30] chridal: And also; what could be a good way of benchmarking this?
[10:02:52] adaedra: nerium: why are you inheriting from Hash?
[10:03:15] nerium: adaedra: b/c I need to add some custom methods to it
[10:03:45] adaedra: You should wrap it rather than inherit from it
[10:04:23] nerium: Care to elaborate?
[10:04:34] adaedra: Have a custom class which has the hash as instance variable
[10:05:00] nerium: Why would I do that?
[10:06:05] xfbs: has joined #ruby
[10:06:19] nerium: That sounds like a bad implementation as I would have to deligate every method from my custom class to the hash
[10:06:41] BrunoSaboia: has joined #ruby
[10:06:45] nerium: Which would yeild the exact same impl. as just using inheritance, except for all the code
[10:07:06] william3: has joined #ruby
[10:07:25] ddv: nerium: Use inheritance only when there are clearly related reusable pieces of code that fit under a single common concept or if you have to because of something you're using.
[10:08:25] nerium: ddv: Its the exact same instance of Hash, just with a cuple of custom methods. That’s all. It’s should still act as a hash
[10:09:44] nerium: Anyhow, how do I create a hash from scratch with init data, like I would expect .new(..) would do
[10:09:56] noodle: has joined #ruby
[10:10:09] jurisdiction: has joined #ruby
[10:10:28] ddv: nerium: https://www.thoughtworks.com/insights/blog/composition-vs-inheritance-how-choose
[10:12:38] nerium: ddv: How would you solve this problem?
[10:13:46] platzhirsch: has joined #ruby
[10:13:46] adaedra: Looks like a fit for refinements, no?
[10:13:52] ddv: nerium: first explain why you even want to do this
[10:14:59] arian0n: has joined #ruby
[10:15:15] nerium: ddv: That’s a bit out of the scope for this question. Just imagen that I’ve to add a method to an arbirtary class. (I’ve already solved the original problem, so I’m just curoius on how you would solve it)
[10:15:28] nerium: adaedra: That’s way to overkill
[10:15:31] ruby[bot]: it seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
[10:15:41] platzhirsch: has left #ruby: ()
[10:15:51] pietr0: has joined #ruby
[10:15:55] nerium: yeah, I know about xy, I’ve been in this comunity for over 10 years
[10:16:48] norc: Refine, inherit or use Delegate.
[10:16:56] norc: Those are your basic three options to do what you want.
[10:17:09] norc: Each with its own up and downsides.
[10:18:50] apeiros: inherit: only from classes you own.
[10:18:58] apeiros: simple rule :)
[10:19:12] nerium: apeiros: Okay, that’s an interesting argument
[10:19:16] chridal: Currently having this issue: on a Rails API but we're hitting external APIs, and it needs to happen really fast. Currently using Resque-workers but it's slow. How to benchmark this? Also do I look at solving this with EventMachine, or even Node?
[10:19:26] nerium: apeiros: or view
[10:19:39] apeiros: was just gonna say that I didn't yet make an argument for that view ;-D
[10:20:11] nerium: apeiros: So what would you do if you needed to add a custom method to say the String class?
[10:20:28] apeiros: nerium: with ruby? I'm experimenting with refinements atm
[10:20:29] ddv: chridal: #rubyonrails, also you asked the same question earlier this week right?
[10:20:48] apeiros: nerium: though one question before that would be whether String is actually the right place and why
[10:20:50] chridal: ddv: No. I was talking about it in #RubyOnRails indeed. Started on a rewrite in Node
[10:21:08] chridal: But the thing is that there is nothing like Rails in Node, and the code becomes messy nearly right away
[10:21:13] ddv: chridal: 'really fast' is kind of subjective
[10:21:13] chridal: So I am trying to look at it again
[10:21:24] ddv: chridal: come up with a baseline first
[10:21:30] chridal: ddv: How about this; spending 50-150 ms to take the worker off the queue is totally unacceptable
[10:21:50] chridal: ddv: I need messages that come into the API to have hit the external Pusher nearly instantly
[10:22:02] chridal: Talking less than 10 ms here preferably
[10:22:07] ddv: chridal: why are you backgrounding this?
[10:22:12] nerium: apeiros: That’s sound scarry for someone getting passed the object. Say you add a method to String, make the object public. I twould look really strange if it suddendlty contained a custom method even tho it’s still a string.
[10:22:23] chridal: ddv: Because we need to hit an external API, and I don't want to block the entire API while we do so.
[10:22:25] nerium: Inheritence seams like a much better fit
[10:22:27] workmad3: has joined #ruby
[10:22:32] apeiros: nerium: talking about refinements?
[10:22:37] nerium: apeiros: Yes
[10:22:42] apeiros: nerium: that's not how they work
[10:22:48] apeiros: refinements are lexically scoped
[10:22:59] apeiros: i.e. the method exists at the place where you say you need it
[10:23:17] apeiros: so nothing scary about it. you know you're adding the methods for that piece of code only.
[10:23:28] nerium: apeiros: But if you create an object inside your ”space”, and make this object public, wont it still contain your method?
[10:23:37] apeiros: that's the point
[10:23:46] nerium: I trought this only applied to the class
[10:23:46] apeiros: extend would do that. refining doesn't
[10:23:56] nerium: not the instances of the object
[10:24:05] apeiros: it applies to everything you refine.
[10:24:12] nerium: In this case I’m making the object public
[10:24:44] apeiros: yes. and the method will only be available to code within the block where you have `using MyStringRefinement`
[10:24:48] apeiros: nowhere else
[10:25:17] Guest34101: has joined #ruby
[10:25:29] chridal: ddv: The use case is this: We have iOS clients that are connected via a websocket to Pusher (a SaaS). We hit their REST API and it then gets broadcasted to all the listening devices. The user calls POST /message from the client, we spawn a worker which then hits their REST API. We can't block on the main thread, so we need to do it in a worker.
[10:25:53] tvw: has joined #ruby
[10:25:55] ddv: chridal: why not writing directly to redis?
[10:25:56] chridal: We also need for this to be nearly instant on the Rails side, because we might also have 50-200 ms on reaching Pusher and the messages actually being propagated to the listeners.
[10:26:10] chridal: ddv: Instead of spawning the worker ddv?
[10:26:27] nerium: apeiros: Okay
[10:26:32] nerium: Thanks for the clearification
[10:26:40] chridal: ddv: Hm. That's an idea. How much time do you think we can save? Is there a big overhead with .perform_later?
[10:27:36] chridal: Which also brings me to the next part; I need some good way of benchmarking this
[10:27:55] chridal: So that I can make an informed decision on what we can save on moving to something like Node.
[10:28:18] chridal: Sidekiq says on their GH that someone achieved 50,000 workers per second with that lib
[10:28:35] ddv: chridal: well are you using the paid version?
[10:28:53] chridal: ddv: We could be, if it would save us that time.
[10:29:10] chridal: Rewriting in Node is really a last last last option
[10:29:10] apeiros: chridal: 50kw/s might not be relevant to you though, since your problem seems to be the latency
[10:29:20] ddv: anyways this is way offtopic in here
[10:29:21] apeiros: at least from the quick glance through your convo
[10:29:33] chridal: ddv: why is it off-topic though? it's not about Rails
[10:29:36] chridal: It's about a Ruby gem.
[10:30:10] ddv: chridal: You are using this with Rails
[10:30:29] chridal: It's sort of in the gray zone.
[10:30:34] chridal: But alright.
[10:30:57] chridal: apeiros: Any thoughts about how I should be looking at this to achieve the needed performance gain though?
[10:31:02] tulak: has joined #ruby
[10:31:02] dlitvak: has joined #ruby
[10:31:10] chridal: Just really struggling to get a conversation about it going in Rails.
[10:31:27] apeiros: ddv: IMO it's fine. but it's borderline.
[10:31:51] apeiros: chridal: don't use workers, use threads?
[10:31:56] eregi: has joined #ruby
[10:31:57] ddv: he asked the same questions in #rubyonrails and because he couldn't get satisyfing answers there and answers that align with his opinions he asks them here
[10:31:58] chridal: apeiros: So run it on the JVM?
[10:32:10] chridal: ddv: It's more like the people in Rails don't think it's enough about Rail
[10:32:14] chridal: since it's really not about Rails
[10:32:20] chridal: It's about an async worker queue.
[10:32:23] apeiros: not necessary. IO based threading is fine in ruby. unless there's lots of CPU involved in getting the data to Pusher
[10:33:03] chridal: apeiros: So the GIL won't interfere with this?
[10:33:03] apeiros: but yes, jruby will help with threading and will quite likely get more performance
[10:33:36] apeiros: chridal: GIL will interfere, but I'd assume not as much, since your problem is probably mostly IO related
[10:34:01] Ropeney: has joined #ruby
[10:34:14] chridal: apeiros: It is indeed an IO problem, because I won't do "any processing at all" before shipping it off.
[10:34:16] apeiros: but unless you have something which stops you from using jruby, I'd try with that. as it can parallelize more than just IO
[10:34:20] chridal: I just need to hit that API async
[10:34:36] chridal: apeiros: well, I really don't want to get into deploying the JVM if I can avoid it.
[10:34:42] apeiros: yeah, then spin off a thread, hit the API and let the thread die. threads in ruby are not that expensive.
[10:34:58] apeiros: just make sure you box them proberly with regards to exceptions (by default, threads die silently)
[10:34:59] blaxter: has joined #ruby
[10:35:08] terlar: has joined #ruby
[10:35:25] chridal: Very interesting. Any litterature I should dive into before going down this route?
[10:35:34] Axy: has joined #ruby
[10:35:34] Axy: has joined #ruby
[10:35:39] romancpodolski: has joined #ruby
[10:36:28] romancpodolski: Hey folks, anyone using ruby for machinelearing?
[10:37:30] apeiros: chridal: not aware of any. it'll be mostly the code you already have in your worker, but called within a new thread.
[10:37:57] chridal: Yea, just thinking about stuff to be weary about now that I'm doing this in a threaded manner.
[10:38:29] apeiros: Thread.new begin; existing_call; rescue => e; handle_exception(e); end # that's the basic setup
[10:38:43] p1k_: has joined #ruby
[10:39:13] chridal: Alright. I'll do some benchmarking and see what kinds of speed improvements we get with this setup.
[10:39:15] chridal: Thanks a lot.
[10:39:32] apeiros: lets hope it's useful ;-)
[10:39:56] chridal: Indeed. After spending the last 4 days in Node I was really grateful when I returned to Ruby + Rails.
[10:41:29] apeiros: chridal: overhead to spawn a thread seems to be around 0.05ms in ruby 2.3 on my machine (2.3GHz i7 on OSX 10.11)
[10:42:01] apeiros: the rest is a question of whether those threads will slow your app down too much or not
[10:42:07] charliesome: has joined #ruby
[10:42:18] chridal: apeiros: Indeed. Which is the scary question because it'll be hard to measure.
[10:42:58] apeiros: shouldn't be too difficult
[10:43:08] chridal: I also thought about writing a microservice with EventMachine and then hit the Rails API for persistence and just hit Pusher from there
[10:43:20] apeiros: that'd be an option, yes
[10:43:34] apeiros: that'd remove the latency
[10:43:45] chridal: and it'd decouple it entirely from the app server
[10:43:53] chridal: or not entirely obviously
[10:43:56] chridal: because of the persistence
[10:44:01] chridal: but the spawning of threads etc.
[10:44:29] apeiros: spawning of threads has the advantage of being rather simple to implement
[10:44:42] steffkes: has joined #ruby
[10:44:42] steffkes: has joined #ruby
[10:44:58] apeiros: the one thing with regards to rails you have to be aware is connection pooling if you do any db work in the new thread
[10:45:01] chridal: Yea. If we go for the microservice that means another load balancer and servers behind there which need to support continuous deployment and their own staging area which means at least 3 servers + load balancer
[10:45:02] mattwildig: has joined #ruby
[10:45:16] apeiros: you have to check out a new connection and check it in again at the end (best in the ensure of your exception boxing of the thread)
[10:46:13] apeiros: I can gist you the code of our Thread.with_connection if you wish. it handles both boxing and checking out/in a connection. would have to do after lunch, though :)
[10:47:12] chridal: apeiros: That would be really awesome!
[10:47:17] apeiros: ah, the other thing you have to be aware: if any of those threads is running while you kill the server, the "job" is lost unless you manually build countermeasures. but that might be arbitrarily complex no matter which solution you choose.
[10:47:27] quazimodo: has joined #ruby
[10:47:41] apeiros: chridal: ok. bing me in ~1h if I haven't gisted until then. laters! :)
[10:48:43] chridal: apeiros: Cheers! Later :-)
[10:49:00] rbennacer: has joined #ruby
[10:49:32] ziyadb: has joined #ruby
[10:51:47] dlitvak_: has joined #ruby
[10:52:12] davidsong: has joined #ruby
[10:52:58] davidsong: hello ruby. I have a newb question. I have an array of arrays, [[1,2,3], [3,4,5]] and want to replace all the 3s with zeros
[10:53:45] davidsong: is there a "nice" way to do this? rather than in the bloated style of other languges where you explicitly iterate over creating a new list of lists
[10:56:18] maikowblue: has joined #ruby
[10:56:35] pandaant: has joined #ruby
[10:57:37] Ox0dea: davidsong: https://eval.in/525147
[10:58:42] blaxter: has joined #ruby
[10:58:53] mhoungbo: has joined #ruby
[10:59:16] snowy: has joined #ruby
[11:00:20] rodfersou: has joined #ruby
[11:01:44] trinaldi: has joined #ruby
[11:02:17] davidsong: woa, thanks
[11:03:37] pawnbox: has joined #ruby
[11:03:44] Ox0dea: Sure thing.
[11:03:53] Ox0dea: That pattern extends well to most other Enumerable methods as well.
[11:04:24] Ox0dea: s/map/select/g and you've got #deep_select. :)
[11:05:19] f4cl3y: has joined #ruby
[11:05:26] tris: has joined #ruby
[11:06:05] adaedra: Ox0dea: why use `Array ===` and not `Enumerable ===`, or maybe even `e.respond_to? :map`?
[11:06:28] Ox0dea: adaedra: Yeah, that last one's pretty good.
[11:07:35] adaedra: And put deep_map in Enumerable, maybe
[11:09:15] Guest34101: has joined #ruby
[11:10:04] Ox0dea: adaedra: That didn't go so well: https://eval.in/525152
[11:12:21] ocbtec: has joined #ruby
[11:20:26] adaedra: Ox0dea why does it do that?
[11:20:43] Ox0dea: adaedra: I don't know. :/
[11:20:50] adaedra: Interesting
[11:20:52] Ox0dea: I would expect a flat Array of size two.
[11:21:18] Ox0dea: Hash#each yields a pair, and if you're mapping that to some value...
[11:23:46] BSaboia: has joined #ruby
[11:24:16] rbennacer: has joined #ruby
[11:25:02] apeiros: chridal: https://gist.github.com/apeiros/6f139cf06ad36e023f46 - it's a contraction of two things in our codebase, but I think I merged the two correctly ;-)
[11:25:37] apeiros: you need to implement ExceptionHandler.handle yourself. f.ex. we send the exception to errbit there and log it via Rails.logger.error
[11:25:59] BSab: has joined #ruby
[11:26:09] dlitvak: has joined #ruby
[11:26:13] joonty: has joined #ruby
[11:28:32] adaedra: Ox0dea: thinking about it, is it not expected result, after all?
[11:29:23] Ox0dea: adaedra: https://eval.in/525160
[11:29:27] Couch: has joined #ruby
[11:29:31] Ox0dea: That "feels" wrong, but I can't put my finger on it.
[11:30:25] adaedra: Feels so, but is it really?
[11:30:46] adaedra: Otherwise, you have to provide a special deep_map for hash
[11:31:02] nachoman: has joined #ruby
[11:31:30] puerile: has joined #ruby
[11:31:36] adaedra: mh, last example is indeed weird
[11:32:29] adaedra: didn't we find a special thing about Hash in here recently? Something about two method reacting differently about parameters
[11:32:40] jimcroft_: has joined #ruby
[11:32:41] Ox0dea: Yeah, #select and #reject return Hashes. :/
[11:32:45] eregi: has joined #ruby
[11:32:51] Ox0dea: Hash doesn't play well with being Enumerable sometimes.
[11:33:15] jimcroft_: has joined #ruby
[11:33:35] Ox0dea: Pseudo-multiple return values also came into it.
[11:33:58] jimcroft: has joined #ruby
[11:34:06] adaedra: Ox0dea: anyway, here's your chance: https://rubygems.org/search?utf8=%E2%9C%93&query=deep_map
[11:34:21] Ox0dea: Ew, that's so clinical.
[11:34:36] rbennacer: has joined #ruby
[11:34:53] steffkes: has joined #ruby
[11:35:28] blackmes1: has joined #ruby
[11:37:03] Gasher: has joined #ruby
[11:37:31] Gasher: hi everyone, do you know where I can find a channel for Crystal language? I'm asking here because it's a Ruby-like language
[11:38:00] ruby[bot]: adaedra: I don't know anything about crystal
[11:38:05] adaedra: You don't?
[11:38:21] adaedra: Gasher try #crystal or #crystal-lang, I don't remember
[11:38:45] Gasher: it was #crystal-lang , I just checked #crystal , thanks
[11:39:24] adaedra: !fact mk crystal Please join #crystal-lang for help with it.
[11:39:25] ruby[bot]: adaedra: I will remember that crystal is Please join #crystal-lang for help with it.
[11:39:49] Ox0dea: Join #crystal-lang for help with #crystal-lang?
[11:40:03] adaedra: ACTION wakes up.
[11:40:09] ruby[bot]: Please join #crystal-lang for help with it.
[11:40:35] shevy: jhass changed #ruby-lang into #ruby but the crystal folks still don't have #crystal
[11:40:52] adaedra: !fact ed crystal Please join #crystal-lang for help with the Crystal programming language.
[11:40:52] ruby[bot]: adaedra: I stand corrected that crystal is Please join #crystal-lang for help with the Crystal programming language.
[11:41:08] adaedra: Thanks for the notice, Ox0dea.
[11:41:22] adaedra: shevy: register.
[11:41:23] Ox0dea: adaedra: Thanks for loving clarity. :)
[11:41:35] shevy: adaedra I want ruboto back :(
[11:41:53] shevy: cuz rubot was kind and not as snobbish
[11:41:57] shevy: erm ruboto
[11:42:02] Ox0dea: It does feel like something's missing, oddly enough.
[11:42:03] tulak: has joined #ruby
[11:42:09] Ox0dea: ruboto just had more "character".
[11:42:36] shevy: we are legend-building now :) like the day when ruboto helped an old lady over a street
[11:43:51] marr: has joined #ruby
[11:43:56] Ox0dea: "This book is dedicated, in respect and admiration, to the spirit that lives in the computer."
[11:44:44] manveru: Gasher: next time: `/msg alis list *crystal*`
[11:45:20] Gasher: manveru; who/what is alis?
[11:45:37] manveru: another bot
[11:45:53] manveru: it has a list of all channels
[11:46:03] jottr_: has joined #ruby
[11:46:12] laith: has joined #ruby
[11:46:15] manveru: it's an official freenode bot like chanserv, because they had to disable /list
[11:46:26] Gasher: I see, thanks
[11:46:48] _mak: how can I do this: puts t.tds(:id => 'descr')[0].text if t.tds(:id => 'descr').exist? else "doesn't exist"
[11:47:12] evidex: has joined #ruby
[11:47:30] ldnunes: has joined #ruby
[11:47:53] apeiros: _mak: `desc = t.tds(:id => 'descr'); puts desc ? desc[0].text : "doesn't exist"`
[11:48:07] laith: has joined #ruby
[11:48:24] apeiros: or `desc.exist?` instead of bare `desc` if that was meant literally.
[11:49:50] mdw: has joined #ruby
[11:50:30] Ox0dea: Or `desc[0]&.text || "doesn't exist"`.
[11:51:12] manveru: that fails if desc is nil
[11:51:32] apeiros: right. assuming they use ruby 2.3
[11:51:39] Gasher: has left #ruby: ("Leaving")
[11:51:46] Ox0dea: manveru: `desc&.[](0)&.text`, then. :P
[11:51:52] _mak: I use 2.2
[11:51:53] apeiros: actually, `desc&.[](0).text || …` following their code
[11:52:08] _mak: ACTION is trying to not get lost
[11:52:10] apeiros: _mak: you should specify your ruby version if you don't use the newest.
[11:52:22] manveru: come on, say 1.6.4
[11:52:47] DaniG2k: has joined #ruby
[11:53:07] _mak: so it would be: descr = t.tds(:id => 'descr'); desc.exist? desc[0].text : "doesn't exist" and then I can simply puts descr
[11:53:51] zcreative: has joined #ruby
[11:54:30] apeiros: a) misses a ?, b) no, because ?: doesn't change anything, it has a return value
[11:54:53] manveru: where does that exist? method come from anyway
[11:55:06] apeiros: the construct I used was `puts condition ? when_true : when_false`
[11:55:07] _mak: watir-webdriver
[11:55:18] _mak: it will check if the element exists on the page
[11:55:24] manveru: so tds never returns nil?
[11:55:37] adaedra: watir love
[11:55:40] dlitvak: has joined #ruby
[11:55:52] _mak: manveru: it will return falst
[11:55:58] _mak: if not found
[11:56:05] manveru: i mean the tds method
[11:56:10] manveru: not the exist? method
[11:56:20] _mak: it will never be nil
[11:56:37] manveru: desc = t.tds(:id => 'descr'); desc = desc.exist? ? desc[0].text : "doesn't exist"
[11:56:41] manveru: so you want that
[11:58:04] _mak: descr = t.tds(:id => 'descr').exist? ? desc[0].text : ""
[11:58:41] adaedra: shorter is not always better.
[11:58:42] manveru: desc isn't defined, so you can call [0] on it
[11:59:26] manveru: if you want to make it really short, you could do: `(desc = t.tds(:id => 'descr')).exist? ? desc[0].text : "doesn't exist"`
[11:59:40] manveru: but then apeiros will have to kill a kitten
[11:59:47] ruby[bot]: adaedra: I don't know anything about cat
[11:59:49] _mak: I won't then
[11:59:53] apeiros: whaaaat?!?
[12:00:03] _mak: ok, I'll use the long way
[12:00:07] _mak: thanks guys
[12:00:13] adaedra: you're slow, ruby[bot]
[12:00:42] charliesome: has joined #ruby
[12:01:21] chridal: apeiros: Thanks! Will have a look.
[12:01:30] manveru: /rename ruby[bot] roboto
[12:01:37] chridal: Out of curiousity: what are you using threads for in your application?
[12:01:40] apeiros: roboto? yet another nick?
[12:01:44] platzhirsch: has joined #ruby
[12:01:51] manveru: ruboto exists already, no?
[12:01:59] apeiros: ruboto is owned by me
[12:02:05] apeiros: or the nick
[12:02:11] apeiros: chridal: exchange webservice (ews)
[12:02:35] manveru: so i suggest roboto :)
[12:02:36] chridal: apeiros: But what does the code in the thread do?
[12:02:56] apeiros: add calendar entries f.ex.
[12:03:06] apeiros: ews is sometimes horribly slow for us (~2s for a response)
[12:03:31] steffkes: has joined #ruby
[12:03:41] steffkes: has joined #ruby
[12:04:41] apeiros: i.e. we add the entry to our db, spin up a thread to push it over to exchange/outlook and then update the db entry with the exchange id for synchronization
[12:05:09] apeiros: rails can return & render without having to wait for snaily exchange
[12:05:51] krzkrzkrz: has joined #ruby
[12:05:53] ElFerna: has joined #ruby
[12:10:43] JohnBat26: has joined #ruby
[12:10:46] millerti: has joined #ruby
[12:11:05] Xeago: has joined #ruby
[12:11:48] chridal: Aha! Sounds much like our use case
[12:12:02] chridal: What kind of penalty are you taking for spinning up that thread?
[12:12:14] chridal: Is this an often performed action?
[12:13:09] xfbs: has joined #ruby
[12:14:43] jeanlinux: has joined #ruby
[12:15:22] dlitvak: has joined #ruby
[12:15:28] UtkarshRay: has joined #ruby
[12:16:32] DaniG2k: has joined #ruby
[12:16:53] apeiros: chridal: as per my measurement above - it's about 0.05ms on my machine. don't know how long the connection clearing takes.
[12:18:31] mhoungbo: has joined #ruby
[12:18:33] p1k_: has joined #ruby
[12:18:44] kobain: has joined #ruby
[12:19:25] Xeago: has joined #ruby
[12:20:37] sluukkonen: has joined #ruby
[12:23:03] platzhirsch: has joined #ruby
[12:26:27] Xeago: has joined #ruby
[12:30:06] dlitvak: has joined #ruby
[12:30:39] skade: has joined #ruby
[12:31:29] johnmilton: has joined #ruby
[12:32:55] duckpuppy: has joined #ruby
[12:33:30] eregi: has joined #ruby
[12:34:05] kp666: has joined #ruby
[12:34:27] sgambino: has joined #ruby
[12:34:27] xfbs: has joined #ruby
[12:34:50] kp666: has joined #ruby
[12:35:50] openstruct: has joined #ruby
[12:36:48] dlitvak_: has joined #ruby
[12:37:19] askhat: has joined #ruby
[12:38:02] askhat: has left #ruby: ()
[12:38:52] _mak: has left #ruby: ("..")
[12:40:04] bahar: has joined #ruby
[12:40:41] sandstrom: has joined #ruby
[12:41:17] Xeago: has joined #ruby
[12:43:32] lessless: has joined #ruby
[12:44:04] lessless: guys, do you know any better way to copy a part of the hash than @params.select { |k| %w(a b c d e f g h j k l m n o).include?(k) }
[12:44:30] shevy: he used guys!!!
[12:44:59] armyriad: has joined #ruby
[12:44:59] apeiros: lessless: check the code of activesupport's Hash#slice
[12:45:29] lessless: apeiros, thank you!
[12:45:52] mattwildig: has joined #ruby
[12:48:22] silverdust: How may I check if a method exists in a struct?
[12:48:59] OSIRIS_: has joined #ruby
[12:50:00] havenwood: silverdust: members.include? :meth
[12:50:16] silverdust: I have [['id',5],['name','Joe']].to_h.to_struct for example which gives #<struct id=5, name="Joe"> . Can I do the_struct.include? :name
[12:50:41] bronson_: has joined #ruby
[12:51:17] silverdust: havenwood: I get false when I check for name and name exists in it
[12:52:15] sgambino: has joined #ruby
[12:52:27] sdothum: has joined #ruby
[12:52:44] silverdust: i = [['id',5],['name','Joe']].to_h.to_struct; i.include? :name #=> false
[12:52:54] dlitvak: has joined #ruby
[12:53:10] ljarvis: silverdust: where does to_struct come from?
[12:53:26] ljarvis: also, as havenwood mentioned, it's .members.include?
[12:53:50] silverdust: I use hashtostruct gem
[12:54:32] silverdust: It works with .members.include? I didn't know he meant members as a method of my struct
[12:54:39] ljarvis: >> Struct.new(:name).new("foo").members
[12:54:40] ruby[bot]: ljarvis: # => [:name] (https://eval.in/525352)
[12:55:22] ljarvis: also, presumably that gem just does Struct.new(*keys).new(*values), is it really worth it?
[12:55:36] armyriad: has joined #ruby
[12:55:54] steffkes: has joined #ruby
[12:55:54] steffkes: has joined #ruby
[12:56:42] ljarvis: oh dear, nope.. it's much worse than that
[12:56:51] apeiros: Hash#to_struct… I don't even…
[12:57:03] ljarvis: apeiros: prepare yourself... https://github.com/openback/hashtostruct/blob/master/lib/hashtostruct.rb
[12:57:23] apeiros: ljarvis: WHY DO YOU DO THIS TO ME?!?
[12:57:30] ljarvis: i had to go through it :(
[12:57:51] apeiros: I'm with data on this one - how the F is shared suffering half the suffering?!? it's double the suffering!
[12:58:10] ljarvis: silverdust: please dont use that gem
[12:58:21] ljarvis: I mean, unless you *really* know you need it
[12:58:29] ljarvis: ACTION stares at to_obj 
[12:58:42] apeiros: wrong anchors for a start
[12:59:07] ljarvis: also, lul at inject instead of map
[12:59:26] apeiros: (tru|fals)e # optimize!
[12:59:48] apeiros: old me would probably have committed the same crime.
[12:59:59] ljarvis: [+-]?\d+ :|
[13:00:18] silverdust: ljarvis: I wouldn't if I knew a better way to convert my hash to struct
[13:00:20] atmosx: has joined #ruby
[13:00:22] charlemagne: has joined #ruby
[13:00:36] mxn: has joined #ruby
[13:00:37] silverdust: I have very little expertise and it was my first solution to what I wanted
[13:00:51] ljarvis: silverdust: like this: Struct.new(*hash.keys.map(&:to_sym)).new(hash.values) -- now you can customise it to how you really want
[13:01:01] ljarvis: *hash.values *
[13:01:30] ljarvis: then add some error checking so it doesn't blow up
[13:01:32] mxn: hi! i'm trying to install the librarian-puppet gem on a debian stable system, which fails cause the ruby version is too old for one of the dependencies. i'd like to figure out where exactly the issue is, so i would love to print a gem dependency tree
[13:02:06] mxn: 'gem dependency librarian-puppet' gives me something useful, but if i attempt the same for each of the dependencies, it fails for some, e.g. rspec
[13:02:32] mxn: oh, 'of an installed gem', got it. so, how do i do this for non-installed gems?
[13:02:37] joonty: has joined #ruby
[13:02:57] apeiros: ljarvis: you can drop the to_sym if you add a nil as first arg
[13:03:13] ljarvis: ah yeah i guess it expects a symbol for the constant?
[13:03:15] mxn: or in other ways: is there many a way i can make gem install an older version of a dependency (which still is new enough to fit the dependency), which will not require a ruby that's not available for debian stable?
[13:03:19] apeiros: Struct.new(nil, *hash.keys).new(*hash.values)
[13:03:34] havenwood: >> h = {aim: true}; Struct.new(nil, *h.keys).new(*h.values)
[13:03:35] ruby[bot]: havenwood: # => #<struct aim=true> (https://eval.in/525354)
[13:03:56] apeiros: ljarvis: na, if the first value is a string, it'll use that as a constant. with a symbol it won't use it for the constant. sad case of argument overloading
[13:04:04] apeiros: or whatever the proper term is
[13:04:55] silverdust: ljarvis: can you please help me understand what the role of * there is. I tried omitting it and name was nil, id had both values in it as an array
[13:05:34] havenwood: >> h = {aim: true}; Struct.new('StructStructStruct', *h.keys).new(*h.values)
[13:05:35] ruby[bot]: havenwood: # => #<struct Struct::StructStructStruct aim=true> (https://eval.in/525357)
[13:06:10] william3: has joined #ruby
[13:06:22] synthroid: has joined #ruby
[13:06:30] platzhirsch: has joined #ruby
[13:06:36] dlitvak_: has joined #ruby
[13:06:42] p7r_: has left #ruby: ()
[13:07:05] Ox0dea: >> require 'ostruct'; h = {aim: true}; OpenStruct.new h
[13:07:06] ruby[bot]: Ox0dea: # => #<OpenStruct aim=true> (https://eval.in/525359)
[13:07:09] Ox0dea: (Just kidding.)
[13:09:57] bruce_lee: has joined #ruby
[13:09:57] bruce_lee: has joined #ruby
[13:09:59] rickmasta: has joined #ruby
[13:10:13] sudoubuntu: has joined #ruby
[13:10:23] sandstrom: has joined #ruby
[13:10:36] havenwood: >> h = {aim: true}; Object.const_set(:Person, Struct.new(*h.keys)).new(*h.values)
[13:10:37] ruby[bot]: havenwood: # => #<struct Person aim=true> (https://eval.in/525360)
[13:11:21] platzhirsch: has left #ruby: ()
[13:12:06] Kang0: has joined #ruby
[13:12:51] UtkarshRay: has joined #ruby
[13:13:52] Jardayn: has joined #ruby
[13:14:20] Ox0dea: >> c = Class.new; [c.name, C = c, c.name]
[13:14:21] ruby[bot]: Ox0dea: # => [nil, C, "C"] (https://eval.in/525363)
[13:15:00] moos3: has joined #ruby
[13:15:14] Guest34101: has joined #ruby
[13:16:48] johnnyt: has joined #ruby
[13:17:36] unl0ckd: has joined #ruby
[13:18:52] xfbs: has joined #ruby
[13:20:45] william3: has joined #ruby
[13:21:06] HalcyonicStorm: has joined #ruby
[13:29:12] aryaching: has joined #ruby
[13:29:26] dstarh: has joined #ruby
[13:31:06] terlar: has joined #ruby
[13:34:17] eregi: has joined #ruby
[13:35:12] mostlybadfly: has joined #ruby
[13:35:45] DaniG2k: has joined #ruby
[13:36:04] fostertheweb: has joined #ruby
[13:36:30] laith: has joined #ruby
[13:36:31] dlitvak: has joined #ruby
[13:36:45] blackmes1: has joined #ruby
[13:37:32] ben_: has joined #ruby
[13:38:23] binaryplease: has joined #ruby
[13:39:36] verde: has joined #ruby
[13:40:35] BSaboia: has joined #ruby
[13:41:06] Ropeney: has joined #ruby
[13:41:13] Jeremy1023: has joined #ruby
[13:45:00] steffes: has joined #ruby
[13:45:27] Xeago: has joined #ruby
[13:45:42] malconis: has joined #ruby
[13:46:10] alexishuard: has joined #ruby
[13:46:10] htmldrum: has joined #ruby
[13:46:35] malconis: has joined #ruby
[13:46:48] ben_: has joined #ruby
[13:48:09] djellemah_: has joined #ruby
[13:48:23] snowy: has joined #ruby
[13:48:30] pocketpr1: has joined #ruby
[13:50:38] goodcodeguy: has joined #ruby
[13:52:19] skade: has joined #ruby
[13:53:18] Outlastsheep: has joined #ruby
[13:55:00] pawnbox: has joined #ruby
[13:56:13] millerti: has joined #ruby
[13:56:25] ben_: has joined #ruby
[13:57:11] pawnbox: has joined #ruby
[13:58:16] fostertheweb: has joined #ruby
[13:59:06] Ropeney: has joined #ruby
[13:59:33] Xeago: has joined #ruby
[14:01:07] ramortegui: has joined #ruby
[14:01:46] quaristice: has joined #ruby
[14:01:58] zotherstupidguy: has joined #ruby
[14:02:31] griffindy: has joined #ruby
[14:02:43] zotherstupidguy: running a rake test, will load and use bundle Gemfile?
[14:02:53] DaniG2k: has joined #ruby
[14:04:42] ben_: has joined #ruby
[14:04:54] havenwood: zotherstupidguy: bundle exec rake
[14:06:02] jgpawletko: has joined #ruby
[14:06:09] mattwildig: has joined #ruby
[14:06:23] bronson: has joined #ruby
[14:06:27] godzillaenlacasa: has joined #ruby
[14:06:57] dlitvak_: has joined #ruby
[14:07:51] stannard: has joined #ruby
[14:08:57] Sminthurus: has joined #ruby
[14:11:43] sgambino: has joined #ruby
[14:13:20] chouhoulis: has joined #ruby
[14:14:18] stevemackinnon: has joined #ruby
[14:14:52] xapak: has joined #ruby
[14:15:34] AlexRussia: has joined #ruby
[14:15:35] goodcodeguy: has joined #ruby
[14:15:36] stevemackinnon: has joined #ruby
[14:17:23] stevemac_: has joined #ruby
[14:18:11] nogic: has joined #ruby
[14:18:45] segy: has joined #ruby
[14:19:03] DaniG2k_: has joined #ruby
[14:20:05] MrDoctor: has joined #ruby
[14:20:18] MrDoctor: Hi guys, I am in fedora 23 and trying to set up postgresql for a rails application. I can connect to my created database using psql fine, but I am encountering problems from both my rails application and from pgadminIII. It's gives me an ident authentication failed arror.
[14:20:20] Timberwo|f: has joined #ruby
[14:22:45] hxegon: has joined #ruby
[14:23:03] dlitvak: has joined #ruby
[14:25:09] ghr: MrDoctor you;'re probably better off in #rubyonrails, but have a read of http://www.depesz.com/2007/10/04/ident/
[14:25:34] MrDoctor: Thank you very much ghr.
[14:26:41] Kang0: has joined #ruby
[14:27:31] mattwashere: has joined #ruby
[14:28:14] xfbs: has joined #ruby
[14:28:44] aegis3121: has joined #ruby
[14:29:15] mxn: has left #ruby: ()
[14:29:42] andyrs: has joined #ruby
[14:30:34] sankaber: has joined #ruby
[14:31:20] Guest85: has joined #ruby
[14:33:45] timwis: has joined #ruby
[14:33:49] MrDoctor: It did the trick ghr, thanks a lot.
[14:34:24] jeanlinux: has joined #ruby
[14:34:31] ghr: great :)
[14:35:04] eregi: has joined #ruby
[14:35:18] Ishido: has joined #ruby
[14:36:06] kerunaru: has joined #ruby
[14:36:15] ElFerna: has joined #ruby
[14:36:42] Kang0: has joined #ruby
[14:37:13] dlitvak_: has joined #ruby
[14:39:56] aryaching: has joined #ruby
[14:40:52] uglybandersnatch: has joined #ruby
[14:42:00] jeanlinux: has joined #ruby
[14:44:49] jimcroft: has joined #ruby
[14:45:00] jimcroft_: has joined #ruby
[14:47:12] rahulprabhakar: has joined #ruby
[14:47:33] platzhirsch: has joined #ruby
[14:47:38] binaryplease: has joined #ruby
[14:49:31] timwis: Hey guys, I've submitted a simple pull request to Jekyll but I'm a JS dev so I'm not as familiar with ruby best practices. What's the best way to write "select where there's a string match or, if it's an array, where the array contains the string" (at the moment tests are failing because `.include?` throws an error against a boolean value) https://github.com/jekyll/jekyll/pull/4555/files
[14:49:44] rahulprabhakar: has left #ruby: ()
[14:50:26] sandstrom: has joined #ruby
[14:50:47] rbennacer: has joined #ruby
[14:51:25] rahulprabhakar: has joined #ruby
[14:51:48] adaedra: what part of this causes you trouble?
[14:51:58] DmitryBochkarev: has joined #ruby
[14:52:48] adaedra: To test an object type, you have is_a?, example: `foo.is_a?(Array)`
[14:53:06] timwis: oh, not .kind_of?(Array) ?
[14:53:19] adaedra: both works, but iirc kind_of? is deprecated
[14:53:23] adaedra: also, use ||, not or
[14:53:50] adaedra: &ri Object#kind_of?
[14:53:50] `derpy: http://ruby-doc.org/core-2.3.0/Object.html#method-i-kind_of-3F
[14:54:13] rahulprabhakar: has left #ruby: ()
[14:54:28] steffes: has joined #ruby
[14:54:47] timwis: adaedra, a few things that are rather elementary, i'm afraid. if it were a language with which i'm comfortable, I'd do a few things: create a variable for the item_property(object, property) bit so as not to execute that function twice (and increase readability), and I'd wrap the second conditional in some kind of test that prevents it throwing an error if it's not being done on an array
[14:55:07] timwis: adaedra: yeah, i was reviewing github's ruby style guide and noticed they recommend ||
[14:55:34] MrDoctor: has joined #ruby
[14:56:04] adaedra: or/and have different precedence than ||/&& and it is a bit confusing. You usually want ||/&&
[14:56:09] binaryplease1: has joined #ruby
[14:56:13] timwis: The reason I thought to ask in here is because a few lines up they do that "input - input.values if input.is_a?(Hash)" stuff, and the "if xxx" suffix is something I've only seen in ruby (and I think python), so I wasn't sure if there were a clever or "more best practice" way to do the test i mentioned above
[14:56:19] platzhirsch: has left #ruby: ()
[14:56:59] mor789: has joined #ruby
[14:57:03] platzhirsch: has joined #ruby
[14:57:07] shevy: timwis .respond_to? is also a possibility
[14:57:39] adaedra: Don't be afraid to spread it on multiple lines if you need to, shorter is not always better, timwis
[14:57:48] mor789: How does the method_missing method gets a method name as an argument after overriding it?
[14:57:53] ljarvis: timwis: why not just have item_property return an array and remove the first condition?
[14:58:00] timwis: adaedra, and from what I've gathered, I remove the brackets and use "do" and "end" to do that, right? (forgive the elementary question)
[14:58:19] nando293921: has joined #ruby
[14:58:32] adaedra: not compulsory, but yeah, I think community guidelines do that
[14:58:51] timwis: ljarvis: I *assume* that item_property is a utility used throughout the codebase, and doing that would be a more significant pull request than they probably want on a project this big
[14:58:54] timwis: but worth verifying
[14:59:05] tulak: has joined #ruby
[14:59:18] ljarvis: timwis: yep fair enough, otherwise you could just do: Array(item_property(object, property).to_s).include?(value.to_s)
[14:59:18] thevaliantx: has joined #ruby
[14:59:23] timwis: okay i'll find out what respond_to? does shevy thanks for the tip
[14:59:46] ljarvis: you really don't need type checks here fwiw
[14:59:48] TomPeed: has joined #ruby
[14:59:56] binaryplease: has joined #ruby
[14:59:57] timwis: ljarvis, but .to_s ... wouldn't that be converting it to a string?
[15:00:16] ljarvis: imo: Array(foo).include?(bar) reads better than foo == bar || (foo.is_a?(Array) && foo.include?(bar))
[15:00:24] ljarvis: timwis: yes, before you create the array
[15:01:02] konsolebox: has joined #ruby
[15:01:10] ljarvis: but anyway, I'm confused. You don't control item_property() but your code assumes it *might* be an array, why is that?
[15:01:16] mor789: How does the method_missing method gets a method name as an argument after overriding it?
[15:01:17] timwis: i agree about readability, but ... well i suppose if I leave off .to_s, I could do what you've suggested. Wrapping it in Array() will still work if it's already an array?
[15:01:19] pdoherty: has joined #ruby
[15:01:31] Flakes: has joined #ruby
[15:01:34] ljarvis: mor789: can you give an example? that's "just how it works"
[15:01:58] ljarvis: timwis: correct, Array(["..."]) #=> ["..."]
[15:02:27] Kensei: has joined #ruby
[15:02:27] Kensei: has joined #ruby
[15:02:28] timwis: ljarvis, the pull request is enhancing the "where" liquid filter. currently it only works on string comparisons (where: foo, "bar") when foo is a string. the pull request enables it to work when foo is an array, to test if it contains the string "bar"
[15:02:45] jimcroft_: has joined #ruby
[15:02:47] damienbrz: has joined #ruby
[15:02:58] ljarvis: timwis: I don't think that's right. Your code assumes item_property() could return an array, not that value is an array
[15:03:04] ljarvis: so maybe it's backwards?
[15:03:26] ljarvis: in which case, Array(value).include?(item_property...) would definitely be the best way to write it
[15:03:57] timwis: Your logic confused me a bit just now, but your conclusion I agree with
[15:04:10] mor789: o=Object.new, def o.method_missing(m,*args) "xxxxxxx #{m}" end, o.some_method
[15:04:16] timwis: I'll try that. thanks ljarvis
[15:04:28] PsionTheory: has joined #ruby
[15:04:40] ljarvis: mor789: yes, that's some code. Do you have a question about it?
[15:05:17] silverdust: what's the name given to things like this exists?
[15:05:25] mor789: How does the method take the method name "some_method" as an argument when its overrided
[15:05:25] whippythellama: has joined #ruby
[15:05:29] ljarvis: mor789: by design, if a method does not exist when being called, it calls method_missing (which, by default, just raises an exception)
[15:05:37] silverdust: I mean with the question mark at the end
[15:05:37] ljarvis: silverdust: huh?
[15:05:45] rahulprabhakar: has joined #ruby
[15:05:46] silverdust: methods like that
[15:06:04] ljarvis: silverdust: oh.. you can just assume that they're used to check the truthyness of something
[15:06:08] silverdust: methods that always return a boolean value
[15:06:13] ljarvis: that's not quite right
[15:06:28] idefine: has joined #ruby
[15:06:59] ljarvis: the idea is that you shouldn't care about the return value, except in a condition. Because it should return truthy or falsy (that is, nil/false for falsy, and anything else for truthy)
[15:07:06] silverdust: I've heard someone call them by a name before but I can't remember what that is
[15:07:12] workmad3: silverdust: predicate methods
[15:07:24] mor789: ljarvis: but the method was override
[15:07:32] rahulprabhakar: has left #ruby: ()
[15:08:03] ljarvis: I've never heard of it called a predicate method but yeah
[15:08:19] silverdust: okay so can I store a value directly in a something like a preidcate method? i.e exists? = true just to mock data
[15:08:27] bronson: has joined #ruby
[15:08:28] jeanlinux: has joined #ruby
[15:08:44] ljarvis: silverdust: methods dont store things, they do stuff and return values
[15:08:45] silverdust: *predicate method
[15:08:53] nofacade: has joined #ruby
[15:08:56] ljarvis: silverdust: so yes, you can write a method which just returns true
[15:09:04] ljarvis: def exists?() true end
[15:09:12] timwis: ljarvis: here's what I ended up with FYI, and tests are passing. https://gist.github.com/timwis/8d2078c62cd3a0b0d8ed Thanks again. I can't really tell if there's anything "non-rubyist" in there but hopefully it's simple enough that I've avoided any of those mistakes
[15:09:20] rbennacer: has joined #ruby
[15:09:30] mor789: ljarvis: if you override the method_missing method how does it refers to its origin method?
[15:09:51] ljarvis: timwis: your first expression is already covered by the second expression.
[15:10:09] william3: has joined #ruby
[15:10:23] aegis3121: has joined #ruby
[15:10:32] timwis: :O no way
[15:10:32] ljarvis: mor789: by calling super
[15:10:39] timwis: I think I can see what you mean
[15:10:48] ljarvis: timwis: well, not *exactly* but you should consense it imo
[15:11:02] timwis: but Array(input_property) doesn't cast input_property to a string
[15:11:16] ljarvis: but again, I'm confused. you mentioned that you don't control what item_property returns, but your code assumes it could return either an array or a string
[15:11:38] ljarvis: did it always return maybe an array?
[15:11:42] mor789: ljarvis: I didn't call super in my method, so how does it take a method name as an argument?
[15:12:06] ljarvis: mor789: because that's how method_missing works, when it's called, it sends the method name as the first argument
[15:12:11] ljarvis: I don't know what you want from me :(
[15:12:26] timwis: ljarvis: It could return a boolean or number as well (some of the tests use booleans)
[15:12:35] timwis: I think item_property is just getting a property from a hash
[15:12:45] ljarvis: timwis: right, so previously it just called .to_s on *everything*?
[15:13:00] Xeago: has joined #ruby
[15:13:01] dhollinger: has joined #ruby
[15:13:14] ljarvis: right ok thanks, then I would: Array(input_property).map(&:to_s).include?(value.to_s)
[15:13:21] Deck`: has joined #ruby
[15:13:24] ljarvis: but what you have is fine really
[15:13:41] jottr: has joined #ruby
[15:13:44] x77686d: has joined #ruby
[15:14:07] quakephil: has joined #ruby
[15:14:08] mor789: ljarvis: when you override the method_missing method you change its content and put your's
[15:14:18] ljarvis: mor789: correct.
[15:14:30] timwis: ah, clever ljarvis. since it was already casting everything to a string, this is no worse
[15:14:31] krobzaur_: has joined #ruby
[15:14:49] decoponio: has joined #ruby
[15:14:51] timwis: and i can keep it a slim one-liner (which I know is not always the best)
[15:14:56] timwis: (but simpler for a pull request)
[15:15:20] zast: has joined #ruby
[15:15:47] jeanlinux: has joined #ruby
[15:16:02] krobzaur: has joined #ruby
[15:16:15] Deck`: is there more elegant way to write this https://dpaste.de/EjPu ? it's about creating hash with optional params
[15:16:19] mor789: ljarvis: so how does it take a method name as an argument after rewriting the method?
[15:16:46] ljarvis: Deck`: I wouldn't use tap myself, but I think it's fine
[15:17:04] ljarvis: mor789: because when method_missing is trigged, it *always* sends the method name as an argument
[15:17:24] Deck`: ljarvis: so you would add new variable inside map and then set optional arguments?
[15:17:31] ljarvis: Deck`: I would yeah
[15:18:18] rippa: has joined #ruby
[15:19:00] failshell: has joined #ruby
[15:19:01] mor789: ljarvis: Thank you! is it unique feature to the "method_missing" method or all the methods act like this?
[15:19:17] Deck`: ljarvis: I disliked this approach as I should explicitly say 'entity' in the end to return
[15:19:19] dopamean_: has joined #ruby
[15:19:37] ljarvis: mor789: it's very much unique, method_missing is used in core Ruby C code. There are other types of unique methods similar to this
[15:20:06] ljarvis: Deck`: yep, I prefer that. It's down to taste, go with tap if you prefer it
[15:20:09] dopamean1: has joined #ruby
[15:20:12] floatingpoint: has joined #ruby
[15:20:17] swills: has joined #ruby
[15:20:34] ljarvis: I only use tap when creating a new block helps code readability or maintenance in some way
[15:20:38] sgambino: has joined #ruby
[15:20:43] mor789: ljarvis: thanks a lot! :)
[15:20:45] fostertheweb: has joined #ruby
[15:21:38] steffkes: has joined #ruby
[15:22:02] htmldrum: has joined #ruby
[15:22:12] Helheim: has joined #ruby
[15:22:23] diegoviola: has joined #ruby
[15:25:57] \13k: has joined #ruby
[15:27:01] Hammy_Work: has joined #ruby
[15:27:01] matled-: has joined #ruby
[15:27:02] justbleed: has joined #ruby
[15:27:02] x77686d: has joined #ruby
[15:27:02] sankaber: has joined #ruby
[15:27:02] fostertheweb: has joined #ruby
[15:27:02] Mojo_Nixon: has joined #ruby
[15:27:03] pawnbox_: has joined #ruby
[15:27:03] Helheim: has joined #ruby
[15:27:03] rbennacer: has joined #ruby
[15:27:03] gix-: has joined #ruby
[15:27:03] symm-: has joined #ruby
[15:27:03] ljames: has joined #ruby
[15:27:04] ElFerna_: has joined #ruby
[15:27:04] babblebre: has joined #ruby
[15:27:04] Xeago: has joined #ruby
[15:27:04] aufi: has joined #ruby
[15:27:05] \13k: has joined #ruby
[15:27:13] lianj: has joined #ruby
[15:27:13] lianj: has joined #ruby
[15:27:36] funnel: has joined #ruby
[15:27:49] FIGO_: has joined #ruby
[15:28:12] Helheim_: has joined #ruby
[15:28:18] ruurd: has joined #ruby
[15:28:40] anagha_: has joined #ruby
[15:30:18] goodcodeguy: has joined #ruby
[15:30:47] tulak: has joined #ruby
[15:30:53] dlitvak: has joined #ruby
[15:31:30] anagha_: is #RubyonRails the irc channel for rails?
[15:32:07] apeiros: anagha_: why do you ask?
[15:32:09] anagha_: But I am not able to ping on the channel
[15:32:24] apeiros: you need to be registered
[15:32:25] ljarvis: you need to register your nick
[15:32:25] cdg: has joined #ruby
[15:32:25] Helheim: has joined #ruby
[15:32:32] ruby[bot]: you need to be identified with NickServ, see /msg NickServ HELP
[15:32:44] ddv: anyone know why this matches? '2016-02-25T15:20:12.0_' =~ /\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{1,3}/
[15:32:54] ddv: with rubular is doesn't match
[15:33:11] apeiros: ddv: why should it not match?
[15:33:15] ljarvis: add to reasons I don't use rubular
[15:33:25] apeiros: >> '2016-02-25T15:20:12.0_'[/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{1,3}/]
[15:33:26] ruby[bot]: apeiros: # => "2016-02-25T15:20:12.0" (https://eval.in/525466)
[15:33:39] amargherio: has joined #ruby
[15:33:46] apeiros: that's what it matches. the why is IMO obvious, if not, please specify what part you have trouble with.
[15:33:46] ddv: apeiros: well becaus of the underscore, I thought I specified \d{1,3} at the end
[15:33:51] cabargas: has joined #ruby
[15:33:55] apeiros: ddv: you have no anchors
[15:34:02] ljarvis: there is no endzz
[15:34:07] themsay: has joined #ruby
[15:34:11] ddv: thanks :)
[15:34:13] apeiros: the \.\d{1,3} happily matches the ".0"
[15:34:21] goodcodeguy: has joined #ruby
[15:34:38] apeiros: common regex mistake no. 2
[15:34:42] ddv: probably
[15:35:15] ljarvis: apeiros: what's 1? using regex in the first place? :)
[15:35:49] eregi: has joined #ruby
[15:36:27] ljarvis: which reminds me
[15:36:32] blandflakes: has joined #ruby
[15:36:32] ljarvis: ddv: Time.parse
[15:36:41] apeiros: ACTION smacks ljarvis with a large clock
[15:36:46] apeiros: Time.strptime
[15:36:55] ljarvis: right right strptime
[15:36:56] ddv: I tried using Time.iso8601
[15:36:58] apeiros: or in this case, probably Time…
[15:37:05] apeiros: right. that's what I wanted to say :)
[15:37:05] ddv: but I don't want to use time zone designations
[15:37:11] Helheim: has joined #ruby
[15:37:16] ljarvis: ddv: always use strpftime, since you seem to know the format
[15:37:34] ddv: yeah seems way better
[15:37:36] apeiros: ddv: they're not required by iso8601
[15:37:36] ljarvis: time zones
[15:37:39] ljarvis: not even once
[15:37:42] ddv: apeiros: I know
[15:37:45] apeiros: no time zone == local time zone
[15:38:09] apeiros: ddv: then I don't understand your problem with iso8601
[15:38:29] apeiros: ljarvis: lucky guy if you so far managed to not having to deal with timezones
[15:38:40] kies^: has joined #ruby
[15:38:43] apeiros: though, timezones are easy. dst and leapseconds are hard.
[15:38:44] ljarvis: apeiros: ... I work on chronic
[15:38:55] apeiros: ljarvis: hah!
[15:39:09] apeiros: ljarvis: I work on chronos.js again
[15:39:24] apeiros: almost completed. but parser still missing - in case you're interested :D
[15:39:34] ljarvis: I am not, thank you ;)
[15:39:43] apeiros: too sad. interested in sharing your experience, though?
[15:40:01] apeiros: in order for me to avoid the pitfalls you already identified…
[15:40:04] ddv: apeiros: I was using Time.iso8601 to check if a string conforms to iso8601
[15:40:09] idefine: has joined #ruby
[15:40:13] yorickpeterse: apeiros: 1) don't write a natural time parser
[15:40:27] Helheim: has joined #ruby
[15:40:31] ljarvis: I could be, I've actually been working on a chronic replacement for.. 2/3 years now. I have a different branch with 3 different parsing methods, none of which I'm completely sold on
[15:40:34] apeiros: yorickpeterse: I want to go even further than that actually. I want to implement "data detectors"
[15:40:36] ljarvis: so yeah, yorickpeterse pretty much nails it
[15:40:42] apeiros: (find dates, locations, names in plain text)
[15:40:49] mary5030: has joined #ruby
[15:40:49] goodcodeguy: has joined #ruby
[15:41:03] terlar: has joined #ruby
[15:41:28] apeiros: ljarvis: ok. well. I guess whenever I get to writing a natural language parser, I'll have a talk with you after having come up with something myself.
[15:41:30] mary5030: has joined #ruby
[15:41:39] htmldrum: has joined #ruby
[15:41:44] eregi: has joined #ruby
[15:41:47] apeiros: though I'm a bit startled by the idea of doing this in js with its piss poor text manipulation support.
[15:42:07] apeiros: s/startled/scared/
[15:42:31] timwis: apeiros what do you mean by text manipulation support?
[15:42:45] timwis: have you tried template strings?
[15:42:45] konsolebox: has joined #ruby
[15:42:46] apeiros: timwis: I'd love to have an equivalent of StringScanner f.ex.
[15:42:56] apeiros: also js' regexen are a sad sad joke
[15:43:05] ljarvis: a custom lexer is probably just the thing you need anyway
[15:43:13] Helheim: has joined #ruby
[15:43:37] codecop: has joined #ruby
[15:43:48] yorickpeterse: apeiros: finding locations/names is super complex
[15:43:52] timwis: apeiros: https://github.com/sstephenson/strscan-js
[15:43:54] sgambino: has joined #ruby
[15:44:08] apeiros: yorickpeterse: fo'sure?
[15:44:10] yorickpeterse: really the only way you can do that is using either dictionaries (good luck with their sizes) or NLP (good luck producing good models)
[15:44:50] yorickpeterse: It's right up there with detecting address formats
[15:45:45] apeiros: timwis: I somewhat doubt that that can be even remotely efficient
[15:46:23] timwis: apeiros: forgive me, but I missed the beginning of the conversation where you said what you were trying to do, and couldn't establish it well enough by scrolling up
[15:46:25] Helheim: has joined #ruby
[15:46:29] apeiros: I have a vague idea how I'd port it (since I pondered), and I didn't because I doubted the possibility of doing it with sane efficiency. I never actually did the necessary checks, though.
[15:46:38] apeiros: timwis: no worries
[15:47:44] infernix: has joined #ruby
[15:48:12] chouhoulis: has joined #ruby
[15:48:40] apeiros: yeah, as expected, StringScanner#scan in the js impl: `regexp.exec(this.getRemainder())) && matches.index === 0`
[15:49:04] apeiros: so the regex is ran against the full remainder, i.e. no chance of short-circuit when it doesn't match at start.
[15:49:28] ljarvis: that across the entire source?
[15:49:37] apeiros: plus it needs to create the substring to get the remainder in the first place (this can be done reasonably efficient, though)
[15:50:23] Helheim: has joined #ruby
[15:50:41] apeiros: yeah. fine for short pieces of text. but if you want to run it against, say, a multi-page document? good luck not having an exploding running time.
[15:50:49] adgtl: has joined #ruby
[15:50:51] yorickpeterse: apeiros: Ragel 7 has a JS backend, you might want to just use that
[15:51:10] rodolfowtf: has joined #ruby
[15:51:17] apeiros: yorickpeterse: that is interesting. though ragel probably means I'd have to compile it for every language.
[15:51:25] tjohnson: has joined #ruby
[15:51:29] ben225: has joined #ruby
[15:51:38] apeiros: human language
[15:51:47] apeiros: like, one state machine for english, one for german etc.
[15:51:56] Kensei: has joined #ruby
[15:51:56] Kensei: has joined #ruby
[15:52:06] ljarvis: I hacked around with a funny (ridiculous) implementation for parsing date/times which basically normalised the string in some way, then matched the return value from a set and returned the method to parse. Now all I have to do is crowdsource formats
[15:52:38] apeiros: ah, right, language detection would also be part of the data detectors :) shouldn't be too hard with sampling of a short piece of the text and a bloom filter.
[15:52:53] cjbottaro: has joined #ruby
[15:52:58] hayden_: has joined #ruby
[15:53:04] yorickpeterse: it's not that easy
[15:53:14] apeiros: we shall see! :D
[15:53:21] yorickpeterse: hi I worked on this stuff for about 3 years
[15:53:39] yorickpeterse: bloom filters are about as accurate as having a 4 year old do it
[15:54:08] andikr: has joined #ruby
[15:54:12] johnny56_: has joined #ruby
[15:54:49] apeiros: yorickpeterse: did you opensource your solution?
[15:55:16] jokester: has joined #ruby
[15:55:28] yorickpeterse: https://github.com/opener-project/language-identifier
[15:55:29] apeiros: the one problem I see is polyglot texts
[15:55:37] yorickpeterse: which is basically a wrapper around https://github.com/shuyo/language-detection made thread-safe
[15:55:40] idefine: has joined #ruby
[15:55:54] yorickpeterse: probably the only thing that has close to 100% accuracy
[15:56:16] rbennacer: has joined #ruby
[15:56:16] Helheim: has joined #ruby
[15:56:27] apeiros: yorickpeterse: wait… that one works by *character frequency*?
[15:56:37] timwis: has joined #ruby
[15:56:41] yorickpeterse: It applies a bunch of techniques IIRC
[15:56:50] timwis: has left #ruby: ()
[15:56:51] apeiros: hm, no, seems there's more than just single characters
[15:56:51] yorickpeterse: e.g. it also has a dictionary for every language for (I think) trigrams to scan for
[15:57:04] B1n4r10: has joined #ruby
[15:58:02] apeiros: is that library supposed to work with short texts (2, 3 words) too then? (I didn't aim that high with my approach)
[15:58:17] yorickpeterse: IIRC it should but the accuracy isn't always as good
[15:58:28] ss_much: has joined #ruby
[15:58:54] yorickpeterse: http://opener.olery.com/language-identifier try it here
[15:59:01] yorickpeterse: "chicken butts" gets detected as English correctly
[15:59:19] Helheim: has joined #ruby
[16:00:18] silverdust: shouldn't rbenv global x just switch to that version as far as I have it installed. I have 2.2.3 and trying to test 2.0.0-dev but it wouldn't leave 2.2.3
[16:00:42] silverdust: I never had to switch on rbenv until now
[16:00:45] htmldrum: has joined #ruby
[16:01:34] eregi: has joined #ruby
[16:02:48] silverdust: oh I get it. I was in project that had it as its local had to run rbenv local
[16:03:15] yorickpeterse: also while we're at it, there's so much BS in the NLP industry
[16:03:21] Helheim: has joined #ruby
[16:03:27] yorickpeterse: OMGMMGMG THIS LIBRARY HAS 99,9% ACCURACY....on the 5 sentences we tested it
[16:03:28] jottr: has joined #ruby
[16:03:41] yorickpeterse: oh and it's not actually suitable for production usage because lol lets load 10GB of models into memory
[16:04:04] apeiros: that's actually one thing which I dislike - getting a reasonable body of text for test-cases.
[16:05:02] yorickpeterse: Oh you want to do constituent parsing in Dutch? Enjoy installing some random thing written in Prolog that uses an ancient version of TCL/TK
[16:05:08] dlitvak: has joined #ruby
[16:05:13] yorickpeterse: I can go on for a while :P
[16:05:19] moos3: has joined #ruby
[16:05:27] yorickpeterse: Thankfully I don't have to deal with that any more
[16:05:31] yorickpeterse: now I just deal with caching issues
[16:05:31] apeiros: that's quite a new aspect of you yorickpeterse, never noticed before ;-p
[16:05:40] terminalrecluse: has joined #ruby
[16:05:48] stevemackinnon: has joined #ruby
[16:05:55] rbennacer: has joined #ruby
[16:06:06] devbug: has joined #ruby
[16:06:33] bronson: has joined #ruby
[16:07:08] stevemackinnon: has joined #ruby
[16:07:28] slawrence00: has joined #ruby
[16:08:15] Helheim: has joined #ruby
[16:08:29] Gnut: has joined #ruby
[16:08:37] stevemackinnon: has joined #ruby
[16:08:51] Renich: has joined #ruby
[16:09:56] stevemac_: has joined #ruby
[16:10:10] polishdub: has joined #ruby
[16:10:16] rakm: has joined #ruby
[16:10:51] bricker: has joined #ruby
[16:10:59] openstruct: I came across a coding challenge to update a value in a nested hash base on a bath. E.g. hash = { name: 'bob', hobbies : { baseball: {type: :activity}}} and path = 'hobbies.baseball.type'. The task was to update type to :sport.
[16:11:12] idefine: has joined #ruby
[16:11:15] Helheim: has joined #ruby
[16:11:16] stevemackinnon: has joined #ruby
[16:11:18] openstruct: I did it by splitting the path into an array of symbols and iterating over it.
[16:11:27] blaxter: has joined #ruby
[16:11:44] openstruct: Apparently it can be done in one line (albeit slower) but I can't seem how figure out the one liner way.
[16:12:33] stevemackinnon: has joined #ruby
[16:13:14] apeiros: openstruct: please gist your solution (just to show that you did solve it yourself)
[16:14:39] Helheim: has joined #ruby
[16:14:58] openstruct: https://gist.github.com/anonymous/295e5826e64bb5d0fdd6
[16:15:06] htmldrum: has joined #ruby
[16:15:15] openstruct: Solution is a bit messy but it was my first stab at it on the fly.
[16:15:28] openstruct: I considered recursion but meh.
[16:15:29] apeiros: path.split(".")[0..-2].inject(hash) { |scope, key| scope[key.to_sym] }[path[/[^.]*\z/].to_sym] = :sport # untested, extracting the values twice is ugly but gives you a single line of code
[16:15:57] openstruct: Ah, yeah, I was thinking that inject would be the best route.
[16:16:09] apeiros: if two lines are allowed, I'd do: *base,last = path.split("."); base.inject …
[16:16:26] apeiros: additional note: this code fails horribly if the path doesn't actually exist :)
[16:16:39] apeiros: (which is why I wouldn't write code like that in anything production)
[16:17:48] apeiros: works for your example code.
[16:18:24] Helheim: has joined #ruby
[16:19:01] aegis3121: has joined #ruby
[16:19:06] haylon: has joined #ruby
[16:19:12] openstruct: apeiros: Cool - thanks for showing that!
[16:19:40] melter: has joined #ruby
[16:19:44] treehug88: has joined #ruby
[16:19:53] aegis3121: has joined #ruby
[16:21:25] Helheim: has joined #ruby
[16:22:50] ElFerna_: has joined #ruby
[16:25:42] dlitvak: has joined #ruby
[16:26:10] Helheim: has joined #ruby
[16:27:01] idefine: has joined #ruby
[16:27:58] Xeago: has joined #ruby
[16:28:13] Voxxit: has joined #ruby
[16:29:14] tristanp: has joined #ruby
[16:29:18] Helheim: has joined #ruby
[16:31:46] Helheim: has joined #ruby
[16:31:52] johnnyt: has joined #ruby
[16:33:46] MrDoctor: has joined #ruby
[16:34:12] llua: has joined #ruby
[16:35:51] Hanmac: has joined #ruby
[16:38:18] Helheim: has joined #ruby
[16:38:52] idefine: has joined #ruby
[16:39:21] The_Phoenix: has joined #ruby
[16:40:51] tulak: has joined #ruby
[16:43:01] htmldrum: has joined #ruby
[16:43:02] idefine: has joined #ruby
[16:45:54] ljames: has joined #ruby
[16:47:17] Don_John: has joined #ruby
[16:47:54] Guest85: has joined #ruby
[16:48:30] htmldrum: has joined #ruby
[16:48:54] Sembei: has joined #ruby
[16:49:01] idefine: has joined #ruby
[16:50:25] mattwild_: has joined #ruby
[16:50:32] rattatmatt: has joined #ruby
[16:51:25] baweaver: has joined #ruby
[16:52:25] kobain: has joined #ruby
[16:53:15] kobain: has joined #ruby
[16:55:24] kobain: has joined #ruby
[16:55:55] unsymbol: has joined #ruby
[16:56:11] sandstrom: has joined #ruby
[16:59:28] dgncn: has joined #ruby
[17:01:22] flughafen_: has joined #ruby
[17:02:09] djbkd: has joined #ruby
[17:03:06] rickmasta: has joined #ruby
[17:03:06] chipotle: has joined #ruby
[17:03:24] goodcodeguy: has joined #ruby
[17:03:49] idefine: has joined #ruby
[17:04:50] htmldrum: has joined #ruby
[17:05:40] rickmasta: has joined #ruby
[17:06:28] rickmasta: has joined #ruby
[17:06:29] mattwildig: has joined #ruby
[17:07:30] rickmasta: has joined #ruby
[17:07:40] blackmes1: has joined #ruby
[17:08:18] rickmasta: has joined #ruby
[17:08:47] manveru: (*h, t = path.split('.'); h).reduce(hash){|s,v| s[v.to_sym] }[t] = 'stuff'
[17:09:37] uris: has joined #ruby
[17:10:33] mfb2: has joined #ruby
[17:11:15] dubek: has joined #ruby
[17:11:38] synthroid: has joined #ruby
[17:11:55] synthroid: has joined #ruby
[17:12:12] manveru: now... one line is a bit harder
[17:12:17] rbennacer: has joined #ruby
[17:12:23] eregi: has joined #ruby
[17:12:35] Guest85: has joined #ruby
[17:13:20] amclain: has joined #ruby
[17:14:16] linoge: has joined #ruby
[17:14:23] linoge: has left #ruby: ()
[17:14:45] rbennacer: has joined #ruby
[17:14:59] manveru: eval "hash#{path.gsub(/([^.]+)\.?/, '[:\1]')} = :sport"
[17:15:07] manveru: don't do this at home kids
[17:15:31] mostlybadfly: has joined #ruby
[17:16:06] rbennacer: has joined #ruby
[17:16:52] TomyLobo: has joined #ruby
[17:17:09] cajone: has left #ruby: ()
[17:17:20] nando293921: has joined #ruby
[17:18:08] marr: has joined #ruby
[17:18:10] goodcodeguy: has joined #ruby
[17:18:45] dubek: has joined #ruby
[17:19:14] rakm: has joined #ruby
[17:19:15] apeiros: manveru: lel, interesting solution :D
[17:20:07] WizJin: has joined #ruby
[17:20:23] sgambino: has joined #ruby
[17:23:26] manveru: path.split('.').each_with_index.reduce(hash){|h,(p,i)| i == path.count('.') ? h[p.to_sym] = :sport : h[p.to_sym] }
[17:23:32] manveru: a bit longer, but also fun
[17:23:45] rht: has joined #ruby
[17:24:14] manveru: alright, back to work ^^;
[17:27:34] eregi_: has joined #ruby
[17:27:41] idefine: has joined #ruby
[17:27:54] ankhers: has joined #ruby
[17:28:59] [Butch]: has joined #ruby
[17:29:00] edwinvdgraaf: has joined #ruby
[17:29:59] chipotle: has joined #ruby
[17:30:25] mattwild_: has joined #ruby
[17:30:42] sanguisdex: has joined #ruby
[17:30:46] ElFerna_: has joined #ruby
[17:31:33] elifoster: has joined #ruby
[17:31:50] sanguisdex: morning all, would someone be willing to help this self taught developer to understand and learn how to correct the rubocop offenses on https://gist.github.com/sanguis/8fea8779e61721baeb47
[17:32:34] sanguisdex: they are a little more pure computer sciency in their explanation than I am used to.
[17:34:17] j0n3: has joined #ruby
[17:35:06] ljarvis: sanguisdex: the method has too many lines
[17:35:09] ankr: has joined #ruby
[17:35:15] ankr: has left #ruby: ("My Mac has gone to sleep.")
[17:35:21] ljarvis: it seems pretty explicit about that
[17:35:42] ljarvis: the "branch condition" it refers to is saving your "when" branches are too long
[17:36:24] ljarvis: also, some of those branches do the same thing. You should extract them into different methods
[17:37:35] _mak: has joined #ruby
[17:37:40] _mak: hi there
[17:38:09] ljarvis: sanguisdex: not to mention case file =~ /.../ doesn't make much sense
[17:38:14] _mak: in a pry binding, is there a way to execute the script step by step?
[17:38:45] apeiros: _mak: pry-byebug enables that
[17:38:54] iooner: has joined #ruby
[17:38:55] SCHAAP137: has joined #ruby
[17:38:59] blackmesa: has joined #ruby
[17:39:14] _mak: apeiros: thanks!
[17:39:58] goodcodeguy: has joined #ruby
[17:40:12] rodolfowtf: has joined #ruby
[17:40:49] Frem: has joined #ruby
[17:40:59] Anderson69s: has joined #ruby
[17:41:03] ljarvis: sanguisdex: something like https://gist.github.com/leejarvis/d3a8977f523f95eba8f6
[17:41:41] Maletor: has joined #ruby
[17:42:42] Kang0: has joined #ruby
[17:43:10] mhoungbo: has joined #ruby
[17:43:25] sanguisdex: ljarvis: reading and comprehending thanks
[17:43:34] sanguisdex: or at least trying
[17:43:35] Authenticator: What's a good single-file-executable Ruby packager for Linux? Currently I'm fetching Ruby 2.2+, building an RPM, including my gem, and RPMing that. It takes admin privs to install, and isn't very tidy once installed.
[17:44:31] yfeldblum: has joined #ruby
[17:44:34] azure32: has joined #ruby
[17:44:49] havenwood: Authenticator: ruby-install is one option to help you compile Ruby as preferrd and put it where you like: https://github.com/postmodern/ruby-install#readme
[17:45:26] havenwood: Authenticator: You can add an `-- --enable-shared` flag if you want to have the Ruby be movable.
[17:46:25] iooner: has joined #ruby
[17:46:26] havenwood: Authenticator: You can install to `/usr/local` with the `--system` flag or put it wherever you like. A popular tool that will detect the default install locations and let you easily switch between Rubies is chruby: https://github.com/postmodern/chruby#auto-switching
[17:46:38] havenwood: (Didn't mean to link to #auto-switching.)
[17:47:31] dlitvak: has joined #ruby
[17:47:32] havenwood: Authenticator: Or say more what you mean by "single-file-executable Ruby package"? Now that I'm rereading your question I think I misread.
[17:48:20] havenwood: Authenticator: I have to relocate but my second stab at trying to answer is to take a look at Traveling Ruby: http://phusion.github.io/traveling-ruby/
[17:49:17] funnel: has joined #ruby
[17:49:18] rbennacer: has joined #ruby
[17:50:34] borodin: has joined #ruby
[17:50:37] LoneHerm_: has joined #ruby
[17:53:28] mor789: has joined #ruby
[17:53:47] mor789: I have an error: "test.rb:17:in `has_friend': undefined method `<<' for nil:NilClass (NoMethodError)"
[17:54:20] Zarthus: mor789: :(
[17:55:02] B1n4r10: has joined #ruby
[17:55:17] Coldblackice_: has joined #ruby
[17:55:32] mor789: Zarthus: is there a problem with this piece of code? def has_hobby(hobby) @hobbies << hobby end def has_friend(friend) @friends << friend end
[17:55:43] Zarthus: mor789: there's better ways to paste code (like gist.github.com)
[17:55:44] adgtl: has joined #ruby
[17:55:47] pawnbox: has joined #ruby
[17:55:50] rbennacer: has joined #ruby
[17:55:54] nickjj: has joined #ruby
[17:55:58] Zarthus: the error in particular says that you are using `<<' on a value that is nil though
[17:55:59] weaksauce: has joined #ruby
[17:56:08] Zarthus: that's probably @friends in this case
[17:56:35] Zarthus: The error also says on what line it is in the error message, so you have enough info to start finding out why it is happening
[17:56:50] VeryBewitching: has joined #ruby
[17:57:05] wldcordeiro: has joined #ruby
[17:57:11] dlitvak_: has joined #ruby
[17:58:31] mor789: Zarthus: https://gist.github.com/anonymous/0b572e856af242a9b1a5. just wanted to push an argument to array
[17:58:50] Zarthus: look at line 8
[18:00:39] mor789: Zarthus: I want it to be an empty array
[18:00:51] Zarthus: mor789: I'm afraid i'm not going to spell it out for you.
[18:01:03] Zarthus: I've given you enough hints, take a look. What could be going wrong here?
[18:01:28] stevemackinnon: has joined #ruby
[18:01:45] dlitvak: has joined #ruby
[18:02:38] Kensei: has joined #ruby
[18:02:38] Kensei: has joined #ruby
[18:02:47] stevemackinnon: has joined #ruby
[18:03:03] firstdayonthejob: has joined #ruby
[18:03:05] Xeago: has joined #ruby
[18:03:57] ben225: Is there a way to achieve a similar behaviour to if/else in ERB, but with a custom function accepting a block? I want to be able to write <%= f(x) do %> blah html <% end %> and either produce the return value of f(x) or "blah html" if f(x) == nil.
[18:04:37] sgambino: has joined #ruby
[18:06:31] HiddenSnake: has joined #ruby
[18:06:40] nisstyre_: has joined #ruby
[18:07:09] adgtl: has joined #ruby
[18:07:21] skade: has joined #ruby
[18:07:59] mikecmpbll: has joined #ruby
[18:08:16] bronson: has joined #ruby
[18:09:24] lubekpl: has joined #ruby
[18:10:03] chouhoulis: has joined #ruby
[18:10:12] mor789: Zarthus: im so funny...spelling error, thank you:)
[18:10:43] chouhoulis: has joined #ruby
[18:11:26] kerunaru: has joined #ruby
[18:11:32] _djbkd: has joined #ruby
[18:11:44] Gnut: has joined #ruby
[18:11:55] goodcodeguy: has joined #ruby
[18:12:20] william3: has joined #ruby
[18:13:57] adgtl: has joined #ruby
[18:13:57] adgtl: has joined #ruby
[18:14:05] graydot: has joined #ruby
[18:15:42] armyriad: has joined #ruby
[18:17:06] ramfjord: has joined #ruby
[18:17:07] mondok: has joined #ruby
[18:17:56] sanguisdex: I have to say 10 lines feels like a really tight squeeze for a method line limit
[18:18:15] intrigueD: has joined #ruby
[18:18:54] sanguisdex: ACTION is used to the php freedom of vomiting up lines and lines of dirty code
[18:19:03] Guest85: has joined #ruby
[18:19:19] trosborn: has joined #ruby
[18:19:29] ramfjord: What do you guys think is the cleanest way to transform a set of hash keys using another hash as the mapping?
[18:19:39] chipotle: has joined #ruby
[18:19:46] ramfjord: for example: {theirs_1: 1, theirs_2: 2} <apply mapping> {theirs_1: mine_1, theirs_2: mine_2} => {mine_1: 1, mine_2: 2}
[18:20:05] ramfjord: I missed some colons there
[18:20:29] ramfjord: is map + reduce actaully the fastest way here?
[18:20:34] devbug: has joined #ruby
[18:20:41] Xeago: has joined #ruby
[18:21:14] Zarthus_: has joined #ruby
[18:22:47] joonty: has joined #ruby
[18:23:17] Spami: has joined #ruby
[18:23:21] Weethus: has joined #ruby
[18:24:30] Deck`: has joined #ruby
[18:25:21] dopamean_: has joined #ruby
[18:26:27] dlitvak_: has joined #ruby
[18:27:56] x77686d: has joined #ruby
[18:28:46] mondok: h2.map { |k,v| [v, h1[k]] }.to_h
[18:29:35] eurialo: has joined #ruby
[18:31:03] RegulationD: has joined #ruby
[18:31:42] baweaver: has joined #ruby
[18:32:33] replay: has joined #ruby
[18:32:40] bronson: has joined #ruby
[18:33:17] replay: has joined #ruby
[18:33:30] n00bDev: has joined #ruby
[18:33:46] zenergi: has joined #ruby
[18:34:41] Underdogg: has joined #ruby
[18:35:14] Maletor: has joined #ruby
[18:35:23] rcvalle: has joined #ruby
[18:35:53] colegatron: has joined #ruby
[18:36:07] stannard: has joined #ruby
[18:37:57] mfb2: has joined #ruby
[18:38:19] spk: has joined #ruby
[18:38:22] ixti: has joined #ruby
[18:38:43] jenrzzz: has joined #ruby
[18:38:46] mattwildig: has joined #ruby
[18:39:48] HiddenSnake: has joined #ruby
[18:39:56] tomchapin: has joined #ruby
[18:41:09] spk: has joined #ruby
[18:42:34] shadoi: has joined #ruby
[18:42:38] akem: has joined #ruby
[18:42:43] sneakerhax: has joined #ruby
[18:42:50] uglybandersnatch: has joined #ruby
[18:42:50] sandstrom: has joined #ruby
[18:43:37] edwinvdgraaf: has joined #ruby
[18:44:00] sanguisdex: is there any way to re-factor this to make it better fit into rubocops 10 line method limit other then making what would seem to be more smaller methods that will only be used for the purpose of making things smaller. https://gist.github.com/sanguis/8fea8779e61721baeb47
[18:44:10] Asher: has joined #ruby
[18:44:56] adaedra: ACTION don't care about these kind of rubocop offenses
[18:46:37] cajone: has joined #ruby
[18:46:51] mor789: `method_missing': undefined method `public_method_defined' for Person:Class
[18:47:13] Zarthus: mor789: you need to start asking questions, not pasting your error.
[18:47:31] Zarthus: mor789: What is going wrong, what are you expecting, why do you think it is going wrong, and where is the gist of your code?
[18:47:38] Hanmac: adaedra: thumbs up from me! ;P
[18:47:45] workmad3: sanguisdex: not particularly... I'd probably ignore the offence in `get_files` as that's pretty clear IMO... I'd probably look to extract the `extract = ...` bit out into a separate method in `unpack_archive` because that feels lower-level than the other 2 parts of that method :)
[18:48:16] workmad3: sanguisdex: you could also consider using https://supermarket.chef.io/cookbooks/archive to give yourself a new resource type for that
[18:48:44] workmad3: not sure if that handles tar though
[18:48:56] Xeago: has joined #ruby
[18:48:57] Hanmac: also rubocop has a problem with "case when" so you might not get it much better :/
[18:50:28] Dimik: has joined #ruby
[18:50:41] mor789: The method "public_method_defined" exists in the Object class. Why do I get an error that its not? https://gist.github.com/anonymous/ea15982d040265dfc71b
[18:50:56] AlexRussia: has joined #ruby
[18:51:20] workmad3: sanguisdex: you're likely to run into that rubocop offence a lot if you run it over chef resources, btw... the way chef resources are declared tends towards a lot of lines, but conceptually the resource and the block is '1 thing'... but rubocop doesn't understand that sort of concept-level thing, so just criticises the long list of simple resource attribute declarations :)
[18:51:38] tAn: has joined #ruby
[18:52:18] jenrzzz: has joined #ruby
[18:52:44] colegatron: has joined #ruby
[18:53:09] MatthewsFace: has joined #ruby
[18:53:15] Authenticator: havenwood: Sorry I had to go AFK. I'm looking at your two links, thanks. (My question was vague, yes. Easy to the users is more the goal than specifically single-file.)
[18:53:20] Hanmac: mor789: "Module#public_method_defined?" is the only one ... so i think you miss the "?"
[18:53:29] Asher: has joined #ruby
[18:53:50] baweaver: has joined #ruby
[18:53:50] nettoweb: has joined #ruby
[18:55:10] mor789: hanmac: thank you
[18:55:30] kirillzh: has joined #ruby
[18:55:38] sanguisdex: workmad3: thanks, I had looked at the archive cookbook but it seemed a lot of cruft to just unzip a file, because it does not handle a tar.
[18:56:06] dlitvak: has joined #ruby
[18:56:11] workmad3: sanguisdex: the other option would be to wrap that up into your own resource
[18:56:19] workmad3: resources are pretty easy to write in chef
[18:57:23] ur5us: has joined #ruby
[18:57:33] sanguisdex: I could make it my own resource, it felt more appropriate as a method in a helpers file. here is the context https://github.com/Harvard-ATG/chef-omeka
[18:57:34] joonty: has joined #ruby
[18:57:41] sanguisdex: workmad3: ^^
[18:57:42] RegulationD: has joined #ruby
[18:58:32] iooner: has joined #ruby
[18:58:47] workmad3: sanguisdex: heh :) to me, you're stringing together a bunch of other resources... that always felt more appropriate as a new resource when I was using chef
[18:59:10] workmad3: sanguisdex: I rarely felt simple helper methods were much use in chef after a while using it
[18:59:48] workmad3: they tend to look odd and out of place when writing a recipe, while a custom resource fits into the rest of the recipe well :)
[19:00:10] alexishuard: Yeah I'd go for custom_ressource over helper method any day with Chef
[19:00:28] alexishuard: I've just wrote an entire one to include Vault Secret Management in production via Chef
[19:00:38] alexishuard: Feels good to spread those ressource in all my recipes.
[19:00:56] Shaboum: has joined #ruby
[19:03:58] blandflakes: has joined #ruby
[19:04:07] BSaboia: has joined #ruby
[19:04:26] jhn: has joined #ruby
[19:06:11] GenghisKen: has joined #ruby
[19:06:12] GenghisKen: has joined #ruby
[19:08:33] ramfjord: has joined #ruby
[19:08:38] yfeldblum: has joined #ruby
[19:09:07] techietrash: has joined #ruby
[19:09:07] techietrash: has joined #ruby
[19:09:15] nachoman: has joined #ruby
[19:09:55] ohaibbq: has joined #ruby
[19:10:20] uglybandersnatch: has joined #ruby
[19:10:57] baweaver: has joined #ruby
[19:11:17] lemur: has joined #ruby
[19:12:17] platzhirsch: has joined #ruby
[19:12:39] eurialo: has joined #ruby
[19:12:53] haylon: bougyman, I was told you might be a chef expert.
[19:13:58] MrDoctor: has joined #ruby
[19:14:23] Gnut_: has joined #ruby
[19:15:20] alexishuard: haylon: ask ahead, I do some stuff with Chef everyday.
[19:15:43] adaedra: Or better, ask the chef channel.
[19:15:58] haylon: alexishuard, I seem to be having issues with Berkshelf connecting to my chef server.http://stackoverflow.com/q/33747520/2009612
[19:16:10] haylon: adaedra, I did, and I still haven't got an answer
[19:16:12] haylon: for two days
[19:16:23] HalcyonicStorm: has left #ruby: ()
[19:16:52] failshell: has joined #ruby
[19:17:11] kirillzh: has joined #ruby
[19:17:37] spider-mario: has joined #ruby
[19:18:17] MrDoctor: has joined #ruby
[19:19:04] dfockler: has joined #ruby
[19:19:40] haylon: alexishuard, I'm in the ruby-offtopic so we're not spamming this channel
[19:19:56] alexishuard: i'll look on SO
[19:20:28] kirillzh: has joined #ruby
[19:21:47] zeroDivisible: has joined #ruby
[19:22:28] mad_hatter: has joined #ruby
[19:23:19] mad_hatter: hey guys...new to ruby looking for some documentation on how to get started with the language. I have experience with other languages (Perl & Java) so something that kinda skips the basics of computer programming and jubs into the nuts and bolts of Ruby specifically
[19:23:37] ruby[bot]: http://ruby-community.com/pages/links
[19:24:02] fostertheweb: has joined #ruby
[19:24:27] mad_hatter: Is there a ruby equivalent of perlbrew? something that will allow me to run multiple versions of ruby from my homedir? or am i stuck with system ruby?
[19:24:41] adaedra: chruby, rbenv, rvm
[19:24:51] adaedra: I would recommend chruby + ruby-install
[19:25:21] eam: mad_hatter: you might find http://rubykoans.com/ useful, set of tasks you can breeze through to pick up syntax and idioms
[19:30:13] Asher: has joined #ruby
[19:30:59] idefine: has joined #ruby
[19:31:46] snowy: has joined #ruby
[19:32:42] Renich: has joined #ruby
[19:32:46] Guest85: has joined #ruby
[19:33:08] Scriptonaut: has left #ruby: ()
[19:36:56] skade: has joined #ruby
[19:39:43] BtcBen: has joined #ruby
[19:40:01] sgambino: has joined #ruby
[19:41:07] mhoungbo: has joined #ruby
[19:43:00] krobzaur: has joined #ruby
[19:43:49] despai: has joined #ruby
[19:44:01] codex: has joined #ruby
[19:44:46] LoneHerm_: has joined #ruby
[19:46:14] dgncn: has joined #ruby
[19:46:26] rattatmatt: has joined #ruby
[19:47:46] failshell: has joined #ruby
[19:48:52] kirun: has joined #ruby
[19:49:40] mattwildig: has joined #ruby
[19:49:42] segmond: has joined #ruby
[19:50:13] blackmesa: has joined #ruby
[19:51:09] lubekpl: has joined #ruby
[19:51:40] stevemackinnon: has joined #ruby
[19:51:41] dubek: has joined #ruby
[19:52:08] Azulinho: has joined #ruby
[19:53:21] nisstyre_: has joined #ruby
[19:53:26] chipotle: has joined #ruby
[19:54:31] symm-: has joined #ruby
[19:54:37] LoneHermit: has joined #ruby
[19:55:05] Deck`: has joined #ruby
[19:56:14] godzillaenlacasa: has joined #ruby
[19:57:25] kies^: has joined #ruby
[19:57:26] jgpawletko: has joined #ruby
[19:57:39] JJM: has joined #ruby
[19:58:16] Jammy_Work: has joined #ruby
[20:00:25] ht_: has joined #ruby
[20:01:09] GenghisKen: has joined #ruby
[20:01:50] lapide_viridi: has joined #ruby
[20:07:11] trosborn: has joined #ruby
[20:07:12] platzhirsch: has left #ruby: ()
[20:07:39] Guest85_: has joined #ruby
[20:09:02] tAn: has joined #ruby
[20:09:15] dgncn: has joined #ruby
[20:09:47] dlitvak: has joined #ruby
[20:10:10] terminalrecluse: has joined #ruby
[20:11:06] st1gma: has joined #ruby
[20:11:22] gizmore: has joined #ruby
[20:11:50] LoneHerm_: has joined #ruby
[20:12:19] baweaver: has joined #ruby
[20:12:42] codex: has joined #ruby
[20:12:46] mfb2: has joined #ruby
[20:14:19] Xeago: has joined #ruby
[20:14:27] william3: has joined #ruby
[20:15:07] sandstrom: has joined #ruby
[20:15:30] InternetFriend: has joined #ruby
[20:15:34] wilbert: has joined #ruby
[20:16:18] cpup: has joined #ruby
[20:16:43] quazimodo: has joined #ruby
[20:18:02] pawnbox: has joined #ruby
[20:20:07] yqt: has joined #ruby
[20:20:27] Xeago: has joined #ruby
[20:21:01] idefine: has joined #ruby
[20:21:27] Mon_Ouie: has joined #ruby
[20:21:27] rattatmatt: has joined #ruby
[20:22:37] Asher: has joined #ruby
[20:23:09] DoubleMalt: has joined #ruby
[20:23:10] fostertheweb: has joined #ruby
[20:24:01] aegis3121: has joined #ruby
[20:24:16] Asher: has joined #ruby
[20:25:28] jimcroft: has joined #ruby
[20:25:46] mdw: has joined #ruby
[20:25:54] blackmesa: has joined #ruby
[20:26:10] poguez_: has joined #ruby
[20:26:42] william3: has joined #ruby
[20:26:49] baweaver: has joined #ruby
[20:28:00] FernandoBasso: has joined #ruby
[20:28:18] skade: has joined #ruby
[20:28:42] fostertheweb: has joined #ruby
[20:29:44] snowy: has joined #ruby
[20:31:06] idefine: has joined #ruby
[20:33:01] dlitvak: has joined #ruby
[20:33:14] aswen: has joined #ruby
[20:36:50] idefine: has joined #ruby
[20:37:03] pwnd_nsfw`: has joined #ruby
[20:37:31] dgncn: has joined #ruby
[20:38:52] synthroid: has joined #ruby
[20:41:22] kobain: has joined #ruby
[20:41:56] DefV: has joined #ruby
[20:42:58] moeabdol1: has joined #ruby
[20:43:02] wilbert_: has joined #ruby
[20:43:03] spuk: has joined #ruby
[20:43:05] Affix: has joined #ruby
[20:43:31] dlitvak_: has joined #ruby
[20:44:25] davedev24: has joined #ruby
[20:44:57] ljarvis: too late we exited sorrynotsorry
[20:46:16] Hammy_Work: has joined #ruby
[20:46:22] idefine: has joined #ruby
[20:46:38] xpt: we are back in shell?
[20:46:42] MrDoctor: has joined #ruby
[20:46:50] shevy: yeah xpt, we can not rescue the exit! :(
[20:47:07] xpt: while /bin/true; do irb ; done
[20:47:27] x77686d: has joined #ruby
[20:47:49] xpt: now you need to sigkill parent process to quit!
[20:48:02] eam: Process.kill :STOP, $$
[20:48:12] eam: there, now your outer loop is bunk too
[20:48:23] tAn: has joined #ruby
[20:48:56] xpt: eam: :'(
[20:49:16] shevy: perl code!
[20:49:18] Deck`: has joined #ruby
[20:49:20] adaedra: %x(kill -9 -1)
[20:49:32] [Butch]: has joined #ruby
[20:49:40] ljarvis: shutdown -t now
[20:49:41] pipework: Signal.trap("EXIT") { puts :nope }
[20:49:57] ruurd: shevy are you sure it's not uuencoded /dev/urandom
[20:50:03] sandstrom: has joined #ruby
[20:50:20] pipework: ruurd: Most of what shevy says is uuencoded /dev/urandom.
[20:50:58] quakephil: has joined #ruby
[20:51:08] ruurd: so why then is it shevy not named whitenoise
[20:51:26] adaedra: Given infinite numbers of threads reading /dev/urandom and infinite time, a computer can rewrite 1984.
[20:51:48] ljarvis: because that's discrimination
[20:52:15] adaedra: nativeeuropeannoise
[20:52:20] eam: the prng backing /dev/urandom is single-threaded, isn't it?
[20:52:41] ruurd: don't know. use the source luke
[20:52:42] adaedra: Implementation-dependent.
[20:52:48] adaedra: dependant?
[20:52:49] eam: gonna hit some scaling issues
[20:53:07] eam: just use RDRAND
[20:53:12] adaedra: Doesn't matter, had entropy.
[20:55:01] pipework: eam: non-blocking, so who cares?
[20:55:24] ljarvis: rewrite it in node
[20:55:24] perfectritone: has joined #ruby
[20:55:31] eam: pipework: well you'll just get empty reads
[20:55:32] pipework: Get it real close to the metal that way.
[20:55:40] pipework: eam: No, you'll just not bother until you get more.
[20:55:44] ljarvis: so close it becomes the metal
[20:55:47] pipework: Exactly how shevy works now.
[20:55:52] pipework: As intended.
[20:56:03] workmad3: has joined #ruby
[20:56:24] fostertheweb: has joined #ruby
[20:56:45] perfectritone: I'm trying to run a method on an instance defined in an included Module. It's second in line in inheritence, so super isn't cutting it. Any ideas/.
[20:57:27] apeiros: what's "an instance defined in an included Module"?
[20:57:28] idefine: has joined #ruby
[20:57:54] shevy: pipework lol
[20:57:59] perfectritone: An instance of a Class. The Module is included in the Class
[20:58:46] perfectritone: and the method I want to get to (which is superseded already) is defined in the Module that has been included
[20:58:59] shevy: perfectritone and do you happen to have code for that problem description?
[20:59:05] apeiros: I think you should make an example
[20:59:10] apeiros: because super should work for that
[20:59:17] ljarvis: I think you should make a cake
[20:59:19] ruby[bot]: here's your cake: 🍰
[20:59:36] ljarvis: ok back to work
[20:59:37] adaedra: ljarvis: tis a lie.
[20:59:42] apeiros: >> module Fuu; def x; "Fuu#x"; end; end; class Foo; include Fuu; def x; super; end; end; Foo.new.x
[20:59:43] hxegon: hmm... https://web.nvd.nist.gov/view/vuln/search-results?query=Ruby&search_type=all&cves=on
[20:59:44] ruby[bot]: apeiros: # => "Fuu#x" (https://eval.in/525679)
[20:59:59] perfectritone: super defaults to the most recently included module. in this case its the second most recently included
[21:00:17] apeiros: perfectritone: IMO you've got a serious code smell then
[21:00:23] eam: >> Module.constants.each { |o| eval "#{o} = nil" }
[21:00:24] ruby[bot]: eam: # => (eval):1: warning: already initialized constant Object ...check link for more (https://eval.in/525685)
[21:00:27] pipework: perfectritone: super_method might help.
[21:00:34] apeiros: you can use YourModule.instance_method(:name).bind(self).call
[21:00:39] apeiros: but as said, serious smell.
[21:00:53] eam: >> $VERBOSE=nil; Module.constants.each { |o| eval "#{o} = nil" }
[21:00:54] ruby[bot]: eam: # => [:Object, :Module, :Class, :BasicObject, :Kernel, :NilClass, :NIL, :Data, :TrueClass, :TRUE, :FalseC ...check link for more (https://eval.in/525688)
[21:01:02] perfectritone: Yea, I just started with a new codebase, still trying to work with it.
[21:01:02] eam: hm it survived?
[21:01:09] rattatmatt: has joined #ruby
[21:01:31] arthurl: has joined #ruby
[21:02:16] Ox0dea: eam: No in-place modifications. :)
[21:02:24] Ox0dea: Fiddle can help(?) with that.
[21:02:25] apeiros: survive? https://www.youtube.com/watch?v=ybXrrTX3LuI
[21:02:38] pawnbox: has joined #ruby
[21:02:39] shawnacscott: has joined #ruby
[21:02:54] Ox0dea: Nostalgia thread?
[21:02:55] blackmesa: has joined #ruby
[21:03:06] Asher: has joined #ruby
[21:03:32] eam: Ox0dea: I mean, Class would still be nil. I'm guessing eval.in doesn't do enough after to provoke a failure
[21:04:00] sp4rrow: has joined #ruby
[21:04:01] Ox0dea: >> $VERBOSE = Class = nil; String.class # eam
[21:04:02] ruby[bot]: Ox0dea: # => /tmp/execpad-cd9608389305/source-cd9608389305:2: warning: already initialized constant Class ...check link for more (https://eval.in/525699)
[21:04:22] shawnacscott: has left #ruby: ()
[21:04:22] LoneHermit: has joined #ruby
[21:04:24] perfectritone: Thanks apeiros and pipework!
[21:04:40] Ox0dea: Why didn't that suppress the warning?
[21:04:56] eam: because it fires before assignment?
[21:05:24] Ox0dea: >> Class = $VERBOSE = nil; String.class
[21:05:25] ruby[bot]: Ox0dea: # => Class (https://eval.in/525706)
[21:05:26] Ox0dea: That, then.
[21:05:54] perfectritone: Hopefully I'll find a better way around it. I'm dealing with RSpec and different gems overwriting #post :-/
[21:06:41] eam: Ox0dea: I think you mean
[21:06:46] eam: >> Class = $VERBOSE = nil; Class.class
[21:06:47] ruby[bot]: eam: # => NilClass (https://eval.in/525716)
[21:07:54] Ox0dea: >> Class = $VERBOSE = nil; String.class.nil? # eam
[21:07:55] ruby[bot]: Ox0dea: # => false (https://eval.in/525719)
[21:08:36] Matthews_: has joined #ruby
[21:08:38] eam: right, it's just changing the constants
[21:09:01] kaleido: has joined #ruby
[21:09:46] Ox0dea: So why were you surprised by the lack of explosions?
[21:10:10] spintronic: has joined #ruby
[21:10:12] slawrence00: has joined #ruby
[21:10:51] eam: it's fairly difficult to avoid them when that occurs
[21:10:55] DoubleMalt: has joined #ruby
[21:11:25] quakephil_: has joined #ruby
[21:11:37] Aviio: has joined #ruby
[21:11:45] Aviio: Hi Rubyists
[21:12:31] Aviio: Anybody know of a quick one-liner to get all .xml files from a directory and its sub directories?
[21:12:45] apeiros: Dir.glob("**/*.xml")
[21:13:05] apeiros: quick enough?
[21:13:12] Aviio: apeiros: ah I thought it was glob but I was passing in just *.xml, thanks!
[21:14:07] Aviio: is that relative to the file that the code is contained in?
[21:14:40] apeiros: Aviio: no. all file operations are relative to the working directory.
[21:15:04] mdw: has joined #ruby
[21:15:49] minimalism: has joined #ruby
[21:15:59] cdg_: has joined #ruby
[21:16:14] havenwood: Aviio: You can check: Dir.pwd
[21:16:32] apeiros: for some reason I prefer the .getwd alias :-/
[21:16:48] Aviio: apeiros: certainly more readable
[21:17:07] Aviio: havenwood: thanks
[21:17:20] Canar: has joined #ruby
[21:17:24] eam: wish ruby had #openat
[21:18:00] havenwood: Aviio: If you chdir in a block it'll change back when the block closes, e.g.: Dir.chdir('..') { Dir.getwd }
[21:18:35] apeiros: beware of Dir.chdir - it won't play nice with threads.
[21:19:00] havenwood: https://bugs.ruby-lang.org/issues/9785
[21:19:56] intrigueD: has joined #ruby
[21:20:06] eam: havenwood: and https://bugs.ruby-lang.org/issues/10181
[21:20:23] havenwood: eam: ah, nice
[21:20:25] hahuang65: has joined #ruby
[21:20:26] ht_: has joined #ruby
[21:20:49] nolsen: has joined #ruby
[21:21:20] apeiros: "MacOS/X no" :<
[21:22:20] idefine: has joined #ruby
[21:22:21] twitch_: has joined #ruby
[21:23:12] idefine: has joined #ruby
[21:23:37] arthurl: hi guys- i have two different web servers, one apache/passenger/rails which is connected to database on local network and one nginx/passenger/rails which is connected to the same database but over a vpn with ~40ms latency- however i am seeing much slower app performance on the nginx box- taking a look at our apps production.log I'm seeing ActiveRecord: load time is much great on the nginx box- does this simply mean rails is taking longer to talk to the
[21:23:42] weemsledeux: has joined #ruby
[21:23:50] arthurl: here is the log output https://gist.githubusercontent.com/alyssenko/1fdc3d8e98fc28e346eb/raw/00cf85422a8a673e7e8dd83b158e0091cd50ca19/gistfile1.txt
[21:23:56] eam: apeiros: osx is missing a lot of super basic stuff, like gettimeofday()
[21:24:30] jenrzzz: has joined #ruby
[21:24:33] havenwood: require 'shell'; Shell.cd('..').pwd
[21:24:38] eam: sorry I mean clock_gettime() -- for ns
[21:24:56] sanguisdex: has joined #ruby
[21:26:58] apeiros: eam: yeah, I've noticed over the last couple of years :-S
[21:27:33] eam: at least it's x86 now so I can run a fast linux vm on it
[21:28:19] centrx: has joined #ruby
[21:28:34] jimcroft: has joined #ruby
[21:28:50] afaris: has joined #ruby
[21:29:41] ht_: has joined #ruby
[21:31:02] maletor_: has joined #ruby
[21:31:18] Cohedrin: has joined #ruby
[21:32:29] pawnbox: has joined #ruby
[21:33:06] n1colas: has joined #ruby
[21:33:28] malnek: has joined #ruby
[21:33:44] snowy: has joined #ruby
[21:33:51] afaris: Is it possible to lock a rvm gemset and prevent any additions? I can't seem to break the habit of running 'gem install' while using the global gemset.
[21:34:09] idefine: has joined #ruby
[21:34:16] stevemackinnon: has joined #ruby
[21:34:21] havenwood: afaris: I suppose you could change the permissions of your global gemset dir. :O
[21:34:29] havenwood: afaris: To remove writing.
[21:34:46] afaris: heh, i hadn't thought of that
[21:36:28] goodcodeguy: has joined #ruby
[21:36:33] spintronic: has joined #ruby
[21:37:42] Xeago: has joined #ruby
[21:38:22] kirillzh: has joined #ruby
[21:38:36] kirillzh: Is there better way to convert Set to Array inside hash? https://gist.github.com/anonymous/ba9cd2dab5f2394238ed
[21:38:44] atmosx: has joined #ruby
[21:39:33] chipotle: has joined #ruby
[21:42:54] Dekade: has joined #ruby
[21:43:01] rickmasta: has joined #ruby
[21:44:50] djbkd_: has joined #ruby
[21:45:12] idefine: has joined #ruby
[21:46:49] havenwood: kirillzh: You want an Array of that particular key's value or to return a Hash with all values as Arrays?
[21:46:57] DonOtreply: has joined #ruby
[21:47:20] kirillzh: havenwood the second one.
[21:47:39] havenwood: kirillzh: h.map { |k, v| [k, v.to_a] }.to_h
[21:48:33] tAn: has joined #ruby
[21:48:53] Dusk_: has joined #ruby
[21:49:07] Dusk_: How do I install Ruby gems on Ubuntu?
[21:49:18] havenwood: dusk_: sudo gem install gem_name_here
[21:49:43] Dusk_: oh that's simple. Cool thanks.
[21:50:19] havenwood: dusk_: An aside, but Brightbox maintains up-to-date Ruby packages for Ubuntu: https://www.brightbox.com/docs/ruby/ubuntu/
[21:50:58] Dusk_: Interesting! I'll check it out (:
[21:51:04] kirillzh: havenwood I mean, I have hash let's say with keys "a", "b" and "c" (I know these keys), values of these keys are Sets. I want to convert these specific to arrays. So I was wondering if there is "better" way to do that: https://gist.github.com/anonymous/3071d6c6f3bfeab7ae9d
[21:51:07] uglybandersnatch: has joined #ruby
[21:51:16] havenwood: dusk_: Or if you want even more Rubies here's a nice guide to ruby-install/chruby for Ubuntu: http://ryanbigg.com/2014/10/ubuntu-ruby-ruby-install-chruby-and-you//
[21:52:19] Ox0dea: kirillzh: https://eval.in/525745
[21:52:53] pawnbox: has joined #ruby
[21:53:09] kirillzh: Ox0dea I don't want to convert every value, only specific ones :)
[21:53:17] Ox0dea: kirillzh: Gotcha.
[21:53:36] Ox0dea: map { |k, v| [k, Set === v ? v.to_a : v] }.to_h
[21:54:24] uglybandersnatc-: has joined #ruby
[21:54:25] kirillzh: Ox0dea I just thought maybe there is bang to_a! method and I could do h[:a].to_a!. Or something like that.
[21:54:35] Ox0dea: kirillzh: 'Fraid not.
[21:54:47] Ox0dea: Bang methods never change the object's class.
[21:55:06] kirillzh: Ox0dea oh, didn't know about that.
[21:55:15] Ox0dea: kirillzh: It's actually a difficult thing to do, in fact.
[21:55:22] Ox0dea: s/difficult/involved/, really.
[21:55:59] quazimodo: has joined #ruby
[21:56:04] kirillzh: Ox0dea havenwood thanks! I think I will go with h[:a] = h[:a].to_a for simplicity.
[21:56:52] kirillzh: Ox0dea I literally have to convert 3 keys' values :)
[21:57:07] trinaldi: has joined #ruby
[21:59:06] MatthewsFace: has joined #ruby
[21:59:22] derailed: has joined #ruby
[21:59:25] sp4rrow: has joined #ruby
[22:01:20] RahulT: has joined #ruby
[22:02:13] kappy: has joined #ruby
[22:02:46] platzhirsch: has joined #ruby
[22:03:13] moeabdol2: has joined #ruby
[22:04:28] ramfjord_: has joined #ruby
[22:05:01] nennes: has joined #ruby
[22:06:31] Gnut: has joined #ruby
[22:06:33] graydot: has joined #ruby
[22:06:45] spintronic: has joined #ruby
[22:09:40] vdamewood: has joined #ruby
[22:10:28] Dimik: has joined #ruby
[22:11:29] ElFerna_: has joined #ruby
[22:11:57] shevy: long live ruby!
[22:12:28] InternetFriend: has joined #ruby
[22:14:00] kaleido: shevy: you know you prefer perl and php
[22:15:20] htmldrum: has joined #ruby
[22:17:08] phatso727: has joined #ruby
[22:17:55] Maletor: has joined #ruby
[22:19:56] fostertheweb: has joined #ruby
[22:21:49] [BNC]WizJin: has joined #ruby
[22:22:26] LoneHerm_: has joined #ruby
[22:22:43] theunraveler: has joined #ruby
[22:23:24] nachoman: has joined #ruby
[22:25:03] Dimik: has joined #ruby
[22:25:05] sgambino: has joined #ruby
[22:25:40] alexishuard: has joined #ruby
[22:25:41] safe: has joined #ruby
[22:26:04] diego2: has joined #ruby
[22:26:17] VeryBewitching: kaleido: If Perl were declared the last language to exist and to be used, I would find a way to accept it. If PHP were delcared to be the same, I would take up carpentry full time.
[22:27:29] [BNC]WizJin: has left #ruby: ("Leaving")
[22:28:26] diego2: has joined #ruby
[22:30:28] nickjj: has joined #ruby
[22:30:54] Dreamer3_: has joined #ruby
[22:31:35] sp4rrow: has joined #ruby
[22:34:25] x77686d: has joined #ruby
[22:37:10] ElFerna_: has joined #ruby
[22:37:36] Radar: VeryBewitching: rofl
[22:38:14] graydot: has joined #ruby
[22:40:37] malcolmva: has joined #ruby
[22:41:35] fostertheweb: has joined #ruby
[22:43:02] chipotle: has joined #ruby
[22:43:17] Matthews_: has joined #ruby
[22:43:54] wastrel: has joined #ruby
[22:43:55] zenlot: has joined #ruby
[22:44:44] dome22xl: has joined #ruby
[22:44:56] rakm: has joined #ruby
[22:45:21] al2o3-cr: has joined #ruby
[22:46:41] mdw: has joined #ruby
[22:46:54] MatthewsFace: has joined #ruby
[22:51:04] blackmesa: has joined #ruby
[22:51:31] toretore: has joined #ruby
[22:52:25] pawnbox: has joined #ruby
[22:52:42] nettoweb: has joined #ruby
[22:57:17] uglybandersnatch: has joined #ruby
[22:58:21] haylon: has left #ruby: ("WeeChat 1.4")
[22:58:21] jgpawletko: has joined #ruby
[22:58:46] shevy: kaleido dunno, I had a nice perl book which was good, had a great part about regexes. perl was somewhat awkward, I actually was more productive in php strangely enough :\ ruby was best though, the other two are not in the same league
[22:59:53] postmodern: has joined #ruby
[23:00:03] bronson: both are really screwed up when it comes to objects and references... could be just personal taste which one appeals more.
[23:01:18] bronson: I've programmed enough perl to appreciate its internal consistency. but it's a pretty heavy mental burden until you have earned enough scars.
[23:01:50] wastrel: has left #ruby: ("nvm")
[23:01:57] eam: I thought perl was super straightforward
[23:02:14] jenrzzz_: has joined #ruby
[23:03:04] ledestin: has joined #ruby
[23:03:07] kobain: has joined #ruby
[23:03:23] brijesh: has joined #ruby
[23:03:58] kobain: has joined #ruby
[23:05:08] VeryBewitching: Going from programming Ruby to PHP in the last month or so, my hands hurt more. It's normal that they hurt for my medical situation, but I feel caged by syntactical nonsense throughout most of my work day.
[23:05:08] solocshaw: has joined #ruby
[23:05:17] VeryBewitching: Perl would be roughly the same effect I think.
[23:05:30] VeryBewitching: Ruby is.. freeing.
[23:05:39] eam: php is nuts. perl is pretty straightforward
[23:05:52] eam: see http://frap.net/php.txt
[23:06:10] baweaver: has joined #ruby
[23:06:40] VeryBewitching: eam: I want to do: foo = bar if bin == baz not if($bin === $baz) { $foo = $bar; }
[23:06:50] VeryBewitching: Too much typing.
[23:06:58] eam: in what language?
[23:07:17] mattwildig: has joined #ruby
[23:07:25] VeryBewitching: Now, I can use one-line conditionals... but still, think of the number of times you'd hit shift.
[23:07:37] pipework: I think that hoon is pretty cool, nock too.
[23:08:06] eam: sounds like you want shortcut eval boolean operators though
[23:08:17] VeryBewitching: eam: No, it's just an example.
[23:08:51] VeryBewitching: def foo; #...; end vs. function foo() { // ... }
[23:08:51] shevy: VeryBewitching yeah, ruby spoils one a lot
[23:08:55] bronson: can anyone tell me what they prefer: initialize the class variable inside the included block or outside?
[23:08:56] bronson: https://github.com/bronson/rails/blob/extract-integration-behavior/actionpack/lib/action_dispatch/testing/integration.rb#L756
[23:09:28] shevy: bronson problem is that I can not answer it because I don't like class variables
[23:09:32] bronson: I suspect it could be just aesthetics because it works OK either way.
[23:09:38] mostlybadfly: has joined #ruby
[23:09:39] bronson: shevy: me neither.
[23:09:48] bronson: especially when ActiveSupport::Concerning.
[23:09:57] bronson: unfortunately I inherited this one.
[23:09:57] shevy: however had, if it would be a @foo variable, on the toplevel instance, like a class level instance variable, then always initialize it near the top somewhere
[23:10:00] shiver_: has joined #ruby
[23:10:00] eam: one thing perl does that I wish ruby would do is merge def and proc/lambda
[23:10:02] quazimodo: has joined #ruby
[23:10:13] eam: why can't def with no name return a lambda?
[23:10:32] shevy: it could return a proc!
[23:10:43] bronson: agree 100%. stabby procs are neat but just paper over the oddity.
[23:10:52] shevy: are defs without names possible?
[23:11:02] aibot: has joined #ruby
[23:11:04] eam: the syntax is ambiguous, I think
[23:11:22] eam: (or, would be)
[23:11:25] VeryBewitching: Can you declare a null symbol?
[23:12:17] eam: >> define_method "", ->{"yes"}; send "" # if you mean empty string
[23:12:19] ruby[bot]: eam: # => "yes" (https://eval.in/525758)
[23:12:33] VeryBewitching: Empty is not the same as null.
[23:12:44] eam: right, that's why I said if :)
[23:12:51] eam: not sure what null indicates in ruby
[23:13:00] VeryBewitching: >> define_method nil, ->{"yes"}; send ""
[23:13:01] ruby[bot]: VeryBewitching: # => nil is not a symbol nor a string (TypeError) ...check link for more (https://eval.in/525759)
[23:13:09] eam: oh nil :)
[23:13:13] eam: nil != null
[23:13:24] kaleido: >> nil.type
[23:13:25] ruby[bot]: kaleido: # => undefined method `type' for nil:NilClass (NoMethodError) ...check link for more (https://eval.in/525760)
[23:13:39] VeryBewitching: >> define_method null, ->{"yes"}; send ""
[23:13:41] ruby[bot]: VeryBewitching: # => undefined local variable or method `null' for main:Object (NameError) ...check link for more (https://eval.in/525761)
[23:14:04] eam: >> define_method :null, ->{"yes"}; send :null
[23:14:05] ruby[bot]: eam: # => "yes" (https://eval.in/525762)
[23:14:06] VeryBewitching: I know nil is NilClass, but it should represent the absence of data.
[23:14:20] VeryBewitching: eam: In that case, :null is just a symbol.
[23:14:31] VeryBewitching: You can't send null to define_method.
[23:14:38] uglybandersnatch: has joined #ruby
[23:14:44] shiver_: has joined #ruby
[23:14:52] workmad3: has joined #ruby
[23:14:59] apeiros: ACTION wonders whether that should make sense…
[23:15:13] eam: null isn't a thing in ruby
[23:15:37] eam: in C it'd be a pointer value
[23:16:52] dubek: has joined #ruby
[23:16:59] BTRE: has joined #ruby
[23:17:09] y2mq37: has joined #ruby
[23:17:16] eam: unless we're talking characters, because null is a character value as well
[23:17:25] Ox0dea: That's NUL. :)
[23:17:25] eam: in which case
[23:17:46] eam: >> define_method 0.chr, ->{"yes"}; send 0.chr
[23:17:47] ruby[bot]: eam: # => "yes" (https://eval.in/525763)
[23:17:49] VeryBewitching: When I use the term "null", I mean to say the absence of data.
[23:17:55] shiver: has joined #ruby
[23:17:58] Ox0dea: Ruby's null value is spelled `nil`.
[23:18:01] VeryBewitching: Various languages have a way to represent nothing.
[23:18:05] eam: VeryBewitching: well that'd be an empty buffer then, right?
[23:18:05] apeiros: NUL is only the abbreviation for the null-byte
[23:18:17] VeryBewitching: eam: Yes, but an empty buffer with no type.
[23:18:18] Ox0dea: Isn't it the character's canonical name?
[23:18:29] VeryBewitching: No characteristics except that it is nothing.
[23:18:52] Ox0dea: VeryBewitching: `Undef = Object.new`
[23:18:58] eam: VeryBewitching: no such concept exists in computers, as far as I'm aware
[23:19:02] apeiros: I wonder whether with characters we've managed to actually have canonical names :-S - I guess unicode codepoint names come closest to that?
[23:19:13] Ox0dea: That's how I meant, anyway.
[23:19:22] eam: all the various values named like or sounding like null represent a value
[23:19:51] apeiros: Ox0dea: https://en.wikipedia.org/wiki/List_of_Unicode_characters
[23:19:59] apeiros: says "null character", abbreviation "nul"
[23:20:10] eam: and in fact, null pointers aren't always zero
[23:20:29] VeryBewitching: So... the reason why I casually mentioned null (and it turned into a bit of a chat) is that you shouldn't define a method in the same way you define code to be executed within a very specific scope.
[23:20:31] apeiros: though, "null character" is listed under "description" - does that count as "name"?
[23:20:54] Ox0dea: UnicodeData.txt calls it NULL, so I guess NUL is an abbreviation.
[23:21:02] VeryBewitching: apeiros: A description is subjective, a name is unique.
[23:21:25] blackgoat: has joined #ruby
[23:21:30] shevy: unique names hmm :)
[23:21:43] eam: VeryBewitching: you'll love php's create_function() then
[23:21:49] Ox0dea: Internally, MRI does have Qundef for representing "nonexistence", but it's not directly exposed.
[23:21:51] VeryBewitching: eam: I've used it.
[23:22:04] eam: "returns a named anonymous function"
[23:22:25] gsilvapt: has joined #ruby
[23:22:38] shevy: the schroedinger cat
[23:22:39] Ox0dea: `foo = -> {}` is arguably a "named anonymous function".
[23:22:40] eam: can you imagine if lambda{} returned :function01, :function02
[23:22:51] Ox0dea: But yeah, that'd be goofy.
[23:23:13] eam: Ox0dea: nah foo isn't the name of the function it's just a reference to it
[23:23:21] graydot: has joined #ruby
[23:23:41] apeiros: >> ->{}.instance_eval { def self.name; "it's a me, lambda!" end }.name
[23:23:43] ruby[bot]: apeiros: # => undefined method `name' for :name:Symbol (NoMethodError) ...check link for more (https://eval.in/525764)
[23:23:52] apeiros: ACTION grumbles
[23:24:05] apeiros: forgot that instance_eval doesn't tap
[23:24:30] apeiros: >> x = ->{}; x.instance_eval { def self.name; "it's a me, lambda!" end }; x.name
[23:24:31] ruby[bot]: apeiros: # => "it's a me, lambda!" (https://eval.in/525765)
[23:24:59] blackmesa: has joined #ruby
[23:25:08] apeiros: what's in a name?
[23:27:21] ta: has joined #ruby
[23:27:26] intrigueD: has joined #ruby
[23:27:31] kfpratt: has joined #ruby
[23:27:49] shevy: "a" and "m"!
[23:28:02] VeryBewitching: OK, Eve time, til the morrow..
[23:28:05] sgambino: has joined #ruby
[23:28:12] apeiros: I'm sure shakespeare would have loved that answer
[23:29:09] Domaldel: has joined #ruby
[23:29:19] jottr: has joined #ruby
[23:30:11] eam: >> ?b * 2 || !(?b * 2)
[23:30:12] ruby[bot]: eam: # => "bb" (https://eval.in/525769)
[23:32:18] Dimik: has joined #ruby
[23:32:27] pawnbox: has joined #ruby
[23:34:33] ur5us: has joined #ruby
[23:35:21] Matthews_: has joined #ruby
[23:35:31] trosborn: has joined #ruby
[23:36:33] sp4rrow: has joined #ruby
[23:37:11] n_blownapart: has joined #ruby
[23:37:12] mary5030: has joined #ruby
[23:37:13] _djbkd: has joined #ruby
[23:37:28] sanguisdex: has joined #ruby
[23:37:35] shevy: To do is to be
[23:37:41] shevy: Do be do be do
[23:37:41] Ox0dea: There should be a juxtaposition operator.
[23:37:52] ankhers: has joined #ruby
[23:38:05] Ox0dea: `2b` would be a method call.
[23:38:18] Ox0dea: Don't ask me what to name the method. :P
[23:39:35] pdoherty: has joined #ruby
[23:40:26] binaryplease: has joined #ruby
[23:42:01] gsilvapt: has joined #ruby
[23:42:22] bronson: has joined #ruby
[23:44:38] sgambino: has joined #ruby
[23:45:45] baweaver: has joined #ruby
[23:46:01] LoganG: has joined #ruby
[23:46:20] blackmes1: has joined #ruby
[23:46:41] ElFerna_: has joined #ruby
[23:46:54] chipotle: has joined #ruby
[23:47:08] mfb2: has joined #ruby
[23:47:33] LoneHerm_: has joined #ruby
[23:49:16] dlitvak: has joined #ruby
[23:50:03] bricker: has joined #ruby
[23:52:01] gsilvapt: has joined #ruby
[23:52:02] Aviio: 99 little bugs in the code, take one down, patch it around, 127 little bugs in the code :(
[23:54:35] shevy: you are proceeding in the wrong direction Aviio!
[23:54:57] godzillaenlacasa: has joined #ruby
[23:55:28] Aviio: shevy: im working on some code that someone with very little programming experience has written, such spaghetti code :(
[23:56:19] recycle: has joined #ruby
[23:56:56] Aviio: https://github.com/Aviio/SecGen/tree/master is the original code, https://github.com/Aviio/SecGen/tree/directory_change is where im currently at with moving things around
[23:59:29] jenrzzz: has joined #ruby
[23:59:52] headius: has joined #ruby