« Back to channel list

#ruby - 06 December 2018

« Back 1 day Forward 1 day »
[00:19:55] ur5us: has joined #ruby
[00:30:57] hutch: has joined #ruby
[00:34:09] beowuff: has joined #ruby
[00:38:09] cnsvc: has joined #ruby
[00:42:49] ansraliant: has joined #ruby
[00:53:12] crankharder: has joined #ruby
[00:59:47] graphene: has joined #ruby
[01:00:42] cliluw: has joined #ruby
[01:07:59] akem: has joined #ruby
[01:08:06] white_lilies: has joined #ruby
[01:11:20] akem: has joined #ruby
[01:22:05] mangold: has joined #ruby
[01:22:11] jetchisel: has joined #ruby
[01:26:55] gix: has joined #ruby
[01:39:43] hutch: has joined #ruby
[01:57:13] arescorpio: has joined #ruby
[02:09:58] chens: has joined #ruby
[02:18:45] andrewray: has joined #ruby
[02:18:59] andrewray: Is this redundant? File.open(Tempfile.new())
[02:19:15] andrewray: I'm calling file.close then File.delete(file) on the resulting file, and I'm getting this error
[02:19:20] andrewray: Errno::ENOENT: No such file or directory @ apply2files IOError: not opened for reading
[02:23:51] akaiiro: has joined #ruby
[02:32:37] esrse: has joined #ruby
[02:33:26] white_lilies: has joined #ruby
[02:38:36] DTZUZO: has joined #ruby
[02:39:14] oncall-pokemon: has joined #ruby
[02:45:42] Freshnuts: has joined #ruby
[02:49:41] hays: has joined #ruby
[02:49:57] jgpawletko: has joined #ruby
[02:55:24] ivanskie: has joined #ruby
[02:56:00] Renich_: has joined #ruby
[02:58:00] white_lilies: has joined #ruby
[02:58:46] andrewray: lol why are ruby core docs like this
[02:59:06] andrewray: showing me 10 years old versions by default
[03:08:14] serard: has joined #ruby
[03:12:42] DTZUZO: has joined #ruby
[03:14:14] jetchisel: has joined #ruby
[03:17:05] jetchisel: has joined #ruby
[03:19:17] jetchisel: has joined #ruby
[03:22:08] jetchisel: has joined #ruby
[03:24:26] akem: has joined #ruby
[03:24:38] dbz: has joined #ruby
[03:24:48] knight33: has joined #ruby
[03:24:53] jetchisel: has joined #ruby
[03:27:24] jetchisel: has joined #ruby
[03:29:42] jetchisel: has joined #ruby
[03:32:42] jetchisel: has joined #ruby
[03:32:55] scrptktty: has joined #ruby
[03:35:07] jetchisel: has joined #ruby
[03:37:19] jetchisel: has joined #ruby
[03:39:38] jetchisel: has joined #ruby
[03:42:03] jetchisel: has joined #ruby
[03:43:14] awkwords_: has joined #ruby
[03:44:23] jetchisel: has joined #ruby
[03:46:37] jetchisel: has joined #ruby
[03:48:57] jetchisel: has joined #ruby
[04:00:32] houhoulis: has joined #ruby
[04:07:43] Renich: has joined #ruby
[04:08:57] braincrash: has joined #ruby
[04:11:38] nchambers: has joined #ruby
[04:17:21] mrush: has joined #ruby
[04:17:28] mrush: parsing malformed json is tricky
[04:23:23] mrush: hi nchambers.
[04:23:41] nchambers: you saw nothing
[04:27:07] ivanskie: has joined #ruby
[04:27:55] hurricanehrndz: has joined #ruby
[04:28:47] jetchisel: has joined #ruby
[04:28:59] KeyJoo: has joined #ruby
[04:36:21] Nicmavr: has joined #ruby
[04:38:01] jenrzzz: has joined #ruby
[04:38:45] jenrzzz: has joined #ruby
[04:40:22] bambanx: has joined #ruby
[04:42:55] awkwords: has joined #ruby
[04:50:49] mrush: has left #ruby: ()
[04:55:09] hutch: has joined #ruby
[04:56:30] awkwords: has joined #ruby
[05:01:39] sauvin: has joined #ruby
[05:14:24] matju: has joined #ruby
[05:18:30] awkwords_: has joined #ruby
[05:19:11] \void: has joined #ruby
[05:26:16] awkwords: has joined #ruby
[05:34:19] dedRabbit: has joined #ruby
[05:38:48] mangold: has joined #ruby
[05:39:27] hurricanehrndz: has joined #ruby
[05:42:59] MyMind: has joined #ruby
[05:45:04] ogres: has joined #ruby
[05:49:46] paranoicsan: has joined #ruby
[05:56:29] dbz: has joined #ruby
[05:56:44] akem: has joined #ruby
[05:59:53] cgfbee: has joined #ruby
[06:09:12] donofrio: has joined #ruby
[06:11:00] jenrzzz: has joined #ruby
[06:12:21] awkwords_: has joined #ruby
[06:16:43] conta: has joined #ruby
[06:23:41] jenrzzz: has joined #ruby
[06:28:30] peirama: has joined #ruby
[06:32:29] akosednar: has joined #ruby
[06:35:33] awkwords: has joined #ruby
[06:37:59] aupadhye: has joined #ruby
[06:38:14] akemot: has joined #ruby
[06:38:38] dbz: has joined #ruby
[06:50:18] dellavg_: has joined #ruby
[07:20:08] hurricanehrndz: has joined #ruby
[07:23:26] vondruch: has joined #ruby
[07:25:55] Swyper: has joined #ruby
[07:27:00] Swyper: https://gist.github.com/RickArora/53436ee0fce19f2afe87b7fbd246efe6
[07:27:11] Swyper: Iā€™m getting a wrong number of arguments error and I am not sure why
[07:29:05] evdubs_: has joined #ruby
[07:29:09] Swyper: def repeat(text)
[07:29:09] Swyper: return (text + " " + text)
[07:29:10] Swyper: end # should just send the repeating word back no?
[07:31:20] bijan_: has joined #ruby
[07:35:05] piks3l: has joined #ruby
[07:53:49] ur5us: has joined #ruby
[07:58:19] akosednar: has joined #ruby
[08:03:00] bijan_: has joined #ruby
[08:06:41] ellcs: has joined #ruby
[08:07:15] clemens3: has joined #ruby
[08:08:07] jenrzzz: has joined #ruby
[08:10:37] Swyper: has joined #ruby
[08:11:00] roshanavand: has joined #ruby
[08:13:51] roshanavand1: has joined #ruby
[08:15:40] bijan_: has joined #ruby
[08:20:19] bijan_: has joined #ruby
[08:21:25] RougeR: has joined #ruby
[08:23:44] aufi: has joined #ruby
[08:33:08] paranoicsan: has joined #ruby
[08:34:40] Guest12374: has joined #ruby
[08:40:19] bijan_: has joined #ruby
[08:44:39] bijan__: has joined #ruby
[08:47:00] nolanv: has joined #ruby
[08:50:24] ur5us: has joined #ruby
[08:51:21] akem: has joined #ruby
[08:52:19] mikecmpbll: has joined #ruby
[08:53:22] hurricanehrndz: has joined #ruby
[08:53:29] bijan_: has joined #ruby
[08:55:34] divergence: has joined #ruby
[08:55:41] booboy: has joined #ruby
[09:01:35] r3dc0d3r: has joined #ruby
[09:02:01] bijan___: has joined #ruby
[09:04:06] xMopx: has joined #ruby
[09:06:18] bijan_: has joined #ruby
[09:08:31] dtzuzu: has joined #ruby
[09:10:41] bijan__: has joined #ruby
[09:19:33] bijan_: has joined #ruby
[09:29:56] saTchymoto: has joined #ruby
[09:32:21] kapil____: has joined #ruby
[09:32:49] chongtxtx: has joined #ruby
[09:32:59] themsay: has joined #ruby
[09:36:24] akosednar: has joined #ruby
[09:36:43] ur5us: has joined #ruby
[09:45:08] dbz: has joined #ruby
[09:56:34] roshanavand: has joined #ruby
[09:59:07] arekushi: has joined #ruby
[10:00:13] Beams: has joined #ruby
[10:00:35] phaul: has joined #ruby
[10:01:18] dhollin3: has joined #ruby
[10:06:02] paranoicsan: has joined #ruby
[10:06:22] lucasb: has joined #ruby
[10:07:47] LinuxKnight: has joined #ruby
[10:13:40] nowhere_man: has joined #ruby
[10:16:30] cnsvc: has joined #ruby
[10:28:51] bijan_: has joined #ruby
[10:32:08] malen: has joined #ruby
[10:39:57] awkwords: has joined #ruby
[10:53:27] malen: has joined #ruby
[10:55:58] bijan_: has joined #ruby
[11:00:55] bijan_: has joined #ruby
[11:05:58] conta: has joined #ruby
[11:13:33] dionysus69: so I pass n number of arguments to exec
[11:13:49] dionysus69: how do I save it in method or proc so I pass method/proc as argument to exec
[11:17:13] piks3l: has joined #ruby
[11:20:27] malen: has joined #ruby
[11:22:26] bijan_: has joined #ruby
[11:23:54] lxsameer: has joined #ruby
[11:36:10] paranoicsan: has joined #ruby
[11:41:03] saTchymoto: has joined #ruby
[11:43:00] cnsvc: has joined #ruby
[11:44:38] Ropeney_: has joined #ruby
[11:50:00] malen_: has joined #ruby
[12:09:28] kapil____: has joined #ruby
[12:12:44] irdr: has joined #ruby
[12:18:23] dedRabbit: has joined #ruby
[12:19:13] bijan_: has joined #ruby
[12:22:17] bijan_: has joined #ruby
[12:23:43] paranoicsan: has joined #ruby
[12:25:32] dedRabbit: has joined #ruby
[12:31:11] bijan_: has joined #ruby
[12:32:33] malen: has joined #ruby
[12:33:20] jhass: dionysus69: wat
[12:42:10] dionysus69: jhass: https://gist.github.com/webzorg/be545f089095b92b707c3db1c635cfc8
[12:42:16] dionysus69: how would you dry that up?
[12:42:29] dionysus69: I tried putting exec block in a method, but it misbehaved
[12:42:57] AJA4350: has joined #ruby
[12:44:06] jhass: pid = spawn ...; Process.waitpid pid if last
[12:44:20] bijan_: has joined #ruby
[12:45:44] jhass: if you really absolutely must exec; args = [...]; if last; exec *args; else; spawn *args; end
[12:47:32] jhass: I'd personally give Process.detach a chance first: pid = spawn ...; Process.detach pid
[12:48:10] dionysus69: ok so you think spawn is better used in this case than fork? but they roughly do the same right, both return the pid
[12:48:55] dionysus69: yea thanks for the splat operator
[12:49:45] jhass: I'm repeating myself: you're just reimplementing spawn there
[12:49:57] jhass: spawn is doing fork & exec for you
[12:50:40] dionysus69: now I get it
[12:50:45] dionysus69: finally, thanks :D
[12:54:57] dinfuehr: has joined #ruby
[12:55:08] woodruffw: has joined #ruby
[12:58:56] dionysus69: jhass: result :P last_call ? exec(*ssh_args(args_for_args)) : spawn(*ssh_args(args_for_args))
[13:08:21] bijan_: has joined #ruby
[13:10:04] nowhereman: has joined #ruby
[13:17:17] bijan_: has joined #ruby
[13:18:58] roshanavand1: has joined #ruby
[13:24:34] tuor: has joined #ruby
[13:24:57] bijan_: has joined #ruby
[13:33:26] bijan__: has joined #ruby
[13:33:49] jsc: has joined #ruby
[13:40:18] mostlybadfly: has joined #ruby
[13:40:33] elfranne: has joined #ruby
[13:45:57] bijan_: has joined #ruby
[13:50:01] bijan_: has joined #ruby
[13:50:38] conta2: has joined #ruby
[13:50:45] Ropeney: has joined #ruby
[13:53:04] cnsvc: has joined #ruby
[13:58:35] kloeri: has joined #ruby
[14:02:28] bijan_: has joined #ruby
[14:03:12] ogres: has joined #ruby
[14:06:32] bijan__: has joined #ruby
[14:11:32] conta2: has joined #ruby
[14:15:54] sheepman: has joined #ruby
[14:31:33] Genya: has joined #ruby
[14:32:23] Genya: ruby newb here. using ruby WITHOUT rails. and dont know how to make a singleton. basically I shouldnt have a need to do someclass.new
[14:32:40] Genya: so an object with methods
[14:35:29] Bish: has joined #ruby
[14:35:39] Bish: somebody have a good gem for swagger defined apis?
[14:35:51] Bish: (client)
[14:36:27] Zarthus: Genya: typically you can `include Singleton` in your class and that's it.
[14:36:40] Zarthus: Genya: though note that singletons are more or less an antipattern in the vision of most.
[14:36:58] Genya: it seemed I still had to initialize the class
[14:37:22] Genya: Im reading a little more and it might seem that module is what im looking for?
[14:37:39] peirama: You can use Singleton, but sounds like you rather need a module: https://ruby-doc.org/stdlib-2.3.0/libdoc/singleton/rdoc/Singleton.html
[14:37:46] Genya: im writting a small service which gets a string and searches for keywords.
[14:38:07] peirama: If it does not hold state, use a module
[14:39:06] Genya: thank you. I think that is what I am looking for
[14:41:25] Inline: has joined #ruby
[14:50:30] Bish: swagger seems to be not in here, :o
[14:52:57] Genya: has left #ruby: ()
[14:53:46] Pisuke: has joined #ruby
[14:54:14] polishdub: has joined #ruby
[14:59:38] mangold: has joined #ruby
[15:05:26] Nicmavr: has joined #ruby
[15:06:24] code_zombie: has joined #ruby
[15:08:44] peirama: has joined #ruby
[15:11:24] paranoicsan: has joined #ruby
[15:24:20] Swyper: has joined #ruby
[15:34:49] arup_r: has joined #ruby
[15:38:18] Inline: has joined #ruby
[15:44:31] HailTheRobots: has joined #ruby
[15:48:19] hutch: has joined #ruby
[15:55:37] Renich_: has joined #ruby
[15:55:44] awkwords: has joined #ruby
[16:04:25] BTRE: has joined #ruby
[16:13:26] Renich_: has joined #ruby
[16:23:08] cnsvc: has joined #ruby
[16:25:47] akaiiro: has joined #ruby
[16:27:43] KeyJoo: has joined #ruby
[16:31:26] ChanServ: +o havenwood
[16:31:53] ChanServ: -o havenwood
[16:34:41] chainz: has joined #ruby
[16:34:46] chainz: anyone know if there's a way to run a ruby script starting at a certain line?
[16:34:51] chainz: like ruby script.rb:34
[16:43:03] Zarthus: chainz: import the lib, call the method declared in script.rb?
[16:43:12] Zarthus: that's typically how portability becomes easy
[16:44:45] Dbugger: has joined #ruby
[16:50:46] CrazyEddy: has joined #ruby
[16:50:51] coltkirk: has joined #ruby
[16:53:37] chainz: Zarthus: the script is like a thousand lines
[16:54:34] bijan_: has joined #ruby
[16:54:37] Zarthus: i can think of a hack where you copy the file, slice the lines, and eval it. Or you do a `head +43 | ruby`
[16:54:51] Zarthus: might actually be -43, i do not remember.
[16:55:07] Zarthus: Probably not what you want :P
[16:55:31] chainz: so some background on what i'm trying
[16:55:34] jaddison: has joined #ruby
[16:56:34] chainz: this is a bootstrap script after a server is launched. right now i'm troubleshooting issues and instead of starting all over (which i will eventually do to ensure it works from start) i want to step through each issue and resolve them all
[16:56:46] chainz: the entire bootstrap process takes 45 mins to an hour
[17:07:07] bijan_: has joined #ruby
[17:11:49] bijan__: has joined #ruby
[17:12:02] Tau: has joined #ruby
[17:12:03] weaksauce: has joined #ruby
[17:15:59] Swyper: has joined #ruby
[17:16:01] gix: has joined #ruby
[17:21:11] bijan_: has joined #ruby
[17:25:06] dbz: has joined #ruby
[17:28:14] hutch: has joined #ruby
[17:34:23] bijan_: has joined #ruby
[17:46:50] bijan_: has joined #ruby
[17:47:27] bijan__: has joined #ruby
[17:47:55] RougeR: has joined #ruby
[17:51:17] bijan_: has joined #ruby
[18:04:06] bijan_: has joined #ruby
[18:14:03] havenwood: https://www.ruby-lang.org/en/news/2018/12/06/ruby-2-6-0-rc1-released/
[18:14:54] uplime: has joined #ruby
[18:20:50] bijan_: has joined #ruby
[18:27:47] Pisuke: has joined #ruby
[18:29:07] \void: has joined #ruby
[18:29:34] bijan_: has joined #ruby
[18:31:15] hutch: has joined #ruby
[18:36:07] Guest14049: has joined #ruby
[18:36:39] Swyper: has joined #ruby
[18:37:10] eckhardt_: has joined #ruby
[18:38:09] bijan_: has joined #ruby
[18:38:54] havenwood: I like this commit message: https://github.com/ruby/ruby/commit/a96a594f9978b28d2d374f4a0fc15f5a2224df9b
[18:39:01] havenwood: "solve the genie/zombie/wrestlers bug"
[18:40:15] havenwood: šŸ§žā€ā™‚ļøšŸ§Ÿā€ā™‚ļøšŸ¤¼ā€ā™‚ļøšŸ§žā€ā™€ļøšŸ§Ÿā€ā™€ļøšŸ¤¼ā€ā™€ļø
[18:42:19] bijan__: has joined #ruby
[18:44:45] CrazyEddy: has joined #ruby
[18:49:03] Aqo: has joined #ruby
[18:53:16] cnsvc: has joined #ruby
[19:02:11] malen: has joined #ruby
[19:04:12] Renich_: has joined #ruby
[19:06:26] reber: has joined #ruby
[19:07:54] malen: has joined #ruby
[19:08:53] Renich: has joined #ruby
[19:13:30] Tau: has joined #ruby
[19:15:36] bijan_: has joined #ruby
[19:17:09] orbyt_: has joined #ruby
[19:17:19] elcontrastador: has joined #ruby
[19:20:16] bijan_: has joined #ruby
[19:21:05] mostlybadfly: has joined #ruby
[19:30:42] mikecmpbll: has joined #ruby
[19:32:05] RedNifre: has joined #ruby
[19:36:14] bijan_: has joined #ruby
[19:40:57] bijan_: has joined #ruby
[19:52:45] malen: has joined #ruby
[20:00:52] rippa: has joined #ruby
[20:06:18] Swyper: has joined #ruby
[20:09:42] ur5us: has joined #ruby
[20:12:13] awkwords: has joined #ruby
[20:25:01] Scriptonaut: has joined #ruby
[20:31:09] bijan_: has joined #ruby
[20:32:53] eckhardt_: has joined #ruby
[20:36:45] mochiyoda: has joined #ruby
[20:41:47] HailTheRobots: has joined #ruby
[20:44:58] Scriptonaut: hey guys, I'm working on a really old project that uses activerecord 2, I'm having an issue with connections to the database persisting after I've ran the query, and returned from the method. Here is a basic rundown of what is happening: https://gist.github.com/robins35/9d6b5bcc02550d8ee4f88402660b9850
[20:45:42] Scriptonaut: this ends up meaning that when I iterate a few hundred time, it ends up maxing out my max connection pool within a few seconds
[20:46:35] Scriptonaut: each time I call the method that runs this query, I return an array of the results (not an activerecord relation), yet the connection stays open
[20:47:55] phaul: uhm, this looks like Sequel?
[20:49:00] Scriptonaut: oh, ya it is, but isn't Sequel an activerecord wrapper?
[20:49:00] phaul: afaik that's not activerecord, or was activerecord using Sequel back then?
[20:49:03] havenwood: phaul: I concur, that's a fishy ActiveRecord 2.
[20:49:08] havenwood: Scriptonaut: No
[20:49:24] Scriptonaut: ah, ok. I guess this is a sequel problem
[20:49:34] Scriptonaut: or is it behaving as intended?
[20:50:53] krawchyk: has joined #ruby
[20:52:03] havenwood: Scriptonaut: I see you asked in the #sequel channel. It may take a minute for a response, but that's the best place.
[20:52:34] Scriptonaut: havenwood: thanks
[21:01:06] awkwords: has joined #ruby
[21:03:20] piks3l: has joined #ruby
[21:04:40] jenrzzz: has joined #ruby
[21:04:43] bijan__: has joined #ruby
[21:09:28] awkwords: has joined #ruby
[21:10:14] agent_white: has joined #ruby
[21:10:29] bambanx: has joined #ruby
[21:29:38] bijan_: has joined #ruby
[21:38:13] bijan_: has joined #ruby
[21:39:28] jenrzzz: has joined #ruby
[21:41:04] krawchyk: has joined #ruby
[21:46:51] awkwords: has joined #ruby
[21:47:09] bijan_: has joined #ruby
[21:48:14] jottr: has joined #ruby
[21:52:13] bijan_: has joined #ruby
[21:52:15] jenrzzz: has joined #ruby
[21:59:41] HailTheRobots: has joined #ruby
[22:02:04] eckhardt_: has joined #ruby
[22:08:07] awkwords_: has joined #ruby
[22:13:52] roshanavand: has joined #ruby
[22:21:30] piks3l_: has joined #ruby
[22:22:41] Fusl: has joined #ruby
[22:24:55] perique: has joined #ruby
[22:29:37] daemonwrangler: has joined #ruby
[22:29:42] eckhardt_: has joined #ruby
[22:30:10] Tau: has joined #ruby
[22:33:10] jenrzzz: has joined #ruby
[22:39:05] blackswan: has joined #ruby
[22:39:19] jenrzzz: has joined #ruby
[22:51:05] krawchyk: has joined #ruby
[22:53:54] ogres: has joined #ruby
[22:59:50] cnsvc: has joined #ruby
[23:02:19] awkwords: has joined #ruby
[23:10:19] Swyper: has joined #ruby
[23:12:05] pavelz: has joined #ruby
[23:12:38] pavelz: i am trying to rename keys in array of hashes but it just ignores them
[23:13:14] pavelz: arr.each{|n| n.each{|k,v| f = k.gsub(/node_/,''); puts f," ", v; [f, v]}.to_h }
[23:13:48] Radar: what is arr
[23:14:16] Radar: &>> arr = [{},{}]; arr.each{|n| n.each{|k,v| f = k.gsub(/node_/,''); puts f," ", v; [f, v]}.to_h }
[23:14:18] rubydoc: # => [{}, {}] (https://carc.in/#/r/5png)
[23:14:35] Radar: pavelz: actual input and expected output please
[23:14:35] pavelz: is my code wrong?
[23:15:08] phaul: i guess you mean map, not each
[23:15:18] pavelz: [{"node_name" => "hello"},{"node_name" => "where"}]
[23:18:38] havenwood: pavelz: If it's modern Ruby, consider refactoring: map { |h| h.transform_keys { |key| key.delete 'node_' } }
[23:19:35] chainz: has left #ruby: ()
[23:22:15] pavelz: havenwood: haha no its not. but thanks!
[23:22:26] pavelz: havenwood: what version?
[23:22:39] havenwood: pavelz: #delete is available whatever version
[23:22:54] havenwood: pavelz: #transform_keys is Ruby 2.5
[23:23:17] pavelz: 2.2.3 here
[23:24:11] havenwood: pavelz: You can use the backports gem if you'd like to keep 2.2 and have Hash#transform_keys: https://github.com/marcandre/backports
[23:24:44] havenwood: pavelz: The latest 2.2 is 2.2.10, fwiw.
[23:25:29] havenwood: pavelz: And Ruby 2.2 is past EoL: https://www.ruby-lang.org/en/news/2018/06/20/support-of-ruby-2-2-has-ended/
[23:25:35] havenwood: pavelz: "We highly recommend that you upgrade to Ruby 2.5 or 2.4 as soon as possible."
[23:26:26] jenrzzz: has joined #ruby
[23:36:08] arescorpio: has joined #ruby
[23:55:48] pavelz: havenwood: thanks
[23:56:45] beowuff: has joined #ruby
[23:57:53] beowuff: has left #ruby: ()
[23:58:26] beowuff: has joined #ruby
[23:59:39] beowuff: has left #ruby: ()
[23:59:47] beowuff: has joined #ruby