« Back to channel list

#ruby - 06 February 2019

« Back 1 day Forward 1 day »
[00:03:37] orbyt_: has joined #ruby
[00:03:46] cthu|: has joined #ruby
[00:06:55] cthulchu_: has joined #ruby
[00:17:49] AJA4351: has joined #ruby
[00:28:23] Eiam: has joined #ruby
[00:45:58] Blaguvest: has joined #ruby
[00:54:30] def_jam: has joined #ruby
[00:54:50] AJA4351: has joined #ruby
[00:55:26] eb0t_: has joined #ruby
[00:59:58] eb0t: has joined #ruby
[01:00:55] def_jam: has joined #ruby
[01:06:31] eb0t: has joined #ruby
[01:09:38] cd: has joined #ruby
[01:26:55] xall: has joined #ruby
[01:39:04] AJA4350: has joined #ruby
[01:50:22] orbyt_: has joined #ruby
[02:14:28] tdy: has joined #ruby
[02:31:13] asphyxia: has joined #ruby
[02:36:51] orbyt_: has joined #ruby
[02:42:47] AJA4351: has joined #ruby
[02:49:40] robscomputer: has joined #ruby
[02:52:22] xco: has joined #ruby
[02:55:21] duckpuppy: has joined #ruby
[03:08:07] cd: has joined #ruby
[03:14:49] arescorpio: has joined #ruby
[03:23:24] marmotini_: has joined #ruby
[03:36:15] Swyper: has joined #ruby
[03:37:56] volkov: has joined #ruby
[03:38:30] houhoulis: has joined #ruby
[03:58:23] kapil____: has joined #ruby
[04:00:45] Swyper: has joined #ruby
[04:03:54] ogres: has joined #ruby
[04:09:00] braincrash: has joined #ruby
[04:14:10] ellcs: has joined #ruby
[04:22:00] v01d4lph4: has joined #ruby
[04:30:11] _whitelogger: has joined #ruby
[04:38:48] v01d4lph4: has joined #ruby
[04:39:54] v01d4lph4: has joined #ruby
[04:48:34] ellcs: has joined #ruby
[05:10:23] dellavg__: has joined #ruby
[05:15:01] \void: has joined #ruby
[05:21:59] Azure: has joined #ruby
[05:23:35] ghormoon: has joined #ruby
[05:33:10] _whitelogger: has joined #ruby
[05:50:52] SuperLag: has joined #ruby
[05:51:11] elcontrastador: has joined #ruby
[06:15:32] johnny56: has joined #ruby
[06:18:14] conta: has joined #ruby
[06:25:09] reber: has joined #ruby
[06:34:46] sauvin: has joined #ruby
[06:39:05] marmotini_: has joined #ruby
[06:41:41] moei: has joined #ruby
[06:44:52] orbyt_: has joined #ruby
[06:46:53] mcspud: has joined #ruby
[06:47:30] lunarkitty7: has joined #ruby
[06:55:45] ogres: has joined #ruby
[07:00:30] Renich: has joined #ruby
[07:01:37] Renich: has joined #ruby
[07:04:10] aufi: has joined #ruby
[07:06:21] hahuang6-: has joined #ruby
[07:07:07] dan64: has joined #ruby
[07:17:05] themsay: has joined #ruby
[07:18:44] za1b1tsu: has joined #ruby
[07:18:44] duderonomy: has joined #ruby
[07:23:40] aupadhye: has joined #ruby
[07:25:46] mangold: has joined #ruby
[07:32:12] Renich: has joined #ruby
[07:39:57] clemens3: has joined #ruby
[07:54:58] kapil____: has joined #ruby
[07:57:36] apparition: has joined #ruby
[08:08:53] mangold: has joined #ruby
[08:09:21] status402: has joined #ruby
[08:13:28] clemens3: has joined #ruby
[08:18:35] Renich: has joined #ruby
[08:21:16] duderonomy: has joined #ruby
[08:25:05] status402_: has joined #ruby
[08:31:12] Sylario: has joined #ruby
[08:40:31] mangold: has joined #ruby
[08:46:59] BH23: has joined #ruby
[08:47:10] wildermind: has joined #ruby
[09:04:51] jmcgnh: has joined #ruby
[09:17:45] FastJack: has joined #ruby
[09:22:18] ep4sh2k: has joined #ruby
[09:23:17] ep4sh2k: hi friends! Could some body help with ruby: https://paste.ubuntu.com/p/7nQDBhR8Vr/ When i start Logstash it crashes :(
[09:23:23] ep4sh2k: What is wrong?
[09:26:32] ep4sh2k: if i comment this code - status Ok
[09:27:26] TvL2386: doesn't logstash print anything useful?
[09:28:24] TvL2386: I can see double quotes to encapsulate your ruby code, but in the code you use double quotes as well... I'd at least change "::" to '::'
[09:29:00] TvL2386: and I think the \s*? is also weird in the regexp
[09:29:14] TvL2386: but that may be me, I'm no regexp guru
[09:29:53] canton7: TvL2386, that's "whitespace zero or more times, non-greedy match"
[09:30:09] TvL2386: canton7: ah ack! ty
[09:30:17] pierrethierry: has joined #ruby
[09:30:17] canton7: granted the '?' isn't needed in this case
[09:30:25] TvL2386: I also think field.strip! || field is weird
[09:30:48] ep4sh2k: enought just field.strip, right?
[09:31:30] TvL2386: I take that back, I thought strip! always returned nil, but that's not true
[09:32:22] lunarkitty7: has joined #ruby
[09:32:48] TvL2386: I think your double quotes in the ruby code confuse logstash, since the ruby code stops at the first " and logstash configuration syntax continues afterwards and doesn't like the ::"
[09:34:01] xco: has joined #ruby
[09:34:36] pierrethierry: has joined #ruby
[09:34:53] ep4sh2k: Thanks i will try it
[09:36:14] helpa: has joined #ruby
[09:36:44] helpa: has joined #ruby
[09:39:41] lunarkitty7: has joined #ruby
[09:44:15] Guest16678: has joined #ruby
[09:44:38] ep4sh2k: my config and raising error: https://paste.ubuntu.com/p/PWzCx38xJF/
[09:44:38] ep4sh2k: but i cant determine where is specified line and column in code (with error)
[09:45:03] Nicmavr: has joined #ruby
[09:45:05] ep4sh2k: if i just comment ruby code - logstash starts fine
[09:50:32] xall: has joined #ruby
[09:53:23] nowhere_man: has joined #ruby
[09:56:59] ellcs: has joined #ruby
[10:08:45] roshanavand: has joined #ruby
[10:15:35] AJA4350: has joined #ruby
[10:17:54] mikecmpbll: has joined #ruby
[10:28:29] madhatter: has joined #ruby
[10:36:30] v01d4lph4: has joined #ruby
[10:37:46] v01d4lph4: has joined #ruby
[10:38:14] marmotini_: has joined #ruby
[10:38:43] v01d4lph4: has joined #ruby
[10:40:31] eb0t: has joined #ruby
[10:41:26] sauvin: has joined #ruby
[10:45:04] eb0t: has left #ruby: ()
[10:51:20] Bish: isn't there a do missing?
[10:51:43] Bish: well it seems to be optional
[10:51:53] Bish: for x in y do;...;end
[11:02:13] soyeomul^bionic: has joined #ruby
[11:05:49] Emmanuel_Chanel: has joined #ruby
[11:08:14] thinkpad: has joined #ruby
[11:11:38] Swyper: has joined #ruby
[11:17:26] dviola: has joined #ruby
[11:23:36] madhatter: has joined #ruby
[11:32:14] Dbugger: has joined #ruby
[11:32:54] conta: has joined #ruby
[11:35:04] pierrethierry: has joined #ruby
[11:38:56] ep4sh2k: yeah, it works! thanks!
[11:47:04] status402: has joined #ruby
[11:52:49] apparition: has joined #ruby
[11:53:47] Guest16678: has joined #ruby
[12:02:01] Guest16678: has joined #ruby
[12:03:39] BH23: has joined #ruby
[12:06:32] Hess: has joined #ruby
[12:06:52] Hess: has left #ruby: ()
[12:16:43] Guest16678: has joined #ruby
[12:24:34] jottr: has joined #ruby
[12:34:40] blackmesa: has joined #ruby
[12:41:03] segy: has joined #ruby
[12:54:43] Guest16678: has joined #ruby
[12:59:33] blackmesa: has joined #ruby
[13:00:36] Swyper: has joined #ruby
[13:13:09] old_relik: has joined #ruby
[13:14:02] old_relik: Is it idiomatic to memoize constants like this: APP_HOST ||= ENV.fetch('APP_HOST')
[13:14:51] lucasb: has joined #ruby
[13:16:33] phaul: for memoizing no. for conditionally setting it yes. but I would freeze it too
[13:17:35] phaul: depends on where that code is. if it only runs once then why not.
[13:17:52] old_relik: so it's technically a rails "concern"
[13:18:01] old_relik: and is under the "included" block
[13:18:13] old_relik: and hence gets loaded a few times (esp during tests)
[13:19:09] old_relik: and hence throws the re-assign warning
[13:19:28] phaul: then its not idiomatic
[13:19:44] phaul: especially with throwing warnings
[13:19:46] AJA4351: has joined #ruby
[13:20:03] old_relik: what would you recommend?
[13:20:15] phaul: variable.
[13:20:32] phaul: acessor. can live in the singleton class
[13:21:23] phaul: class Blah; class < self; attr_accessor :app_host; end; end
[13:21:54] dionysus69: I need to decode XDR envelope, I am unable to use this gem, it produces weird errors https://github.com/stellar/ruby-xdr the link to the the code http://paste.debian.net/1065634/
[13:22:21] phaul: old_relik: Blah.app_host ||= '...'
[13:22:24] dionysus69: I am sure the encoded message is correct, so far I was unable to find any other xdr library in ruby
[13:22:38] old_relik: oh like a self accessor
[13:22:53] old_relik: however this must sit in a module (rails concern)
[13:23:03] za1b1tsu: has joined #ruby
[13:25:02] phaul: old_relik: that's not a problem. Concerns are just dressed up modules, right?
[13:25:23] phaul: modules can have singleton classes
[13:26:06] phaul: but extend or include wont pick up the accessor, you would have to write Modulename.host_path
[13:27:29] thinkpad: has joined #ruby
[13:28:46] phaul: I guess you can put it in class_method { } block, if it works by included hook extending with a sub module. Then include would also pick up the accessor. I guess easyest is to try
[13:33:29] old_relik: so I just moved the constants from "included do" to out in the normal module scope
[13:33:33] old_relik: and it works
[13:33:44] old_relik: they are accessible in the included block
[13:34:30] old_relik: I'm not entirely sure why that worked though
[13:34:52] phaul: not sure without seeing your code, and its been a while Ive seen the concern implementation. I did this gist this works https://gist.github.com/107baa398e9f4ebe7533b728e5c1d312
[13:35:12] phaul: but your thing can also be correct.
[13:35:38] phaul: actually the result is 17 not 13 at the end
[13:36:04] old_relik: phaul: https://dpaste.de/vbKe
[13:36:18] old_relik: so that works
[13:36:51] old_relik: what I previously had was this: https://dpaste.de/eY7z
[13:36:55] old_relik: (which was throwing warnings)
[13:37:06] ua: has joined #ruby
[13:37:07] old_relik: [apologies if this is rails domain]
[13:37:13] phaul: yeah, but then it only runs once, when it's loaded. I thought it was a requirement to be able to assign multiple times
[13:37:32] phaul: anyways, if that works that's the right way
[13:37:37] old_relik: yeah, I might have not made that clear
[13:37:58] phaul: no worries
[13:37:59] old_relik: it's completely ok for it to be init'd once
[13:38:17] phaul: that's cool, then constant makes more sense than a var
[13:38:53] Emmanuel_Chanel: has joined #ruby
[13:43:23] gregf_: has joined #ruby
[13:48:10] _whitelogger: has joined #ruby
[13:49:30] pierrethierry: has joined #ruby
[13:55:15] blackmesa: has joined #ruby
[14:01:30] GinoMan: has joined #ruby
[14:03:35] rubydoc: has joined #ruby
[14:06:46] nowhereman: has joined #ruby
[14:12:05] fanta7531: has joined #ruby
[14:22:05] dinfuehr: has joined #ruby
[14:38:17] aupadhye: has joined #ruby
[14:44:34] pierrethierry: has joined #ruby
[14:52:32] Rapture: has joined #ruby
[14:59:03] polishdub: has joined #ruby
[14:59:44] cubillosxy_py: has joined #ruby
[15:01:10] rippa: has joined #ruby
[15:01:46] status402: has joined #ruby
[15:03:07] marmotini_: has joined #ruby
[15:04:33] status402_: has joined #ruby
[15:12:18] AJA4350: has joined #ruby
[15:14:25] Sirecote: has joined #ruby
[15:24:25] kapil____: has joined #ruby
[15:32:21] elcontrastador: has joined #ruby
[15:34:07] Inline: has joined #ruby
[15:34:14] jottr: has joined #ruby
[15:45:58] duderonomy: has joined #ruby
[15:48:04] galaxie: has joined #ruby
[15:48:55] galaxie: What's a good HTML templating engine that works in both Ruby and Lua and is cross-platform?
[15:49:22] galaxie: I mean, not necessarily HTML, but I am using Liquid so far.
[15:53:13] galaxie: Mustache would've been perfect except it's logic-less, as in, no if statements, for loops, etc.
[15:57:21] grvgr: has joined #ruby
[15:57:54] galaxie: Except it looks alpha quality for now this would work: https://github.com/jasonroelofs/late
[16:02:20] tdy: has joined #ruby
[16:07:28] galaxie: Hmmm, there appears to be a port of Liquid to Lua that's slightly different, I'll look into that.
[16:12:23] clemens3: has joined #ruby
[16:12:43] SuperLag: has joined #ruby
[16:15:17] Iambchop: dionysus69: "are you decoding the right xdr type?" how was that message encoded?
[16:15:17] Iambchop: https://www.stellar.org/laboratory/#xdr-viewer?input=AAAAAFugE4m5G6atiR3UnMAowKubzTCrhbm1uRXNXElbXnIIAAAAZAACv7oAA3rJAAAAAAAAAAEAAAAQVGVzdCBUcmFuc2FjdGlvbgAAAAEAAAAAAAAAAQAAAAAMF%2FX3w8lITxPE60OCt6GzPVeEL2IVmq5Cz6%2FggDlPZAAAAAFITlkAAAAAAJyzpxsbHjlm33tVyNgwYLBOw9%2B35z5yQ%2BeiqdRkBROZAAAAAEIpQYAAAAAAAAAAAVtecggAAABA2%2B8Zm43h9NEYi2ReXwK%2Bg9ZHLvjklferCHotyXg2Tv%2BjYfqgipPTfrwdRlvXDwMwLP0YhgMReJLLF80VcYVUAQ%3D%3D&type=Transactio
[16:15:17] Iambchop: nEnvelope&network=test
[16:18:53] AJA4351: has joined #ruby
[16:20:00] Silex: has joined #ruby
[16:30:28] arup_r: has joined #ruby
[16:35:18] ua: has joined #ruby
[16:38:56] jottr: has joined #ruby
[16:40:51] orbyt_: has joined #ruby
[16:42:45] dinfuehr: has joined #ruby
[16:46:15] v01d4lph4: has joined #ruby
[16:47:21] \void: has joined #ruby
[16:49:31] conta: has joined #ruby
[16:56:38] silent_freak: has joined #ruby
[17:12:47] skyikot: has joined #ruby
[17:14:24] aldodelgado: has joined #ruby
[17:16:58] BH23: has joined #ruby
[17:18:22] d10n-work: has joined #ruby
[17:24:45] akemot: has joined #ruby
[17:25:01] AJA4351: has joined #ruby
[17:36:55] Swyper: has joined #ruby
[17:37:49] [Butch]: has joined #ruby
[17:42:15] orbyt_: has joined #ruby
[17:42:29] themsay: has joined #ruby
[17:44:57] hiroaki: has joined #ruby
[17:47:24] Guest16678: has joined #ruby
[17:49:07] octos: has joined #ruby
[17:49:17] krawchyk: has joined #ruby
[17:49:55] marmotini_: has joined #ruby
[17:56:56] fanta7531: has joined #ruby
[17:58:37] marmotini_: has joined #ruby
[18:00:18] jobewan: has joined #ruby
[18:02:07] volkov: has joined #ruby
[18:02:21] aldodelgado: Question? Anyone know if the google+ API shutdown will effect people who are using googleauth to just login? I cant seem to find a straight answer. https://developers.google.com/+/integrations-shutdown
[18:02:37] aldodelgado: looks like the endpoints/scopes need to be updated. https://github.com/googleapis/google-auth-library-ruby
[18:04:22] valadares: has joined #ruby
[18:04:57] orbyt_: has joined #ruby
[18:11:45] marmotini_: has joined #ruby
[18:11:47] robscomputer: has joined #ruby
[18:12:59] marmotini: has joined #ruby
[18:14:23] robscomputer: has joined #ruby
[18:14:38] up|ime: i don't think google+ is their auth component?
[18:14:39] Xeago: has joined #ruby
[18:16:54] blackmesa: has joined #ruby
[18:17:51] aldodelgado: https://github.com/googleapis/google-auth-library-ruby/blob/edaa784d3de1f35fc6bc7de31302858a1e7b78c5/lib/googleauth/scope_util.rb
[18:21:27] valadares: has joined #ruby
[18:27:17] v01d4lph4: has joined #ruby
[18:38:39] v01d4lph4: has joined #ruby
[18:39:09] code_zombie: has joined #ruby
[18:41:04] reber: has joined #ruby
[18:46:36] d^sh: has joined #ruby
[19:01:24] marmotini: has joined #ruby
[19:04:23] rippa: has joined #ruby
[19:07:20] dviola: has joined #ruby
[19:24:17] v01d4lph4: has joined #ruby
[19:37:55] AJA4350: has joined #ruby
[19:40:03] spacesuitdiver: has joined #ruby
[19:43:55] blackmesa: has joined #ruby
[19:47:41] gix: has joined #ruby
[19:52:29] jobewan: has joined #ruby
[19:57:38] Swyper: has joined #ruby
[20:08:41] agent_white: has joined #ruby
[20:11:24] SeepingN: has joined #ruby
[20:15:20] AJA4351: has joined #ruby
[20:19:32] octos: has joined #ruby
[20:20:37] gaussblurinc1: has joined #ruby
[20:20:51] phaul: gaussblurinc1: hi
[20:21:05] gaussblurinc1: is it possible to pass block as a last parameter to an operator with one extra parameter.
[20:21:27] gaussblurinc1: Example: def > (a, &b); end
[20:22:23] baweaver: Why would you?
[20:22:30] baweaver: What's the use case?
[20:24:20] phaul: &>> x = Object.new; def x.>(a, &b); p self: self, a: a; b.call; end; x > s { puts ' hello' }
[20:24:22] rubydoc: # => undefined method `s' for main:Object (NoMethodError) (https://carc.in/#/r/66rd)
[20:24:28] gaussblurinc1: a | b | c {|value| value}
[20:24:40] phaul: &>> x = Object.new; def x.>(a, &b); p self: self, a: a; b.call; end; x > x { puts ' hello' }
[20:24:41] rubydoc: # => undefined method `x' for main:Object (NoMethodError) (https://carc.in/#/r/66re)
[20:24:44] baweaver: Just use `then`
[20:24:59] gaussblurinc1: baweaver: custom objects + dsl
[20:25:13] Nicmavr: has joined #ruby
[20:25:18] baweaver: Trying to be too clever in DSLs tends to be hard to test and maintain
[20:25:35] baweaver: and functional piping isn't really necessary anymore, we have << and >> for composition in 2.6
[20:26:01] gaussblurinc1: baweaver: could you share a link?
[20:26:07] phaul: &>> x = Object.new; def x.>(a, &b); p self: self, a: a; b.call; end; x.>(x) { puts ' hello' }
[20:26:08] rubydoc: # => {:self=>#<Object:0x000055690aff1a68>, :a=>#<Object:0x000055690aff1a68>} (https://carc.in/#/r/66rf)
[20:26:19] baweaver: You're thinking about it backwards.
[20:26:34] baweaver: a | b | c { ... }
[20:27:02] baweaver: a, b, and c are all entities. | is an operator that works on those entities. The clock doesn't belong to |, it belongs to c
[20:28:13] baweaver: &>> adds = -> x { -> y { x + y } }; multiplies = -> x { -> y { x * y } }; [1, 2, 3].map(&adds[1] >> multiplies[5])
[20:28:13] rubydoc: # => [10, 15, 20] (https://carc.in/#/r/66rg)
[20:28:30] baweaver: << composes in the other direction
[20:28:35] baweaver: &>> adds = -> x { -> y { x + y } }; multiplies = -> x { -> y { x * y } }; [1, 2, 3].map(&adds[1] << multiplies[5])
[20:28:35] rubydoc: # => [6, 11, 16] (https://carc.in/#/r/66rh)
[20:28:41] kapil____: has joined #ruby
[20:29:00] phaul: yeah, as baweaver says it. technically it's possible though, as demonstrated.
[20:29:02] baweaver: which is more accurately what people mean with `compose` in functional languages.
[20:29:28] baweaver: It's less of "Can Ruby do X" than "Should you be doing X?"
[20:29:51] phaul: sure. I was curius myself what it will do tbh :)
[20:29:51] gaussblurinc1: phaul: thanks! parentheses are the keys
[20:30:00] za1b1tsu: has joined #ruby
[20:30:13] baweaver: Though I'm 95% they just ignored that
[20:30:27] phaul: gaussblurinc1: as baweaver says it works but you shouldn't do it
[20:30:31] baweaver: which is why often times I don't show how it's done
[20:31:02] baweaver: The reason the parens are needed is the difference between `{ ... }` blocks and `do ... end` blocks
[20:31:22] baweaver: The former creates ambiguity for the parser between that and a hash / kw param
[20:32:03] baweaver: It's the same reason you can't do this in RSpec: `let :value { ... }`
[20:32:44] gaussblurinc1: baweaver: even when I pass parameters names to a block?
[20:32:57] baweaver: Give it a try in a REPL
[20:35:31] gaussblurinc1: baweaver: it dies at curly bracer even with named parameter in block
[20:35:56] baweaver: Figured, didn't remember.
[20:36:04] gaussblurinc1: ah, wait, ruby version 2.4.1
[20:36:17] baweaver: REPLs are great for answering questions and experimenting.
[20:39:19] thinkpad: has joined #ruby
[20:48:56] lxsameer: has joined #ruby
[20:50:00] houhoulis: has joined #ruby
[20:51:53] AJA4350: has joined #ruby
[21:04:04] orbyt_: has joined #ruby
[21:20:03] cnsvc: has joined #ruby
[21:22:00] Frem: has joined #ruby
[21:22:02] darix: <3 binding.pry or binding.irb
[21:22:11] tdy: has joined #ruby
[21:29:01] Eiam: pry changed the way I debug ruby =)
[21:29:36] Eiam: these days I write most of my code INSIDE a halted pry session, then pop it back into the file
[21:29:39] Eiam: sad but true
[21:32:01] r29v: has joined #ruby
[21:35:42] SeepingN: I do that in irb/console but haven't bothered dealing with pry
[21:38:27] Eiam: I halt right where the new code would go so it operates in the right context
[21:38:35] Eiam: state is 'as it should be' when its running
[21:56:05] robscomputer: has joined #ruby
[22:04:06] robscomputer: has joined #ruby
[22:12:56] tdy: has joined #ruby
[22:28:39] blackmesa: has joined #ruby
[22:28:56] al2o3-cr: baweaver: curry dude!
[22:29:24] perique: has joined #ruby
[22:34:07] Fusl: has joined #ruby
[22:43:41] leah2: did ARGF.lineno reset at some point? it doesnt seem to anymore
[22:44:56] tde: has joined #ruby
[22:45:13] leah2: hm not in 1.9.3 either
[22:46:09] leah2: oh duh, ARGF.file.lineno
[22:46:46] robscomputer: has joined #ruby
[22:47:37] nowhereman: has joined #ruby
[22:48:52] tde: has joined #ruby
[23:13:07] AJA4350: has joined #ruby
[23:13:31] r29v: has joined #ruby
[23:20:19] bruul: has joined #ruby
[23:24:25] cd: has joined #ruby
[23:32:05] Emmanuel_Chanel: has joined #ruby