« Back to channel list

#ruby - 18 June 2018

« Back 1 day Forward 1 day »
[00:04:03] mjolnird: has joined #ruby
[00:04:51] baweaver: Might have to put this to use for some interesting things later.
[00:13:08] roamingdog: has joined #ruby
[00:16:02] dogweather: has joined #ruby
[00:22:49] queequeg1: has joined #ruby
[00:26:15] matyf__: has joined #ruby
[00:27:08] arand: has joined #ruby
[00:28:23] matyf: has joined #ruby
[00:32:34] matyf: has joined #ruby
[00:36:10] karapetyan: has joined #ruby
[00:38:05] dogweather: has joined #ruby
[00:41:54] herbmillerjr: has joined #ruby
[00:55:34] roamingdog: has joined #ruby
[00:56:24] roamingdog: has joined #ruby
[00:57:08] roamingdog: has joined #ruby
[00:57:21] jrafanie: has joined #ruby
[00:57:58] roamingdog: has joined #ruby
[00:58:43] roamingdog: has joined #ruby
[00:59:33] roamingdog: has joined #ruby
[01:03:52] tdy: has joined #ruby
[01:04:20] dogweather: has joined #ruby
[01:09:51] lbracher: has joined #ruby
[01:17:10] vonfry: has joined #ruby
[01:17:27] dogweather: has joined #ruby
[01:18:11] cbz: has joined #ruby
[01:29:55] nowhere_man: has joined #ruby
[01:33:06] jenrzzz: has joined #ruby
[01:34:37] dogweather: has joined #ruby
[01:35:09] chamar: has joined #ruby
[01:47:42] dogweather: has joined #ruby
[02:10:06] konsolebox: has joined #ruby
[02:25:29] arand: has joined #ruby
[02:37:33] tdy: has joined #ruby
[02:37:41] karapetyan: has joined #ruby
[02:37:51] BloopMonster: has joined #ruby
[02:38:24] akaiiro: has joined #ruby
[03:00:17] cadillac_: has joined #ruby
[03:00:53] roamingdog: has joined #ruby
[03:05:02] dogweather: has joined #ruby
[03:06:19] wadadli: has joined #ruby
[03:06:21] cadillac_: has joined #ruby
[03:06:53] wadadli: so I used bundler to install bootstrap, to use it I just add @import at the top of a .css file?
[03:10:29] braincrash: has joined #ruby
[03:15:32] beilabs: has joined #ruby
[03:16:13] beilabs_: has joined #ruby
[03:19:23] chamar: has joined #ruby
[03:21:08] _chamar_: has joined #ruby
[03:23:29] dogweather: has joined #ruby
[03:25:56] kapil___: has joined #ruby
[03:26:37] jgpawletko: has joined #ruby
[03:29:05] bauruine: has joined #ruby
[03:36:27] beilabs: has joined #ruby
[03:43:07] woodruffw: has joined #ruby
[03:43:07] woodruffw: has joined #ruby
[03:43:50] roamingdog: has joined #ruby
[03:46:15] JamJam_kid: has joined #ruby
[04:01:09] shinnya: has joined #ruby
[04:09:45] beilabs_: has joined #ruby
[04:13:17] eckhardt: has joined #ruby
[04:14:13] roamingdog: has joined #ruby
[04:14:56] roamingdog: has joined #ruby
[04:15:41] roamingdog: has joined #ruby
[04:16:32] roamingdog: has joined #ruby
[04:17:17] roamingdog: has joined #ruby
[04:17:20] dogweather: has joined #ruby
[04:18:24] redlegion: has joined #ruby
[04:18:40] jgpawletko: has joined #ruby
[04:22:06] darkworld: has joined #ruby
[04:22:30] darkworld: why should i learn ruby if im not a hipster, serious question
[04:22:52] darkworld: I know C, and I don't want to touch Python with a billion foot pole because of whitespace syntax
[04:24:48] baweaver: darkworld: because you want to
[04:25:06] darkworld: how small is it
[04:25:22] baweaver: That's a very wide question
[04:25:26] darkworld: I want an interperated language that isnt on crack
[04:25:29] baweaver: by which vector?
[04:25:32] darkworld: is it any larger than C
[04:25:38] darkworld: which I consider to be a small language
[04:26:09] baweaver: That's a bit of a silly metric.
[04:26:15] darkworld: because ill install it right now if its not huge
[04:26:20] baweaver: What are you wanting to achieve?
[04:26:32] darkworld: duct tape progrmming language
[04:26:39] baweaver: A language is as large as it needs to be.
[04:27:04] darkworld: well, theres large languages and then theres that "thing" (C++)
[04:27:23] baweaver: Though the fact that you entered with the predefined assumption that it's a hipster language, it sounds like you already have an answer.
[04:28:00] darkworld: the only people ive ever met who used ruby have been hipsters but honestly anything is better than python so im actually curious if its good for general purpose use or not
[04:28:02] baweaver: Realistically it's a very poor way to get good answers.
[04:28:33] darkworld: my buddy told me to learn ruby when looking for an alternative to python
[04:29:04] baweaver: Then learn Ruby for you
[04:29:10] baweaver: and evaluate it from that perspective
[04:29:32] baweaver: By coming in from an actively hostile position (they're all hipsters) you do both yourself and the language a disservice.
[04:30:02] baweaver: tryruby.org is a fast start.
[04:30:14] dogweather: has joined #ruby
[04:39:23] karapetyan: has joined #ruby
[04:45:55] anisha: has joined #ruby
[04:48:03] suukim: has joined #ruby
[04:48:33] akaiiro: has joined #ruby
[04:51:23] t0xik: has joined #ruby
[04:55:17] howdoi: has joined #ruby
[04:57:19] GinoMan: has joined #ruby
[04:59:35] apeiros: has joined #ruby
[05:04:00] dogweather: has joined #ruby
[05:19:43] BlopMonster: has joined #ruby
[05:24:39] BlopMonster: has joined #ruby
[05:30:20] reber: has joined #ruby
[05:38:51] User458764: has joined #ruby
[05:41:49] karapetyan: has joined #ruby
[05:42:05] conta: has joined #ruby
[05:44:44] aufi: has joined #ruby
[05:46:58] madh: has joined #ruby
[05:53:44] aupadhye: has joined #ruby
[05:56:24] dogweather: has joined #ruby
[06:03:52] apeiros: has joined #ruby
[06:06:48] User458764: has joined #ruby
[06:07:42] jzh: has joined #ruby
[06:13:05] akaiiro: has joined #ruby
[06:14:52] DoubleMalt: has joined #ruby
[06:15:09] biberu: has joined #ruby
[06:23:49] arkaros: has joined #ruby
[06:38:24] matyf: has joined #ruby
[06:40:53] DoubleMalt: has joined #ruby
[06:43:50] BTRE: has joined #ruby
[06:44:36] arkaros: has joined #ruby
[06:44:41] tomeaton17: has left #ruby: ("WeeChat 1.9.1")
[06:51:25] clemens3_: has joined #ruby
[06:56:54] dionysus69: has joined #ruby
[06:58:30] yohji: has joined #ruby
[07:00:29] Asher: has joined #ruby
[07:00:58] andikr: has joined #ruby
[07:10:16] priodev: has joined #ruby
[07:11:54] claudiuinberlin: has joined #ruby
[07:13:22] ltp: has joined #ruby
[07:14:13] burgestrand: has joined #ruby
[07:14:14] mtkd: has joined #ruby
[07:14:59] sysvalve: has joined #ruby
[07:19:12] ellcs: has joined #ruby
[07:24:53] arkaros: has joined #ruby
[07:24:56] DoubleMalt: has joined #ruby
[07:25:40] schleppel: has joined #ruby
[07:29:25] bijan_: has joined #ruby
[07:37:34] fanta7531: has joined #ruby
[07:38:37] yohji: has joined #ruby
[07:45:56] dogweather: has joined #ruby
[07:47:19] User458764: has joined #ruby
[07:49:56] vondruch: has joined #ruby
[07:58:34] NL3limin4t0r: has joined #ruby
[07:58:44] bijan_: has joined #ruby
[08:03:03] drale2k_: has joined #ruby
[08:03:38] aceruser: has joined #ruby
[08:06:10] Morrolan: has joined #ruby
[08:07:38] Mia: has joined #ruby
[08:10:25] ski7777: has joined #ruby
[08:11:13] pnkl: has joined #ruby
[08:12:38] nielsk: has joined #ruby
[08:12:52] kfjdlkajds: has joined #ruby
[08:13:20] Pisuke: has joined #ruby
[08:18:47] dogweather: has joined #ruby
[08:20:29] chmurifree: has joined #ruby
[08:26:09] dogweather: has joined #ruby
[08:26:39] amar: has joined #ruby
[08:26:42] burgestrand: has joined #ruby
[08:31:09] arkaros: has joined #ruby
[08:31:13] ellcs: has joined #ruby
[08:35:57] guille-moe: has joined #ruby
[08:39:39] User458764: has joined #ruby
[08:43:27] karapetyan: has joined #ruby
[08:46:13] c0ncealed2: has joined #ruby
[08:55:23] aufi: has joined #ruby
[08:55:38] Nicmavr: has joined #ruby
[08:56:41] ciscam: has joined #ruby
[09:00:58] saTchymoto: has joined #ruby
[09:01:32] Beams: has joined #ruby
[09:04:22] RougeR: has joined #ruby
[09:04:22] RougeR: has joined #ruby
[09:06:08] cadillac_: has joined #ruby
[09:07:15] ams__: has joined #ruby
[09:07:40] venmx: has joined #ruby
[09:09:30] guille-moe: has joined #ruby
[09:13:59] catphish: has joined #ruby
[09:28:19] mlkkk: has joined #ruby
[09:30:07] burgestrand: has joined #ruby
[09:30:32] tAn: has joined #ruby
[09:33:15] tAn: has joined #ruby
[09:33:15] sonOfRa: has joined #ruby
[09:33:58] psychicist__: has joined #ruby
[09:37:14] User458764: has joined #ruby
[09:51:55] bijan_: has joined #ruby
[10:03:37] cyberg: has joined #ruby
[10:03:39] roamingdog: has joined #ruby
[10:05:03] venmx: has joined #ruby
[10:13:54] tAn: has joined #ruby
[10:16:31] shinnya: has joined #ruby
[10:20:29] KeyJoo: has joined #ruby
[10:24:55] apparition47: has joined #ruby
[10:28:40] twe4ked: has joined #ruby
[10:30:50] Danielss89: has joined #ruby
[10:34:54] arkaros: has joined #ruby
[10:37:26] amar_: has joined #ruby
[10:43:08] drale2k_: has joined #ruby
[10:46:28] jrafanie: has joined #ruby
[10:49:56] User458764: has joined #ruby
[10:57:24] mikecmpbll: has joined #ruby
[11:06:59] amatas: has joined #ruby
[11:14:57] OneNeptune: has joined #ruby
[11:15:22] User458764: has joined #ruby
[11:16:31] arkaros: has joined #ruby
[11:22:27] bijan_: has joined #ruby
[11:28:22] bijan__: has joined #ruby
[11:29:37] burgestrand: has joined #ruby
[11:31:59] ldnunes: has joined #ruby
[11:39:32] dionysus69: has joined #ruby
[11:41:06] matyf: has joined #ruby
[11:46:37] matyf: has joined #ruby
[11:46:54] gregf_: has joined #ruby
[11:54:39] chamar: has joined #ruby
[11:57:54] saTchymoto: has joined #ruby
[11:57:57] beilabs: has joined #ruby
[11:58:02] AJA4350: has joined #ruby
[11:59:42] chongtxtx: has joined #ruby
[12:02:31] jrafanie: has joined #ruby
[12:02:41] mikecmpbll: has joined #ruby
[12:03:44] kapil___: has joined #ruby
[12:06:26] fmcgeough: has joined #ruby
[12:06:33] vondruch: has joined #ruby
[12:13:48] dogweather: has joined #ruby
[12:14:02] karapetyan: has joined #ruby
[12:15:01] matyf: has joined #ruby
[12:32:26] herbmillerjr: has joined #ruby
[12:34:22] jamesaxl: has joined #ruby
[12:38:13] bmurt: has joined #ruby
[12:38:13] Asher: has joined #ruby
[12:39:44] micutzu: has joined #ruby
[12:40:02] OneNeptune: has joined #ruby
[12:42:19] OneNeptune: has joined #ruby
[12:43:21] saTchymoto: has joined #ruby
[12:44:49] InfinityFye: has joined #ruby
[12:50:10] User458764: has joined #ruby
[12:51:36] synthroid: has joined #ruby
[12:56:43] Sylario: has joined #ruby
[13:00:36] fmcgeough: has joined #ruby
[13:03:43] User458764: has joined #ruby
[13:04:26] tty: has joined #ruby
[13:12:20] rwb: has joined #ruby
[13:18:48] ogres: has joined #ruby
[13:20:21] dogweather: has joined #ruby
[13:21:31] jcalla: has joined #ruby
[13:29:22] karapetyan: has joined #ruby
[13:30:22] k0mpa: has joined #ruby
[13:33:29] lfalcao: has joined #ruby
[13:33:30] catphish: is there such thing as an ssh agent (key server) for ruby net/ssh, i couldn't find anything
[13:34:07] catphish: i need to be able to do 2 ssh hops and was hoping to forward keys, but can't figure it out
[13:34:40] roamingdog: has joined #ruby
[13:38:29] mtkd: has joined #ruby
[13:43:35] Mike11: has joined #ruby
[13:44:30] k0mpa: has joined #ruby
[13:46:53] cagomez: has joined #ruby
[13:47:20] zapata: has joined #ruby
[13:51:40] InfinityFye: has joined #ruby
[13:53:15] gnufied: has joined #ruby
[13:55:00] InfinityFye: has left #ruby: ()
[14:00:23] jrafanie: has joined #ruby
[14:02:51] dhollinger: has joined #ruby
[14:04:26] Rapture: has joined #ruby
[14:05:40] cagomez: has joined #ruby
[14:09:33] arkaros: has joined #ruby
[14:09:57] icy`: has joined #ruby
[14:22:27] Inline: has joined #ruby
[14:25:26] drale2k_: has joined #ruby
[14:25:33] conta1: has joined #ruby
[14:29:40] vondruch: has joined #ruby
[14:30:12] apeiros: has joined #ruby
[14:35:31] Asher: has joined #ruby
[14:36:27] roamingdog: has joined #ruby
[14:37:12] roamingdog: has joined #ruby
[14:38:02] roamingdog: has joined #ruby
[14:38:39] venmx: has joined #ruby
[14:38:50] roamingdog: has joined #ruby
[14:39:48] cdunklau: catphish: forwarding keys isn't a great idea
[14:40:00] cdunklau: that is, forwarding the agent connection
[14:40:18] catphish: cdunklau: why not?
[14:40:49] wadadli: has left #ruby: ("WeeChat 2.0.1")
[14:41:09] catphish: seems a pretty effective way to authenticated between a series of trusted hosts
[14:41:10] cdunklau: catphish: because it implicitly trusts the remote system to not be evil
[14:41:21] cdunklau: catphish: sure if you absolutely trust the remote box :)
[14:41:25] catphish: well of course
[14:41:41] cdunklau: catphish: an alternative would be to do a port forward, and jump through that
[14:41:48] jottr: has joined #ruby
[14:42:44] cadillac_: has joined #ruby
[14:42:45] catphish: cdunklau: sadly that won't work, i'm trying to automate some backups, having a management server connect to one server, then rsync to a third server
[14:42:52] Azure|dc: has joined #ruby
[14:43:07] catphish: i can fix this my manually generating unique keys on every server and configuring trust as necessary
[14:43:14] dminuoso: catphish: forwarding keys sounds weird.
[14:43:23] dminuoso: why not simply put your key on the remote?
[14:43:35] bak1an: has joined #ruby
[14:43:39] catphish: because that means generating private keys on every host
[14:43:40] cdunklau: catphish: i do see :forward_agent
[14:43:48] dminuoso: cdunklau: Huh?
[14:43:48] catphish: not a huge problem, but a lot more configuration
[14:43:52] dminuoso: catphish: err huh?
[14:43:58] catphish: dminuoso: he's right, that option exists
[14:43:59] roamingdog: has joined #ruby
[14:44:12] cdunklau: catphish: https://www.rubydoc.info/github/net-ssh/net-ssh/Net%2FSSH%2Estart
[14:44:16] dminuoso: catphish: No my question is why do you want this?
[14:44:17] catphish: but i think it's only forwarding, not the agent itself
[14:44:27] catphish: dminuoso: i explained above
[14:44:38] cdunklau: catphish: ":forward_agent => set to true if you want the SSH agent connection to be forwarded"
[14:44:41] catphish: i want to have a management server connect to one server, then rsync to a third server for backup purposes
[14:44:44] roamingdog: has joined #ruby
[14:45:26] catphish: cdunklau: i believe that will forward agent connections, but i'm not really sure what it would forward them to, my key only exists in ruby
[14:45:37] roamingdog: has joined #ruby
[14:45:45] cdunklau: catphish: aha i missed that part
[14:45:47] catphish: i don't think net/ssh itself has the agent "server"
[14:45:55] cdunklau: i would doubt that, yes
[14:46:24] roamingdog: has joined #ruby
[14:46:32] catphish: i suspect what i'll end up doing instead is just automating the configuration of private keys on each server and distribution of the public keys as needed
[14:46:33] cdunklau: catphish: but you could probably spawn the agent yourself and add the key
[14:46:49] karapetyan: has joined #ruby
[14:46:59] catphish: cdunklau: that's not a bad idea actually, as long as i can spawn a unique agent for this purpose, and somehow forward to it
[14:47:01] cdunklau: hmm that might require the key material to be on the disk though
[14:47:09] roamingdog: has joined #ruby
[14:47:10] cdunklau: catphish: sure sure that's what ssh-agent's job is
[14:47:12] chouhoulis: has joined #ruby
[14:47:51] catphish: "ssh-add -" seems to work
[14:48:09] catphish: but i don't know how to spawn an agent, and forward to the right agent
[14:48:40] cdunklau: catphish: ok, will you be running this interactively
[14:48:52] catphish: nope, all automated
[14:48:55] venmx: has joined #ruby
[14:49:20] cdunklau: catphish: oh, but the private key isn't encrypted, right?
[14:49:47] catphish: i have an existing management system that connects to several servers and manages them in various ways, and now i want to be able to create an ssh connection *between* 2 of those servers
[14:49:57] catphish: the key isn't encrypted in memory
[14:50:19] cdunklau: catphish: hmm wait what do you mean ssh-add - worked
[14:50:30] cdunklau: i thought the agent needed to see both pub and priv
[14:51:48] agent_white: has joined #ruby
[14:53:31] catphish: cdunklau: you just give it a private key
[14:53:47] mozzarella: has joined #ruby
[14:53:51] catphish: for a start, the private key includes the public key, or the information needed to generate it
[14:54:22] bijan_: has joined #ruby
[14:54:38] stnly: has joined #ruby
[14:55:03] cdunklau: catphish: aha i hadn't considered that
[14:55:22] User458764: has joined #ruby
[14:55:36] dinfuehr: has joined #ruby
[14:55:55] catphish: to clarify, if you run "ssh-add -" it accepts a private key from stdin
[14:56:20] cdunklau: catphish: so yeah i think this will work: you run ssh-agent -s, parse out the env vars, set them in your program's environment, run ssh-add - and give it the key, then you should be good
[14:57:55] cdunklau: catphish: confirm this, but presumably net/ssh will look in the environment to get the agent info
[14:58:08] catphish: i'll try that, thanks
[14:58:21] cdunklau: catphish: and ssh-add definitely needs it
[14:59:13] OneNeptu_: has joined #ruby
[14:59:16] akaiiro: has joined #ruby
[14:59:23] catphish: looks like that might work, just need to make sure i don't spawn lots unnecessarily
[14:59:38] cdunklau: oh and make sure you kill the agent on cleanup :)
[15:00:30] cdunklau: catphish: oh it looks like you can tell ssh-agent what address to use for its domain socket
[15:00:42] cdunklau: catphish: so you might not even have to do the parsing dance
[15:00:56] catphish: this may also allow me to prevent duplicates
[15:01:02] catphish: if the socket is there i can just use it
[15:01:24] JamJam_kid: has joined #ruby
[15:01:24] catphish: the app can just start it the first time it's needed then check the socket is available
[15:01:42] cdunklau: catphish: i might also add a check that the pid is still alive
[15:02:13] rippa: has joined #ruby
[15:02:23] catphish: thanks! i'll get something coded
[15:05:03] cdunklau: catphish: why do you have to jump through systems though
[15:05:27] catphish: i have an existing management system that connects to several servers and manages them in various ways, and now i want to be able to create an ssh connection *between* 2 of those servers
[15:05:45] catphish: the purpose is to cause one to tar/rsync/some kind of backup to another
[15:05:53] catphish: without needing to manually configure trust in advance
[15:06:48] cdunklau: catphish: i'd probably do this via the backup server, and just have the management server tell the backup server to do it
[15:07:19] cdunklau: fewer hosts involved == more reliable
[15:08:26] cdunklau: i mean you have to have comms between the target server and the backup server, of course, but do you really want the whole thing to *also* depend on the management server <-> target server connection?
[15:08:59] cdunklau: that just seems brittle, especially for a presumably long-running thing like backup
[15:09:08] catphish: same number of hosts
[15:09:08] catphish: in fact that's the way i've written it
[15:09:08] catphish: but there are several backup servers, and servers can be provisioned at any time, so having a separate private key on each management server and adding that to all the other servers seemed like an unwanted step, when the management server can just authorize each action
[15:09:08] catphish: *separate key on each backup server
[15:09:16] jrm: has joined #ruby
[15:10:12] cdunklau: catphish: either way is the same number of hosts, sure, but my suggestion doesn't rely on all three of them communicating properly for the whole process
[15:10:16] catphish: i see your point
[15:10:27] cdunklau: brain food :)
[15:10:31] catphish: it would actually complete fine if the management server went away
[15:10:35] cdunklau: the network is evil
[15:10:50] catphish: but the management server wouldn't know :(
[15:11:12] cdunklau: who watches the watchers? :D
[15:11:47] catphish: i don't really want to complicate it too much
[15:12:21] catphish: it would be cool to have a daemon on the backup server that is asked to do a backup, and monitors the success, then the management server could just check on progress
[15:12:35] catphish: but that's rather more complicated than just running one ssh command and watching the output
[15:13:01] catphish: and these backups are quite small, not like whole system backups, just shared hosting sites
[15:13:21] catphish: thanks for all the suggestions though, lots of things to try
[15:13:45] Mike111: has joined #ruby
[15:14:41] beefjoe: has joined #ruby
[15:15:45] Mike111: has joined #ruby
[15:16:21] mtkd: has joined #ruby
[15:19:05] synthroid: has joined #ruby
[15:19:48] Mike11: has joined #ruby
[15:21:41] k0mpa: has joined #ruby
[15:24:10] Inside: has joined #ruby
[15:24:50] karapetyan: has joined #ruby
[15:26:36] Mike11: has joined #ruby
[15:29:00] Mike11: has joined #ruby
[15:37:22] BlopMonster: has joined #ruby
[15:38:05] OneNeptune: has joined #ruby
[15:41:13] jrich523: hey guys, is there any difference between the top and bottom? https://gist.github.com/jrich523/1eb7bc425367ded87278542ba76e7156
[15:41:34] jrich523: the top is the way it was written, the bottom is what i figured it can/should be?
[15:45:00] stairmast0r: has joined #ruby
[15:46:25] beilabs: has joined #ruby
[15:47:28] conta1: has joined #ruby
[15:48:47] baweaver: jrich523: the bottom relies on some odd syntax.
[15:49:08] clemens3: has joined #ruby
[15:49:23] karapetyan: has joined #ruby
[15:49:40] Mike11: has joined #ruby
[15:50:22] apeiros: jrich523: I'd say both are bad and you should use sort_by :)
[15:50:48] icy`: misnamed function? items doesnt actually change after calling it
[15:51:54] apeiros: also the one on the bottom is a syntax error as far as I can tell
[15:52:10] KeyJoo: has joined #ruby
[15:54:49] stairmast0r: has joined #ruby
[15:55:19] r29v: has joined #ruby
[16:01:29] crankhar1er: has joined #ruby
[16:02:34] baweaver: Reduce is fun :D https://twitter.com/keystonelemur/status/1008741518016835584
[16:02:54] baweaver: Also Structs. I need to play with those more
[16:02:57] amar_: has joined #ruby
[16:03:37] baweaver: icy`: a function doesn't mean the receiver changes implicitly.
[16:03:41] baweaver: doesn't necessarily, rather.
[16:04:31] [Butch]: has joined #ruby
[16:08:07] madh: has joined #ruby
[16:08:13] GinoMan: has joined #ruby
[16:08:16] orbyt_: has joined #ruby
[16:09:47] redlegion: has joined #ruby
[16:10:17] synthroid: has joined #ruby
[16:10:59] cthulchu: has joined #ruby
[16:11:57] jrich523: thanks apeiros and baweaver
[16:12:03] GinoMan: has joined #ruby
[16:12:35] amar_: has joined #ruby
[16:13:29] GinoMan: has joined #ruby
[16:14:16] zlogan2003: has joined #ruby
[16:19:50] cagomez: has joined #ruby
[16:20:16] cagomez: has joined #ruby
[16:20:51] mtkd: has joined #ruby
[16:21:01] eckhardt: has joined #ruby
[16:21:26] cliluw: has joined #ruby
[16:22:49] wontruefree: has joined #ruby
[16:25:47] dbugger_: has joined #ruby
[16:29:26] ldepandis: has joined #ruby
[16:37:07] Mike11: has joined #ruby
[16:37:58] stairmast0r: has joined #ruby
[16:39:21] OneNeptune: has joined #ruby
[16:42:39] lxsameer: has joined #ruby
[16:43:32] amar_: has joined #ruby
[16:44:25] r29v: has joined #ruby
[16:45:39] orbyt_: has joined #ruby
[16:49:12] dendazen: has joined #ruby
[16:49:20] r29v: has joined #ruby
[16:50:47] darkhanb: has joined #ruby
[16:50:51] conta1: has joined #ruby
[16:51:55] cthulchu: has joined #ruby
[16:52:19] dogweather: has joined #ruby
[16:54:39] User458764: has joined #ruby
[16:55:49] dogweath_: has joined #ruby
[16:56:02] biberu: has joined #ruby
[16:59:34] synthroid: has joined #ruby
[17:01:07] beilabs: has joined #ruby
[17:03:24] hph^: has joined #ruby
[17:04:25] chouhoulis: has joined #ruby
[17:05:14] jrich523: so if i need a method that i can call with arguments or no arguments, what is the ideal way to do that? just check for nil params?
[17:08:54] karapetyan: has joined #ruby
[17:10:37] eckhardt: has joined #ruby
[17:10:39] apeiros: has joined #ruby
[17:11:54] drale2k_: has joined #ruby
[17:12:37] z64: omitting arguments is done by giving args default values, i.e. `def foo(arg = nil)` can be called as `foo` or `foo(something)`
[17:13:43] z64: splatting an argument (*arg, **arg) works as well if you want variadic args
[17:14:05] jrich523: this is for a guest_count(app,env)
[17:14:19] jrich523: i'd need all guests, not app/env specific
[17:14:34] jrich523: so was trying to decide if i should modify that method, add a new one...
[17:14:43] jrich523: sound like slap in some defaults and add the code to handle it :)
[17:14:44] User458764: has joined #ruby
[17:15:55] z64: sure. definitely think about it in each situation; sometimes a more explicit, differently named method is preferred. for your use case that sounds fine
[17:18:29] amar_: has joined #ruby
[17:19:26] theRoUS: has joined #ruby
[17:19:44] amar_: has joined #ruby
[17:20:11] theRoUS: has joined #ruby
[17:22:42] lxsameer: has joined #ruby
[17:26:30] sphenxes: has joined #ruby
[17:26:42] jenrzzz: has joined #ruby
[17:26:42] jenrzzz: has joined #ruby
[17:26:59] mtkd: has joined #ruby
[17:28:08] guns: has joined #ruby
[17:28:17] Eiam: has joined #ruby
[17:29:02] guns: Hello. Are the "# encoding: utf-8" magic comments still a good idea in Ruby 2.5 for source files with UTF-8 characters?
[17:29:46] amar_: has joined #ruby
[17:31:59] icarus: has joined #ruby
[17:32:24] gizmore: has joined #ruby
[17:34:54] dviola: has joined #ruby
[17:35:10] orbyt_: has joined #ruby
[17:37:31] lxsameer: has joined #ruby
[17:38:26] cthulchu: I thought it was utf8 by default
[17:38:50] cthulchu: what is it by default? the wretched 1251?
[17:38:59] jenrzzz: has joined #ruby
[17:38:59] jenrzzz: has joined #ruby
[17:39:27] cthulchu: ah, it's utf8 in Ruby 2
[17:39:44] mtkd: has joined #ruby
[17:39:47] cthulchu: it used to be plain ASCII in 1.9
[17:41:09] nythalcrow: has joined #ruby
[17:41:46] JamJam_kid: has joined #ruby
[17:43:33] cagomez: has joined #ruby
[17:44:02] lele: has joined #ruby
[17:44:05] jrich523: then i guess that would imply the comment is no longer required :)
[17:44:41] sameerynho: has joined #ruby
[17:45:31] rippa: has joined #ruby
[17:46:28] mostlybadfly: has joined #ruby
[17:47:29] SeepingN: has joined #ruby
[17:49:52] cthulchu: I'm using 2.2.0
[17:49:58] cthulchu: feel old :(
[17:50:01] jottr: has joined #ruby
[17:50:39] cthulchu: oh wow, the release date is 2014-12-25
[17:50:50] desperek: has joined #ruby
[17:51:15] cthulchu: and Ruby 2.2.10 is
[17:51:24] nythalcrow: has joined #ruby
[17:51:42] cthulchu: ten subversion in almost four years. feels like a barely supported branch
[17:52:11] cthulchu: I guess switching to 2.6 is a good idea for new projects
[17:52:19] tAn: has joined #ruby
[17:52:28] lxsameer: has joined #ruby
[17:52:28] agent_white: has joined #ruby
[17:54:37] cagomez: has joined #ruby
[17:54:52] jrich523: just stuck with whatever is deployed to the servers
[17:54:55] jrich523: in my case its just 2.0 :(
[17:55:28] Inside: holy moly
[17:55:37] cthulchu: 2.0 is holier Moly
[17:56:08] cthulchu: Ruby of 2014 is A LOT better than PHP of 2014
[17:56:09] BloopMonster: has joined #ruby
[17:56:15] Inside: I use 2.1.4 ;)
[17:56:40] cthulchu: hah! neighbour!
[17:57:07] Inside: There's actually no reason for me to use 2.1.4 anymore
[17:57:36] Inside: the rails applications run inside 2.4.0, but passenger runs in 2.1.4
[17:57:41] Inside: I don't know what i'm doing.
[17:58:13] cthulchu: having two versions side by side on the same system
[17:58:45] Inside: It was even better when passenger was serving up one application in a 2.1.4 environment and 2.4.0 in the other
[17:58:49] nythalcrow: i just use ubuntu and "sudo apt-get install ruby"
[17:58:56] Inside: on centos lol
[17:59:16] SeepingN: brew install rvm
[17:59:29] jottr: has joined #ruby
[17:59:32] SeepingN: too bad brew can't replace rvm itself
[17:59:36] Inside: yum info centos -> 2.0.0.648 lol
[17:59:41] SeepingN: "isntall these 3 and give me a fancy switcher"
[17:59:52] Inside: I mean yum info ruby
[18:00:08] SeepingN: I went from 1.8.6 (not even .7) to 2.0.x on a linux box. what a nightmare
[18:00:29] cthulchu: had to rewrite code?
[18:00:40] SeepingN: all of the networking/ssh/sftp stuff changed so much that there was much pain and confusion
[18:01:01] Inside: if you just write idiomatic ruby code without using a single library or fancy language feature -- your code is forever future compatible <3
[18:01:08] SeepingN: the ways it reported failures, or now reported failures where before it just bombed out... ugh. Good changes, but ugly transition
[18:01:23] cthulchu: what's a fancy language feature?
[18:01:36] Inside: anything more complicated than if/then blocks :P
[18:01:41] cthulchu: I mean, if you use Assembly to write code, Ruby updates won't affect it either :)
[18:01:45] SeepingN: i'll get back to you in 2120 when I've managed to simulate what net::ssh does
[18:02:05] SeepingN: ACTION gets out his 68000 ASM book
[18:02:29] Inside: pretty sure it's future compatible too
[18:02:33] cthulchu: and then they introduce decimal processors.
[18:02:39] cthulchu: and whole assembly is different
[18:03:11] \void: has joined #ruby
[18:03:36] cthulchu: how many main version branches does Ruby have?
[18:04:04] amarks: has joined #ruby
[18:04:12] conta1: has joined #ruby
[18:07:19] apeiros: has joined #ruby
[18:08:29] kapil___: has joined #ruby
[18:10:07] ciscam: has joined #ruby
[18:11:22] karapetyan: has joined #ruby
[18:11:42] chouhoulis: has joined #ruby
[18:13:36] wadadli: has joined #ruby
[18:13:51] wadadli: why can't I do this in a sass file
[18:13:52] wadadli: @import "../../vendor/bundle/ruby/2.5.0/gems/bootstrap-4.1.1/assets/stylesheets/_bootstrap.scss";
[18:14:57] SeepingN: just say no to traversal?
[18:17:31] cthulchu: sass doesn't support includes?
[18:20:06] cthulchu: so not having spaces between parenthesis and metod names applies to when we define them too?
[18:20:21] wadadli: not sure using jekyll but for obvious reasons I don't wanna hard code that path
[18:20:47] wadadli: it uses bundler for dep tracking
[18:21:03] wadadli: and by default looks into _sass/ for partials
[18:21:34] wadadli: bundler is configured to install it's deps locally in the ` vendor/bundle/ ` dir
[18:21:46] suukim: has joined #ruby
[18:21:52] wadadli: I can't figure out a way to say bundler install bootstrap --path _sass/
[18:22:26] wadadli: I'm not sure if it has that functionality either since it isn't mentioned in the docs.
[18:23:23] wadadli: now I'm not a ruby guy by any means and I'm just using this framework and the dep tracker that they recommend it's just a pitty that it can't do simple things like that
[18:24:01] wadadli: so what's the next move, install another dep tracker alongside your existing dep tracker to do this sort of thing? o_
[18:25:29] eckhardt: has joined #ruby
[18:26:12] cthulchu: I just deleted all semicolons triling by \r\n from my code
[18:29:50] mikecmpbll: has joined #ruby
[18:32:16] User458764: has joined #ruby
[18:32:29] cthulchu: a class gets executed once its file was required?
[18:32:52] cthulchu: or when its first instance was created?
[18:33:01] cthulchu: using its constructor
[18:33:33] cthulchu: I'm gonna test it...
[18:34:18] cthulchu: >> class test @@qwe=123 end puts test:@@qwe
[18:34:19] ruby[bot]: cthulchu: # => /tmp/execpad-df079005e7ad/source-df079005e7ad:2: class/module name must be CONSTANT ...check link for more (https://eval.in/1022853)
[18:35:13] cthulchu: >> class Test @@qwe=123 end puts Test:@@qwe
[18:35:14] ruby[bot]: cthulchu: # => /tmp/execpad-27df3b422290/source-27df3b422290:2: syntax error, unexpected tIDENTIFIER, expecting key ...check link for more (https://eval.in/1022856)
[18:35:45] synthroid: has joined #ruby
[18:37:42] lxsameer: has joined #ruby
[18:37:54] roamingdog: has joined #ruby
[18:39:25] cthulchu: >> class Test; @@qwe=123; end; puts Test:@@qwe
[18:39:26] ruby[bot]: cthulchu: # => /tmp/execpad-2a44538bc8a5/source-2a44538bc8a5:2: warning: class variable access from toplevel ...check link for more (https://eval.in/1022867)
[18:42:28] cthulchu: what's wrong about it? @@ is the class-scope variable. Once the class is there, I should be able to access all its.... static variables.
[18:42:40] cthulchu: I'm sorry, I'm still getting used to Ruby's OOP
[18:43:22] nowhere_man: has joined #ruby
[18:45:16] baweaver: cthulchu: I'd probably read through a Ruby book or two at this rate.
[18:45:20] baweaver: It'd be faster
[18:45:36] dminuoso: 20:32 cthulchu | a class gets executed once its file was required?
[18:45:40] dminuoso: Ruby has a simple eval model.
[18:45:44] baweaver: and for the same reason you can't do instance.@variable.
[18:45:49] dminuoso: A require is essentially an eval in disquise.
[18:46:35] cthulchu: I can do instance:@variable
[18:46:52] cthulchu: I'm using an object method to get it
[18:47:00] cthulchu: can I write a getter?
[18:47:05] cthulchu: a static method!
[18:47:35] cthulchu: I'm gonna do it the proper way
[18:47:43] lxsameer: has joined #ruby
[18:47:53] chouhoulis: has joined #ruby
[18:49:05] cthulchu: dminuoso, check this out!!
[18:49:08] cthulchu: >>class Test; @@qwe=123; def self.getQwe; return @@qwe; end; end; puts Test.getQwe()
[18:49:09] ruby[bot]: cthulchu: # => 123 ...check link for more (https://eval.in/1022883)
[18:49:16] cthulchu: is it ok to do it like this?
[18:49:39] dminuoso: cthulchu: On the basis that class variables are almost always wrong, Im gonna go with: No.
[18:49:42] cthulchu: I think self.method is a very weird construct but I guess it works because classes are objects
[18:49:42] dogweather: has joined #ruby
[18:50:02] baweaver: inheritance nightmares mostly
[18:50:03] dminuoso: cthulchu: It stems from a more general pattern
[18:50:24] dminuoso: cthulchu: `def foo.bar; ...; end` defines a method :bar on the singleton class of whatever `foo` is.
[18:50:28] baweaver: Though I'd still argue that reading through a book like Eloquent Ruby would be good at this point.
[18:50:34] dminuoso: cthulchu: Inside the class definition `self` happens to be that class object itself.
[18:50:38] cthulchu: okay, say you have a dogs class. you want to store in it the max height and weight od a dog.
[18:50:45] dminuoso: cthulchu: Use a constant.
[18:50:52] dminuoso: And freeze it.
[18:51:02] dminuoso: class variables are just bugs waiting to happen
[18:51:03] cthulchu: can you show me an example of it?
[18:51:23] dminuoso: cthulchu: The book baweaver has mentioned can.
[18:52:02] cthulchu: well then it doesn't seem like a good solution
[18:52:19] dminuoso: Reading books is not a good solution?
[18:52:30] cthulchu: universally nothing is a good solution
[18:52:56] cthulchu: the quality of the solution is relevant to the issue
[18:52:59] baweaver: So does that make you a Nilhilist
[18:53:13] cthulchu: it surely doesn't
[18:54:18] cthulchu: anyhow, what is a better solution for static class-level variables?
[18:54:23] cthulchu: I googled the @@ solution
[18:54:33] cthulchu: there were comments about how bad it was
[18:54:58] cthulchu: that it were as global for this classes children
[18:55:16] cthulchu: and that one should use something else instead
[18:55:28] cthulchu: but that something else looked extremely confusing
[18:56:08] matyf: has joined #ruby
[18:56:53] zachk: has joined #ruby
[18:56:53] zachk: has joined #ruby
[18:57:26] cthulchu: if a class is an object
[18:57:43] cthulchu: and we can create instance varialbes in objects on the fly
[18:57:58] cthulchu: then why not create an ivar in this class as if it was an object!
[18:58:03] cthulchu: probably too weird
[18:59:48] matyf: has joined #ruby
[19:02:18] chris349: has joined #ruby
[19:03:36] Inline: has joined #ruby
[19:07:51] tdy: has joined #ruby
[19:09:13] synthroid: has joined #ruby
[19:13:18] dogweather: has joined #ruby
[19:14:06] jenrzzz: has joined #ruby
[19:14:06] jenrzzz: has joined #ruby
[19:15:45] orbyt_: has joined #ruby
[19:20:33] jenrzzz: has joined #ruby
[19:20:33] jenrzzz: has joined #ruby
[19:24:04] nythalcrow: has joined #ruby
[19:27:11] synthroid: has joined #ruby
[19:27:29] lxsameer: has joined #ruby
[19:30:01] good_ol_rusty: has joined #ruby
[19:30:26] jenrzzz: has joined #ruby
[19:30:51] Cavallari: has joined #ruby
[19:33:47] cagomez: has joined #ruby
[19:35:13] balo: na mar freenode-on is toltak az eu upload filters proposal elleni alairasgyujtest
[19:35:21] Nicmavr: has joined #ruby
[19:35:22] balo: damn wrong channel, sry
[19:35:44] balo: it's getting strange that the only thing i contribute here are missent messages :D
[19:36:34] balo: today i can't internet
[19:37:32] lxsameer: has joined #ruby
[19:37:46] jenrzzz: has joined #ruby
[19:37:52] ldepandis: has joined #ruby
[19:38:28] cthulchu: def always defines methods, right?
[19:39:23] TinkerT: has joined #ruby
[19:41:11] havenwood: cthulchu: Yes.
[19:41:29] cthulchu: okay, I got a bit confused with this example I'm playing with
[19:41:41] cthulchu: https://eval.in/1022913
[19:42:10] havenwood: cthulchu: A:config isn't valid syntax.
[19:42:12] andrewray: has joined #ruby
[19:42:22] havenwood: cthulchu: Use: A.config
[19:42:31] cthulchu: that's for methods only
[19:42:33] lxsameer: has joined #ruby
[19:42:37] cthulchu: I need the variable
[19:42:45] cthulchu: we use init to set it
[19:42:48] havenwood: cthulchu: To access an instance variable, expose it via method.
[19:42:48] cthulchu: and then config to get it
[19:43:14] cthulchu: look https://eval.in/1022914
[19:43:25] cthulchu: is this the proper way of doing globals?
[19:43:31] cthulchu: I mean, public static
[19:43:42] cthulchu: although having setter and getter eliminates the meaning of public
[19:43:47] cthulchu: at least we have static
[19:43:48] havenwood: cthulchu: I'd say this is an odd pattern, that doesn't look right.
[19:43:52] r29v: has joined #ruby
[19:44:12] cthulchu: how would you implement static class variables?
[19:44:37] cthulchu: I mean @@ is the fastest way
[19:44:41] havenwood: cthulchu: In Ruby, if you have no instances of internal state, use a module. Modules are the one place that the docs refer to "functions" rather than "methods," with `module_function`.
[19:44:42] cthulchu: but everybody hates it
[19:44:53] havenwood: cthulchu: If you have one instance of state, use a Singleton Class.
[19:45:01] havenwood: cthulchu: If you have multiple instances of state, use a Class.
[19:45:06] d10n-work: has joined #ruby
[19:45:16] cthulchu: I need a Class
[19:45:23] cthulchu: but I also need a static variable in it
[19:45:32] cthulchu: like say you have a class of dogs
[19:45:33] havenwood: cthulchu: Then you'll use Class::new with #initialize.
[19:45:47] havenwood: cthulchu: Say more?
[19:45:55] kmckelvin: has joined #ruby
[19:45:59] havenwood: So you have multiple dogs, each dog has different state?
[19:46:07] cthulchu: a class of dogs, but I want to set the nubmer of tails for all dogs in this class
[19:46:24] cthulchu: so like all dogs in my class will have 1 tail
[19:46:30] andrewray: Hello. I feel frustrated writing ruby, because the adopted design patterns are all pseudo-OO, when it seems like only using functions/lambdas is possible, but not explored
[19:46:32] cthulchu: that 1 has to be a variable
[19:46:55] havenwood: andrewray: Many folk these days do prefer to write Ruby in a functional fashion. I like it.
[19:46:56] andrewray: are there any articles or mentalities that explore a non-OO approach to ruby, like other dynamic languages have adopted? Or should I give up my dream and acknowledge that OO is the "ruby way"
[19:47:17] havenwood: andrewray: The folk behind tools like the Dry gems, ROM and Roda are big into functional programming.
[19:47:28] jenrzzz: has joined #ruby
[19:47:29] havenwood: andrewray: http://dry-rb.org/gems/
[19:47:32] havenwood: andrewray: And Hanami, etc.
[19:47:34] dogweather: has joined #ruby
[19:47:36] cthulchu: I would actually enjoy functional approach in Ruby too if I hadn't have the legacy of oop
[19:47:43] havenwood: andrewray: http://hanamirb.org/
[19:47:45] lxsameer: has joined #ruby
[19:47:55] havenwood: andrewray: http://roda.jeremyevans.net/
[19:47:59] andrewray: havenwood: hmm, the first example dry gem http://dry-rb.org/gems/dry-auto_inject/ is a class mixin, and I want to avoid both classes and mixins :P
[19:48:33] havenwood: andrewray: They're trying to be good functional citizens in an OO world. Yeah, it's not pure functional.
[19:48:44] cadillac_: has joined #ruby
[19:48:45] havenwood: andrewray: http://rom-rb.org/
[19:48:48] andrewray: but I also want a thinkpiece on if this is possible and scalable in ruby. there's some fundamental issues with the language that I suspect would make it difficult, but I don't have enough experience to make a judgement call
[19:49:14] andrewray: havenwood: understood, I'm not aiming for pure FP (and don't have any pure fp experience)
[19:49:14] havenwood: andrewray: Lack of immutable data structures, pattern matching and TCO are limitation that come to mind.
[19:49:17] cthulchu: okay, let's say I have a dog class with many dog instances. I want to know how many dogs I have. For this, I need a static class variable and I need to increment it by one in the constructor. How do I create that variable?
[19:49:49] havenwood: andrewray: There are libraries for immutable data structures, like Hamster. I think we might just be better off using JRuby with Clojure data structures. ;-P
[19:49:51] cagomez: has joined #ruby
[19:50:17] havenwood: andrewray: There's a fork of Ruby with pattern matching that was presented at Ruby Kaigi. I think it'll be in Ruby's future.
[19:50:43] havenwood: andrewray: You can currently enable TCO, but it's disabled by default in favor of trace instructions.
[19:50:50] andrewray: this question is also specific to a rails ecosystem, where i'm also wondering if I can do anything to structure the app that's not class-hard-baked 24/7. it's already difficult because models are central to everything
[19:51:28] ^mtkd: has joined #ruby
[19:51:34] havenwood: cthulchu: You could use a Singleton class to count dogs. You could use class variables. Maybe even the observer pattern.
[19:51:53] andrewray: I don't have immutable data, I have a "thing" that knows how to update itself, what its connected to, how to manipulate and mutate itself, and I'm frustrated that the design patterns around models don't consider making a model just data
[19:52:00] dminuoso: andrewray: check out trailblazers
[19:52:20] dminuoso: andrewray: they provide a different mental model to structure apps, it's slightly more FP inclined.
[19:52:23] havenwood: andrewray: +1 trailblazer - even if it's just for ideas and you don't use the lib
[19:52:36] jenrzzz: has joined #ruby
[19:52:36] jenrzzz: has joined #ruby
[19:53:22] havenwood: cthulchu: Can dogs be destroyed or only initialized?
[19:53:36] apeiros: has joined #ruby
[19:53:38] cthulchu: they can be destroyed
[19:53:39] codymj: has joined #ruby
[19:53:40] havenwood: cthulchu: Do you always care about all dog tails, or some dog's tails don't count?
[19:53:56] cthulchu: some dogs don't have tails and some have more than one
[19:54:05] cthulchu: the constructor lets them decide
[19:54:12] havenwood: Do some dogs not have tails?
[19:54:13] havenwood: Ah, the multi-tailed dog, yes.
[19:56:03] zenspider: havenwood: what are you on about?!?
[19:56:09] andrewray: thank you havenwood and dminuoso this is something to explore. i'm still unclear if I can write closer-to-explicit-functions-everywhere especially in a rails ecosystem, or if I should bolster on an anti-class mentality wherever I can, and acknowledge that there are some things I can't change
[19:56:11] cthulchu: I know nobody likes @@, but it's the simplest solution
[19:56:29] havenwood: zenspider: cthulchu is exploring class variables with dog tails
[19:56:29] cthulchu: and the one I googled adds the whole getter-setter thing to the class
[19:56:43] zenspider: I... what? ... nevermind. of course.
[19:57:02] cthulchu: zenspider, how does it look to you? https://eval.in/1022914
[19:57:33] cthulchu: he doesn't like dogs.
[19:58:00] mtkd: has joined #ruby
[20:00:21] gheegh: has joined #ruby
[20:01:07] cthulchu: I don't think singletons are the solution
[20:01:27] cthulchu: unless I use them on self in the class, which makes it barely singleton
[20:01:57] jenrzzz: has joined #ruby
[20:01:57] jenrzzz: has joined #ruby
[20:02:16] cthulchu: anyhow, I'll go with @@ for now since there's no efficient analogue.
[20:02:40] mostlybadfly: has joined #ruby
[20:02:45] lxsameer: has joined #ruby
[20:03:46] orbyt_: has joined #ruby
[20:03:46] Cthulu201: has joined #ruby
[20:05:02] dogweather: has joined #ruby
[20:05:39] karapetyan: has joined #ruby
[20:07:11] ElFerna: has joined #ruby
[20:08:43] ElFerna_: has joined #ruby
[20:08:49] clemens3: has joined #ruby
[20:12:57] lxsameer: has joined #ruby
[20:15:40] roamingdog: has joined #ruby
[20:16:19] ElFerna_: has joined #ruby
[20:16:31] roamingdog: has joined #ruby
[20:17:16] roamingdog: has joined #ruby
[20:18:03] roamingdog: has joined #ruby
[20:18:53] roamingdog: has joined #ruby
[20:19:38] roamingdog: has joined #ruby
[20:19:44] ElFerna: has joined #ruby
[20:20:28] roamingdog: has joined #ruby
[20:20:48] havenwood: cthulchu: Here's a contrived example of a TailCounter Singleton Class, just to show a few things: https://gist.github.com/havenwood/936c64ae9fae91f18450bf1d3754a12e
[20:21:03] apeiros: has joined #ruby
[20:21:18] roamingdog: has joined #ruby
[20:22:01] dogweather: has joined #ruby
[20:22:54] matyf: has joined #ruby
[20:23:12] lxsameer: has joined #ruby
[20:25:06] havenwood: cthulchu: https://ruby-doc.org/stdlib-2.5.0/libdoc/observer/rdoc/Observable.html
[20:25:13] Zarthus: i'd hate to be glowing_green, that one endured torture
[20:28:53] havenwood: cthulchu: You might try a stab at the Observer pattern with a Singleton class counter, as an exercise.
[20:29:45] havenwood: Extra points for implementing your own serialization on the singleton class, with an option to dump or load the counter from disk.
[20:30:39] venmx: has joined #ruby
[20:33:29] lxsameer: has joined #ruby
[20:33:35] LongcatLulz: has joined #ruby
[20:33:35] apeiros: has joined #ruby
[20:34:10] icarus: has joined #ruby
[20:35:27] orbyt_: has joined #ruby
[20:35:35] zenspider: havenwood: that seems like a lot of work to me.
[20:35:40] zenspider: Not sure I'd go that route
[20:35:42] reber__: has joined #ruby
[20:35:44] zenspider: esp for a beginner
[20:36:14] havenwood: zenspider: It's certainly not the simplest thing that possibly works, but cthulchu wants the most complicated thing that possibly works I think. ;-P
[20:36:21] havenwood: zenspider: I generally agree.
[20:36:25] zenspider: of course they do
[20:36:55] havenwood: LongcatLulz: hi!
[20:37:18] zenspider: I'd probably throw a const w/ an array in the main class, add the instance to the collection, and then enumerate that to sum the tails.
[20:37:30] zenspider: throw in weakrefs if you need to GC them
[20:37:40] t0xik: has joined #ruby
[20:39:10] zenspider: (or reject this requirement in the first place)
[20:39:22] lxsameer: has joined #ruby
[20:41:24] cbz: has joined #ruby
[20:42:14] cagomez: has joined #ruby
[20:42:23] cthulchu: It's a bit weird that the concept of a static variable is so disturbing in Ruby
[20:42:30] cthulchu: I feel like following the wrong path
[20:43:01] andrewray: has joined #ruby
[20:43:21] cthulchu: I just realized how to implement what I want via static setters/getters and you give me something completely different and a lot more complex
[20:45:35] TvL2386: hi everybody!
[20:45:44] amar: has joined #ruby
[20:47:24] subroot: has joined #ruby
[20:49:11] dogweather: has joined #ruby
[20:49:34] lxsameer: has joined #ruby
[20:50:36] cthulchu: lol you have a whole class to count tails
[20:50:47] cthulchu: I have just one variable for it
[20:51:16] TvL2386: class TailCounter?
[20:51:36] cthulchu: I was trying to understand how static class vars work in Ruby
[20:52:08] TvL2386: as in: a constant?
[20:52:18] cthulchu: variable is not a constant
[20:52:25] cthulchu: it needs to be changed
[20:52:39] cthulchu: the closest simplest concept I found is @@
[20:52:53] cthulchu: the only drawback is that it cascades down to children
[20:53:03] havenwood: cthulchu: I think you'll have better luck accomplishing tasks without trying to use the Java analogue to do so. Try the simplest thing that can possibly work, without paying attention to how Java does it.
[20:53:04] cthulchu: which is not a drawback to me, I kinda want it to do that
[20:53:28] cthulchu: okay, a real life thing I'm working on
[20:53:52] cthulchu: I have analytics test instance that gets created in a test and runs instance methods to check analytics stuff
[20:54:01] TvL2386: I've been programming Ruby for 10 years now. I am a network guy, so don't listen to me, but a "static class var" is not something that lands
[20:54:16] TvL2386: from java I do know that yes :)
[20:54:27] cthulchu: after each analytics test, I want to have a global variable in my class to push the results in it.
[20:54:38] cthulchu: and then I have a method for printing it
[20:54:48] TvL2386: cthulchu: class var is not a drawback, it's awesome ;)
[20:54:57] cthulchu: I know, right!
[20:55:19] lupine: *shudder*
[20:55:20] roamingdog: has joined #ruby
[20:55:30] lupine: just use a proper $global, it's easier to track scope
[20:55:42] lupine: unless you accidentally shadow a thread-local $global maybe
[20:55:48] cthulchu: would I create that $ global in class?
[20:55:56] lupine: doesn't matter where or how you create it
[20:56:05] cthulchu: it will be acessible everywhere?
[20:56:12] elomatreb: globally, yes :P
[20:56:16] cthulchu: looks like an overkill
[20:56:41] elomatreb: Not just an overkill, it gives off the foul smell of shared mutable state
[20:57:01] TvL2386: maybe you can make an object to contain your analytic test data and pass that to your test instance to accumulate the results?
[20:57:02] cthulchu: @@ looks like a bit less... global
[20:57:14] cthulchu: I think I can do that
[20:57:21] cthulchu: but it feels like too much trouble
[20:57:34] cthulchu: and I don't want to interfere with the test too much
[20:57:35] elomatreb: I have never seen a situation where a class var was the right tool for the job, and not a red herring
[20:57:38] cthulchu: since it's not my code
[20:57:40] TvL2386: I'd avoid using globals at all times
[20:57:50] Lyfe_: I don't know why you would store a value into any sort of shared state prior to printing it, since that sounds like a future race condition issue to me.
[20:58:10] cthulchu: we have like a thousand tests
[20:58:11] zenspider: that's just horrible
[20:58:19] cthulchu: In that variable I have two counters
[20:58:28] TvL2386: probably if I grep through my code `grep -r @@` of the last ten years I'll get a handful of hits
[20:58:40] zenspider: a class constant or class ivar or even a class cvar are vastly better than a global
[20:58:40] cthulchu: when test initiates, I increment one of them
[20:58:58] cthulchu: that's exactly the other solution I found
[20:58:58] havenwood: cthulchu: Where does this inter-instance, accumlated info get ultimately used?
[20:58:59] zenspider: and a class constant or cvar are just as accessible but at least namespaced
[20:59:01] cthulchu: and it was ok
[20:59:20] cagomez: has joined #ruby
[20:59:45] zenspider: TvL2386: I use them now and then...
[20:59:49] lxsameer: has joined #ruby
[20:59:52] TvL2386: yeah if you wanted a static class variable, you could still use a class constant
[20:59:55] havenwood: cthulchu: Are you accumulating these stats to print them at the end of the tests? Or something else?
[21:00:04] TvL2386: yes you cannot reassign it, so an Integer would be wrong
[21:00:10] TvL2386: but you can make it a Hash
[21:00:16] TvL2386: and change 1 of the keys everytime
[21:00:51] cthulchu: I do that to send them to my slack
[21:00:53] cthulchu: if it matters
[21:01:03] havenwood: I wonder if it'd be nicer to freeze constants by default. I can't recall the last time I used a constant without it being frozen.
[21:01:21] cthulchu: freezing is like final?
[21:01:38] TvL2386: freeze makes the object immutable right?
[21:01:47] TvL2386: I've never ever used it
[21:01:55] cthulchu: what a constant does to an object?
[21:02:00] cthulchu: I would expect it from a constant
[21:02:13] cthulchu: mutable constant is a variable
[21:02:49] TvL2386: well, you can always change the object the constant points to
[21:02:54] TvL2386: but you cannot reassign the constant
[21:03:10] havenwood: cthulchu: There's not a straightforward way to thaw something that's frozen, other than #dup. It's of course possible with Fiddle. >.>
[21:03:31] TvL2386: ah well, actually you can :)
[21:03:35] ElFerna: has joined #ruby
[21:03:38] TvL2386: (irb):2: warning: already initialized constant CONSTANT
[21:03:45] TvL2386: but we don't mind :)
[21:03:59] elomatreb: And freezing is not recursive either, so e.g. if you freeze a Hash you can't insert new keys but you can mutate the members that are already there
[21:04:02] havenwood: cthulchu: Constants are not frozen by default. They give you a warning if you reassign the value, but not if you mutate it.
[21:04:20] havenwood: elomatreb: I'll be glad when we have a deep_freeze
[21:04:36] havenwood: elomatreb: for now there's the ice_nine gem
[21:04:44] elomatreb: Is that coming as standard? I always used the gem when I wanted it
[21:05:07] zenspider: TvL2386: constants aren't actually constant. They just warn when reassigned.
[21:05:18] TvL2386: yup I know
[21:05:26] zenspider: freezing is sorta mostly constant
[21:05:26] havenwood: elomatreb: there have been a few issues around it - i vaguely recall something promising
[21:05:33] havenwood: https://bugs.ruby-lang.org/issues/12008
[21:05:51] TvL2386: I just knew from years ago ruby gave a warning when reassigning... haven't don't it for ages... not exactly a good practice so I was wondering how 2.6.0-preview2 would react
[21:05:53] havenwood: https://bugs.ruby-lang.org/issues/2509
[21:06:26] zenspider: you can get around the warning using const setters
[21:07:11] TvL2386: I did that in the past
[21:07:16] TvL2386: have no idea why anymore
[21:08:58] nythalcrow: has joined #ruby
[21:09:55] raynold: has joined #ruby
[21:10:03] lxsameer: has joined #ruby
[21:10:22] zenspider: UGH. rspec's not_to is such a clusterfuck
[21:12:07] Zarthus: negation in general is.
[21:13:17] cthulchu: interesting
[21:14:04] Azure: has joined #ruby
[21:16:21] Puffball: has joined #ruby
[21:18:00] BH23: has joined #ruby
[21:20:14] lxsameer: has joined #ruby
[21:21:35] TvL2386: so... I'm having a problem I'm trying to solve.... I made a multi user website where you can track your amount and value of "assets". Every hour my site gets updated from an external source so I know the most recent values for all assets. So far so good... But now I wanted history information, so I added a table where I keep track of the history. Problem is that all those data points are too much and I
[21:21:41] TvL2386: think mariadb is not really suited for this
[21:22:15] TvL2386: not really a ruby question though...
[21:22:49] TvL2386: not really a question either....
[21:23:02] havenwood: TvL2386: I think we have a lot of DB baggage from the days where we had no space, so everything had to be optimized towards space-saving.
[21:23:26] havenwood: TvL2386: DBs like Datomic make a lot of sense. It's a shame they don't yet have more mindshare.
[21:23:27] elomatreb: If you use proper indexes you can usually scale any simple DB to most demands
[21:24:42] TvL2386: I'll check that out havenwood! Never heard of it... I was thinking to look at influxdb
[21:24:58] havenwood: TvL2386: Rich Hickey has a good talk discussing how facts change over time, and that's what we care about: https://www.youtube.com/watch?v=V6DKjEbdYos
[21:25:04] TvL2386: I have limited RAM though for the app and the db (8GB RAM)
[21:25:06] havenwood: https://www.infoq.com/presentations/Datomic-Database-Value
[21:25:18] havenwood: TvL2386: Unlimited disk space? ;-P
[21:25:39] TvL2386: thanks for the links :)
[21:25:50] TvL2386: disk space? 4TB left :)
[21:26:04] TvL2386: self hosted, just for fun :)
[21:26:05] elomatreb: Do you actually need the full history though? The simplest solution that would avoid the need of moving databases would be a cronjob that cleans the history, say, to a million points
[21:27:03] havenwood: TvL2386: Datomic can actually use MySQL (I presume MariaDB as well) for the storage service.
[21:27:26] havenwood: TvL2386: If you need to query against facts over time, it might be worth looking at.
[21:28:38] TvL2386: elomatreb: I have a routine to delete points for records older than a certain date, that helps
[21:28:48] TvL2386: less fine grained, but more performance
[21:29:07] dogweather: has joined #ruby
[21:29:28] elomatreb: Yeah, combined with a proper index I don't really see why you should want to involve super-fancy custom databases
[21:29:38] TvL2386: also my highchart multiline graphs really don't like multiple lines containing several megabytes of json data
[21:30:29] lxsameer: has joined #ruby
[21:34:21] TvL2386: I'm also thinking that instead of saving everybodies "amount and value of ITEM" every hour, it maybe better to just save "value of 1 ITEM" every hour and only save everybodies amount when it changes. Then correlate the two
[21:34:26] r29v: has joined #ruby
[21:34:38] TvL2386: not sure if I'm still making sense
[21:36:09] jenrzzz: has joined #ruby
[21:39:13] codymj: has joined #ruby
[21:40:21] Fr4n: has joined #ruby
[21:40:40] lxsameer: has joined #ruby
[21:45:02] RougeR: has joined #ruby
[21:46:25] dogweather: has joined #ruby
[21:46:54] jordanm: has joined #ruby
[21:50:12] jottr: has joined #ruby
[21:50:23] dogweather: has joined #ruby
[21:50:53] lxsameer: has joined #ruby
[22:01:08] lxsameer: has joined #ruby
[22:05:21] ^mtkd: has joined #ruby
[22:05:38] jenrzzz_: has joined #ruby
[22:05:44] akaiiro: has joined #ruby
[22:07:55] mlkkk: has joined #ruby
[22:08:48] pnkl: has joined #ruby
[22:08:57] kapil___: has joined #ruby
[22:10:37] fmcgeough: has joined #ruby
[22:11:01] ElFerna: has joined #ruby
[22:11:23] lxsameer: has joined #ruby
[22:12:20] mtkd: has joined #ruby
[22:16:38] LongcatLulz: I made an indie exploration game in my spare time: https://socah.itch.io/railroadtracks
[22:16:47] LongcatLulz: srry for spamming u
[22:17:02] akaiiro: has joined #ruby
[22:21:38] lxsameer: has joined #ruby
[22:23:55] akaiiro: has joined #ruby
[22:28:18] WhereIsMySpoon__: has left #ruby: ("http://quassel-irc.org - Chat comfortably. Anywhere.")
[22:30:54] akaiiro: has joined #ruby
[22:31:45] lxsameer: has joined #ruby
[22:40:10] LongcatLulz: has left #ruby: ("Closing Window")
[22:41:59] lxsameer: has joined #ruby
[22:48:44] kevinburke: has joined #ruby
[22:51:25] dogweather: has joined #ruby
[22:52:16] lxsameer: has joined #ruby
[22:56:40] jenrzzz: has joined #ruby
[22:56:53] r29v: has joined #ruby
[22:58:37] garyserj: has joined #ruby
[23:02:25] lxsameer: has joined #ruby
[23:04:12] ltp: has joined #ruby
[23:08:09] matyf: has joined #ruby
[23:12:41] lxsameer: has joined #ruby
[23:13:48] roamingdog: has joined #ruby
[23:14:32] roamingdog: has joined #ruby
[23:22:45] cthulchu: I'll have a minitest instance in my class!
[23:22:53] lxsameer: has joined #ruby
[23:23:04] cthulchu: just to fail or success my tests in a nice way
[23:26:22] matyf: has joined #ruby
[23:28:46] roamingdog: has joined #ruby
[23:29:31] roamingdog: has joined #ruby
[23:30:21] roamingdog: has joined #ruby
[23:31:09] roamingdog: has joined #ruby
[23:31:57] roamingdog: has joined #ruby
[23:32:46] orbyt_: has joined #ruby
[23:33:07] lxsameer: has joined #ruby
[23:34:48] gil_: has joined #ruby
[23:38:49] mikecmpbll: has joined #ruby
[23:40:22] gil_: has joined #ruby
[23:43:01] dogweather: has joined #ruby
[23:43:19] lxsameer: has joined #ruby
[23:45:27] matyf: has joined #ruby
[23:50:51] matyf: has joined #ruby
[23:53:29] lxsameer: has joined #ruby
[23:57:46] shinnya: has joined #ruby