« Back to channel list

#ruby - 01 May 2019

« Back 1 day Forward 1 day »
[00:06:52] skryking_: has joined #ruby
[00:37:19] Swyper: has joined #ruby
[00:45:20] jenrzzz: has joined #ruby
[01:12:00] jelera: has joined #ruby
[01:22:27] dsmythe: has joined #ruby
[01:25:13] fphilipe: has joined #ruby
[01:28:11] MuffinPimp: has joined #ruby
[01:29:39] orbyt_: has joined #ruby
[01:32:48] dsmythe_: has joined #ruby
[01:39:55] duderonomy: has joined #ruby
[01:48:25] jmcgnh: has joined #ruby
[01:49:10] Swyper: has joined #ruby
[02:11:22] skryking: has joined #ruby
[02:15:35] ramfjord: has joined #ruby
[02:22:29] marmotini_: has joined #ruby
[02:25:36] Inline: has joined #ruby
[02:55:41] jmcgnh: has joined #ruby
[03:01:48] zacts: has joined #ruby
[03:08:05] dar123: has joined #ruby
[03:10:17] braincrash: has joined #ruby
[03:10:31] ricekrispie2: has joined #ruby
[03:17:05] gix-: has joined #ruby
[03:20:18] uranoss: has joined #ruby
[03:22:46] TvL2386: has joined #ruby
[03:27:54] zephiro: has joined #ruby
[03:31:40] marmotini_: has joined #ruby
[03:33:50] jenrzzz: has joined #ruby
[03:42:53] abaiste^: has joined #ruby
[03:52:05] evdubs: has joined #ruby
[04:04:10] OneNeptune: has joined #ruby
[04:05:25] FastJack: has joined #ruby
[04:21:57] dsmythe: has joined #ruby
[04:28:45] Tempesta: has joined #ruby
[04:31:19] zacts: has joined #ruby
[04:33:30] laaron: has joined #ruby
[04:34:23] jenrzzz: has joined #ruby
[04:41:54] jenrzzz: has joined #ruby
[04:43:47] dar123: has joined #ruby
[04:59:32] ramfjord: has joined #ruby
[05:02:02] jcarl43: has joined #ruby
[05:10:43] sauvin: has joined #ruby
[05:16:39] reber: has joined #ruby
[05:19:35] Swyper: has joined #ruby
[05:52:00] ricekrispie: has joined #ruby
[06:06:10] duderonomy: has joined #ruby
[06:08:24] jenrzzz: has joined #ruby
[06:20:31] dsmythe: has joined #ruby
[06:24:25] dellavg_: has joined #ruby
[06:25:20] Swyper: has joined #ruby
[06:34:20] fphilipe: has joined #ruby
[06:44:50] yxhuvud: has joined #ruby
[06:56:10] alem0lars: has joined #ruby
[06:59:45] ramfjord: has joined #ruby
[07:05:06] Davey: has joined #ruby
[07:05:18] Davey: has joined #ruby
[07:05:50] jenrzzz: has joined #ruby
[07:06:41] ricekrispie2: has joined #ruby
[07:10:11] wildermind: has joined #ruby
[07:19:56] lel: has joined #ruby
[07:29:05] lxsameer: has joined #ruby
[07:30:07] nowhere_man: has joined #ruby
[07:56:26] suukim: has joined #ruby
[07:57:26] harmaahylje: has left #ruby: ()
[08:10:10] mikecmpbll: has joined #ruby
[08:10:29] buckworst: has joined #ruby
[08:13:03] hightower3: has joined #ruby
[08:16:11] waheedi: has joined #ruby
[08:20:30] alem0lars: has joined #ruby
[08:29:22] reber: has joined #ruby
[08:35:02] conta: has joined #ruby
[08:39:45] mikecmpbll: has joined #ruby
[08:43:43] jenrzzz: has joined #ruby
[08:44:22] marmotini: has joined #ruby
[09:03:59] ur5us: has joined #ruby
[09:09:11] fphilipe: has joined #ruby
[09:18:16] dsmythe: has joined #ruby
[09:30:33] m_antis: has joined #ruby
[09:38:15] sh7d: has joined #ruby
[09:46:11] mniip: has joined #ruby
[09:52:27] fphilipe: has joined #ruby
[09:57:21] ramfjord: has joined #ruby
[09:59:43] flips: Heh, dashboard prompted me to install versionupgrade ... But FreePBX 15 is still alpha ... I guess I'll just wait a bit longer ... ;)
[10:04:38] syndikate: Can help me understand what I am missing in this simple unix program?
[10:04:39] syndikate: https://paste.ee/p/gUImo
[10:05:24] syndikate: I start the programs, takes an input in parent and sends to worker. But in worker I am not able to receive it
[10:05:32] syndikate: It just gets stuck there
[10:12:11] _whitelogger: has joined #ruby
[10:12:35] flips: has left #ruby: ("bbl")
[10:16:34] AJA4350: has joined #ruby
[10:21:29] syndikate: Nvm guys, fixed it :D
[10:24:38] evdubs: has joined #ruby
[10:34:05] jenrzzz: has joined #ruby
[10:39:14] jenrzzz: has joined #ruby
[10:39:37] Guest14: has joined #ruby
[10:41:58] fphilipe: has joined #ruby
[10:46:55] laaron: has joined #ruby
[11:09:58] Cthulu201: has joined #ruby
[11:16:14] Jonopoly: has joined #ruby
[11:19:57] jenrzzz: has joined #ruby
[11:24:57] kyrylo: has joined #ruby
[11:25:49] hightower3: has joined #ruby
[11:31:26] bmurt: has joined #ruby
[11:37:47] Dbugger: has joined #ruby
[11:46:11] Guest14: has joined #ruby
[11:49:18] altigraph: has joined #ruby
[11:58:16] marmotini_: has joined #ruby
[12:02:54] alem0lars: has joined #ruby
[12:06:30] Fernando-Basso: has joined #ruby
[12:10:22] laaron: has joined #ruby
[12:30:35] waheedi: has joined #ruby
[12:31:49] tuor: has joined #ruby
[12:34:02] laaron: has joined #ruby
[12:35:41] conspyone: has joined #ruby
[12:37:35] fphilipe: has joined #ruby
[12:42:40] segy: has joined #ruby
[12:44:35] buckworst: has joined #ruby
[12:59:36] aither: has joined #ruby
[13:00:48] bmurt: has joined #ruby
[13:03:01] dsmythe: has joined #ruby
[13:27:12] zacts: has joined #ruby
[13:32:26] lucasb: has joined #ruby
[13:33:41] pupsikov: has joined #ruby
[13:35:55] ua: has joined #ruby
[13:38:14] jenrzzz: has joined #ruby
[13:42:06] fphilipe: has joined #ruby
[13:45:11] OneNeptune: has joined #ruby
[13:55:16] pwnd_nsfw: has joined #ruby
[14:15:23] zacts: has joined #ruby
[14:19:09] zacts: has joined #ruby
[14:33:06] Rakete1111: has joined #ruby
[14:35:56] Rakete1111: hello all. I'm a ruby beginner and I'm trying to resolve an issue I've been having with the mail gem. Can someone please try to reproduce my problem, as that would be really helpful to see if it is not a problem with my environment or not.
[14:35:59] SeepingN: has joined #ruby
[14:36:00] Rakete1111: https://github.com/mikel/mail/issues/1335
[14:36:31] Rakete1111: seems to be an encoding problem somewhere inside mail where parts of the email are not recognized
[14:37:14] Rakete1111: I patched my version of mail by forcing conversion to UTF-8 and that works, but the non-ascii characters are dropped, as expected
[14:40:39] houhoulis: has joined #ruby
[14:41:10] thebigj: has left #ruby: ()
[14:45:54] skryking_: has joined #ruby
[14:47:04] bmurt: has joined #ruby
[14:48:33] adam12: Rakete1111: Did we talk about this a few days ago? I'm having deja-vu
[14:48:34] fphilipe: has joined #ruby
[14:51:37] Rakete1111: adam12: yes :)
[14:51:51] Rakete1111: you're right
[14:52:25] adam12: Rakete1111: I reproduced your issue. With characters the result is nil. Without the characters, I get a Mail::Part object back.
[14:52:34] Rakete1111: thank you, that helps
[14:52:51] adam12: LANG=en_US.UTF-8
[14:52:53] adam12: LC_CTYPE="en_US.UTF-8"
[14:52:55] adam12: LC_COLLATE=C
[14:53:02] Rakete1111: that is interesting though, because I would have thought that the content of the body is irrelevent when parsing the email
[14:53:25] Rakete1111: well my LANG is the same
[14:54:15] Rakete1111: take this: header_part, body_part = raw_source.encode('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '').lstrip.split(HEADER_SEPARATOR, 2)
[14:54:40] Rakete1111: without the "invalid" characters, this fails
[14:55:00] Rakete1111: but I read the email with :encoding => "UTF-8"
[14:55:03] Rakete1111: so it should be valid UTF8
[14:56:05] adam12: Rakete1111: I can't look at it now but since you've provided an example email I'll dig into it a bit later and see if there's something I can see.
[14:56:38] Rakete1111: I'll continue looking
[15:10:09] polishdub: has joined #ruby
[15:11:20] hiroaki: has joined #ruby
[15:15:33] zacts: has joined #ruby
[15:16:29] Rakete1121: has joined #ruby
[15:18:05] wget: has joined #ruby
[15:18:05] wget: has joined #ruby
[15:18:24] Rakete1121: has left #ruby: ()
[15:19:56] Rakete1111: has joined #ruby
[15:22:03] zacts: has joined #ruby
[15:23:37] zacts|pi: has joined #ruby
[15:30:56] VSpike: has joined #ruby
[15:38:53] Swyper: has joined #ruby
[15:41:00] alem0lars: has joined #ruby
[15:48:12] OneNeptune: has joined #ruby
[15:54:00] VSpike: Hi. How much of a problem is it to use a older version of a supported branch in production. e.g for 2.4.x, should anything less than 2.4.6 be considered deprecated?
[15:54:12] VSpike: Is it any worse or better than using a 2.3.x version, for example?
[15:54:50] VSpike: Are there scales of wrongness, where 2.4.0 is awful (2.5 years old!) but 2.4.5 is meh?
[15:58:00] ramfjord: has joined #ruby
[16:00:20] adam12: VSpike: If you have to run a non-current version, you're obviously best to run the latest of that minor. The patches will usually switch from bug fixes to security fixes.
[16:00:43] adam12: VSpike: I don't think there's any hard and fast rule, and you could look at 2.4.6 and 2.4.5 and go meh, 2.4.5 is sufficient.
[16:00:50] Swyper: has joined #ruby
[16:01:14] wald0: has joined #ruby
[16:02:18] Rakete1111: ignore me lol :)
[16:13:55] jenrzzz: has joined #ruby
[16:26:08] cthulchu: has joined #ruby
[16:36:34] houhoulis: has joined #ruby
[16:39:08] krawchyk: has joined #ruby
[16:43:40] sean_s: has joined #ruby
[16:45:03] jcarl43: has joined #ruby
[16:45:20] ramfjord: has joined #ruby
[16:53:34] ltem: has joined #ruby
[16:53:47] houhoulis: has joined #ruby
[16:59:35] wget: has joined #ruby
[17:00:28] duderonomy: has joined #ruby
[17:01:54] AJA4351: has joined #ruby
[17:03:24] fphilipe: has joined #ruby
[17:03:44] wget: has joined #ruby
[17:06:47] zacts: has joined #ruby
[17:11:16] Eiam: heh im still deploying some projects on 2.1
[17:11:18] Eiam: fire and forget
[17:26:52] hiroaki: has joined #ruby
[17:27:20] m_antis: has joined #ruby
[17:36:26] yokel: has joined #ruby
[17:37:21] reber: has joined #ruby
[17:46:17] laaron: has joined #ruby
[17:52:17] hiroaki: has joined #ruby
[17:54:23] pupsikov: has joined #ruby
[17:56:32] ramfjord: has joined #ruby
[17:56:40] OneNeptune: has joined #ruby
[17:57:18] OneNeptune: has joined #ruby
[17:59:34] sgen: has joined #ruby
[18:03:11] sameerynho: has joined #ruby
[18:08:12] ramfjord: has joined #ruby
[18:16:21] hiroaki: has joined #ruby
[18:18:29] adam12: 2.6 has such goodness tho
[18:22:19] mikecmpbll: has joined #ruby
[18:29:48] hiroaki: has joined #ruby
[18:45:14] jenrzzz: has joined #ruby
[18:47:25] agent_white: has joined #ruby
[18:54:55] cd: has joined #ruby
[18:57:25] speakingcode: has joined #ruby
[19:04:36] clemens3_: has joined #ruby
[19:04:54] hiroaki: has joined #ruby
[19:06:50] laaron: has joined #ruby
[19:08:28] fishcooker: has joined #ruby
[19:13:15] fishcooker: im trying to install the ruby here but problem to signature problem vpaste.net/nr4ku
[19:13:23] fishcooker: has left #ruby: ()
[19:13:57] ule: Do you guys know if there is a method that transform this: {a:1}to: { [{a:1},{a:1},{a:1}] }
[19:14:28] ule: I'm not sure how to search by that. Clone? Multiply? Duplicate hash?
[19:15:31] phaul: &>> [{a: 1}] * 3
[19:15:32] rubydoc: # => [{:a=>1}, {:a=>1}, {:a=>1}] (https://carc.in/#/r/6tiq)
[19:16:12] AJA4351: has joined #ruby
[19:16:37] ule: phaul: dammit. The simples solution ever that I didn't even think about it. :P
[19:16:40] ule: Thank you very much!
[19:16:42] phaul: but with this kind of stuff you always have to be careful of what's deep cloned and whats the same object multiple times
[19:19:22] fishcooker: has joined #ruby
[19:20:06] fishcooker: sorry im disconnected im trying to install the ruby here but problem to signature problem vpaste.net/nr4ku
[19:21:34] phaul: no idea fishcooker sorry. Have you tried following the instructions in the error message?
[19:21:58] hiroaki: has joined #ruby
[19:25:22] phaul: &>> &>> x = [{a:1}] * 3; x[0][:b] = 2; x # ule
[19:25:23] rubydoc: stderr: -e:2: syntax error, unexpected & (https://carc.in/#/r/6tjy)
[19:25:30] phaul: &>> x = [{a:1}] * 3; x[0][:b] = 2; x # ule
[19:25:31] rubydoc: # => [{:a=>1, :b=>2}, {:a=>1, :b=>2}, {:a=>1, :b=>2}] (https://carc.in/#/r/6tjz)
[19:27:26] hiroaki: has joined #ruby
[19:29:58] ule: phaul: I'm working here to generate some dummy data through an API. If a specific parameter is set, the response will return some dummy data
[19:30:10] ule: That will be really handy
[19:30:32] phaul: &>> x = Array.new(3) { {a:1} }; x[0][:b] = 2; x
[19:30:33] rubydoc: # => [{:a=>1, :b=>2}, {:a=>1}, {:a=>1}] (https://carc.in/#/r/6tkc)
[19:31:38] phaul: so just know the difference of these ^ two. as it can be really hard to debug if an object is referenced from multiple places of a program.
[19:32:21] phaul: multiple data structures rather
[19:32:23] fphilipe: has joined #ruby
[19:32:55] sgen: has joined #ruby
[19:33:22] ule: phaul: For most of the endpoints, I'm gonna generate seeds with dummy data.. but for some endpoints that basically returns data from external data sources, I'm intercepting and "injecting" this dummy response
[19:33:46] ule: First time doing this kind of stuff. I'm kind of following my guts so far.. :/
[19:34:08] ule: But always with something telling me that this is a kind of code smell :D
[19:34:41] _joes_: has joined #ruby
[19:37:09] phaul: so in [a] * n you get an array of one *single* object n times, whereas Array.new(n) { a } gives an array of n objects each of wich initially equal to a. that's the main gotcha with this
[19:38:34] fishcooker: checking... phaul
[19:39:47] wallace_mu: has joined #ruby
[19:42:00] _joes_: has joined #ruby
[19:42:25] tdy1: has joined #ruby
[19:43:36] spiette: has joined #ruby
[19:45:48] fishcooker: phaul: i have done with the curl commands but still https://dpaste.de/o6fO
[19:46:22] fishcooker: but i think the rvm still not installed
[19:47:47] phaul: hopefully someone with RVM knowledge comes along...
[19:48:38] nowhere_man: has joined #ruby
[19:51:16] hiroaki: has joined #ruby
[19:58:20] fishcooker: rvm is ruby version manager
[19:59:40] ramfjord: has joined #ruby
[20:00:03] fishcooker: how about installing not stable one phaul?
[20:01:13] dsmythe: has joined #ruby
[20:01:47] phaul: zenspider: rvm. we need you ! :)
[20:01:59] zenspider: I don't use rvm, but I might be able to answer questions
[20:02:02] jenrzzz: has joined #ruby
[20:02:39] zenspider: the dpaste?
[20:08:15] zenspider: I see some stuff about gpg. *shrug* Do the thing it says?
[20:08:28] zenspider: or use rbenv. This is not a problem I have or want to have.
[20:19:35] fphilipe: has joined #ruby
[20:19:44] zenspider: it looks like fishcooker is pretty unresponsive... so... yeah.
[20:19:58] jenrzzz: has joined #ruby
[20:26:16] _joes_: has joined #ruby
[20:29:04] krawchyk: has joined #ruby
[20:32:28] dinfuehr_: has joined #ruby
[20:34:16] _joes_: has joined #ruby
[20:43:29] fphilipe: has joined #ruby
[20:48:49] OneNeptune: has joined #ruby
[20:50:27] ur5us: has joined #ruby
[20:50:38] SeepingN: has joined #ruby
[20:52:34] hightower3: has joined #ruby
[20:53:24] hightower3: has joined #ruby
[20:59:16] tdy: has joined #ruby
[21:10:23] cjohnson: has joined #ruby
[21:10:52] cjohnson: Is there a method that returns the first *return value* of the given block that isn't false or nil or something?
[21:11:04] cnsvc: has joined #ruby
[21:11:33] cjohnson: Basically I have a list of values, I want to do a transform on the value but I want to stop at the first return that matches a condition
[21:12:20] cjohnson: A list of secret objects, and I want to call authenticator.authenticate(secret) against each secret, and stop checking additional secrets after I find one where authenticator.authenticate doesn't return false
[21:12:27] cjohnson: I can make it return nil or something else if that helps
[21:12:28] adam12: cjohnson: Like Enumerable#find ?
[21:12:38] cjohnson: Yes except that find returns the original value
[21:12:45] cjohnson: I want to return the transformed value
[21:13:07] cjohnson: I might have to write *gasp* a loop
[21:13:11] cjohnson: with a break
[21:14:24] cjohnson: Oh wait you can break in find and it'll return the break
[21:14:24] tdy1: has joined #ruby
[21:17:26] cjohnson: nice that's exactly what I needed
[21:17:33] cjohnson: p.find do |i|
[21:17:40] cjohnson: break transformed_value if i.condition
[21:18:16] phaul: how about p.map(&:transform_value).find(&:condition)
[21:19:04] phaul: ah. that checks condition on the mapped values
[21:20:34] phaul: p.find(&:condition)&.then(&:transform_value) ?
[21:21:50] phaul: &>> [1,2,3].find(&:even?)&.then { |x| x + 17 }
[21:21:51] rubydoc: # => 19 (https://carc.in/#/r/6tlx)
[21:23:38] kyrylo_: has joined #ruby
[21:35:24] jenrzzz: has joined #ruby
[21:37:48] VSpike: adam12: right, makes sense. But anything other than the latest release on the non-current series is going to have security flaws pretty much by definition
[21:38:02] VSpike: And the older it is, the more flaws it will have, presumably
[21:43:24] houhoulis: has joined #ruby
[21:46:51] _joes_: has joined #ruby
[21:47:47] dsmythe: has joined #ruby
[21:53:37] zacts: has joined #ruby
[21:54:57] sgen: has joined #ruby
[21:55:20] d^sh: has joined #ruby
[21:57:06] _joes_: has joined #ruby
[22:03:43] SeepingN_: has joined #ruby
[22:04:11] jenrzzz: has joined #ruby
[22:09:49] fphilipe: has joined #ruby
[22:11:19] SeepingN: has joined #ruby
[22:17:34] OneNeptune: has joined #ruby
[22:19:26] ltem: has joined #ruby
[22:19:48] Swyper: has joined #ruby
[22:20:28] speakingcode: has joined #ruby
[22:20:32] dsmythe: has joined #ruby
[22:20:45] cjohnson: phaul: the condition is on the transformed value
[22:20:56] cjohnson: and also that doesn't stop checking after the first match
[22:22:24] Caerus: has joined #ruby
[22:25:49] hightower2: has joined #ruby
[22:26:28] Swyper: has joined #ruby
[22:31:38] clemens3: has joined #ruby
[22:33:58] eduardo: has joined #ruby
[22:38:45] Swyper: has joined #ruby
[22:55:11] galaxie: has joined #ruby
[22:55:17] brendan-: has joined #ruby
[23:03:56] endorama: has joined #ruby
[23:08:23] weird_error: has joined #ruby
[23:25:21] al2o3-cr: has joined #ruby
[23:29:44] xco: has joined #ruby
[23:30:29] xco: Hi. I want to build my first gem. However I’m not sure if there’s anything special I need to do if I need my gem to be able to be used in Rails at the same time.
[23:31:25] xco: Question is if i build a generic gem for Ruby, is there anything extra I would do to make it useable in Rails; asking because the gem i want to build will use some API keys
[23:31:46] xco: in a Rails app you’d put this keys in say config/intializers/mygem.rb
[23:31:58] xco: but you won’t do this for a normal generic gem
[23:32:24] xco: how do i go about achieving this? building a gem that you can use with and without Rails?
[23:47:39] grvgr: has joined #ruby
[23:51:05] laaron: has joined #ruby