« Back to channel list

#ruby - 29 March 2019

« Back 1 day Forward 1 day »
[00:02:15] havenwood: though I'm actually not sure it's supported at all
[00:02:49] adam12: havenwood: I'm going to look. Last time I looked at it, Oracle wanted me to make an account and do some stuff. Maybe it's better now.
[00:11:26] orbyt_: has joined #ruby
[00:13:00] sgen: has joined #ruby
[00:13:41] podman: has joined #ruby
[00:18:37] mangold: has joined #ruby
[00:19:58] jpirko: has joined #ruby
[00:21:14] AJA4350: has joined #ruby
[00:22:12] djabadu: has joined #ruby
[00:47:55] aauren3: has joined #ruby
[00:54:12] fredolinhares: has joined #ruby
[01:02:47] Renich: has joined #ruby
[01:18:21] RamShadow11: has joined #ruby
[01:21:34] t0xik: has joined #ruby
[01:29:10] twe4ked: has joined #ruby
[01:29:20] peksi16: has joined #ruby
[01:32:23] lido: has joined #ruby
[01:32:24] lido: has joined #ruby
[01:37:42] szed: has joined #ruby
[01:37:51] szed: has left #ruby: ()
[01:39:40] Devalo: has joined #ruby
[01:52:08] sgen: has joined #ruby
[02:05:35] octos: has joined #ruby
[02:12:32] fireduck25: has joined #ruby
[02:27:51] mangold: has joined #ruby
[02:30:35] TeamBlast18: has joined #ruby
[02:38:53] ausmat: has joined #ruby
[03:13:44] pwnd_nsfw: has joined #ruby
[03:14:02] tdy1: has joined #ruby
[03:16:12] dar123: has joined #ruby
[03:29:42] ston3r: has joined #ruby
[03:33:19] shakes: has joined #ruby
[03:35:21] hdaugherty: has joined #ruby
[03:38:53] mikroflops13: has joined #ruby
[03:39:40] tAn: has joined #ruby
[03:54:20] znpy28: has joined #ruby
[03:55:04] ston3r: has left #ruby: ("Leaving")
[03:55:34] kapil____: has joined #ruby
[04:00:50] noodle: has joined #ruby
[04:10:55] braincrash: has joined #ruby
[04:22:29] DaniG2k: has joined #ruby
[04:26:14] Swyper: has joined #ruby
[04:33:40] gb_away: has joined #ruby
[04:46:21] ur5us: has joined #ruby
[04:55:25] mangold: has joined #ruby
[05:04:27] holdenjd: has joined #ruby
[05:04:34] iMadper: has joined #ruby
[05:07:09] sauvin: has joined #ruby
[05:07:11] holdenjd: has left #ruby: ("Leaving...")
[05:09:08] hdaugherty: has joined #ruby
[05:11:39] johnny56: has joined #ruby
[05:17:51] Tau: has joined #ruby
[05:19:22] WhereIsMySpoon: has joined #ruby
[05:19:22] WhereIsMySpoon: has joined #ruby
[05:43:14] sidx64: has joined #ruby
[05:52:20] Swyper: has joined #ruby
[05:54:16] v01d4lph4: has joined #ruby
[06:01:24] lido: has joined #ruby
[06:01:24] lido: has joined #ruby
[06:02:02] laaron: has joined #ruby
[06:05:31] duderonomy: has joined #ruby
[06:06:36] pwnd_nsfw`: has joined #ruby
[06:15:52] tdy1: has joined #ruby
[06:16:23] Swyper: has joined #ruby
[06:18:01] aupadhye: has joined #ruby
[06:22:24] kapil____: has joined #ruby
[06:27:49] conta: has joined #ruby
[06:27:51] hiroaki: has joined #ruby
[06:33:51] CrazyEddy: has joined #ruby
[06:34:53] marz_d`ghostman: has joined #ruby
[06:35:24] marz_d`ghostman: Has anyone tried developing a video streaming web app via RTSP? WHat tech stack did you use?
[06:37:44] DmitryBochkarev: has joined #ruby
[06:53:25] aufi: has joined #ruby
[06:54:43] shakes: has left #ruby: ("Leaving")
[07:13:50] sidx64: has joined #ruby
[07:18:10] t0xik: has joined #ruby
[07:30:01] andikr: has joined #ruby
[07:35:59] suukim: has joined #ruby
[07:45:10] _whitelogger: has joined #ruby
[07:45:20] _joes_: has joined #ruby
[07:47:59] AzizLight: has joined #ruby
[07:49:55] vondruch: has joined #ruby
[07:51:15] schleppel: has joined #ruby
[07:51:20] Dbugger: has joined #ruby
[07:56:37] ellcs1: has joined #ruby
[07:57:09] cd: has joined #ruby
[07:59:03] Dbugger: has joined #ruby
[08:00:55] cd: has joined #ruby
[08:01:23] BH23: has joined #ruby
[08:02:28] aupadhye: has joined #ruby
[08:09:57] ikbenhet: has joined #ruby
[08:13:34] akem: has joined #ruby
[08:13:44] _joes_: has joined #ruby
[08:14:15] def_jam: has joined #ruby
[08:14:21] clemens3: has joined #ruby
[08:14:35] eb0t_: has joined #ruby
[08:15:36] WhereIsMySpoon: has joined #ruby
[08:15:37] WhereIsMySpoon: has joined #ruby
[08:22:17] lxsameer: has joined #ruby
[08:23:05] agent_white: has joined #ruby
[08:25:19] sidx64: has joined #ruby
[08:28:48] sidx64: has joined #ruby
[08:30:59] mangold: has joined #ruby
[08:33:34] hightower2: has joined #ruby
[08:33:50] eb0t: has joined #ruby
[08:35:33] hightower2: has joined #ruby
[08:41:56] Stan: has joined #ruby
[08:43:40] Swyper: has joined #ruby
[08:46:45] graft: has joined #ruby
[08:47:12] _joes_: has joined #ruby
[08:51:23] TomyWork: has joined #ruby
[08:53:23] claudiuinberlin: has joined #ruby
[08:53:26] ikbenhet: has joined #ruby
[09:00:55] claudiuinberlin: has joined #ruby
[09:03:53] def_jam: has joined #ruby
[09:17:31] tdy1: has joined #ruby
[09:20:13] Cork: the core net/http causes "warning: Object#timeout is deprecated, use Timeout.timeout instead." warnings, anyone know if there is an issue somewhere about handling this?
[09:21:42] cgfbee: has joined #ruby
[09:21:49] WhereIsMySpoon: has joined #ruby
[09:21:49] WhereIsMySpoon: has joined #ruby
[09:24:20] tdy1: has joined #ruby
[09:50:04] gkos: has joined #ruby
[09:56:14] tjbp: has joined #ruby
[09:57:09] kyrylo: has joined #ruby
[10:06:10] WhereIsMySpoon: has joined #ruby
[10:06:11] WhereIsMySpoon: has joined #ruby
[10:06:40] WhereIsMySpoon: is there any way to somehow return from a begin-rescue-end block? Otherwise each time I have one I need to put it in a separate function which is just a bit annoying for such a small piece of code
[10:06:49] WhereIsMySpoon: or assign the result of the block to a variable
[10:09:28] phaul: WhereIsMySpoon: paste a snippet of code, and we will try to refactor
[10:11:46] ytti: do remember that def, rescue, end is an option
[10:12:52] phaul: if there was no error then throw catch.
[10:13:09] phaul: but that's just one way
[10:13:12] WhereIsMySpoon: phaul: https://pastebin.com/XjM0uKNr so if i wanted baz available outside the block id need to do that
[10:13:13] ruby[bot]: WhereIsMySpoon: 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
[10:13:21] WhereIsMySpoon: or put it in a function like this https://pastebin.com/ez2VB6HH
[10:13:22] ruby[bot]: WhereIsMySpoon: as I told you already, please use https://gist.github.com
[10:13:28] WhereIsMySpoon: gah, ill do it next time
[10:14:42] WhereIsMySpoon: phaul: is there some way i dont have to do either of those and just assign baz equal to the result of evaluating the begin-rescue-end block somehow?
[10:14:50] ytti: WhereIsMySpoon, def foo(input); JSON.parse! input; rescue # do stuff; end
[10:15:20] WhereIsMySpoon: ytti: right but thatd still be a separately defined function for essentially 1 or 2 lines of code
[10:15:49] phaul: baz = begin JSON.parse! ... end
[10:16:08] ytti: baz = JSON.parse!(input) rescue "poop"
[10:16:12] ytti: but this is discouraged
[10:16:28] WhereIsMySpoon: i assume phaul's version is also discouraged?
[10:16:28] ytti: generally not considered idiomatic
[10:16:35] ytti: but that doesn't mean you can't use it
[10:17:49] phaul: do you want baz to contain some value from rescue if there is an error, and supress the exception , or do you want the error to be rasied to upper level
[10:18:43] phaul: if you want to supress it then ytti's solution is the same , otherwise in baz = begin ... rescue .. raise $! end
[10:18:51] WhereIsMySpoon: i want the error to be raised
[10:19:05] WhereIsMySpoon: i dont want baz to contain the error
[10:19:30] phaul: then just re-raise $! in rescue
[10:19:58] phaul: hangon. for these two lines it's the same as:
[10:20:06] phaul: baz = JSON.parse!
[10:21:17] WhereIsMySpoon: what a silly circle
[10:31:30] UncleCid__: has joined #ruby
[11:05:29] apparition: has joined #ruby
[11:13:42] pwnd_nsfw: has joined #ruby
[11:20:31] garyserj: has joined #ruby
[11:20:54] DmitryBochkarev: has joined #ruby
[11:28:50] yokel: has joined #ruby
[11:31:16] conta: has joined #ruby
[11:31:50] ldnunes: has joined #ruby
[11:34:49] yokel: has joined #ruby
[11:39:34] Devalo: has joined #ruby
[11:48:08] AJA4350: has joined #ruby
[11:56:35] houhoulis: has joined #ruby
[12:01:28] WhereIsMySpoon: I have a function on Mongo::Client that's just #[] - how do I mock this with rspec? I tried client.stub!(:[]).and_return(foo) but it complains
[12:01:54] WhereIsMySpoon: #[] returns a Mongo::Collection given a valid arg in [] like say my_client[:my_collection_name]
[12:02:17] WhereIsMySpoon: "#<Double "Mongo::Client"> received unexpected message :stub! with (:[])"
[12:03:01] bmurt: has joined #ruby
[12:04:12] znz_jp: has joined #ruby
[12:05:22] phaul: try allow(client).to receive(:[]).and_return(foo)
[12:06:54] WhereIsMySpoon: phaul: undefined method `and_return' for :[]:Symbol
[12:07:26] phaul: did you parenthesise correctly?
[12:07:59] WhereIsMySpoon: `allow(client).to receive (:[]).and_return(collection)`
[12:08:17] phaul: space between receive and open paren
[12:08:21] phaul: delete that
[12:08:37] phaul: parses to different ruby expression
[12:10:50] WhereIsMySpoon: that works thanks
[12:12:25] sgen: has joined #ruby
[12:18:35] al2o3-cr: &>> 0b0101010
[12:18:37] rubydoc: # => 42 (https://carc.in/#/r/6lxs)
[12:23:30] al2o3-cr: hey, phaul :)
[12:23:32] venmx: has joined #ruby
[12:23:44] phaul: hi al2o3-cr
[12:25:12] al2o3-cr: beutiful day, today.
[12:25:52] phaul: yeah, same here.
[12:26:14] al2o3-cr: you still on your boat?
[12:26:36] phaul: no, boat is ashore. I'm at my dad's in hungary
[12:26:54] phaul: I have no money to launch it, or to boat this year
[12:27:05] phaul: such is life :)
[12:27:22] al2o3-cr: ah, ok. maybe next year hopefully :)
[12:28:26] phaul: diging myself into front end stuff, jumped to elm from react. It's quite enjoyable
[12:28:59] phaul: especially if haskell syntax is somewhat familiar to you
[12:29:03] al2o3-cr: oh, that's cool. how's going?
[12:29:11] al2o3-cr: no, never did haskell.
[12:29:16] phaul: slowly taking over the world :)
[12:30:02] phaul: I think elm is a lot more approachable than haskell
[12:30:12] phaul: and a lot smaller
[12:30:33] al2o3-cr: like they say, learn as many as possible.
[12:31:51] Nicmavr: has joined #ruby
[12:31:55] al2o3-cr: i'd like to seriously start getting to grips with rust/go
[12:35:25] gkos: has joined #ruby
[12:41:56] RubyGuyNeedsHelp: has joined #ruby
[12:43:24] RubyGuyNeedsHelp: I need to downcase the first line of a file without reading the entire file into memory. I know how to read only the first line File.open('largefile.csv') {|f| f.readline} but how do I write to the same file without loading it all into memory?
[12:50:07] v01d4lph4: has joined #ruby
[12:50:28] evdubs: has joined #ruby
[12:51:53] lupine: RubyGuyNeedsHelp: f.rewind; f.write(...)
[12:51:59] fredolinhares: has joined #ruby
[12:52:07] lupine: you'll need to open it 'r+' and hope nobody else is concurrently editing it
[12:52:42] lupine: also, this approach only makes sense if your downcased data is the same number of bytes. this is a safe assumption for ascii files, but not generally safe
[12:54:56] _joes_: has joined #ruby
[12:55:19] BH23: has joined #ruby
[12:56:23] gkos: has joined #ruby
[12:57:44] v01d4lph4: has joined #ruby
[12:59:11] v01d4lph4: has joined #ruby
[13:01:08] lucasb: has joined #ruby
[13:01:54] gkos: has joined #ruby
[13:06:22] farski: has joined #ruby
[13:11:41] BTRE: has joined #ruby
[13:11:42] Xiti: has joined #ruby
[13:13:46] WhereIsMySpoon: has joined #ruby
[13:15:31] rippa: has joined #ruby
[13:17:25] sgen: has joined #ruby
[13:26:40] jcalla: has joined #ruby
[13:28:48] WhereIsMySpoon__: has joined #ruby
[13:30:31] laaron: has joined #ruby
[13:37:15] claudiuinberlin: has joined #ruby
[13:37:59] ferr: has joined #ruby
[13:43:06] venmx: has joined #ruby
[13:43:32] jottr_: has joined #ruby
[13:49:16] Blaguvest: has joined #ruby
[13:54:56] mangold: has joined #ruby
[14:02:19] Swyper: has joined #ruby
[14:02:38] Inline: has joined #ruby
[14:07:40] _joes_: has joined #ruby
[14:07:54] BH23: has joined #ruby
[14:09:39] WhereIsMySpoon: has joined #ruby
[14:09:39] WhereIsMySpoon: has joined #ruby
[14:21:32] dionysus69: has joined #ruby
[14:24:38] yokel: has joined #ruby
[14:27:51] void09: has left #ruby: ("WeeChat 2.3")
[14:31:32] _joes_: has joined #ruby
[14:31:43] BH23: has joined #ruby
[14:34:54] hiroaki: has joined #ruby
[14:37:41] helpa: has joined #ruby
[14:37:51] DmitryBochkarev: has joined #ruby
[14:39:25] Hobbyboy: has joined #ruby
[15:01:52] i1nfusion: has joined #ruby
[15:02:46] Swyper: has joined #ruby
[15:07:58] i1nfusion1: has joined #ruby
[15:09:50] tdy1: has joined #ruby
[15:21:23] krandi: has joined #ruby
[15:24:13] APK: has joined #ruby
[15:24:24] gigetoo: has joined #ruby
[15:25:35] ByronJohnson: has joined #ruby
[15:25:50] n13z: has joined #ruby
[15:26:01] Onwarion: has joined #ruby
[15:26:19] priodev: has joined #ruby
[15:29:18] d10n-work: has joined #ruby
[15:29:31] polishdub: has joined #ruby
[15:33:45] kyrylo: has joined #ruby
[15:35:53] DmitryBochkarev: has joined #ruby
[15:40:16] Fischmiep: has joined #ruby
[15:41:04] Devalo: has joined #ruby
[15:41:14] ams__: has joined #ruby
[15:56:49] orbyt_: has joined #ruby
[16:01:49] orbyt_: has joined #ruby
[16:03:20] Terens: has joined #ruby
[16:03:57] alem0lars: has joined #ruby
[16:08:09] sgen: has joined #ruby
[16:13:46] Terens: would you store configuration as rows or within jsonb column ?
[16:14:15] Terens: some are depended so ancenstry would be used
[16:18:58] crankharder: has joined #ruby
[16:22:18] lanky_leguan: has joined #ruby
[16:23:08] clemens3_: has joined #ruby
[16:24:15] grilix: has joined #ruby
[16:31:43] cthulchu_: has joined #ruby
[16:33:43] i1nfusion1: has joined #ruby
[16:34:37] sanscoeur: has joined #ruby
[16:37:06] alem0lars: has joined #ruby
[16:37:10] Devalo: has joined #ruby
[16:41:56] crankharder: has joined #ruby
[16:43:15] gix: has joined #ruby
[16:43:20] lanky_leguan: why do some keywords return something, and some don't? method_name = def name; end but alias doesn't work like that?
[16:46:30] Devalo: has joined #ruby
[16:46:30] lanky_leguan: seemed similar, def ~ define_method, alias ~ alias_method
[16:53:40] sanscoeur: has joined #ruby
[16:55:17] AJA4350: has joined #ruby
[16:58:33] dar123: has joined #ruby
[17:04:11] sanscoeur: has joined #ruby
[17:04:20] suukim: has joined #ruby
[17:06:47] _joes_: has joined #ruby
[17:08:14] t0xik: has joined #ruby
[17:08:46] also_uplime: has joined #ruby
[17:12:18] AJA4350: has joined #ruby
[17:17:20] orbyt_: has joined #ruby
[17:25:03] Renich: has joined #ruby
[17:29:14] claudiuinberlin: has joined #ruby
[17:29:42] griffindy: has joined #ruby
[17:31:56] Swyper: has joined #ruby
[17:35:11] code_zombie: has joined #ruby
[17:37:09] Devalo: has joined #ruby
[17:37:11] code_zombie: has joined #ruby
[17:38:28] NickPresta: has joined #ruby
[17:38:56] jcarl43: has joined #ruby
[17:41:43] RedSnarf: has joined #ruby
[17:43:11] NickPresta: Hi. I'm trying to publish a ruby gem with a pre-release version but it seems that running `gem build my.gemspec` results in some sort of transformation happening to my version number. Here's an example of the version, the gemspec, and running `gem build`: https://gist.github.com/nickpresta/fdf77d3f7ada3b9ec5765177d1affdc6. Any explanation would be appreciated. Thanks.
[17:48:31] NickPresta: I'm reading the RubyGems site: https://guides.rubygems.org/releasing-rubygems/ and the docs claim that gems adhere to semver restrictions, which should mean that something like `1.0.0-beta+exp.sha.5114f85` is a valid version number, but `gem build` throws an error with `Malformed version number string` so I'm not sure where to look to find how I can name beta/pre-release versions correctly.
[18:02:45] Terens: has joined #ruby
[18:03:04] Terens: why is this code good? scope :holidays, -> { sla_active? ? eval(find_by(key: 'holidays').value) : '' }
[18:06:05] Devalo: has joined #ruby
[18:08:53] nowhere_man: has joined #ruby
[18:13:19] claudiuinberlin: has joined #ruby
[18:13:43] darix: terens: something with eval is imho questionable :P
[18:14:23] Terens: but senior dev says that there isn't other way but I don't understand why
[18:17:00] darix: just based on docs
[18:17:21] darix: scope :holidays, -> { find_by(key: 'holidays') if sla_active? }
[18:17:26] darix: https://guides.rubyonrails.org/active_record_querying.html#using-conditionals
[18:17:58] Terens: Would you choose single vs multiple rows for configuration? With multiple rows I find it hard to do validations. I have run them conditionally on key, also dependend validations are hard. Also frontend has to make lots of PUT requests. Senior dev and other dev agreed that it is better to go multiple rows. They use eval too. Senior said that dependency can be solved by adding ancestry gem and this way we can check.
[18:18:25] Terens: All configurations are STI about 20 models now
[18:19:59] Terens: darix good point
[18:22:53] darix: terens: although I think where(key: 'holidays') if sla_active?
[18:22:58] darix: would be better in that case
[18:32:32] Terens: they want a single record although this defeats the purpose of scopes
[18:32:38] Terens: not chainable
[18:33:19] darix: then you could just define a method on the class
[18:33:55] clemens3_: has joined #ruby
[18:34:32] zachk: has joined #ruby
[18:40:02] Devalo: has joined #ruby
[18:40:07] claudiuinberlin: has joined #ruby
[18:42:01] reber: has joined #ruby
[18:45:32] sgen: has joined #ruby
[18:55:34] Dbugger: has joined #ruby
[18:55:41] stryek: has joined #ruby
[19:21:10] _whitelogger: has joined #ruby
[19:31:31] Tau: has joined #ruby
[19:35:49] duderonomy: has joined #ruby
[19:39:57] Swyper: has joined #ruby
[19:40:34] [Butch]: has joined #ruby
[19:42:47] bambanx: has joined #ruby
[19:48:41] zachk: has joined #ruby
[19:55:12] i1nfusion1: has joined #ruby
[19:55:28] SeepingN: has joined #ruby
[19:55:38] funnel: has joined #ruby
[20:13:48] orbyt_: has joined #ruby
[20:15:16] r3m: has joined #ruby
[20:17:10] themsay: has joined #ruby
[20:17:33] zleap: has joined #ruby
[20:19:17] alem0lars: has joined #ruby
[20:20:09] cd: has joined #ruby
[20:22:59] dviola: has joined #ruby
[20:38:11] Renich_: has joined #ruby
[20:46:39] Fernando-Basso: has joined #ruby
[20:48:41] Renich: has joined #ruby
[20:54:12] Renich: has joined #ruby
[20:57:31] Fusl: has joined #ruby
[20:58:50] Alison`: has joined #ruby
[21:02:51] Devalo: has joined #ruby
[21:10:55] totallyserious: has joined #ruby
[21:11:08] orbyt_: has joined #ruby
[21:12:18] totallyserious: Hey everyone, I am a beginner to ruby and I am trying to figure out what is the best way to install this: https://gist.github.com/vincentwhales/b09c24cbcafb0cc8f57fa90bd916517f
[21:15:42] Zarthus: totallyserious: if you read the comments it'll tell you
[21:17:29] cd: has joined #ruby
[21:27:37] Devalo: has joined #ruby
[21:28:59] sgen: has joined #ruby
[21:39:46] orbyt_: has joined #ruby
[21:52:53] Devalo: has joined #ruby
[21:53:02] zapata: has joined #ruby
[21:59:50] Swyper: has joined #ruby
[22:10:54] code_zombie: has joined #ruby
[22:18:17] rafadc: has joined #ruby
[22:18:47] totallyserious: has joined #ruby
[22:19:16] havenwood: totallyserious: Have you installed Ruby? Which version?
[22:43:39] GodFather: has joined #ruby
[22:46:38] houhoulis: has joined #ruby
[22:48:45] Deesl: has joined #ruby
[22:51:29] eblip: has joined #ruby
[23:02:29] venmx: has joined #ruby
[23:03:25] brool: has joined #ruby
[23:04:17] Swyper: has joined #ruby
[23:11:31] Nicmavr: has joined #ruby
[23:23:26] IGnorAND: I'm trying to run some tests, but they take absurdly long for simple tests. https://pastebin.com/SCr8RRJ9 Is 7 seconds normal or am I exagerating?
[23:23:27] ruby[bot]: IGnorAND: 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
[23:28:31] clemens3: has joined #ruby
[23:30:10] dar123: has joined #ruby
[23:32:58] Swyper: has joined #ruby
[23:39:56] phaul: &fake Hacker.say_something_smart
[23:39:57] rubydoc: You can't parse the pixel without programming the primary IB feed!
[23:41:21] phaul: after quick google it turns out IB feed is something to do with fish and or India.
[23:47:12] AJA4350: has joined #ruby
[23:52:14] havenwood: IGnorAND: That _is_ absurdly long.
[23:52:20] bmurt: has joined #ruby
[23:52:29] havenwood: "files took 5.51 seconds to load"
[23:52:52] IGnorAND: havenwood: okay, thanks. so that's my hardware or is it my rails_helper?
[23:57:34] teej: has joined #ruby
[23:59:36] orbyt_: has joined #ruby