« Back to channel list

#ruby - 21 June 2018

« Back 1 day Forward 1 day »
[00:02:11] dinfuehr: has joined #ruby
[00:07:34] ElFerna: has joined #ruby
[00:07:35] Guest58336: has joined #ruby
[00:17:25] Guest58336: has joined #ruby
[00:18:43] nowhere_man: has joined #ruby
[00:25:26] cthulchu_: the most annoying thing ever is absense of seamless casting
[00:25:53] cthulchu_: so I always have to do weird stuff like a.to_s == b.to_s
[00:27:37] cthulchu_: I mean I used to do it in Java and other languages of the same level, but Ruby feels top level enough to have it.
[00:27:51] cthulchu_: so many unexpected things
[00:33:19] gr33n7007h: has joined #ruby
[00:33:34] tjbp: has joined #ruby
[00:38:50] TinkerT: has joined #ruby
[00:40:27] roamingdog: has joined #ruby
[00:46:53] havenwood: cthulchu_: By "seamless casting" I think you mean weak typing. :-P
[00:47:28] havenwood: There's no reason for it to exist, but... anyhoo - a pure Ruby SipHash 13 command line tool: https://github.com/havenwood/digest-sip_hash#command-line-examples
[00:47:54] SeepingN: has joined #ruby
[00:47:57] solocshaw: has joined #ruby
[00:48:46] herbmillerjr: has joined #ruby
[00:49:13] havenwood: cthulchu_: And yuck. Do you want the `1 + '1' #=> '11'` JavaScript madness. Or the `1 + '1' #=> 2` PHP madness?
[00:49:18] baweaver: havenwood: So can you `sip "tea"` now?
[00:49:28] orbyt_: has joined #ruby
[00:50:02] havenwood: baweaver: echo -n "tea" | siphash #=> 70b4599868a10553 -
[00:50:05] havenwood: baweaver: checks out!
[00:51:03] baweaver: cthulchu_: "unexpected" is very much dangerous to use loosely. For you, a newbie to the language, a lot of things are going to be unexpected at a personal level as you have biases from other languages.
[00:51:35] baweaver: Such as 0 being truthy. For Rubyists that's expected. For someone who's used other languages that can be surprising.
[00:51:41] Zarthus: in fairness, php 7.x permits strict typing (though it doesn't solve 1+'1' specifically, you can now specify the type in a function and ensure it really is that.)
[00:53:10] Zarthus: i do much prefer a typeerror on this kind of stuff, though.
[00:53:26] Zarthus: While I may take care of my code.. my colleagues seem to have different ideas :P
[00:54:49] cjs226_: has joined #ruby
[00:55:48] havenwood: Zarthus: Yeah, PHP isn't strongly typed, but it does have a few strict features. I think people often confuse strict and strong, since they're both s-words.
[00:56:15] havenwood: I have no weak typing envy.
[00:57:32] Zarthus: php without strict typing opt-in is just chaos.
[00:58:28] havenwood: ACTION It's actually kinda hard to find SipHash 13 examples. This Elixir one is my favorite: https://github.com/whitfin/siphash-elixir
[01:02:26] Guest58336: has joined #ruby
[01:12:42] Guest58336: has joined #ruby
[01:19:57] zenspider: if a != b && a.to_s == b.to_s then # => ???
[01:19:59] dogweather: has joined #ruby
[01:20:13] zenspider: that sure seems like a clusterfuck to debug to me...
[01:20:38] jyaworski: has joined #ruby
[01:22:30] zenspider: havenwood: consider refactoring with an #add method that always does the mask.
[01:23:19] havenwood: zenspider: Good point. It's repetitive. Thanks, will do!
[01:23:40] zenspider: having a proper numeric stack can be a pita sometimes.
[01:24:11] zenspider: it'd kinda be neat if you could opt into fixed size ints sometimes... tho that opens their own can of worms too
[01:32:28] Guest58336: has joined #ruby
[01:35:26] ruby[bot]: -b Purplex!*@*$#ruby-banned
[01:35:51] nowhere_man: has joined #ruby
[01:54:10] ciscam: has joined #ruby
[01:57:46] workmad3: has joined #ruby
[01:59:14] ElFerna: has joined #ruby
[02:03:43] Lytol: has joined #ruby
[02:08:21] gnufied: has joined #ruby
[02:09:59] konsolebox: has joined #ruby
[02:12:55] cschneid: has joined #ruby
[02:13:36] cschneid: has joined #ruby
[02:16:57] whathappens: has joined #ruby
[02:20:14] white_lilies: has joined #ruby
[02:27:27] Guest58336: has joined #ruby
[02:28:37] cadillac_: has joined #ruby
[02:31:21] chamar: has joined #ruby
[02:33:44] tdy: has joined #ruby
[02:34:12] ghoti: has joined #ruby
[02:37:27] Guest58336: has joined #ruby
[02:40:19] pastorinni: has joined #ruby
[02:54:13] StarSeed0000: has joined #ruby
[02:55:06] shinnya: has joined #ruby
[02:59:19] pastorinni: has joined #ruby
[03:00:20] cadillac_: has joined #ruby
[03:08:24] booboy: has joined #ruby
[03:12:01] braincras: has joined #ruby
[03:13:32] sspreitz: has joined #ruby
[03:14:29] ElFerna: has joined #ruby
[03:17:22] Guest58336: has joined #ruby
[03:33:29] meinside: has joined #ruby
[03:34:18] cschneid: has joined #ruby
[03:43:55] cadillac_: has joined #ruby
[03:44:12] dogweather: has joined #ruby
[03:55:05] \void: has joined #ruby
[03:57:18] gix: has joined #ruby
[03:58:44] ciscam: has joined #ruby
[04:01:15] haxx0r: https://thepasteb.in/p/2RhK443ZyO7s4 why is the .average() function returning 1/100ths of the real result? that's weired tho
[04:01:23] haxx0r: ^ rails related
[04:04:18] mozzarella: haxx0r: it's not
[04:04:38] mozzarella: e2 means * 10^2
[04:04:59] haxx0r: lol, i didn't even see that
[04:05:12] haxx0r: to_s gives "18.384333313836"
[04:05:25] haxx0r: sweet. thanks!
[04:07:12] akaiiro: has joined #ruby
[04:07:27] Guest58336: has joined #ruby
[04:11:17] shwouchk: has joined #ruby
[04:17:24] Guest58336: has joined #ruby
[04:22:28] Guest58336: has joined #ruby
[04:22:44] NightMonkey: has joined #ruby
[04:22:47] nickjj: has joined #ruby
[04:27:27] Guest58336: has joined #ruby
[04:32:33] ElFerna: has joined #ruby
[04:41:22] JamJam_kid: has joined #ruby
[04:41:32] cschneid: has joined #ruby
[04:42:26] mjolnird: has joined #ruby
[04:45:38] akaiiro: has joined #ruby
[04:47:38] Dykam: has joined #ruby
[04:49:26] suukim: has joined #ruby
[04:50:00] cschneid: has joined #ruby
[05:06:06] cschneid: has joined #ruby
[05:06:53] apeiros: has joined #ruby
[05:12:40] Guest58336: has joined #ruby
[05:14:04] Dykam: has joined #ruby
[05:17:21] cschneid: has joined #ruby
[05:18:19] dhollinger: has joined #ruby
[05:20:24] wilbert: has joined #ruby
[05:20:51] sauvin: has joined #ruby
[05:27:06] nowhere_man: has joined #ruby
[05:30:27] cschneid: has joined #ruby
[05:31:29] nowhere_man: has joined #ruby
[05:32:07] Junaos: has joined #ruby
[05:32:24] Guest58336: has joined #ruby
[05:33:13] anisha: has joined #ruby
[05:34:31] G: has joined #ruby
[05:34:54] planigan: has joined #ruby
[05:35:54] eam: has joined #ruby
[05:36:08] ElFerna: has joined #ruby
[05:38:03] dogweather: has joined #ruby
[05:38:15] venmx: has joined #ruby
[05:40:49] motstgo_: has joined #ruby
[05:42:24] Guest58336: has joined #ruby
[05:44:34] reber: has joined #ruby
[05:50:00] kitallis: has joined #ruby
[05:52:24] Guest58336: has joined #ruby
[05:54:18] jcarl43: has joined #ruby
[05:55:46] r29v: has joined #ruby
[05:56:38] sauvin: has joined #ruby
[05:56:56] TomyWork: has joined #ruby
[05:57:29] aupadhye: has joined #ruby
[05:57:57] Dockyard: has joined #ruby
[05:58:33] workmad3: has joined #ruby
[05:59:07] kitallisii: has joined #ruby
[06:19:50] biberu: has joined #ruby
[06:26:47] cthu|: has joined #ruby
[06:27:08] DTZUZO: has joined #ruby
[06:30:50] schleppel: has joined #ruby
[06:32:28] Guest58336: has joined #ruby
[06:32:51] ciscam: has joined #ruby
[06:35:35] amar: has joined #ruby
[06:39:56] dogweather: has joined #ruby
[06:40:22] russt: has joined #ruby
[06:42:45] ElFerna: has joined #ruby
[06:43:41] jmi0920: has joined #ruby
[06:47:28] Guest58336: has joined #ruby
[06:49:00] epochwolf: has joined #ruby
[06:50:38] andikr: has joined #ruby
[06:54:35] KnownSyntax: has joined #ruby
[06:55:28] epochwolf: has joined #ruby
[06:57:30] craysiii: has joined #ruby
[06:58:46] Dockyard: has joined #ruby
[07:00:17] baweaver: has joined #ruby
[07:00:17] baweaver: has joined #ruby
[07:01:20] craysiii: has joined #ruby
[07:01:43] kspencer-: has joined #ruby
[07:04:23] KnownSyntax: has joined #ruby
[07:04:38] kspencer-: has joined #ruby
[07:07:22] KnownSyntax: has joined #ruby
[07:07:43] clemens3: has joined #ruby
[07:08:25] rann: has joined #ruby
[07:10:18] uditk: has left #ruby: ()
[07:10:42] KnownSyntax: has joined #ruby
[07:12:14] craysiii: has joined #ruby
[07:12:45] hurricanehrndz: has joined #ruby
[07:13:03] rann: has joined #ruby
[07:13:13] kspencer-: has joined #ruby
[07:13:26] KnownSyntax: has joined #ruby
[07:14:13] aufi: has joined #ruby
[07:14:27] aupadhye: has joined #ruby
[07:15:36] epochwolf: has joined #ruby
[07:15:47] claudiuinberlin: has joined #ruby
[07:22:21] sysvalve: has joined #ruby
[07:25:17] za1b1tsu: has joined #ruby
[07:27:25] Guest58336: has joined #ruby
[07:27:59] amar: has joined #ruby
[07:33:10] aupadhye: has joined #ruby
[07:36:23] jzhu: has joined #ruby
[07:37:04] cschneid: has joined #ruby
[07:37:24] Guest58336: has joined #ruby
[07:39:45] dogweather: has joined #ruby
[07:40:53] za1b1tsu: has joined #ruby
[07:43:41] p4p0l0: has joined #ruby
[07:44:09] SolarAquarion: has joined #ruby
[07:45:48] dogweather: has joined #ruby
[07:47:26] Guest58336: has joined #ruby
[07:50:39] dionysus69: has joined #ruby
[07:51:27] venmx: has joined #ruby
[07:52:35] DoubleMalt: has joined #ruby
[07:52:43] Guest58336: has joined #ruby
[07:54:32] wald0: has joined #ruby
[07:56:19] aufi_: has joined #ruby
[07:58:07] sysvalve: has joined #ruby
[07:58:57] workmad3: has joined #ruby
[07:59:24] yohji: has joined #ruby
[08:01:14] burgestrand: has joined #ruby
[08:02:39] Guest58336: has joined #ruby
[08:09:48] conta: has joined #ruby
[08:12:09] Klumben: has joined #ruby
[08:19:03] dr3wo: has joined #ruby
[08:23:53] claudiuinberlin: has joined #ruby
[08:26:25] ishe: has joined #ruby
[08:26:31] amar: has joined #ruby
[08:28:39] amar: has joined #ruby
[08:31:35] guille-moe: has joined #ruby
[08:36:32] RougeR: has joined #ruby
[08:36:32] RougeR: has joined #ruby
[08:39:03] cadillac_: has joined #ruby
[08:39:09] guille-moe: has joined #ruby
[08:42:04] tvw: has joined #ruby
[08:45:32] cadillac_: has joined #ruby
[08:48:48] arne: some general software design question
[08:49:21] arne: i want a specific format for a ssl key, and i use it often
[08:49:42] ProjectH: has joined #ruby
[08:49:47] arne: ssl_key.to_s.lines[1..-1].map(&:strip).join
[08:49:55] arne: now ih ave that code, where do i put it?
[08:50:14] arne: utility class? do i monkeypatch PKey::RSA? do i put it in a proc?
[08:50:37] Mike11: has joined #ruby
[08:53:03] cadillac_: has joined #ruby
[08:53:17] arne: do i rewrite it in every class i program?
[08:54:19] jottr: has joined #ruby
[08:58:38] Quintasan: arne: You can try using refinements
[08:58:45] Quintasan: arne: https://docs.ruby-lang.org/en/2.4.0/syntax/refinements_rdoc.html
[09:00:35] arne: so it's a clojure monkeypatch?
[09:00:37] Beams: has joined #ruby
[09:00:39] workmad3: has joined #ruby
[09:00:55] guille-moe: has joined #ruby
[09:01:22] dhollin3: has joined #ruby
[09:06:04] Dockyard: has joined #ruby
[09:06:10] cschneid: has joined #ruby
[09:07:56] tty: has joined #ruby
[09:09:24] gregf_: has joined #ruby
[09:10:01] arne: is there a short version for class.method?
[09:10:10] guille-moe: has joined #ruby
[09:10:18] arne: (calling a method of the class, inside of an instance of said class)
[09:10:22] arne: just wondering
[09:11:42] arne: would that be cool?
[09:11:43] arne: guess not
[09:11:46] icarus: has joined #ruby
[09:12:23] dminuoso: arne: For what its worth I think class methods are a fatally wrong abstraction.
[09:12:45] dminuoso: Virtually all class methods are just a wrongful attempt to create namespaced *functions*
[09:12:54] ur5us: has joined #ruby
[09:13:00] arne: for what its worth OOP is the wrong abstraction
[09:13:21] dminuoso: arne: OOP has a lot of so-called "patterns" that shoe horn abstractions into OO.
[09:13:58] arne: whats wrong about namespaced functions tho
[09:14:03] dminuoso: The "factory pattern" is not the solution to a problem.
[09:14:15] ElFerna: has joined #ruby
[09:14:15] dminuoso: It's a work around because most OO languages lack higher order functions.
[09:14:22] dminuoso: 11:13 arne | whats wrong about namespaced functions tho
[09:14:37] dminuoso: Except Ruby has no module infrastructure and no proper standalone functions
[09:14:51] dminuoso: The closest thing is `E = -> (e) { ... }`
[09:14:57] dminuoso: But that infests global namespace
[09:15:40] arne: well, whats the difference between standalone functions & not
[09:22:22] dminuoso: arne: You mean the difference between a method and a lambda?
[09:22:26] dminuoso: one is bound to an instance
[09:22:36] dminuoso: python makes this a bit more obvious
[09:22:46] dminuoso: methods effectively receive an implicit parameter (self)
[09:25:44] cdunklau: a great source of confusion for newbies, that
[09:25:48] cdunklau: but yeah the explictness is nice
[09:28:11] Dykam: has joined #ruby
[09:29:21] dminuoso: something like: foo.bar(quux) is semantically closer to: foo::bar(foo, quux)
[09:29:46] dminuoso: foo.class::bar(foo, quux) as some pseudo code
[09:34:36] cadillac_: has joined #ruby
[09:44:59] KeyJoo: has joined #ruby
[09:52:53] Sylario: has joined #ruby
[09:57:29] jottr: has joined #ruby
[09:58:07] arne: has joined #ruby
[09:59:39] camilasan: has joined #ruby
[10:02:29] desperek: has joined #ruby
[10:14:33] jottr: has joined #ruby
[10:18:11] devyn: has joined #ruby
[10:23:05] arne: has joined #ruby
[10:27:03] mzo: has joined #ruby
[10:29:56] cschneid_: has joined #ruby
[10:30:09] ferr: Hey, any ideas why would this case sentence not fire as expected? https://gist.github.com/Fercell/b7125354e1d3608bf7f52ca8a55813c5
[10:30:35] dminuoso: ferr: because case uses ===
[10:31:48] dminuoso: ferr: What you can do is just use `case self when Load` ...
[10:32:06] dminuoso: It annoys me too =)_
[10:32:30] ciscam: has joined #ruby
[10:33:22] arne: dminuoso: sorry, our primary internet line died
[10:33:44] za1b1tsu: has joined #ruby
[10:34:19] maufart__: has joined #ruby
[10:34:58] Mortomes|Work: has joined #ruby
[10:40:59] jinie: has joined #ruby
[10:41:14] ElFerna: has joined #ruby
[10:43:08] Zaab1t: has joined #ruby
[10:52:26] jrafanie: has joined #ruby
[11:03:10] cadillac_: has joined #ruby
[11:06:04] clemens3: has joined #ruby
[11:14:35] cadillac_: has joined #ruby
[11:16:49] nickjj: has joined #ruby
[11:19:25] conta: has joined #ruby
[11:23:49] lupine: has joined #ruby
[11:24:19] Mike111: has joined #ruby
[11:24:52] karapetyan: has joined #ruby
[11:24:57] cadillac_: has joined #ruby
[11:31:20] Mike11: has joined #ruby
[11:33:58] za1b1tsu: has joined #ruby
[11:38:14] Nicmavr: has joined #ruby
[11:38:26] ldnunes: has joined #ruby
[11:41:26] houhoulis: has joined #ruby
[11:42:12] tdy: has joined #ruby
[11:42:13] cadillac_: has joined #ruby
[11:43:07] jottr: has joined #ruby
[11:45:28] arne: has joined #ruby
[11:48:13] cadillac_: has joined #ruby
[11:49:56] houhoulis: has joined #ruby
[11:55:44] cadillac_: has joined #ruby
[11:58:11] synthroid: has joined #ruby
[12:00:04] jamesaxl: has joined #ruby
[12:03:44] cadillac_: has joined #ruby
[12:04:26] vonfry: has joined #ruby
[12:04:29] tvw: has joined #ruby
[12:05:29] donnie_2: has left #ruby: ("Leaving")
[12:09:13] cadillac_: has joined #ruby
[12:18:42] whathappens: has joined #ruby
[12:18:54] za1b1tsu: has joined #ruby
[12:30:51] jottr: has joined #ruby
[12:32:46] cadillac_: has joined #ruby
[12:33:04] cschneid_: has joined #ruby
[12:33:18] aufi_: has joined #ruby
[12:34:44] cadillac__: has joined #ruby
[12:35:45] Dockyard: has joined #ruby
[12:38:29] psychicist__: has joined #ruby
[12:40:42] cadillac__: has joined #ruby
[12:41:25] gnufied: has joined #ruby
[12:41:51] za1b1tsu: has joined #ruby
[12:45:17] ams__: has joined #ruby
[12:46:16] cadillac-: has joined #ruby
[12:49:17] GodFather: has joined #ruby
[12:49:46] fmcgeough: has joined #ruby
[12:50:23] stnly: has joined #ruby
[12:51:14] nowhereman_: has joined #ruby
[12:55:07] cadillac__: has joined #ruby
[12:57:44] Megamos: has joined #ruby
[12:58:50] karapetyan: has joined #ruby
[13:01:47] maufart__: has joined #ruby
[13:01:58] jzhu: has joined #ruby
[13:02:08] AJA4350: has joined #ruby
[13:03:27] ElFerna: has joined #ruby
[13:04:15] twobitsprite: has joined #ruby
[13:04:48] hph^: has joined #ruby
[13:05:00] cadillac__: has joined #ruby
[13:05:03] karapetyan: has joined #ruby
[13:05:08] hph^: has joined #ruby
[13:05:31] hph^: has joined #ruby
[13:05:51] hph^: has joined #ruby
[13:06:22] OneNeptune: has joined #ruby
[13:06:33] hph^: has joined #ruby
[13:06:56] hph^: has joined #ruby
[13:10:49] yohji: has joined #ruby
[13:12:17] bmurt: has joined #ruby
[13:13:42] livcd: kinda bothers me that graal is not usable that much with Ruby yet
[13:14:10] dminuoso: livcd: what do you mean it is not usable?
[13:14:30] dminuoso: livcd: Blame Ruby for creating an execution model that is notoriously difficult to optimize.
[13:14:55] dminuoso: When performance comes as an afterthought, it's going to be hard.
[13:15:07] livcd: dminuoso: i dont blame anyone i am just complaining it's not ready yet
[13:17:15] karapetyan: has joined #ruby
[13:23:35] cadillac-: has joined #ruby
[13:23:54] KevinSjoberg: has joined #ruby
[13:24:07] Mortomes|Train: has joined #ruby
[13:24:12] clemens3: has joined #ruby
[13:25:11] k0mpa: has joined #ruby
[13:29:02] cadillac__: has joined #ruby
[13:29:20] beefjoe: has joined #ruby
[13:29:58] cschneid_: has joined #ruby
[13:34:10] OneNeptune: has joined #ruby
[13:35:47] jottr: has joined #ruby
[13:36:18] cadillac_: has joined #ruby
[13:36:53] Inline: has joined #ruby
[13:37:57] fmcgeough: has joined #ruby
[13:38:44] mjolnird: has joined #ruby
[13:40:21] zer0s: has joined #ruby
[13:47:47] donofrio: has joined #ruby
[13:47:50] kapil___: has joined #ruby
[13:51:09] soniya29: has joined #ruby
[13:56:55] cadillac_: has joined #ruby
[13:59:09] cadillac__: has joined #ruby
[14:00:23] twobitsp1ite: has joined #ruby
[14:00:28] gnufied: has joined #ruby
[14:02:48] cadillac_: has joined #ruby
[14:09:17] jrafanie: has joined #ruby
[14:09:58] cadillac_: has joined #ruby
[14:10:12] pastorinni: has joined #ruby
[14:10:29] yohji: has joined #ruby
[14:12:37] Rapture: has joined #ruby
[14:14:47] cschneid_: has joined #ruby
[14:17:35] mzo: has joined #ruby
[14:18:46] whathappens: has joined #ruby
[14:24:32] ishe: has joined #ruby
[14:32:23] akaiiro: has joined #ruby
[14:35:32] GodFather: has joined #ruby
[14:37:00] cschneid_: has joined #ruby
[14:37:38] ElFerna: has joined #ruby
[14:38:09] RougeR: has joined #ruby
[14:40:56] gizmore: has joined #ruby
[14:42:39] workmad3: has joined #ruby
[14:46:42] karapetyan: has joined #ruby
[14:47:56] cadillac_: has joined #ruby
[14:48:21] rdg: has joined #ruby
[14:48:48] grilix_: has joined #ruby
[14:49:16] rdg: 'bundle install' constantly spits out that libraries are being ignored due to non built extensions and telling me to run pristine.. is there a way to make them run in bulk?
[14:49:27] rdg: otherwise I'm basically working my way through a dependency tree trying to make it happen right noqw
[14:50:53] elomatreb: Quick-and-dirty fix would potentially be to install a new dependency tree specific to your project, e.g. with `--path=vendor`
[14:51:47] rdg: i'm literally just trying to get an initial jekyll site made
[14:51:53] rdg: like 'jekyll new blog'
[14:51:56] KrzaQ: I'd like to add error reporting to an existing app. Is there a way to add a global uncaught exception handler, so that I wouldn't have to wrap everything in begin/rescues?
[14:52:28] KrzaQ: Basically, I'm looking for something like php's set_exception_handler()
[14:54:23] rdg: i'm using rvm single user install to ~/.rvm and using ruby 2.4.1 .. i run pristine against several of the packages and it doesn't seem to change.. bundle install still reports them not being built
[14:57:02] dminuoso: has left #ruby: ("WeeChat 2.0.1")
[14:58:36] apeiros: has joined #ruby
[14:58:43] karapetyan: has joined #ruby
[15:01:55] rdg: if I run jekyll new site I get -> Could not load Bundler. Bundle install skipped.
[15:03:24] rdg: should I be concerned that my 'bundle' is /usr/bin/bundle instead of in ~.rvm?
[15:03:48] deathwishdave: has joined #ruby
[15:05:13] elomatreb: Probably, unless it's a symlink back to your home directory (which would be also kind of weird)
[15:05:34] elomatreb: Check if your PATH variable contains the rvm-managed directory before the global directory
[15:06:46] cyberg: has joined #ruby
[15:07:15] OneNeptune: has joined #ruby
[15:07:33] rdg: that's what it was
[15:08:19] r29v: has joined #ruby
[15:08:48] arne: has joined #ruby
[15:08:54] fluxAeon: has joined #ruby
[15:09:20] RougeR: has joined #ruby
[15:09:21] RougeR: has joined #ruby
[15:10:11] cschneid_: has joined #ruby
[15:15:14] jottr: has joined #ruby
[15:16:33] Megamos: has joined #ruby
[15:16:50] leitz: has joined #ruby
[15:19:43] RougeR: has joined #ruby
[15:21:59] za1b1tsu: has joined #ruby
[15:24:01] tcopeland: has joined #ruby
[15:24:08] KrzaQ: at_exit seems to do most of the job, but it doesn't catch threading errors
[15:24:36] RougeT430: has joined #ruby
[15:24:45] havenwood: KrzaQ: Do you have?: Thread.abort_on_exception = true
[15:25:13] KrzaQ: I guess it's a fair requirement, thanks
[15:25:27] elomatreb: Is it possible to monkey-patch the Exception constructor
[15:25:37] RougeT430: has joined #ruby
[15:26:09] KrzaQ: but how would I know it was uncaught?
[15:28:19] Es0teric: has joined #ruby
[15:32:26] synthroid: has joined #ruby
[15:33:45] amar_: has joined #ruby
[15:34:19] Es0teric: has joined #ruby
[15:36:05] nicht_: has joined #ruby
[15:38:48] RougeT430: has joined #ruby
[15:39:22] apeiros: elomatreb: you can override Kernel#raise, yes, but that'll not work for C level exceptions
[15:39:39] apeiros: (or java level exceptions or whichever other native language your runtime uses :D)
[15:43:37] apeiros: what problem are we trying to solve?
[15:44:21] KrzaQ: I'm creating a gem to send errors to backtrace.io (kinda like sentry)
[15:44:40] apeiros: errbit/airbrake kinda things?
[15:44:47] KrzaQ: ideally, I want it to be plug-and-play in your script without changing the app
[15:46:09] apeiros: re how to know it was uncaught: if $! is set, it is uncaught
[15:46:19] apeiros: at least I assume that's what you use in your at_exit
[15:47:23] apeiros: however, you won't be able to cover all cases w/o changing the host application. unless you only want to report back crashing errors.
[15:47:52] KrzaQ: well, if an exception was caught I cannot really know if it's an error or part of their workflow anyway
[15:48:05] KrzaQ: so in this case, modifying the application seems like the only choice to me
[15:48:18] KrzaQ: crashing errors are kind of a no-brainer :)
[15:48:19] apeiros: it should never be part of their workflow. but it's not necessarily a report-worthy error :)
[15:48:34] apeiros: but yes, that's what I'm referring to.
[15:48:36] KrzaQ: sure, it shouldn't
[15:49:02] apeiros: ACTION uses `MyThingy.reporting_exceptions do … end`
[15:49:05] KrzaQ: Also, you're right, even if it's an error, if they caught it, it might mean they don't want to hear about it
[15:49:22] amar_: has joined #ruby
[15:49:33] apeiros: we catch throws, which rarely ever are exceptions (even though 1.9+ allow throwing exceptions)
[15:50:35] whathappens: has joined #ruby
[15:51:55] suukim: has joined #ruby
[15:52:27] jcarl43: has joined #ruby
[15:53:11] DTZUZO: has joined #ruby
[15:57:02] whathappens: has joined #ruby
[15:58:00] wontruefree: has joined #ruby
[15:58:12] wilbert: has joined #ruby
[16:02:01] jottr: has joined #ruby
[16:02:37] karthik_: has joined #ruby
[16:03:40] ldepandis: has joined #ruby
[16:04:30] mozzarella: has joined #ruby
[16:05:27] eckhardt_: has joined #ruby
[16:06:44] karthik_: Does anyone here have experience in cross compiling ruby gems
[16:07:49] p4p0l0: has joined #ruby
[16:10:18] eam: do gems even support cross compilation?
[16:10:41] jrafanie: has joined #ruby
[16:13:43] RougeR: has joined #ruby
[16:15:12] whathappens: has joined #ruby
[16:15:13] dr3wo: has joined #ruby
[16:15:45] jrafanie: has joined #ruby
[16:16:00] konsolebox: someone here tried cross-compiling with rake/Rakefile. not sure if it's possible
[16:17:11] matthewd: https://github.com/rake-compiler/rake-compiler#cross-compilation---the-future-is-now
[16:17:34] matthewd: (but it's been a long time since I cared, so no idea how easy, or how current, that is)
[16:18:15] blackmesa: has joined #ruby
[16:20:22] cagomez: has joined #ruby
[16:20:47] Liothen: has joined #ruby
[16:21:14] Liothen: has joined #ruby
[16:22:48] wontruefree: has joined #ruby
[16:22:55] AJA4351: has joined #ruby
[16:23:19] c0ncealed2: has joined #ruby
[16:25:19] \void: has joined #ruby
[16:26:13] daed: has joined #ruby
[16:28:49] kspencer-: has joined #ruby
[16:28:58] rgiscard: has joined #ruby
[16:30:12] claudiuinberlin: has joined #ruby
[16:30:17] RougeR: has joined #ruby
[16:31:26] jottr: has joined #ruby
[16:32:13] karthik_: @konsolebox and @matthewd Thank you for the support. I will go through the link.
[16:34:28] OneNeptune: has joined #ruby
[16:34:37] fluxAeon: has joined #ruby
[16:37:14] karthik_: @matthewd I have indeed looked into this link before and i coudn't get any help from it. This is specific for Windows platform. This tells us to do "rake-compiler cross-ruby" which will automaticaly download the ruby compiler for Windows.
[16:37:36] konsolebox: karthik_: and aren't you able to?
[16:37:53] karthik_: But my target is not Windows
[16:38:25] karthik_: I am doing it for ARM linux machine and cross compiling on a x86 linux machine
[16:38:57] konsolebox: well that should be a bit easier. windows have these toolkit dependencies you have to install.
[16:39:51] konsolebox: karthik_: do you mean cross-ruby doesn't work in non-windows platforms?
[16:41:28] konsolebox: karthik_: well it seems like it says "Rake-compiler also provides a standardized way to generate, from either Linux or OSX, extensions and gem binaries for your Windows users!"
[16:42:10] karthik_: konsolebox : Let me give you a newbie alert first. I need to cross compile some ruby gems (eventmachine) for ARM Linux machine. My host is x86_64 linux machine. There is not Windows in the entire picture.
[16:42:40] karthik_: There is no Windows in the entire picture*
[16:45:12] GodFather_: has joined #ruby
[16:45:40] karthik_: I didn't mean to say the cross compiling is not working in non-windows platforms. I maybe doing something wrong. Can anyone provide me some reference links or docs or some kind of support for cross compiling on Linux platform ?
[16:46:04] konsolebox: karthik_: i know. i read your message. but i was wondering if cross-ruby supports cross-compiling against other platforms besides windows.
[16:46:57] karthik_: konsolebox : What exactly is cross ruby ? An app or a compiler or something else ?
[16:48:13] dr3wo: has joined #ruby
[16:48:23] konsolebox: karthik_: i think i might misread it to be a gem a bit, but i just followed your message that, ""rake-compiler cross-ruby" automatically downloads the ruby compiler for Windows"
[16:48:39] karthik_: I have a rakefile in eventmachine source folder. Maybe if the rakefile is able to read the environment variables which included the exported cross compiler definitions.
[16:49:04] karthik_: konsolebox : Yes, i was reffering to the link which was provided. https://github.com/rake-compiler/rake-compiler#cross-compilation---the-future-is-now
[16:50:06] wontruefree: has joined #ruby
[16:50:36] wontruefree: has joined #ruby
[16:50:59] konsolebox: anyway, i'll try to see if the tutorial works for cross-compiling my gem
[16:51:40] karthik_: and if i am able to make the Rakefile read the cross compiled ruby and openssl (which i have already cross compiled in Yocto build) instead of my host machine's ruby and openssl. I don't know what variables has to be changed in Rakefile to make it read the Include paths and librarires of the cross compiled ruby and openssl.
[16:52:20] karthik_: konsolebox : sure, thanks.
[16:52:56] bonhoeffer: has joined #ruby
[16:54:10] havenwood: Anyone mind testing installing TruffleRuby on RVM master?: rvm get master && rvm install truffleruby
[16:55:02] havenwood: I'm wondering if the deps install cleanly, or if an error I'm seeing is reproducible.
[16:59:16] stephenmac7: has joined #ruby
[16:59:37] stephenmac7: Hey, is there a method that destructively concatenates an array to the left of another array?
[17:00:02] stephenmac7: So a method like Array#concat but where the argument goes on the left, not the right
[17:00:18] SeepingN: has joined #ruby
[17:01:50] konsolebox: karthik_: it seems like rake-compiler only supports cross-compiling against Windows. running it without an argument just shows me this: https://bpaste.net/show/e1e88f669ed0. i also check some parts of the page. it seems like it only mentions cross-compiling with mingw, which is basically just about Windows.
[17:03:46] karthik_: Yes, this is exactly what i am seeing when i am running the command "rake-compiler"
[17:04:28] karthik_: Are you telling cross compiling rubygems in Linux is not possible ?
[17:05:03] marius: has joined #ruby
[17:05:33] konsolebox: karthik_: don't know, but rake-compiler is likely not the way
[17:07:02] stephenmac7: Or, rather, an equivalent to arr.prepend(*other_arr)
[17:10:57] JamJam_kid: has joined #ruby
[17:11:17] bmurt: has joined #ruby
[17:12:05] miah: has joined #ruby
[17:13:02] bmurt: has joined #ruby
[17:14:24] blackmesa: has joined #ruby
[17:14:31] wontruefree: has joined #ruby
[17:14:47] havenwood: baweaver's latest challenge: https://medium.com/square-corner-blog/challenge-table-of-contents-generator-c99171fde831
[17:15:05] cadillac_: has joined #ruby
[17:22:07] roamingdog: has joined #ruby
[17:23:56] orbyt_: has joined #ruby
[17:24:20] rubyist: has joined #ruby
[17:24:28] rubyist: Hey Everyone!
[17:24:42] rubyist: I need some help installing Ruby 1.8.0 from Source
[17:25:13] konsolebox: why would you need that
[17:26:21] mzo: has joined #ruby
[17:26:24] konsolebox: Rubyist: don't mind me. do continue
[17:26:31] havenwood: I need help with someone testing RVM installation of TruffleRuby!
[17:26:45] havenwood: Rubyist: I think it's fair to say, 1) Don't do it! :-P
[17:26:51] havenwood: Rubyist: Why do you need 1.8?
[17:27:01] havenwood: Rubyist: It's by far easiest to install it on old systems.
[17:27:08] rubyist: Some weird thing with work.
[17:27:28] havenwood: Rubyist: What version of what OS are you trying to install it on?
[17:27:29] rubyist: I run autoconf, configure, but when I get to make I get this error
[17:27:35] rubyist: Ubuntu 18.04
[17:27:47] havenwood: Rubyist: You're going to get crazy errors on modern Ubuntu with unsupported Rubies.
[17:28:04] rubyist: Okie I'll be back in an hour, I'll check with work for a different version
[17:28:10] havenwood: Rubyist: Your best bet is probably seeing if RVM has back-patches to make it work.
[17:28:17] klaas: has joined #ruby
[17:28:31] havenwood: Rubyist: Or use a different OS, something that has Ruby 1.8 in long term support.
[17:28:57] RougeR: has joined #ruby
[17:28:59] havenwood: Rubyist: Another option, maybe the best for you, is a Brightbox package: https://www.brightbox.com/docs/ruby/ubuntu/
[17:29:07] RougeR: has joined #ruby
[17:29:19] havenwood: Rubyist: Yeah, use the 1.8.7 Ruby package for Ubuntu that Brightbox maintains.
[17:29:23] havenwood: That's my advice!
[17:30:05] chris349: has joined #ruby
[17:30:37] grilix_: has joined #ruby
[17:32:11] baweaver: and if possible, use 2.5.1 instead.
[17:35:47] amar_: has joined #ruby
[17:38:04] havenwood: ^ even better
[17:38:10] havenwood: much, much better
[17:38:17] sameerynho: has joined #ruby
[17:40:48] Guest82829: has joined #ruby
[17:42:34] whathappens: havenwood: i get "No binary rubies available for: osx/10.13/x86_64/truffleruby-1.0.0-rc2". when i rvm install truffle-ruby
[17:45:38] wontruefree: has joined #ruby
[17:45:44] cthu|: I discovered the best thing ever in Ruby
[17:45:46] cthu|: yesterday
[17:45:57] cthu|: thing that makes Ruby _AMAZING_
[17:46:05] cthu|: I should check if JS has it
[17:46:37] JoL1hAHN: has joined #ruby
[17:46:44] cthu|: but hell, method(var3: 1, var1: 2, var5: 9) is just THE BEST
[17:47:03] havenwood: cthu|: Yes, keyword arguments are great. Use more of those!
[17:47:11] cthu|: it makes it soooo much easier to write custom tests.
[17:47:29] cthu|: I will rewrite all my method calls to have them and will always use them. the benefit is mindblowing
[17:47:42] Guest82829: has joined #ruby
[17:47:43] cthu|: I used to have to rewrite all calls when I change the signature
[17:47:46] cthu|: not anymore
[17:48:01] havenwood: cthu|: In Ruby 2.5 you can use keywords with Structs too.
[17:48:04] havenwood: cthu|: Point = Struct.new :x, :y, keyword_init: true; Point.new x: 42, y: 0
[17:48:09] havenwood: cthu|: => #<struct Point x=42, y=0>
[17:49:25] cthu|: I don't quite know what struct is. Is it a hash constructor?
[17:49:55] havenwood: cthu|: Think of a Hash that knows ahead of time what its keys are.
[17:50:17] cthu|: so like an ad-hoc class
[17:50:56] havenwood: cthu|: You can even do: Struct.new :x, :y do; def ...
[17:51:15] havenwood: cthu|: Here's an example of using a keyword_init struct where you could alternatively use a Hash: https://github.com/havenwood/digest-sip_hash/blob/master/bin/siphash#L9-L10
[17:51:15] cthu|: so it's a real class
[17:51:16] claudiuinberlin: has joined #ruby
[17:51:50] havenwood: cthu|: You can use Hash-like getter/setter, or Struct exposes nice methods.
[17:54:47] JoL1hAHN: has joined #ruby
[17:57:43] Guest82829: has joined #ruby
[17:59:39] biberu: has joined #ruby
[18:00:25] dbrandon: has left #ruby: ()
[18:01:01] codymj: has joined #ruby
[18:01:02] yokel: has joined #ruby
[18:01:19] twobitsprite: has joined #ruby
[18:01:45] dbrandon: has joined #ruby
[18:02:07] baweaver: cthu| https://twitter.com/search?q=rubytips&src=typd
[18:02:14] baweaver: There are a ton of Ruby tips over there
[18:03:20] baweaver: Well, chronologically is better - https://twitter.com/search?f=tweets&vertical=default&q=rubytips&src=typd
[18:03:21] havenwood: Such a great idea to have a tool that checks which tests for gems from your Gemfile.lock pass on your Ruby: http://www.graalvm.org/docs/reference-manual/compatibility/
[18:04:06] havenwood: Careful responding to baweaver's challenges... I tried a little one and ended up writing a SAX parser. :-O
[18:04:46] havenwood: That's a cool kinda challenge. :-D
[18:05:50] gizmore: still working on my new framework... got rid of a factory class-method in favor of .new to make it easier for Eclipse to code-complete
[18:06:02] gizmore: all tests passing again :)
[18:06:24] twobitsp1ite: has joined #ruby
[18:07:44] Guest82829: has joined #ruby
[18:09:25] havenwood: gizmore: link to the code?
[18:10:01] gizmore: https://github.com/gizmore/gdo (Core, to be splitted more maybe) https://github.com/gizmore/GDO-Login (first module)
[18:10:15] gizmore: fun fact: the first i wrote was an own autoloader :)
[18:10:16] jjunior__: has joined #ruby
[18:11:07] havenwood: gizmore: No need to require RubyGems (Ruby 1.8 is dead!): https://github.com/gizmore/gdo/blob/master/bin/gdo#L3
[18:11:25] gizmore: erasing this line should be safe?
[18:11:39] havenwood: gizmore: yes
[18:12:16] havenwood: gizmore: You have `module_name` and `method_name` variables to use here: https://github.com/gizmore/gdo/blob/master/bin/gdo#L27
[18:12:51] havenwood: gizmore: Add `.byebug_history` to your .gitignore and `git rm` it: https://github.com/gizmore/gdo/blob/master/.byebug_history
[18:13:16] havenwood: You have two licenses.
[18:13:41] havenwood: heh, case: https://github.com/gizmore/gdo/tree/master/lib
[18:13:54] gizmore: hmmm gdo_module() is a method for Object iirc... should change this
[18:14:42] gizmore: my plan is to have a framework where you write one method to serve all: http,cli,exe,websocket,various_chat_clients
[18:14:46] havenwood: the one stdlib file I know of that is uppercase is English.rb
[18:14:54] havenwood: which causes hilarity when folk go from a case insensitive OS to a case sensitive one
[18:15:12] havenwood: i don't support capital filenames - follow convention!
[18:15:42] havenwood: gizmore: You can drop this `begin/end` and just `rescue` directly in the method.
[18:15:45] havenwood: gizmore: https://github.com/gizmore/gdo/blob/master/lib/GDO.rb#L14
[18:15:56] anjen: has joined #ruby
[18:16:01] havenwood: gizmore: remove the `begin` and `end` and deindent the content by two spaces
[18:16:07] havenwood: leaving the rescue in place
[18:16:11] havenwood: it'll *just work*
[18:16:28] StarSeed0000: has joined #ruby
[18:16:43] clemens3: has joined #ruby
[18:16:48] Megamos: has joined #ruby
[18:17:06] millerti: has joined #ruby
[18:17:30] Guest82829: has joined #ruby
[18:17:50] gizmore: havenwood: the advantage of my autoloader is that it is minmal and maps 1:1 constants to file names
[18:18:33] gizmore: i know it is unusual to have filenames like FooBar.rb
[18:18:43] gizmore: but i like my autoloader :)
[18:18:59] havenwood: gizmore: Typically, you don't check Gemfile.lock into git with gems.
[18:19:06] gizmore: thx thx thx
[18:20:08] havenwood: gizmore: Change this to "1.0.0", preferably using GDO::VERSION: https://github.com/gizmore/gdo/blob/master/gdo.gemspec#L7
[18:20:23] havenwood: 1.00 != "1.0.0"
[18:20:39] russt: has joined #ruby
[18:20:47] jinie: has joined #ruby
[18:21:17] orbyt_: has joined #ruby
[18:21:32] wald0: has joined #ruby
[18:22:49] KrzaQ: Kernel.exit causes $! to be not nil, can I differentiate it somehow?
[18:23:04] claudiuinberlin: has joined #ruby
[18:23:20] KrzaQ: I only want to do at_exit stuff if there's an uncaught exception
[18:23:53] gizmore: havenwood: i have own versioning in my GDO, 1.00 => 1.01 => 1.02 etc.... i will return "1.0.0", "1.1.0", "1.2.0" instead?
[18:24:19] apeiros: KrzaQ: well, ignore if it's SystemExit?
[18:24:30] gizmore: havenwood: so a method that converts GDO version to rubystyle version?
[18:24:50] dogweather: has joined #ruby
[18:24:54] havenwood: >> Gem::Version.new(1.00) # gizmore
[18:24:55] ruby[bot]: havenwood: # => #<Gem::Version "1.0"> (https://eval.in/1025968)
[18:24:57] KrzaQ: apeiros: sure. But now I wonder if the exclusion list is going to grow
[18:24:59] apeiros: KrzaQ: in general, you should be extra careful with exceptions which are not subclasses of StandardError
[18:25:12] apeiros: KrzaQ: it is. ^
[18:25:21] gizmore: >> Gem::Version.new(1.04)
[18:25:21] zachk: has joined #ruby
[18:25:21] apeiros: Interrupt is another one you probably don't want
[18:25:22] ruby[bot]: gizmore: # => #<Gem::Version "1.04"> (https://eval.in/1025969)
[18:25:26] havenwood: gizmore: RubyGems requires its conventions be followed. You can internally do what you'd like, though it's confusing. You kinda have it backwards right now.
[18:25:46] havenwood: gizmore: You are following convention internally, but not giving RubyGems a version it understands.
[18:25:51] gizmore: the reason for my versioning is update scripts
[18:26:02] zachk: has joined #ruby
[18:26:07] havenwood: you can do update scripts with the conventional way
[18:26:18] KrzaQ: apeiros: if $! and $!.class <= StandardError
[18:26:19] havenwood: >> "1.0.4".succ
[18:26:20] ruby[bot]: havenwood: # => "1.0.5" (https://eval.in/1025970)
[18:26:23] KrzaQ: does that make sense to you?
[18:27:17] gizmore: >> "1.04".succ
[18:27:18] ruby[bot]: gizmore: # => "1.05" (https://eval.in/1025971)
[18:27:31] gizmore: >> "1.04.0".succ
[18:27:32] ruby[bot]: gizmore: # => "1.04.1" (https://eval.in/1025972)
[18:27:37] Guest82829: has joined #ruby
[18:27:37] apeiros: KrzaQ: sure. I just don't know whether it's what you want :) it might ignore too many exceptions.
[18:27:41] gizmore: >> "1.04.0.0".succ # sry
[18:27:42] ruby[bot]: gizmore: # => "1.04.0.1" (https://eval.in/1025973)
[18:28:01] KrzaQ: Very well, I'll leave it as it is and classify futher later
[18:28:34] apeiros: >> ObjectSpace.each_object(Exception.singleton_class).reject { |c| c <= StandardError } # KrzaQ those are from ruby itself
[18:28:35] ruby[bot]: apeiros: # => [SystemStackError, NoMemoryError, SecurityError, NotImplementedError, LoadError, SyntaxError, Script ...check link for more (https://eval.in/1025974)
[18:28:55] apeiros: KrzaQ: also there's a couple of programmers who fail to understand ruby's exception model and inherit from Exception directly.
[18:29:28] KrzaQ: Maybe I'll make an exclusion list for now
[18:33:42] kenichi: has joined #ruby
[18:37:27] Guest82829: has joined #ruby
[18:40:20] konsolebox: havenwood: i got touch: cannot touch ‘/home/user/.rvm/rubies/truffleruby-1.0.0-rc2/lib/ruby/site_ruby/2.4.0/auto_gem.rb’: No such file or directory
[18:41:49] throstur: has joined #ruby
[18:42:07] konsolebox: i had to modify some parts of it to not update the system since i don't use sudo to escalate privilege
[18:42:42] mjolnird: has joined #ruby
[18:42:48] gizmore: havenwood: merged your suggestions and wrote a test for autoloader to fail :)
[18:42:58] gizmore: thank you very much :)
[18:43:17] throstur: I'm trying to call my_lambda.(x) and expecting to receive ['my', 'series'] but when I puts it, it prints each item on it's own line, how do I print it as an array?
[18:43:44] apeiros: throstur: use p, not puts
[18:44:05] throstur: oh yeah, of course... why was I even using puts
[18:47:27] Guest82829: has joined #ruby
[18:54:37] eckhardt_: has joined #ruby
[18:57:45] Guest82829: has joined #ruby
[19:05:36] ElFerna: has joined #ruby
[19:06:20] dionysus69: has joined #ruby
[19:07:29] Guest82829: has joined #ruby
[19:11:06] dogweather: has joined #ruby
[19:14:13] roamingdog: has joined #ruby
[19:14:53] dogweather: has joined #ruby
[19:15:03] roamingdog: has joined #ruby
[19:15:48] roamingdog: has joined #ruby
[19:16:44] karapetyan: has joined #ruby
[19:17:42] Guest82829: has joined #ruby
[19:19:47] tvw: has joined #ruby
[19:27:24] Guest82829: has joined #ruby
[19:29:21] rubyist: has joined #ruby
[19:29:37] rubyist: Hey what version of Ubuntu should I use to compile Ruby 1.8?
[19:29:51] havenwood: rubyist: Did you see my comments earlier?
[19:30:02] havenwood: rubyist: (Regarding Brightbox.)
[19:30:26] bmurt: has joined #ruby
[19:30:28] havenwood: rubyist: https://irclog.whitequark.org/ruby/2018-06-21#22410490;
[19:30:28] rubyist: No I had to leave. Work is killing me. What was your comment?
[19:31:23] havenwood: rubyist: https://www.brightbox.com/docs/ruby/ubuntu/#ruby-187
[19:31:38] havenwood: rubyist: "Ubuntu Artful, Xenial and Trusty"
[19:32:29] havenwood: rubyist: artfil aardvark is your best bet
[19:33:00] rubyist: Thanks. Should building it from source work on that?
[19:33:33] havenwood: rubyist: It wouldn't have backported security fixes.
[19:34:25] havenwood: rubyist: I'd highly recommend the Brightbox package on Ubuntu 17.10.
[19:34:46] dogweather: has joined #ruby
[19:34:51] havenwood: Or free yourself from Ruby 1.8! Ruby 2.5 ftw!
[19:35:16] rubyist: Trust me, If it were up to me, I wouldn't even be using 1.8. But my boss is hell bent about compiling it from source
[19:35:59] havenwood: rubyist: Tell your boss that you then need to backport security fixes, because there are known issues that are unpatched in the source.
[19:36:44] havenwood: rubyist: You can build it from source with a tool like RVM, which might include those patches. Or better yet, use a package manager that diligently does it for you.
[19:36:46] rubyist: Will do. I really hate working for someone who has such a poor understanding of my work
[19:37:07] havenwood: rubyist: Ruby 1.8 is too old to build unpatched on a modern OS. Even if you wanted to cavalierly ignore the known security issues.
[19:37:32] Guest82829: has joined #ruby
[19:38:05] gizmore: rubyist: maybe tell your boss that 1.8 is at end of support for quite a while. i did not receive security updates
[19:38:22] rubyist: Thanks for the help. Just in case we do switch to 2.x, I know he'll want to compile it from source. Is that possible without having Ruby installed?
[19:38:23] havenwood: rubyist: You could use a LTS release that still backports to 1.8. I'd push back on building 1.8 myself.
[19:38:41] havenwood: rubyist: Yes, you can compile Ruby from source without Ruby installed.
[19:39:44] havenwood: rubyist: You just need to install the deps, and you're good to go.
[19:39:46] havenwood: rubyist: https://github.com/postmodern/chruby/wiki/Ruby
[19:40:24] havenwood: rubyist: Consider installing to /usr/local.
[19:40:31] baweaver: It's quite frankly none of a manager's concern how you perform your job, only that the work gets done
[19:40:44] baweaver: Sounds like you have a micro manager who needs to step back and stay in his lane
[19:41:08] havenwood: rubyist: You can have RVM install from source, btw. Unless they also care *how* you install from source.
[19:41:42] havenwood: 1.8 is too old.
[19:41:43] baweaver: Likely you'll need to have a discussion at some point over whether or not they trusts you to do your job, and if he does you should call them on that
[19:42:21] havenwood: It's getting to be waaaaay more of a hassle to be on 1.8 than it's worth.
[19:42:22] havenwood: I don't actually know anyone on 1.8.
[19:42:36] havenwood: Maybe CentOS folk. ;-P
[19:42:43] havenwood: It's even old for that!
[19:44:16] jyaworski: has joined #ruby
[19:45:50] cagomez: has joined #ruby
[19:46:16] cthu|: how do you call method calls with explicitly set arg names?
[19:46:41] cthu|: metod1(arg1:123,arg3="qwe")
[19:46:46] dogweather: has joined #ruby
[19:46:59] havenwood: cthu|: What about ^ that?
[19:47:07] cthu|: how do you call them?
[19:47:07] havenwood: cthu|: Do you mean mandatory arguments?
[19:47:13] desperek: has joined #ruby
[19:47:16] cthu|: that was a call
[19:47:21] cthu|: sorry, I meant :, not =
[19:47:33] Guest82829: has joined #ruby
[19:47:53] havenwood: cthu|: I don't understand the question.
[19:48:09] cthu|: how do you call method calls with explicitly set argument names using :
[19:48:57] havenwood: cthu|: Like you're showing. What's not working?
[19:48:58] elomatreb: `methodname(keywordname: value)` (not like in python. Using = there silently creates a new local variable)
[19:49:10] cthu|: oh, no, I mean how do you call them
[19:49:15] cthu|: when you talk about them :)
[19:49:22] elomatreb: Keyword arguments
[19:49:23] cthu|: not when you invoke them
[19:49:23] havenwood: cthu|: keyword arguements
[19:49:27] cthu|: oh, thanks
[19:52:03] eckhardt_: has joined #ruby
[19:53:31] p4p0l0: has joined #ruby
[19:56:00] pastorinni: has joined #ruby
[19:57:25] Guest82829: has joined #ruby
[19:59:22] szulak: has joined #ruby
[20:00:50] nowhereman_: has joined #ruby
[20:00:55] p4p0l0: has joined #ruby
[20:01:18] weird_error: has joined #ruby
[20:01:36] Blaguvest: has joined #ruby
[20:02:26] troulouliou_div2: has joined #ruby
[20:06:20] dogweather: has joined #ruby
[20:06:22] rann: has joined #ruby
[20:07:25] nicht_: has joined #ruby
[20:07:26] Guest82829: has joined #ruby
[20:08:10] ski7777: has joined #ruby
[20:11:40] __goodnight__: has joined #ruby
[20:14:33] workmad3: has joined #ruby
[20:15:23] dogweather: has joined #ruby
[20:17:34] Guest82829: has joined #ruby
[20:18:11] hph^: has joined #ruby
[20:18:20] karapetyan: has joined #ruby
[20:22:48] bmurt: has joined #ruby
[20:27:31] Guest82829: has joined #ruby
[20:27:53] Eiam: has joined #ruby
[20:28:24] safetypin: has joined #ruby
[20:35:29] ciscam: has joined #ruby
[20:37:37] Guest82829: has joined #ruby
[20:39:04] gizmore: const_name = "::GDO::#{self.module_name}::Method::#{method_name}"
[20:39:04] gizmore: const = Object.const_get(const_name)
[20:39:04] gizmore: method_name is user controlled. is it a security issue?
[20:40:05] StarSeed0000: has joined #ruby
[20:40:25] jenrzzz: has joined #ruby
[20:40:42] tag: has joined #ruby
[20:46:30] zenspider: gizmore: that's not gonna work the way it's written
[20:47:32] Guest82829: has joined #ruby
[20:54:53] t0xik: has joined #ruby
[20:55:32] cagomez: when using Dalli for Rails.cache, does `exist(key)` still make a network request?
[20:57:40] Guest82829: has joined #ruby
[20:58:12] mjolnird: has joined #ruby
[21:02:28] Mike11: has joined #ruby
[21:05:36] rtsq: has joined #ruby
[21:07:37] Guest82829: has joined #ruby
[21:11:16] fmcgeough: has joined #ruby
[21:11:58] rtsq: Hi all, I have a problem that I cant seem to solve right now. I want to add a prefix to all keys in a hash. They should all start with "throwable_". But right now it cant get it to work. In the pastebin example I have tried to make the key to a string just to make the concatenation. https://pastebin.com/q6Amd16B
[21:11:58] ruby[bot]: rtsq: we in #ruby do not like pastebin.com, it loads slowly for most, has ads which are distracting and has terrible formatting. Please use https://gist.github.com
[21:12:28] lupine: should probably update that recommendation given MS
[21:12:40] zenspider: rtsq: curious... why?
[21:12:41] apeiros: zenspider: hm? newer ruby's const_get can do fully qualified constants
[21:12:53] zenspider: seriously??? I'm getting old
[21:13:16] apeiros: >> module A; module B; class C; end; end; end; Object.const_get("A::B::C")
[21:13:17] ruby[bot]: apeiros: # => A::B::C (https://eval.in/1026063)
[21:13:18] zenspider: rtsq: that's pretty unreadable
[21:13:35] apeiros: I think 2.2 or 2.3 introduced it
[21:13:44] zenspider: n/m... that's terribly unreadable.
[21:13:52] rtsq: zenspider: I have a couple of keys that are the same name, and the way that they are used it would be prefered to have a prefix on them.
[21:13:52] cthu|: oh so 2.2 is considered to be not-too-old?
[21:13:55] zenspider: you're doing bad things with quoting
[21:14:26] apeiros: cthu|: iirc 2.2 is not EOL, but the next to be EOLd
[21:14:29] zenspider: but the code also doesn't demonstrate your problem, as far as I can tell
[21:15:16] roamingdog: has joined #ruby
[21:15:27] elomatreb: Short answer: On newer versions of Ruby there is Hash#transform_keys
[21:15:29] zenspider: rtsq: I would suggest NOT doing any magic to add the keys automatically... just make your code work properly WITH the prefix added in there where needed
[21:15:36] merpnderp: has joined #ruby
[21:15:47] cthu|: how does the arrow work?
[21:15:49] elomatreb: But it looks like you're doing eval-y stuff, which is probably a bad idea
[21:16:19] apeiros: cthu|: by piercing its target
[21:16:33] cthu|: hahahah)))
[21:16:35] apeiros: cthu|: also I hear that the fin has something to do with the airflow, stabilizing its flight.
[21:16:43] jgpawletko: has joined #ruby
[21:16:49] elomatreb: Objects in motion stay in motion
[21:16:54] zenspider: >> h = {}; def h.[](k) super "prefix_#{k}"; end; def h.[](k,v) super "prefix_#{k}", v; end; h["blah"] = 42; [h["blah"], h]
[21:16:57] ruby[bot]: zenspider: # => wrong number of arguments (given 1, expected 2) (ArgumentError) ...check link for more (https://eval.in/1026064)
[21:17:10] zenspider: >> h = {}; def h.[](k) super "prefix_#{k}"; end; def h.[]=(k,v) super "prefix_#{k}", v; end; h["blah"] = 42; [h["blah"], h]
[21:17:11] ruby[bot]: zenspider: # => [42, {"prefix_blah"=>42}] (https://eval.in/1026065)
[21:17:23] zenspider: ALWAYS a one character bug
[21:17:29] Guest82829: has joined #ruby
[21:17:40] apeiros: is that a type of "one off error"?
[21:17:41] zenspider: but again... this is a bad idea IMHO
[21:17:45] zenspider: pretty much
[21:18:01] apeiros: I get that a lot lately. thanks to stucky keyboard
[21:19:06] zenspider: I can't blame my keyboard... just my brain or my fingers
[21:20:11] bastilian: has joined #ruby
[21:25:17] ElFerna: has joined #ruby
[21:27:28] Guest82829: has joined #ruby
[21:28:19] r29v: has joined #ruby
[21:29:28] merpnderp: I don't know anything about ruby but am interested in learning. What language is ruby most like?
[21:30:09] zenspider: tautological
[21:30:25] zenspider: merpnderp: what languages do you know?
[21:30:28] baweaver: Joking aside, you'll find similarities between it, Javascript, Perl, and Lisp.
[21:30:33] apeiros: merpnderp: I'd say from the more popular languages, python
[21:30:42] rtsq: zenspider: Yes, that would be nice, but I cant control the key values that I get, so I want to enrich them when I assign them.
[21:30:48] apeiros: also it inherited a lot from perl
[21:30:48] zenspider: baweaver: ehem... SMALLTALK PLEASE
[21:30:54] ur5us: has joined #ruby
[21:30:58] havenwood: merpnderp: Do you mean only languages that existed before Ruby?
[21:31:00] baweaver: zenspider: how's the weather there?
[21:31:04] havenwood: merpnderp: Crystal-lang ;-P
[21:31:12] zenspider: gray and coolish today. finally
[21:31:12] merpnderp: zenspider: python, js, C, C#, Java, Perl
[21:31:19] baweaver: zenspider: there you go
[21:31:22] baweaver: smalltalk :D
[21:31:22] havenwood: merpnderp: mruby is quite similar
[21:31:27] rtsq: The best way should be just to concatenate the key when its created, but everything I tried fails.
[21:31:35] havenwood: merpnderp: Of those, Perl and Python are the most similar.
[21:31:36] zenspider: rtsq: see above
[21:31:42] merpnderp: havenwood: cool, thanks.
[21:31:50] merpnderp: apeiros: thanks.
[21:34:25] elomatreb: Ruby outright copied a few Perl-isms, but they're usually considered bad style by now
[21:35:12] tvw: has joined #ruby
[21:35:20] havenwood: Perl 6 copied more than a few Rubyisms. The cycle continues.
[21:35:34] apeiros: copying the good parts is a great thing :)
[21:37:41] Guest82829: has joined #ruby
[21:41:11] joast: has joined #ruby
[21:43:53] ur5us: has joined #ruby
[21:45:27] rtsq: zenspider: I think that I am too tired to understand. What I try to do is to get this: event.get('thorowable').each { |key,value| event[key] = value; } to be something like this event.get('thorowable').each { |key,value| "throwable_#{event[key]}" = value; }
[21:45:51] rtsq: Exept that I cant spell throwable.... :)
[21:46:31] zenspider: I can't make sense of your code. sorry. Mine creates a hash that'll always prefix on [] and []=.
[21:46:52] zenspider: if you want to do something after the fact, then elomatreb's suggestion to use Hash#transform_keys is the right way to go
[21:47:22] elomatreb: Keep in mind that it only exists on recent versions of Ruby (2.4 I think?)
[21:47:26] zenspider: but you said something to the effect of "I have several keys that are the same" and that doesn't make sense
[21:47:43] Guest82829: has joined #ruby
[21:48:04] rtsq: transform_keys have I looked at, but cant find out how to make it do the prefix for me....
[21:48:29] zenspider: rtsq: "make it do" ?
[21:48:33] apeiros: rtsq: if you're too tired to understand, you should probably get some sleep and try again tomorrow.
[21:48:48] zenspider: >> s = "some string"; "prefix_#{s}"
[21:48:49] ruby[bot]: zenspider: # => "prefix_some string" (https://eval.in/1026067)
[21:49:30] zenspider: rtsq: this esp doesn't make sense: |key,value| "throwable_#{event[key]}" = value
[21:49:39] zenspider: |key,value| "throwable_#{event[key]}" = value
[21:49:42] zenspider: |key,value| "throwable_#{key}" = value
[21:49:47] rtsq: apeiros: true, that would be the best.. :)
[21:49:48] zenspider: |key,value| event["throwable_#{key}"] = value
[21:50:12] zenspider: event[key] IS value
[21:50:13] SeepingN: otehrwise you ahve value=value
[21:50:18] zenspider: you want key
[21:50:33] zenspider: then you're not assigning anywhere
[21:50:50] cthu|: will a string cast into regex I wonder?
[21:51:13] cthu|: it's quite awkward to have to do all the obvious casting manually
[21:51:20] rtsq: zenspider: I want to change the key, AND assign value, but maybe I need to do it in two steps as mentioned above.
[21:51:26] havenwood: cthu|: Weak typing is bad. Stop yearning for it.
[21:51:43] zenspider: rtsq: you're doing this: "string" = "value" and that doesn't compute
[21:51:50] apeiros: cthu|: ruby does plenty of conversions for you already. what's your current code?
[21:51:55] cthu|: It's not about weak typing it's about implicit conversion
[21:51:59] icarus: has joined #ruby
[21:52:02] baweaver: >> 'string' = 'value'
[21:52:03] ruby[bot]: baweaver: # => /tmp/execpad-fd3b476d8482/source-fd3b476d8482:2: syntax error, unexpected '=', expecting keyword_end ...check link for more (https://eval.in/1026068)
[21:52:17] havenwood: >> Regexp.new 'cthu|'
[21:52:18] ruby[bot]: havenwood: # => /cthu|/ (https://eval.in/1026069)
[21:52:20] baweaver: cthu| that's weak typing
[21:52:22] havenwood: cthu|: Err, what do you think "weak typing" means?
[21:52:38] cthu|: I thought it was about types
[21:52:39] cthu|: not methods
[21:52:45] cthu|: cuz casting would be in +
[21:52:59] raynold: has joined #ruby
[21:52:59] rtsq: zenspider: I will check the version of ruby and see if I can get transform_keys to do the trick.
[21:53:01] zenspider: you know not of what you speak of
[21:53:30] zenspider: rtsq: you can still do what you want without it. But your code has to actually assign into the hash. see my step by step transformations above. happy to answer questions
[21:54:38] baweaver: implicit conversions in methods is textbook weak typing cthu|
[21:54:55] cthu|: oh, okay, I didn't know it
[21:55:07] cthu|: why is it bad?
[21:55:49] apeiros: https://news.ycombinator.com/item?id=9484757
[21:55:54] ur5us_: has joined #ruby
[21:56:00] havenwood: apeiros: hahaha
[21:56:07] apeiros: cthu|: ^ that
[21:56:18] _pastel: has joined #ruby
[21:57:19] cthu|: apeiros, but there's typeless == and typefull ===
[21:57:28] cthu|: sure you'll get artifacts in rare cases.
[21:57:28] SeepingN: "I found out that strings that start with zero are coerced to 0 and then interpreted as false. Never used PHP for anything important since."
[21:57:31] Guest82829: has joined #ruby
[21:58:00] cthu|: just like you get artefacts in ruby thanks to it multiple abstractions
[21:58:34] elomatreb: Just compare the frequency of cases where you do want coercion to the cases where it could subtly mess you up, and explicit conversion becomes the obvious choice
[21:59:00] cthu|: idk. I never had issues with it in JS, but keep using it all the time
[21:59:05] cthu|: saved me A LOT of time
[21:59:16] elomatreb: You'll notice that in "modern" php code people use type checks a lot to mitigate it (both through explicit inline checks and typed method signatures)
[21:59:16] grilix_: has joined #ruby
[21:59:18] cthu|: I guess depends on usecase or on people's habits.
[21:59:38] apeiros: you can write bad code in any language, that's true
[21:59:52] cthu|: In JS, I rarely do type checking, but again, I use it on the backend and I rarely work with user input
[21:59:53] apeiros: some make it easier than others. ruby too is more on the "make it easy side".
[21:59:55] havenwood: but it's easier to write bad code in bad languages
[22:00:15] cthu|: well that's what is confusing to me
[22:00:20] cthu|: Ruby makes it super easy
[22:00:22] apeiros: but IMO weak typing is a needless move further towards "make it easy to write broken code"
[22:00:27] cthu|: even the things JS hesitated to do
[22:00:34] cthu|: like the keyword args
[22:00:44] cthu|: and yet, no weak typing
[22:00:45] apeiros: hm? kwargs aren't making it easier to write bad code.
[22:00:56] apeiros: quite the opposite.
[22:00:57] elomatreb: (quite the opposite)
[22:01:01] apeiros: ^5 elomatreb
[22:01:05] cthu|: well JS folks said it was a tradeoff
[22:01:07] elomatreb: ACTION has flashbacks to options = {}
[22:01:26] cthu|: I actually don't know what other languages have this cool feature
[22:01:28] apeiros: ACTION has flashbacks to method(:foo).arity > 5
[22:01:34] cthu|: it's the first time I'm seeing it
[22:01:44] elomatreb: Python has keyword arguments and probably popularized them in scripting languages
[22:01:49] elomatreb: Or rather, named arguments
[22:01:50] apeiros: cthu|: I think it's pervasive in objc
[22:02:00] cthu|: object C has it?!
[22:02:12] cthu|: that's low
[22:02:15] apeiros: you have things like createColor fromRed: 255, green: 0, andBlue: 100
[22:02:19] cthu|: lower than I would expect it to be
[22:02:39] apeiros: (I don't do ObjC, so it's from memory and not 100% correct)
[22:03:01] havenwood: not kwargs but interlargs
[22:04:18] havenwood: is Smalltalk the origin there as well?
[22:04:22] apeiros: cthu|: why is that low?
[22:04:52] cthu|: well objective c is on the same level as C#/Javas, I think
[22:05:06] cthu|: which makes it lower than things like Ruby, PHP, Python and JS
[22:05:58] apeiros: ah, you mean as in lower/higher level languages
[22:06:29] elomatreb: Don't invest too much in the low/high-level language metaphor these days, it has become very blurred
[22:07:11] cthu|: I don't. it's just a cosmetic, basically.
[22:07:50] elomatreb: And even that is broken quickly, e.g. Rust offers very "high-level" abstractions but compiles to 100% native code
[22:08:40] cthu|: it doesn't matter how it compiles
[22:08:40] apeiros: eh, the product is not a property of the language, but of the runtime
[22:08:50] cthu|: the coding experience matters
[22:08:54] apeiros: low/high level IMO is more related to what a language grants you access to
[22:09:23] elomatreb: But you can get the same access in e.g. Ruby as well, e.g. Fiddle
[22:09:58] elomatreb: IMO the metaphor is a leftover from the days where the options were line-based BASIC interpreters or C
[22:10:06] cthu|: also it's about levels of abstractions the language builds for you
[22:10:41] cthu|: more abstractions = higher level. less abstractions = lower level
[22:11:13] cthu|: binary grants no abstractions. HEX would be a simple abstraction above binary. Then asm comes.
[22:12:00] zapata: has joined #ruby
[22:12:05] FernandoBasso: has joined #ruby
[22:12:17] whathappens: has joined #ruby
[22:12:53] Puffball: has joined #ruby
[22:14:14] roamingdog: has joined #ruby
[22:14:53] Nicmavr: has joined #ruby
[22:14:58] workmad3: has joined #ruby
[22:15:02] Lytol: has joined #ruby
[22:16:02] zenspider: JS has no weak typing?!?!? what the fuck?
[22:16:06] zenspider: THEY FIXED IT!
[22:17:10] zenspider: hex is NOT an abstraction over binary. it's just a different representation of the exact same numbers.
[22:17:26] havenwood: 1 + '1' #=> '11' #boo hiss
[22:17:39] amar: has joined #ruby
[22:17:44] zenspider: asm is 1:1 to the binary... so it isn't an abstraction either. it's just a more readable representation.
[22:17:53] Es0teric: has joined #ruby
[22:18:02] apeiros: havenwood: and in php `1 + '1'` => 2
[22:18:17] zenspider: I do wish you'd stop spouting nonsense and listen more than you talk.
[22:18:38] havenwood: apeiros: i think it should indeterminately be either '11' or 2, roll the dice each time
[22:18:48] apeiros: havenwood: haha
[22:19:41] amar: has joined #ruby
[22:19:59] apeiros: I actually don't remember how to concat two numeric strings in php
[22:21:01] apeiros: ooooh, right, .
[22:21:17] apeiros: omigosh. `1 . 1` looks so weird now.
[22:22:05] elomatreb: String concat is the one example where phps weak typing doesn't mess up :)
[22:25:28] JamJam_kid: has joined #ruby
[22:26:18] havenwood: >> class Integer; alias add +; def + other; if other.instance_of?(String); ["#{self}#{other}", add(other.to_i)].sample; else; add(other) end end end; [1 + '1', 1 + '1', 1 + '1']
[22:26:19] ruby[bot]: havenwood: # => undefined method `+' for class `Integer' (NameError) ...check link for more (https://eval.in/1026072)
[22:26:32] Puffball: has joined #ruby
[22:26:44] havenwood: >> class Fixnum; alias add +; def + other; if other.instance_of?(String); ["#{self}#{other}", add(other.to_i)].sample; else; add(other) end end end; [1 + '1', 1 + '1', 1 + '1']
[22:26:45] ruby[bot]: havenwood: # => ["11", 2, 2] (https://eval.in/1026073)
[22:26:57] havenwood: cthu|: There you go ^
[22:27:13] havenwood: cthu|: That's extremely weak typing, in Ruby! You're welcome. ;-)
[22:27:45] elomatreb: >> [1, "2"].join
[22:27:46] ruby[bot]: elomatreb: # => "12" (https://eval.in/1026077)
[22:28:02] cthu|: don't use arrows
[22:28:12] cthu|: they penetrate targets and frighten noobs
[22:28:36] cthu|: also that's join
[22:28:39] cthu|: join's unfair
[22:28:59] cthu|: it has to be in... how do you call methods that are symbolic
[22:29:05] cthu|: like + or -
[22:29:08] elomatreb: Certain Ruby methods do give you something similar to weak typing, by just blindly trying to make everything into strings
[22:29:20] cthu|: okay, in operators methods them
[22:29:55] cthu|: yeah, to_s everythng is what I would expect from + if one of the args is a string
[22:30:12] cthu|: I accept Ruby as it is
[22:30:52] cthu|: the keyword arrgs make up for a lot of things I may not like
[22:31:27] elomatreb: "If one of the args is a string" doesn't work though, as `a + b` is equivalent to `a.+(b)`, and since methods are defined on the receiver the inverse could do something different entirely
[22:31:27] GodFather: has joined #ruby
[22:31:41] elomatreb: keyword arrrgs, pirate Ruby
[22:31:45] cyberg: has joined #ruby
[22:32:08] cthu|: I thought there was a good reason
[22:32:11] cthu|: there it is
[22:34:10] zenspider: elomatreb: double dispatch can be a nice way to do numerics tho. Smalltalk uses it to coerce to the same type and then re-dispatch on the same operator
[22:35:00] zenspider: IIRC, a + b is roughly executed as: b.coerce(a) + a
[22:35:03] elomatreb: I'm getting less and less convinced that operator overloading is a good idea anyway, tbh (at least for the core set of arithmetics)
[22:36:21] zenspider: I've been enjoying it in haskell (if it is even considered that? I don't really think it is)... but I tend to agree for languages like ruby / smalltalk / whatever
[22:36:25] ur5us: has joined #ruby
[22:36:28] ElFerna: has joined #ruby
[22:36:41] zenspider: the complexity it brings is not worth it imo
[22:37:03] cthu|: I don't see the point to do that to any except the + tbh
[22:37:11] cthu|: and + only cuz it's so popular
[22:37:23] cthu|: << is better than + anyway
[22:37:31] cthu|: and probably << does the casting
[22:37:37] Guest82829: has joined #ruby
[22:38:57] elomatreb: I'm also torn on it with Haskell, since it leads to extremely terse code (e.g. when I was learning it I was stuck on understanding what the $s in my code do for days)
[22:39:07] zenspider: maybe starting with "I don't see the point" should be a hint to listen more, speak less. Asserting your "knowledge" vs actually being open to learning stuff.
[22:40:06] zenspider: elomatreb: I took a course on ML a little while back and all of a sudden, I could read haskell. :P I've been enjoying studying it so far. It does have too many sigils imo
[22:40:57] zenspider: I have emacs set up with a whole bunch of extra tooling, so as I'm editing, emacs is suggesting changes as I go. This looks like a map! Now it looks like a foldr! Now it looks like blah blah... I have been learning the libraries this way
[22:42:52] FernandoBasso: has joined #ruby
[22:43:06] blackmesa: has joined #ruby
[22:45:35] apeiros: zenspider: `b.coerce(a) + a` you probably meant `b.coerce(a) + b`, no? (and I too think that's how it's done)
[22:47:00] zenspider: if I remember a paper that Dan Ingalls published back in the day, the second dispatch ofter went backwards. I don't remember the reasoning for that tho. It's been years.
[22:47:02] apeiros: hm, actually it's more like b,a = b.coerce(a); b+a
[22:47:37] apeiros: I still got it wrong :D
[22:47:46] Guest82829: has joined #ruby
[22:48:22] apeiros: well, I guess I know now what I'll look at again tomorrow
[22:49:30] zenspider: hah: A Simple Technique for Handling Multiple Polymorphism. In Proceedings of OOPSLA '86... so yeah. I "few" years ago. :P
[22:50:57] JamJam_kid: has joined #ruby
[22:51:38] amar: has joined #ruby
[22:52:53] cthu|: >> p test(\ee\, "street");
[22:52:54] ruby[bot]: cthu|: # => /tmp/execpad-aa9c146a45c3/source-aa9c146a45c3:2: syntax error, unexpected $undefined, expecting ')' ...check link for more (https://eval.in/1026084)
[22:53:34] zenspider: what is that even supposed to be?
[22:54:45] JamJam_kid: has joined #ruby
[22:56:44] elomatreb: "unexpected $undefined"
[22:57:12] karapetyan: has joined #ruby
[22:57:24] ur5us: has joined #ruby
[22:57:25] havenwood: zenspider: I interpret it as an "artistic" attempt at: assert_match /ee/, 'street'
[22:57:33] cthu|: why is this?
[22:57:39] cthu|: >>"asd asd" =~ /^asd\sasd/
[22:57:39] ruby[bot]: cthu|: # => nil (https://eval.in/1026099)
[22:57:50] cthu|: ahouls be 0
[22:57:57] havenwood: cthu|: Kernel#test is a method. It doesn't do what you seem to assume it does, at all. Regexp literals are // not \\.
[22:57:58] baweaver: Because the regex didn't match.
[22:57:58] zenspider: havenwood: I assumed it was more liek the archaic form of File.exist? "street"
[22:58:03] cthu|: and this is ok:
[22:58:05] cthu|: >>"asd asd" =~ /^asd\s/
[22:58:06] ruby[bot]: cthu|: # => 0 (https://eval.in/1026100)
[22:58:06] havenwood: zenspider: hahaha
[22:58:16] cthu|: >>"asd asd" =~ /^asd\s*asd/
[22:58:17] ruby[bot]: cthu|: # => 0 (https://eval.in/1026101)
[22:58:22] cthu|: ok, found, sorry
[22:58:30] cthu|: trying to get used to regex in Ruby
[22:59:15] jyaworski: has joined #ruby
[23:00:19] zenspider: I wonder if I still have any old code that uses Kernel#test instead of File#whatever?
[23:01:15] ur5us: has joined #ruby
[23:01:40] zenspider: RubyInline, ZenTest, graph, hoe-seattlerb ... saaaad
[23:01:49] cthu|: what's wrong with this one?
[23:01:55] cthu|: >>regexs = /asd/; str = "asd"; if (str =~ regexs)!=nil; puts "works"; end
[23:01:56] ruby[bot]: cthu|: # => works ...check link for more (https://eval.in/1026106)
[23:02:34] cthu|: I mean, it also returns nil after "works"
[23:02:37] zenspider: You're expecting us to be psychic
[23:02:55] cthu|: maybe that's eval's debug
[23:03:24] Radar: cthu|: I would advise you listen to the people trying to help you.
[23:03:26] zenspider: >> x=puts "woot"; x
[23:03:27] ruby[bot]: zenspider: # => woot ...check link for more (https://eval.in/1026109)
[23:03:44] zenspider: ah, well... puts returns nil. The bot biases towards IO
[23:04:14] zenspider: no, you're really not.
[23:04:37] zenspider: I'd also ask that you start using your spacebar a lot more instead of return.
[23:04:49] Radar: cthu|: Maybe if someone is telling you something then perhaps that something is indicative of something else?
[23:04:51] zenspider: I am. I do. :)
[23:05:12] cthu|: Radar, no idea what you're talking about, but I totally agree.
[23:05:41] Radar: cthu|: It's been a running theme. You come in here, ask questions... then people try to help you, but you flatout ignore them and continue on with your own ramblings. It's really frustrating. Maybe take the time to reply to those who are replying to you?
[23:05:48] icy`: i mean, it does output "works" so what's the issue
[23:06:10] cthu|: Radar, you do see that I'm replying to you?
[23:06:20] Radar: cthu|: Yes, now you are. But previously you have not.
[23:06:25] cthu|: icy`, I think it was eval's debugging
[23:06:35] cthu|: on eval it returned nil too
[23:06:51] icy`: what did you expect it to *****return*****
[23:06:56] zenspider: >> eval "1+2"
[23:06:58] ruby[bot]: zenspider: # => 3 (https://eval.in/1026110)
[23:06:59] icy`: there's output, and there's return value
[23:07:03] cthu|: Radar, I may have not seen then. I usually answer unless ignored
[23:07:36] cthu|: icy`, yeah, I realize now that that nil was a return value.
[23:07:57] cthu|: effectively meaning it doesn't return anything?
[23:07:59] ur5us_: has joined #ruby
[23:08:11] icy`: cthu|, you still never specified what you want to happen
[23:08:30] zenspider: cthu|: this is exactly what Radar was talking about
[23:08:32] cthu|: icy`, my concern was about the nil
[23:08:47] cthu|: I got exactly what I needed in that case
[23:08:48] zenspider: icy` asked a clear question. you have yet to answer it
[23:08:56] cthu|: so all is good, thanks
[23:08:57] icy`: "works" if s=~r
[23:09:06] Radar: cthu|: Don't you go down the path of "all is good". People want answers.
[23:09:19] cthu|: Radar, I gave the answers
[23:09:24] cthu|: nil confused me
[23:09:25] zenspider: my rope... it is short. getting shorter...
[23:09:28] whathappens: has joined #ruby
[23:10:38] zenspider: icy`: do you feel like your questions were answered?
[23:10:52] zenspider: I sure don't... but I might be a bit testy at this point.
[23:11:00] ur5us: has joined #ruby
[23:11:17] banisterfiend: has joined #ruby
[23:11:32] baweaver: puts returns nil.
[23:11:41] baweaver: but it "prints" to the screen
[23:11:49] baweaver: (more accurately to STDOUT, but not the point)
[23:12:44] cthu|: yeah, thanks
[23:13:40] baweaver: Reading the documentation on methods will help to realize what they expect and what they return in given circumstances.
[23:14:08] cthu|: yeah, it's just I didn't notice before that eval prints them when there's explicit print
[23:14:22] baweaver: In pry, with pry-doc, you can ask for the documentation inline: ? Kernel#puts
[23:14:23] cthu|: it didn't do it here cuz we only get one line of output here
[23:14:35] cthu|: I chose not to use pry
[23:14:40] zenspider: or `ri` in the terminal
[23:14:50] baweaver: I always forget about that one.
[23:14:54] cthu|: it has some weird issues with steps after the break.
[23:15:04] cthu|: there's another one we decided to use instead
[23:15:18] cthu|: doesn't have colors, but has a better navigation capabilities
[23:17:04] icy`: well hopefully you learned something about being more clear next time ;D
[23:17:15] Eiam: choose not to use pry! forshame! =)
[23:17:19] jyaworski: has joined #ruby
[23:17:20] elomatreb: byebug uses pry though
[23:17:54] Eiam: banisterfiend is sobbing
[23:18:07] cthu|: I was wondering why it's so alike pry
[23:18:11] ur5us_: has joined #ruby
[23:18:27] baweaver: So does that make it a REPLacement?
[23:18:31] cthu|: it's just pry doesn't have proper stepping
[23:18:35] Eiam: I personally use pry to replace irb
[23:18:47] cthu|: it does to me since I removed pry and added byebug
[23:18:50] zenspider: ACTION still uses irb 99% of the time
[23:18:53] baweaver: (cjohnson: just for you)
[23:18:57] elomatreb: Yes, byebug is a debugger, pry is a repl. They integrate well, but they're different tools
[23:19:21] Eiam: cthu|: you might want "pry-nav"
[23:19:29] cthu|: that's another gem
[23:19:31] zenspider: and 99% of the time, `minitest` is my debugger
[23:19:34] Eiam: https://github.com/nixme/pry-nav
[23:19:36] cthu|: occam's razor
[23:19:59] baweaver: zenspider: using Guard much?
[23:20:01] zenspider: that is not what occam's razor means
[23:20:04] Eiam: put them in your dev block in the gemfile...
[23:20:12] cthu|: that's where they are
[23:20:13] zenspider: baweaver: no. I use minitest-autotest now and then, but mostly don't bother
[23:20:18] Eiam: not sure why thats an issue, good useful gems are good, is there some kind of "gem shame" going around?
[23:20:56] baweaver: Mmm, recently found uses for Guard outside of just tests
[23:20:57] Eiam: I comment in my gemfiles exactly what each gem is providing the project specifically so I have good reason for it to be present
[23:21:21] Eiam: that specific project, not generally what it provides.
[23:21:35] zenspider: Eiam: that's a good practice
[23:21:43] baweaver: 4 upstream resources combine into one specification, so Guard watches them for changes and regens the spec for development. Very useful.
[23:22:17] banisterfiend: guard is just a very light wrapper around inotify right?
[23:22:17] zenspider: I generally found that guard doesn't have enough brains (at least, out of the box the way most ppl use it)
[23:22:21] Eiam: saw a project with multijson and no other json libraries was like ???
[23:22:24] banisterfiend: i think i just used inotify for a similar thing
[23:22:34] halbbalda: has joined #ruby
[23:22:39] elomatreb: And the respective APIs for other OSes and a fallback poll implementation, I think
[23:22:41] ur5us: has joined #ruby
[23:22:49] baweaver: Is it? I just defaulted to using it because that's what I was familiar with when I wrote it
[23:23:38] baweaver: Also, good day banisterfiend
[23:23:51] Eiam: banisterfiend: thanks again for pry
[23:23:55] jrafanie: has joined #ruby
[23:23:58] Eiam: such a lovely tool
[23:24:02] baweaver: banisterfiend: You'll enjoy this one - https://github.com/baweaver/xf
[23:24:23] Eiam: baweaver: you monster =/
[23:24:59] baweaver: It's running in production here for some things.
[23:25:38] baweaver: Mostly JSON specification generation
[23:26:28] bijan_: has joined #ruby
[23:27:36] Guest82829: has joined #ruby
[23:27:38] baweaver: The function itself was something like this:
[23:27:39] baweaver: Xf.trace_key_value('version', proc { |v| DateTime.parse('2018-05-01') > DateTime.parse(v) }).get_value(api_spec).uniq
[23:28:14] baweaver: Except the actual function for the value was: newer_than = proc { |d| proc { |t| DateTime.parse(d) > DateTime.parse(t) } }
[23:29:00] baweaver: So: Xf.trace_key_value('version', newer_than['2018-05-01']).get_value(api_spec).uniq
[23:29:38] baweaver: === is fun.
[23:30:46] baweaver: Had to find out if a given specification had APIs newer than the timestamp I was trying to generate an artifact for.
[23:31:05] baweaver: More than likely i'll turn that into a challenge later :D
[23:32:35] baweaver: ACTION is very excitable with new toys
[23:32:35] Guest82829: has joined #ruby
[23:36:41] jyaworski: has joined #ruby
[23:45:34] beefjoe: has joined #ruby
[23:46:13] blackmesa: has joined #ruby
[23:47:09] RougeR: has joined #ruby
[23:47:09] RougeR: has joined #ruby
[23:47:24] Guest82829: has joined #ruby
[23:48:10] RougeT430: has joined #ruby
[23:52:05] cagomez: has joined #ruby
[23:53:37] nowhereman_: has joined #ruby