« Back to channel list

#ruby - 01 March 2018

« Back 1 day Forward 1 day »
[00:00:44] tcopeland: has joined #ruby
[00:01:04] dmitriy_: has joined #ruby
[00:02:50] hahuang65: has joined #ruby
[00:13:53] orbyt_: has joined #ruby
[00:14:49] karapetyan: has joined #ruby
[00:15:57] cpruitt: has joined #ruby
[00:17:07] c0ncealed: has joined #ruby
[00:21:54] karapetyan: has joined #ruby
[00:23:03] yonahw_: has joined #ruby
[00:25:03] nowhere_man: has joined #ruby
[00:25:32] rgiscard: has joined #ruby
[00:27:10] GodFather: has joined #ruby
[00:34:01] achen: has joined #ruby
[00:40:12] hahuang65: has joined #ruby
[00:41:43] cschneid: has joined #ruby
[00:45:13] John_Ivan: has joined #ruby
[00:45:14] John_Ivan: has joined #ruby
[00:45:36] chat: has joined #ruby
[00:46:41] cdg: has joined #ruby
[00:56:53] arescorpio: has joined #ruby
[00:57:16] orbyt_: has joined #ruby
[00:58:57] fyrril: has joined #ruby
[00:59:37] bosma: has joined #ruby
[01:04:16] howdoi: has joined #ruby
[01:13:22] orbyt_: has joined #ruby
[01:14:58] drewmcmillan: has joined #ruby
[01:21:21] hahuang65: has joined #ruby
[01:23:23] hahuang65: has joined #ruby
[01:40:09] achen: has joined #ruby
[01:41:20] achen: has joined #ruby
[01:41:29] dviola: has joined #ruby
[01:41:51] Puffball: has joined #ruby
[01:42:19] achen: has joined #ruby
[01:43:39] achen: has joined #ruby
[01:44:53] achen: has joined #ruby
[01:45:53] bkxd: has joined #ruby
[01:49:53] chouhoulis: has joined #ruby
[01:50:48] chouhoul_: has joined #ruby
[01:51:29] alfiemax: has joined #ruby
[01:51:58] chouhoul_: has joined #ruby
[01:53:05] chouhoul_: has joined #ruby
[01:53:33] Tempesta: has joined #ruby
[01:53:33] Tempesta: has joined #ruby
[01:54:05] chouhoul_: has joined #ruby
[01:55:11] chouhoulis: has joined #ruby
[01:55:18] sanscoeur: has joined #ruby
[01:56:38] chouhoul_: has joined #ruby
[01:57:20] chouhoul_: has joined #ruby
[01:58:28] chouhoul_: has joined #ruby
[01:59:33] chouhoul_: has joined #ruby
[02:00:38] chouhoulis: has joined #ruby
[02:01:44] chouhoul_: has joined #ruby
[02:02:13] gizmore|2: has joined #ruby
[02:02:52] chouhoul_: has joined #ruby
[02:03:57] chouhoul_: has joined #ruby
[02:05:00] chouhoul_: has joined #ruby
[02:06:12] chouhoulis: has joined #ruby
[02:07:11] chouhoul_: has joined #ruby
[02:07:28] scrptktty_: has joined #ruby
[02:08:22] chouhoul_: has joined #ruby
[02:08:40] jeffreylevesque: has joined #ruby
[02:09:27] chouhoul_: has joined #ruby
[02:10:31] chouhoul_: has joined #ruby
[02:11:34] chouhoulis: has joined #ruby
[02:11:48] kapil___: has joined #ruby
[02:12:41] chouhoul_: has joined #ruby
[02:13:41] alfiemax: has joined #ruby
[02:13:46] chouhoul_: has joined #ruby
[02:14:02] hahuang65: has joined #ruby
[02:14:52] chouhoul_: has joined #ruby
[02:15:58] chouhoul_: has joined #ruby
[02:16:55] baweaver: !connection chouhoulis
[02:16:55] ruby[bot]: +bbbb chouhoulis!*@*$#ruby-fix-your-connection chouhoul_!*@*$#ruby-fix-your-connection chouhou__!*@*$#ruby-fix-your-connection chouho___!*@*$#ruby-fix-your-connection
[02:17:11] ruby[bot]: +bbb chouh____!*@*$#ruby-fix-your-connection chou_____!*@*$#ruby-fix-your-connection *!*@50-207-64-46-static.hfc.comcastbusiness.net$#ruby-fix-your-connection
[02:17:11] ruby[bot]: ruby[bot] kicked chouhoul_: join/part detected
[02:17:11] ruby[bot]: ruby[bot] kicked chouhou__: join/part detected
[02:17:11] ruby[bot]: ruby[bot] kicked chouho___: join/part detected
[02:17:12] ruby[bot]: ruby[bot] kicked chouh____: join/part detected
[02:17:55] xcesariox: has joined #ruby
[02:18:19] hahuang65: has joined #ruby
[02:20:51] cdg: has joined #ruby
[02:22:31] segy: has joined #ruby
[02:28:18] logoscoder: has joined #ruby
[02:33:46] cpruitt: has joined #ruby
[02:35:15] parsnip0: has left #ruby: ()
[02:35:22] keithy: has joined #ruby
[02:35:57] keithy: hello I am looking for the best way to run remote ssh commands , and collect the output, possibly as rak tasks
[02:36:19] keithy: so far I have found net::ssh::shell
[02:36:35] keithy: does anyone have any other suggestions?
[02:36:52] keithy: I havent quite got the hang of net::ssh::shell
[02:40:54] pastorinni: has joined #ruby
[02:41:52] keithy: I tried an on_output callback but it goes into an endless loop
[02:43:13] achen: has joined #ruby
[02:43:30] dinfuehr: has joined #ruby
[02:48:35] bkxd: has joined #ruby
[02:50:42] sleetdrop: has joined #ruby
[02:51:09] xcesariox: has joined #ruby
[02:51:24] AndBobsYourUncle: has joined #ruby
[02:52:42] sleetdrop: has joined #ruby
[02:55:32] xcesariox: has joined #ruby
[02:57:44] keithy: whatever happened to documentation!
[02:58:48] houhoulis: has joined #ruby
[03:00:06] gizmore: has joined #ruby
[03:01:56] hahuang65: has joined #ruby
[03:03:23] keithy: its beyond my ken
[03:04:06] keithy: if anyone can understand how to collect output from net-ssh-shell and go onto the next command
[03:06:48] keithy: putting on_output ruins something
[03:08:29] sleetdrop: has joined #ruby
[03:12:00] hahuang65: has joined #ruby
[03:13:08] xcesariox: has joined #ruby
[03:14:41] keithy: the shell stays logged in! until you do an exit.
[03:16:04] keithy: im going to use bash
[03:16:17] kn-928: has joined #ruby
[03:16:17] alfiemax: has joined #ruby
[03:21:26] keithy: ill ask again about this in the morning
[03:24:26] Iambchop: keithy: https://github.com/capistrano/sshkit
[03:25:07] Iambchop: (I haven't used sshkit; I have used net-ssh)
[03:25:35] keithy: now i have heard of capistrano!
[03:26:03] keithy: something was vs capistrano...
[03:31:59] Iambchop: I've also seen, but not used: https://github.com/duke-automation/net-ssh-telnet
[03:32:45] keithy: using net-ssh-shell I am strucggling to see how a command execution finishes
[03:32:47] cschneid: has joined #ruby
[03:32:51] keithy: and hands over to the next comand
[03:33:21] keithy: ive got a callback to grab the output (cant understand why a simple usecase is not documented
[03:33:54] bkxd: has joined #ruby
[03:34:54] keithy: capistrano looks like it migh be good for my usecase
[03:35:36] Iambchop: The SyncShell service allows you to execute commands on the shell and block until they finish https://net-ssh.github.io/ssh/v1/chapter-5.html#s4
[03:36:34] Iambchop: (oh that's an old version docs though)
[03:39:12] Iambchop: if you have a little use case to demonstrate, you can post a gist here later
[03:39:58] keithy: not sure about capistrano
[03:41:06] govg: has joined #ruby
[03:41:29] Iambchop: updated docs: http://net-ssh.github.io/net-ssh/Net/SSH/Connection/Session.html#method-i-exec-21 exec!() Same as exec, except this will block until the command finishes.
[03:42:47] dessm: has joined #ruby
[03:46:13] hahuang65: has joined #ruby
[03:46:52] cpruitt: has joined #ruby
[03:47:00] dessm: Good evening. I've been wondering about the following: Often times when dealing with external APIs I'll get back some rather large JSON payload which I then parse into a Ruby hash. Usuallly I need specific parts of that hash so I might make a bunch of new hashes like: random_hash = payload[:some_key][:another_key] etc. Now the problem that I run into is that I need to transform that data. But when I modify the new hashes random_hash
[03:47:00] dessm: changes as well. I'd like to keep the original payload around without modifying it, so I usually marshal dump/load the new hashes before modifying them. This seems absurdly kludgy and leads me to believe that I'm somehow approaching the problem in a wholly un-Rubyesque way. What is the Ruby way to handle this situation?
[03:47:09] keithy: you know what I think bash is so much simpler
[03:48:31] keithy: put together a bash script using “sub” to roll several commands into one. script A, checks out code with git, checks out deploy bash scripts , rsyncs them up to the server and then ou can run the scripts there!
[03:51:52] alfiemax: has joined #ruby
[03:54:36] dinfuehr: has joined #ruby
[03:55:10] cpruitt: has joined #ruby
[03:56:24] Iambchop: keithy: for future reference https://gist.github.com/Iambchop/5e4b30c874f1ed62eb1c3b4388fd85c2
[03:56:28] lupine: has joined #ruby
[03:56:28] sanscoeur: has joined #ruby
[03:56:29] darkhanb: has joined #ruby
[03:57:01] qyliss: has joined #ruby
[03:57:29] Iambchop: dessm: can you post a simple gist with sample pre/post data?
[03:58:44] aspiers: has joined #ruby
[03:59:41] achen: has joined #ruby
[04:00:50] hahuang65: has joined #ruby
[04:01:18] Radar: has joined #ruby
[04:07:43] alfiemax: has joined #ruby
[04:07:57] dtzuzu: has joined #ruby
[04:10:29] guacamole: has joined #ruby
[04:10:29] guacamole: has joined #ruby
[04:10:51] memo1: has joined #ruby
[04:11:37] memo1: hi, how i set irb configs, like identation on loops
[04:12:17] cdg: has joined #ruby
[04:14:21] cschneid: has joined #ruby
[04:14:39] cpruitt: has joined #ruby
[04:19:34] mrBen2k2k2k: has joined #ruby
[04:25:01] alfiemax: has joined #ruby
[04:25:15] trautwein: has joined #ruby
[04:27:57] gix-: has joined #ruby
[04:31:01] Iambchop: memo1: http://blog.luckyus.net/2008/05/14/auto-indent-in-irb/ ?
[04:31:02] Hanmac: has joined #ruby
[04:31:12] SirFunk: has joined #ruby
[04:31:24] Iambchop: http://tagaholic.me/2009/05/29/exploring-how-to-configure-irb.html
[04:33:46] cpruitt: has joined #ruby
[04:34:12] ramfjord: has joined #ruby
[04:36:44] iMadper`: has joined #ruby
[04:45:47] bkxd: has joined #ruby
[04:52:50] schneider: has joined #ruby
[04:54:02] meadmoon: has joined #ruby
[05:00:02] darkhanb: has joined #ruby
[05:01:17] kies: has joined #ruby
[05:02:36] cpruitt: has joined #ruby
[05:04:00] rippa: has joined #ruby
[05:06:53] memo1: Iambchop: thank you
[05:09:21] SirFunk: has joined #ruby
[05:14:18] anisha: has joined #ruby
[05:20:41] cpruitt: has joined #ruby
[05:24:17] Uptime: has joined #ruby
[05:29:56] iMadper`: has joined #ruby
[05:36:12] jenrzzz: has joined #ruby
[05:36:37] sidx64: has joined #ruby
[05:37:57] strika: has joined #ruby
[05:39:32] alex``: has joined #ruby
[05:45:29] bkxd: has joined #ruby
[05:46:59] cpruitt: has joined #ruby
[05:50:25] xcesariox: has joined #ruby
[05:52:49] sanscoeur: has joined #ruby
[05:55:22] kenichi: has joined #ruby
[05:56:11] Liothen: has joined #ruby
[05:56:11] Liothen: has joined #ruby
[05:56:17] russt: has joined #ruby
[05:56:47] bmn: has joined #ruby
[06:13:00] schneider: has joined #ruby
[06:17:14] ledestin: has joined #ruby
[06:17:49] xt233: has joined #ruby
[06:18:32] xt233: has left #ruby: ()
[06:22:43] shalok: How can I capture by value instead of reference?: https://ideone.com/7Dycf0
[06:23:21] shalok: I want each thread to print the value of x at the time I defined the block.
[06:24:28] havenwood: shalok: All the threads are sleeping until well after the iteration is over.
[06:25:06] shalok: havenwood: Yes, I deliberately did this to illustrate the problem I'm trying to solve
[06:28:41] havenwood: shalok: One way to handle it is a thread local variable.
[06:28:52] shalok: https://ideone.com/TDszR6
[06:28:59] shalok: havenwood: Was just thinking the same thing ^
[06:29:04] havenwood: shalok: You'll get 2, 3, 4, 5, 6 for example if you change what you have to: Thread.new(x) { |x|
[06:29:17] shalok: Oh thread local...
[06:29:32] shalok: Isn't just a regular local good enough
[06:29:37] shalok: like in my example
[06:29:57] shalok: x2 only exists in the block so each thread will get it's own copy
[06:30:14] shalok: should work fine for anything I can copy
[06:30:40] havenwood: It's clearer to use a thread local variable, which is meant for this.
[06:31:02] havenwood: shalok: if you like: Thread.new(x) { |x2|
[06:32:36] havenwood: shalok: We might be able to give better suggestions if you have more realistic code.
[06:33:00] shalok: actually I think your suggestion is exactly what I was looking for
[06:34:00] ramfjord: has joined #ruby
[06:37:50] havenwood: shalok: I'm tired, they're just local variables, not thread variables. The block form is nice.
[06:39:46] aguestuser: has joined #ruby
[06:40:26] shalok: Is it possible to use blocks to isolate the scope of variables?: https://ideone.com/FyGdQx
[06:40:47] havenwood: shalok: try defining the variable before the block
[06:40:55] kapil___: has joined #ruby
[06:41:35] shalok: havenwood: Well my goal is that the variable should not be visible outside the block
[06:41:49] shalok: havenwood: But for some reason the interpreter is rejecting that syntax
[06:42:29] shalok: Is is possible to create blocks that aren't an argument to a loop or function call?
[06:43:18] havenwood: shalok: A proc is like a block that actually exists as an object. Blocks are a fancy way to not actually create an object.
[06:43:36] havenwood: >> ->{ :ok }.class
[06:43:37] ruby[bot]: havenwood: # => Proc (https://eval.in/964809)
[06:43:43] havenwood: >> ->{ :ok }.lambda
[06:43:44] ruby[bot]: havenwood: # => private method `lambda' called for #<Proc:0x41411ba8> ...check link for more (https://eval.in/964810)
[06:43:46] havenwood: >> ->{ :ok }.lambda?
[06:43:47] ruby[bot]: havenwood: # => true (https://eval.in/964812)
[06:43:51] havenwood: >> ->{ :ok }.call
[06:43:52] ruby[bot]: havenwood: # => :ok (https://eval.in/964813)
[06:44:15] havenwood: shalok: Look into lambdas and procs.
[06:44:24] havenwood: shalok: That's a "stabby lambda" above.
[06:44:36] havenwood: -> arg { block }.call
[06:44:49] LocaMocha: has joined #ruby
[06:45:04] shalok: havenwood: btw, what's the difference between the Thread.new block form and thread variables?
[06:45:24] havenwood: shalok: The block form does exactly what you're wanting to do.
[06:45:39] shalok: havenwood: The arguments to the block will only be visible to the thread. How is this different from thread variables?
[06:45:44] havenwood: shalok: Thread variables are thread-specific and can be queried from a dead thread.
[06:45:47] shalok: havenwood: Yup I know. Was just curious.
[06:46:14] havenwood: shalok: https://www.rubytapas.com/2016/11/20/ruby-thread-local-variables/
[06:48:27] cdg: has joined #ruby
[06:48:48] sidx64: has joined #ruby
[06:50:05] LocaMocha: has joined #ruby
[06:53:42] sanscoeur: has joined #ruby
[07:01:34] SuperLag: has joined #ruby
[07:02:11] Layonthese: has joined #ruby
[07:02:48] Layonthese: anyone here who might help me with a problem while running a ruby script?
[07:06:53] eam: Layonthese: don't ask to ask, just ask. what's your issue?
[07:09:53] n008f4g_: has joined #ruby
[07:09:54] Uptime: has joined #ruby
[07:14:47] axion: has joined #ruby
[07:16:03] Layonthese: has joined #ruby
[07:30:04] darkhanb: has joined #ruby
[07:32:06] bkxd: has joined #ruby
[07:34:32] conta: has joined #ruby
[07:36:24] sidx64: has joined #ruby
[07:37:39] andikr: has joined #ruby
[07:41:42] sidx64: has joined #ruby
[07:42:31] schneider: has joined #ruby
[07:46:00] vondruch: has joined #ruby
[07:47:08] vondruch: has joined #ruby
[07:51:35] eam: Layonthese: ask in the channel, not via privmsg
[07:57:23] KeyJoo: has joined #ruby
[07:59:42] soniya29: has joined #ruby
[07:59:43] soniya29_: has joined #ruby
[08:02:14] sidx64: has joined #ruby
[08:05:00] dionysus69: has joined #ruby
[08:05:49] jokke: has joined #ruby
[08:13:28] clemens3: has joined #ruby
[08:17:59] TomyWork: has joined #ruby
[08:19:03] SirFunk: has joined #ruby
[08:19:45] aufi: has joined #ruby
[08:26:58] amatas: has joined #ruby
[08:28:09] guardian: has joined #ruby
[08:28:13] deathwishdave: has joined #ruby
[08:29:09] bigblind: has joined #ruby
[08:29:48] amelliaa: has joined #ruby
[08:31:40] roshanavand: has joined #ruby
[08:33:27] claudiuinberlin: has joined #ruby
[08:33:45] ramfjord: has joined #ruby
[08:37:48] jenrzzz: has joined #ruby
[08:37:48] jenrzzz: has joined #ruby
[08:40:25] schneider: has joined #ruby
[08:40:53] burgestrand: has joined #ruby
[08:41:39] aupadhye: has joined #ruby
[08:42:34] logoscoder: has joined #ruby
[08:46:29] mrBen2k2k2k_: has joined #ruby
[08:49:26] bkxd: has joined #ruby
[08:51:22] bigblind: has joined #ruby
[08:54:31] sanscoeur: has joined #ruby
[08:55:56] marr: has joined #ruby
[08:59:49] Pisuke: has joined #ruby
[09:00:00] Beams: has joined #ruby
[09:00:34] quobo: has joined #ruby
[09:01:56] drewmcmillan: has joined #ruby
[09:01:59] logoscoder_: has joined #ruby
[09:02:58] SirFunk: has joined #ruby
[09:05:29] willmichael: has joined #ruby
[09:05:47] burgestrand: has joined #ruby
[09:07:08] cschneid: has joined #ruby
[09:07:33] mikecmpbll: has joined #ruby
[09:10:08] Fusselgesicht: has joined #ruby
[09:17:54] moei: has joined #ruby
[09:18:46] ShekharReddy: has joined #ruby
[09:18:57] nadir: has joined #ruby
[09:19:28] sidx64: has joined #ruby
[09:22:22] sidx64: has joined #ruby
[09:26:03] apeiros: has joined #ruby
[09:28:32] phaul: has joined #ruby
[09:32:09] fribmendes: has joined #ruby
[09:33:39] cliq: has joined #ruby
[09:33:41] ramfjord: has joined #ruby
[09:35:44] sidx64: has joined #ruby
[09:36:27] guille-moe: has joined #ruby
[09:40:16] fullstack: has joined #ruby
[09:40:40] shoogz: has joined #ruby
[09:41:08] nfsnobody: has joined #ruby
[09:41:51] shoogz: has joined #ruby
[09:43:28] sidx64: has joined #ruby
[09:44:57] aufi_: has joined #ruby
[09:47:07] connor_goodwolf: has joined #ruby
[09:48:41] eroux: has joined #ruby
[09:53:44] connor_goodwolf: has joined #ruby
[09:53:55] mozzarella: has joined #ruby
[09:54:07] riotjones: has joined #ruby
[09:54:16] armyriad: has joined #ruby
[09:56:26] Blackraider: has joined #ruby
[09:57:34] jaruga: has joined #ruby
[10:04:43] Serpent7776: has joined #ruby
[10:07:45] soniya29: has joined #ruby
[10:08:05] soniya29_: has joined #ruby
[10:09:11] GodFather: has joined #ruby
[10:09:28] sidx64: has joined #ruby
[10:10:44] fribmendes: has joined #ruby
[10:11:43] karapetyan: has joined #ruby
[10:13:06] fribmendes: has joined #ruby
[10:13:46] dionysus69: is singleton class same as metaclass?
[10:14:26] apeiros: it's usually used interchangeably, yes
[10:14:46] apeiros: even though if you were pedantic, the terms mean different things
[10:14:52] dionysus69: ok cause I read two different articles and they used both of them, just made sure they were meaning the same :)
[10:15:33] apeiros: singleton class, metaclass and eigenclass usually refer to what you get from Object#singleton_class (or via `class << obj`)
[10:15:44] dionysus69: just explored metaprogramming, it's interesting but so far I didn't have a chance to use it in real life xD
[10:16:13] mtkd: has joined #ruby
[10:16:35] dionysus69: so as I understood correctly, class methods are defined TO singleton/metaclass/eigenclass instead of just main class
[10:19:28] maufart__: has joined #ruby
[10:19:39] apeiros: s/TO/on the/
[10:19:53] apeiros: yes. ruby only has instance methods. class methods don't really exist.
[10:20:26] dionysus69: I see ^.^ thanks
[10:20:26] fribmendes: has joined #ruby
[10:20:26] apeiros: what we call class methods are instance methods on the singleton_class of the class/module.
[10:21:02] apeiros: and since it's much easier to say/write, and known in other languages too, it stuck :)
[10:21:31] dionysus69: hmm very interesting, never though of class methods not existing, but actually it makes sense, if everything is an object, every method has to be an instance method, if I formulated it correctly
[10:23:23] dminuoso: 11:13 dionysus69 | is singleton class same as metaclass?
[10:23:29] dminuoso: dionysus69: Depends on what you are looking at.
[10:23:35] dminuoso: In the ruby source code itself no.
[10:23:55] drewmcmi_: has joined #ruby
[10:23:56] atmosx: has joined #ruby
[10:24:12] dionysus69: the force is not that close to me yet xD
[10:24:25] dminuoso: dionysus69: Internally "metaclass" is the class of class objects (i.e. objects that are not of RClass), while "singleton class" is the class object of.. everything else.
[10:24:30] dminuoso: dionysus69: http://i.imgur.com/04Mlrwp.png
[10:24:47] dminuoso: dionysus69: The blue is whats formally called "singleton class", while all purpose classes are formally called "metaclass"
[10:25:03] dminuoso: But as far as rubyists are concerned apeiros is correct.
[10:26:33] apeiros: hence "usually"
[10:26:34] dionysus69: I see, thanks to you too, that diagram seems pretty (complex) :D
[10:26:37] nowhereman_: has joined #ruby
[10:27:15] cschneid: has joined #ruby
[10:28:53] dionysus69: so for example I use this https://gist.github.com/anonymous/1ccef4d3c0312633ab81b860f89cf00c on regular basis
[10:29:09] drewmcmillan: has joined #ruby
[10:29:15] dionysus69: what would one call this "pattern"?
[10:29:21] dminuoso: Anti-pattern.
[10:29:30] dionysus69: form of metaprogramming?
[10:29:36] dminuoso: Every time people use singletons kitten die.
[10:29:37] dionysus69: what do you mean by anti-pattern ? :D
[10:30:09] dionysus69: ok then, how would you achieve same without killing kitten?
[10:30:21] dminuoso: dionysus69: Let me show you the non-obfuscated version of what you just wrote.
[10:30:23] dionysus69: sending some random methods to remote service
[10:30:40] willmichael: has joined #ruby
[10:30:41] dminuoso: $really_global_service_for_the_entire_world_to_touch_and_modify = RPC::JSON::Client.new(Setting["rpc_connection_params"], 1.1)
[10:30:51] dminuoso: Suddenly the entire project, even every gem and library has access to it.
[10:31:26] dionysus69: well yea, I need such thing in my rails app, various parts of application use this
[10:31:28] dminuoso: Singletons seem to be the answer to "Oh boy, we have a dependency on multiple things, and I dont know/am to lazy to provide this dependency to the respective modules"
[10:31:52] larcara: has joined #ruby
[10:31:56] dionysus69: so you are saying to change class into module and import it only wherever it's necessary?
[10:32:02] drewmcmi_: has joined #ruby
[10:32:02] sameerynho: has joined #ruby
[10:32:06] dionysus69: include* sorry
[10:34:19] dionysus69: other than that though, I don't see what much else could change
[10:36:47] dminuoso: dionysus69: Whenever I see the singleton pattern, I ask myself first: "Why do we have a singleton? Are we trying to enforce that only one object can possibly exist?"
[10:37:29] dminuoso: dionysus69: What's wrong with just using `RPC::JSON::Client.new` every time you need it?
[10:37:41] dionysus69: actually I just inherited this piece of code, I didn't come up with it :D
[10:37:50] dminuoso: It's just a basic first thought, not that its a good idea.
[10:38:40] dionysus69: the only problem I see atm with it is that it will be recreated multiple times
[10:39:00] dionysus69: @service ||=
[10:40:07] clemens3: anyone on debian? I have ruby installed, but no gem in the path..?! Anyone know the package that would be in?
[10:40:11] sidx64: has joined #ruby
[10:40:41] clemens3: maybe something for #debian, but they are sleeping
[10:41:07] darix: clemens3: packages.debian.org
[10:41:14] darix: use the file search at the bottom
[10:41:16] ledestin: has joined #ruby
[10:41:20] dionysus69: clemens3: use rvm ^.^
[10:41:27] clemens3: darix: oki, thnx..
[10:41:27] dionysus69: and I am on debian btw hehe
[10:42:06] clemens3: dionysus69: I used for ages on mac.. but I don't like it for security reasons not that much anymore..
[10:42:25] darix: dionysus69: RVM is not the solution
[10:42:32] clemens3: dionysus69: I might just compile ruby myself in the future and make sure all gems are used with a single installation only
[10:42:47] dionysus69: I dont really know security implications of using rvm ^.^
[10:42:52] darix: clemens3: and who does security backports for this ruby version?
[10:43:11] clemens3: dionysus69: for a start, installing it is downloading some bash script and immediately running it..
[10:43:13] darix: dionysus69: many people just oneshot install ruby with it and then get stuck
[10:43:22] tvw: has joined #ruby
[10:43:27] darix: so no security fixes and so on
[10:43:40] clemens3: darix: one problem vs another
[10:43:40] darix: software life cycle doesnt end with "install"
[10:44:21] dionysus69: dunno, I didn't have any problems with rvm, I use it both in production and dev :D I had some problems but not related to ruby itself
[10:44:54] darix: dionysus69: personally I even rpm-ify gems, so i can backport fixes on those as well.
[10:45:21] dionysus69: what do you mean by backport fixes? to modify them?
[10:46:03] clemens3: dionysus69: rvm is nice, just how to you check what you just downloaded and installed is really what you think it is?
[10:46:04] darix: simple_rss had broken non ascii charset handling and upstream was dead and not doing releases
[10:46:30] darix: and backporting security fixes when you can just upgrade the whole stack
[10:47:14] darix: and upstream only released a new version which doesnt match the version limits of your current stack
[10:47:54] dionysus69: dunno, I only use gems installed by bundler, never used a OS packaged gem
[10:48:45] cdg: has joined #ruby
[10:49:06] clemens3: darix: strangely, on my system it is called gem2.1
[10:49:16] clemens3: must do a symlink
[10:49:18] darix: clemens3: probably so you can use multiple versions in parallel
[10:49:29] clemens3: darix: yeah..
[10:49:41] darix: clemens3: I would have expected that debian has update-alternative handling for a /usr/bin/gem
[10:50:58] darix: dionysus69: funny story. I package discourse for opensuse. I applied the simple-rss fix to my package and all was good. then a friend asks me if i can install discourse for him - on an ubuntu machine ... ok ... we install via git ... run bundle install ... and test his install. run into the rss bug again. "i thought I had this fixed ... oh damn ... not using rpms"
[10:51:03] roshanavand: has joined #ruby
[10:51:10] darix: so we had to patch the copy in the vendor tree *again*
[10:51:34] talntid: has joined #ruby
[10:51:38] darix: a few months later we moved his instance to opensuse and now we both enjoy the same backported fixes. ;)
[10:51:55] Beams_: has joined #ruby
[10:52:50] dionysus69: ah I see, so vendor tree is the "main repo" for gems?
[10:53:08] dionysus69: and from there people do all sorts of packaging?
[10:55:23] clemens3: darix: actually I wanted to generate all standard documentation, but actually the documentation was there, just ri was also named ri2.1..
[10:55:53] darix: clemens3: :D
[10:55:55] clemens3: darix: I skip the alternative way for now, just linked it manually..
[10:56:08] clemens3: oki, thanks - later
[10:56:13] darix: dionysus69: naw. vendor tree is where "bundle install" dumps the things
[10:56:13] amatas_: has joined #ruby
[10:57:13] connor_goodwolf: has joined #ruby
[10:57:50] sidx64: has joined #ruby
[10:59:20] kapil___: has joined #ruby
[11:00:20] schneider: has joined #ruby
[11:06:55] xfbs: has joined #ruby
[11:08:55] mtkd: has joined #ruby
[11:19:21] sidx64: has joined #ruby
[11:21:25] amatas_: has joined #ruby
[11:23:41] apparition: has joined #ruby
[11:27:32] nowhere_man: has joined #ruby
[11:28:43] ldnunes: has joined #ruby
[11:31:41] sidx64: has joined #ruby
[11:34:03] ramfjord: has joined #ruby
[11:35:23] adlerdias: has joined #ruby
[11:38:22] Cavallari: has joined #ruby
[11:41:28] KeyJoo: has joined #ruby
[11:43:56] konsolebox: has joined #ruby
[11:53:30] fribmendes: has joined #ruby
[11:56:50] d9867eb: has joined #ruby
[11:57:59] za1b1tsu: has joined #ruby
[11:58:24] d9867eb: hello, please tell me, is nested methods ie dynamic methods considred a bad thing?
[12:00:18] sidx64: has joined #ruby
[12:00:50] d9867eb: here is a example https://pastebin.com/Z8dg8N6B
[12:00:52] ruby[bot]: d9867eb: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/21a72e5bfcbbdaa604eeeabf584dcdda
[12:00:52] ruby[bot]: d9867eb: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[12:00:56] Psybur: has joined #ruby
[12:01:00] ramfjord: has joined #ruby
[12:01:15] apeiros: d9867eb: yes
[12:01:30] burgestrand: has joined #ruby
[12:01:36] apeiros: and it almost certainly does not work the way you expect it to
[12:01:49] apeiros: (alternatively: your code makes no sense)
[12:01:55] d9867eb: apeiros, then what should i do instead?
[12:02:35] apeiros: unclear from your code. but seems like you want a Project = Struct.new(:title, :url)
[12:03:33] d9867eb: apeiros, how does my code not make sense?
[12:03:44] apeiros: in that it does not work. like, at all.
[12:03:47] apeiros: https://gist.github.com/anonymous/21a72e5bfcbbdaa604eeeabf584dcdda#file-ruby-rb-L5
[12:03:52] apeiros: self in that line is not project
[12:04:21] meadmoon: has joined #ruby
[12:05:40] d9867eb: apeiros, then what is it? it worked when i ran it
[12:05:53] apeiros: it may not have raised
[12:05:57] apeiros: that does not mean it worked
[12:08:24] willmichael: has joined #ruby
[12:09:19] apeiros: ok, it "works"
[12:09:26] apeiros: but not the way you expect it to
[12:09:36] apeiros: you could simply write those two methods outside of your loop
[12:10:43] apeiros: d9867eb: https://gist.github.com/apeiros/08e6bec4c04bddb2cbc42407d11adeed this does exactly the same as yours
[12:11:01] apeiros: except that it doesn't define the same method over and over again (replacing the old, same version)
[12:11:43] apeiros: also note that you can now call .title and .url on *every* object.
[12:12:20] schneider: has joined #ruby
[12:13:32] AJA4350: has joined #ruby
[12:14:21] apeiros: https://gist.github.com/apeiros/08e6bec4c04bddb2cbc42407d11adeed (updated) the "better.rb" is more what you should do.
[12:15:23] apeiros: my attention is elswhere. ping me if you write something I should read.
[12:17:07] goatish: has joined #ruby
[12:17:50] soniya29: has joined #ruby
[12:17:51] soniya29_: has joined #ruby
[12:19:46] roshanavand: has joined #ruby
[12:20:14] d9867eb: apeiros, thanks
[12:23:31] zenspider: keithy: rake_remotetask
[12:23:37] zenspider: the older I get... the more I hate the word "best"
[12:23:50] shinnya: has joined #ruby
[12:26:21] cschneid: has joined #ruby
[12:26:47] apeiros: zenspider: hah, I know that feeling
[12:26:55] apeiros: zenspider: btw., imagescience is no longer maintained?
[12:27:04] apeiros: or is it just flawless at this point? :)
[12:27:17] cdg: has joined #ruby
[12:27:46] karapetyan: has joined #ruby
[12:27:54] zenspider: so flawless
[12:27:58] sidx64: has joined #ruby
[12:28:14] zenspider: not not maintained... just hasn't had anything pushing on it for a long while
[12:28:37] zenspider: I am minimizing THE STRANGEST BUG... in did_you_mean
[12:29:15] achen: has joined #ruby
[12:30:27] aguestuser: has joined #ruby
[12:33:01] zenspider: ACTION goes to bed
[12:38:13] anjen: has joined #ruby
[12:42:00] John_Ivan: has joined #ruby
[12:42:00] John_Ivan: has joined #ruby
[12:43:04] oroborous: has joined #ruby
[12:43:04] oroborous: has joined #ruby
[12:48:15] Papierkorb: has joined #ruby
[12:48:20] Papierkorb: has left #ruby: ("Konversation terminated!")
[12:54:03] drewmcmillan: has joined #ruby
[12:56:06] sanscoeur: has joined #ruby
[12:59:50] cschneid: has joined #ruby
[13:00:22] cliq: has joined #ruby
[13:01:28] schneider: has joined #ruby
[13:04:35] bigblind: has joined #ruby
[13:07:41] adlerdias_: has joined #ruby
[13:09:21] lxsameer: has joined #ruby
[13:09:38] achen: has joined #ruby
[13:12:26] faces: has joined #ruby
[13:13:20] sidx64: has joined #ruby
[13:13:25] soniya29: has joined #ruby
[13:13:26] soniya29_: has joined #ruby
[13:13:36] schneider: has joined #ruby
[13:14:17] mtkd: has joined #ruby
[13:15:00] fribmendes: has joined #ruby
[13:15:23] adlerdias_: has joined #ruby
[13:15:40] phaul: what's the best lib atm to do fast matrix dot products, map func over matrices and basic matrix arithmetics ie elemwise +, - or multiply by scalar? Tried nmatrix, but Im getting issues.
[13:18:34] Iambchop: phaul: share a gist of your code and issues?
[13:21:30] willmichael: has joined #ruby
[13:22:29] bmurt: has joined #ruby
[13:23:18] banisterfiend: has joined #ruby
[13:23:22] phaul: it requires packable. if I open an irb this happens: https://gist.github.com/phaul/5becb77a5c1a60adc22f11b85b032d1a
[13:24:11] phaul: so if I try to use packable and or nmatrix, p becomes dodgy..
[13:25:19] phaul: I see that packable says it was designed to work with ruby 1.8 & 1.9. But then Im stuck
[13:25:48] phaul: hence my starting question, what else cn I use?
[13:27:06] workmad3: has joined #ruby
[13:27:47] dionysus69: has joined #ruby
[13:32:08] drewmcmi_: has joined #ruby
[13:33:04] beyer: has joined #ruby
[13:33:13] schneider: has joined #ruby
[13:33:38] thinkpad: has joined #ruby
[13:33:45] phaul: beyer: hi
[13:34:00] beyer: i want to install this repo https://github.com/vdaubry/youtube-multiple-dl but have no idea how to do... i have 0 knowledge of ruby
[13:34:38] ams__: has joined #ruby
[13:34:40] jaruga: has joined #ruby
[13:34:42] tobiasvl: beyer: the readme file has installation instructions
[13:34:47] beyer: i have installed ruby 2.4.3 but after when i try to run it it says "C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- delayed_job_active_record (LoadError)"
[13:35:02] tobiasvl: did you "bundle install"?
[13:35:11] beyer: im on windows 10 ...
[13:35:26] beyer: i dont know what is bundle install or how to do it
[13:35:29] tobiasvl: ok, I don't know anything about windows, but did you install the bundle?
[13:35:49] tobiasvl: ok so you did not install it
[13:37:43] tobiasvl: ok, well, I don't know anything about windows unfortunately, so maybe someone else can answer
[13:37:57] tobiasvl: but your question is essentially "how do I install bundler on windows" then
[13:39:07] kapil___: has joined #ruby
[13:39:21] tobiasvl: on linux you would do "gem install bundler"
[13:39:25] tobiasvl: and then "bundle install"
[13:40:11] memo1: has joined #ruby
[13:40:18] tobiasvl: the "gem" command comes with ruby
[13:40:23] tobiasvl: maybe this helps https://stackoverflow.com/questions/18908708/installing-ruby-gem-in-windows
[13:42:36] beyer: ill try tks
[13:44:16] Beams: has joined #ruby
[13:45:13] fribmendes: has joined #ruby
[13:48:58] karapetyan: has joined #ruby
[13:50:11] beyer: yeah i already installed the recommended version here https://rubyinstaller.org/downloads/ 2.4.3
[13:51:00] jeffreylevesque: has joined #ruby
[13:51:01] beyer: cmd ruby -v says 2.4.3p205
[13:55:37] beyer: then what should i do?
[13:55:51] tobiasvl: beyer: do you have the "gem" command?
[13:58:08] tobiasvl: ok, then do what I said earlier
[13:58:13] tobiasvl: "gem install bundler"
[13:58:23] tobiasvl: then you can follow the installation instructions in the readme
[13:58:55] beyer: ERROR: While executing gem ... (Errno::EADDRNOTAVAIL) L’adresse demandée n’est pas valide dans son contexte. - connect(2) for "0.0.0.0" port 53
[13:58:57] cpruitt: has joined #ruby
[13:59:11] beyer: the requested adress is not valid (translation..)
[13:59:20] schneider: has joined #ruby
[14:00:08] tobiasvl: ok, never seen that before, but googling "gem install eaddrnotavail" has some results
[14:00:17] tobiasvl: possibly dns configuration
[14:00:40] beyer: im in china, it can be the cause?
[14:00:53] tobiasvl: the great firewall of china
[14:01:52] ramfjord: has joined #ruby
[14:01:58] beyer: ok its working trough openvpn
[14:02:18] beyer: 1 gem installed
[14:03:11] dminuoso: >> -> f { -> y { y[y] }[->x { f[-> v { x[x][v] }] }] }[-> f, x { x == Math.cos(x) ? x : f[Math.cos(x)]}.curry][3]
[14:03:12] ruby[bot]: dminuoso: # => 0.7390851332151607 (https://eval.in/965195)
[14:03:16] dminuoso: >> -> f { -> y { y[y] }[->x { f[-> v { x[x][v] }] }] }[-> f, x { x == Math.cos(x) ? x : f[Math.cos(x)]}.curry][4]
[14:03:17] ruby[bot]: dminuoso: # => 0.7390851332151607 (https://eval.in/965196)
[14:03:21] dminuoso: >> -> f { -> y { y[y] }[->x { f[-> v { x[x][v] }] }] }[-> f, x { x == Math.cos(x) ? x : f[Math.cos(x)]}.curry][10]
[14:03:22] ruby[bot]: dminuoso: # => 0.7390851332151607 (https://eval.in/965197)
[14:04:31] banisterfiend: has joined #ruby
[14:04:53] dminuoso: It seems as if eval.in has TCO enabled
[14:05:29] dminuoso: I just segfaulted ruby.
[14:06:27] beyer: i got this C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- lib/youtube_multiple_dl (LoadError) from C:/Ruby24-x64/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require' from youtube-multiple-dl:3:in `<main>'
[14:06:48] tobiasvl: beyer: and is youtube-multiple-dl installed, like the readme says it must be?
[14:07:03] synthroid: has joined #ruby
[14:07:08] tobiasvl: please just read the installation instructions in the readme now that I helped you get to the point it starts from
[14:07:57] burgestrand: has joined #ruby
[14:08:17] aScottishBoat: has joined #ruby
[14:08:30] cdg: has joined #ruby
[14:10:04] dminuoso: >> RUBY_VERSION
[14:10:05] ruby[bot]: dminuoso: # => "2.3.0" (https://eval.in/965201)
[14:10:09] cdg_: has joined #ruby
[14:10:39] jcalla: has joined #ruby
[14:10:57] rwb: has joined #ruby
[14:11:01] mtkd: has joined #ruby
[14:11:09] workmad3: has joined #ruby
[14:12:01] bmurt: has joined #ruby
[14:13:16] karapetyan: has joined #ruby
[14:14:16] Bish: dminuoso: enlighten us with your 0day exploit
[14:15:32] Bish: enlighten me then?
[14:16:03] achen: has joined #ruby
[14:24:13] dminuoso: Bish: Mmm irrelevant, its fixed.
[14:24:21] beyer: C:\Ruby24-x64\bin>ruby rake db:migrate rake aborted! No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb) rake:23:in `load' rake:23:in `<main>' (See full trace by running task with --trace)
[14:24:38] dminuoso: Bish: I managed to seg fault 2.4.1 in some strange combinations, but it does not seem reproducible in 2.5.0
[14:25:08] beyer: i have rakefile what it says that i dont?
[14:25:45] dminuoso: Bish: -> f { -> y { y[y] }[->x { f[-> v { x[x][v] }] }] }[-> f, x { x == Math.cos(x) ? x : f[Math.cos(x)]}.curry][10]; RubyVM::InstructionSequence.compile_option = { tailcall_optimization: true, trace_instruction: false }; -> f { -> y { y[y] }[->x { f[-> v { x[x][v] }] }] }[-> f, x { x == Math.cos(x) ? x : f[Math.cos(x)]}.curry][10]
[14:25:56] dminuoso: Bish: Repeat this a few times in 2.4.1 (possibly newer too) and watch it segfault
[14:28:25] achen: has joined #ruby
[14:29:25] aufi_: has joined #ruby
[14:30:03] mikecmpbll: has joined #ruby
[14:30:26] karapetyan: has joined #ruby
[14:33:56] maufart__: has joined #ruby
[14:34:21] beyer: i have this issue now ... https://github.com/vdaubry/youtube-multiple-dl/issues/2
[14:35:11] fribmendes: has joined #ruby
[14:36:34] k0mpa: has joined #ruby
[14:37:39] karapetyan: has joined #ruby
[14:37:59] aScottishBoat: has joined #ruby
[14:38:49] Psybur: has joined #ruby
[14:38:50] Psybur: has joined #ruby
[14:40:40] dminuoso: beyer: You probably are not using `bundle` to invoke your rake commands.
[14:44:11] krawchyk: has joined #ruby
[14:45:30] riotjones: has joined #ruby
[14:47:42] drewmcmillan: has joined #ruby
[14:50:32] beyer: how to do it?
[14:50:41] desperek: has joined #ruby
[14:50:58] oleo: has joined #ruby
[14:51:13] raynold: has joined #ruby
[14:51:42] beyer: Comment je fais diminuoso?
[14:52:26] karapetyan: has joined #ruby
[14:55:34] morfin60: dminuoso, not crashed for me
[14:55:41] beyer: have this in CMD https://pastebin.com/pS58zrdw
[14:55:42] ruby[bot]: beyer: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/ba7880d49e6d4cbff0395697334509c7
[14:55:43] ruby[bot]: beyer: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
[14:55:45] dminuoso: morfin60: 2.4.1 in irb?
[14:55:48] dminuoso: morfin60: Repeatedly put in?
[14:55:55] dminuoso: morfin60: what platform?
[14:56:16] morfin60: Arch Linux x86_64 =)
[14:56:24] morfin60: yes, 2.4.1 and irb
[14:56:52] dminuoso: morfin60: what exact patch version?
[14:56:58] sanscoeur: has joined #ruby
[14:57:01] beyer: le gars a fait un script fantastique mais il dit pas cmt sen servir grrr
[14:57:06] dminuoso: morfin60: https://gist.github.com/dminuoso/3e95cef65f098961f1e2e4f3b3547154
[14:57:33] dviola: has joined #ruby
[14:57:45] beyer: https://gist.github.com/ba7880d49e6d4cbff0395697334509c7
[14:57:55] dminuoso: (The actual testcase is smaller, but repeating that statement is easier to explain)
[14:58:37] shpoont: has joined #ruby
[14:59:14] cdg: has joined #ruby
[14:59:14] morfin60: no stack level too deep for me
[15:00:35] orbyt_: has joined #ruby
[15:01:01] pastorinni: has joined #ruby
[15:01:21] cdg__: has joined #ruby
[15:03:16] karapetyan: has joined #ruby
[15:11:36] riotjones: has joined #ruby
[15:11:46] sidx64: has joined #ruby
[15:14:31] fribmendes: has joined #ruby
[15:16:51] Terens: has joined #ruby
[15:16:56] Terens: why does this fail?
[15:16:57] Terens: DateTime.strptime("1519916596.0613241", "%s.%7N").to_f
[15:17:09] kn-928: has joined #ruby
[15:17:37] Rapture: has joined #ruby
[15:20:36] Beams_: has joined #ruby
[15:21:14] apeiros: terens: seems it wants %N instead of %7N and will throw away the subsecond part.
[15:21:39] apeiros: not sure why and whether there's a better solution. because it's absolutely capable of internally having that state.
[15:22:40] InfinityFye: has joined #ruby
[15:22:47] drewmcmillan: has joined #ruby
[15:23:04] schneider: has joined #ruby
[15:23:43] InfinityFye: has left #ruby: ()
[15:28:19] netherwolfe: has joined #ruby
[15:28:51] cschneid: has joined #ruby
[15:32:28] GotHyper: has joined #ruby
[15:41:38] karapetyan: has joined #ruby
[15:44:15] pskosinski: has joined #ruby
[15:48:08] troys: has joined #ruby
[15:51:21] ShekharReddy: has joined #ruby
[15:52:39] n008f4g_: has joined #ruby
[15:59:39] aufi: has joined #ruby
[15:59:51] tAn: has joined #ruby
[16:03:21] willmichael: has joined #ruby
[16:03:48] karapetyan: has joined #ruby
[16:04:33] karapetyan: has joined #ruby
[16:06:10] karapetyan: has joined #ruby
[16:07:46] karapetyan: has joined #ruby
[16:09:21] karapetyan: has joined #ruby
[16:10:07] karapetyan: has joined #ruby
[16:11:25] karapetyan: has joined #ruby
[16:13:05] sanscoeur: has joined #ruby
[16:16:16] mtkd: has joined #ruby
[16:17:46] ruby[bot]: -bbb Bisyari!*@*$#ruby-banned Kamel!*@*$#ruby-banned Coito!*@*$#ruby-banned
[16:21:02] momomo: has joined #ruby
[16:21:54] momomo: yo .. how do you merge a hash onto another but only new keys ... one.merge!(two) is overwriting for me
[16:22:29] momomo: one : {a => 1}, two : {b => 20, a => 10}
[16:22:55] momomo: results in the same as two
[16:23:03] momomo: i want to keep a = 1
[16:23:38] gizmore: https://stackoverflow.com/questions/1980794/how-can-i-merge-two-hashes-without-overwritten-duplicate-keys-in-ruby
[16:23:45] gizmore: didnt check answers
[16:25:47] al2o3-cr: momomo: h1.merge(h2) { |k, o, n| o }
[16:26:04] apeiros: has joined #ruby
[16:26:38] havenwood: >> {a: 1}.merge({b: 20, a: 10}) { |_, old, _| old }
[16:26:39] havenwood: al2o3-cr: You beat me to it
[16:26:39] ruby[bot]: havenwood: # => {:a=>1, :b=>20} (https://eval.in/965274)
[16:27:19] conta: has joined #ruby
[16:27:20] sammi`_: has joined #ruby
[16:27:23] momomo: havenwood: one problem though
[16:27:34] momomo: it doesnt modify one
[16:27:37] momomo: it returns a new one
[16:27:56] tcopeland: has joined #ruby
[16:28:02] havenwood: momomo: You mean you want to modify the receiver Hash?
[16:28:29] momomo: but i cant get it the value in my code that I am expecting
[16:28:40] havenwood: >> h = {a: 1}; h.merge!({b: 20, a: 10}) { |_, old, _| old }; h # momomo
[16:28:41] ruby[bot]: havenwood: # => {:a=>1, :b=>20} (https://eval.in/965276)
[16:28:50] havenwood: momomo: Gist your code?
[16:30:14] apeiros: has joined #ruby
[16:30:26] momomo: havenwood:constructing the gist i discovered the error :D
[16:30:58] havenwood: momomo: aha, nice
[16:31:30] momomo: what is { |k, o, n| o } vs { |_, old, _| old } vs { |key, v1, v2| v1 }
[16:31:47] momomo: i see the first one uses a bit different syntax than the old one
[16:32:34] burgestrand: has joined #ruby
[16:33:56] kapil___: has joined #ruby
[16:34:45] willmichael: has joined #ruby
[16:35:02] hinbody: has joined #ruby
[16:39:28] Antiarc: has joined #ruby
[16:45:25] schneider: has joined #ruby
[16:49:49] Cavallari: has joined #ruby
[16:51:07] synthroid: has joined #ruby
[16:51:46] bonhoeffer: has joined #ruby
[16:52:46] ruby[bot]: -b jcpwn!*@*$#ruby-banned
[16:53:18] s3nd1v0g1us: has joined #ruby
[16:53:59] s3nd1v0g1us: has joined #ruby
[16:57:57] John_Ivan: has joined #ruby
[16:59:26] pocketprotector: has joined #ruby
[17:00:36] momomo: is there a way to delete a key and get the return valeu ?
[17:01:48] momomo: 777<%= locals[:date_of_birth].delete("static") %>888
[17:01:52] momomo: not printing anything
[17:02:14] momomo: 777<%= locals[:date_of_birth][:static] %>888
[17:02:26] apeiros: "static" is not the same as :static
[17:03:10] [Butch]: has joined #ruby
[17:03:26] rrutkowski: has joined #ruby
[17:04:45] tcopeland: has joined #ruby
[17:05:37] anjen: has joined #ruby
[17:06:56] conta: has joined #ruby
[17:10:03] eckhardt: has joined #ruby
[17:10:34] clemens3: has joined #ruby
[17:11:33] willmichael: has joined #ruby
[17:13:22] marxarelli: has joined #ruby
[17:14:08] jcarl43: has joined #ruby
[17:16:37] apeiros: momomo: and? could you resolve your issue?
[17:16:55] momomo: yes, i had to use delete(:static) for some reason
[17:17:01] momomo: i dont get the ruby syntax
[17:17:13] momomo: documentation says 'static'
[17:17:36] apeiros: you do get that "1" and 1 are not the same?
[17:18:31] apeiros: can't say anything about the documentation you're reading since I don't know which that would be. but can say something about ruby syntax.
[17:18:57] timmow: has joined #ruby
[17:19:29] cdg: has joined #ruby
[17:19:45] rrutkowski: has joined #ruby
[17:21:29] jenrzzz: has joined #ruby
[17:21:30] jenrzzz: has joined #ruby
[17:24:07] schneider: has joined #ruby
[17:28:26] byte512: has joined #ruby
[17:28:46] soniya29: has joined #ruby
[17:28:51] soniya29_: has joined #ruby
[17:29:01] bmurt: has joined #ruby
[17:36:45] darkhanb: has joined #ruby
[17:38:24] shpoont: has joined #ruby
[17:39:51] rybarra: has joined #ruby
[17:41:13] Terens: has joined #ruby
[17:42:20] Beams: has joined #ruby
[17:43:39] ramfjord: has joined #ruby
[17:44:08] hahuang65: has joined #ruby
[17:50:55] hahuang65: has joined #ruby
[17:51:34] Xentil: has joined #ruby
[17:51:57] schneider: has joined #ruby
[17:56:19] mniip: has joined #ruby
[17:59:03] sanscoeur: has joined #ruby
[18:04:36] karapetyan: has joined #ruby
[18:05:44] Tempesta: has joined #ruby
[18:08:56] cdg_: has joined #ruby
[18:09:33] dionysus69: has joined #ruby
[18:16:12] hahuang65: has joined #ruby
[18:21:08] dmitriy_: has joined #ruby
[18:21:25] mtkd: has joined #ruby
[18:25:19] AndBobsYourUncle: has joined #ruby
[18:26:08] dmitriy_: has joined #ruby
[18:26:22] nmeum: has joined #ruby
[18:27:25] ski7777: has joined #ruby
[18:28:13] nmeum: I have an instance of a class Foo which inherits from class Bar and I want to get a list of all instance variables defined by the class Bar without the once defined by the class Foo, is that somehow possible?
[18:30:07] guest123: has joined #ruby
[18:30:36] hahuang62: has joined #ruby
[18:31:10] Guest: has joined #ruby
[18:31:11] dmitriy_: has joined #ruby
[18:32:42] havenwood: nmeum: Bar.new.instance_variables - Foo.new.instance_variables
[18:32:57] kies: has joined #ruby
[18:33:01] havenwood: nmeum: No, there's not an easy way to tell where an instance variable came from. You can tell with methods but not with instance variables.
[18:33:21] John_Ivan: has joined #ruby
[18:33:29] weaksauce: anyone have a suggestion on a free email service to use to send low volume emails through a ruby script to myself?
[18:34:55] Terens: you can send using gmail to yourself as far as i know
[18:35:12] catphish: has joined #ruby
[18:35:33] Terens: has joined #ruby
[18:35:39] weaksauce: well i was going to go that route but didn't want to hard code a password into it and couldn't find what google did with the temp passwords for applications
[18:35:39] catphish: does rack by any chance provide the original http request? or would it need to be reconstructed?
[18:36:10] dmitriy_: has joined #ruby
[18:36:45] catphish: actually never mind, someone already wrote what i'm trying to write https://github.com/ngauthier/tubesock
[18:37:22] havenwood: catphish: what does that have to do with reconstructing the request??
[18:38:14] catphish: havenwood: i was intending to use a websocket protocol library that expects to be given an incoming http request, hence i would have needed the request
[18:39:02] catphish: like this: https://github.com/imanel/websocket-ruby#server-handshake
[18:39:15] shakes: has joined #ruby
[18:39:45] catphish: that's the websocket protocol library i usually use, but this would require the original http request, all this is moot though if tubesock does it all :)
[18:39:46] ruby[bot]: -bb Hirst!*@*$#ruby-banned Guest17460!*@*$#ruby-banned
[18:39:54] karapetyan: has joined #ruby
[18:39:55] alaing: has joined #ruby
[18:40:11] alaing: has joined #ruby
[18:40:21] havenwood: catphish: Why not use ActionCable (or AnyCable)?
[18:40:56] catphish: isn't actioncable a messaging framework? i just need a raw socket
[18:41:09] dmitriy_: has joined #ruby
[18:41:13] havenwood: catphish: ah
[18:41:17] havenwood: catphish: just hijack then
[18:41:23] catphish: that's the plan
[18:41:41] alaing: i'm using activerecord, what is the difference between update and update!
[18:41:56] catphish: i'm a little worried about how hijack will interact with the thread model of puma
[18:42:16] sanscoeur: has joined #ruby
[18:42:16] havenwood: catphish: Puma supports hijack at least.
[18:42:54] havenwood: alaing: See the docs: "Updates its receiver just like update but calls save! instead of save, so an exception is raised if the record is invalid."
[18:42:54] catphish: i've only ever done websockets in my own servers before, where i could make an unlimited number of threads, or event driven
[18:43:14] havenwood: catphish: <3 H2
[18:43:17] catphish: but for this project i'm hoping to keep things simple and use puma
[18:43:34] havenwood: catphish: Discourse has an interesting approach, disfavoring websockets: https://github.com/SamSaffron/message_bus
[18:43:36] sanscoeur: has joined #ruby
[18:43:42] catphish: there shouldn't be too many WS connections, so hopefully not a big problem
[18:44:10] alaing: havenwood: i thought update would run through validations
[18:44:37] catphish: i actually do want a new message bus (i've had a falling out with rabbitmq), but today's project is a VNC server, so neeeds to be pure websocket
[18:45:13] havenwood: catphish: Use HTTP2!
[18:45:35] catphish: i have no idea how that helps, but i'm intrigued, i've never used it
[18:45:48] catphish: does it have a new approach to sockets?
[18:46:10] dmitriy_: has joined #ruby
[18:46:39] havenwood: I guess I'd need to know more about what you're doing to give a real recommendation, but HTTP/2 is really quite nice. Yeah, no more Request/Response - It's a new paradigm.
[18:48:14] havenwood: catphish: Here's a pure Ruby implementation of H2: https://github.com/igrigorik/http-2
[18:48:41] havenwood: catphish: I've recently been playing with gRPC, which uses Protocol Buffers over H2. It's quite nice.
[18:49:20] havenwood: catphish: Schema'd binary data across a binary protocol.
[18:49:26] catphish: well on this occasion i just want a simple stream between JS and a server running a rails app
[18:49:35] catphish: (to carry vnc data)
[18:50:06] catphish: there are a few things i could write to do that, but i was hoping to keep it all within one server, hence the interest in rack hijack
[18:51:14] dmitriy_: has joined #ruby
[18:51:17] havenwood: catphish: Sam Saffron of Discourse argues against WebSockets for such a task. (He's the author of MessageBus.)
[18:51:42] havenwood: catphish: MessageBus also uses Rack Hijack, it just doesn't prefer WebSockets as a transport.
[18:51:56] catphish: well javascript doesn't offer many options
[18:52:06] catphish: websocket, or discreet request/response, afaik
[18:52:46] havenwood: catphish: MessageBus uses the best HTTP/1.1 has to offer, long polling with streamed chungs.
[18:53:05] catphish: that seems inferior to websocket
[18:53:20] havenwood: depends what you're transporting and why
[18:53:28] catphish: websocket offers all that, but in a bidirectional manner
[18:53:34] havenwood: he talks on the why
[18:53:49] havenwood: catphish: https://samsaffron.com/archive/2015/12/29/websockets-caution-required
[18:54:26] havenwood: TL;DR: WebSockets, 50 connections for 50 tabs. HTTP/2, 1 connection for 50 tabs. :-P
[18:54:47] bmurt: has joined #ruby
[18:55:41] bmurt: has joined #ruby
[18:56:04] catphish: some of those criticisms seem fair
[18:56:15] dmitriy_: has joined #ruby
[18:56:54] catphish: but this is all with reference to an app that wants a message bus, not an app that wants a bidirectional binary stream
[18:57:15] havenwood: catphish: bidirectional binary stream sounds best suited to H2
[18:58:02] havenwood: catphish: gRPC handles it well
[18:58:02] catphish: that may be true, i don't know it well
[18:58:08] havenwood: https://grpc.io/docs/guides/concepts.html#bidirectional-streaming-rpc
[18:58:32] Xiti: has joined #ruby
[18:58:49] catphish: really i just want TCP :)
[18:58:56] catphish: but seemingly we're not allowed
[18:59:13] havenwood: catphish: We use gRPC broadly at work. I've just gotten into it myself so I've not done *real things* but I've been very impressed.
[18:59:16] ali_g: has joined #ruby
[18:59:39] catphish: maybe i should just make an activeX control and only support ie6
[18:59:52] gizmore: optimized for IE5
[19:00:10] havenwood: https://caniuse.com/#feat=http2
[19:00:21] havenwood: https://caniuse.com/#feat=websockets
[19:00:31] bmurt: has joined #ruby
[19:00:37] havenwood: Not on Opera Mini!
[19:00:40] catphish: https://caniuse.com/#search=activex
[19:01:12] dmitriy_: has joined #ruby
[19:01:13] havenwood: catphish: https://github.com/Fyrd/caniuse/issues/2467
[19:02:10] catphish: gave it a +1 :)
[19:03:07] catphish: i could really do with a good alternative to rabbitmq to distribute messages
[19:03:36] havenwood: catphish: Phoenix Channels ftw.
[19:04:15] catphish: that's quite a sidestep :)
[19:04:33] havenwood: catphish: Erlang.
[19:04:35] catphish: i still have a lot of rails going on :)
[19:04:47] havenwood: catphish: Step 1) Port Rails to Erlang.
[19:04:56] bmurt: has joined #ruby
[19:05:05] catphish: can i just do it in assembler?
[19:05:12] catphish: after all, ruby doesn't scale
[19:05:17] havenwood: I was really happy to see Phoenix getting H2 support.
[19:06:03] rrutkowski: has joined #ruby
[19:06:12] dmitriy_: has joined #ruby
[19:09:03] n0m4d1c: has joined #ruby
[19:10:54] rrutkowski: has joined #ruby
[19:11:14] dmitriy_: has joined #ruby
[19:11:45] catphish: well after all that, tubesock doesn't seem to support binary websockets, so back to the beginning
[19:11:54] StarSeed0000: has joined #ruby
[19:12:32] guacamole: has joined #ruby
[19:12:32] guacamole: has joined #ruby
[19:13:01] cdg: has joined #ruby
[19:15:18] catphish: and digging into the source of the websocket gem i usually use, it has a "from_rack()" method that gets the necessary data from a rack request hash instead of a raw http request, so everyone wins
[19:16:15] dmitriy_: has joined #ruby
[19:17:00] AgentVenom: has joined #ruby
[19:21:12] dmitriy_: has joined #ruby
[19:23:26] imanc_: has left #ruby: ()
[19:26:10] dmitriy_: has joined #ruby
[19:31:12] dmitriy_: has joined #ruby
[19:36:12] dmitriy_: has joined #ruby
[19:36:31] karapetyan: has joined #ruby
[19:38:08] drewmcmi_: has joined #ruby
[19:38:13] claudiuinberlin: has joined #ruby
[19:39:50] drewmcmi_: has joined #ruby
[19:41:12] dmitriy_: has joined #ruby
[19:44:34] guacamole: has joined #ruby
[19:44:34] guacamole: has joined #ruby
[19:46:11] dmitriy_: has joined #ruby
[19:46:23] eckhardt: has joined #ruby
[19:48:23] drewmcmi_: has joined #ruby
[19:51:12] dmitriy_: has joined #ruby
[19:56:11] dmitriy_: has joined #ruby
[20:01:15] dmitriy_: has joined #ruby
[20:01:20] jenrzzz: has joined #ruby
[20:01:20] jenrzzz: has joined #ruby
[20:06:16] dmitriy_: has joined #ruby
[20:07:12] synthroid: has joined #ruby
[20:08:39] bmurt: has joined #ruby
[20:11:14] dmitriy_: has joined #ruby
[20:14:57] chridal: has joined #ruby
[20:16:15] dmitriy_: has joined #ruby
[20:17:17] Terens: DateTime.strptime("1519916596.0613241", "%s.%7N").to_f why this doesnt wokr?
[20:17:32] AJA4350: has joined #ruby
[20:18:57] minimalism: has joined #ruby
[20:21:20] dmitriy_: has joined #ruby
[20:23:26] wnd: terens, I don't know. Is this just a simplified reproduction of a bigger issue, or could you perhaps use Time.at(1519916596.0613241) instead?
[20:25:52] n008f4g_: has joined #ruby
[20:26:16] dmitriy_: has joined #ruby
[20:27:00] mtkd: has joined #ruby
[20:27:58] Terens: has joined #ruby
[20:28:11] phaul: >> puts 'try'
[20:28:12] ruby[bot]: phaul: # => try ...check link for more (https://eval.in/965400)
[20:28:47] phaul: >> puts require 'packable'; p 1
[20:28:48] ruby[bot]: phaul: # => cannot load such file -- packable (LoadError) ...check link for more (https://eval.in/965401)
[20:29:29] memo1: has joined #ruby
[20:29:42] shpoont: has joined #ruby
[20:31:20] dmitriy_: has joined #ruby
[20:32:41] eckhardt: has joined #ruby
[20:33:11] aeontech: has joined #ruby
[20:36:16] dmitriy_: has joined #ruby
[20:40:21] \void: has joined #ruby
[20:41:20] dmitriy_: has joined #ruby
[20:46:16] dmitriy_: has joined #ruby
[20:46:51] cliq: has joined #ruby
[20:49:03] gr33n7007h: has joined #ruby
[20:51:15] dmitriy_: has joined #ruby
[20:53:20] John_Ivan: has joined #ruby
[20:53:20] John_Ivan: has joined #ruby
[20:54:30] memo1: has joined #ruby
[20:54:40] guacamole: has joined #ruby
[20:54:52] guacamole: has joined #ruby
[20:54:57] memo1: hi, any library to work with realtime data?, like threads or socketid(nodejs)
[20:56:21] dmitriy_: has joined #ruby
[20:59:08] tomphp: has joined #ruby
[20:59:55] claudiuinberlin: has joined #ruby
[21:01:20] dmitriy_: has joined #ruby
[21:01:40] memo1: like the stream (sinatra)
[21:03:06] jenrzzz: has joined #ruby
[21:03:06] jenrzzz: has joined #ruby
[21:03:10] cdg: has joined #ruby
[21:06:21] dmitriy_: has joined #ruby
[21:09:08] cdg: has joined #ruby
[21:09:59] guacamole: has joined #ruby
[21:09:59] guacamole: has joined #ruby
[21:11:16] dmitriy_: has joined #ruby
[21:12:51] Terens: DateTime.strptime("1519916596.0613241", "%s.%7N").to_f why this doesnt wokr?
[21:13:10] Terens: memo1, actioncable ?
[21:13:21] Terens: faye websocket or something similar
[21:15:42] al2o3-cr: terens: not sure
[21:16:21] dmitriy_: has joined #ruby
[21:16:40] al2o3-cr: >> require 'time'; Time.strptime("1519916596.0613241", "%s.%7N").to_f
[21:16:41] ruby[bot]: al2o3-cr: # => invalid strptime format - `%s.%7N' (ArgumentError) ...check link for more (https://eval.in/965458)
[21:16:47] al2o3-cr: >> require 'time'; Time.strptime("1519916596.0613241", "%s.%N").to_f
[21:16:48] ruby[bot]: al2o3-cr: # => 1519916596.0613241 (https://eval.in/965461)
[21:17:26] Mike11: has joined #ruby
[21:18:53] workmad3: has joined #ruby
[21:19:02] logoscoder: has joined #ruby
[21:20:21] memo1: terens: thank you
[21:20:39] memo1: terens: actoncable is not Rails?
[21:21:17] dmitriy_: has joined #ruby
[21:21:57] Matt2843: has joined #ruby
[21:22:46] synthroid: has joined #ruby
[21:23:05] Terens: yes but most of these things can be used alone
[21:23:28] agent0range: has joined #ruby
[21:24:00] Matt2843: Heyho o/ is there an easy way to append a variable amount of '0' to a string?
[21:25:21] phaul: >> 'string' << '0' * 3
[21:25:22] ruby[bot]: phaul: # => "string000" (https://eval.in/965464)
[21:25:26] Terens: "0" * 666
[21:26:13] karapetyan: has joined #ruby
[21:26:14] nmeum: has left #ruby: ()
[21:26:17] dmitriy_: has joined #ruby
[21:28:09] tomphp: has joined #ruby
[21:29:29] karapetyan: has joined #ruby
[21:31:19] Radar: has joined #ruby
[21:31:22] dmitriy_: has joined #ruby
[21:31:55] Puffball: has joined #ruby
[21:33:48] phaul: Matt2843: depending on your code 'string'.ljust(total_length, '0') can be more convinient
[21:36:12] Dimik: has joined #ruby
[21:36:18] dmitriy_: has joined #ruby
[21:38:34] pastorinni: has joined #ruby
[21:38:44] karapetyan: has joined #ruby
[21:41:20] dmitriy_: has joined #ruby
[21:42:34] karapetyan: has joined #ruby
[21:46:25] dmitriy_: has joined #ruby
[21:51:22] dmitriy_: has joined #ruby
[21:55:03] adlerdias: has joined #ruby
[21:56:25] dmitriy_: has joined #ruby
[21:58:17] keithy: has joined #ruby
[22:01:23] dmitriy_: has joined #ruby
[22:03:27] shinnya: has joined #ruby
[22:03:54] gr33n7007h: has joined #ruby
[22:06:26] dmitriy_: has joined #ruby
[22:09:15] jamiejackson: has joined #ruby
[22:09:17] shpoont: has joined #ruby
[22:10:44] roshanavand: has joined #ruby
[22:11:26] dmitriy_: has joined #ruby
[22:16:26] dmitriy_: has joined #ruby
[22:19:33] keithy: has joined #ruby
[22:21:24] dmitriy_: has joined #ruby
[22:23:22] tomphp: has joined #ruby
[22:24:03] schneider: has joined #ruby
[22:24:04] rwb: has joined #ruby
[22:26:03] d10n-work: has joined #ruby
[22:26:24] dmitriy_: has joined #ruby
[22:31:27] dmitriy_: has joined #ruby
[22:36:25] dmitriy_: has joined #ruby
[22:38:19] Vapez: has joined #ruby
[22:39:50] kliq: has joined #ruby
[22:41:25] dmitriy_: has joined #ruby
[22:44:16] catphish: does anyone know if net/ssh can be used with polling?
[22:44:24] catphish: ie epoll/select
[22:47:58] catphish: i'll just try it :)
[22:53:39] keithy: has joined #ruby
[22:55:17] dmitriy_: has joined #ruby
[22:55:56] shpoont: has joined #ruby
[23:00:18] dmitriy_: has joined #ruby
[23:05:17] dmitriy_: has joined #ruby
[23:06:05] SynSynack: has joined #ruby
[23:10:19] dmitriy_: has joined #ruby
[23:12:27] cdg_: has joined #ruby
[23:12:48] rgiscard: has joined #ruby
[23:15:19] dmitriy_: has joined #ruby
[23:16:08] darix: catphish: huh?
[23:16:57] nadir: has joined #ruby
[23:17:12] catphish: darix: i wanted to know if i could use net/ssh with epoll, so rather than blocking, i can process ssh events whenever they occur, along with events on other sockets
[23:17:33] catphish: i haven't worked out the answer yet, will know when i have some more code in place
[23:18:03] karapetyan: has joined #ruby
[23:19:30] workmad3: has joined #ruby
[23:19:43] karapetyan: has joined #ruby
[23:20:18] dmitriy_: has joined #ruby
[23:23:37] willmichael: has joined #ruby
[23:24:51] achen: has joined #ruby
[23:25:22] dmitriy_: has joined #ruby
[23:25:31] karapetyan: has joined #ruby
[23:27:40] hahuang65: has joined #ruby
[23:27:56] nowhereman_: has joined #ruby
[23:30:16] dmitriy_: has joined #ruby
[23:31:40] mtkd: has joined #ruby
[23:35:17] dmitriy_: has joined #ruby
[23:37:19] xerxes: has joined #ruby
[23:39:12] cagomez: has joined #ruby
[23:40:19] dmitriy_: has joined #ruby
[23:40:34] n0m4d1c: has joined #ruby
[23:40:55] pastorin_: has joined #ruby
[23:43:26] darix: catphish: thread
[23:45:18] dmitriy_: has joined #ruby
[23:50:17] dmitriy_: has joined #ruby
[23:50:51] tomphp: has joined #ruby
[23:50:54] logoscoder: has joined #ruby
[23:52:10] logoscoder: has joined #ruby
[23:53:04] catphish: threads aren't a great way to do it, but they make a good fallback
[23:53:24] logoscoder: has joined #ruby
[23:53:53] catphish: anyway, the answer is yes, you can, select([ssh_session.transport.socket]); ssh_session.process(0)
[23:55:19] dmitriy_: has joined #ruby
[23:55:23] postmodern: has joined #ruby
[23:55:40] rflec028: has joined #ruby
[23:56:13] catphish: i now have a server that bridges between websocket and vnc-over-ssh :)
[23:56:14] aguestuser: has joined #ruby
[23:56:51] n0m4d1c: has joined #ruby
[23:58:15] sanscoeur: has joined #ruby
[23:58:36] drewmcmi_: has joined #ruby
[23:59:57] n0m4d1c: has joined #ruby