« Back to channel list

#ruby - 11 January 2019

« Back 1 day Forward 1 day »
[00:03:38] ogres: has joined #ruby
[00:17:29] rkazak: has joined #ruby
[00:23:15] sputnik13: has joined #ruby
[00:24:59] tdy: has joined #ruby
[00:29:11] darix: has joined #ruby
[00:30:47] saysjonathan: has joined #ruby
[00:38:52] chouhoulis: has joined #ruby
[00:39:23] mspo: zenspider: congrats
[00:39:28] mspo: zenspider: I have 30 years to go
[00:39:37] baweaver: Hehehehehe: https://twitter.com/keystonelemur/status/1083522909467856896
[00:39:40] rkazak: has joined #ruby
[00:39:58] mspo: zenspider: but I also have 17 years in so.. whatever
[00:43:14] marmotini_: has joined #ruby
[00:48:21] Azure: has joined #ruby
[01:04:19] horribleprogram: has joined #ruby
[01:04:26] horribleprogram: thinking about my ex again
[01:04:39] horribleprogram: I've been alone for too long, there's no turning back
[01:05:16] horribleprogram: if u put someone in a cell for 10 years, they learn to adapt in that cell, and change their behavior
[01:05:28] horribleprogram: sometimes it's irreversible
[01:05:44] horribleprogram: kinda like brain damage from doing a bunch of drugs when you're 14
[01:07:47] saysjonathan: has joined #ruby
[01:12:55] orbyt_: has joined #ruby
[01:13:10] baweaver: horribleprogram: need some help with Ruby?
[01:14:29] horribleprogram: baweaver: Not really I've never written a script with Ruby or anything
[01:14:43] baweaver: Never a better time to start than now :D
[01:15:13] AJA4351: has joined #ruby
[01:15:19] horribleprogram: baweaver: I don't really see the point of adding Ruby to the toolkit
[01:15:42] bmurt: has joined #ruby
[01:16:12] baweaver: horribleprogram: There's always a point! https://ruby.github.io/TryRuby/
[01:17:33] baweaver: You just have to believe in magic, and you can fly!
[01:18:04] horribleprogram: The 1000 hours of studying Ruby can be spent learning Groovy or something
[01:19:09] havenwood: horribleprogram: I thought from what you first said that you might be using Groovy on Grails. Try Ruby on Rails!
[01:21:11] havenwood: Or TruffleRuby runs on GraalVM, and is quite impressive. (Graal isn't so far from Grails, after all.)
[01:23:37] baweaver: Why just 1000?
[01:23:45] baweaver: Why not 10_000 horribleprogram?
[01:23:57] baweaver: There's so much fun to be had!
[01:24:25] horribleprogram: wow you can put underscores in an integer literal in Ruby?
[01:24:47] havenwood: horribleprogram: But only one in a row.
[01:24:56] horribleprogram: wow that's cool
[01:25:00] baweaver: You want to learn Ruby, you just don't quite know it yet.
[01:25:05] baweaver: So we're here to help!
[01:25:12] horribleprogram: OH WAIT JAVA SE 7 IMPLEMENTED THAT HAHAHAHHAHAHAHAHAHAHAHAHAHHAHAHA
[01:25:16] havenwood: &>> "#{1_0_0}%"
[01:25:18] rubydoc: # => "100%" (https://carc.in/#/r/5yxu)
[01:25:39] horribleprogram: listen to me, I'd never learn Ruby in a thousand years
[01:25:51] horribleprogram: Written by some Japanese
[01:25:52] baweaver: &>> "100%".next # :D
[01:25:53] rubydoc: # => "101%" (https://carc.in/#/r/5yxv)
[01:26:08] horribleprogram: Japanese are shitty programmers and don't know shit about anything
[01:26:13] havenwood: !troll horribleprogram
[01:26:17] horribleprogram: The last thing they've made was the compact cd
[01:26:24] ChanServ: +o havenwood
[01:26:37] havenwood: +b *!~horriblep@unaffiliated/nightcoder
[01:26:43] horribleprogram: has left #ruby: ()
[01:26:44] havenwood: +b horribleprogram!*@*
[01:26:44] baweaver: Nighty night
[01:28:32] phaul: it's already night over there?! /me confused.... 'night , anyways
[01:28:52] baweaver: Well, that was fun. Off I go, it's movies time!
[01:29:27] phaul: 3am - ~ 8 hrs = 24:00 - 5 hrs = ~ 19 hrs
[01:29:40] baweaver: 5:30pm here
[01:31:04] phaul: sounds like morning to me :)
[01:32:21] ChanServ: -o havenwood
[01:37:23] EXCHGR: has joined #ruby
[01:47:12] mspo: dviola: https://www.reddit.com/r/cscareerquestions/comments/9ni46v/how_to_improve_underdeveloped_software/
[01:47:47] saysjonathan: has joined #ruby
[01:48:09] mspo: groovy is terrible
[01:48:23] mspo: I think it's my least favorite language I've encountered
[01:50:42] Tempesta: has joined #ruby
[01:56:13] saysjonathan: has joined #ruby
[01:58:21] rkazak: has joined #ruby
[02:01:07] LSD-Jester: has joined #ruby
[02:02:05] LSD-Jester: has left #ruby: ()
[02:08:29] AJA4351: has joined #ruby
[02:11:33] tdy: has joined #ruby
[02:22:27] AJA4351: has joined #ruby
[02:27:33] dviola: mspo: heh
[02:30:50] chouhoulis: has joined #ruby
[02:33:58] orbyt_: has joined #ruby
[02:38:42] esrse: has joined #ruby
[02:41:21] saysjonathan: has joined #ruby
[03:04:23] d^sh: has joined #ruby
[03:16:32] Swyper: has joined #ruby
[03:17:38] Swyper: has joined #ruby
[03:19:41] uplime: has joined #ruby
[03:21:54] orbyt_: has joined #ruby
[03:22:34] davidw: has joined #ruby
[03:26:35] saysjonathan: has joined #ruby
[03:26:44] duderonomy: has joined #ruby
[03:39:26] r29v: has joined #ruby
[03:41:35] Swyper: has joined #ruby
[03:49:25] Swyper: has joined #ruby
[03:50:02] davidw: has joined #ruby
[04:06:55] Swyper: has joined #ruby
[04:09:59] braincrash: has joined #ruby
[04:16:18] tiff: has joined #ruby
[04:20:51] kapil____: has joined #ruby
[04:22:07] hutch: has joined #ruby
[04:24:24] adgtl: has joined #ruby
[04:24:32] adgtl: Is there any better way to write this?
[04:24:34] adgtl: https://gist.github.com/4f6eeefd5bd0c0edf3fa51832251665f
[04:24:47] DTZUZO: has joined #ruby
[04:25:18] adgtl: missing else one
[04:25:42] Nicmavr: has joined #ruby
[04:27:58] ur5us: has joined #ruby
[04:29:45] mozzarella: adgtl: what does @window contain?
[04:36:33] Swyper: has joined #ruby
[04:37:09] adgtl: mozzarella title of window. . abc.txt - myproject
[04:42:02] mozzarella: adgtl: why not just use a regex instead?
[04:47:02] d^sh: has joined #ruby
[04:47:12] mozzarella: adgtl: something like that: @window.split(/[#{NORMAL_DASH}#{SPECIAL_DASH}]/)
[04:51:31] davidw: has joined #ruby
[04:51:37] mozzarella: actually I think | would work in here
[04:51:44] mozzarella: @window.split(/#{NORMAL_DASH}|#{SPECIAL_DASH}/)
[04:58:25] dellavg_: has joined #ruby
[05:13:43] hutch: has joined #ruby
[05:15:00] DTZUZO: has joined #ruby
[05:25:08] Azure: has joined #ruby
[06:12:10] _whitelogger: has joined #ruby
[06:18:59] cthulchu: has joined #ruby
[06:23:57] conta: has joined #ruby
[06:29:28] nowhere_man: has joined #ruby
[06:30:12] marmotini_: has joined #ruby
[06:39:14] marmotini_: has joined #ruby
[06:42:40] MzrE: has joined #ruby
[06:47:24] tdy: has joined #ruby
[06:51:28] profetes: has joined #ruby
[06:56:36] KeyJoo: has joined #ruby
[06:59:46] CrazyEddy: has joined #ruby
[07:04:09] aupadhye: has joined #ruby
[07:04:27] maufart__: has joined #ruby
[07:04:55] marmotini_: has joined #ruby
[07:13:45] dionysus69: has joined #ruby
[07:17:25] neuraload: has joined #ruby
[07:58:42] jenrzzz: has joined #ruby
[08:03:25] clemens3: has joined #ruby
[08:08:26] status402: has joined #ruby
[08:12:30] status402: has joined #ruby
[08:14:26] reber: has joined #ruby
[08:17:12] not_finger_guns: has joined #ruby
[08:22:56] vondruch: has joined #ruby
[08:23:18] status402: has joined #ruby
[08:42:16] conta: has joined #ruby
[08:45:02] dinfuehr_: has joined #ruby
[08:49:50] mikecmpbll: has joined #ruby
[08:58:49] jenrzzz: has joined #ruby
[09:05:40] zululee_: has joined #ruby
[09:07:02] mikecmpbll: has joined #ruby
[09:15:37] uplime: has joined #ruby
[09:20:54] hahuang65: has joined #ruby
[09:27:40] hahuang65: has joined #ruby
[09:34:09] mikecmpb_: has joined #ruby
[09:41:22] CrazyEddy: has joined #ruby
[09:42:47] Bish: has joined #ruby
[09:42:59] Bish: why does mail.from_addrs from the mail gem exist
[09:43:10] Bish: it just wraps ".from" inside an array
[09:43:38] gregf_: has joined #ruby
[09:56:37] KeyJoo: has joined #ruby
[09:59:30] jenrzzz: has joined #ruby
[10:04:03] marmotini_: has joined #ruby
[10:04:06] DTZUZO: has joined #ruby
[10:06:16] bikram_: has joined #ruby
[10:13:04] za1b1tsu: has joined #ruby
[10:22:09] am0123: has joined #ruby
[10:22:18] jenrzzz: has joined #ruby
[10:25:21] drale2k_: has joined #ruby
[10:26:53] canton7: Bish, well it does slightly more: `from ? [from].flatten : []`
[10:27:04] canton7: That's the sort of thing that I might put in a little helper method
[10:31:33] dhollinger: has joined #ruby
[10:38:46] catbusters: has joined #ruby
[10:43:11] za1b1tsu: has joined #ruby
[10:46:44] Bish: canton7: my problem was that i have code like
[10:46:56] Bish: .to_address = "Something, Somethingelse <a@b.de>"
[10:47:16] Bish: the mail gem made this 2 addresses.. and it resulted in multiple sender addresses
[10:47:19] Bish: man that was hard to find
[10:48:04] Bish: canton7: i expected the mail gem to encode that
[10:48:20] Bish: canton7: slighty more? u mean the flaten thing?
[10:55:52] canton7: yeah, flattens and provides an empty array as the default value
[11:01:50] nertzy: has joined #ruby
[11:09:37] jenrzzz: has joined #ruby
[11:11:00] neuraload: has joined #ruby
[11:12:21] venmx: has joined #ruby
[11:18:03] drale2k_: has joined #ruby
[11:22:20] jenrzzz: has joined #ruby
[11:29:16] lucasb: has joined #ruby
[11:34:34] jenrzzz: has joined #ruby
[11:43:19] jenrzzz: has joined #ruby
[11:45:42] uplime: has joined #ruby
[11:48:16] deathwishdave: has joined #ruby
[11:54:31] deathwishdave: I am looking for a rails app that can handle registration, licensing, authentication etc for a desktop application
[11:55:31] deathwishdave: anyone know if such a thing exists? I guess i'm not google the right terms
[11:55:37] status402_: has joined #ruby
[11:59:35] jenrzzz: has joined #ruby
[12:03:15] canton7: deathwishdave, things like that rarely come out-of-the-box, since "registration" is a word which means something slightly different to everyone which puts it in their requirements...
[12:03:27] canton7: deathwishdave, you'll find tools which help you to build a rails app which can do those things, though
[12:03:49] deathwishdave: canton7 makes sense, thanks
[12:04:32] deathwishdave: canton7 we were building an in house system, 99% of the way there, and the dev behind it has been taken seriously ill
[12:04:39] deathwishdave: full panic now on
[12:17:04] keden: has joined #ruby
[12:26:31] deathwishdave: has joined #ruby
[12:28:53] jenrzzz: has joined #ruby
[12:36:59] SqREL: has joined #ruby
[12:45:40] jenrzzz: has joined #ruby
[12:49:14] uplime: has joined #ruby
[12:54:41] jenrzzz: has joined #ruby
[12:58:21] am0123: has joined #ruby
[13:01:27] AJA4350: has joined #ruby
[13:01:58] jenrzzz: has joined #ruby
[13:05:19] stryek: has joined #ruby
[13:10:42] keden: has joined #ruby
[13:11:19] reber: has joined #ruby
[13:11:25] jcalla: has joined #ruby
[13:12:54] jenrzzz: has joined #ruby
[13:14:31] bmurt: has joined #ruby
[13:20:44] status402: has joined #ruby
[13:32:55] drale2k_: has joined #ruby
[13:39:09] jenrzzz: has joined #ruby
[13:39:19] alexterziev: has joined #ruby
[13:39:48] pvalena: has joined #ruby
[13:41:21] rippa: has joined #ruby
[13:43:27] eddof13: has joined #ruby
[13:44:32] jacksoow: has joined #ruby
[13:46:52] uplime: has joined #ruby
[13:52:13] Inline: has joined #ruby
[13:55:04] rikkipitt: has joined #ruby
[13:57:51] drale2k_: has joined #ruby
[14:04:54] drale2k_: has joined #ruby
[14:06:11] status402: has joined #ruby
[14:12:42] drale2k_: has joined #ruby
[14:15:49] jenrzzz: has joined #ruby
[14:21:07] uplime: has joined #ruby
[14:28:42] drale2k_: has joined #ruby
[14:39:34] chouhoulis: has joined #ruby
[14:46:05] GodFather: has joined #ruby
[14:46:12] Rapture: has joined #ruby
[14:50:34] duderonomy: has joined #ruby
[14:52:22] jenrzzz: has joined #ruby
[14:55:41] am0123: has joined #ruby
[15:05:52] Nicmavr: has joined #ruby
[15:07:28] donofrio: has joined #ruby
[15:08:34] cow[moo]: has joined #ruby
[15:10:52] uplime: has joined #ruby
[15:13:50] conta: has joined #ruby
[15:19:37] conta: has joined #ruby
[15:19:40] drale2k_: has joined #ruby
[15:27:00] jenrzzz: has joined #ruby
[15:31:10] yebyen: has joined #ruby
[15:31:42] phaul: hi yebyen
[15:32:06] yebyen: I'm upgrading my stuff to 2.6 and I have a test that does: expect(BigDecimal).to receive(:new).with(any_args).at_least(:once).and_call_original
[15:32:39] yebyen: the test is called "uses BigDecimal" and it's only there to verify that nobody decided to replace the implementation with float or something less safe
[15:33:02] yebyen: and it doesn't work anymore because BigDecimal.new is deprecated, so we're calling BigDecimal like you're supposed to
[15:33:10] yebyen: BigDecimal("1.5") for example
[15:33:13] venmx: has joined #ruby
[15:33:21] yebyen: is there a way to capture that in rspec?
[15:33:45] yebyen: i understand that BigDecimal(_,_) is a global method I guess?
[15:33:53] yebyen: is that the same as calling it on Kernel? or instance of Kernel?
[15:34:20] yebyen: ok, I'm on the right track then... so I tried:
[15:34:21] yebyen: expect_any_instance_of(Kernel).to receive(:BigDecimal).with(any_args).at_least(:once).and_call_original
[15:34:22] phaul: Kernel is a module though so it has no instances
[15:34:34] yebyen: and I got a stack too deep crash
[15:34:47] yebyen: I think expect_any_instance_of works on modules
[15:35:13] yebyen: (it seems to intercept the method call, I think "and_call_original" is what fails)
[15:35:45] yebyen: maybe i'd get better results if I don't try to use any_args
[15:35:55] yebyen: or and_call_original
[15:36:02] yebyen: just explicitly call BigDecimal(xyz) myself instead
[15:37:18] yebyen: i guess i could also just take this test out
[15:37:55] phaul: that's what I would do. I dont understand what this test proves...
[15:38:08] drale2k_: has joined #ruby
[15:38:45] yebyen: it proves that i took your param passed in and actually sent it forward to the bigdecimal library
[15:39:15] yebyen: is there a good reason to make this deprecation? I really don't understand why it was done
[15:39:19] yebyen: i've never heard of a global function before
[15:39:31] yebyen: is there anything else that you call like BigDecimal(xyz)?
[15:40:08] phaul: I don't know of this global method distinction. its justa regular method on Kernel.
[15:40:30] yebyen: https://github.com/ruby/bigdecimal/blob/04f782f31b496dc250a02e0ee43f84c907b4aa25/ext/bigdecimal/bigdecimal.c#L3298
[15:40:46] cthulchu_: has joined #ruby
[15:41:27] yebyen: not really, if it was just a regular method then i'd be able to find a "def" for it somewhere
[15:41:37] yebyen: i'm pretty sure this is where it's defined though, in some C code
[15:41:51] yebyen: i'm not a ruby kernel developer though so i could be completely wrong about that
[15:42:56] yebyen: i guess it's documented as a regular instance method
[15:42:59] yebyen: http://ruby-doc.org/stdlib-2.6/libdoc/bigdecimal/rdoc/Kernel.html
[15:43:00] phaul: you don't have to find def for it, if it's defined in the C core. and that global_function stuff is just MRI internal helper
[15:43:08] phaul: it is just a regular method
[15:44:10] jenrzzz: has joined #ruby
[15:44:18] phaul: didn't really help you with that, though, I dont know what happens in RSpec that pushes it into recursion...
[15:44:41] yebyen: i'm sure it has something to do with the way it's defined
[15:44:45] yebyen: this is probably a bug in rspec
[15:45:51] yebyen: i've got 9 failing tests to fix and this is the easiest one of them, so
[15:46:00] yebyen: i'll remove that line
[15:46:15] davidw: has joined #ruby
[15:46:58] phaul: https://github.com/ruby/ruby/blob/trunk/class.c#L1759 it just does module_function automatically in Kernel
[15:47:26] yebyen: wow cool, and I actually know what a module function is because i've been using them :D
[15:47:34] yebyen: that clarifies that for me
[15:47:55] phaul: I think this should be reproducible with any module. give me a sec, let's see if I can replicate this with a custom module...
[15:48:04] yebyen: so I really should be able to intercept Kernel.BigDecimal()
[15:48:14] yebyen: rather than "instance of kernel"
[15:48:49] yebyen: i think that's how testing module functions worked anyway
[15:49:20] yebyen: if it's a module function, there is no instance it's called on
[15:51:46] polishdub: has joined #ruby
[15:53:27] bauruine: has joined #ruby
[15:54:23] yebyen: when did http error response bodies stop being nil and start being blank?
[15:54:29] yebyen: this one has bitten me before
[15:55:15] sputnik13: has joined #ruby
[15:55:51] yebyen: this is the restclient gem I think
[15:56:05] yebyen: probably between whatever version i upgraded from and whatever version I upgraded to, never mind...
[15:58:13] am0123: has joined #ruby
[15:59:17] phaul: yeah it just hangs https://gist.github.com/0f3528077a6d5ba709cb733714e0e674
[15:59:27] phaul: rspec is in some weird loop
[15:59:39] yebyen: awesome thanks for doing that!
[16:00:25] d0liver: has joined #ruby
[16:00:35] Inline: has joined #ruby
[16:01:33] jenrzzz: has joined #ruby
[16:04:50] uplime60: has joined #ruby
[16:06:39] nchambers: has joined #ruby
[16:07:57] hutch: has joined #ruby
[16:11:25] marmotini_: has joined #ruby
[16:14:16] A-cat: has joined #ruby
[16:14:21] A-cat: has left #ruby: ("Leaving")
[16:15:44] yebyen: phaul: should I report this to rspec? or are you already going to
[16:16:07] tiff: has joined #ruby
[16:17:28] phaul: It's up to you, I am not going to.
[16:17:58] yebyen: ok, i'll iterate on it for a day or so and see if i can find out more about what's going wrong before I bother anyone else with it
[16:18:01] yebyen: thanks for the gist
[16:19:51] phaul: the module_function line is not needed. simple instance_method reproduce the issue. The issue goes away if you remove the .and_call_original (as you said)
[16:26:20] crankharder: has joined #ruby
[16:26:32] P1C0: has joined #ruby
[16:28:37] davidw: has joined #ruby
[16:32:06] za1b1tsu: has joined #ruby
[16:33:29] phaul: what it fundamentally doesn't seem to like is the any_instance_of(module) .. yebyen I updated the gist, the commented line works, the uncommented line hangs
[16:33:57] yebyen: aha well that makes sense because there is no instance
[16:34:13] yebyen: but it's not intercepting at all if you say expect(Module).to receive
[16:34:48] yebyen: or would you say that there is actually an instance of the kernel here wherever we're calling BigDecimal
[16:34:50] Cybergeek: has joined #ruby
[16:35:41] phaul: there is. Object includes kernel, and wherever you are that self inherits Object. That self is the instance
[16:36:30] phaul: so where the BigDecimal() call is in your code that self is the receiver
[16:36:34] orbyt_: has joined #ruby
[16:38:03] jenrzzz: has joined #ruby
[16:38:07] drale2k_: has joined #ruby
[16:39:32] phaul: in fact this gives an idea. what happens if you say any_instance_of(Object) ?
[16:41:04] yebyen: that works
[16:41:11] r29v: has joined #ruby
[16:41:18] yebyen: :thumbsup:
[16:42:32] chouhoulis: has joined #ruby
[16:46:28] yebyen: so what you have in the gist now works too
[16:46:43] yebyen: that makes more sense and i think it's how i've been using rspec to test module functions
[16:46:58] yebyen: (just pretend that it's an instance of the module)
[16:50:27] tdy: has joined #ruby
[16:50:47] \void: has joined #ruby
[16:51:45] Dbugger: has joined #ruby
[16:53:04] phaul: I would argue that testing builtin in classes like Object is not what you want. You have an object/code under test, that has some class right? Why not make that a double, and expect the BigDecimal directly on that?
[16:53:46] phaul: a = MyClass.new; expect(a).to receive(:BigDecimal) ; a.calculate!
[16:55:50] phaul: ah, I see, you said it, you want to test that is does not override BigDecimal() and the method lookup bubbles up all the way to Kernel.
[16:57:33] phaul: I would say that that is testing internal implementation detail, objects have the right to respond to methods whichever way they want, as sonlg as that response is good
[17:04:18] yebyen: if i said that, it's not what i meant
[17:04:36] yebyen: i just want to be sure that they're not deciding unilaterally that "bigdecimal is no longer needed"
[17:04:54] yebyen: if they're going to do that, they're on the hook to remove the test that asserts "we used bigdecimal because it's safe" too
[17:05:39] yebyen: the expectation isn't on the object, the expectation is that we're calling a method BigDecimal
[17:05:43] yebyen: (on what) was the question
[17:05:46] yebyen: Object, not Kernel
[17:05:50] yebyen: good enough for me
[17:06:00] yebyen: *isn't on Object
[17:13:00] jenrzzz: has joined #ruby
[17:18:23] orbyt_: has joined #ruby
[17:18:35] cd: has joined #ruby
[17:20:10] baweaver: ACTION wanders in
[17:21:25] jenrzzz: has joined #ruby
[17:21:29] jinie: has joined #ruby
[17:25:19] conta2: has joined #ruby
[17:26:22] cthulchu: has joined #ruby
[17:29:44] jenrzzz: has joined #ruby
[17:32:57] WA9ACE: seeing your name reminds me I haven't checked ruby.social in a while
[17:33:20] BTRE: has joined #ruby
[17:38:16] am0123: has joined #ruby
[17:42:10] lytol_: has joined #ruby
[17:48:51] jenrzzz: has joined #ruby
[17:54:51] jenrzzz: has joined #ruby
[17:55:55] marmotini_: has joined #ruby
[17:56:53] chouhoulis: has joined #ruby
[18:04:27] phaul: archlinux finally upgraded to 2.6 !
[18:04:28] sanscoeur: has joined #ruby
[18:04:35] phaul: ?hammertime
[18:05:00] phaul: ah, ruby[bot] is on vacation
[18:05:05] up|ime: half a month ain't too bad, especially during vacaiton time :P
[18:11:40] tdy: has joined #ruby
[18:13:56] eddof13: has joined #ruby
[18:15:03] jenrzzz: has joined #ruby
[18:17:36] mozzarella: You know, I wish 3 / 2 returned a float, just like it does in python. Rounding division is almost never what I want, and I end up with .to_f all over my code.
[18:19:07] mozzarella: I shouldn't have to
[18:20:30] al2o3-cr: then what would use for integer division // ?
[18:22:24] phaul: another thing is that maybe you need rational, floats are work of evil
[18:23:35] mozzarella: al2o3-cr: // or .div (though rdiv would be a better name)
[18:24:48] phaul: there is a lot of things unsafe on floats that catches ppl offguard
[18:25:39] mozzarella: such as what?
[18:26:14] phaul: ruboto fact ?float: Your numbers don't add up? You get "weird" results? read http://floating-point-gui.de/
[18:27:51] mspo: don't you probably want to use .to_r ?
[18:28:21] jenrzzz: has joined #ruby
[18:50:10] catbusters: has joined #ruby
[18:52:55] jenrzzz: has joined #ruby
[19:04:14] chouhoulis: has joined #ruby
[19:08:45] jenrzzz: has joined #ruby
[19:13:15] chouhoulis: has joined #ruby
[19:17:59] jenrzzz: has joined #ruby
[19:18:25] eddof13: has joined #ruby
[19:23:43] salasrod: has joined #ruby
[19:29:58] Azure: has joined #ruby
[19:30:48] jenrzzz: has joined #ruby
[19:35:42] jenrzzz: has joined #ruby
[19:36:59] conta: has joined #ruby
[19:43:32] jenrzzz: has joined #ruby
[19:45:25] ziyadb: has joined #ruby
[19:47:01] gix: has joined #ruby
[19:48:07] PasNox: has joined #ruby
[19:59:48] conta: has joined #ruby
[20:02:35] SqREL: has joined #ruby
[20:04:21] jenrzzz: has joined #ruby
[20:08:11] marmotini_: has joined #ruby
[20:16:07] eddof13: has joined #ruby
[20:18:02] profetes: has joined #ruby
[20:20:40] SqREL: has joined #ruby
[20:21:52] marmotini_: has joined #ruby
[20:23:20] PasNox: has joined #ruby
[20:24:29] hutch: has joined #ruby
[20:25:10] dviola: has joined #ruby
[20:48:42] SeepingN: has joined #ruby
[20:50:29] ur5us: has joined #ruby
[20:52:14] orbyt_: has joined #ruby
[20:54:40] tAn: I'm playing around with Object#define_singleton_method... is it possible to let the defined method handle blocks?
[20:56:06] tAn: my current notepad - https://gist.github.com/ta/4a36338e4d3a296006ef2faf8ec0d9cf
[20:58:43] saysjonathan: has joined #ruby
[21:04:51] lupine: weird, I'd expect that to work
[21:06:09] phaul: block_given? might be the thing. it only makes sense to me inside a def
[21:06:45] lupine: this works: define_singleton_method(:foo, method(:foo))
[21:06:58] phaul: &>>block_given?
[21:07:00] rubydoc: # => false (https://carc.in/#/r/5z2v)
[21:07:17] lupine: where `method(:foo)` gets a reference to a method created with `def`
[21:08:18] lupine: If I use a block rather than pass a method, then `yield`fails with `LocalJumpError`, which is really unexpected
[21:09:06] tAn: lupine: like `def o.bar; ... ; end` ?
[21:09:11] lupine: &>> def foo; yield ; end ; a = Object.new ; a.define_singleton_method(:foo, method(:foo)) ; a.foo { puts 'ok' ; 'ok' }
[21:09:12] rubydoc: # => ok ...check link for more (https://carc.in/#/r/5z2w)
[21:09:34] lupine: &>> a = Object.new ; a.define_singleton_method(:foo) { yield } ; a.foo { puts 'ok' ; 'ok' }
[21:09:35] rubydoc: # => no block given (yield) (LocalJumpError) (https://carc.in/#/r/5z2x)
[21:09:55] lupine: thanks ruby, very wise
[21:10:48] phaul: well, yeild and block_given? are keywords to work in def..
[21:12:46] phaul: it would be better if it was syntax error imho
[21:13:53] phaul: &>> super
[21:13:54] rubydoc: # => super called outside of method (NoMethodError) (https://carc.in/#/r/5z2y)
[21:17:03] cow[moo]: has joined #ruby
[21:18:48] phaul: this reminds me of this https://gist.github.com/phaul/1d36018bf925bd212c64671a5ca20217#file-sudoku-rb-L223, innteresting that that works
[21:20:30] al2o3-cr: https://banisterfiend.wordpress.com/2010/11/06/behavior-of-yield-in-define_method/ this explains why.
[21:24:59] al2o3-cr: &>> def ping; define_singleton_method(:pong) { yield } end; ping { "ping" }; pong { "pong" }
[21:25:01] rubydoc: # => "ping" (https://carc.in/#/r/5z33)
[21:29:58] mikecmpbll: has joined #ruby
[21:36:45] orbyt_: has joined #ruby
[21:38:00] jenrzzz: has joined #ruby
[21:42:22] comet23: has joined #ruby
[21:42:32] fcambus: has joined #ruby
[21:42:33] SqREL: has joined #ruby
[21:43:08] comet23: why are there aliased methods in ruby?
[21:48:51] saysjonathan: has joined #ruby
[21:55:56] saysjonathan: has joined #ruby
[21:57:59] ddffg: has joined #ruby
[21:58:40] ddffg: hi people, i have one challenge, i need send about 10M from rails, what tools couls you recommend?
[21:59:32] ddffg: send 10M emails with ruby
[21:59:48] ddffg: what is fastest way to do that
[22:01:42] mspo: do whatever you do to send 1
[22:01:49] mspo: parallelize it
[22:02:27] bougyman: ddffg: I'd use a work queue for that.
[22:02:39] bougyman: so all rails does is put them on that work queue (beanstalk is nice for this)
[22:02:47] bougyman: then as many workers you want can work that queue to send the mail
[22:03:53] sticaz: has joined #ruby
[22:07:48] ruby[bot]: has joined #ruby
[22:07:48] ChanServ: +o ruby[bot]
[22:08:52] phaul: ?botsnack
[22:10:02] phaul: ACTION kicks rubybot hard in the back for not playing along
[22:10:27] hiroaki: has joined #ruby
[22:10:36] elomatreb: be nice to the bot :(
[22:14:41] chouhoulis: has joined #ruby
[22:22:51] orbyt_: has joined #ruby
[22:25:28] olspookishmagus: has joined #ruby
[22:32:02] jenrzzz: has joined #ruby
[22:36:22] reber: has joined #ruby
[22:40:13] orbyt_: has joined #ruby
[22:43:36] not_finger_guns: has joined #ruby
[22:47:45] zapata: has joined #ruby
[22:48:18] saysjonathan: has joined #ruby
[22:55:20] SqREL: has joined #ruby
[23:00:46] ruby[bot]: has joined #ruby
[23:00:47] ChanServ: +o ruby[bot]
[23:01:18] ruby[bot]: -bb horribleprogram!*@* horribleprogram!*@*
[23:04:22] connermcd: has joined #ruby
[23:05:13] discopatrick: has joined #ruby
[23:06:18] EduardoBautista: has joined #ruby
[23:09:31] davidw: has joined #ruby
[23:11:22] orbyt_: has joined #ruby
[23:14:43] hutch: has joined #ruby
[23:19:42] EduardoBautista: has joined #ruby
[23:27:42] EduardoBautista: has joined #ruby
[23:27:43] eddof13: has joined #ruby
[23:29:38] eddof13: has joined #ruby
[23:33:05] jenrzzz: has joined #ruby
[23:35:04] BTRE: has joined #ruby
[23:41:42] Rich_Morin_: has joined #ruby
[23:43:37] davidw: has joined #ruby
[23:44:53] comet23: how can i use ruby to create a dns that will create a massive ddos across the entire class b range?
[23:45:24] Rich_Morin_: Actually, Elixir is better suited for that task...
[23:46:16] comet23: sounds like snake oil
[23:48:21] orbyt_: has joined #ruby
[23:48:21] Rich_Morin_: https://blog.discordapp.com/scaling-elixir-f9b8e1e7c29b - "we are up to nearly five million concurrent users and millions of events per second flowing through the system"
[23:52:59] phaul: never tried such things, but its so hard for me to beleive that you are going to be CPU limited
[23:54:59] Rich_Morin_: Ruby is a lovely language, but concurrency is not one of its strong suits.
[23:57:04] baweaver: It's not, but for that type of task it's irrelevant
[23:57:20] baweaver: It's also likely against the channel's rules to discuss how that might work.
[23:58:51] Rich_Morin_: On another note, I haven't been able to find a way to use regexen on text strings which contain arbitrary byte values. I've got some text that is mostly ASCII, but has some wonky 8-bit characters I'd like to discard. When I try to do this with gsub, it complains massively.