« Back to channel list

#ruby - 03 December 2018

« Back 1 day Forward 1 day »
[00:00:43] jaddison: has joined #ruby
[00:16:49] arescorpio: has joined #ruby
[00:18:10] dbz: has joined #ruby
[00:23:29] white_lilies: has joined #ruby
[00:24:03] riotjones: has joined #ruby
[00:25:20] jaddison: has joined #ruby
[00:26:38] Puffball: has joined #ruby
[00:28:19] arescorpio: has joined #ruby
[00:34:12] hutch: has joined #ruby
[00:43:02] themsay: has joined #ruby
[00:46:06] Arkantos: has joined #ruby
[00:57:03] bambanx: has joined #ruby
[00:57:50] darkhanb: has joined #ruby
[01:11:25] Tom-_: has joined #ruby
[01:12:04] ua: has joined #ruby
[01:12:50] patr0clus: has joined #ruby
[01:13:36] jottr: has joined #ruby
[01:15:10] \void: has joined #ruby
[01:17:45] phaul: has joined #ruby
[01:18:44] orbyt_: has joined #ruby
[01:22:51] matti: has joined #ruby
[01:33:32] ua: has joined #ruby
[01:33:45] white_lilies: has joined #ruby
[01:58:08] woodruffw: has joined #ruby
[02:09:04] thi: has joined #ruby
[02:12:21] esrse: has joined #ruby
[02:17:15] hutch: has joined #ruby
[02:34:16] tdy: has joined #ruby
[02:37:05] bambanxx: has joined #ruby
[02:37:06] akaiiro: has joined #ruby
[02:39:38] cnsvc: has joined #ruby
[02:52:16] nicesignal: has joined #ruby
[02:56:10] StarLord__: has joined #ruby
[03:14:10] hutch: has joined #ruby
[03:14:28] jottr: has joined #ruby
[03:26:05] riotjones: has joined #ruby
[04:00:23] awkwords: has joined #ruby
[04:00:46] riotjones: has joined #ruby
[04:05:54] cnsvc: has joined #ruby
[04:08:37] braincrash: has joined #ruby
[04:14:59] white_lilies: has joined #ruby
[04:17:15] peirama: has joined #ruby
[04:17:26] hutch: has joined #ruby
[04:26:22] peirama: has joined #ruby
[04:32:11] awkwords: has joined #ruby
[04:33:46] Ring0`: has joined #ruby
[04:33:53] akaiiro: has joined #ruby
[04:35:23] Ring0`: How do I write a map(or something else) so that I preserve result from previous iteration over a new one? Eg [+1, +2, +3] => [1, 3, 6]
[04:35:26] peirama: has joined #ruby
[04:36:02] Ring0`: so like [1,2,3].map { |n| previous_num_but_initially_0 + n }
[04:44:33] peirama: has joined #ruby
[04:46:35] za1b1tsu: has joined #ruby
[04:52:07] riotjones: has joined #ruby
[04:53:29] peirama: has joined #ruby
[04:55:55] riotjoe: has joined #ruby
[05:02:42] tectonic: has joined #ruby
[05:02:46] peirama: has joined #ruby
[05:04:32] Iambchop: Ring0`: > n=0; [1,2,3].map{|a| n+=a} => [1, 3, 6]
[05:04:32] Iambchop: Ring0`: > [1,2,3].each_with_object([0]).map{|a,n| n[0]+=a} #=> [1, 3, 6]
[05:11:39] Tom-_: has left #ruby: ("Leaving")
[05:11:45] Tom-_: has joined #ruby
[05:11:56] peirama: has joined #ruby
[05:14:54] peirama: has joined #ruby
[05:15:19] jottr: has joined #ruby
[05:23:55] Iambchop: one more before bed> [1,2,3].inject([0]){|a,b| a<<b+a[-1]}[1..-1] # => [1, 3, 6]
[05:24:09] Iambchop: > [1,2,3].inject([]){|a,b| a<<b+a[-1].to_i} #=> [1, 3, 6]
[05:35:26] baweaver: Ring0`: Advent of code?
[05:35:52] baweaver: Probably reduce
[05:38:05] desnudopenguino: ACTION winks at baweaver
[05:39:04] awkwords: has joined #ruby
[05:43:48] baweaver: ACTION trips over tachyons
[05:43:51] baweaver: Ah, the next story is posting later this week!
[05:43:53] baweaver: https://twitter.com/keystonelemur/status/1069426306104750080
[05:44:02] conta: has joined #ruby
[05:44:20] baweaver: desnudopenguino: the lemurs are going to save Christmas!
[05:49:07] KrzaQ: if I want a jit here and now, what are my options, if any? Googling ruby with jit now only gives me 2.6 results
[05:51:06] malen: has joined #ruby
[05:52:13] ByronJohnson: has joined #ruby
[05:52:53] desnudopenguino: baweaver: oh snap, you're using the plum keyset as well?
[05:57:26] baweaver: On my 60%, yes.
[05:57:38] baweaver: Stock MD Ctrl on the other one, like the feel of them.
[05:57:45] baweaver: Box Dark Yellows
[06:15:08] malen: has joined #ruby
[06:28:14] aupadhye: has joined #ruby
[06:29:21] jcarl43: has joined #ruby
[06:29:26] reber: has joined #ruby
[06:31:49] white_lilies: has joined #ruby
[06:47:25] conta1: has joined #ruby
[06:51:07] conta1: has joined #ruby
[06:57:02] dinfuehr_: has joined #ruby
[06:58:15] ogres: has joined #ruby
[07:04:29] peirama: has joined #ruby
[07:09:21] dbz: has joined #ruby
[07:12:04] dionysus69: has joined #ruby
[07:14:34] Ring0`: baweaver: haha how did you know :^)
[07:14:59] Ring0`: damn I've been cuckd
[07:15:05] baweaver: Sounded familiar.
[07:15:14] Ring0`: now I can't ask questions on how to make my code even more unreadible
[07:16:18] jottr: has joined #ruby
[07:17:03] nolanv: has joined #ruby
[07:21:46] dedRabbit: has joined #ruby
[07:27:59] dinfuehr: has joined #ruby
[07:28:24] riotjones: has joined #ruby
[07:29:45] dedRabbit: cat: /a/: No such file or directory
[07:32:31] dedRabbit: has joined #ruby
[07:38:50] conta: has joined #ruby
[07:40:25] dbz: has joined #ruby
[07:45:53] dedRabbit: has joined #ruby
[07:46:03] bmurt: has joined #ruby
[07:51:25] jottr: has joined #ruby
[07:52:44] sleetdrop: has joined #ruby
[07:56:13] kapil____: has joined #ruby
[07:58:20] CrazyEddy: has joined #ruby
[08:01:56] graphene: has joined #ruby
[08:29:34] clemens3: has joined #ruby
[08:31:33] DTZUZO: has joined #ruby
[08:34:58] graphene: has joined #ruby
[08:36:16] dbz: has joined #ruby
[08:54:41] Nicmavr: has joined #ruby
[08:56:59] graphene: has joined #ruby
[09:05:56] keden: has joined #ruby
[09:06:53] lucasb_: has joined #ruby
[09:07:36] vondruch: has joined #ruby
[09:21:02] cabotto: has joined #ruby
[09:22:19] aufi: has joined #ruby
[09:26:17] aupadhye: has joined #ruby
[09:30:04] riotjones: has joined #ruby
[09:32:15] jottr: has joined #ruby
[09:38:39] Guest21835: has joined #ruby
[09:40:41] awkwords: has joined #ruby
[09:55:23] riotjones: has joined #ruby
[10:00:40] cnsvc: has joined #ruby
[10:02:56] graphene: has joined #ruby
[10:06:41] LinuxKnight: has joined #ruby
[10:12:37] aupadhye: has joined #ruby
[10:18:33] phaul: has joined #ruby
[10:27:53] dinfuehr: has joined #ruby
[10:29:29] alem0lars: has joined #ruby
[10:37:02] alem0lars: has joined #ruby
[10:42:39] themsay: has joined #ruby
[10:46:33] endemic: has joined #ruby
[10:47:09] cnsvc: has joined #ruby
[10:49:02] lxsameer: has joined #ruby
[11:01:03] piks3l: has joined #ruby
[11:12:10] _whitelogger: has joined #ruby
[11:15:51] alxd: has joined #ruby
[11:16:45] alxd: Hey! I'm quite an experienced Pythonista / JS dev and I'd like to learn Ruby and Ruby on Rails to contribute to Mastodon. Can you recommend any sources? Learn Ruby The Hard Way? Codecademy? How much should I focus on pure Ruby, how much on Rails?
[11:16:45] alem0lars: has joined #ruby
[11:17:37] jetchisel: has joined #ruby
[11:19:32] fluxAeon: has joined #ruby
[11:22:26] roshanavand: has joined #ruby
[11:22:47] sarink: has joined #ruby
[11:24:05] x0F: has joined #ruby
[11:27:23] jetchisel: has joined #ruby
[11:31:35] cnsvc: has joined #ruby
[11:33:26] c0mrad3: has joined #ruby
[11:36:29] blackmesa: has joined #ruby
[11:37:16] paulscoder: has joined #ruby
[11:37:30] blackmesa1: has joined #ruby
[11:39:25] mangold: has joined #ruby
[11:42:23] blackmesa: has joined #ruby
[11:44:37] endemic: has joined #ruby
[11:44:39] y0u: has joined #ruby
[11:58:21] KeyJoo: has joined #ruby
[12:07:12] rkoller: has joined #ruby
[12:35:45] cnsvc: has joined #ruby
[12:53:34] conta: has joined #ruby
[13:01:13] yadunut: has joined #ruby
[13:06:59] cgajardo: has joined #ruby
[13:20:03] DTZUZO: has joined #ruby
[13:26:33] vondruch_: has joined #ruby
[13:27:20] AJA4350: has joined #ruby
[13:27:28] mangold: has joined #ruby
[13:35:59] conta1: has joined #ruby
[13:41:09] cnsvc: has joined #ruby
[13:41:45] alem0lars: has joined #ruby
[13:43:02] akem: has joined #ruby
[13:45:54] mostlybadfly: has joined #ruby
[13:55:32] loveablelobster: has joined #ruby
[13:57:00] loveablelobster: has joined #ruby
[14:10:03] eclm: has joined #ruby
[14:16:09] peirama: has joined #ruby
[14:19:17] loveablelobster: has left #ruby: ("Textual IRC Client: www.textualapp.com")
[14:20:41] jcalla: has joined #ruby
[14:25:32] vonfry: has joined #ruby
[14:25:52] cabotto: has joined #ruby
[14:35:54] orbyt_: has joined #ruby
[14:37:35] polishdub: has joined #ruby
[14:44:44] blackmesa: has joined #ruby
[14:45:00] hutch: has joined #ruby
[14:45:43] white_lilies: has joined #ruby
[14:48:08] SeepingN: has joined #ruby
[14:48:31] Rapture: has joined #ruby
[14:49:22] mangold: has joined #ruby
[14:54:01] lxsameer: has joined #ruby
[14:57:51] crankharder: has joined #ruby
[15:00:41] jeffreylevesque: has joined #ruby
[15:04:10] phaul: has joined #ruby
[15:09:55] piks3l: Hey alxd ! If you already know Django, RoR shouldn't be too hard. The structure is a bit different but it's still an MVC. If you're really new to Ruby syntax, I'd say Codecademy is nice to start. As you already know some languages, I'd say it's to familiarize yourself with the syntax
[15:10:05] cnsvc: has joined #ruby
[15:10:20] piks3l: Also Mastodon is using React which, to me, is still confusing
[15:10:35] piks3l: if you have questions about RoR, ping me :)
[15:10:46] piks3l: I'm not senior, but I can help
[15:10:48] alxd: piks3l, I'm fluent in React and Redux (some Haskell), so I've already scored some easy hits there
[15:10:56] piks3l: Oh cool !
[15:11:00] alxd: I'm learning how to sanitize HTML in HAML now :D
[15:11:11] piks3l: that sounds awesome !
[15:16:00] gnufied: has joined #ruby
[15:16:01] piks3l: alxd if you find good documentation on how to connect React/Redux to RoR, I'm interested :p
[15:16:52] alxd: piks3l, I'm kind of an expert on React, so I may help ;)
[15:16:53] hutch: has joined #ruby
[15:16:57] alxd: What do you mean by connect?
[15:17:12] piks3l: Well, i'd like to have a backend in RoR and front in React
[15:17:24] piks3l: but I'm failing at finding good documentation on that
[15:17:38] alxd: That's pretty general. Do you want a Single Page App?
[15:17:43] alxd: Do you want something isomorphic?
[15:18:22] alxd: The easiest thing would be to write RoR with REST / graphQL API and have a React app get data from there, unaware if it's RoR, Django or some Java app
[15:18:38] piks3l: No, not a single page app, something more complex. The default front for RoR (ERB) doesn't translate well on mobile and I'm looking at solution on that
[15:18:42] piks3l: Yeah exactly that
[15:19:01] alxd: piks3l, mobile has nothing to do with RoR, it's CSS only ;)
[15:19:11] alxd: unless you want React Native to have mobile /apps/
[15:19:20] piks3l: yes, React Native :)
[15:19:36] piks3l: Sorry if I'm not clear ahah
[15:19:53] alxd: Ah. So just use React Native with REST / GraphQL, nothing more
[15:20:09] alxd: Do you know how to make your API in RoR?
[15:20:38] phaul: I don't think you can easily connect the RoR REST to graphql.
[15:20:48] alxd: So if you want to make Android / iOS apps, you just use React Native and query the endpoints from your Rails
[15:21:17] alxd: https://blog.codeship.com/how-to-implement-a-graphql-api-in-rails/ and https://github.com/rmosolgo/graphql-ruby give you GraphQL in Rails
[15:21:27] piks3l: coooool !
[15:21:36] phaul: I just did an small example app with Sinatra/graphql/react. My impression is that graphql-rub sits at the middleware level
[15:21:37] alxd: I used one in a production app and I have to say: if you write both frontend and backend, stay with REST
[15:22:20] alxd: graphQL is great if you cannot make backend changes too often, but for me it was cumbersome
[15:22:46] phaul: but it sort of makes Rails pointless for it.
[15:23:26] phaul: if you are interested https://github.com/phaul/books. Simplest example app..
[15:23:38] phaul: but no Rails.
[15:24:36] alxd: well, something needs to manage credentials
[15:24:59] alxd: I don't know if Rails is the right tool, but with Django being comparable I would use Django just to manage APIs, with nothing to render client-side
[15:25:08] piks3l: Everytime I use Sinatra, I tend to plan for no scaling because it becomes really painful from there
[15:28:46] Inline: has joined #ruby
[15:37:55] vondruch: has joined #ruby
[15:38:47] akemot: has joined #ruby
[15:41:17] kapil____: has joined #ruby
[15:41:40] bmurt: has joined #ruby
[15:42:02] spiette: has joined #ruby
[15:42:13] bmurt: has joined #ruby
[15:45:24] phaul: alxd: is Django primarily REST? if so in Django don't you end up implementing 2 APIs one REST one graphql? Or are there ways to share code between them? And if so can you for instance share per resource authorization?
[15:46:02] alxd: phaul, Django uses rest with Django-Rest-Framework
[15:46:03] rippa: has joined #ruby
[15:46:14] alxd: you can just install Graphene /instead/ of DRF
[15:47:14] alxd: if nothing changed in the latest versions, I don't recall Django _needing_ to have REST
[15:47:55] alxd: As I said, I use Django mainly for the ease of authentication and administration in my project. It doesn't scale perfectly, but it's modular when it comes to APIs
[15:50:15] roshanavand: has joined #ruby
[15:54:28] _phaul: has joined #ruby
[15:54:37] kaleido: has joined #ruby
[15:55:25] vondruch: has joined #ruby
[15:59:20] Fridtjof: has joined #ruby
[16:00:03] pistachio: has joined #ruby
[16:00:36] LightStalker: has joined #ruby
[16:07:42] phaul: so for instance in Rails I handled authorization with CanCanCan (disclaimer: I haven't used rails for a while now) https://github.com/CanCanCommunity/cancancan If you look at the Readme you will see how the whole thing is entangled in REST controller ideas.. But I guess you can define an endpoint to graphql, and when graphql-ruby calls out to the DB layer you can insert a manual if can? :update, resource ... or
[16:07:43] phaul: similar and raise Exceptions when needed
[16:08:46] phaul: but to me it feels you just mostly need active_record (the ORM layer from Rails).
[16:08:58] bak1an: has joined #ruby
[16:17:02] akaiiro: has joined #ruby
[16:18:52] roshanavand: has joined #ruby
[16:20:28] Renich_: has joined #ruby
[16:24:25] sarink: has joined #ruby
[16:26:53] RougeR: has joined #ruby
[16:27:24] RougeR: heya, does anyone know how you might add self from a class method while doing something with the class
[16:27:31] RougeR: i know thats horribly explained
[16:27:53] RougeR: but im dealing with a code base where i THINK something like that might be happening. but i cant find where
[16:29:13] phaul: RougeR: maybe a small example snippet that demonstrates what you mean
[16:30:46] RougeR: phaul, honestly im not sure how this works. ill try explain it though
[16:31:04] RougeR: so im using resque and redis as a taskengine
[16:31:21] RougeR: except we have our own custom tasks which can be put into json workflows and chained together
[16:31:36] RougeR: standard resque tasks rely on the self.perform to be processed first
[16:31:48] RougeR: our resque tasks just have perform instead of self.perform
[16:32:22] RougeR: resque-retry does not seem to want to play game with our custom task classes, but works fine with regular resque classes
[16:32:58] RougeR: my guess is there is something missing between the two
[16:33:13] RougeR: and upon retry its not recognized as a valid resque class maybe?
[16:33:43] akemot: has joined #ruby
[16:34:32] uplime: has joined #ruby
[16:37:09] phaul: Stab in the dark as I dont know these libs: but ... the environment expects an object that respond_to(:perform). If it's a class and :perform is a method of the class so be it. If it's your custom object, that could be fine too, but you need to instantiate it? Like instead of using Myclass (standard case), you have to give the environment Myclass.new (special case)?
[16:37:54] RougeR: heya phaul yes you are right, but i dont have control of this lib
[16:38:04] RougeR: ive also found out where its calling .perform
[16:38:11] RougeR: but i dont know how to fix my issue
[16:38:36] RougeR: im loathe to share application code from qork
[16:38:54] RougeR: but simply
[16:38:55] RougeR: klass = Object::const_get(@task.class_name).new(@task.input)
[16:39:00] RougeR: @task.output = klass.perform
[16:39:10] RougeR: is whats being done
[16:39:17] RougeR: ive no clue of the solution yet
[16:42:24] phaul: sure, don't get into trouble :) can you paste the error message though?
[16:42:27] sarink: has joined #ruby
[16:42:59] RougeR: phaul, no error
[16:43:09] RougeR: it just doesnt get retried
[16:43:17] cnsvc: has joined #ruby
[16:43:28] phaul: ah. thats a bummer :)
[16:43:43] RougeR: i need to somehow turn the perform method into a class method while its being retried?
[16:44:21] RougeR: i dont think anyone left at my company fully understands how the scheduling/task engine part works
[16:44:30] RougeR: or else they would have told me this would be an issue last week
[16:46:38] phaul: where can you add behaviour, what code can you modify in this flow? I can help with turning an instance method into class method if that helps ?
[16:47:05] RougeR: so a task gets loaded by a worker
[16:47:19] RougeR: and during that process. quite a few complex ruby bits are done
[16:47:25] RougeR: and yeah that might help
[16:47:36] RougeR: it might be a case of i want to use it as a class method if it has failed once
[16:47:50] RougeR: so that would be helpful to know
[16:48:50] phaul: so assuming that the instance method does not need any state from the instance and does not refer to self :) it's just a bit of metaprogramming. I write up an example. Otherwise if those things are not true, it's not even possible
[16:49:13] RougeR: im honestyly, not quite sure
[16:49:15] RougeR: i dont think it does
[16:49:21] RougeR: it is metaprogramming just about
[16:49:30] lunarkitty7: has joined #ruby
[16:49:57] RougeR: tbh im just glad i spotted where the issue was today, i could have gone round for hours more trying to find it
[16:50:55] RougeR: its this line here
[16:51:04] RougeR: @task.output = klass.perform
[16:51:09] AJA4350: has joined #ruby
[16:51:23] RougeR: klass = Object::const_get(@task.class_name).new(@task.input)
[16:51:23] RougeR: Object.send(:remove_const, @task.class_name.to_sym) if klass
[16:51:41] RougeR: between that is 6 line of setup/logging etc
[16:51:46] RougeR: and config
[16:52:21] RougeR: why would you want to remove the constant from the class
[16:59:25] phaul: RougeR: I don't know... but https://gist.github.com/83b4d24290271069a0364f8ef10a4875 demonstrates how one can hack a method into a class that's based on an instance method
[17:00:17] phaul: (argument passing not included, but could be done)
[17:01:27] RougeR: thanks phaul
[17:02:11] RougeR: phaul, how would you do that if the classes were called dynamically
[17:02:58] RougeR: wait i think i see how
[17:06:08] cd: has joined #ruby
[17:07:48] tdy: has joined #ruby
[17:08:40] ua: has joined #ruby
[17:09:55] graphene: has joined #ruby
[17:10:32] peirama: has joined #ruby
[17:10:38] cthulchu_: has joined #ruby
[17:13:04] gix: has joined #ruby
[17:14:40] jaddison: has joined #ruby
[17:15:29] phaul: apart from that this "works" it will give redefinition of method foo erros on multiple calls of boo, and even worse it will leak memory as the instances that received :boo can't be freed _ever_ while the process running.
[17:15:52] phaul: it's a hack..
[17:19:42] RougeR: phaul, it feels like trying to unravel spaghetti
[17:19:48] peirama: has joined #ruby
[17:21:21] phaul: yeah. I agree. maybe the best is to wait for the authors, if that's an option
[17:22:00] RougeR: they are long gone, however got 2 senior devs back wednesday
[17:22:32] RougeR: they know ther stuff way better than me, but their ruby knowledge is only about on par with me
[17:22:58] RougeR: phaul, i duno its progress. I now think i know where the issue is.
[17:23:11] RougeR: before it was just a mystery with no errors
[17:23:17] peirama: has joined #ruby
[17:27:42] RougeR: im not being daft here am i
[17:27:47] RougeR: klass = Object::const_get(@task.class_name).new(@task.input)
[17:27:51] RougeR: @task.output = klass.perform
[17:28:07] RougeR: is that just calling the peform method and assigning the result to output?
[17:28:38] RougeR: but its actually MyClass.perform
[17:28:49] phaul: that's what it does, but it get stuff out of @task. @task.class_name, @task.input, etc
[17:28:52] RougeR: instead of MyClass.new.perform
[17:29:33] phaul: like @task might be an openstruct, and if you fill class_name with MyClass then yes.
[17:29:33] RougeR: so it takes an instance of that task (i.e @task = MyClass.new)
[17:29:42] RougeR: @task is a class
[17:30:05] RougeR: yeah thats gotta be how it works
[17:30:13] RougeR: it just sorta clicked, no idea how to fix it
[17:31:05] phaul: &>> Integer.class_name
[17:31:07] rubydoc: # => undefined method `class_name' for Integer:Class (NoMethodError) (https://carc.in/#/r/5om2)
[17:31:14] phaul: &>> 1.class_name
[17:31:14] rubydoc: # => undefined method `class_name' for 1:Integer (NoMethodError) (https://carc.in/#/r/5om3)
[17:32:00] RougeR: so complicated...
[17:32:24] phaul: can you print @task.inspect ? @task.class ?
[17:32:35] RougeR: i know what they are
[17:33:02] RougeR: hang on ill show ya
[17:33:08] RougeR: ive got an internal mock task
[17:34:03] sarink: has joined #ruby
[17:35:14] conta1: has joined #ruby
[17:35:16] RougeR: this is one of our custom tasks
[17:35:24] RougeR: https://dpaste.de/LMKP
[17:37:05] RougeR: and this is a standard task
[17:37:06] RougeR: https://dpaste.de/BYCS
[17:38:57] phaul: so what's @task? @task == MockTask ? and .class_name is inherited from CustomTask? or where is it coming from?
[17:39:17] RougeR: @task is an active record relation
[17:39:24] RougeR: with a load of information about the task
[17:39:32] RougeR: then klass becomes an instance of @task
[17:39:57] RougeR: explaining that to you made it clearer to me actually
[17:40:14] RougeR: CustomTask is a load of logic for chaining tasks and varies other things
[17:41:17] RougeR: why the feck is this line here
[17:41:19] phaul: well, rubber-duck debug ... sorry for otherwise not being much help, obiously you have code you can't disclose, and Im just speculating a lot ..
[17:41:42] RougeR: phaul, yeah im really sorry. i know its annoying trying to discuss it without the code
[17:41:48] RougeR: Object.send(:remove_const, @task.class_name.to_sym) if klass
[17:41:53] RougeR: still dont get the point in that line
[17:42:03] RougeR: phaul, its quite a complex custom job scheduling engine
[17:42:09] RougeR: and no one put any comments anywhere
[17:42:22] RougeR: because "ruby code should be self documenting"...and other myths
[17:42:50] baweaver: Mind that's not Ruby
[17:42:56] baweaver: That's just lazy programmers
[17:43:02] RougeR: yeah, i dont know
[17:43:09] RougeR: im a jr dev, i dont get much say
[17:43:20] RougeR: i much prefer to have a small amount of comments in key complex areas
[17:43:20] baweaver: We have YARDoc and other things for a reason
[17:43:36] RougeR: baweaver, is that a documentation/comment maintinence thing?
[17:43:41] RougeR: .g YARDoc
[17:44:35] RougeR: ahhh ive seen it before
[17:44:55] baweaver: We're about to implement policy here that a PR without requisite YARDoc breaks CI
[17:45:05] RougeR: mm i like that
[17:45:09] baweaver: (fair warning havenwood ^)
[17:45:26] RougeR: baweaver, yeah i have had a 'fun' first job for a new dev
[17:45:44] RougeR: custom sinatra clusterfuck of a project
[17:45:47] baweaver: Here's a secret
[17:45:51] baweaver: Everything's hacky
[17:45:55] RougeR: ACTION cries
[17:45:58] baweaver: You just get good at managing the chaos
[17:46:13] RougeR: yeah, its got easier
[17:46:23] bmurt: has joined #ruby
[17:46:29] RougeR: im past my probation, so cant be doing too bad haha
[17:47:16] baweaver: You probably just have a jobs framework that tries to be smart about dispatching actions
[17:47:23] RougeR: we use resque
[17:47:37] baweaver: Want some fun Ruby magic shenanigans?
[17:47:39] RougeR: but weve added workflow functionality and our own system on top
[17:47:46] baweaver: well, I say magic, but reduce is pretty useful
[17:47:55] RougeR: reduce is pretty good
[17:47:58] RougeR: not used it in a while
[17:48:07] baweaver: Did an entire talk on it: https://www.youtube.com/watch?v=x3b9KlzjJNM&t=1s
[17:48:13] baweaver: and illustrated it with cartoon lemurs
[17:48:25] RougeR: is it the same as inject?
[17:48:44] baweaver: alias, so yeah
[17:48:56] RougeR: yeah, i know it more as inject. just what i learnt
[17:49:00] awkwords: has joined #ruby
[17:49:19] RougeR: even (1..10).inject(:+) is quite nice
[17:49:35] baweaver: did you know that every other Enumerable function can be implemented in terms of reduce?
[17:49:43] RougeR: i did not
[17:49:46] baweaver: Now we have (1..10).sum in 2.4+
[17:49:49] RougeR: but i will add the talk you linked
[17:49:55] baweaver: you'll enjoy that talk then
[17:50:24] RougeR: thanks :)
[17:50:37] RougeR: ill check it our tommorow, just finishing up for the day. will ping you my thoughts :)
[17:50:44] baweaver: Also most of the medium articles over on medium.com/@baweaver go over Ruby topics in a decent amount of depth
[17:50:45] baweaver: Lemme know if you'd like to see a topic covered.
[17:50:54] RougeR: im still a bit shit with yielf
[17:51:07] RougeR: i know how it works, but i can never see when to use it
[17:51:18] RougeR: and i never see it used in other PRs
[17:56:09] al2o3-cr: i see alot of ["1\n", "2\n", "3\n"].map(&:to_i).sum when you can do ["1\n", "2\n", "3\n"].sum &:to_i
[17:56:50] RougeR: you just removed the brackets right?
[17:56:54] reber: has joined #ruby
[17:56:59] reber__: has joined #ruby
[17:57:06] RougeR: im personally not a fan of removing brackets in ruby unless its a DSL
[17:57:33] al2o3-cr: RougeR: i didn't use map.
[17:57:55] al2o3-cr: sum takes a block.
[17:58:06] maryo: has joined #ruby
[17:58:08] RougeR: oh sorry i see the difference now
[17:58:31] al2o3-cr: no worries.
[17:58:36] RougeR: yeah the second way is nice, well spotted
[17:58:41] RougeR: if you add brackets!
[17:59:15] RougeR: curious what people here think about over usage of ternary and when it should be used.
[17:59:16] al2o3-cr: choose what suits you, i do =)
[17:59:30] RougeR: al2o3-cr, yeah i do, or i follow the coding style for the project
[17:59:59] RougeR: i just dislike omitting brackets/braces/terminations n general
[18:00:06] RougeR: looking at you python...
[18:00:21] al2o3-cr: RougeR: yeah, stick to a style you like/follow.
[18:00:44] patr0clus: has joined #ruby
[18:01:21] eckhardt_: has joined #ruby
[18:01:52] baweaver: al2o3-cr: lines.sum(&:to_i) :D
[18:02:05] baweaver: Sum takes a block function, which is super cheating
[18:02:21] baweaver: You said that. Ignore me
[18:02:26] nicesignal: has joined #ruby
[18:02:44] baweaver: ACTION needs coffee
[18:02:47] cow[moo]: has joined #ruby
[18:03:02] baweaver: Keep an eye on this for more RubyConf talks to watch - https://twitter.com/keystonelemur/status/1069650750979039232
[18:03:29] RougeR: catchya later
[18:03:50] orbyt_: has joined #ruby
[18:05:47] \void: has joined #ruby
[18:14:13] cow[moo]: has joined #ruby
[18:15:09] dbz: has joined #ruby
[18:16:58] GodFather: has joined #ruby
[18:19:57] za1b1tsu: has joined #ruby
[18:20:38] za1b1tsu: has joined #ruby
[18:20:39] sanscoeur: has joined #ruby
[18:20:49] clemens3: has joined #ruby
[18:21:17] chouhoulis: has joined #ruby
[18:33:52] hiroaki: has joined #ruby
[18:35:25] jottr: has joined #ruby
[18:35:48] dellavg_: has joined #ruby
[18:37:39] lxsameer: has joined #ruby
[18:41:54] sarink: has joined #ruby
[18:44:03] Aqo: has joined #ruby
[18:50:47] ivanskie: has joined #ruby
[19:00:42] Eiam: has joined #ruby
[19:02:50] akaiiro: has joined #ruby
[19:07:42] conta1: has joined #ruby
[19:10:21] kent\n: has joined #ruby
[19:12:03] piks3l: has joined #ruby
[19:25:07] reber: has joined #ruby
[19:33:25] RougeR: has joined #ruby
[19:34:51] Nicmavr: has joined #ruby
[19:36:46] RougeR: has joined #ruby
[19:39:49] patr0clus: has joined #ruby
[19:43:24] za1b1tsu: has joined #ruby
[19:52:38] jarlopez: has joined #ruby
[19:52:44] jarlopez: has left #ruby: ()
[19:53:43] Renich_: has joined #ruby
[19:59:37] hutch: has joined #ruby
[20:08:45] blackswan: has joined #ruby
[20:10:26] blackswan: use Inline 'Ruby' => 'require "rails"'; yields #<ArgumentError: unknown encoding name: binary> while trying to load a ruby file with coding: binary
[20:12:56] Dbugger: has joined #ruby
[20:13:49] bmurt: has joined #ruby
[20:14:54] jottr: has joined #ruby
[20:15:55] SeepingN: has joined #ruby
[20:20:04] jsral: has joined #ruby
[20:20:34] cschneid_: has joined #ruby
[20:24:59] SeepingN: has joined #ruby
[20:40:01] graphene: has joined #ruby
[20:43:37] alxd: has joined #ruby
[20:49:33] ivanskie: has joined #ruby
[20:50:20] Inline: has joined #ruby
[20:53:17] r3m: has joined #ruby
[21:04:29] spiette: has joined #ruby
[21:08:10] orbyt_: has joined #ruby
[21:11:40] jaddison: has joined #ruby
[21:13:16] RougeR: has joined #ruby
[21:15:02] roshanavand: has joined #ruby
[21:15:33] orbyt_: has joined #ruby
[21:20:28] Dreamer3_: has joined #ruby
[21:21:13] blackswan: anybody around familiar with ruby internals?
[21:23:02] hutch: has joined #ruby
[21:23:06] cow[moo]: has joined #ruby
[21:30:53] nchambers: has joined #ruby
[21:43:21] jaddison: has joined #ruby
[21:52:47] kurra: has joined #ruby
[21:59:29] sanscoeur: has joined #ruby
[22:02:34] peirama: is tk still a thing?
[22:02:58] lewis: has joined #ruby
[22:03:15] nchambers: peirama: the tld?
[22:03:16] lewis: whats the diff between non deterministic vs deterministic date?
[22:04:12] nchambers: do you mean data?
[22:05:45] lewis: calendar date
[22:06:03] peirama: nchambers: https://github.com/ruby/tk
[22:06:12] nchambers: ah, wrong on 2 counts
[22:06:31] nchambers: tcl was my next guess though :}
[22:06:34] peirama: for UI interfaces in ruby... not sure if there is something better.
[22:06:55] graphene: has joined #ruby
[22:10:37] ausmat: has joined #ruby
[22:12:20] MasterAsia: has joined #ruby
[22:12:37] MasterAsia: I'm trying to decrypt something but it is telling me that the key must be 32 byte
[22:14:42] orbyt_: has joined #ruby
[22:19:05] SeepingN_: has joined #ruby
[22:19:57] SeepingN_: supply the correct 32 byte key
[22:20:30] tectonic: has joined #ruby
[22:20:33] knight33: I'm checking for pending tasks in a small ruby app of mine. The amount gets put into a string like so -> "Count: " + tasks.count.to_s, however I run into a small bug when there are none, since I guess it's nil.to_s. Should I check if it > 0? or not nil? or false?
[22:23:25] Rapture: has joined #ruby
[22:24:36] nchambers: do you control the data that is in tasks.count?
[22:25:17] brandonkal: has joined #ruby
[22:25:19] nchambers: if so, you can set it to 0 instead of nil
[22:25:41] nchambers: or alternatively, override to_s for the tasks class, and do the logic in there
[22:25:56] bak1an: has joined #ruby
[22:26:00] ausmat: Anyone here using `dry-validation` in prod? I’d like to hear some gotchas with any, and best practices
[22:27:59] knight33: Control the data? I mean, I don't put tasks in there, just checking for them.
[22:28:06] peirama: has left #ruby: ("ERC (IRC client for Emacs 26.1)")
[22:28:18] Puffball: has joined #ruby
[22:28:20] knight33: I see NilClass.to_s gives me an empty string, but I guess it's the count that throws it off
[22:35:59] jaddison: has joined #ruby
[22:36:33] jaddison: has joined #ruby
[22:39:57] cow[moo]: has joined #ruby
[22:42:31] blackswan: now i'm getting #<TypeError: no implicit conversion of NoMethodError into String> when i do use Inline 'Ruby' => 'require "rails"';
[22:43:29] blackswan: i don't even know what's printing this, perl or ruby
[22:44:13] cschneid: has joined #ruby
[22:54:41] jaddison: has joined #ruby
[23:07:18] hutch: has joined #ruby
[23:11:40] phaul: has joined #ruby
[23:11:48] ua: has joined #ruby
[23:11:53] mostlybadfly: has joined #ruby
[23:13:23] zenspider: has joined #ruby
[23:24:55] agent_white: has joined #ruby
[23:39:51] sarink: has joined #ruby
[23:40:46] sarink: has joined #ruby
[23:46:50] jaddison: has joined #ruby
[23:48:20] cow[moo]: has joined #ruby
[23:58:54] nowhere_man: has joined #ruby