« Back to channel list

#ruby - 19 August 2019

« Back 1 day Forward 1 day »
[00:04:00] DaRock: has joined #ruby
[00:05:52] poontangmessiah: has joined #ruby
[00:12:17] fphilipe_: has joined #ruby
[00:13:42] galaxie: has joined #ruby
[00:40:06] chalkmonster: has joined #ruby
[00:42:01] sleepee: has joined #ruby
[01:16:35] BlackSalmon: has joined #ruby
[01:16:55] BlackSalmon: Hi, I have a quick question for you. Where ruby i mainly used for?
[01:22:28] aupadhye: has joined #ruby
[01:24:40] sleepee: has joined #ruby
[01:25:11] matled-: has joined #ruby
[01:27:23] greypack: has joined #ruby
[01:31:07] swistak35: has joined #ruby
[01:46:41] kyrylo: has joined #ruby
[01:49:17] kyrylo: has joined #ruby
[01:54:03] kyrylo: has joined #ruby
[01:57:10] kyrylo: has joined #ruby
[01:59:41] kyrylo: has joined #ruby
[02:04:20] kyrylo: has joined #ruby
[02:07:25] kyrylo: has joined #ruby
[02:10:17] kyrylo: has joined #ruby
[02:13:01] kyrylo: has joined #ruby
[02:15:49] kyrylo: has joined #ruby
[02:16:16] Nicmavr: has joined #ruby
[02:18:37] kyrylo: has joined #ruby
[02:21:21] kyrylo: has joined #ruby
[02:24:00] kyrylo: has joined #ruby
[02:26:26] baojg: has joined #ruby
[02:26:51] kyrylo: has joined #ruby
[02:29:31] kyrylo: has joined #ruby
[02:32:12] kyrylo: has joined #ruby
[02:34:49] kyrylo: has joined #ruby
[02:37:34] kyrylo: has joined #ruby
[02:42:33] kyrylo: has joined #ruby
[02:42:47] fphilipe_: has joined #ruby
[02:45:15] kyrylo: has joined #ruby
[02:48:22] kyrylo: has joined #ruby
[02:50:54] kyrylo: has joined #ruby
[02:53:52] kyrylo: has joined #ruby
[02:58:56] kyrylo: has joined #ruby
[02:59:21] englishm: has joined #ruby
[03:01:29] kyrylo: has joined #ruby
[03:04:24] kyrylo: has joined #ruby
[03:07:20] kyrylo: has joined #ruby
[03:10:14] kyrylo: has joined #ruby
[03:12:50] kyrylo: has joined #ruby
[03:15:56] cats: has joined #ruby
[03:17:28] kyrylo: has joined #ruby
[03:22:03] kyrylo: has joined #ruby
[03:26:37] kyrylo: has joined #ruby
[03:29:14] kyrylo: has joined #ruby
[03:31:50] kyrylo: has joined #ruby
[03:34:25] kyrylo: has joined #ruby
[03:37:00] kyrylo: has joined #ruby
[03:38:22] cyclonis: has joined #ruby
[03:39:35] kyrylo: has joined #ruby
[03:42:12] kyrylo: has joined #ruby
[03:44:23] cyclonis: has joined #ruby
[03:44:48] kyrylo: has joined #ruby
[03:47:24] kyrylo: has joined #ruby
[03:49:59] kyrylo: has joined #ruby
[03:50:22] cyclonis: has joined #ruby
[03:50:59] duderonomy: has joined #ruby
[03:52:35] kyrylo: has joined #ruby
[03:55:11] kyrylo: has joined #ruby
[03:56:22] cyclonis: has joined #ruby
[03:57:46] kyrylo: has joined #ruby
[04:00:25] kyrylo: has joined #ruby
[04:05:00] kyrylo: has joined #ruby
[04:07:35] kyrylo: has joined #ruby
[04:10:10] kyrylo: has joined #ruby
[04:14:45] kyrylo: has joined #ruby
[04:17:21] kyrylo: has joined #ruby
[04:19:56] kyrylo: has joined #ruby
[04:22:51] kyrylo: has joined #ruby
[04:27:39] kyrylo: has joined #ruby
[04:28:17] englishm: has joined #ruby
[04:28:34] queip: has joined #ruby
[04:32:21] kyrylo: has joined #ruby
[04:34:56] kyrylo: has joined #ruby
[04:35:47] baweaver: Put up a JS article for fun: https://dev.to/baweaver/of-a-higher-order-map-filter-reduce-49f6
[04:37:32] kyrylo: has joined #ruby
[04:40:10] kyrylo: has joined #ruby
[04:42:45] kyrylo: has joined #ruby
[04:45:20] kyrylo: has joined #ruby
[04:45:22] dinfuehr: has joined #ruby
[04:57:52] dinfuehr: has joined #ruby
[04:57:55] kyrylo: has joined #ruby
[05:02:31] kyrylo: has joined #ruby
[05:03:37] fphilipe_: has joined #ruby
[05:04:56] dinfuehr_: has joined #ruby
[05:05:14] howdoi: has joined #ruby
[05:07:05] kyrylo: has joined #ruby
[05:07:18] tsujp: has joined #ruby
[05:10:53] queip: has joined #ruby
[05:11:52] kyrylo: has joined #ruby
[05:13:46] fphilipe_: has joined #ruby
[05:14:27] kyrylo: has joined #ruby
[05:16:54] dinfuehr: has joined #ruby
[05:17:02] kyrylo: has joined #ruby
[05:19:37] kyrylo: has joined #ruby
[05:22:14] kyrylo: has joined #ruby
[05:24:50] kyrylo: has joined #ruby
[05:27:26] kyrylo: has joined #ruby
[05:28:10] fphilipe_: has joined #ruby
[05:30:02] kyrylo: has joined #ruby
[05:36:38] kyrylo: has joined #ruby
[05:39:12] kyrylo: has joined #ruby
[05:41:51] kyrylo: has joined #ruby
[05:44:27] kyrylo: has joined #ruby
[05:45:58] bitwinery: has joined #ruby
[05:47:02] kyrylo: has joined #ruby
[05:51:38] kyrylo: has joined #ruby
[05:54:13] kyrylo: has joined #ruby
[05:56:51] kyrylo: has joined #ruby
[06:01:27] kyrylo: has joined #ruby
[06:04:07] kyrylo: has joined #ruby
[06:05:00] ZAJDAN: has joined #ruby
[06:05:16] queip: has joined #ruby
[06:06:47] kyrylo: has joined #ruby
[06:13:28] kyrylo: has joined #ruby
[06:16:04] kyrylo: has joined #ruby
[06:18:38] kyrylo: has joined #ruby
[06:21:14] kyrylo: has joined #ruby
[06:23:48] kyrylo: has joined #ruby
[06:27:28] dionysus69: has joined #ruby
[06:28:24] kyrylo: has joined #ruby
[06:29:34] reber: has joined #ruby
[06:30:59] kyrylo: has joined #ruby
[06:33:34] kyrylo: has joined #ruby
[06:40:09] kyrylo: has joined #ruby
[06:42:44] kyrylo: has joined #ruby
[06:45:19] kyrylo: has joined #ruby
[06:47:56] kyrylo: has joined #ruby
[06:49:32] ravenous_: has joined #ruby
[06:50:08] ineb: has joined #ruby
[06:52:22] TomyWork: has joined #ruby
[06:52:51] baojg: has joined #ruby
[07:00:46] qbeek: has joined #ruby
[07:07:02] queip: has joined #ruby
[07:12:40] lxsameer: has joined #ruby
[07:14:44] jinie: has joined #ruby
[07:17:26] jinie: has joined #ruby
[07:24:52] cyalc: has joined #ruby
[07:28:36] Bounga: has joined #ruby
[07:32:56] queip: has joined #ruby
[07:37:20] aolko: has joined #ruby
[07:37:37] aolko: hey there, is there a concept of `packages` in ruby?
[07:37:40] vondruch: has joined #ruby
[07:37:48] ineb: yes, they are called gems.
[07:38:08] aolko: packages->modules->functions->variables
[07:38:21] aolko: packages as module containers
[07:38:26] ineb: ah. the answer is no then. :)
[07:38:39] aolko: alternative (not classes)?
[07:39:02] ineb: a wrapping module which includes other modules
[07:39:05] baweaver: Nesting modules
[07:39:16] aolko: perhaps maybe that can be fixed with metaprogramming somehow?
[07:39:25] ytti: what is the problem
[07:39:39] qbeek: why not just nest modules under a common namespace ?
[07:39:50] aolko: the lack of that specific construct and associated keyword
[07:39:56] aolko: as well as importing
[07:40:05] ytti: be specific
[07:40:31] baweaver: Do you mean for importing specific _parts_ of a module like Javascript?
[07:40:55] baweaver: import { x, y } from z?
[07:41:04] aolko: so when i do `require "Package"` or `require "Package.*" it imports the whole package
[07:41:18] baweaver: There's no way around that in Ruby.
[07:41:57] ytti: you could build package which lazily requires
[07:42:14] aolko: there should be crutches
[07:42:18] baweaver: or, more accurately, the trouble one would have to go through to make it as such would be far beyond overkill and would be very slow to work with.
[07:42:21] aolko: for this case
[07:42:30] baweaver: Rails does something similar for constant loading
[07:42:38] ytti: i understand the problem now
[07:42:41] ytti: but i can't relate
[07:42:47] aolko: well you see, i'm not touching rails with a 10m stick
[07:42:50] baweaver: Imposing your will upon a language is a poor way to get started in it
[07:42:53] aolko: my case is jruby
[07:43:23] baweaver: What you think to be common sense and necessity may very well make no sense to people who work in the language frequently
[07:43:32] aolko: i plug my packages/modules into java clusterfucks of classes
[07:43:36] baweaver: Does that make them wrong? Does that make you wrong?
[07:43:48] baweaver: Not necessarily in either case.
[07:43:48] aolko: actually wait, the other way around
[07:44:28] aolko: besides i'm not starting, i'm continuing
[07:44:51] ytti: i' dsay lazy require or autoload
[07:45:06] baweaver: Zeitwork was the recent solution
[07:45:10] ytti: are most reasonasble idiomatic approaches which cover some of the same problem ground
[07:45:23] ytti: but do not perfectly overlap
[07:45:31] aolko: right, but still can you maybe provide a macro or some other crutch?
[07:45:40] baweaver: https://github.com/fxn/zeitwerk
[07:46:49] aolko: it's nice yet requires a bit too much to get going
[07:47:04] baweaver: Late here, headed to bed.
[07:47:57] ineb: baweaver:gn8
[07:48:29] kyrylo: has joined #ruby
[07:50:41] queip: has joined #ruby
[07:51:01] aolko: right so, we have lazy require, zeitwerk still no crutches
[07:54:24] aolko: honestly, i'd say this is like a "procedural blocks"
[07:56:52] cyalc: has joined #ruby
[08:05:45] alem0lars: has joined #ruby
[08:11:58] deepreds1: has joined #ruby
[08:12:02] queip: has joined #ruby
[08:12:22] aolko: for example, this https://github.com/sshaw/class2 extensively works with classes
[08:12:30] cyalc: has joined #ruby
[08:14:17] MrCrackPot: has joined #ruby
[08:15:42] MrCrackPot: has joined #ruby
[08:17:33] MrCrackPot: has joined #ruby
[08:24:11] dionysus69: has joined #ruby
[08:28:40] drale2k_: has joined #ruby
[08:31:08] claudiuinberlin: has joined #ruby
[08:34:12] qbeek_: has joined #ruby
[08:35:05] queip: has joined #ruby
[08:37:23] ur5us: has joined #ruby
[08:40:57] schneider: has joined #ruby
[08:41:53] drale2k_: has joined #ruby
[08:42:10] amateur_rubyist: has joined #ruby
[08:44:42] NL3limin4t0r: aolko: You can also partialy require parts of a module/gem. For example `require 'active_support/core_ext/object/deep_dup'`
[08:44:58] cyalc: has joined #ruby
[08:47:26] amateur_rubyist: has joined #ruby
[08:49:06] NL3limin4t0r: It doesn't always work easily, since some modules might not have the needed dependencies set up (since they assumed to be loaded).
[08:49:13] yann-kaelig: has joined #ruby
[08:49:40] NL3limin4t0r: For example let's say you want to load all core extensions of active support.
[08:50:34] NL3limin4t0r: This would be `require 'active_support/core_ext'`, but fails with "NameError: uninitialized constant ActiveSupport::Autoload".
[08:51:24] NL3limin4t0r: So you need to require autoload first. `require 'active_support/dependencies/autoload'`
[08:55:41] qbeek: has joined #ruby
[08:59:50] Bounga`: has joined #ruby
[09:06:12] _whitelogger: has joined #ruby
[09:12:22] aolko: i aim for `import "package.module.module.module"`
[09:13:51] aolko: and yes i've worked with composer and more or less know about autoloading
[09:26:53] drale2k_: has joined #ruby
[09:41:13] Bish: is there a tool that allows me to analyze what method of a certain class gets called?
[09:41:16] Bish: from where?
[09:41:34] Bish: i want to see all occurrences of .update but there are many classes and instances that have that method
[09:41:53] Bish: is pry able to do that somehow, as it basicially has that information?
[09:47:35] leftylink: I think I heard rumours of tracepoint being useful in that situation
[09:48:00] leftylink: or perhaps you could redefine the method to first print Kernel#caller then cacll the original method
[09:48:53] Bish: well you're talking about runtime analysis, i want it staticially
[09:48:59] Bish: which would be possible, i guess
[09:55:19] d^sh: has joined #ruby
[10:03:15] Bounga`: has joined #ruby
[10:04:38] queip: has joined #ruby
[10:07:44] phaul: I would look into writing a TracePoint trigger.. but I don't know for sure if that's workable
[10:08:55] poontangmessiah: has joined #ruby
[10:12:35] BlackSalmon: has joined #ruby
[10:13:55] BlackSalmon: What ruby is mainly used for?
[10:14:55] phaul: ah leftylink already mentioned TracePoint... nm
[10:15:24] kyrylo: has joined #ruby
[10:15:30] paraxial28: has joined #ruby
[10:16:37] phaul: Ruby is a general purpose programming language designed without any particular appication domain in mind. It was largely popularized by the Rails web framework though.
[10:18:00] kyrylo: has joined #ruby
[10:18:29] phaul: BlackSalmon: these categories can give you an idea of what applications you can expect : https://www.ruby-toolbox.com/categories
[10:18:35] ZAJDAN: has joined #ruby
[10:18:47] aolko: and yet for some reason most ruby devs insist on writing strictly oop code
[10:18:59] aolko: this ain't java
[10:19:59] amateur_rubyist: has joined #ruby
[10:20:35] kyrylo: has joined #ruby
[10:25:11] kyrylo: has joined #ruby
[10:25:27] tsujp: has joined #ruby
[10:27:45] kyrylo: has joined #ruby
[10:32:23] mozzarella: has joined #ruby
[10:33:55] deepreds1: has joined #ruby
[10:34:26] kyrylo: has joined #ruby
[10:37:13] kyrylo: has joined #ruby
[10:39:50] kyrylo: has joined #ruby
[10:41:53] deepreds1: has joined #ruby
[10:42:25] kyrylo: has joined #ruby
[10:45:01] kyrylo: has joined #ruby
[10:45:22] suukim: has joined #ruby
[10:45:58] tsujp: has joined #ruby
[10:47:36] kyrylo: has joined #ruby
[10:50:12] kyrylo: has joined #ruby
[10:52:50] kyrylo: has joined #ruby
[10:55:27] kyrylo: has joined #ruby
[10:57:57] lalitmee: has joined #ruby
[10:58:02] kyrylo: has joined #ruby
[10:59:02] AJA4350: has joined #ruby
[10:59:48] phaul: someone with the rights should !badconn kyrylo
[11:00:38] kyrylo: has joined #ruby
[11:00:48] ruby[bot]: phaul: ops currently in #ruby: havenwood, Mon_Ouie, Radar, baweaver, helpa, jhass, matthewd, miah, ruby[bot] and zenspider
[11:03:13] kyrylo: has joined #ruby
[11:07:00] troulouliou_div2: has joined #ruby
[11:07:48] kyrylo: has joined #ruby
[11:08:37] vondruch: has joined #ruby
[11:09:12] BlackSalmon: If i have to choose between django and ruby on rails, what should i choose?
[11:09:55] BlackSalmon: I am not an advanced programmer, so I want to be able to calmly write a few simple lines on what already exists and actually is very easy to understand
[11:10:18] desperek: has joined #ruby
[11:10:23] kyrylo: has joined #ruby
[11:10:24] desperek: has joined #ruby
[11:10:47] phaul: Try both for a few days, and then decide which experience you liked better? Sometimes documentation and additional materials are more important then the framework itself
[11:11:03] BlackSalmon: Instead of looking outside the documentation after some libraries of unknown origin that have a lot of errors, no instructions and they don't do exactly what I would like them to do
[11:11:29] phaul: https://www.railstutorial.org/book is pretty good to get started on Rails
[11:12:19] BlackSalmon: Yeah, i tested django. Trying write a website since last year. Start was pretty smooth but most of the problems showed up later
[11:12:36] tehas: has joined #ruby
[11:13:41] BlackSalmon: eg. you easly run your project localy by just `python manage.py runserver` BUT in the production you can't run this so easly
[11:13:53] tehas: Hi Folks, can I take ruby gems from Ruby2.4 and copy+install it on Ruby2.6 ? is it compulsory to that a gem should be compiled for a particular ruby version ?
[11:14:59] kyrylo: has joined #ruby
[11:15:07] BlackSalmon: Advanced options have no documentation or is so damn poor that i, begginger, can't use too much cuz i don't have a clue how to use it
[11:16:08] drale2k_: has joined #ruby
[11:16:48] tpanarch1st_: has joined #ruby
[11:17:08] fphilipe_: has joined #ruby
[11:17:34] kyrylo: has joined #ruby
[11:20:09] kyrylo: has joined #ruby
[11:22:44] kyrylo: has joined #ruby
[11:23:11] vondruch: has joined #ruby
[11:23:50] beanie__: has joined #ruby
[11:23:52] lalitmee: has joined #ruby
[11:25:19] kyrylo: has joined #ruby
[11:25:33] tpanarch1st: has joined #ruby
[11:27:54] kyrylo: has joined #ruby
[11:30:29] kyrylo: has joined #ruby
[11:35:04] kyrylo: has joined #ruby
[11:35:48] vondruch: has joined #ruby
[11:39:39] kyrylo: has joined #ruby
[11:42:16] kyrylo: has joined #ruby
[11:44:51] kyrylo: has joined #ruby
[11:49:28] kyrylo: has joined #ruby
[11:52:03] kyrylo: has joined #ruby
[11:56:38] kyrylo: has joined #ruby
[11:57:10] dionysus69: has joined #ruby
[12:01:12] kyrylo: has joined #ruby
[12:03:47] kyrylo: has joined #ruby
[12:04:14] tehas: Hi Folks, can I take ruby gems from Ruby2.4 and copy+install it on Ruby2.6 ? is it compulsory to that a gem should be compiled for a particular ruby version ?
[12:11:43] suukim: has joined #ruby
[12:12:22] kyrylo: has joined #ruby
[12:14:58] kyrylo: has joined #ruby
[12:17:06] Fischmiep: has joined #ruby
[12:17:33] kyrylo: has joined #ruby
[12:20:09] kyrylo: has joined #ruby
[12:22:44] kyrylo: has joined #ruby
[12:25:19] kyrylo: has joined #ruby
[12:27:56] kyrylo: has joined #ruby
[12:30:31] kyrylo: has joined #ruby
[12:33:07] kyrylo: has joined #ruby
[12:35:42] kyrylo: has joined #ruby
[12:37:08] drale2k_: has joined #ruby
[12:37:59] Fischmiep: has joined #ruby
[12:38:24] kyrylo: has joined #ruby
[12:40:59] kyrylo: has joined #ruby
[12:41:34] lucasb: has joined #ruby
[12:42:34] queip: has joined #ruby
[12:43:38] kyrylo: has joined #ruby
[12:46:22] kyrylo: has joined #ruby
[12:46:57] AJA4350: has joined #ruby
[12:49:05] kyrylo: has joined #ruby
[12:53:10] Bish: is there a name for methods that return the parameter without modifying it but only if a special case doesn't happen?
[12:53:14] Bish: kinda like
[12:53:28] Bish: case param when Numeric then param.to_s else param end
[12:53:41] kyrylo: has joined #ruby
[12:56:14] grilix: has joined #ruby
[12:56:27] kyrylo: has joined #ruby
[12:56:36] xco: has joined #ruby
[12:58:03] tehas: Bish : there is no official name I guess. But they could be called "specialMutationMethods"
[12:58:17] tehas: which mutate the param only in special cases
[12:59:16] kyrylo: has joined #ruby
[13:00:21] cyclonis_: has joined #ruby
[13:00:29] tehas: Officially, there is something called "Mutating Functions" which allow modification in special cases when special keyword is used
[13:00:52] tehas: so for your case, you can call it "specialMutationMethod"
[13:01:57] kyrylo: has joined #ruby
[13:04:42] kyrylo: has joined #ruby
[13:07:13] kyrylo: has joined #ruby
[13:08:56] tweeeaks: has joined #ruby
[13:09:03] drnerdius: has joined #ruby
[13:09:52] kyrylo: has joined #ruby
[13:12:36] kyrylo: has joined #ruby
[13:13:39] desperek: can i create an intersection of arrays/sets in an array in a nice way?
[13:13:58] stryek: has joined #ruby
[13:15:25] kyrylo: has joined #ruby
[13:18:20] kyrylo: has joined #ruby
[13:20:29] Bish: desperek: & i guess
[13:20:36] Bish: tehas: well, that's a really general name
[13:20:53] desperek: Bish, yeah i was about the .inject(:&) thing as whole really
[13:20:53] brool: has joined #ruby
[13:21:18] kyrylo: has joined #ruby
[13:22:09] bmurt: has joined #ruby
[13:24:15] kyrylo: has joined #ruby
[13:24:31] havenwood: desperek: I like: map(&:to_set).reduce(:intersection)
[13:24:41] havenwood: desperek: Same as: collect(&:to_set).inject(:&)
[13:24:54] desperek: :& works with an array tho!
[13:25:10] havenwood: desperek: Not when there are both Arrays and Sets together.
[13:26:43] desperek: well okay, my question was formulated bad then
[13:27:30] bmurt: has joined #ruby
[13:30:20] cyclonis: has joined #ruby
[13:31:18] kyrylo: has joined #ruby
[13:35:53] jcalla: has joined #ruby
[13:36:21] cyclonis: has joined #ruby
[13:36:27] kyrylo: has joined #ruby
[13:36:37] Bish: desperek: well.. why not
[13:36:43] Bish: &> [1,2,3] & [2,5]
[13:36:43] rubydoc: parser error at position 0 around `>'
[13:36:48] Bish: > [1,2,3] & [2,5]
[13:36:54] Bish: >> [1,2,3] & [2,5]
[13:37:00] ruby[bot]: Bish: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[13:39:20] kyrylo: has joined #ruby
[13:42:18] kyrylo: has joined #ruby
[13:42:21] cyclonis: has joined #ruby
[13:45:04] kyrylo: has joined #ruby
[13:47:07] cyclonis: has joined #ruby
[13:47:35] cyclonis: has joined #ruby
[13:47:41] kyrylo: has joined #ruby
[13:47:49] desperek: Bish, yea thats why i said nvm later :D thanks
[13:48:00] cyclonis: has joined #ruby
[13:48:30] cyclonis: has joined #ruby
[13:48:56] cyclonis: has joined #ruby
[13:49:24] cyclonis: has joined #ruby
[13:52:20] kyrylo: has joined #ruby
[13:56:58] kyrylo: has joined #ruby
[13:57:16] lalitmee: has joined #ruby
[13:59:38] kyrylo: has joined #ruby
[14:02:17] kyrylo: has joined #ruby
[14:04:55] kyrylo: has joined #ruby
[14:07:40] kyrylo: has joined #ruby
[14:07:49] Esa_: has joined #ruby
[14:10:15] kyrylo: has joined #ruby
[14:14:38] lalitmee: has joined #ruby
[14:14:51] k0mpa: has joined #ruby
[14:14:57] Esa_: has joined #ruby
[14:14:59] ElFerna: has joined #ruby
[14:16:06] reber: has joined #ruby
[14:19:45] xco: has joined #ruby
[14:22:51] kyrylo: has joined #ruby
[14:25:29] kyrylo: has joined #ruby
[14:30:14] kyrylo: has joined #ruby
[14:33:00] kyrylo: has joined #ruby
[14:33:15] Bish: desperek: funnel maybe
[14:33:59] tsujp: has joined #ruby
[14:34:25] Bish: because the domain of the function gets smaller when projected to the codomain
[14:38:02] kyrylo: has joined #ruby
[14:38:44] suukim: has joined #ruby
[14:40:26] dionysus70: has joined #ruby
[14:40:45] kyrylo: has joined #ruby
[14:42:33] amateur_rubyist: has joined #ruby
[14:43:50] kyrylo: has joined #ruby
[14:46:13] drale2k_: has joined #ruby
[14:49:14] queip: has joined #ruby
[14:53:02] alem0lars: has joined #ruby
[14:53:58] amateur_rubyist: has joined #ruby
[14:55:27] deepreds1: has joined #ruby
[14:56:58] qbeek_: has joined #ruby
[14:57:01] banister_: has joined #ruby
[14:57:02] kyrylo: has joined #ruby
[14:57:24] Bish: type-funnel
[14:58:29] banisterfiend: has joined #ruby
[14:59:11] alem0lars: has joined #ruby
[14:59:55] kyrylo: has joined #ruby
[15:02:33] fphilipe: has joined #ruby
[15:02:51] Bounga`: has joined #ruby
[15:03:25] iffraff: has joined #ruby
[15:05:22] qbeek: has joined #ruby
[15:07:24] kyrylo: has joined #ruby
[15:07:47] banisterfiend: has joined #ruby
[15:09:56] banisterfiend: i am talking to you through the glory of a split tunnel 😍
[15:10:50] xfbs: has joined #ruby
[15:12:34] kyrylo: has joined #ruby
[15:13:16] phroa: has joined #ruby
[15:15:00] havenwood: banisterfiend: o/
[15:15:13] banisterfiend: havenwood wassup
[15:15:42] kyrylo: has joined #ruby
[15:15:44] banisterfiend: i finally got the split tunnel working on mac :)
[15:16:56] queip: has joined #ruby
[15:17:05] phaul: don't get too excited about kyrylo :) they are in a constant rejoin loop, they will lose connection in a minute
[15:17:19] phaul: they beat me to it :)
[15:17:41] dinfuehr: has joined #ruby
[15:18:12] snowy: has joined #ruby
[15:18:19] desperek: who's kyrylo
[15:18:31] banisterfiend: desperek an east-european computer programmer
[15:18:40] kyrylo: has joined #ruby
[15:18:50] desperek: banisterfiend, how do you know it
[15:19:14] banisterfiend: desperek we're milk brothers
[15:19:20] desperek: who's milk brother
[15:19:58] desperek: banisterfiend, what
[15:21:02] desperek: this is very weird
[15:21:58] kyrylo: has joined #ruby
[15:24:42] dinfuehr: has joined #ruby
[15:26:30] kyrylo: has joined #ruby
[15:29:25] kyrylo: has joined #ruby
[15:31:46] qbeek_: has joined #ruby
[15:32:21] kyrylo: has joined #ruby
[15:32:54] lalitmee: has joined #ruby
[15:39:19] hiroaki: has joined #ruby
[15:42:31] banisterfiend: has joined #ruby
[15:43:18] Bounga`: has joined #ruby
[15:44:09] kyrylo: has joined #ruby
[15:46:58] kyrylo: has joined #ruby
[15:49:16] queip: has joined #ruby
[15:49:41] kyrylo: has joined #ruby
[15:50:07] qbeek: has joined #ruby
[15:52:17] kyrylo: has joined #ruby
[15:54:52] kyrylo: has joined #ruby
[15:57:29] kyrylo: has joined #ruby
[15:59:15] drale2k_: has joined #ruby
[16:02:06] amateur_rubyist: has joined #ruby
[16:03:58] joast: has joined #ruby
[16:04:16] kyrylo: has joined #ruby
[16:04:16] tdy: has joined #ruby
[16:06:59] kyrylo: has joined #ruby
[16:09:29] nowhereman: has joined #ruby
[16:09:39] kyrylo: has joined #ruby
[16:12:27] kyrylo: has joined #ruby
[16:12:52] orbyt_: has joined #ruby
[16:14:58] kyrylo: has joined #ruby
[16:19:37] kyrylo: has joined #ruby
[16:22:14] kyrylo: has joined #ruby
[16:24:48] kyrylo: has joined #ruby
[16:25:10] nowhereman: has joined #ruby
[16:29:21] planigan: has joined #ruby
[16:31:19] dionysus69: has joined #ruby
[16:36:25] jj: has joined #ruby
[16:36:38] jj: has left #ruby: ()
[16:38:03] AJA4351: has joined #ruby
[16:45:15] planigan: has joined #ruby
[16:50:28] angelixd: has joined #ruby
[16:57:10] planigan: has joined #ruby
[17:01:11] poontangmessiah: has joined #ruby
[17:05:39] queip: has joined #ruby
[17:06:06] skyikot: has joined #ruby
[17:06:08] sameerynho: has joined #ruby
[17:06:39] Exuma: has joined #ruby
[17:07:17] wildtrees: has joined #ruby
[17:09:24] qbeek: has joined #ruby
[17:09:27] orbyt_: has joined #ruby
[17:12:28] ramfjord: has joined #ruby
[17:24:15] qbeek: has joined #ruby
[17:25:49] houhoulis: has joined #ruby
[17:35:32] fphilipe: has joined #ruby
[17:40:18] skyikot: has joined #ruby
[17:40:42] Nahra: has joined #ruby
[17:41:30] queip: has joined #ruby
[17:46:21] schneider: has joined #ruby
[17:46:59] tehas: has joined #ruby
[17:47:20] DTZUZO: has joined #ruby
[17:53:06] chalkmonster: has joined #ruby
[17:54:34] amateur_rubyist: has joined #ruby
[18:00:01] amateur_rubyist: has joined #ruby
[18:05:26] k0mpa: has joined #ruby
[18:07:53] code_zombie: has joined #ruby
[18:25:29] cyclonis_: has joined #ruby
[18:26:01] gix: has joined #ruby
[18:36:50] ravenous_: has joined #ruby
[18:37:30] cyclonis: has joined #ruby
[18:44:25] KeyJoo: has joined #ruby
[18:45:17] ellcs1: has joined #ruby
[18:48:12] whoami_: has joined #ruby
[18:49:42] whoami_: Hello, I am trying to use rake on my Debian 10; however, it keep trying to use ruby2.3 even though ruby2.5 is installed; I've tried to purge rake and reinstall it, but it doesn't change anything, I keep getting this error message: "/usr/bin/env: ‘ruby2.3’: No such file or directory"; how can I fix this issue ?
[18:50:17] adam12: whoami_: What rake binary is being used? `which rake`
[18:50:34] whoami_: adam12, /usr/local/bin/rake
[18:50:49] adam12: whoami_: What's the shebang of that file? `head -1 /usr/local/bin/rake`
[18:51:31] whoami_: adam12, #!/usr/bin/env ruby2.3
[18:51:45] adam12: whoami_: How did you install ruby2.3? ruby2.5?
[18:52:07] whoami_: adam12, sudo apt-get install -y rake, which then installed ruby2.5
[18:52:28] whoami_: adam12, right now, only ruby2.5 is installed on my system
[18:52:44] whoami_: adam12, and apt search doesn't find any ruby2.3
[18:55:01] adam12: whoami_: imho, forget about distro packaged ruby and use a ruby version manager. You likely won't fix this.
[18:55:49] angelixd: has joined #ruby
[18:56:12] cd: has joined #ruby
[19:09:25] whoami_: adam12, I guess so, well I used 'sudo gem update' instead and this did the job, rake work properly now; thanks !
[19:12:57] troulouliou_div2: has joined #ruby
[19:19:57] qbeek: has joined #ruby
[19:29:20] ellcs1: has joined #ruby
[19:29:29] cereal: has joined #ruby
[19:30:31] djdduty: has joined #ruby
[19:31:50] cereal: Hi, I'm writing an inspec test that needs to check certain fields from a JSON file. I'm new to Ruby and have basically only learned enough to write unit tests so far. How do I look inside a the body of JSON if the body is a list of items with identical keys?
[19:32:46] cereal: So, like, {"status" = 200, "body" = [{"key" = asdf}, {"key" = sdfg}, {"key" = qwert}]}
[19:33:00] fphilipe: has joined #ruby
[19:33:35] banisterfiend: has joined #ruby
[19:35:15] amateur_rubyist: has joined #ruby
[19:36:10] queip: has joined #ruby
[19:38:47] houhoulis: has joined #ruby
[19:39:26] havenwood: cereal: For example, if you have: {"status"=>200, "body"=>[{"key"=>"asdf"}, {"key"=>"sdfg"}, {"key"=>"qwert"}]}
[19:40:15] havenwood: cereal: h.dig('body', 2, 'key') #=> "qwert"
[19:40:35] agent_white: has joined #ruby
[19:40:44] havenwood: &24>> {"status"=>200, "body"=>[{"key"=>"asdf"}, {"key"=>"sdfg"}, {"key"=>"qwert"}]}.dig('body', 2, 'key')
[19:40:47] rubydoc: # => "qwert" (https://carc.in/#/r/7fc2)
[19:41:45] havenwood: cereal: Or, pass `symbolize_names: true` when you deserialize the JSON, so you can use Symbol keys.
[19:41:55] havenwood: cereal: h.dig(:body, 2, :key)
[19:43:03] havenwood: &24>> JSON.parse("{\"status\":200,\"body\":[{\"key\":\"asdf\"},{\"key\":\"sdfg\"},{\"key\":\"qwert\"}]}", symbolize_keys: true)
[19:43:07] rubydoc: stderr: -e:2:in `<main>': uninitialized constant JSON (NameError) (https://carc.in/#/r/7fc3)
[19:43:08] havenwood: &24>> require 'json'; JSON.parse("{\"status\":200,\"body\":[{\"key\":\"asdf\"},{\"key\":\"sdfg\"},{\"key\":\"qwert\"}]}", symbolize_keys: true)
[19:43:09] rubydoc: # => {"status"=>200, "body"=>[{"key"=>"asdf"}, {"key"=>"sdfg"}, {"key"=>"qwert"}]} (https://carc.in/#/r/7fc4)
[19:43:30] havenwood: &24>> require 'json'; JSON.parse("{\"status\":200,\"body\":[{\"key\":\"asdf\"},{\"key\":\"sdfg\"},{\"key\":\"qwert\"}]}", symbolize_names: true)
[19:43:30] rubydoc: # => {:status=>200, :body=>[{:key=>"asdf"}, {:key=>"sdfg"}, {:key=>"qwert"}]} (https://carc.in/#/r/7fc5)
[19:43:43] havenwood: {:status=>200, :body=>[{:key=>"asdf"}, {:key=>"sdfg"}, {:key=>"qwert"}]}.dig(:body, 2, :key)
[19:43:45] djdduty: has joined #ruby
[19:43:50] havenwood: #=> "qwert"
[19:52:15] orbyt_: has joined #ruby
[19:54:06] drale2k_: has joined #ruby
[20:05:22] fphilipe: has joined #ruby
[20:06:46] VeryBewitching: has joined #ruby
[20:09:51] queip: has joined #ruby
[20:22:45] mynameisdebian: has joined #ruby
[20:26:52] mynameisdebian: havenwood: A while back I was having an issue where my Apache server was failing to respond to a Slack message quickly enough, and you advised me to do a Process.detach fork{}, and put the code that was taking a long time inside of the braces. However, I am finding that my Apache server is still waiting for the child process to complete before closing the connection, even though the script itself continues processing immediately without waiting for
[20:26:53] mynameisdebian: the code in the block to complete. I am wondering if you have any ideas why that is happening or how I might be able to fix it?
[20:32:55] queip: has joined #ruby
[20:38:51] leitz: has joined #ruby
[20:38:53] mynameisdebian: If I have some JSON that I would like to be the body of an HTTP request, I can I pass that JSON to curl via a system call?
[20:39:01] mynameisdebian: "how can I pass"
[20:43:57] ur5us: has joined #ruby
[20:48:14] leftylink: hmm. I usually use the -d flag for that.
[21:06:01] nius: Hi, in when I redefine the [] method in the main Object, I can only access it using self[], not just []
[21:06:03] nius: why is that?
[21:07:25] banisterfiend: has joined #ruby
[21:09:32] ElFerna: has joined #ruby
[21:11:51] ElFerna: has joined #ruby
[21:18:26] skyikot: has joined #ruby
[21:18:26] rainer_tm: has joined #ruby
[21:19:01] ramfjord: mynameisdebian: regarding your asnc processing load for apache responses: when I do that sort of thing I would prefer to write the work units to a queue, and have a set of workers popping items off that queue for processing asynchronously. Forking on each one seems like it would take a while just because forking itself takes a while. It would be more infra changes though.
[21:20:36] ramfjord: depending on your req/second, you could use a PG database, or redis/rabitMQ, or just a ruby in memory Queue connected via a unix pipe (though beware pipe buffer size is not very big)
[21:21:22] ramfjord: maybe even SQLite if it's small enough and you only have 1 web writer process
[21:26:05] ramfjord: RE. shelling out to curl (system call has a kind of specific meaning that I don't think you're using), should just be able to do something like: https://gist.githubusercontent.com/ramfjord/85581a49e19addcf2cf8066c61312bf4/raw/0d9f75ad0f6c65cd87f710c6990b82607b006302/curl_with_data.rb
[21:26:40] ramfjord: but you should definitely use an HTTP library for that instead of shelling out
[21:26:56] ramfjord: I like https://github.com/httprb/http
[21:27:00] ramfjord: but there are many good ones
[21:32:43] angelixd: has joined #ruby
[21:35:07] Milos: has joined #ruby
[21:39:47] Milos: has joined #ruby
[21:42:10] queip: has joined #ruby
[21:49:35] DTZUZO: has joined #ruby
[21:50:02] fphilipe: has joined #ruby
[21:50:42] Milos: has joined #ruby
[21:54:25] AJA4350: has joined #ruby
[22:02:17] mynameisdebian: ramfjord, the issue is that in order to push my code I have to request a merge and wait like a day, which makes it difficult at this stage to break up my program into worker queues. The reason I'm shelling out instead of just using an HTTP library for this is that it is a CGI script running on Apache that is supposed to receive Slack messages. Slack throws an error in the channel if a response is not received within 3 seconds, and Apache waits for
[22:02:17] mynameisdebian: Ruby to exit before sending the response. I've tried this numerous way but I don't believe it will work any other way (besides worker queues like you suggested, but I'm trying to avoid that)
[22:18:07] Milos: has joined #ruby
[22:32:45] mynameisdebian: How can I execute a shell command in my Ruby CGI script without Apache waiting for the shell command to finish? My CGI script receives messages from Slack and must respond with "200 OK" within 3 seconds, but Apache waits until everything has resolved before sending the 200 message.
[22:37:00] x86sk: has joined #ruby
[22:47:03] sameerynho: has joined #ruby
[22:47:22] luminousnine: has joined #ruby
[22:49:55] bambanx: has joined #ruby
[22:54:41] bambanx: has joined #ruby
[23:07:47] dviola: has joined #ruby
[23:10:58] chalkmonster: has joined #ruby
[23:22:59] AJA4350: has joined #ruby
[23:36:15] Nicmavr: has joined #ruby
[23:46:07] havenwood: mynameisdebian: http://perl.apache.org/docs/1.0/guide/performance.html#Avoiding_Zombie_Processes
[23:47:07] havenwood: mynameisdebian: Sometimes you just need to ignore your zombie grandchildren...
[23:49:14] havenwood: mynameisdebian: I think you'd find that Rack with Threads is way simpler to work with, but CGI with Processes does lead you down an interesting path at least.
[23:50:43] havenwood: mynameisdebian: Double forking is a trick that might work in your case. A worker queue is a more conventional approach.
[23:51:50] havenwood: mynameisdebian: https://gist.github.com/fogus/1216429
[23:52:22] havenwood: mynameisdebian: https://dev.to/davidk01/double-fork-and-exec-in-ruby-31kc
[23:53:19] havenwood: mynameisdebian: I suspect that pattern will work as you'd like it. I still advise checking out Rack.
[23:54:03] havenwood: IIR, Process.daemon does a double fork these days.