« Back to channel list

#ruby - 21 April 2019

« Back 1 day Forward 1 day »
[00:05:37] kyrylo: has joined #ruby
[00:06:26] samort7: has joined #ruby
[00:07:07] AJA4351: has joined #ruby
[00:12:00] fphilipe: has joined #ruby
[00:12:53] jottr: has joined #ruby
[00:15:35] wallace_mu: has joined #ruby
[00:30:11] _whitelogger: has joined #ruby
[00:32:43] quarters: hello. I was wondering if anyone can advise on how to debug specs with vs code's debugger
[00:36:04] wallace_mu: has joined #ruby
[00:37:44] wallace_mu: has joined #ruby
[00:40:35] wallace__: has joined #ruby
[00:44:00] tdy: has joined #ruby
[00:49:21] donofrio_: has joined #ruby
[00:52:39] fphilipe: has joined #ruby
[01:14:58] pupsikov: has joined #ruby
[01:15:57] wallace_mu: has joined #ruby
[01:21:10] _whitelogger: has joined #ruby
[01:25:50] dsmythe: has joined #ruby
[01:38:41] jottr: has joined #ruby
[01:40:34] donofrio: has joined #ruby
[01:58:23] uplime96: has joined #ruby
[02:20:42] tdy: has joined #ruby
[02:49:58] duderonomy: has joined #ruby
[03:00:00] Axsuul: has joined #ruby
[03:05:04] jottr: has joined #ruby
[03:10:34] braincrash: has joined #ruby
[03:22:24] hightower3: has joined #ruby
[03:22:47] fphilipe: has joined #ruby
[03:37:41] hightower3: has joined #ruby
[03:43:10] jottr: has joined #ruby
[04:02:56] duderonomy: has joined #ruby
[04:08:59] wallace_mu: has joined #ruby
[04:10:54] rippa: has joined #ruby
[04:13:24] apparition: has joined #ruby
[04:22:16] bambanx: has joined #ruby
[04:29:21] fphilipe: has joined #ruby
[04:33:04] laaron: has joined #ruby
[04:39:44] jottr: has joined #ruby
[04:51:10] _whitelogger: has joined #ruby
[04:51:21] mangold: has joined #ruby
[05:16:32] stoller: has joined #ruby
[05:19:19] crankharder: has joined #ruby
[05:20:20] jottr: has joined #ruby
[05:47:28] mozzarella: has joined #ruby
[06:00:41] jottr: has joined #ruby
[06:12:58] Alison`: has joined #ruby
[06:15:55] dsmythe: has joined #ruby
[06:24:04] schleppel: has joined #ruby
[06:27:14] DmitryBochkarev: has joined #ruby
[06:31:13] cd: has joined #ruby
[06:32:25] mozzarella: has joined #ruby
[06:49:27] Deesl: has joined #ruby
[06:59:53] fphilipe: has joined #ruby
[07:06:54] kapil____: has joined #ruby
[07:16:53] duderonomy: has joined #ruby
[07:22:01] duckpupp-: has joined #ruby
[07:23:00] conta: has joined #ruby
[07:23:17] wallace_mu: has joined #ruby
[07:24:54] lomex: has joined #ruby
[07:33:00] conta: has joined #ruby
[07:49:54] bokwoon: has joined #ruby
[07:55:54] wallace_mu: has joined #ruby
[07:58:06] jefffrails35: has joined #ruby
[08:07:36] hightower3: has joined #ruby
[08:13:13] vrih: has joined #ruby
[08:21:21] sameerynho: has joined #ruby
[08:33:26] lomex: has joined #ruby
[08:38:30] reber: has joined #ruby
[08:50:47] Dbugger: has joined #ruby
[08:58:13] kyrylo: has joined #ruby
[08:59:58] fphilipe: has joined #ruby
[09:01:12] dhollinger: has joined #ruby
[09:03:34] vrih: has joined #ruby
[09:16:37] clemens3_: has joined #ruby
[09:16:38] uranoss: has joined #ruby
[09:20:24] nowhere_man: has joined #ruby
[09:22:52] vrih: has joined #ruby
[09:42:28] laaron: has joined #ruby
[09:43:21] znz_jp: has joined #ruby
[09:46:14] laaron: has joined #ruby
[09:54:50] Puffball: has joined #ruby
[09:56:53] DTZUZO: has joined #ruby
[10:15:40] jottr: has joined #ruby
[10:19:26] Azure: has joined #ruby
[10:27:37] DTZUZO: has joined #ruby
[10:30:29] layer: has joined #ruby
[10:34:38] fphilipe: has joined #ruby
[10:39:57] laaron: has joined #ruby
[10:40:36] hightower3: has joined #ruby
[10:46:04] Fernando-Basso: has joined #ruby
[11:00:12] _whitelogger: has joined #ruby
[11:29:28] AJA4350: has joined #ruby
[11:44:57] ricekrispie2: has joined #ruby
[12:22:47] AKPWD: has joined #ruby
[12:26:12] al2o3-cr: has joined #ruby
[12:28:38] fphilipe_: has joined #ruby
[12:28:50] psmolen: has joined #ruby
[12:59:51] lomex: has joined #ruby
[13:07:46] fphilipe_: has joined #ruby
[13:16:14] clemens3_: has joined #ruby
[13:18:00] Bob8989|2: has joined #ruby
[13:35:20] laaron: has joined #ruby
[13:40:34] ellcs: has joined #ruby
[13:41:04] ellcs: has joined #ruby
[13:41:37] ellcs: has joined #ruby
[13:42:24] ellcs: has joined #ruby
[13:43:07] ellcs: has joined #ruby
[14:04:46] mozzarella: has joined #ruby
[14:18:32] wallace_mu: has joined #ruby
[14:44:34] tdy: has joined #ruby
[14:49:46] Swyper: has joined #ruby
[15:22:37] Rakete1111: has joined #ruby
[15:23:07] Rakete1111: hello I have a question about the Mail gem. Is this the appropriate channel to ask?
[15:23:58] DmitryBochkarev: has joined #ruby
[15:24:47] adam12: Rakete1111: Just ask. If someone knows the answer then they'll chime in. I can't think of any better channel, tbh.
[15:25:54] Swyper: has joined #ruby
[15:25:55] Rakete1111: Mail.read("/path/to/file").text_part is Nil but if I do `s = File.read("/path/to/file")` and then `Mail.new(s).text_part` it works.
[15:26:03] Rakete1111: I looked at the docs (https://www.rubydoc.info/github/mikel/mail/Mail#read-class_method)
[15:26:28] Rakete1111: and it seems like it's doing the same thing? but I don't really get why one way doesn't work and with the other it works
[15:27:45] Rakete1111: Or same question but asked differently: It seems like `File.open(filename, 'rb') { |f| f.read }` does something else than `File.read(filename)`?
[15:27:54] adam12: Rakete1111: Indeed that is kinda odd.
[15:28:33] adam12: Rakete1111: Does it happen on every file or just random ones?
[15:29:02] Rakete1111: well only on the files that have a multiple parts. I'll check if I can reproduce in the irb
[15:29:16] Rakete1111: (because that's when the function is used)
[15:29:37] jottr: has joined #ruby
[15:31:00] Rakete1111: yes so the output is different
[15:31:12] Rakete1111: the File.open way gives me a different string than File.read
[15:32:18] adam12: Rakete1111: That's odd. What OS?
[15:32:28] adam12: Maybe it's an encoding issue.
[15:33:10] Rakete1111: oh that's true
[15:34:53] adam12: Rakete1111: The binary flag to File.open does some things different. File.read by default doesn't set binary mode. That might be why you see different results as strings.
[15:35:26] Rakete1111: oh right, non ascii characters get encoded using \xNN in the first
[15:35:41] Rakete1111: you're right
[15:36:07] Rakete1111: so I guess it seems like
[15:36:17] adam12: Rakete1111: If you're getting what you want with File.read + Mail.new, I don't see any reason why you couldn't use that method.
[15:36:21] Rakete1111: Mail can't really work with \xNN characters
[15:36:40] adam12: Rakete1111: It might. I'd look through the spec/fixtures and see if there are any files that match.
[15:36:55] adam12: Rakete1111: What's your locale, out of curiosity?
[15:37:14] Rakete1111: It should be en-us, but the email was German
[15:37:18] russt: has joined #ruby
[15:37:41] DmitryBochkarev: has joined #ruby
[15:38:04] fphilipe_: has joined #ruby
[15:38:59] adam12: Rakete1111: Might be a mail bug. Hard to say. If you `s = File.read("/path/to/file", mode: "rb"); Mail.new(s).text_part` does it bug out?
[15:39:52] agent_white: has joined #ruby
[15:39:53] Rakete1111: So: "\xC3" == "ö" is false. Is there not a way to reverse the conversion that happens when File.read reads a file in binary mode?
[15:39:56] Rakete1111: yes it does bug out
[15:40:03] Rakete1111: and the output is the same (so indeed that was it)
[15:40:29] Rakete1111: Does ruby not have escaped characters in strings?
[15:40:52] adam12: Rakete1111: The 'b' flag forces external encoding to ASCII-8BIT.
[15:41:38] adam12: Rakete1111: Do you have a value for `Encoding.default_external` ?
[15:42:02] Rakete1111: It's #<Encoding:UTF-8>
[15:42:09] adam12: How about Encoding.default_internal?
[15:42:23] adam12: Hm. I'd presume that to work just fine.
[15:42:51] adam12: Should "\xC3" == "ö" be true?
[15:43:38] Rakete1111: yes. doesn't work even for ASCII characters: "\x30" == "/" is false
[15:44:08] Rakete1111: Seems like ruby doesn't know my locale so misinterprets "\xC3" as nothing
[15:44:17] Rakete1111: and doesn't parse that as character
[15:44:39] Rakete1111: I guess that make sense. \xC3 could mean different things in different locales
[15:45:56] Rakete1111: omg I was wrong
[15:45:56] adam12: Rakete1111: I don't work too much with different locales so likely getting to the extend of my knowledge here.
[15:46:01] adam12: Rakete1111: What Ruby version is this?
[15:46:22] adam12: So no issue there.
[15:46:22] Rakete1111: "\xC3\xB6" == "ö" is true
[15:46:30] Rakete1111: I didn't see the last part
[15:46:33] adam12: That looks right.
[15:46:42] Rakete1111: So why the different? funny
[15:47:37] Rakete1111: maybe worth filing a Mail bug I guess
[15:47:52] Rakete1111: or what do you think?
[15:47:59] adam12: Rakete1111: Maybe. I'm not sure if the `b` flag is necessary to read emails.
[15:48:14] Rakete1111: I'll file and see what they think :)
[15:48:15] adam12: Rakete1111: If you have the source, I'd remove the flag and run the specs. If they all pass, maybe it's a Windows-only thing.
[15:48:43] adam12: Rakete1111: Could search the issue tracker for encoding. Maybe it's been discussed before.
[15:49:40] Rakete1111: yeah I will do that thakns
[16:02:12] lomex: has joined #ruby
[16:07:57] houhoulis: has joined #ruby
[16:43:07] fphilipe_: has joined #ruby
[16:51:19] DmitryBochkarev: has joined #ruby
[16:53:04] suukim: has joined #ruby
[16:54:06] dviola: has joined #ruby
[17:07:00] venmx: has joined #ruby
[17:21:15] AJA4351: has joined #ruby
[17:27:05] delimited: has joined #ruby
[17:30:57] jottr: has joined #ruby
[17:34:08] hightower3: has joined #ruby
[17:40:03] kyrylo: has joined #ruby
[17:41:14] fanta1: has joined #ruby
[17:41:41] camilasan: has joined #ruby
[17:51:02] laaron: has joined #ruby
[17:51:04] conta: has joined #ruby
[17:55:00] AJA4351: has joined #ruby
[17:57:03] dviola: has joined #ruby
[17:57:16] delimited: has joined #ruby
[17:59:07] dviola: has joined #ruby
[18:06:40] agent_white: has joined #ruby
[18:07:02] sphenxes: has joined #ruby
[18:12:52] crankharder: has joined #ruby
[18:14:28] laaron-: has joined #ruby
[18:15:42] hightower2: has joined #ruby
[18:24:55] jottr: has joined #ruby
[18:25:49] lord4163: has joined #ruby
[18:36:45] seggy: has joined #ruby
[18:37:59] nowhere_man: has joined #ruby
[18:48:44] AJA4350: has joined #ruby
[18:56:30] Lytol: has joined #ruby
[18:56:57] quarters: I was wondering how to pass a hash's key, value pair as a hash into a proc
[18:57:23] quarters: while iterating over it using #each
[19:01:01] uplime: quarters: you mean like: myhash.each { |key, val| ... }
[19:04:00] jottr: has joined #ruby
[19:11:28] rbasak: has left #ruby: ()
[19:13:30] fphilipe_: has joined #ruby
[19:23:38] AJA4351: has joined #ruby
[19:24:34] delimited: has joined #ruby
[19:43:22] dsmythe: has joined #ruby
[19:43:57] wallace_mu: has joined #ruby
[19:45:02] vrih: has joined #ruby
[19:51:12] dsmythe: has joined #ruby
[19:54:08] clemens3_: has joined #ruby
[20:07:35] aqd: has joined #ruby
[20:20:02] fphilipe_: has joined #ruby
[20:36:27] laaron: has joined #ruby
[20:49:54] kmckelvin: has joined #ruby
[20:58:00] camilasan: has joined #ruby
[22:11:13] reber: has joined #ruby
[22:37:46] fphilipe_: has joined #ruby
[22:38:38] cow[moo]: has joined #ruby
[23:07:06] code_zombie: has joined #ruby