« Back to channel list

#ruby - 17 January 2018

« Back 1 day Forward 1 day »
[00:01:03] nerium: has joined #ruby
[00:02:37] eckhardt: has joined #ruby
[00:03:48] belmoussaoui: has joined #ruby
[00:03:58] s3nd1v0g1us: has joined #ruby
[00:05:46] jenrzzz: has joined #ruby
[00:05:47] jenrzzz: has joined #ruby
[00:07:40] al2o3-cr1: has joined #ruby
[00:08:22] belmoussaoui: has joined #ruby
[00:10:33] cschneid_: has joined #ruby
[00:10:34] jtdoncas: has joined #ruby
[00:13:22] chocoelho1: has joined #ruby
[00:14:34] jmpf: has joined #ruby
[00:14:36] bronson: has joined #ruby
[00:25:16] fmcgeough: has joined #ruby
[00:28:22] eric_hill: has joined #ruby
[00:35:32] fmcgeough: has joined #ruby
[00:39:11] eckhardt: has joined #ruby
[00:39:13] _whitelogger: has joined #ruby
[00:45:47] nerium: has joined #ruby
[00:46:52] eric_hill: has joined #ruby
[00:47:11] belmoussaoui_: has joined #ruby
[00:54:38] Toggi3: has joined #ruby
[00:57:35] TomyLobo: has joined #ruby
[00:57:50] chocoelho1: has joined #ruby
[00:57:51] zigzig: has joined #ruby
[00:58:12] eckhardt: has joined #ruby
[00:58:49] DTZUZU2: has joined #ruby
[01:14:38] jnyw: has joined #ruby
[01:15:18] bronson: has joined #ruby
[01:19:04] kossae: has joined #ruby
[01:28:46] nadir: has joined #ruby
[01:37:50] sanscoeur: has joined #ruby
[01:40:35] mjolnird: has joined #ruby
[01:44:05] bmurt: has joined #ruby
[01:50:26] DTZUZU2: has joined #ruby
[01:52:42] workmad3: has joined #ruby
[01:57:52] LenPayne: has joined #ruby
[02:00:57] Aloy: has joined #ruby
[02:06:00] Nilium: has joined #ruby
[02:09:55] cschneid_: has joined #ruby
[02:10:46] jeffreylevesque_: has joined #ruby
[02:16:35] bronson: has joined #ruby
[02:18:07] LastWhisper____: has joined #ruby
[02:24:56] gizmore|2: has joined #ruby
[02:26:18] cschneid_: has joined #ruby
[02:37:32] zigzig: has joined #ruby
[02:37:32] cschneid_: has joined #ruby
[02:39:07] _aeris_: has joined #ruby
[02:41:30] konsolebox_: has joined #ruby
[02:42:21] Aloy: has joined #ruby
[02:43:24] jeffreylevesque: has joined #ruby
[02:45:40] jnollette: has joined #ruby
[02:47:26] tamouse__: has joined #ruby
[02:47:43] tamouse__: has left #ruby: ()
[02:53:12] Toggi3: has joined #ruby
[03:00:41] EXCHGR: has joined #ruby
[03:05:26] cpruitt: has joined #ruby
[03:16:12] elphe: has joined #ruby
[03:17:14] bronson: has joined #ruby
[03:23:21] k0mpa: has joined #ruby
[03:23:59] bmurt: has joined #ruby
[03:24:18] orbyt_: has joined #ruby
[03:26:57] ledestin: has joined #ruby
[03:30:40] chocoelho: has joined #ruby
[03:34:12] pastorinni: has joined #ruby
[03:36:32] c-c: has joined #ruby
[03:36:54] cdg_: has joined #ruby
[03:38:47] bmurt: has joined #ruby
[03:40:05] darkhanb: has joined #ruby
[03:43:07] cpruitt: has joined #ruby
[03:50:06] cpruitt: has joined #ruby
[03:53:25] workmad3: has joined #ruby
[03:55:47] orbyt_: has joined #ruby
[03:57:48] alfiemax: has joined #ruby
[03:57:56] cpruitt: has joined #ruby
[03:58:05] milardovich: has joined #ruby
[04:00:24] bmurt: has joined #ruby
[04:04:13] pastorinni: has joined #ruby
[04:06:00] w0b: has joined #ruby
[04:06:32] govg: has joined #ruby
[04:11:55] govg: has joined #ruby
[04:15:35] bmurt: has joined #ruby
[04:18:06] bronson: has joined #ruby
[04:18:42] jtdoncas: has joined #ruby
[04:21:22] jjaii9: has joined #ruby
[04:29:17] Guest9063: has left #ruby: ()
[04:31:45] jtdoncas: has joined #ruby
[04:32:19] Toggi3: has joined #ruby
[04:34:32] riskish: has joined #ruby
[04:37:23] maum: has joined #ruby
[04:38:08] c_nick: has joined #ruby
[04:42:10] gix-: has joined #ruby
[04:42:51] Mutsuhito: has joined #ruby
[04:45:13] cschneid_: has joined #ruby
[04:47:46] r3kz: has joined #ruby
[04:50:44] Guest54943: has left #ruby: ()
[04:53:11] jtdoncas: has joined #ruby
[05:00:22] jtdoncas: has joined #ruby
[05:02:01] milardovich: has joined #ruby
[05:03:18] oleo: has joined #ruby
[05:04:30] KeyJoo: has joined #ruby
[05:04:44] nadir: has joined #ruby
[05:14:13] deathsparton: has joined #ruby
[05:14:32] deathsparton: has joined #ruby
[05:16:55] rabajaj: has joined #ruby
[05:17:01] iMadper: has joined #ruby
[05:19:12] bronson: has joined #ruby
[05:22:15] thejamespinto: has joined #ruby
[05:24:23] zigzig: has joined #ruby
[05:29:59] ramfjord: has joined #ruby
[05:31:30] ur5us: has joined #ruby
[05:34:58] iamarun: has joined #ruby
[05:38:01] aupadhye: has joined #ruby
[05:39:34] deathsparton: has joined #ruby
[05:39:39] naprimer: has joined #ruby
[05:40:13] c_nick: has joined #ruby
[05:45:07] ohcibi: has joined #ruby
[05:47:48] Nilium: has joined #ruby
[05:49:14] ledestin: has joined #ruby
[05:59:12] rabajaj: has joined #ruby
[06:00:09] cdg: has joined #ruby
[06:02:34] apeiros: has joined #ruby
[06:03:59] cschneid: has joined #ruby
[06:05:04] Klumben: has joined #ruby
[06:07:13] alfiemax: has joined #ruby
[06:10:18] ahrs: has joined #ruby
[06:10:57] armyriad: has joined #ruby
[06:19:46] bronson: has joined #ruby
[06:20:30] oetjenj: has joined #ruby
[06:22:14] LocaMocha: has joined #ruby
[06:24:24] chouhoulis: has joined #ruby
[06:30:53] cdg: has joined #ruby
[06:31:40] reber: has joined #ruby
[06:35:20] roshanavand: has joined #ruby
[06:35:39] elphe: has joined #ruby
[06:38:02] DaFiN: has joined #ruby
[06:38:14] DaFiN: hello, i have a very specific query
[06:38:17] DaFiN: related to gem
[06:38:31] DaFiN: i put > gem search ^git
[06:38:55] DaFiN: i can find all gem packages using "gem search git", but, can i also install them all in windows
[06:39:07] DaFiN: or do i need to export the list and input it?
[06:39:42] Toggi3: has joined #ruby
[06:39:59] havenwood: DaFiN: You want to install every gem starting with "git"? Or something else?
[06:40:13] havenwood: DaFiN: You can: gem install gem-name-here
[06:41:32] havenwood: DaFiN: Say more about what you're trying to do?
[06:42:29] anisha: has joined #ruby
[06:43:14] kossae: has joined #ruby
[06:46:35] cschneid: has joined #ruby
[06:47:13] DaFiN: havenwood: matching a pattern yes
[06:47:18] oetjenj: has joined #ruby
[06:47:21] DaFiN: say every git-*
[06:47:31] DaFiN: ^git-\w$ ?
[06:47:35] DaFiN: something like that
[06:47:37] _aeris_: has joined #ruby
[06:48:01] havenwood: DaFiN: gem search "^git-"
[06:48:05] oetjenj: has joined #ruby
[06:48:09] DaFiN: havenwood: yes
[06:48:14] havenwood: DaFiN: Do you also want to install them all?
[06:48:14] DaFiN: but howto download those
[06:48:20] DaFiN: do i need to put all of those 1 at a time
[06:48:28] DaFiN: in linux i suppose i could xargs
[06:48:39] DaFiN: havenwood: yes
[06:48:51] oetjenj: has joined #ruby
[06:48:52] havenwood: DaFiN: 223 gems?
[06:49:15] DaFiN: i find only 2 matching git-?
[06:49:17] DaFiN: i find only 2 matching git-*?
[06:49:20] Ishido: has joined #ruby
[06:49:37] oetjenj: has joined #ruby
[06:50:27] DaFiN: sorry sorry i meant other one
[06:50:28] oetjenj: has joined #ruby
[06:50:51] _aeris_: has joined #ruby
[06:51:09] havenwood: DaFiN: PowerShell or cmd.exe?
[06:51:09] oetjenj: has joined #ruby
[06:51:47] DaFiN: havenwood: i suppose i got the answer
[06:51:59] DaFiN: it implies there is no feature to "pattern install" using gem
[06:52:04] DaFiN: like yum or dnf no?
[06:53:16] havenwood: DaFiN: correct, there's no globbing for install or whatnot
[06:54:01] DaFiN: could you suggest how i could have put that question forth in first place
[06:54:46] DaFiN: i am looking forward to installing packages using gem using a pattern similar to yum
[06:56:45] baweaver: Lies and slander
[06:56:48] baweaver: gems=`gem search ^rails`.lines.grep(/^[a-z]/i).map{|v|v.split[0]}.join(' ');`gem install #{gems}`
[06:57:37] baweaver: Throw that in a bin, take some ARGVs, and boom!
[06:58:00] baweaver: havenwood: I did a bad thing
[06:59:16] havenwood: for gem in $(gem search '^git-' | cut -d' ' -f1); do; gem install "$gem"; done
[06:59:21] dminuoso: baweaver: that .map { |v| v.split[0] } is absolutely gross.
[06:59:22] havenwood: baweaver: install them all!
[06:59:48] baweaver: havenwood: gem takes space delimited gem names
[06:59:53] baweaver: gem install*
[07:00:04] dminuoso: o/ baweaver
[07:00:06] baweaver: dminuoso: All I do is hack hack hack
[07:00:08] dminuoso: \o havenwood
[07:00:39] darkhanb: has joined #ruby
[07:01:01] baweaver: It's fun to stay at the...
[07:01:08] havenwood: baweaver: good point, so: gem install $(gem search '^git-' | cut -d' ' -f1 | tr '\n' ' ')
[07:01:33] baweaver: remember it gives you *** REMOTE SOURCE ***
[07:01:46] havenwood: 223 gems later...
[07:02:32] thejamespinto: has joined #ruby
[07:04:17] havenwood: baweaver: cut takes care of those
[07:04:37] havenwood: gem search '^git-' | cut -d' ' -f1 | head -n 1 #=> git-2-s3
[07:05:26] ur5us: has joined #ruby
[07:06:31] havenwood: baweaver: err, it's not cut that takes care of it, rather the piping it seems
[07:06:48] havenwood: gem search '^git-' | head -n 1 #=> git-2-s3 (0.1.3)
[07:07:40] havenwood: convenient, but odd
[07:14:58] iamarun: has joined #ruby
[07:15:02] DaFiN: havenwood: thats a dos for
[07:15:10] Toggi3: has joined #ruby
[07:17:06] zapata: has joined #ruby
[07:17:40] chouhoulis: has joined #ruby
[07:17:45] DaFiN: awesome thanks
[07:19:42] eckhardt: has joined #ruby
[07:20:38] bronson: has joined #ruby
[07:22:50] pwnd_nsfw: has joined #ruby
[07:23:55] Nilium: has joined #ruby
[07:24:51] deathsparton: has joined #ruby
[07:25:28] conta: has joined #ruby
[07:26:05] andikr: has joined #ruby
[07:27:49] aufi: has joined #ruby
[07:33:31] jenrzzz: has joined #ruby
[07:33:51] gnufied: has joined #ruby
[07:40:03] mtkd: has joined #ruby
[07:43:36] jenrzzz: has joined #ruby
[07:46:54] vichib: has joined #ruby
[07:48:40] bawNg: has joined #ruby
[07:55:08] workmad3: has joined #ruby
[08:01:24] jenrzzz: has joined #ruby
[08:03:32] Toggi3: has joined #ruby
[08:04:26] roshanavand: has joined #ruby
[08:04:39] soniya29: has joined #ruby
[08:10:47] zigzig: has joined #ruby
[08:13:16] apeiros: has joined #ruby
[08:13:31] elphe: has joined #ruby
[08:17:44] TomyWork: has joined #ruby
[08:18:01] Mia: has joined #ruby
[08:18:02] Mia: has joined #ruby
[08:22:03] bronson: has joined #ruby
[08:22:06] tAn: has joined #ruby
[08:24:45] cpruitt: has joined #ruby
[08:25:03] jenrzzz: has joined #ruby
[08:30:20] dionysus69: has joined #ruby
[08:48:42] mark_66: has joined #ruby
[08:49:51] elomatreb: has joined #ruby
[08:57:31] cpruitt: has joined #ruby
[08:57:32] deathsparton: has joined #ruby
[08:58:08] mkroman: has joined #ruby
[08:58:51] mtkd: has joined #ruby
[09:01:03] drewmcmillan: has joined #ruby
[09:01:56] guille-moe: has joined #ruby
[09:02:06] ur5us: has joined #ruby
[09:03:15] marr: has joined #ruby
[09:04:25] thejamespinto: has joined #ruby
[09:08:03] randomstrangerb: has joined #ruby
[09:12:29] phaul: has joined #ruby
[09:13:23] Beams: has joined #ruby
[09:15:08] jenrzzz: has joined #ruby
[09:15:08] jenrzzz: has joined #ruby
[09:23:00] bronson: has joined #ruby
[09:25:56] jenrzzz: has joined #ruby
[09:26:42] snapcase: has joined #ruby
[09:29:27] lunarkitty7: has joined #ruby
[09:30:13] ramfjord: has joined #ruby
[09:31:14] cpruitt: has joined #ruby
[09:33:02] Morrolan: has joined #ruby
[09:37:22] conta: has joined #ruby
[09:43:31] zigzig: has joined #ruby
[09:45:29] ledestin: has joined #ruby
[09:49:29] goatish: has joined #ruby
[09:52:52] Dykam: has joined #ruby
[09:54:52] plexigras: has joined #ruby
[09:54:53] cabotto: has joined #ruby
[09:56:00] workmad3: has joined #ruby
[09:56:45] cabotto: has joined #ruby
[09:58:00] Mortomes|Work: has joined #ruby
[10:00:16] Serpent7776: has joined #ruby
[10:02:12] DaFiN: has joined #ruby
[10:03:06] cpruitt: has joined #ruby
[10:03:44] snapcase: has joined #ruby
[10:04:57] elphe: has joined #ruby
[10:09:22] alfiemax: has joined #ruby
[10:11:18] iamarun: has joined #ruby
[10:11:22] mkroman: has joined #ruby
[10:12:51] cabotto: has joined #ruby
[10:13:55] alfiemax_: has joined #ruby
[10:19:15] kossae: has joined #ruby
[10:19:41] bweston92: has joined #ruby
[10:20:50] amatas: has joined #ruby
[10:21:07] bawNg: what is the best option if I want to release a gem with a C extension that needs to build against some internal MRI headers? if I copy the Ruby headers into the project, they will have to be manually updated for new Ruby versions, but if I don't, no one will be able to build the gem without downloading the Ruby source
[10:21:43] Cavallari: has joined #ruby
[10:21:59] KeyJoo: has joined #ruby
[10:23:46] bronson: has joined #ruby
[10:23:47] TinkerTyper: has joined #ruby
[10:25:30] cdg: has joined #ruby
[10:28:17] govg: has joined #ruby
[10:28:27] InfinityFye: has joined #ruby
[10:30:44] InfinityFye: has joined #ruby
[10:30:57] InfinityFye: has left #ruby: ()
[10:31:45] InfinityFye: has joined #ruby
[10:32:27] InfinityFye: has left #ruby: ()
[10:34:00] belmoussaoui: has joined #ruby
[10:35:27] ldnunes: has joined #ruby
[10:40:16] Toggi3: has joined #ruby
[10:41:49] cpruitt: has joined #ruby
[10:42:47] cabotto: has left #ruby: ()
[10:45:20] dionysus69: is there a cooler way to write this?
[10:45:35] dionysus69: amount = some_params[:amount].to_d
[10:45:35] dionysus69: amount = amount < 0 ? amount * -1 : amount
[10:45:49] dionysus69: I just want to make sure input by user is positive
[10:46:56] ruby[bot]: dminuoso: # => 5 (https://eval.in/936305)
[10:46:56] cabotto: has joined #ruby
[10:47:11] ruby[bot]: dminuoso: # => 5 (https://eval.in/936306)
[10:47:48] dionysus69: ok forgot about that, and I used it like a week ago thanks dminuoso :D
[10:49:11] randomstrangerb: has joined #ruby
[10:52:52] alfiemax: has joined #ruby
[10:58:11] Guest73369: has joined #ruby
[10:58:22] jaruga: has joined #ruby
[11:00:06] Kedare: has joined #ruby
[11:00:58] Kedare: has left #ruby: ()
[11:01:57] Cavallari1: has joined #ruby
[11:03:59] mtkd: has joined #ruby
[11:11:02] cpruitt: has joined #ruby
[11:14:02] cschneid: has joined #ruby
[11:21:13] deathsparton: has joined #ruby
[11:22:49] apeiros: dminuoso: don't you think some_params[:amount].delete("-").to_d would be nicer? 😇
[11:23:05] apeiros: (math by string manipulation, yay :D)
[11:24:36] bronson: has joined #ruby
[11:24:48] dminuoso: let me just sed our monorepo.
[11:25:27] dminuoso: git commit -m "Refactoring based on recommendation from #ruby expert"
[11:30:27] ramfjord: has joined #ruby
[11:32:58] xfbs: has joined #ruby
[11:34:03] amatas_: has joined #ruby
[11:34:31] alfiemax: has joined #ruby
[11:38:22] conta1: has joined #ruby
[11:43:37] tvw: has joined #ruby
[11:44:30] kossae: has joined #ruby
[11:44:51] Azure: has joined #ruby
[11:45:14] kossae: has joined #ruby
[11:47:04] cpruitt: has joined #ruby
[11:48:08] cdg: has joined #ruby
[11:51:37] AJA4350: has joined #ruby
[11:55:56] quobo: has joined #ruby
[11:56:20] workmad3: has joined #ruby
[12:00:07] Toggi3: has joined #ruby
[12:03:05] kiltzman: has joined #ruby
[12:03:30] kiltzman: has joined #ruby
[12:04:00] kiltzman: has joined #ruby
[12:05:06] kiltzman: has joined #ruby
[12:19:52] zautomata: has joined #ruby
[12:22:53] plexigras: has joined #ruby
[12:25:14] fmcgeough: has joined #ruby
[12:25:22] bronson: has joined #ruby
[12:26:58] kapil___: has joined #ruby
[12:31:54] vtx: has joined #ruby
[12:33:19] vtx: hi guys, is there an idiomatic/simple way of comparing two arrays in ruby? essentially i want to check that two arrays contain the same elements, regardless of order. so [“a”,”b”,”c”] and [“c”,”b”,”a”] would be considered equal. how can i do this?
[12:33:49] dminuoso: (a - b).empty?
[12:34:12] dminuoso: vtx: Of course things get a bit more tricky if you admit non unique elements.
[12:34:54] dminuoso: Or rather: ((a - b) | (b - b)).empty?
[12:34:58] dminuoso: Or rather: ((a - b) | (b - a)).empty?
[12:35:56] dminuoso: https://eval.in/936380
[12:36:41] apparition: has joined #ruby
[12:40:00] VladGh: has joined #ruby
[12:40:12] tobiasvl: that's nice, I was going to suggest a.to_set == b.to_set (but that requires a require)
[12:40:20] tobiasvl: but yes, non-unique elements are a problem
[12:43:44] cabotto: has joined #ruby
[12:45:09] John_Ivan: has joined #ruby
[12:45:20] sepp2k: has joined #ruby
[12:53:11] Camusensei: has joined #ruby
[12:55:00] Camusensei: Hello guys! Is there a way to specify a system command through an array of arguments instead of a string? like password="'"; `echo #{password}` sh: 1: Syntax error: Unterminated quoted string
[12:55:37] Camusensei: (I don't want to shellescape the string)
[12:55:50] Camusensei: I know it works, it's just not what I'm looking for
[12:57:32] cabotto: has joined #ruby
[12:58:15] apeiros: Camusensei: yes, system(), popen() and spawn() allow that
[12:58:25] Camusensei: system(*myarray) works fine, thanks! (from https://www.ruby-forum.com/topic/2012139)
[12:59:05] apeiros: note that system does two things vastly different from backticks: it does NOT return its output, it DOES however print its output on ruby's $stdout and $stderr directly.
[12:59:30] MaksimPinigin: has joined #ruby
[12:59:38] Camusensei: it's fine, I don't need the output in this case, thank you :)
[12:59:41] ped: has joined #ruby
[13:00:13] srandon111: has joined #ruby
[13:00:22] srandon111: hello all, guys is there any module to do google searches?
[13:00:31] chmurifree: has joined #ruby
[13:00:55] apeiros: srandon111: Net::HTTP
[13:01:11] srandon111: apeiros: so low level?
[13:01:38] apeiros: the more specific your question, the more specific the answer
[13:01:45] amatas_: has joined #ruby
[13:02:13] srandon111: apeiros... i would like something where i put the query to do to google and it returns me the results in form of a list or hash
[13:02:42] apeiros: I'm not aware of any. but I'd search rubygems.org
[13:04:40] Vapez: has joined #ruby
[13:05:29] Guest73369: has joined #ruby
[13:06:17] tbuehlmann: apeiros: do you know the differences between the several shelling out options by heart?
[13:06:36] dminuoso: tbuehlmann: https://i.stack.imgur.com/1Vuvp.png
[13:06:46] dminuoso: I got that printed out on my desk (somewhere)
[13:09:03] mtkd: has joined #ruby
[13:09:42] jeffreylevesque_: has joined #ruby
[13:10:19] apeiros: tbuehlmann: partially
[13:10:27] apeiros: tbuehlmann: I know spawn is the swiss army knife
[13:10:32] guille-moe: has joined #ruby
[13:10:55] apeiros: and I know the main differences between ``, system, popen, popen3 and popen4. but I lack some minutiae.
[13:11:13] apeiros: and I *always* have to lookup the docs when I want to use spawn :D
[13:12:12] apeiros: dminuoso: y u no Kernel#spawn there?
[13:12:12] bmurt: has joined #ruby
[13:12:21] dminuoso: apeiros: Its not mine
[13:12:59] dminuoso: apeiros: Its from some SO answer, but it was good so I bookmarked it.
[13:13:07] apeiros: meh, that's the domain and I now almost confused it with lemur. I'm terrible.
[13:14:06] apeiros: honestly, nowadays if it's not solved by ``, I go straight to spawn. popen and system are almost always just ever so close but not close enough.
[13:14:13] Camusensei: said SO answer: https://stackoverflow.com/a/31572431/4486184
[13:16:00] dminuoso: apeiros: The only diagram floating around by me is http://i.imgur.com/04Mlrwp.png
[13:16:21] dminuoso: And look! Colors!
[13:16:38] aspiers: has joined #ruby
[13:19:25] deathsparton: has joined #ruby
[13:19:43] tlr: has joined #ruby
[13:26:17] bronson: has joined #ruby
[13:27:46] xfbs: has joined #ruby
[13:28:52] fyrril: has joined #ruby
[13:29:23] amatas_: has joined #ruby
[13:32:25] shinnya: has joined #ruby
[13:32:40] workmad3: has joined #ruby
[13:33:30] amatas_: has joined #ruby
[13:34:06] alfiemax_: has joined #ruby
[13:35:00] deathsparton: has joined #ruby
[13:35:25] deathsparton: has joined #ruby
[13:35:50] deathsparton: has joined #ruby
[13:36:27] dminuoso: Almost but not quite.
[13:38:52] apeiros__: has joined #ruby
[13:39:18] cajone: has joined #ruby
[13:40:32] bmurt: has joined #ruby
[13:40:38] roshanavand: has joined #ruby
[13:42:30] cajone: has left #ruby: ()
[13:50:06] deathsparton: has joined #ruby
[13:50:40] amatas_: has joined #ruby
[13:53:58] chocoelho: has joined #ruby
[13:56:39] dviola: has joined #ruby
[14:01:57] drewmcmillan: has joined #ruby
[14:05:07] cabotto: has joined #ruby
[14:05:22] nadir: has joined #ruby
[14:09:01] randomstrangerb: has joined #ruby
[14:09:53] cabotto: has joined #ruby
[14:10:14] jeffreylevesque: has joined #ruby
[14:12:24] Toggi3: has joined #ruby
[14:14:26] synthroid: has joined #ruby
[14:25:37] vondruch: has joined #ruby
[14:27:17] bronson: has joined #ruby
[14:32:26] bmurt: has joined #ruby
[14:41:05] deathsparton: has joined #ruby
[14:41:41] vtx: has joined #ruby
[14:42:47] deathsparton_: has joined #ruby
[14:43:20] DLSteve: has joined #ruby
[14:46:53] rrichardsr3: has joined #ruby
[14:47:49] ramfjord: has joined #ruby
[14:48:21] deathsparton: has joined #ruby
[14:50:06] nckpz: has joined #ruby
[14:50:55] Rapture: has joined #ruby
[14:52:00] thejamespinto: has joined #ruby
[14:53:08] Zamyatin: has joined #ruby
[14:53:33] kapil___: has joined #ruby
[14:54:41] dionysus69: has joined #ruby
[14:55:12] rippa: has joined #ruby
[15:00:35] LastWhisper____: has joined #ruby
[15:00:50] cdg_: has joined #ruby
[15:05:34] pastorinni: has joined #ruby
[15:07:40] AJA4350: has joined #ruby
[15:09:11] Toggi3: has joined #ruby
[15:09:47] tcopeland: has joined #ruby
[15:14:24] cpruitt: has joined #ruby
[15:15:25] xhoy: has joined #ruby
[15:16:17] xhoy: hi! maybe a stupid question, but strftime *realy* misses a querter option, could just fork ruby and create a PR?
[15:16:46] Zamyatin: has joined #ruby
[15:20:26] desperek: has joined #ruby
[15:21:56] deathsparton: has joined #ruby
[15:22:24] deathsparton: has joined #ruby
[15:22:38] randomstrangerb: has joined #ruby
[15:22:48] deathsparton: has joined #ruby
[15:23:08] deathsparton: has joined #ruby
[15:23:18] apeiros: xhoy: Time#strftime is just a thin wrapper around C's strftime, so might need more than just a patch to ruby
[15:23:41] alfiemax: has joined #ruby
[15:24:05] Zamyatin: has joined #ruby
[15:24:12] xhoy: apeiros: the rejected it in glibc
[15:25:14] xhoy: https://sourceware.org/ml/libc-alpha/2016-11/msg00114.html <<
[15:26:21] Beams: has joined #ruby
[15:26:32] cek: has joined #ruby
[15:28:24] bronson: has joined #ruby
[15:29:41] apeiros: that's a long thread…
[15:29:59] apeiros: but if it's been rejected in glibc, chances are probably not that big to get it added to ruby.
[15:30:07] apeiros: but you can always open a ticket over at bugs.ruby-lang.org
[15:30:28] oleo: has joined #ruby
[15:30:43] xhoy: well its rejected since it should be part of is 30112
[15:31:02] alfiemax_: has joined #ruby
[15:31:03] xhoy: but there hasn't hapend a thing on iso 30112 since 2014
[15:31:07] reber: has joined #ruby
[15:31:25] xhoy: and possible conflicts in postix something anyway
[15:36:01] cek: has left #ruby: ()
[15:37:30] chocoelho: has joined #ruby
[15:41:36] hinbody: has joined #ruby
[15:41:51] JusticeFries: has joined #ruby
[15:44:01] cpruitt: has joined #ruby
[15:46:39] morfin60: has joined #ruby
[15:47:33] morfin60: i have JSON output parsed to an array ["foo", 1233243, "bar", 56234112] and i wanted to make hash with number key and string value
[15:48:24] havenwood: >> ["foo", 1233243, "bar", 56234112].each_slice(2).map(&:reverse).to_h # morfin60
[15:48:25] ruby[bot]: havenwood: # => {1233243=>"foo", 56234112=>"bar"} (https://eval.in/936574)
[15:48:30] morfin60: values = Hash[*values].invert did it but since numbers aren't unique something collapsed
[15:48:53] havenwood: morfin60: the way above won't have that prob
[15:49:26] morfin60: >> values = ["foo", 1233243, "bar", 56234112]; Hash[*values].invert
[15:49:27] ruby[bot]: morfin60: # => {1233243=>"foo", 56234112=>"bar"} (https://eval.in/936579)
[15:49:50] morfin60: >> values = ["foo", 1233243, "bar", 56234112, "baz", 1233243]; Hash[*values].invert
[15:49:51] ruby[bot]: morfin60: # => {1233243=>"baz", 56234112=>"bar"} (https://eval.in/936580)
[15:50:14] morfin60: >> ["foo", 1233243, "bar", 56234112, "baz", 1233243].each_slice(2).map(&:reverse).to_h
[15:50:16] ruby[bot]: morfin60: # => {1233243=>"baz", 56234112=>"bar"} (https://eval.in/936582)
[15:50:25] morfin60: anyway "collapsing" )
[15:50:52] morfin60: i guess i need add suffix before making mapo
[15:51:13] havenwood: morfin60: I assumed you meant the strings were "collapsing" before the invert.
[15:51:33] havenwood: morfin60: Is it really that the integer keys conflict? What should happen in that case?
[15:52:06] nckpz: has joined #ruby
[15:52:29] havenwood: >> [:a, 1, :b, 2, :a, 3].each_slice(2).map(&:reverse).to_h
[15:52:30] ruby[bot]: havenwood: # => {1=>:a, 2=>:b, 3=>:a} (https://eval.in/936584)
[15:54:26] havenwood: morfin60: compare with:
[15:54:28] havenwood: >> values = [:a, 1, :b, 2, :a, 3]; Hash[*values].invert
[15:54:29] ruby[bot]: havenwood: # => {3=>:a, 2=>:b} (https://eval.in/936586)
[15:54:58] havenwood: morfin60: I assumed that ^ was what you were running into.
[15:55:53] havenwood: morfin60: Is it really that the post-invert keys are colliding in your original, or the pre-invert keys?
[15:55:59] havenwood: morfin60: If it's the post-invert keys, what should happen when they collide?
[15:56:01] moei: has joined #ruby
[15:56:14] havenwood: morfin60: If it's the pre-invert keys, it's not a problem with my version.
[15:56:26] zigzig: has joined #ruby
[15:56:50] alfiemax: has joined #ruby
[15:58:46] deathsparton: has joined #ruby
[16:00:53] Asher: has joined #ruby
[16:03:33] roshanavand: has joined #ruby
[16:04:53] havenwood: morfin60: https://gist.github.com/havenwood/8c0186184dabd58f49ca8e73dd196567
[16:09:07] cschneid: has joined #ruby
[16:17:52] qba73: has joined #ruby
[16:18:14] synthroid: has joined #ruby
[16:21:28] Asher: has joined #ruby
[16:24:06] Toggi3: has joined #ruby
[16:25:08] synthroid: has joined #ruby
[16:26:48] skawa: im having the issue that running "rspec" and "bundle exec rspec" are completely different
[16:27:02] skawa: unfortunately im dealing with a tangle of scripts that all call of "rspec" and not "bundle exec rspec"
[16:27:08] skawa: rspec is only one example
[16:27:21] skawa: how can i clear my ruby environment so that "rspec" is the same as "bundle exec rspec" ?
[16:27:30] skawa: i tried removing all installed gems, then doing bundle install
[16:27:43] skawa: somehow this didn'' solve my problem
[16:28:10] havenwood: skawa: Is rspec installed on other Rubies?
[16:28:11] havenwood: skawa: which -a rspec
[16:28:27] skawa: havenwood: yes it looks like i have two
[16:28:33] skawa: i don't know how or why i have two rubies, i dont' care
[16:28:38] havenwood: skawa: Typically removing all versions later than the bundled version does work. Alternatively, and usually better - update your Gemfile.lock rspec versions.
[16:28:56] qba73: has joined #ruby
[16:28:59] skawa: yea so when i removed all gems it probably only removed them from one of the rubies
[16:29:04] skawa: i don't know how to get to the other one
[16:29:06] bronson: has joined #ruby
[16:29:23] havenwood: skawa: What are you using to change Ruby versions? This is a dev env?
[16:29:33] skawa: havenwood: this is my laptop, yes
[16:30:23] skawa: i really should be running this entire thing in a container, but it would require some effort
[16:30:36] havenwood: skawa: Are you using RVM, chruby, rbenv or non-of-the-above?
[16:30:57] skawa: but there could be ruby installed via some other tool, and i don't need it installed anywhere else
[16:31:07] havenwood: skawa: Probably if you `rvm system` you'll see there's a non-RVM Ruby as well with rspec installed.
[16:31:23] havenwood: Or other RVM Rubies installed. See with: rvm list
[16:31:27] skawa: yea i see. the other is an rbenv
[16:32:11] havenwood: skawa: You might consider: rm -rf ~/.rbenv
[16:32:38] havenwood: skawa: (Assuming you're not using rbenv Ruby and it's some relic.)
[16:33:20] oetjenj: has joined #ruby
[16:34:08] skawa: that looks much better havenwood thanks
[16:34:19] skawa: which -a rspec is brilliant ill remember that maybe
[16:36:53] troys: has joined #ruby
[16:44:27] chocoelho: has joined #ruby
[16:51:46] Zamyatin: has joined #ruby
[16:51:58] SuperL4g: has joined #ruby
[16:52:32] tjbp: has joined #ruby
[16:55:17] dinfuehr: has joined #ruby
[16:55:36] elepedus: has joined #ruby
[16:55:43] nogic: has joined #ruby
[16:56:50] [Butch]: has joined #ruby
[17:03:06] Zamyatin: has joined #ruby
[17:05:04] Zamyatin: has joined #ruby
[17:08:23] goatish: has joined #ruby
[17:09:43] ldepandis: has joined #ruby
[17:09:51] alfiemax: has joined #ruby
[17:09:59] SuperLag: has joined #ruby
[17:12:18] TobiFrano: has joined #ruby
[17:13:04] cdg: has joined #ruby
[17:14:11] mtkd: has joined #ruby
[17:17:06] ltem: has joined #ruby
[17:17:45] lcarlson: has joined #ruby
[17:25:35] darkhanb: has joined #ruby
[17:26:33] elcontrastador: has joined #ruby
[17:26:58] Fire-Dragon-DoL: has joined #ruby
[17:28:20] cajone: has joined #ruby
[17:28:25] cajone: has left #ruby: ()
[17:29:00] apeiros: has joined #ruby
[17:29:51] bronson: has joined #ruby
[17:30:07] nit3rid3: has joined #ruby
[17:30:44] miah: has joined #ruby
[17:34:44] Dimik: has joined #ruby
[17:36:33] alfiemax: has joined #ruby
[17:36:35] reber: has joined #ruby
[17:36:41] JusticeFries: has joined #ruby
[17:42:52] bmurt: has joined #ruby
[17:44:49] Zamyatin: has joined #ruby
[17:44:54] jtdoncas: has joined #ruby
[17:47:33] Vapez: has joined #ruby
[17:50:15] hahuang61: has joined #ruby
[17:51:00] miah: has joined #ruby
[17:51:25] sanscoeur: has joined #ruby
[17:54:32] orbyt_: has joined #ruby
[17:58:18] _main_: has joined #ruby
[17:59:39] kies: has joined #ruby
[18:00:09] dstrunk: has joined #ruby
[18:00:17] eam: has joined #ruby
[18:01:09] alfiemax: has joined #ruby
[18:01:25] romain_t: has joined #ruby
[18:02:19] miah: has joined #ruby
[18:03:31] alfiemax: has joined #ruby
[18:05:21] k0mpa: has joined #ruby
[18:06:24] r3kz: has joined #ruby
[18:07:13] havenwood: Interesting, in 2.5: SecureRandom.send(:choose, %w[OMG WTF BBQ], 2) #=> "BBQBBQ"
[18:07:32] kspencer: so I see a '->(var)' in a peice of code I'm looking at, and I don't know what it is
[18:08:03] eck: has joined #ruby
[18:08:08] havenwood: kspencer: It's a stabby lambda.
[18:10:15] havenwood: >> thingy = ->(var){ var }; "it's a #{thingy.class} and it's #{thingy.lambda?} that it's a lambda"
[18:10:16] ruby[bot]: havenwood: # => "it's a Proc and it's true that it's a lambda" (https://eval.in/936678)
[18:11:19] fschuindt: has joined #ruby
[18:12:23] fschuindt: I'm trying to File.write a string, but every line break is being writed as \r\n. How can write using only \n?
[18:12:25] conta: has joined #ruby
[18:13:08] sspreitz: has joined #ruby
[18:14:34] apeiros: kspencer: `->(arg) { …code… }` is alternative syntax for `lambda { |arg| …code… }`
[18:15:02] apeiros: fschuindt: windows?
[18:15:24] fschuindt: apeiros: macOS
[18:15:30] kspencer: havenwood: apeiros thanks, yeah once i heard lambda I figured out what it was
[18:15:34] ruby[bot]: havenwood: # => "\n" (https://eval.in/936679)
[18:15:42] [Butch]: has joined #ruby
[18:15:46] apeiros: fschuindt: then your string almost certainly already contains the \r\n
[18:16:03] apeiros: you can gsub it: .gsub("\r\n", "\n")
[18:16:15] fschuindt: apeiros: I thought it, was just trying to see any sign of hope
[18:16:38] fschuindt: I'm going for regex
[18:17:14] apeiros: gsub doesn't require a regex ;-)
[18:18:58] alfiemax: has joined #ruby
[18:26:04] lcarlson: what is the latest consensus on best framework for making API's in Ruby?
[18:26:24] lcarlson: i just did a rails new --api and it generated a bunch of things I didn't anticipate
[18:26:33] lcarlson: like, why is it bringing in sprockets?
[18:26:40] lcarlson: I get that I can turn that off
[18:26:47] lcarlson: but shouldn't that be part of the default?
[18:26:52] troydm: has joined #ruby
[18:27:06] lcarlson: Is Padrino good?
[18:27:29] troydm: how do I iterate Hash with foreach while also being able to remove elements in the block if I deem necessary
[18:27:41] nicesignal: has joined #ruby
[18:27:41] apeiros: troydm: iterate over a copy
[18:28:02] troydm: apeiros: there is no way to not use copy, coz I need to iterate about 100 per sec
[18:28:25] lcarlson: troydm, you should be able to .clone without impacting performance terribly?
[18:28:37] lcarlson: have you tried? :)
[18:28:39] apeiros: troydm: maybe rethink your algorithm
[18:28:48] troydm: lcarlson: like clone entire Hash or only keys?
[18:29:10] lcarlson: troydm, just the item you're interested in that block
[18:29:15] apeiros: it's quite likely less expensive to dup the hash than use .keys
[18:29:48] troydm: what's difference between clone and dup?
[18:29:48] apeiros: unless you don't need the value to determine whether the key should be deleted.
[18:30:05] apeiros: clone additionally copies singleton_class and frozen state.
[18:30:34] havenwood: lcarlson: I'd not use Padrino for an API. It's more a webframework on top of Sinatra as far as I recall.
[18:30:37] troydm: apeiros: I need values, values itself are Proc that I call that might remove key from Hash
[18:30:51] lcarlson: havenwood, so straight Sinatra for web services?
[18:30:52] bronson: has joined #ruby
[18:31:03] havenwood: lcarlson: I'd recommend taking a look at Roda: http://roda.jeremyevans.net/
[18:31:12] havenwood: lcarlson: What are you doing with the API in particular?
[18:31:15] apeiros: oh, and invokes a different callback (initialize_clone instead of initialize_dup)
[18:31:23] lcarlson: havenwood, thx!
[18:31:38] lcarlson: troydm, ya, it looks like .dup is more perf
[18:31:49] lcarlson: especially if you're not looking to do anything special with its class
[18:31:58] lcarlson: which it sounds like you're not since they're simple hashes
[18:32:03] havenwood: lcarlson: Roda is lovely. It's the same maintainer as the Sequel gem and has a similar plugin system.
[18:32:04] havenwood: lcarlson: You can compose the API framework you need from Roda plugins.
[18:32:18] havenwood: lcarlson: The maintainer of Roda also maintains RodaAuth and the Sequel gem, etc - which are also great for APIs.
[18:32:19] lcarlson: havenwood, it looks pretty nifty!
[18:32:35] havenwood: lcarlson: http://rodauth.jeremyevans.net/
[18:32:39] lcarlson: It's been awhile since I've used sequel
[18:32:43] lcarlson: Do they have nice migrations?
[18:32:55] s3nd1v0g1us: has joined #ruby
[18:33:01] havenwood: lcarlson: Yeah, they do. Sequel is great.
[18:33:14] lcarlson: havenwood, generators too?
[18:33:21] lcarlson: havenwood, not that is necessary
[18:33:24] lcarlson: just nice to have
[18:33:32] havenwood: lcarlson: http://sequel.jeremyevans.net/
[18:33:32] s3nd1v0g1us: has joined #ruby
[18:34:20] havenwood: lcarlson: Folk have made various generators, or integrated things like ROM. I don't know of a Sequel specific migration generator, but I'd imagine there is one.
[18:34:33] s3nd1v0g1us: has joined #ruby
[18:34:37] Zamyatin: has joined #ruby
[18:34:38] lcarlson: havenwood, they're handy when making migrations
[18:35:00] lcarlson: is it considered convention to hand bake migrations when using sequel?
[18:37:04] Zamyatin: has joined #ruby
[18:37:28] lcarlson: there is a #sequel chan
[18:40:35] wilbert: has joined #ruby
[18:42:18] eckhardt: has joined #ruby
[18:43:20] sameerynho: has joined #ruby
[18:46:56] claudiuinberlin: has joined #ruby
[18:48:36] Zamyatin: has joined #ruby
[18:50:02] goatish: has joined #ruby
[18:50:55] tAn: has joined #ruby
[18:52:50] netherwolfe: has joined #ruby
[18:54:16] chocoelho: has joined #ruby
[18:55:29] n0m4d1c: has joined #ruby
[18:58:40] selim: has joined #ruby
[18:58:42] chocoelho1: has joined #ruby
[19:01:35] bmurt: has joined #ruby
[19:02:17] anisha: has joined #ruby
[19:08:03] Cavallari: has joined #ruby
[19:08:50] elphe: has joined #ruby
[19:09:05] guacamole: has joined #ruby
[19:09:06] guacamole: has joined #ruby
[19:09:50] Zamyatin: has joined #ruby
[19:11:15] romain_t: has joined #ruby
[19:11:39] desperek: how can i def method that adds two fields of class?
[19:13:34] havenwood: desperek: fields?
[19:14:00] desperek: havenwood, i mean, i was curious how do i refer to, well, variable in the class
[19:14:02] desperek: but done it already
[19:15:31] tomphp: has joined #ruby
[19:18:23] TobiFrano: has joined #ruby
[19:19:22] mtkd: has joined #ruby
[19:25:59] _aeris_: has joined #ruby
[19:26:02] chouhoulis: has joined #ruby
[19:26:14] tomphp: has joined #ruby
[19:26:20] mtkd: has joined #ruby
[19:26:22] wilbert_: has joined #ruby
[19:27:25] dstrunk: has joined #ruby
[19:28:34] ramfjord: has joined #ruby
[19:30:51] FrostCandy: has joined #ruby
[19:31:30] bronson: has joined #ruby
[19:32:08] BTRE: has joined #ruby
[19:33:42] tomphp: has joined #ruby
[19:38:37] troydm: has left #ruby: ("WeeChat 2.0.1")
[19:43:36] hahuang61: has joined #ruby
[19:44:37] minimalism: has joined #ruby
[19:52:10] ldnunes: has joined #ruby
[19:59:30] ltem: has joined #ruby
[20:00:02] mniip: has joined #ruby
[20:00:49] imode: has joined #ruby
[20:03:39] ur5us: has joined #ruby
[20:04:46] bmurt: has joined #ruby
[20:05:13] chocoelho1: has joined #ruby
[20:05:25] Dykam: has joined #ruby
[20:07:25] listenmore: has joined #ruby
[20:08:08] Guest2997: has joined #ruby
[20:11:08] sammi`: has joined #ruby
[20:15:23] jtdoncas: has joined #ruby
[20:16:57] hazelux: has joined #ruby
[20:26:44] Inside: has joined #ruby
[20:27:21] Inside: I'm using CentOS. Does it make sense to use SCL ruby 2.4.0 or should I use rvm to install ruby for a new system?
[20:31:13] Zamyatin: has joined #ruby
[20:33:39] eckhardt: has joined #ruby
[20:34:49] havenwood: Inside: SCL 2.4 seems completely reasonable. Dev or prod?
[20:35:26] havenwood: Assuming it's prod, I'd vote SCL.
[20:35:39] havenwood: (You don't see CentOS in dev much I suppose. ;-))
[20:36:27] havenwood: Inside: Alternatively you could use `sudo ruby-install --system --latest` to install 2.5 to /usr/local.
[20:36:55] havenwood: Inside: TL;DR: SCL if prod.
[20:44:06] hazelux: has joined #ruby
[20:45:43] orbyt_: has joined #ruby
[20:47:58] nixy: has left #ruby: ("WeeChat 1.7")
[20:48:33] Barrt: has joined #ruby
[20:52:20] ur5us: has joined #ruby
[20:53:02] Ericx2x: has joined #ruby
[20:55:18] guacamole: has joined #ruby
[20:55:18] guacamole: has joined #ruby
[20:56:02] jenrzzz: has joined #ruby
[20:56:02] jenrzzz: has joined #ruby
[20:57:01] elphe: has joined #ruby
[20:58:29] Hanmac: has joined #ruby
[21:01:39] faces: has joined #ruby
[21:05:34] ivanskie: has joined #ruby
[21:08:43] jottr: has joined #ruby
[21:10:57] bmurt: has joined #ruby
[21:11:41] workmad3: has joined #ruby
[21:13:31] Eiam: has joined #ruby
[21:15:07] hazelux: has joined #ruby
[21:16:04] tvw: has joined #ruby
[21:16:17] orbyt_: has joined #ruby
[21:16:32] d^sh_: has joined #ruby
[21:17:42] jottr: has joined #ruby
[21:18:11] oleo: has joined #ruby
[21:19:30] dviola: has joined #ruby
[21:21:38] fmcgeough: has joined #ruby
[21:21:43] Inside: I'm using CentOS. Does it make sense to use SCL ruby 2.4.0 or should I use rvm to install ruby for a new system?
[21:22:12] ledestin: has joined #ruby
[21:22:29] Inside: havenwood: Yeah, it's for production for a small intranet site.
[21:22:57] Inside: I've been trying to use SCL, but nginx/passenger don't seem to like it
[21:23:35] darix: Inside: you need to set the path to the ruby interpreter that passenger should use for your app
[21:24:08] banisterfiend: has joined #ruby
[21:24:56] Inside: I had passnger_ruby /opt/rh/rh-ruby24/root/usr/bin/ruby;
[21:24:58] hazelux: has joined #ruby
[21:27:48] tomphp_: has joined #ruby
[21:28:11] rrichardsr3: has joined #ruby
[21:30:37] yxhuvud: has joined #ruby
[21:31:35] jottr_: has joined #ruby
[21:32:13] Inside: I've gone back to trying to use rvm (which has its own issues :D) in this Dockerfile
[21:32:25] Inside: But the bigger philosophical question is -- when should SCL even be used?
[21:32:40] yxhuvud: I have never looked back after I switched to chruby.
[21:32:43] bronson: has joined #ruby
[21:32:59] cschneid_: has joined #ruby
[21:33:33] Inside: According to my sysadmin guy the whole concept of multiple rubies on a single system is a terrible idea
[21:33:54] Inside: I was trying to explain to him the whole rvm/scl thing and he wasn't having any of it
[21:36:22] havenwood: Inside: In production, you don't need to switch Rubies - you have just your Ruby.
[21:36:36] rigby: has joined #ruby
[21:36:47] havenwood: Inside: SCL is a package-managed Ruby that's ideal for production.
[21:37:03] TobiFrano: has joined #ruby
[21:37:13] cschneid: has joined #ruby
[21:37:48] havenwood: Inside: A good reason for multiple Rubies on a single system is a development machine.
[21:38:02] havenwood: Inside: Different projects will require different Ruby engines and versions.
[21:38:14] havenwood: In prod, you know exactly what Ruby you should be providing. Use that.
[21:38:19] bmurt: has joined #ruby
[21:38:25] ramfjord: yup - that's definitely the ideal state
[21:38:32] troulouliou_div2: has joined #ruby
[21:39:03] havenwood: SCL is a great choice. No other Rubies. Or like I said, you can install Ruby to /usr/local if you want to build Ruby yourself for a single install.
[21:39:10] rigby: has joined #ruby
[21:39:17] ramfjord: I do find the SCL packages quite irritating though, with everything having to be run through scl enable
[21:39:33] havenwood: I'd personally want at 2.5 ;-)
[21:39:51] havenwood: sudo ruby-install --system --latest -j8 -- --with-jemalloc
[21:40:40] ramfjord: what is this ruby-install?
[21:40:48] havenwood: err, i forgot the `ruby`, oops
[21:40:55] Inside: https://github.com/Insood/docker-rails-base/blob/master/Dockerfile
[21:40:57] havenwood: sudo ruby-install --system --latest -j8 ruby -- --with-jemalloc
[21:41:00] dviola: has joined #ruby
[21:41:14] havenwood: ramfjord: https://github.com/postmodern/ruby-install
[21:41:53] havenwood: ramfjord: It's by the same author as chruby.
[21:43:02] LastWhisper____: has joined #ruby
[21:44:36] havenwood: It supports updating Ruby metadata (from ruby-version repo) without updating the tool itself, checks md5, sha1, sha256 *and* sha512 checksums, uses package managers for dependencies, etc. It's nicely organized and tested.
[21:45:17] ramfjord: seems quite nice compared to SCL if it lets you do a system installation like that!
[21:45:19] havenwood: It's just for building Ruby though. No precompiled, statically-linked binaries.
[21:46:27] Inside: App 63 stderr: /opt/rh/rh-ruby24/root/usr/bin/ruby: error while loading shared libraries: libruby.so.2.4: cannot open shared object file: No such file or directory
[21:46:34] Inside: is the error I get w/ passenger
[21:46:51] Barrt: has joined #ruby
[21:48:20] Inside: And this is part 2 of the Dockerfile: https://gist.github.com/Insood/b6287844905597b9de08a2bb1dad8c23 (which uses the Dockerfile I posted previously as a base)
[21:48:20] bawNg: I wonder how many people use Ruby for soft-realtime applications
[21:49:48] havenwood: Inside: Hrm, seems like maybe you need a: LD_LIBRARY_PATH="/opt/rh/ruby24/root/usr/lib64:$LD_LIBRARY_PATH"
[21:49:51] havenwood: Inside: Dunno!
[21:50:11] havenwood: bawNg: What puts the "soft" in "soft-realtime"?
[21:50:26] pastorinni: has joined #ruby
[21:50:30] havenwood: ah, can miss some deadlines
[21:51:07] bawNg: havenwood: well true real time applications can't really be built in a high language which has GC, they need to guarantee the CPU time that is needed to perform tasks
[21:51:19] ahrs: has joined #ruby
[21:51:27] bawNg: but very few real time applications require such strict deadlines
[21:51:43] Inside: blah blah deterministic
[21:53:11] bawNg: this week, I've built a C extension which implements a high precision scheduler of light weight timers for async and fibered Ruby applications
[21:53:40] bawNg: it can fire timers or resume sleeping fibers within precision of a few microseconds
[21:53:49] havenwood: bawNg: ah, nice
[21:54:13] havenwood: how does it compare to hitimes?
[21:54:18] bawNg: I created it for the Sonic Pi project, but I'm thinking I should just turn it into an open source gem in case anyone else wants to use it
[21:54:47] bawNg: it does something completely different to hitimes, though it also includes a high precision cross platform clock like hitimes does
[21:55:12] bawNg: it is high precision reactor, so basically an eventmachine replacement without any IO support
[21:55:42] bawNg: it may eventually include IO support, since things can be a lot more efficient than eventmachine, but I don't know if I'll ever have the time to do that
[21:55:52] bawNg: so it's a timer/fiber scheduler
[21:57:33] bawNg: it includes Mutex and ConditionalVariable replacements, joining on jobs (fibers), job sleeping, fiber-less timers and some other things which I needed to replace native threads with fibers while converting the heavily threaded Sonic Pi project
[21:58:07] havenwood: bawNg: are you familiar with normalperson's Thribers patch?
[21:58:21] havenwood: bawNg: that sounds really interesting
[21:58:35] havenwood: bawNg: https://bugs.ruby-lang.org/issues/13618
[21:58:39] ramfjord: Inside: I think you'll probably need to change the `passenger_ruby` option or something like that in your nginx.conf if you want to use the SCL packages
[21:58:57] ramfjord: the `scl enable` stuff is supposed to manage the LD_LIBRARY_PATH and other variables for you
[21:59:01] Inside: Well - it is set to where the SCL package is
[21:59:12] Inside: It just looks like nginx isn't using the SCL environment
[21:59:39] bawNg: I saw that sometime last year, does sound interesting, but I've been using fibers in async applications for many years already
[21:59:44] Toggi3: has joined #ruby
[22:00:08] bawNg: it definitely seems like a good idea to have better core language support for fibers in the future, at least in some way
[22:00:38] jetpack_joe_: has joined #ruby
[22:01:42] bawNg: I wish extconf supported magically downloading the compatible ruby source as a dependency when building a gem
[22:02:48] jeffreylevesque: has joined #ruby
[22:03:18] ramfjord: Inside: are you running passenger inside scl enable?
[22:04:27] banisterfiend: has joined #ruby
[22:06:15] Inside: That's actually what I'm trying to figure out right now
[22:06:31] d^sh: has joined #ruby
[22:07:43] dviola: has joined #ruby
[22:08:48] ramfjord: i.e. `scl enable rh-ruby24 'bundle exec passenger start'`
[22:09:05] jenrzzz: has joined #ruby
[22:09:26] Toggi3: has joined #ruby
[22:11:12] Inside: Well - it's technically nginx w/ passenger
[22:12:37] ramfjord: nginx running in some systemd unit?
[22:13:47] ramfjord: tbh I'd be strongly considering trying a ruby-install version of the centos base image if I were you - building from source isn't much of an issue with docker, as long as you put it in a layer that doesn't have to be rebuild often
[22:14:12] Inside: Thsi isn't even going to be a Docker file =_=
[22:14:59] Inside: I'm trying to move my stuff to a different box - the sysadmin wants me to give him a list of everything that he needs to do to setup that box
[22:15:04] Inside: And Docker comes into play here
[22:15:35] Inside: Not in a "we're going to use Docker" way, but in a "I'm going to copy the commands over and set up the box from scratch" way
[22:15:37] bawNg: I feel like whatever solution I come up with for building a gem against the Ruby source is going to cause problems for people who have different environments like RVM, even if I detect the current running Ruby version and download the matching source, I'd still need to use the installed Ruby versions config.h
[22:16:06] bawNg: there must be a better solution, surely it can't be all that uncommon for an extension to depend on the Rruby source
[22:16:46] jdawgaz: has joined #ruby
[22:17:48] ramfjord: run in docker on new host, so he only needs to install docker and you can have the same dev environment as prod?
[22:18:19] Inside: i'm not even using docker for development
[22:18:28] ramfjord: or, figure out where the nginx binary is getting invoked and surround it in scl enable rh-ruby24
[22:18:34] cjohnson: In ruby, I have two arrays, and I want to take the product of those two arrays and run a command on each combination. I know about Arra#product but the question is how can I easily consume them? Does this work?
[22:18:45] cjohnson: arr1.product(arr2).each do |arr1_arg, arr2_arg|
[22:18:55] cjohnson: Or do I need to use something beside each to iterate the array of arrays
[22:19:06] Inside: you want to do a[n] * b[n]?
[22:19:41] Inside: a.each_with_index { |a_val, index| a_val * b[index] } ?
[22:20:35] Inside: this is a combinatorial question
[22:20:37] havenwood: cjohnson: Seems like you want #map not #each. Hard to tell unless you say what result you want.
[22:20:38] Inside: ACTION slinks away.
[22:21:11] havenwood: >> [1, 2, 3].product([4, 5, 6]).map(&:sum)
[22:21:12] ruby[bot]: havenwood: # => undefined method `sum' for [1, 4]:Array (NoMethodError) ...check link for more (https://eval.in/936877)
[22:21:18] havenwood: We need to update that bot!
[22:21:24] havenwood: #=> [5, 6, 7, 6, 7, 8, 7, 8, 9]
[22:21:44] baweaver: >>a=[1,2,3];b=%w[a b c]; a.product(b).map { |(a,b)| "#{a}#{b}" }
[22:21:45] ruby[bot]: baweaver: # => ["1a", "1b", "1c", "2a", "2b", "2c", "3a", "3b", "3c"] (https://eval.in/936878)
[22:22:07] baweaver: >>a=[1,2,3];b=%w[a b c]; a.product(b).map { |a,b| "#{a}#{b}" }
[22:22:08] ruby[bot]: baweaver: # => ["1a", "1b", "1c", "2a", "2b", "2c", "3a", "3b", "3c"] (https://eval.in/936879)
[22:22:16] baweaver: ah, so it does work both ways, good
[22:22:52] guacamole: TIL #product
[22:23:08] thejamespinto: has joined #ruby
[22:23:27] havenwood: >> 'guaca'.chars.product('mole'.chars).map(&:join)
[22:23:28] ruby[bot]: havenwood: # => ["gm", "go", "gl", "ge", "um", "uo", "ul", "ue", "am", "ao", "al", "ae", "cm", "co", "cl", "ce", "am ...check link for more (https://eval.in/936881)
[22:23:39] Inside: I'm not even seeing how people are using scl with nginx, heh.
[22:23:48] havenwood: oops, forgot my final join
[22:23:49] havenwood: >> 'guaca'.chars.product('mole'.chars).map(&:join).join
[22:23:50] ruby[bot]: havenwood: # => "gmgoglgeumuoulueamaoalaecmcoclceamaoalae" (https://eval.in/936882)
[22:24:01] havenwood: guacamole: ^
[22:24:02] bawNg: >> 'guaca'.each_char.product('mole'.chars).map(&:join)
[22:24:03] ruby[bot]: bawNg: # => undefined method `product' for #<Enumerator: "guaca":each_char> ...check link for more (https://eval.in/936883)
[22:24:11] ramfjord: >> 'guaca'.chars.product('mole'.chars).join
[22:24:12] ruby[bot]: ramfjord: # => "gmgoglgeumuoulueamaoalaecmcoclceamaoalae" (https://eval.in/936884)
[22:24:20] havenwood: ramfjord: good point
[22:24:27] baweaver: was about to mention that one
[22:24:32] bawNg: someone should do something about Enumerator#product, useless to alloocate an array of chars for that
[22:24:45] jnyw: has joined #ruby
[22:24:58] baweaver: Take a look at its arity
[22:25:04] baweaver: not so easy
[22:25:12] baweaver: &ri Enumerable#product
[22:25:13] `derpy: No results
[22:25:19] baweaver: &ri Array#product
[22:25:19] `derpy: http://ruby-doc.org/core-2.4.1/Array.html#method-i-product
[22:25:26] baweaver: I always forget what's in what
[22:25:45] guacamole: whats the difference between product and combination?
[22:26:28] ramfjord: I'm guessing product is linear algebra/matrix product
[22:28:29] guacamole: i demand havenwood do a talk on the difference
[22:31:13] guacamole: has joined #ruby
[22:31:14] guacamole: has joined #ruby
[22:31:19] ramfjord: they have different arities as baweaver pointed out
[22:31:52] baweaver: guacamole: it would be a productive talk
[22:32:19] SeepingN: has joined #ruby
[22:33:15] havenwood: baweaver: we could do a combo talk where we each cover a different permutation of the topic
[22:33:44] bronson: has joined #ruby
[22:37:00] Azure: has joined #ruby
[22:37:29] phaul: has joined #ruby
[22:41:30] TobiFrano: has joined #ruby
[22:43:40] ant[]_: has joined #ruby
[22:43:43] ant[]_: /usr/lib64/ruby/site_ruby/2.5.0/rubygems.rb:289:in `find_spec_for_exe': can't find gem rake (>= 0.a) with executable rake (Gem::GemNotFoundException)
[22:43:54] ant[]_: http://77.55.215.219/rdoc_fail.txt
[22:45:08] elphe: has joined #ruby
[22:45:46] randomstrangerb: has joined #ruby
[22:46:33] cjohnson: havenwood: The result is side effects -- it's saving a record on a rails model
[22:46:58] cjohnson: baweaver: thanks! I knew there was some syntax way to destructure that
[22:47:19] baweaver: cjohnson: what's the full code? May be a better way to do it.
[22:47:48] havenwood: cjohnson: You can omit the #each even, since #product takes a block directly.
[22:48:40] cjohnson: havenwood: nice
[22:49:28] cjohnson: baweaver: as.product(bs) do |(a, b)| MyModel.where(a: a, b: b, id: id).first_or_intialize end
[22:50:24] baweaver: where's id?
[22:50:25] baweaver: I have a hunch, one sec
[22:50:45] cjohnson: id is the instance id of this model
[22:51:02] cjohnson: So this model is Program and an instance method is seed_eulas which does the above code
[22:51:05] baweaver: MyModel.where(id: id).index_by { |m| [m.id, m.a, m.b] }
[22:51:16] cjohnson: so id = Program#id
[22:51:39] baweaver: as.product(bs) { |a,b| [id, a, b] }
[22:52:24] baweaver: then diff the two hashes, you only need to create the ones which don't exist meaning less queries
[22:54:33] cjohnson: So that will find every MyModel matching my program id as one query, and then I will use ruby to find those combinations of records which don't yet exist
[22:54:36] cjohnson: is that right?
[22:55:08] ant[]_: has left #ruby: ()
[22:55:42] IJsbrand: has joined #ruby
[22:55:42] oetjenj: has joined #ruby
[22:56:06] chouhoulis: has joined #ruby
[22:59:08] LastWhisper____: has joined #ruby
[23:00:20] _main_: has joined #ruby
[23:01:01] chouhoul_: has joined #ruby
[23:01:28] guacamole: has joined #ruby
[23:01:28] guacamole: has joined #ruby
[23:04:17] hahuang61: has joined #ruby
[23:07:26] jenrzzz: has joined #ruby
[23:07:26] jenrzzz: has joined #ruby
[23:12:32] workmad3: has joined #ruby
[23:19:29] _main_: has joined #ruby
[23:20:14] tomphp: has joined #ruby
[23:24:13] eckhardt: has joined #ruby
[23:34:18] bronson: has joined #ruby
[23:34:48] r3kz: has joined #ruby
[23:35:21] _main_: has joined #ruby
[23:35:56] mtkd: has joined #ruby
[23:36:00] randomstrangerb: has joined #ruby
[23:44:06] Azure: has joined #ruby
[23:47:39] tcopeland: has joined #ruby
[23:49:27] guacamole: has joined #ruby
[23:49:27] guacamole: has joined #ruby
[23:50:18] kossae: has joined #ruby
[23:52:49] GremL1N: has joined #ruby
[23:52:59] chouhoulis: has joined #ruby
[23:53:03] paulrf: has joined #ruby
[23:56:39] quobo: has joined #ruby
[23:59:17] Dykam: has joined #ruby