« Back to channel list

#ruby - 27 March 2018

« Back 1 day Forward 1 day »
[00:03:59] seydar: weird. works on one machine (mac 10.9.5), but not another (ubuntu)
[00:04:07] marxarelli: has joined #ruby
[00:05:08] seydar: ah okay. that was the problem. i just had to publically ask first before either a) the problem fixed itself or b) i figured out that rvm wasn't getting the latest list
[00:05:24] gigetoo: has joined #ruby
[00:10:25] harryv: has joined #ruby
[00:11:00] jobewan: has joined #ruby
[00:16:30] ramfjord: has joined #ruby
[00:18:47] n0m4d1c: has joined #ruby
[00:22:05] harryv: has joined #ruby
[00:24:21] alfiemax: has joined #ruby
[00:24:47] beremenushka: has joined #ruby
[00:25:36] katoline: has joined #ruby
[00:28:37] tolerablyjake: has joined #ruby
[00:29:21] katoline: has left #ruby: ()
[00:34:19] riotjones: has joined #ruby
[00:39:48] AJA4350: has joined #ruby
[00:41:16] ramfjord: has joined #ruby
[00:47:19] ramfjord: has joined #ruby
[00:47:25] gix: has joined #ruby
[00:49:10] white_lilies: has joined #ruby
[00:49:35] white_lilies: has joined #ruby
[00:50:19] jobewan: has joined #ruby
[00:50:28] noobineer: has joined #ruby
[00:54:32] harryv: has joined #ruby
[00:55:28] bmurt: has joined #ruby
[00:56:53] duckpuppy: has joined #ruby
[00:57:59] fhmax: has joined #ruby
[00:59:04] harrycs: has joined #ruby
[01:00:07] jenrzzz_: has joined #ruby
[01:03:19] ledestin: has joined #ruby
[01:04:41] chmurifree: has joined #ruby
[01:08:23] riotjones: has joined #ruby
[01:09:44] gizmore|2: has joined #ruby
[01:11:22] tryingruby: has joined #ruby
[01:14:49] darkhanb: has joined #ruby
[01:15:35] tryingruby: Hi All, trying ruby 101 to be used for ingesting data using logstash: But i can't get past this basic thing I am trying to do. I am not a Ruby programmer, but wondering if one could quickly point my mistake in this 4 line code: https://pastebin.com/D6c3qc2a
[01:15:36] ruby[bot]: tryingruby: we in #ruby do not like pastebin.com, it loads slowly for most, has ads which are distracting and has terrible formatting. Please use https://gist.github.com
[01:16:56] alfiemax: has joined #ruby
[01:17:21] jobewan: has joined #ruby
[01:17:38] phaul: tryingruby: first thing I spot is that .map(&:to_s) does nothing
[01:17:57] phaul: afaics, at least, those are already strings
[01:18:17] tryingruby: phaul: https://gist.github.com/ahkumar/27596c6cec45016d03abd66ccc135888
[01:18:44] tryingruby: phaul: okay I will get rid of it
[01:19:06] gix: has joined #ruby
[01:19:26] phaul: but otherwise Im not seeing any obvious mistake. although it's 3 am in the morning here :)
[01:19:39] tryingruby: phaul: I expect only the matched line to be printed, instead I get all lines printed out, any idea why?
[01:20:25] ElFerna: has joined #ruby
[01:20:44] dinfuehr: has joined #ruby
[01:20:56] phaul: yes you are in a repl right like irb? you are not printing anything. the repl prints the last expression which is the whole block
[01:21:06] tryingruby: phaul: 3am that's too late in the night or too early in the morning ;) Anyways my file is delimited by pipe(|)
[01:21:16] alfiemax_: has joined #ruby
[01:23:45] phaul: so the task is to print get an array of lines where only the lines with the String 'user' are kept?
[01:24:04] phaul: s/print//
[01:24:58] phaul: you could put a .grep(/user/) right on on each_line and forget about the block
[01:25:35] tryingruby: phaul: yes that is correct: each line if formatted as user|xyz|sss|sssys|ssddsd|...|zzz ; where user is different user names; and i want to grep specific user and find further details related to user in an array and pass it to elasticsearch
[01:26:38] tryingruby: phaul: can you please explain be why is the current code referencing a block and not a line as I think it is?
[01:27:48] tryingruby: phaul: I understood data is a line array with all values split in a line
[01:27:58] phaul: so you were saying this code prints something. There is not a single print in this code. That's why I said it must be the REPL giving you the value of the expression you typed
[01:28:47] phaul: and that's the whole thing. try putting a puts on the last line in the block to see what hat evaluates to
[01:28:47] noobineer: has joined #ruby
[01:30:03] Radar: has joined #ruby
[01:30:19] phaul: s/hat/that/
[01:31:52] guacamole: has joined #ruby
[01:32:27] tryingruby: phaul: I tried putting a just "puts" but same thing it prints the whole block; what do you mean by s/hat/that/ I understand this has search and replace in vi?
[01:33:17] noobineer: has joined #ruby
[01:34:20] phaul: tryingruby: I made a typo `hat' -> `that' in my previous comment.
[01:35:02] phaul: so, this code does not filter out lines. you iterate on all lines with .each_line. then for all lines you apply the block.
[01:35:13] tryingruby: phaul: here is what I tried: var=line.grep(/user/); puts var; it failed
[01:35:45] tryingruby: phaul: how do I filter out lines?
[01:36:21] phaul: put a .grep(/user/) on .each_line like
[01:36:39] fhmax: has joined #ruby
[01:36:45] phaul: File.read("OU_user_details.log").each_line.grep(/user/)
[01:37:01] tryingruby: phaul: is this correct: var=line.grep(/myuser/) ?
[01:38:40] phaul: you don't even need the block, this just returns an array of matching lines
[01:38:49] tryingruby: phaul: got it that worked. but i get an extra => [nil] printed at the end, what is that for?
[01:39:08] phaul: that's the REPL telling you the value of the last expression
[01:39:30] phaul: that mechanism is simply part of irb
[01:39:59] workmad3: has joined #ruby
[01:41:38] tryingruby: phaul: I see, I plan to set variables from the matched lines and their values in elasticsearch/logstash using their libraries that implement event.set I just i hope this nil will not be an issue at that time given it is not running interactively then.
[01:42:42] tryingruby: phaul: anyways thanks a lot my friend ... I will continue with finishing up what i was trying. for now this much ruby is good!! get some rest!!
[01:43:22] cdg: has joined #ruby
[01:43:29] phaul: good luck with your project
[01:43:42] Dimik: has joined #ruby
[01:43:56] riotjones: has joined #ruby
[01:46:23] cagomez: has joined #ruby
[01:48:05] pilcrow: has joined #ruby
[01:52:01] guacamole: has joined #ruby
[01:52:02] guacamole: has joined #ruby
[01:54:07] rshetty: has joined #ruby
[01:54:14] milardovich: has joined #ruby
[01:56:47] guacamole: has joined #ruby
[01:56:48] guacamole: has joined #ruby
[01:58:59] duckpuppy: has joined #ruby
[02:01:09] ivanskie: has joined #ruby
[02:06:26] Olipro: has joined #ruby
[02:08:01] duderonomy: has joined #ruby
[02:09:58] netherwolfe: has joined #ruby
[02:10:02] n0m4d1c: has joined #ruby
[02:11:07] STYNC: has joined #ruby
[02:14:48] riotjones: has joined #ruby
[02:17:54] kapil___: has joined #ruby
[02:36:39] jane_booty_doe: has joined #ruby
[02:38:13] kn-928: has joined #ruby
[02:39:04] harrycs: has joined #ruby
[02:40:32] toks: has joined #ruby
[02:43:21] rshetty: has joined #ruby
[02:48:14] riotjones: has joined #ruby
[02:49:43] harryv: has joined #ruby
[02:52:21] harryk_: has joined #ruby
[02:55:43] harryv: has joined #ruby
[02:56:01] guacamole: has joined #ruby
[02:56:01] guacamole: has joined #ruby
[02:56:20] rshetty: has joined #ruby
[03:03:07] duckpuppy: has joined #ruby
[03:03:53] harryk_: has joined #ruby
[03:08:48] LenPayne: has joined #ruby
[03:22:14] harryv: has joined #ruby
[03:23:19] redlegion: has joined #ruby
[03:25:41] riotjones: has joined #ruby
[03:26:17] n0m4d1c: has joined #ruby
[03:27:41] redlegion: has joined #ruby
[03:34:03] redlegion: has joined #ruby
[03:36:03] ramfjord: has joined #ruby
[03:38:13] ivanskie: has joined #ruby
[03:39:59] workmad3: has joined #ruby
[03:42:18] ramfjord: has joined #ruby
[03:44:53] r3m: has joined #ruby
[03:45:21] alfiemax: has joined #ruby
[03:46:12] guacamole: has joined #ruby
[03:46:13] guacamole: has joined #ruby
[03:46:21] harryk_: has joined #ruby
[03:46:34] apeiros: has joined #ruby
[03:46:45] ryan_ford: has joined #ruby
[03:48:18] pastorinni: has joined #ruby
[03:49:12] burgestrand: has joined #ruby
[03:49:13] harrycs: has joined #ruby
[03:54:18] darkhanb: has joined #ruby
[03:55:59] GJdan: has joined #ruby
[03:57:35] rshetty: has joined #ruby
[03:59:20] riotjones: has joined #ruby
[04:00:40] orbyt_: has joined #ruby
[04:01:56] b100s: has joined #ruby
[04:03:35] duckpuppy: has joined #ruby
[04:03:50] eckhardt: has joined #ruby
[04:05:15] govg: has joined #ruby
[04:05:16] b100s: Hello! Probably simple question: could I force Sinatra to listen on multiple IPs or/and ports ?
[04:06:27] baweaver: Probably, though you probably want to use NGINX for that instead.
[04:06:35] harrycs: Hi all, restarting my job search made me a little self conscious of my Twitter - so I made a tool in Ruby to purge an account of likes, tweets, and rts. Just thought I'd share this in case any others have had similar https://github.com/stebbins/cage-the-bird
[04:07:05] darkhanb: has joined #ruby
[04:08:07] baweaver: you might get dinged for the eval in there if you show it off.
[04:09:16] harrycs: baweaver: was that @ me or b100s?
[04:09:41] harrycs: What do you mean by dinged for the eval?
[04:10:36] baweaver: If you show off that code as an example the eval might get some looks
[04:10:57] baweaver: you could likely use public_send there intead, or even a case statement dispatch
[04:13:54] harrycs: baweaver: interesting, thanks for the tip! just curious - what's the advantage of public_send over eval?
[04:14:18] baweaver: public_send will only send to the instance and will only allow you to call the public interface of it
[04:14:24] baweaver: eval lets you do anything
[04:14:37] baweaver: like someone passes you `rm -rf` for instance
[04:15:31] b100s: baweaver, could I run multiple "apps" in one server like `my_app = Sinatra.new { get('/') { "hi" } } my_app.run!`, so each will listen to different IP and port ?
[04:15:58] harrycs: baweaver: ah, good to know! Thanks for taking a look & for the feedback!
[04:16:07] baweaver: Use NGINX for it, it'll be easier on you
[04:16:21] baweaver: Though if you're running multiple apps off of one file I would consider breaking that up anyways.
[04:16:33] b100s: baweaver, noted, nginx is not my current case, unfotunately
[04:17:01] baweaver: What's your current case?
[04:17:39] b100s: baweaver, I have app which runs inside cloud like bluemix, so I'm not able to change anything aside my app
[04:18:00] b100s: I have two interfaces and have to listen to them for handle different requests
[04:18:15] burgestrand: has joined #ruby
[04:23:50] rikai: has joined #ruby
[04:25:14] trautwein: has joined #ruby
[04:27:40] zacts: has joined #ruby
[04:30:22] rshetty: has joined #ruby
[04:31:04] riotjones: has joined #ruby
[04:32:13] alfiemax: has joined #ruby
[04:36:41] burgestrand: has joined #ruby
[04:42:25] rshetty: has joined #ruby
[04:46:18] hays: has joined #ruby
[04:46:18] hays: has joined #ruby
[04:49:00] jane_booty_doe: has joined #ruby
[04:55:32] jaequery: has joined #ruby
[05:01:08] duckpuppy: has joined #ruby
[05:11:02] reber: has joined #ruby
[05:11:09] reber__: has joined #ruby
[05:13:38] jyaworski: has joined #ruby
[05:17:19] romain_t: has joined #ruby
[05:22:58] jaequery: has joined #ruby
[05:24:59] stoffus: has joined #ruby
[05:27:10] tolerablyjake: has joined #ruby
[05:27:49] cdg: has joined #ruby
[05:33:20] nowhereman_: has joined #ruby
[05:33:43] howdoi: has joined #ruby
[05:34:20] sauvin_: has joined #ruby
[05:36:19] jyaworski: has joined #ruby
[05:38:27] riotjones: has joined #ruby
[05:39:59] workmad3: has joined #ruby
[05:41:28] aupadhye: has joined #ruby
[05:41:45] jaequery: has joined #ruby
[05:45:08] shuforov: has joined #ruby
[05:45:43] n008f4g_: has joined #ruby
[05:45:51] tomphp: has joined #ruby
[05:48:08] guacamole: has joined #ruby
[05:48:08] guacamole: has joined #ruby
[05:50:25] pilcrow: has left #ruby: ("Leaving")
[05:56:14] venmx: has joined #ruby
[05:57:30] duckpuppy: has joined #ruby
[05:57:31] za1b1tsu: has joined #ruby
[06:10:36] jcarl43: has joined #ruby
[06:11:20] aupadhye: has joined #ruby
[06:12:09] jyaworski: has joined #ruby
[06:13:05] anisha_: has joined #ruby
[06:13:37] KeyJoo: has joined #ruby
[06:14:37] riotjones: has joined #ruby
[06:15:15] _rshetty_: has joined #ruby
[06:16:28] shuforov: has joined #ruby
[06:17:01] qba73: has joined #ruby
[06:18:07] nowhere_man: has joined #ruby
[06:19:23] qba73: has joined #ruby
[06:21:05] kapil___: has joined #ruby
[06:21:08] conta: has joined #ruby
[06:22:10] marr: has joined #ruby
[06:22:22] alex``: has joined #ruby
[06:31:12] shpoont_: has joined #ruby
[06:32:55] sanscoeur: has joined #ruby
[06:34:16] andikr: has joined #ruby
[06:35:43] sauvin_: has joined #ruby
[06:37:44] workmad3: has joined #ruby
[06:47:39] Emmanuel_Chanel: has joined #ruby
[06:47:56] shuforov: has joined #ruby
[06:50:57] TheMFingYeti: has joined #ruby
[06:51:57] TheMFingYeti: Does anyone know what would cause bundle install to spit out: "NameError: undefined local variable or method `options' for #<Bundler::RubyGemsGemInstaller:0x7fd48c2cf520>" when trying to install the mysql 2.9.1 gem?
[06:52:38] larcara: has joined #ruby
[06:53:18] riotjones: has joined #ruby
[07:02:02] duckpuppy: has joined #ruby
[07:02:12] TheMFingYeti: has joined #ruby
[07:02:38] alfiemax_: has joined #ruby
[07:04:32] Flisk: has left #ruby: ("// this should never happen")
[07:07:02] TheMFingYeti: has joined #ruby
[07:07:38] dionysus69: has joined #ruby
[07:09:59] aufi: has joined #ruby
[07:10:05] RougeR: has joined #ruby
[07:15:47] suukim: has joined #ruby
[07:20:21] clemens3: has joined #ruby
[07:24:37] schneider: has joined #ruby
[07:25:00] aufi: has joined #ruby
[07:30:34] faces: has joined #ruby
[07:33:33] ur5us_: has joined #ruby
[07:35:40] morfin: has joined #ruby
[07:37:02] _whitelogger: has joined #ruby
[07:39:36] jamesaxl: has joined #ruby
[07:47:06] Beams: has joined #ruby
[07:48:31] burgestrand: has joined #ruby
[07:56:37] _rshetty_: has joined #ruby
[07:56:46] duckpuppy: has joined #ruby
[07:57:58] TinkerT: has joined #ruby
[07:58:08] Beams_: has joined #ruby
[07:58:46] guille-moe: has joined #ruby
[07:58:46] rshetty: has joined #ruby
[07:59:09] _rshetty_: has joined #ruby
[07:59:27] venmx: has joined #ruby
[08:01:30] claudiuinberlin: has joined #ruby
[08:03:24] za1b1tsu: has joined #ruby
[08:03:33] riotjones: has joined #ruby
[08:05:04] kriskropd: has joined #ruby
[08:07:45] cagomez: has joined #ruby
[08:10:04] tomphp: has joined #ruby
[08:11:00] Beams: has joined #ruby
[08:11:56] rshetty: has joined #ruby
[08:12:23] alfiemax: has joined #ruby
[08:12:45] alfiemax: has joined #ruby
[08:14:25] karapetyan: has joined #ruby
[08:18:49] KeyJoo: has joined #ruby
[08:22:54] tomphp: has joined #ruby
[08:23:49] riotjones: has joined #ruby
[08:28:42] ellcs: has joined #ruby
[08:30:41] karapetyan: has joined #ruby
[08:35:45] Beams_: has joined #ruby
[08:36:14] mfaeh: has joined #ruby
[08:41:45] RougeR: has joined #ruby
[08:41:45] RougeR: has joined #ruby
[08:50:02] riotjones: has joined #ruby
[08:56:02] jottr: has joined #ruby
[08:56:33] anisha_: has joined #ruby
[08:56:59] einarj: has joined #ruby
[09:00:10] Serpent7776: has joined #ruby
[09:01:20] dr3wo: has joined #ruby
[09:01:28] larcara: has joined #ruby
[09:01:59] duckpuppy: has joined #ruby
[09:06:24] larcara: has joined #ruby
[09:07:30] WhereIsMySpoon: has joined #ruby
[09:07:30] WhereIsMySpoon: has joined #ruby
[09:07:35] nowhereman: has joined #ruby
[09:10:32] burgestrand: has joined #ruby
[09:13:22] jyaworski: has joined #ruby
[09:24:57] duckpuppy: has joined #ruby
[09:26:32] cdg: has joined #ruby
[09:27:20] dextrey: has joined #ruby
[09:30:11] kriskropd: has joined #ruby
[09:31:51] dhollinger: has joined #ruby
[09:32:54] Beams: has joined #ruby
[09:40:37] mojtaba: has joined #ruby
[09:47:10] Guest92986: has joined #ruby
[09:48:56] Zaab1t: has joined #ruby
[09:50:33] ferr: has joined #ruby
[09:55:08] karapetyan: has joined #ruby
[09:57:17] rshetty: has joined #ruby
[09:59:22] mojtaba: has joined #ruby
[10:00:56] Beams_: has joined #ruby
[10:02:45] larcara: has joined #ruby
[10:03:08] larcara: has joined #ruby
[10:03:36] rahul_bajaj: has joined #ruby
[10:03:43] aupadhye_: has joined #ruby
[10:05:38] dr3wo: has joined #ruby
[10:06:50] sanscoeur: has joined #ruby
[10:07:03] rabajaj: has joined #ruby
[10:07:16] zwliew: has joined #ruby
[10:07:50] za1b1tsu_: has joined #ruby
[10:08:37] psychicist__: has joined #ruby
[10:09:32] rshetty: has joined #ruby
[10:12:13] jyaworski: has joined #ruby
[10:13:30] ramfjord: has joined #ruby
[10:16:25] ur5us: has joined #ruby
[10:18:34] karapetyan: has joined #ruby
[10:21:38] aupadhye_: has joined #ruby
[10:25:23] larcara: has joined #ruby
[10:25:48] jottr: has joined #ruby
[10:31:25] leitz: has joined #ruby
[10:31:52] silam: has joined #ruby
[10:32:22] leitz: If using 5e3 for scientific notation, is there a way to use a variable for the "3"?
[10:32:24] smala: has joined #ruby
[10:32:38] karapetyan: has joined #ruby
[10:34:17] canton7: leitz, "use a variable" in what sense?
[10:34:28] leitz: Ah, found it. 5 * 10 ** ldmod
[10:35:17] leitz: canton7, not sure if the "3" in the above is the exponent, or what. Still (re-)learning math.
[10:35:48] leitz: But the goal is to have a variable for the "power of" bit.
[10:37:31] canton7: yeah, "5e3" is scentific notiation for "5 * 10^3"
[10:41:18] workmad3: has joined #ruby
[10:43:57] hays: has joined #ruby
[10:43:57] hays: has joined #ruby
[10:50:35] silam: I am using ruby-2.4.3 and while exectuing the puppet command
[10:50:37] silam: ./puppet agent -t --debug
[10:50:39] apparition: has joined #ruby
[10:51:03] silam: I am using ruby-2.4.3 and while exectuing the puppet command ...
[10:51:04] silam: ./puppet agent -t --debug
[10:51:17] silam: am geiing seg fault
[10:51:18] silam: Debug: Dynamically-bound port lookup failed; falling back to ca_port setting Debug: Creating new connection for https://puppet:8140 /opt/iexpress/ruby/lib/ruby/2.4.0/timeout.rb:97: [BUG] Segmentation fault at 0x02beb640 ruby 2.4.3p205 (2017-12-14 revision 61247) [hppa2.0w-hpux11.31]
[10:51:34] silam: Please help me on this issue
[10:52:42] WhereIsMySpoon: silam: are you trying to get puppet to use an external CA?
[10:54:53] silam: here i am not using any external CA .. i am just doing sample test ..
[10:55:26] silam: i am doing this on HP-UX PA platform
[10:55:37] silam: On HP UX IA i dint get any issues..
[10:58:09] silam: WhereIsMySpoon : why seg faults is coming ... /opt/iexpress/ruby/lib/ruby/2.4.0/timeout.rb:97: [BUG] Segmentation fault at 0x02beb640
[10:59:23] silam: thanks .. did u faced any similar isssues?
[11:00:06] shuforov: has joined #ruby
[11:00:16] WhereIsMySpoon: there are some old issues on the net if you google “puppet timeout.rb segfault
[11:00:25] WhereIsMySpoon: but theyre like 4-5 years old
[11:02:39] Psybur: has joined #ruby
[11:03:40] gray_-_wolf: has joined #ruby
[11:05:01] _rshetty_: has joined #ruby
[11:06:16] shpoont_: has joined #ruby
[11:07:11] dr3wo: has joined #ruby
[11:07:34] burgestrand: has joined #ruby
[11:18:28] KeyJoo: has joined #ruby
[11:20:31] larcara: has joined #ruby
[11:21:57] catphish: has joined #ruby
[11:23:06] catphish: i have a situation where some of my ruby processes are sending kill(9) to seemingly random low numbered processes, is there any obvious reason this might happen before i keep digging?
[11:23:12] jyaworski: has joined #ruby
[11:23:26] catphish: most of the time it gets back "process not found" but just occasionally it kills something important
[11:26:08] catphish: hopefully strace will soon tell me
[11:26:31] WhereIsMySpoon: catphish: I have no idea, but that sounds whacky :D
[11:27:22] WhereIsMySpoon: catphish: are your ruby processes using ports or the database or threads in a pool or something similar? Maybe theyre trying to clear resources up but getting the wrong pids
[11:27:28] WhereIsMySpoon: Just a random shot in the dark
[11:28:52] karapetyan: has joined #ruby
[11:31:25] Nahra: has joined #ruby
[11:33:31] catphish: it seems to occur when i call "exit"
[11:40:52] ldnunes: has joined #ruby
[11:42:36] Beams: has joined #ruby
[11:42:55] catphish: i guess a badly behaved at_exit
[11:43:10] dr3wo: has joined #ruby
[11:51:22] tomphp: has joined #ruby
[11:54:36] Cavallari: has joined #ruby
[11:54:53] catphish: looks like i was running exit in a forked process, and it had an at_exit callback that was running kill on some stale data
[12:00:30] yokel: has joined #ruby
[12:01:06] stoffus1: has joined #ruby
[12:01:16] bruce_lee: has joined #ruby
[12:05:24] mahlon: has joined #ruby
[12:08:28] amatas: has joined #ruby
[12:12:54] larcara: has joined #ruby
[12:17:06] shpoont_: has joined #ruby
[12:17:15] bmurt: has joined #ruby
[12:17:27] ur5us: has joined #ruby
[12:19:38] ecuanaso: has joined #ruby
[12:20:46] ecuanaso: has joined #ruby
[12:23:51] ferr: has left #ruby: ("WeeChat 2.1")
[12:28:22] AJA4350: has joined #ruby
[12:29:08] ged: has joined #ruby
[12:30:43] sepp2k: has joined #ruby
[12:34:50] WhereIsMySpoon: has joined #ruby
[12:34:50] WhereIsMySpoon: has joined #ruby
[12:36:45] ramfjord: has joined #ruby
[12:37:54] nme13: has joined #ruby
[12:39:45] TheBloke: has joined #ruby
[12:40:01] Strepsils: has joined #ruby
[12:42:40] Papierkorb: has joined #ruby
[12:43:12] Papierkorb: has left #ruby: ("Konversation terminated!")
[12:47:59] yadnesh: has joined #ruby
[12:48:14] ecuanaso: has joined #ruby
[12:48:34] fyrril: has joined #ruby
[12:56:11] shuforov: has joined #ruby
[12:56:15] phaul: has joined #ruby
[12:56:46] Guest92986: has joined #ruby
[13:00:49] schneider: has joined #ruby
[13:03:11] aufi_: has joined #ruby
[13:03:42] Beams_: has joined #ruby
[13:04:00] shuforov: has joined #ruby
[13:06:13] rshetty: has joined #ruby
[13:07:52] rsh: has joined #ruby
[13:08:52] catphish: i expected exit! to fix it, but strangely it hasn't :(
[13:11:26] jcalla: has joined #ruby
[13:15:10] jyaworski: has joined #ruby
[13:16:34] fhmax: has joined #ruby
[13:16:56] shuforov: has joined #ruby
[13:18:13] RougeR: has joined #ruby
[13:18:13] RougeR: has joined #ruby
[13:18:14] larcara: has joined #ruby
[13:22:32] leotaku: has left #ruby: ("WeeChat 2.0")
[13:23:58] skweek: has joined #ruby
[13:26:04] cdg: has joined #ruby
[13:26:12] kn-928: has joined #ruby
[13:26:41] skweek: has joined #ruby
[13:28:40] jyaworski: has joined #ruby
[13:30:41] maufart__: has joined #ruby
[13:30:46] burgestrand: has joined #ruby
[13:30:53] ecuanaso: has joined #ruby
[13:31:42] k0mpa: has joined #ruby
[13:32:48] gentleterror: has joined #ruby
[13:37:31] shinnya: has joined #ruby
[13:38:16] shuforov: has joined #ruby
[13:38:33] Sylario: has joined #ruby
[13:39:26] zaka: has joined #ruby
[13:40:55] conta: has joined #ruby
[13:41:28] hinbody: has joined #ruby
[13:43:30] ecuanaso: has joined #ruby
[13:44:47] oleo: has joined #ruby
[13:45:04] darix: has joined #ruby
[13:45:05] memo1: has joined #ruby
[13:45:36] zaka: someone who knows somethink about threads is here and can help?
[13:46:01] WhereIsMySpoon: zaka: ask the question, and maybe someone will
[13:46:29] memo1: hi, if i want to execute a ffmpeg command, inside a ruby program and grab all possible exceptions, how i do it?
[13:48:20] ellcs: @memo1 have a look at Open3
[13:51:39] alfiemax: has joined #ruby
[13:57:45] zaka: I have a class by which I create objects and add them to the array list.Each object has a doImages method. It takes around 2 minutes to create images per object. How can I start this process in many threads so that it simultaneously creates photos for example 10 objects
[13:58:28] za1b1tsu: has joined #ruby
[13:58:35] zaka: i can show my code if someone can help
[13:59:17] WhereIsMySpoon: https://stackoverflow.com/questions/15782492/how-to-run-two-methods-in-parallel-ruby
[14:02:41] dviola: has joined #ruby
[14:03:05] jrafanie: has joined #ruby
[14:05:22] skweek: has joined #ruby
[14:05:30] zaka: i trying that and my app finish process automaticly
[14:05:30] zaka: t1 = Thread.new do
[14:05:31] zaka: i.createImage
[14:05:38] zaka: sorry for that spam
[14:06:29] phaul: you join the thread in the thread block. join outside
[14:07:09] phaul: also for this specific use case take a look at https://github.com/grosser/parallel
[14:07:27] phaul: high level api that fits your needs better
[14:08:13] zaka: thanks for link
[14:08:17] orbyt_: has joined #ruby
[14:08:33] catphish: fixed my problem, i was still running exit() instead of exit!() in some places, and calling an at_exit that killed things (which had already been killed by a different fork) :)
[14:08:46] catphish: causing it to occasionally kill something that was reusing an old PID
[14:09:37] n0m4d1c: has joined #ruby
[14:09:42] memo1: ellcs: thank you, and once i get the stderr and stdout, how i check it as a log?,
[14:11:29] zaka: no idea how to use that parallel :D
[14:11:34] chouhoulis: has joined #ruby
[14:11:55] WhereIsMySpoon: catphish: yay for multiprocess programs :D
[14:12:51] phaul: zaka ok, then you hae to move out t.join from the block
[14:13:02] zaka: ok it work when i do it
[14:13:17] zaka: but still doing one method at once
[14:14:05] phaul: start all threads in a loop. dont join them in the loop. after that join all in a separate loop
[14:15:01] arekushi: has joined #ruby
[14:15:15] ellcs: @memo1 you might i don't know the specific output you might want to catch. but you can iterate over stderr and check if there are some indicators for your exceptions
[14:15:39] zaka: so i need to keep that thread in array too?
[14:16:31] memo1: ellcs: i can use open3 with a try do block?
[14:16:36] Rapture: has joined #ruby
[14:17:36] WhereIsMySpoon: is there not a way in ruby to stream a list in a parallel way? like java has myList.parallelStream().map/forEach which will execute the lambda given in a multithreaded way
[14:18:07] ur5us: has joined #ruby
[14:18:38] WhereIsMySpoon: oh wait, that parallel gem does like…exactly that
[14:18:39] phaul: WhereIsMySpoon: the library I linked does exactly that
[14:18:43] WhereIsMySpoon: zaka: follow the readme in that library
[14:18:52] WhereIsMySpoon: its super super simple
[14:19:10] ellcs: popen won't throw a exception
[14:19:10] ellcs: are you using the ffmpeg gem?
[14:19:17] ellcs: guess not, nvm
[14:20:28] nitrnitr: has joined #ruby
[14:21:18] catphish: has left #ruby: ("Leaving")
[14:21:44] zaka: i read some i create somethink like this results = Parallel.map($a) do |one_letter|
[14:21:44] zaka: one_letter.createImage
[14:23:37] zaka: error :block (2 levels) in <top (required)>': undefined method `createImage' for //i:Regexp (NoMethodError)
[14:24:03] WhereIsMySpoon: then whatever you’re passing in doesnt have a createImage function
[14:24:21] WhereIsMySpoon: you said doImages when you first said this
[14:24:25] WhereIsMySpoon: then createImages
[14:24:39] WhereIsMySpoon: check youve got the right function and youre passing in the right objects to the array
[14:25:04] zaka: function is right because code $a.each do|i| i.createImage end work
[14:25:44] nadir: has joined #ruby
[14:27:02] darix: has joined #ruby
[14:27:59] fhmax: has joined #ruby
[14:28:10] alex``: has joined #ruby
[14:28:38] dionysus69: has joined #ruby
[14:29:44] alfiemax: has joined #ruby
[14:33:43] Fysicus: has joined #ruby
[14:35:11] fhmax: has joined #ruby
[14:35:20] karapetyan: has joined #ruby
[14:35:33] memo1: has joined #ruby
[14:36:34] memo1: ellcs: no, im using the bash command ffmpeg
[14:36:37] jeffreylevesque: has joined #ruby
[14:38:04] ellcs: memo1: so you need to check within your stderr object if there has been an error
[14:38:05] tdelam: has joined #ruby
[14:40:16] Jittler: has joined #ruby
[14:40:28] phaul: is there a gem that gives you UINT64 arithmetics, preferably implemented with machine registers?
[14:40:37] karapetyan: has joined #ruby
[14:40:51] Jittler: Can someone help me get rubocop to auto-format my .rb files on save in VS Code? I'm in a class learning ruby and it'd certainly help.
[14:41:08] synthroid: has joined #ruby
[14:41:23] harrycs: has joined #ruby
[14:41:35] Jittler: I have Ruby, Ruby Solargraph, and ruby-rubocop packages installed. The linter works, and I added "ruby.rubocop.onSave": true to my settings.
[14:42:18] synthroid: has joined #ruby
[14:44:01] ldnunes: has joined #ruby
[14:45:00] chouhoulis: has joined #ruby
[14:45:13] govg: has joined #ruby
[14:46:37] Jittler: Okay, after some digging.. it looks like rubocop is just a linter and it doesn't do the beautify/prettify autoformat on save thing. Does anyone know a ruby autoformatter I can use? :|
[14:47:11] drale2k: has joined #ruby
[14:50:01] RougeR: has joined #ruby
[14:52:47] netherwolfe: has joined #ruby
[14:53:01] fhmax: has joined #ruby
[14:53:09] fhmax_: has joined #ruby
[14:55:10] Esa_: has joined #ruby
[14:55:23] zaka: Process.fork is not supported by this Ruby --- what that means?
[14:58:50] WhereIsMySpoon: zaka: are you on windows?
[15:00:00] alfiemax: has joined #ruby
[15:03:13] jottr: has joined #ruby
[15:03:26] rippa: has joined #ruby
[15:03:37] rshetty: has joined #ruby
[15:04:13] sleepee: has joined #ruby
[15:05:06] za1b1tsu: has joined #ruby
[15:05:58] Mike11: has joined #ruby
[15:09:35] jottr: has joined #ruby
[15:13:07] zaka: yes on windows
[15:13:35] lxsameer: has joined #ruby
[15:13:43] WhereIsMySpoon: zaka: youre out of luck, you cant fork on windows
[15:14:43] larcara: has joined #ruby
[15:16:31] alfiemax_: has joined #ruby
[15:18:46] konsolebox: has joined #ruby
[15:20:12] alfiemax: has joined #ruby
[15:21:44] mugurel_: has joined #ruby
[15:21:49] mugurel_: Anonymous survey - your help is greatly appreciated Hello everyone, I'd like to have a better idea (that's up to date and real, not possibly fake data) of how much Web Developers / Programmers in different parts of the world are paid. If anyone has 20 - 60 seconds to spare and fill the anonymous survey, it will be very helpful. You will find the survey here: https://goo.gl/forms/gzNw7PWc3h9hWnTL2 After I get enough answers I'll al
[15:22:49] WhereIsMySpoon: mugurel_: you know this data is readily available on various websites?
[15:23:54] jottr: has joined #ruby
[15:24:08] mugurel_: Yes, I am aware of that, but most of them are from lengthy surveys, and some of them not up to date. Ever if I get a few questions it will help. It's worth a shot anyway.
[15:24:30] jyaworski: has joined #ruby
[15:29:48] jottr: has joined #ruby
[15:31:33] ldnunes: has joined #ruby
[15:31:58] tAn: has joined #ruby
[15:33:22] nme13: has joined #ruby
[15:34:50] schneider: has joined #ruby
[15:35:03] pastorinni: has joined #ruby
[15:36:14] memo1: hi, im using evenmachine and rest-client to post to a server. Every two or three weeks i get an exception "too many open files- getaddrinfo". It is solve if a restart the script. How i can solve it programmatically?
[15:37:53] RougeR: has joined #ruby
[15:37:53] RougeR: has joined #ruby
[15:38:15] WhereIsMySpoon: memo1: https://askubuntu.com/questions/181215/too-many-open-files-how-to-find-the-culprit this might help you find whats going on
[15:39:35] facest: has joined #ruby
[15:39:53] tAn: has joined #ruby
[15:40:26] jottr: has joined #ruby
[15:42:06] troys: has joined #ruby
[15:47:17] konsolebox: has joined #ruby
[15:48:44] m27frogy: has joined #ruby
[15:49:35] bobix: has joined #ruby
[15:49:45] cagomez: has joined #ruby
[15:49:47] c0ncealed: has joined #ruby
[15:49:49] harryv: has joined #ruby
[15:49:52] bobix: hello everyone
[15:50:31] bobix: havenwood: hello my friend
[15:50:46] cagomez: has joined #ruby
[15:51:54] harryk_: has joined #ruby
[15:53:13] faces: has joined #ruby
[15:54:42] memo1: WhereIsMySpoon: thank you. Im checking on my server, and it has the ulimit set to umlimit
[15:55:09] [Butch]: has joined #ruby
[15:55:12] jcarl43: has joined #ruby
[15:55:23] jottr: has joined #ruby
[15:55:45] kapil___: has joined #ruby
[15:56:34] tvw: has joined #ruby
[16:01:50] eam: memo1: the ulimit for open files cannot be set to unlimited
[16:01:51] jottr: has joined #ruby
[16:02:48] eam: you can check the limit for a particular process via: cat /proc/$pid/limits
[16:03:42] eam: reasonable odds you have a descriptor leak in your app, which you would see by looking at lsof -p $pid -- examine if the descriptor table grows over time
[16:04:00] redlegion: has joined #ruby
[16:04:31] eam: ruby is especially prone to this kind of error as it's common to release an object to the gc which still has descriptors attached to it
[16:08:04] venmx: has joined #ruby
[16:10:21] dr3wo: has joined #ruby
[16:10:54] tolerablyjake: has joined #ruby
[16:10:58] synthroid: has joined #ruby
[16:11:48] jottr: has joined #ruby
[16:12:58] suukim: has joined #ruby
[16:14:24] jcarl43: has joined #ruby
[16:17:40] darkhanb: has joined #ruby
[16:18:50] ur5us: has joined #ruby
[16:18:52] ledestin: has joined #ruby
[16:19:25] conta: has joined #ruby
[16:20:30] eckhardt_: has joined #ruby
[16:21:56] apeiros: has joined #ruby
[16:21:56] jottr: has joined #ruby
[16:23:44] raynold: has joined #ruby
[16:30:00] guacamole: has joined #ruby
[16:32:26] graft: has joined #ruby
[16:33:54] nme13: has joined #ruby
[16:35:07] mjolnird: has joined #ruby
[16:36:06] jottr: has joined #ruby
[16:36:55] jyaworski: has joined #ruby
[16:37:02] nme13: is there a way to sort this by date ??? please > {2=>Fri, 19 Jan 2018 17:57:23 UTC +00:00, 1=>Tue, 27 Mar 2018 15:00:11 UTC +00:00, 4=>Fri, 19 Jan 2018 13:47:23 UTC +00:00}
[16:37:59] shuforov: has joined #ruby
[16:38:43] nme13: anybody here ?
[16:39:02] n008f4g_: has joined #ruby
[16:39:14] nme13: please I've found many way to sort hashes but it seems that none of them works
[16:39:34] nme13: I want to sort an hash that contains datetime value, by datetime
[16:39:38] apeiros: nme13: how are you currently doing it?
[16:39:45] apeiros: or, what's your current approach?
[16:39:59] SeepingN: has joined #ruby
[16:40:05] nme13: .sort_by{ |t| t[created_at] }
[16:40:23] schneider: has joined #ruby
[16:40:37] apeiros: that does not fit the hash you provided - does your real hash look differently from your example then?
[16:40:40] nme13: this hash contains ids and dates
[16:40:52] havenwood: nme13: And how does the result differ from your expectation?
[16:40:53] nme13: that's the result of .inspect
[16:41:20] apeiros: nme13: ok, sort_by will give you the key/value pair
[16:41:32] nme13: undefined method `created_at' for [2, Fri, 19 Jan 2018 17:57:23 UTC +00:00]:Array
[16:41:44] apeiros: so your_hash.sort_by { |_id, date| date } # => will return a sorted array
[16:41:57] apeiros: and to_h will turn that sorted array back into a hash
[16:42:15] havenwood: >> {}.sort_by(&:itself)
[16:42:16] ruby[bot]: havenwood: # => [] (https://eval.in/979570)
[16:42:19] havenwood: >> {}.sort_by(&:itself).to_h
[16:42:21] ruby[bot]: havenwood: # => {} (https://eval.in/979571)
[16:42:32] apeiros: havenwood: that'd sort by id first
[16:42:47] havenwood: apeiros: aye, not the best example given the context :-O
[16:43:11] nme13: I want to sort by date
[16:43:24] nme13: sort by the values
[16:43:35] havenwood: nme13: It seems you're already sorting by date, but as apeiros said you're missing a #to_h.
[16:43:51] havenwood: not the best example period
[16:44:09] apeiros: havenwood: worse, they don't understand their data structure :(
[16:44:24] nme13: {2=>Fri, 19 Jan 2018 17:57:23 UTC +00:00, 1=>Tue, 27 Mar 2018 15:00:11 UTC +00:00, 4=>Fri, 19 Jan 2018 13:47:23 UTC +00:00}
[16:44:38] nme13: no it's not sorting by date
[16:44:52] nme13: @listing.sort_by{ |_id, date| date }.to_h
[16:44:58] nme13: it does nothing
[16:45:09] apeiros: it *returns* a sorted hash
[16:45:21] apeiros: if you don't assign that return value anywhere, then yes, you're wasting what it does.
[16:45:57] apeiros: and yes, minutiae like this matter :-p you have to pay close attention to what people say when it's about programming.
[16:46:04] nme13: but it is sorting DESC
[16:46:20] apeiros: sort_by defaults to ascending order
[16:46:31] nme13: hum hum sry
[16:46:34] nme13: the contrary
[16:46:44] nme13: I need DESC order
[16:46:52] nme13: what should I use ?
[16:47:00] jottr: has joined #ruby
[16:47:01] apeiros: then I suggest you give it a try yourself first :)
[16:47:07] nme13: I saw a "-1" somewhere when sorting to reverse
[16:47:29] apeiros: you can negate numeric values, yes
[16:48:03] apeiros: that'll reverse the sort order. so how do you get from datetime to numeric?
[16:48:05] fhmax: has joined #ruby
[16:49:26] nme13: just use .reverse on the array before casting to hash
[16:50:10] apeiros: there's no casting in ruby. but yes. that's another approach.
[16:50:18] apeiros: for this case it might even be the fastest.
[16:50:27] zerowolfgang: has joined #ruby
[16:50:54] claudiuinberlin: has joined #ruby
[16:50:58] apeiros: nme13: shameless plug, you can also use https://github.com/apeiros/sorting
[16:51:06] tomphp: has joined #ruby
[16:51:32] apeiros: and then it's just: your_hash.sort_by { |_, date| desc(date) }
[16:52:07] guacamole: has joined #ruby
[16:52:08] guacamole: has joined #ruby
[16:52:21] sanscoeur: has joined #ruby
[16:53:38] rshetty: has joined #ruby
[16:55:50] nme13: now that I have my hash I dont know how to get the key from it
[16:56:27] nme13: oh I think I found it :)
[16:56:51] dionysus69: has joined #ruby
[17:02:28] phaul: what's the current O runtime on Hash operations? is lookup O(n)?!
[17:05:09] justinmcp: has joined #ruby
[17:05:20] rsh: has joined #ruby
[17:07:45] havenwood: phaul: https://blog.heroku.com/ruby-2-4-features-hashes-integers-rounding#hash-changes
[17:08:56] pilne: has joined #ruby
[17:09:14] phaul: havenwood: thanks, reading ..
[17:11:38] larcara: has joined #ruby
[17:11:58] \void: has joined #ruby
[17:12:09] apeiros: phaul: lookup and insertion is amortized O(1)
[17:12:10] einarj: has joined #ruby
[17:13:00] apeiros: everything which loops is obviously at least O(n). sorting requires working on all values, so it doesn't differ from other collection classes and is O(nlogn)
[17:13:41] alfiemax: has joined #ruby
[17:14:58] larcara: has joined #ruby
[17:17:19] jyaworski: has joined #ruby
[17:19:06] karapetyan: has joined #ruby
[17:20:01] Nahra: has joined #ruby
[17:20:46] rshetty: has joined #ruby
[17:21:00] rshetty: has joined #ruby
[17:21:02] tomphp: has joined #ruby
[17:23:06] FrostCandy: has joined #ruby
[17:24:01] Silthias: has joined #ruby
[17:24:22] nowhere_man: has joined #ruby
[17:24:25] phaul: not entirely clear on what happens on the collision. So you start a second level of hashing with the unsused bits of key.hash. but even that can start collliding after a while?
[17:25:17] phaul: or is that recursive, and whenever you collide you introduce a new level?
[17:25:18] larcara: has joined #ruby
[17:26:09] imode: has joined #ruby
[17:27:38] Cybergeek: has joined #ruby
[17:29:18] phaul: or the size with the second level is such that you practically can't exhaust it
[17:29:46] jyaworski: has joined #ruby
[17:31:48] jottr: has joined #ruby
[17:32:37] jenrzzz: has joined #ruby
[17:32:37] jenrzzz: has joined #ruby
[17:35:03] ldepandis: has joined #ruby
[17:35:10] dextrey: has joined #ruby
[17:36:19] RougeR: has joined #ruby
[17:36:19] jcarl43: has joined #ruby
[17:40:41] dr3wo: has joined #ruby
[17:41:16] jottr: has joined #ruby
[17:44:06] biberu: has joined #ruby
[17:44:38] apeiros: phaul: hashmaps in general or ruby's implementation?
[17:45:20] phaul: ruby's implementation
[17:45:46] apeiros: hm, ok, with the recent changes I'm not sure which strategy ruby currently uses, so can't tell.
[17:46:03] phaul: Im reading st.c atm, the comment at the top seems pretty useful
[17:46:48] bmurt: has joined #ruby
[17:46:55] ramfjord: has joined #ruby
[17:49:21] sleepee: has joined #ruby
[17:51:32] sameerynho: has joined #ruby
[17:57:15] alfiemax: has joined #ruby
[17:58:36] synthroid: has joined #ruby
[17:59:18] sleepee: has joined #ruby
[17:59:36] clemens3: has joined #ruby
[17:59:58] jottr: has joined #ruby
[18:07:30] jottr: has joined #ruby
[18:11:08] phaul: I *think* I have a vague understanging of this now. so it's 2 levels. but you have many bins.
[18:12:10] phaul: also If my understanding is correct if key.hash collides than you are in trouble :)
[18:13:08] nowhereman: has joined #ruby
[18:13:54] Lytol: has joined #ruby
[18:14:12] alfiemax: has joined #ruby
[18:15:29] chouhoul_: has joined #ruby
[18:16:44] ur5us: has joined #ruby
[18:16:56] phaul: the second level of hash can cover all possible bins that can fall out of key.hash
[18:19:25] Junaos: has joined #ruby
[18:20:42] jottr: has joined #ruby
[18:30:20] eljimmy: has joined #ruby
[18:30:54] dionysus69: has joined #ruby
[18:32:38] okinomo: has joined #ruby
[18:33:32] jottr: has joined #ruby
[18:46:56] jenrzzz: has joined #ruby
[18:46:56] jenrzzz: has joined #ruby
[18:47:37] jottr: has joined #ruby
[18:48:04] kapil___: has joined #ruby
[18:49:48] Guest34314: has joined #ruby
[18:51:43] alfiemax: has joined #ruby
[18:56:15] larcara: has joined #ruby
[18:56:41] larcara: has joined #ruby
[18:57:19] graft: has joined #ruby
[18:57:59] alfiemax: has joined #ruby
[18:58:27] graft: phaul: not sure if someone answered this, but it's not O(n), it's more like O(1)
[18:59:57] jottr: has joined #ruby
[19:13:57] jenrzzz: has joined #ruby
[19:13:57] jenrzzz: has joined #ruby
[19:18:44] rsh: has joined #ruby
[19:19:41] cagomez: has joined #ruby
[19:23:11] jottr: has joined #ruby
[19:24:11] pior: has joined #ruby
[19:24:55] moei: has joined #ruby
[19:27:16] riotjoe: has joined #ruby
[19:28:01] safetypin: has joined #ruby
[19:29:56] jottr: has joined #ruby
[19:30:28] duderonomy: has joined #ruby
[19:31:41] guacamole: has joined #ruby
[19:31:41] guacamole: has joined #ruby
[19:35:05] eckhardt_: has joined #ruby
[19:36:39] Cavallari: has joined #ruby
[19:37:57] reber: has joined #ruby
[19:40:26] jottr: has joined #ruby
[19:42:00] tomphp: has joined #ruby
[19:42:24] cagomez: has joined #ruby
[19:43:15] duderonomy: has joined #ruby
[19:45:02] cloaked1: has joined #ruby
[19:45:02] cloaked1: has joined #ruby
[19:45:17] alfiemax: has joined #ruby
[19:56:13] cagomez: has joined #ruby
[19:56:15] moei: has joined #ruby
[19:57:29] synthroid: has joined #ruby
[19:58:14] alfiemax: has joined #ruby
[19:59:51] n0m4d1c: has joined #ruby
[19:59:54] darkhanb: has joined #ruby
[20:00:21] herbmillerjr: has joined #ruby
[20:02:39] sparrk: has joined #ruby
[20:04:37] cdg: has joined #ruby
[20:05:46] darkhanb: has joined #ruby
[20:06:36] cdg_: has joined #ruby
[20:06:36] memo1: has joined #ruby
[20:10:59] tomphp: has joined #ruby
[20:12:53] cschneid: has joined #ruby
[20:14:33] ur5us: has joined #ruby
[20:18:21] Ryzokuken: has joined #ruby
[20:18:33] ramfjord: has joined #ruby
[20:21:05] tao_: has joined #ruby
[20:21:42] apeiros: has joined #ruby
[20:21:53] cagomez: has joined #ruby
[20:24:53] einarj: has joined #ruby
[20:25:43] chouhoulis: has joined #ruby
[20:26:08] einarj: has joined #ruby
[20:29:27] phaul: graft: yes, I was afk for a bit. Thanks
[20:30:35] eckhardt_: has joined #ruby
[20:31:44] einarj: has joined #ruby
[20:33:57] einarj: has joined #ruby
[20:38:08] synthroid: has joined #ruby
[20:38:10] jottr: has joined #ruby
[20:39:54] tomphp: has joined #ruby
[20:42:47] darkhanb: has joined #ruby
[20:47:32] wdfsdf: has joined #ruby
[20:49:36] apeiros: has joined #ruby
[20:50:03] guacamole: has joined #ruby
[20:50:04] guacamole: has joined #ruby
[20:57:53] Guest32161: has joined #ruby
[20:59:24] John_Ivan: has joined #ruby
[20:59:24] John_Ivan: has joined #ruby
[21:04:36] rahul_bajaj: has joined #ruby
[21:04:36] xuanrui: has joined #ruby
[21:07:32] rabajaj: has joined #ruby
[21:07:51] tomphp: has joined #ruby
[21:10:28] claudiuinberlin: has joined #ruby
[21:11:26] jottr: has joined #ruby
[21:12:37] Azure: has joined #ruby
[21:16:24] tomphp: has joined #ruby
[21:17:50] jyaworski: has joined #ruby
[21:20:19] nowhere_man: has joined #ruby
[21:23:21] fox_mulder_cp: has joined #ruby
[21:24:11] eckhardt_: has joined #ruby
[21:24:18] Omnilord: has joined #ruby
[21:24:24] fox_mulder_cp: how i can proper implement #each for my plain ruby object in array? now it have exeption for [] method
[21:26:03] phaul: fox_mulder_cp: sorry but your question is hard to understand. Do you want each method on the array or on the object inside the array. If so what is the type of that object?
[21:26:43] phaul: can you give us a code example?
[21:26:46] zenspider: "plain ruby object" ... all ruby objects are plain ruby objects
[21:27:17] apeiros: zenspider: he's from rails. IME they talk about "plain ruby objects" meaning "not an AR model"
[21:27:38] apeiros: (since most stuff every & all logic into models)
[21:27:40] zenspider: yeah. I don't care for the distinction. it's meaningless. AR models are also plain ruby objects.
[21:27:48] zenspider: fox_mulder_cp: making assumptions about what you want... class X... def each; @my_collection.each do |o| ... end end end
[21:28:01] zenspider: it just comes from that java POJO bullshit
[21:28:12] harrycs: has joined #ruby
[21:28:18] zenspider: and it makes more sense there... not everything is an object
[21:28:48] apeiros: zenspider: why not &block and pass that on? a) faster, b) gives you enum semantics for free
[21:29:17] zenspider: apeiros: it depends on what he wants to do. might need extra accounting, etc.
[21:29:28] zenspider: but sure. at that point, I'd prolly just do a delegator
[21:29:32] apeiros: you mean if there's code in the block? then yes, sure
[21:29:43] zenspider: tho, I find the delegation code a bit clunky. or at least, the doco
[21:30:00] harryv: has joined #ruby
[21:30:12] apeiros: for some irrational reason I rarely ever use Forwardable (and even less Delegator/SimpleDelegator)
[21:34:17] phaul: fox_mulder_cp: do a gist of a minimal example of what you want ..
[21:38:36] zenspider: don't you love it when ppl ask questions and then seemingly walk away...?
[21:38:57] tomphp: has joined #ruby
[21:39:33] fox_mulder_cp: in some countries of third wotld we have a shit of wifi L)
[21:41:01] fox_mulder_cp: gist of class here https://gist.github.com/foxmuldercp/8b61b5bcc641f3ca512ca6c0f41ff3c1
[21:42:00] jaequery: has joined #ruby
[21:42:22] dr3wo: has joined #ruby
[21:42:31] zenspider: fox_mulder_cp: don't modify someone else's data on line 9
[21:42:59] zenspider: line 21, 'self.each' would be recursive. you want to call each on your actual collection
[21:43:06] fox_mulder_cp: so how i can pass it as default?
[21:43:17] fox_mulder_cp: zenspider: so how i can implement it properly?
[21:43:30] zenspider: fox_mulder_cp: || would work fine on line 9. you don't need to modify the incoming arg
[21:43:47] schneider: has joined #ruby
[21:44:20] fox_mulder_cp: zenspider: and what about each emplementation?
[21:45:48] fox_mulder_cp: i don't know properly implement some for collection when user it as arr = [Record.new(), Record.new(),..]
[21:48:31] jottr: has joined #ruby
[21:48:50] zenspider: fox_mulder_cp: how does the content of the collection matter in this case?
[21:50:05] fox_mulder_cp: for #to_json mapped, in main use case, for mapping data to external api
[21:53:00] zenspider: I think we're hitting a language barrier here... to_json isn't in play here. We're not talking about json as far as I can tell... we're talking about defining #each to work properly.
[21:54:31] fox_mulder_cp: i create gem for powerdns, and i need map domain zone json to ruby object structure
[21:55:49] zenspider: by the time you're calling #each on your W3dns::Record object, your collection should already be translated from json to ruby objects
[21:55:54] zenspider: each shouldn'd DO anything but enumerate
[21:56:05] zenspider: json parsing should be as far away from it as possible
[21:57:00] fox_mulder_cp: zenspider: i need reverse mapping. from json all ok. but into json
[21:57:36] zenspider: dude. no. each is each. it isn't ANYTHING ELSE
[21:58:12] zenspider: if you can't let go of the json thing here and now, I'm done. implement each. implement to_json, implement parsing from json into your Record. They do NOT mix
[21:59:08] fox_mulder_cp: zenspider: i have deep loop exeption when try to use #each for self..
[21:59:28] zenspider: I already pointed out that you're recursively calling each
[21:59:35] zenspider: that has NOTHING to do with json
[21:59:39] fox_mulder_cp: so i need it proper implementation
[21:59:52] fox_mulder_cp: zenspider: shit. drop to_json. i needf #each
[22:00:31] zenspider: once again... read my original suggestion.
[22:00:56] zenspider: this is wandering into help vampire territory. I carry stakes and holy water for just this reason...
[22:02:12] fox_mulder_cp: i need for ideas for proper implementation of #each to my object with two props. english in not my native.
[22:02:35] icarus: has joined #ruby
[22:03:02] phaul: fox_mulder_cp: so you want each to iterate both @content and @disabled ? are those arrays?
[22:04:11] fox_mulder_cp: @content and @disabled are strings. i need do some with array od W3dns::Record.neODODODODODODODODODODODODODODw
[22:05:12] phaul: sorry. I cannot help
[22:05:22] zenspider: they're NOT strings. line 9 is clearly boolean (at least for false)
[22:06:09] icarus: hello all, I'm looking at 'net/ssh', attempting to use ssh.exec! to issue a command on a remote server, however it is one that requires :RequestTTY => force, but this isn't an option for Net::SSH (http://www.rubydoc.info/github/net-ssh/net-ssh/Net/SSH); Does anyone have any recommendations for executing "ssh -ttt" commands via ruby?
[22:06:12] zenspider: and while content is named such that it can be a collection, disabled is not. it is a bool-like thing
[22:06:23] fox_mulder_cp: zenspider: it's not critical now
[22:06:33] icarus: I appreciate any input, thank you!
[22:06:52] zenspider: icarus: meaning the command you want to run requires a TTY connection?
[22:07:56] icarus: zenspider: correct! (:config doesnt register an entry in ~/.ssh/config for RequestTTY either)
[22:08:31] tdy: has joined #ruby
[22:10:36] zenspider: man rubydoc.info is an unusuable mess.
[22:10:59] icarus: im also looking here: https://net-ssh.github.io/net-ssh/classes/Net/SSH/Connection/Session.html
[22:11:03] zenspider: last time I had problems with net/ssh I wound up creating Rake::RemoteTask... so... this might still be a problem
[22:11:29] iszak: has joined #ruby
[22:12:38] zenspider: ok. grabbed it and grepped around. looks like you might want request_pty via ssh.open_channel
[22:12:50] zenspider: `gem which ssh/connection/channel`
[22:12:58] zenspider: as in: emacs -q `gem which ssh/connection/channel`
[22:13:18] eckhardt_: has joined #ruby
[22:14:41] icarus: zenspider: thanks for the assist, ill read up
[22:15:04] SeepingN: Ruby Net:SSH is a PITA
[22:15:26] SeepingN: In general it's easy, but when you have anything different than the default settins they must test against, good luck
[22:15:42] SeepingN: I have some really horrible hax
[22:15:59] icarus: SeepingN: do you happen to know of any good alternatives? (yeah, in this case i just need the equivalent of "ssh -t" hah)
[22:16:26] SeepingN: like when I tell the remove device to hang up (drop the tunnel, forced), it just stops responding. I have to look for a key phrase and wait 10 seconds and force hard disconnect to move on
[22:16:31] zenspider: and to be clear. Rake::RemoteTask works well, but is more meant for running against N machines and the like. it's very specific about what it is for
[22:17:21] jyaworski: has joined #ruby
[22:17:31] zenspider: icarus: https://net-ssh.github.io/ssh/v1/chapter-5.html
[22:17:56] SeepingN: those docs are so unfinished
[22:18:05] jeffreylevesque: has joined #ruby
[22:18:11] SeepingN: not to mention 11 years out of date
[22:18:16] zenspider: seems so low level... it's just gross
[22:18:42] zenspider: ya know... maybe you want to use expect.rb and a plain popen (or open3) to ssh?
[22:18:51] zenspider: it depends on what you're actually trying to do
[22:19:01] SeepingN: yeah I had ssh.start and ssh.exec! at first. had to move on to using channels for several things to work right
[22:19:18] SeepingN: I wasted weeks playing with popen/open3/some other obscure open
[22:19:20] zenspider: 72 lines of goodness... damn that thing is impressive
[22:19:35] icarus: yea see rake has something like this: "set :ssh_flags, %w[-l joe -p 2000]" thats a lot more convenient
[22:21:14] zenspider: you mean like this? http://docs.seattlerb.org/rake-remote_task/
[22:21:34] jottr: has joined #ruby
[22:21:35] zenspider: icarus: depending on what you want... I'd probably steer you towards open3 + expect.rb + IO#expect
[22:22:22] zenspider: does this not work?
[22:22:30] zenspider: Net::SSH.start( 'localhost' ) do |session| shell = session.shell.open( :pty => true ) ... end
[22:22:55] zenspider: (honestly I have no idea--I left net/ssh out of hate probably a decade ago)
[22:23:26] icarus: "undefined local variable or method `session' for main:Object (NameError)"
[22:23:39] icarus: does it not exist in net/ssh anymore?
[22:23:52] icarus: I might be leaving it in a few minutes for the same reasons :)
[22:23:53] zenspider: ugh. fuck me. no clue
[22:24:02] zenspider: what do you want to do?
[22:24:58] icarus: im putting an ssh wrapper together to run certain commands on remote servers, behind sinatra/nginx
[22:25:35] icarus: I was handed some endpoints that have broken rpc endpoints, but they still work locally (yea, im hacking it together, but hey its gotta be up asap)
[22:25:38] fox_mulder_cp: icarus: use ansible $)
[22:26:03] fox_mulder_cp: i use ansible for controlling my nodes from rails app
[22:26:39] bmurt: has joined #ruby
[22:27:44] SeepingN: Net::SSH.start( emuip, "username", :password => pw, :timeout => 8, :verify_host_key => Net::SSH::Verifiers::Null.new ) do |ssh|
[22:29:27] zenspider: icarus: if that's all you want to do, then Rake::RemoteTask might actually be perfect for you.
[22:29:37] icarus: zenspider: yeah i think so
[22:29:45] zenspider: lemme know...
[22:30:03] zenspider: ACTION goes back to hacking on emacs & enh-ruby-mode...
[22:30:08] SeepingN: I had some strange pty issues initially but don't call out anything specifc for it now
[22:30:20] SeepingN: what happens in your case?
[22:36:53] mojtaba: has joined #ruby
[22:55:17] mojtaba: has joined #ruby
[22:58:13] troulouliou_div2: has joined #ruby
[22:59:12] sanscoeur: has joined #ruby
[23:10:40] Lytol: has joined #ruby
[23:10:48] RougeR: has joined #ruby
[23:12:27] icarus: zenspider: exec ( "ssh -q -t ..." ) is winner winner chicken dinner
[23:12:33] icarus: i really over thought that one
[23:14:09] duderonomy: has joined #ruby
[23:14:15] ecuanaso: has joined #ruby
[23:18:09] cschneid: has joined #ruby
[23:25:34] rahul_bajaj: has joined #ruby
[23:26:27] SeepingN: I had to do that
[23:26:35] SeepingN: in the same script I use other ssh calls
[23:26:58] shinnya: has joined #ruby
[23:27:07] SeepingN: some weirdo proprietary server that just wouldn't work with net:ssh. gave up, made a file of commands to execute, and pass them to commandline ssh. pretty lame
[23:28:17] rabajaj: has joined #ruby
[23:29:03] cschneid: has joined #ruby
[23:30:05] eam: SeepingN: shelling out to the openssh binary is a pretty regular thing -- none of the ssh libraries (libssh2) have a full authentication featureset
[23:30:29] SeepingN: ah yes, that was it. it didn't like any of our authentication attempts
[23:30:53] eam: you might try this gem for managing ssh jobs https://rubygems.org/gems/mssh
[23:31:12] eam: does parallelism, timeouts, and wraps bin/ssh with the default batch-oriented options you probably want
[23:32:40] eam: the killer feature which keeps us from using libssh2 implementations is lack of kerberos support
[23:36:23] nowhereman: has joined #ruby
[23:38:21] zenspider: that looks nice. I especially like the -c flog
[23:38:27] zenspider: flag. ... wow muscle memory...
[23:40:25] clemens3: has joined #ruby
[23:44:32] mojtaba: has joined #ruby
[23:44:46] Psybur: has joined #ruby
[23:51:34] Strepsils: has joined #ruby
[23:52:17] minimalism: has joined #ruby
[23:53:36] morfin: has joined #ruby
[23:56:03] cagomez: has joined #ruby
[23:56:58] jottr: has joined #ruby
[23:58:11] phaul: some are more used to floggin' than anything else :D