#ruby - 05 September 2018
« Back 1 day Forward 1 day »
[00:00:14] zenspider: leitz: probably don't need a full rebuild? at least, it looks like you're already using packages...
[00:29:12] leitz: Because I got really really tired of people saying "you should upgrade". So I do. Every week or so.
[00:30:41] leitz: I left Ruby twice because I spent more time being told to upgrade, after saying I couldn't, than I did getting answers.
[00:31:34] zenspider: ya know what? nevermind... I don't think any understanding is going to come of this
[00:31:58] leitz: I work on servers; I can't upgrade them. I can upgrade my personal machine, but then lose the ability to code for servers.
[00:33:43] baweaver: You can upgrade them. If your base image is old enough that it still has Ruby 2.0.0 or below there are more severe security risks there as well.
[00:34:12] baweaver: CentOS 6 and friends are far out of date, and they all like to lock down old versions of things with critical security flaws.
[00:34:18] leitz: There's no ROI to upgrade, or to even install Ruby. I was trying to get it into the environment.
[00:35:49] baweaver: Though you could repackage your base image and load more packages into YUM for it.
[00:36:42] leitz: Like I said, no ROI. We don't use Ruby, I was trying to build that. Not enough value in my code to even install Ruby, much less support locally compiled versions.
[00:37:42] leitz: And the vi/readline issue is fixed. Added the readline-devel and libedit-devel rpms to the requirements.
[05:06:07] JJonah: i'm writing a module that adds methods to a class when that class extends it. it will add private methods as well, purely to make the code more readable, but i don't want those private methods to conflict with any private methods a user might write. is there a convention for doing this? eg, prepending or appending `_` or `__` to the private method names?
[08:12:14] ineb: qolq: it doesnt look right because its bad code :) but another way would be some_method.eql? true
[09:46:11] Bish: E, [2018-09-05T11:45:44.815092 #20300] ERROR -- : reaped #<Process::Status: pid 20312 SIGKILL (signal 9)> worker=2
[09:52:24] Bish: E, [2018-09-05T11:52:15.012295 #12] ERROR -- : worker=0 PID:28 timeout (31s > 30s), killing
[13:08:47] pyrmont: qolq: Like baweaver said, it's a little hard to know how best to structure this without more context but there are situations in which three values might be returned. The <=> method is typically implemented to return -1, 0, 1. My suggestion would be to return something in this format. Perhaps something like :constrained, :unconstrained, :unchanged.
[13:34:35] qolq: ineb: i agree. but i've been stuck on this refactoring for quite a while now and i've reached the point where i just decided to write spaghetti code (but more organized than the previous) for now so i could organize things in my head better
[13:36:58] qolq: pyrmont: i considered that after baweaver's comment actually. but i think the structure of this is going to change significantly so i won't need to do it anymore
[14:48:57] havenwood: regedit: Last time I checked, it didn't have wire-dump debug: https://docs.google.com/spreadsheets/d/1vPlk6nMIFa3sI5ISl7zZ5r6lDNpVQX6Jxi3ksXCyVbs/edit?usp=sharing
[21:07:26] hays_: If I wanted to use map to generate a hash, is the clearest/best way to go about this to use to_h? I find end.to_h to be .. disturbing
[21:10:20] hays_: Hash also seems weird, encasing a block like that. is this something I should just get over
[21:26:04] hays_: is there a way to have ruby be associated more strongly with the directory I am in? right now I am using rbenv and basically if I have a shared directory among different users, each one needs to have a certain ruby installation and associated gems
[21:26:36] hays_: it would be cool if there was a way to just have a ruby that is in that directory somehow, and it is picked up when someone cds into the directory.
[21:30:48] havenwood: hays_: Yeah, looks pretty hardcoded to $RBENV_ROOT/versions, glancing at this.
[21:33:59] havenwood: (Assuming your app is in ~/my/app and you made a directory ~/my/app/rubies with Ruby in ruby-2.5.1-my-app/ dir.)
[21:36:47] havenwood: rbenv could probably also do that? I assume you can make RBENV_ROOT a system-wide location.
[21:42:08] Caeso: So I'm making a connect four game, and have a Board class. This class includes the following code: https://gist.github.com/Caeso-Lucilius/020f6676e405061daef4bf02dff957d1. However, it returns an error on the first play complaining how there is no defined "push" method for Nil class.
[21:44:33] elomatreb: You have variables named player_1 in the play method, and variables named player_one in the initialize
[22:07:12] clorisu: is there a way to use sleep as a condition in an if branch? eg `if sleep(10) == true puts "true" else puts "false"`?
[22:48:07] hays_: is there a nice way to merge two keys into a single key so that it is usable in a Hash?
[22:51:36] hays_: i was thinking that, but it seems like using a mutable as a key is asking for problems
[22:52:12] hays_: the context is.. a lot like the situation where you have ip and tcp. except they are :syms
[22:52:47] hays_: trying to figure out reasonable way to be able to store those.. was thinking nested dicts isn't too bad
[22:58:28] srruby: I just started a project that is still on ruby 1.9.3. I'm running the latest debian (Buster) and was unable to install ruby 1.9.3p551 I do have a server that is running debian wheezy and I am able to install ruby 1.9.3 on my server. Anyone know how to get 1.9.3 on my debian buster machine? I guess I can create a docker image if I need to...
[22:58:44] havenwood: hays_: I agree it's not a good idea to mutate hash keys. There is rehash: https://docs.ruby-lang.org/en/2.5.0/Hash.html#method-i-rehash
[23:02:20] havenwood: srruby: I wonder if you could get the Ruby 1.9 Brightbox Ubuntu package working on Buster?: https://www.brightbox.com/docs/ruby/ubuntu/
[23:05:33] havenwood: RVM does apply the openssl3.patch and CVE-2015-1855-p484.patch for 1.9 to make it (kinda) viable.