#ruby - 15 April 2019
« Back 1 day Forward 1 day »
[12:12:21] Spaceman77: `compiling parse.c; gcc: internal compiler error: Killed (program cc1); Please submit a full bug report,with preprocessed source if appropriate.; See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.; Makefile:364: recipe for target 'parse.o' failed; make: *** [parse.o] Error 4`
[12:15:01] phaul: stab in the dark , https://bugs.ruby-lang.org/issues/10841 , you can try Nobu's suggestion
[13:03:47] phaul: you just going to have a hard time tracking down working versions of things. dependencies since then abandoned, things not building any more, get an old enough ruby mri etc. Unfortunately that thing hasn't been maintained.
[15:05:46] ryouba: when a class is entered via a class method ("def self.something"), is there a way to still always call #initialize before something's code is executed?
[15:09:31] phaul: call on what? remember that ruby doesn'thave functions or procedures, but messages sent to objects. #initialize can be called on an instance of that class, as it probably operates on instance data. without an instance you can't call instance methods
[15:10:51] hightower2: ryouba, as phaul says. initialize() is not executed on "class enter" but on/after object creation
[15:12:37] ryouba: phaul: yeah, it's still about the stuff you explained to me… those explanations have not yet become intuition exactly yet :-(
[15:15:52] ryouba: phaul: https://gist.github.com/sixtyfive/7b94a213311af8f274f40252ee40ac19 - line 28 works just fine, but in line 34, the attributes added are ofc not present anymore. can what i want to do be done?
[15:18:13] ryouba: i guess i'm struggling with having an instance available *inside* those self.something methods, but they *are* not of an instance themselves.
[15:24:21] ryouba: phaul: https://gist.github.com/sixtyfive/7b94a213311af8f274f40252ee40ac19 - now it's working. thanks for the wrist-slap!
[15:25:36] ryouba: phaul: is there also some magic available to dynamically generate that attr_accessor line?
[15:30:33] ryouba: ytti: that looks like that's the kind of magic attr_accessor itself might be using?
[15:31:20] ytti: ryouba, attr_accessor create def method; @method; end and def method=(value); @method=value; end
[15:31:33] phaul: ryouba: if you are matching with column names, I think Sequel::Model already defines those, but Im not 100%
[15:34:41] ryouba: that list will not change now for a while, so I guess I'll leave it be for the moment
[15:35:11] ryouba: man it'd be real cool if Markdown files containing Ruby inside of ```…``` blocks could just be executed
[15:39:42] ryouba: or the other way around … and ofc othrs had that idea before https://github.com/github/markup/issues/172
[20:36:34] towo: So… rvm not being able to find the correct URL for a ruby and tries to download '/system.tar.gz' without any URL. Anyone had that one yet?
[20:51:14] towo: Lemme quickly check with another user, just if the environment is any kind of issue
[20:51:58] towo: Apparently it does depend on the environment… even though not in an understandable way.
[20:52:14] havenwood: towo: I've seen very odd issues before where someone has gone between a local and global install of RVM without clearing the environment (unfortunately)
[20:52:51] towo: havenwood: lemme check, it should be loading the correct rvm version, but I'll see if there's any remainders
[20:53:44] xco: i have an instance variable set like say @example = “something”. and would like to pass a bunch of of these to a method. how do i get the instance variable inside the method when the names of the instance variables change, so like how so i get to pass these instance vars into a method when i have to work with another instance var called @example1?
[20:54:14] havenwood: If it was a local/global install issue, it'd likely fix it to implode RVM, then restart entirely before reinstalling.
[20:54:56] havenwood: xco: A nice thing about instance variables is they don't have to be passed as arguments to methods - methods can use instance variables directly.
[20:56:03] towo: havenwood: sure, got that. Running through my home now and not finding any hints of rvm left, weirdly enough, and the environment looks okay as well
[21:12:20] TvL2386: hey guys, I'm trying to parse a datetime stamp to a Time object. This is the String: "UTC 2019-03-18 14:47:13". I'm especially wondering how I can handle that "UTC" part. Looking at Time.strptime(...)
[21:17:19] TvL2386: jordanm: looking at the docs I don't think so... %Z - Equivalent to %:z (e.g. +09:00)