« Back to channel list

#ruby - 05 May 2019

« Back 1 day Forward 1 day »
[00:02:56] jottr: has joined #ruby
[00:09:30] wolfshappen: has joined #ruby
[00:13:10] jottr: has joined #ruby
[00:21:34] fphilipe: has joined #ruby
[00:23:23] jottr: has joined #ruby
[00:23:40] orbyt_: has joined #ruby
[00:33:37] jottr: has joined #ruby
[00:43:51] jottr: has joined #ruby
[00:52:40] jenrzzz: has joined #ruby
[00:54:03] jottr: has joined #ruby
[00:54:45] dsmythe: has joined #ruby
[01:00:14] noobineer: has joined #ruby
[01:01:15] ElF3rn4: has joined #ruby
[01:04:16] jottr: has joined #ruby
[01:09:29] laaron: has joined #ruby
[01:11:11] orbyt_: has joined #ruby
[01:14:29] jottr: has joined #ruby
[01:18:48] bga57: has joined #ruby
[01:23:55] fphilipe: has joined #ruby
[01:24:41] jottr: has joined #ruby
[01:26:29] orbyt_: has joined #ruby
[01:27:18] tdy: has joined #ruby
[01:32:33] laaron: has joined #ruby
[01:34:56] jottr: has joined #ruby
[01:45:09] jottr: has joined #ruby
[01:55:20] jottr: has joined #ruby
[02:05:34] jottr: has joined #ruby
[02:12:14] shakes: has joined #ruby
[02:15:47] jottr: has joined #ruby
[02:18:00] skyikot: has joined #ruby
[02:25:15] dsmythe: has joined #ruby
[02:25:59] jottr: has joined #ruby
[02:36:14] jottr: has joined #ruby
[02:46:28] jottr: has joined #ruby
[02:56:38] jottr: has joined #ruby
[03:06:52] jottr: has joined #ruby
[03:11:19] braincrash: has joined #ruby
[03:12:28] roadt_: has joined #ruby
[03:17:04] jottr: has joined #ruby
[03:28:15] jottr: has joined #ruby
[03:35:03] dar123: has joined #ruby
[03:35:55] Code_[24]_: has joined #ruby
[03:53:23] jenrzzz: has joined #ruby
[03:55:57] fphilipe: has joined #ruby
[04:00:31] jottr: has joined #ruby
[04:03:35] nomoney4u: has joined #ruby
[04:07:15] Milos: has joined #ruby
[04:18:26] ricekrispie: has joined #ruby
[04:19:10] nomoney4u: has joined #ruby
[04:22:28] Milos: has joined #ruby
[04:38:11] sh7d: has joined #ruby
[04:45:32] haengma: has joined #ruby
[04:58:36] fphilipe: has joined #ruby
[05:10:50] rhuang: has joined #ruby
[05:16:30] m27frogy: has joined #ruby
[05:36:33] u0_a238: has joined #ruby
[05:51:13] laaron: has joined #ruby
[05:54:50] jenrzzz: has joined #ruby
[05:59:31] iMadper: has joined #ruby
[06:00:39] jottr: has joined #ruby
[06:08:13] u0_a238: has joined #ruby
[06:24:17] jottr: has joined #ruby
[06:31:48] u0_a238: has joined #ruby
[07:07:53] iMadper`: has joined #ruby
[07:11:13] t3hyoshi: has joined #ruby
[07:19:24] jottr: has joined #ruby
[07:20:30] iMadper`: has joined #ruby
[07:24:08] iMadper``: has joined #ruby
[07:27:58] def_jam: has joined #ruby
[07:28:51] eb0t_: has joined #ruby
[07:29:05] fphilipe: has joined #ruby
[07:30:19] u0_a238_: has joined #ruby
[07:34:04] jarray52: has joined #ruby
[07:38:21] reber: has joined #ruby
[07:38:26] jottr: has joined #ruby
[07:48:40] jottr: has joined #ruby
[07:55:10] jenrzzz: has joined #ruby
[07:58:51] jottr: has joined #ruby
[08:06:07] Inline: has joined #ruby
[08:09:06] jottr: has joined #ruby
[08:11:42] iMadper: has joined #ruby
[08:17:10] dellavg_: has joined #ruby
[08:18:12] claudiuinberlin: has joined #ruby
[08:18:51] ellcs: has joined #ruby
[08:18:52] kyrylo: has joined #ruby
[08:19:18] jottr: has joined #ruby
[08:21:15] lxsameer: has joined #ruby
[08:29:36] jottr: has joined #ruby
[08:39:48] jottr: has joined #ruby
[08:45:58] haengma: has joined #ruby
[08:50:01] jottr: has joined #ruby
[08:52:40] jarray52: has left #ruby: ()
[08:57:26] laaron: has joined #ruby
[09:00:14] jottr: has joined #ruby
[09:08:44] Onwarion: has joined #ruby
[09:10:28] jottr: has joined #ruby
[09:13:27] zapata: has joined #ruby
[09:20:07] gix: has joined #ruby
[09:20:42] jottr: has joined #ruby
[09:30:02] haengma: has joined #ruby
[09:30:29] m_antis: has joined #ruby
[09:30:55] jottr: has joined #ruby
[09:32:31] TheSpectre: has joined #ruby
[09:41:10] jottr: has joined #ruby
[09:48:31] nowhere_man: has joined #ruby
[09:48:44] laaron: has joined #ruby
[09:51:21] jottr: has joined #ruby
[09:52:58] Ai9zO5AP: has joined #ruby
[09:55:30] jenrzzz: has joined #ruby
[10:01:33] jottr: has joined #ruby
[10:05:15] ellcs: has joined #ruby
[10:10:09] Dbugger: has joined #ruby
[10:11:48] jottr: has joined #ruby
[10:14:41] laaron: has joined #ruby
[10:16:16] cadeskywalker: has joined #ruby
[10:17:27] cadeskywalker: has joined #ruby
[10:22:00] jottr: has joined #ruby
[10:26:45] djdduty: has joined #ruby
[10:32:14] jottr: has joined #ruby
[10:39:06] tsrt^: has joined #ruby
[10:42:25] jottr: has joined #ruby
[10:51:59] AJA4350: has joined #ruby
[10:52:38] jottr: has joined #ruby
[10:53:39] jenrzzz: has joined #ruby
[11:02:52] jottr: has joined #ruby
[11:07:00] apparition: has joined #ruby
[11:08:38] ellcs: has joined #ruby
[11:13:06] jottr: has joined #ruby
[11:23:17] jottr: has joined #ruby
[11:33:07] clemens3_: has joined #ruby
[11:33:32] jottr: has joined #ruby
[11:36:26] clemens3: has joined #ruby
[11:43:43] jottr: has joined #ruby
[11:45:25] DTZUZO: has joined #ruby
[11:51:50] nomoney4u: has joined #ruby
[11:53:57] jottr: has joined #ruby
[12:04:09] jottr: has joined #ruby
[12:14:22] jottr: has joined #ruby
[12:24:37] jottr: has joined #ruby
[12:24:55] u0_a238: has joined #ruby
[12:31:53] mikeiniowa: has joined #ruby
[12:33:03] Swyper: has joined #ruby
[12:34:50] jottr: has joined #ruby
[12:45:04] jottr: has joined #ruby
[12:55:17] jottr: has joined #ruby
[12:56:14] uranoss: has joined #ruby
[13:02:47] dsmythe: has joined #ruby
[13:04:52] mikecmpbll: has joined #ruby
[13:05:11] fphilipe: has joined #ruby
[13:05:12] djdduty: has joined #ruby
[13:05:30] jottr: has joined #ruby
[13:10:12] sh7d: ahh, fuck nokogiri "output error : unknown encoding ASCII-8BIT" ;/
[13:11:30] sh7d: is there any way just to make it working in binary mode ?
[13:12:29] sh7d: or i suppose in case of html it just cannot be (urlencode attributes and shit)
[13:15:42] jottr: has joined #ruby
[13:25:56] jottr: has joined #ruby
[13:26:51] manveru: sh7d: there's rchardet if you don't know the real encoding
[13:30:49] sh7d: manveru, i'll give it a try, but imo for my case more elegent solution is to just dont care about badly encoded chars, and parse doc as is
[13:31:46] manveru: you can force encode it to ascii and replace any non-ascii chars then
[13:34:06] sh7d: well, i rather want to save it, but let me explain more precisely
[13:34:11] manveru: something like: 'what is this: わからない'.encode('ASCII', undef: :replace)
[13:36:09] jottr: has joined #ruby
[13:36:26] Swyper: has joined #ruby
[13:37:16] sh7d: for now, i create nokogiri doc object like that: doc = Nokogiri::HTML(file_content, nil, Encoding::BINARY.to_s)
[13:37:37] sh7d: and nokogiri completly ignores third argument
[13:38:15] sh7d: it still tries to detect encoding by self, and there are enven casesn when doc.encoding is nil
[13:38:49] sh7d: (aand file_content is from IO.binread, so is encodend in binary)
[13:40:55] conta: has joined #ruby
[13:41:06] laaron: has joined #ruby
[13:41:18] manveru: did you try passing the IO to nokogiri directly?
[13:41:19] fphilipe: has joined #ruby
[13:43:45] sh7d: nope, i need file_content anyway to determine if is changed after processing
[13:44:24] sh7d: yes, i know, i can calculate checksum but im lazy :P
[13:46:28] jottr: has joined #ruby
[13:53:03] zacts: has joined #ruby
[13:57:06] DTZUZO: has joined #ruby
[13:57:55] englishm: has joined #ruby
[14:05:21] jottr: has joined #ruby
[14:15:34] jottr: has joined #ruby
[14:18:09] laaron-: has joined #ruby
[14:25:47] jottr: has joined #ruby
[14:25:49] ltem: has joined #ruby
[14:36:01] jottr: has joined #ruby
[14:45:14] TomyLobo2: has joined #ruby
[14:47:29] al2o3-cr: has joined #ruby
[14:54:21] jottr: has joined #ruby
[14:57:03] wbollui: has joined #ruby
[14:57:05] wbollui: join #ruby
[14:59:31] wbollui: I'm trying to figure out a better way to handle a method taking an argument that could be an Integer or an Array<Integer>
[14:59:39] wbollui: https://dpaste.de/2QT6#L1,3,12,17
[15:00:35] wbollui: At the moment I have a stupid implementation that just copies the method body and then switches based on the object type passed in using #is_a?
[15:01:09] manveru: wbollui: something like `rooms = [*room]`, and then always iterate over `rooms`
[15:01:09] wbollui: What would be a more rubyish way to do this kind of dispatch that intelligently handles multiple types of object parameters?
[15:01:55] wbollui: at the beginning of the method body coerce an Int into an Array?
[15:03:23] wbollui: thank you, great idea
[15:03:29] manveru: personally, i'd just pass `rooms` always, it's not really clear from the method signature that it can take multiple
[15:04:04] wbollui: that would be a better way to name it, I agree.
[15:04:16] wbollui: Never realized you could splat an array and it returns itself
[15:04:36] jottr: has joined #ruby
[15:11:16] kyrylo: has joined #ruby
[15:14:21] al2o3-cr: has joined #ruby
[15:14:26] fphilipe_: has joined #ruby
[15:15:48] jottr: has joined #ruby
[15:16:13] MuffinPimp: has joined #ruby
[15:26:00] jottr: has joined #ruby
[15:36:12] jottr: has joined #ruby
[15:41:15] u0_a238: has joined #ruby
[15:45:19] tdy: has joined #ruby
[15:46:28] jottr: has joined #ruby
[15:50:37] zacts: has joined #ruby
[15:51:29] jmcgnh: has joined #ruby
[15:55:35] jmcgnh: has joined #ruby
[15:56:42] jottr: has joined #ruby
[15:59:20] jmcgnh: has joined #ruby
[16:01:31] hightower2: has joined #ruby
[16:06:52] jottr: has joined #ruby
[16:07:49] jmcgnh: has joined #ruby
[16:16:07] jmcgnh: has joined #ruby
[16:16:13] blackmesa: has joined #ruby
[16:17:05] jottr: has joined #ruby
[16:27:19] jottr: has joined #ruby
[16:28:04] jmcgnh: has joined #ruby
[16:31:59] mikecmpbll: has joined #ruby
[16:32:28] Swyper: has joined #ruby
[16:33:34] jmcgnh: has joined #ruby
[16:37:31] jottr: has joined #ruby
[16:37:39] GodFather: has joined #ruby
[16:47:44] jottr: has joined #ruby
[16:51:03] rippa: has joined #ruby
[16:55:47] al-damiri: has joined #ruby
[16:57:57] clemens3: has joined #ruby
[16:57:59] jottr: has joined #ruby
[17:01:26] SeepingN: has joined #ruby
[17:08:10] jottr: has joined #ruby
[17:18:49] jottr: has joined #ruby
[17:29:47] jottr: has joined #ruby
[17:35:13] jottr: has joined #ruby
[17:43:34] blackmesa: has joined #ruby
[17:46:12] jottr: has joined #ruby
[17:53:00] tdy: has joined #ruby
[17:55:49] nt80: has joined #ruby
[17:57:11] jottr: has joined #ruby
[18:02:00] jmcgnh: has joined #ruby
[18:08:10] jottr: has joined #ruby
[18:14:43] yqt: has joined #ruby
[18:19:09] jottr: has joined #ruby
[18:22:01] jmcgnh: has joined #ruby
[18:23:19] Dbugger: has joined #ruby
[18:27:24] kyrylo: has joined #ruby
[18:29:08] fphilipe_: has joined #ruby
[18:30:06] jottr: has joined #ruby
[18:33:04] jmcgnh: has joined #ruby
[18:33:56] orbyt_: has joined #ruby
[18:40:14] jmcgnh: has joined #ruby
[18:40:45] jottr: has joined #ruby
[18:44:10] xdrxs: has joined #ruby
[18:44:59] jmcgnh: has joined #ruby
[18:47:17] reber__: has joined #ruby
[18:57:21] dsmythe: has joined #ruby
[18:58:13] jottr: has joined #ruby
[18:59:16] dsmythe: has joined #ruby
[19:01:55] jmcgnh: has joined #ruby
[19:07:12] jottr: has joined #ruby
[19:14:13] Swyper: has joined #ruby
[19:18:11] jottr: has joined #ruby
[19:27:26] jottr: has joined #ruby
[19:30:30] cd: has joined #ruby
[19:37:43] Swyper: has joined #ruby
[19:38:05] jottr: has joined #ruby
[19:48:18] u0_a238: has joined #ruby
[19:59:52] jottr: has joined #ruby
[20:00:12] Swyper: has joined #ruby
[20:00:40] u0_a238: has joined #ruby
[20:02:35] jmcgnh: has joined #ruby
[20:07:39] jmcgnh: has joined #ruby
[20:10:13] jottr: has joined #ruby
[20:13:36] u0_a238: has joined #ruby
[20:16:35] blackmesa: has joined #ruby
[20:18:36] orbyt_: has joined #ruby
[20:20:17] jottr: has joined #ruby
[20:23:45] cthulchu_: has joined #ruby
[20:26:33] Swyper: has joined #ruby
[20:30:30] jottr: has joined #ruby
[20:39:09] beeshk: has joined #ruby
[20:40:01] zacts: has joined #ruby
[20:40:43] jottr: has joined #ruby
[20:43:28] xdrxs: has joined #ruby
[20:45:35] nevada1: has joined #ruby
[20:47:04] ellcs: has joined #ruby
[20:48:26] nevada1: Can you mimic for(int i = 2; i * i < n; i++) in Ruby's for loop?
[20:48:38] jaequery: has joined #ruby
[20:50:56] jottr: has joined #ruby
[21:01:09] jottr: has joined #ruby
[21:06:10] u0_a238: has joined #ruby
[21:11:23] jottr: has joined #ruby
[21:14:42] ur5us: has joined #ruby
[21:21:34] jottr: has joined #ruby
[21:31:47] jottr: has joined #ruby
[21:32:44] code_zombie: has joined #ruby
[21:40:34] cthulchu: has joined #ruby
[21:42:00] jottr: has joined #ruby
[21:52:13] jottr: has joined #ruby
[21:53:09] beeshk: has joined #ruby
[22:00:17] fphilipe_: has joined #ruby
[22:02:27] jottr: has joined #ruby
[22:04:09] orbyt_: has joined #ruby
[22:10:20] dinfuehr: has joined #ruby
[22:12:41] jottr: has joined #ruby
[22:14:33] dsmythe: has joined #ruby
[22:16:10] clemens3: has joined #ruby
[22:16:48] Mike11: has joined #ruby
[22:22:54] jottr: has joined #ruby
[22:30:21] dinfuehr: has joined #ruby
[22:36:06] dar123: has joined #ruby
[22:40:51] jottr: has joined #ruby
[22:41:44] beeshk: has joined #ruby
[22:43:16] chaus: has joined #ruby
[22:49:55] riceandbeans: has joined #ruby
[22:51:03] jottr: has joined #ruby
[22:51:12] riceandbeans: What's the correct way to do this, I'm spacing, foo = ['one','two','three'] foo.each do | bar | baz = `biff -f #{bar}` end
[22:57:10] riceandbeans: ugh, "#{bar}"
[22:57:19] riceandbeans: Couldn't focus with kids screaming in my ears
[23:00:28] jottr: has joined #ruby
[23:01:58] baweaver: riceandbeans: What're you trying to do?
[23:03:29] nowhere_man: has joined #ruby
[23:03:58] baweaver: because you probably want map.
[23:04:12] baweaver: but placeholder names make that hard to know.
[23:04:20] riceandbeans: baweaver: Sorry, I'm just....going nuts from kids right now, but I'll try to explain
[23:04:47] riceandbeans: I have a series of hosts, I need to iterate through them to find a subset that meet a certain condition that is determined by output of a shell command
[23:05:15] baweaver: map then select
[23:05:19] riceandbeans: From those hosts I then need to do a mapping of one column to another column across the various hosts
[23:05:40] baweaver: If you can get an example written that'd help
[23:06:31] riceandbeans: Well the part here was that I needed to get info per host and so I was iterating on hosts and shoving them into the shell command
[23:12:54] jottr: has joined #ruby
[23:23:07] jottr: has joined #ruby
[23:24:35] batcat84: has joined #ruby
[23:25:02] batcat84: Hello, all! I'm fairly new to CLI/Terminal and I'm getting an error from Ruby Version Manager.
[23:25:10] batcat84: The error reads: Warning! PATH is not properly set up, /Users/stoney/.rvm/gems/ruby-2.6.1/bin is not at first place.
[23:25:17] batcat84: I'm on macOS Mojave.
[23:28:27] spacesuitdiver: has joined #ruby
[23:29:32] beeshk: has joined #ruby
[23:31:50] al2o3-cr: batcat84: add `export PATH="$GEM_HOME/bin:$PATH"` the last line of your `$HOME/.bashrc` if using bash
[23:33:21] jottr: has joined #ruby
[23:33:56] batcat84: al2o3-cr: Thank you. How would I do that?
[23:35:19] al2o3-cr: open $HOME/.bashrc in a text editor and add the line: export PATH="$GEM_HOME/bin:$PATH"
[23:35:54] al2o3-cr: batcat84: you are using bash right?
[23:36:24] al2o3-cr: batcat84: from the terminal type: printenv SHELL
[23:39:17] al2o3-cr: batcat84: type this: echo 'export PATH="$GEM_HOME/bin:$PATH"' >> $HOME/.bashrc
[23:40:35] al2o3-cr: batcat84: should be good to go now.
[23:40:47] orbyt_: has joined #ruby
[23:41:17] al2o3-cr: batcat84: make sure to restart shell session
[23:41:26] batcat84: Ok, thank you.
[23:43:34] jottr: has joined #ruby
[23:46:43] nowhere_man: has joined #ruby
[23:47:56] xdrxs: has joined #ruby
[23:53:45] jottr: has joined #ruby