« Back to channel list

#ruby - 29 April 2019

« Back 1 day Forward 1 day »
[00:00:37] Psy-Q: has joined #ruby
[00:02:28] fphilipe: has joined #ruby
[00:05:32] s3nd1v0g1us: has joined #ruby
[00:06:54] skryking__: has joined #ruby
[00:12:33] jottr: has joined #ruby
[00:15:54] dar123: has joined #ruby
[00:23:09] E3lit3h4XX0r666: has left #ruby: ()
[00:28:59] dar123: has joined #ruby
[00:35:43] weird_error: has joined #ruby
[00:39:47] kyrylo: has joined #ruby
[00:39:59] jottr: has joined #ruby
[00:46:31] mostlybadfly: has joined #ruby
[01:00:56] jottr: has joined #ruby
[01:02:46] chaus: has joined #ruby
[01:10:35] oncall-pokemon_: has joined #ruby
[01:16:04] oncall-pokemon_: has joined #ruby
[01:20:21] oncall-pokemon: has joined #ruby
[01:21:49] jottr: has joined #ruby
[01:30:44] oncall-pokemon: has joined #ruby
[01:42:48] jottr: has joined #ruby
[01:45:34] m_antis: has joined #ruby
[01:56:20] orbyt_: has joined #ruby
[02:00:48] orbyt_: has joined #ruby
[02:02:44] Swyper: has joined #ruby
[02:03:27] fphilipe: has joined #ruby
[02:04:22] bairyn: has joined #ruby
[02:09:57] laaron: has joined #ruby
[02:14:34] houhoulis: has joined #ruby
[02:17:59] jottr: has joined #ruby
[02:27:19] Azure: has joined #ruby
[02:30:04] laaron: has joined #ruby
[02:39:43] jottr: has joined #ruby
[03:00:37] jottr: has joined #ruby
[03:02:06] laaron: has joined #ruby
[03:08:52] aither: has joined #ruby
[03:08:52] jenrzzz: has joined #ruby
[03:09:24] braincrash: has joined #ruby
[03:16:26] al2o3-cr: has joined #ruby
[03:18:37] iMadper: has joined #ruby
[03:21:49] jelera: has joined #ruby
[03:25:09] Swyper: has joined #ruby
[03:30:34] ndrst: has joined #ruby
[03:35:08] jottr: has joined #ruby
[03:50:24] houhoulis: has joined #ruby
[03:58:30] noobineer: has joined #ruby
[04:01:55] arescorpio: has joined #ruby
[04:03:06] bambanx: has joined #ruby
[04:04:24] fphilipe: has joined #ruby
[04:07:29] jottr: has joined #ruby
[04:27:10] _whitelogger: has joined #ruby
[04:28:24] jottr: has joined #ruby
[04:35:42] marmotini_: has joined #ruby
[04:46:43] CableNinja: has joined #ruby
[04:48:18] E3lit3h4XX0r666: has joined #ruby
[04:49:19] jottr: has joined #ruby
[04:49:28] CableNinja: hey guys. I'm trying to do an SSL server/client setup (straight tcp/ssl via TCP/SSL network sockets). I'm struggling to get a complete connection. using openssl_sclient I get correct info, but when I connect using the ruby client I get "unexpected message" on the client side, and "wrong version number" on the server side. Both are running on the same system, I updated to openssl 1.1.1b, and rebuilt ruby/openssl with it, but I still
[04:49:28] CableNinja: cannot get a successful connection.
[05:09:09] jenrzzz: has joined #ruby
[05:10:54] xco: has joined #ruby
[05:12:13] kapil____: has joined #ruby
[05:13:42] Xiti`: has joined #ruby
[05:16:16] iMadUtil`: has joined #ruby
[05:16:40] bambanxx: has joined #ruby
[05:17:46] jottr: has joined #ruby
[05:22:37] conta: has joined #ruby
[05:25:47] landakram: has joined #ruby
[05:26:30] fphilipe: has joined #ruby
[05:26:58] Swyper: has joined #ruby
[05:27:56] orbyt_: has joined #ruby
[05:32:57] marmotini_: has joined #ruby
[05:38:06] ozzloy: has joined #ruby
[05:38:07] ozzloy: has joined #ruby
[05:38:40] jottr: has joined #ruby
[05:47:19] Swyper: has joined #ruby
[05:48:09] hightower2: has joined #ruby
[05:56:37] TheSpectre_: has joined #ruby
[05:59:35] jottr: has joined #ruby
[06:04:58] jenrzzz: has joined #ruby
[06:06:16] reber: has joined #ruby
[06:12:27] fphilipe: has joined #ruby
[06:16:55] tdy1: has joined #ruby
[06:17:33] clemens3: has joined #ruby
[06:20:31] jottr: has joined #ruby
[06:31:29] Dbugger: has joined #ruby
[06:34:22] yuriii: has joined #ruby
[06:34:26] Tempesta_: has joined #ruby
[06:36:32] Nilium: has joined #ruby
[06:36:59] arooni: has joined #ruby
[06:37:25] MuffinPimp: has joined #ruby
[06:37:49] akemot: has joined #ruby
[06:48:57] jottr: has joined #ruby
[06:53:07] andikr: has joined #ruby
[06:53:19] clemens3: has joined #ruby
[07:09:52] jottr: has joined #ruby
[07:14:55] Sylario: has joined #ruby
[07:21:31] prestorium: has joined #ruby
[07:24:10] vondruch: has joined #ruby
[07:25:09] zacts: has joined #ruby
[07:25:29] zacts: hello #ruby
[07:29:31] jefffrails35: has joined #ruby
[07:30:40] waheedi: has joined #ruby
[07:32:48] hightower2: has joined #ruby
[07:34:41] dhollinger: has joined #ruby
[07:38:50] jottr: has joined #ruby
[07:43:42] lxsameer: has joined #ruby
[07:59:25] Jonopoly: has joined #ruby
[07:59:44] jottr: has joined #ruby
[08:02:40] hightower2: has joined #ruby
[08:03:45] andikr: has joined #ruby
[08:08:25] _joes_: has joined #ruby
[08:08:36] BH23: has joined #ruby
[08:15:40] jottr: has joined #ruby
[08:26:05] _joes_: has joined #ruby
[08:26:36] BH23: has joined #ruby
[08:29:47] clemens3: has joined #ruby
[08:50:47] andikr: has joined #ruby
[08:58:13] alem0lars: has joined #ruby
[09:01:30] conta: has joined #ruby
[09:15:29] jefffrails35: has joined #ruby
[09:17:07] claudiuinberlin: has joined #ruby
[09:18:01] buckworst: has joined #ruby
[09:22:38] cthu|: has joined #ruby
[09:26:29] cthulchu_: has joined #ruby
[09:31:16] m_antis_: has joined #ruby
[09:35:51] jottr: has joined #ruby
[09:42:48] suryc: has joined #ruby
[09:47:07] ur5us: has joined #ruby
[09:53:30] conta: has joined #ruby
[09:54:30] kyrylo: has joined #ruby
[09:56:19] vondruch: has joined #ruby
[09:57:23] jottr: has joined #ruby
[10:17:46] wald0: has joined #ruby
[10:17:47] jenrzzz: has joined #ruby
[10:19:43] jottr: has joined #ruby
[10:28:45] queip: has joined #ruby
[10:34:49] rainer_tm: has joined #ruby
[10:48:43] AJA4350: has joined #ruby
[10:50:26] jottr: has joined #ruby
[10:58:57] jottr: has joined #ruby
[11:06:02] cd: has joined #ruby
[11:06:56] vondruch: has joined #ruby
[11:09:11] _whitelogger: has joined #ruby
[11:14:00] cthu|: has joined #ruby
[11:23:13] _joes_: has joined #ruby
[11:23:25] BH23: has joined #ruby
[11:25:04] vondruch: has joined #ruby
[11:27:49] _joes_: has joined #ruby
[11:29:34] haivron: has joined #ruby
[11:38:30] ldnunes: has joined #ruby
[11:45:46] jottr: has joined #ruby
[11:53:41] _joes_: has joined #ruby
[12:06:22] jottr: has joined #ruby
[12:21:02] jenrzzz: has joined #ruby
[12:21:18] kyrylo: has joined #ruby
[12:27:49] jottr: has joined #ruby
[12:31:12] waheedi: has joined #ruby
[12:32:14] Nahra: has joined #ruby
[12:32:57] edwardly: has joined #ruby
[12:32:57] edwardly: has joined #ruby
[12:33:02] _joes_: has joined #ruby
[12:48:37] jottr: has joined #ruby
[12:50:56] marmotini_: has joined #ruby
[12:51:38] Mia: has joined #ruby
[12:51:38] Mia: has joined #ruby
[12:52:38] hightower2: has joined #ruby
[12:54:31] alem0lars_: has joined #ruby
[12:56:03] vondruch_: has joined #ruby
[12:56:53] lucasb: has joined #ruby
[13:05:05] alem0lars: has joined #ruby
[13:05:26] pwnd_nsfw: has joined #ruby
[13:15:38] jottr: has joined #ruby
[13:19:02] ech0s7: has joined #ruby
[13:19:07] ech0s7: https://onlinegdb.com/HkhiFOVoN why line 4 return false ?
[13:23:01] BH23: has joined #ruby
[13:25:35] _joes_: has joined #ruby
[13:30:45] jcalla: has joined #ruby
[13:34:31] Swyper: has joined #ruby
[13:35:14] pupsikov: has joined #ruby
[13:35:59] fphilipe: has joined #ruby
[13:36:31] jottr: has joined #ruby
[13:39:28] adam12: ech0s7: Your keys are symbols. 'a' is a string.
[13:39:47] adam12: ech0s7: I bet if you `puts hash.key? :a` it would work :)
[13:39:55] cthulchu: has joined #ruby
[13:40:25] adam12: &>> { a: "a" }.key? :a
[13:40:29] rubydoc: # => true (https://carc.in/#/r/6t1g)
[13:41:40] jelera: has joined #ruby
[13:42:25] BH23: has joined #ruby
[13:42:26] _joes_: has joined #ruby
[13:47:54] ech0s7: adam12: it is possible to convert hash keys to symbols ?
[13:48:27] krawchyk: has joined #ruby
[13:48:43] ech0s7: adam12: I'm reading a json config file into an hash object and I would like to access the hash using obj[:key] instead of obj["key"]
[13:49:56] adam12: ech0s7: Couple methods. If you're using Rails, there's a symbolize_keys! method on Hash.
[13:50:09] adam12: ech0s7: If you're not, I believe JSON will accept an argument to symbolize keys/names.
[13:50:30] rubydoc: https://ruby-doc.org/stdlib-2.6/libdoc/json/rdoc/JSON.html
[13:51:51] laaron: has joined #ruby
[13:53:14] havenwood: ech0s7: +1 for JSON's: symbolize_names: true
[13:53:48] havenwood: ech0s7: you can always: transform_keys(&:to_sym)
[13:54:40] ech0s7: thanks havenwood
[13:54:47] ech0s7: why did you put the & ?
[13:55:33] _joes_: has joined #ruby
[13:56:34] Jonopoly: i think ive came to conclusion that ruby and selenium is a problem T_T
[13:56:53] Jonopoly: One of my features generates a file, I then can't seem to run that file.. T_T
[13:57:29] jottr: has joined #ruby
[14:02:45] vdl: has joined #ruby
[14:04:15] laaron-: has joined #ruby
[14:04:29] Swyper: has joined #ruby
[14:05:59] AJA4351: has joined #ruby
[14:11:26] orbyt_: has joined #ruby
[14:12:49] suukim: has joined #ruby
[14:20:29] _joes_: has joined #ruby
[14:20:35] BH23: has joined #ruby
[14:20:35] ngw: has joined #ruby
[14:21:49] ngw: hi *, is there an easy way to parse multipart data in plain ruby? I know Rack has the code for doing that but I'm building an AWS lambda, I feel silly requiring Rack for nothing
[14:22:39] adam12: ngw: I haven't seen anything but maybe you can dig through the CGI library in stdlib?
[14:26:41] adam12: ngw: Nevermind. I forgot that CGI.rb was a bit barren.
[14:28:37] conta: has joined #ruby
[14:30:09] ngw: I won't die I guess if I use Rack
[14:30:21] ngw: just hoped for something easier
[14:31:15] adam12: ngw: If it's just a single method I'd just lift and shift :)
[14:31:16] Inline: has joined #ruby
[14:32:06] Xiti: has joined #ruby
[14:38:17] cthulchu: has joined #ruby
[14:39:06] ngw: eh, it's quite out of scope with what I'm doing, I hate helpers/libs when completely out of scope with the project
[14:42:06] gnufied: has joined #ruby
[14:46:57] jottr: has joined #ruby
[14:51:42] dionysus69: has joined #ruby
[14:53:05] jcarl43: has joined #ruby
[14:54:12] Cthulu201: has joined #ruby
[14:58:12] dionysus69: has joined #ruby
[15:00:53] jelera: has joined #ruby
[15:02:26] ua_: has joined #ruby
[15:05:20] queip: has joined #ruby
[15:10:59] dionysus70: has joined #ruby
[15:11:59] jottr: has joined #ruby
[15:18:19] ldnunes: has joined #ruby
[15:23:53] kyrylo: has joined #ruby
[15:26:24] cajone: has joined #ruby
[15:29:22] doodlebug: has joined #ruby
[15:32:51] jottr: has joined #ruby
[15:36:04] shansen: has joined #ruby
[15:52:13] jelera: has joined #ruby
[15:53:42] conta: has joined #ruby
[15:56:07] luminousnine: has joined #ruby
[15:56:07] luminousnine: has joined #ruby
[15:57:53] duderonomy: has joined #ruby
[15:59:46] clemens3: has joined #ruby
[15:59:55] tAn: has joined #ruby
[16:01:56] jottr: has joined #ruby
[16:02:00] fphilipe: has joined #ruby
[16:07:50] polishdub: has joined #ruby
[16:08:16] zacts: has joined #ruby
[16:08:19] jelera: has joined #ruby
[16:09:16] IanMalcolm: has joined #ruby
[16:14:22] nowhereman: has joined #ruby
[16:22:51] jottr: has joined #ruby
[16:23:17] tdy1: has joined #ruby
[16:24:38] SeepingN: has joined #ruby
[16:28:14] gix: has joined #ruby
[16:32:17] ech0s7: has joined #ruby
[16:32:46] ech0s7: I'm looking for an elegant way to return an array from a function only if it is not empty
[16:32:53] ech0s7: could you advise a way ?
[16:34:34] rippa: has joined #ruby
[16:37:14] cschneid: has joined #ruby
[16:38:30] fphilipe: has joined #ruby
[16:39:09] Swyper: has joined #ruby
[16:41:14] dsmythe_: has joined #ruby
[16:42:15] blackmesa: has joined #ruby
[16:44:52] jelera: has joined #ruby
[16:45:31] jelera: has joined #ruby
[16:46:17] jelera: has joined #ruby
[16:47:01] jelera: has joined #ruby
[16:47:51] jelera: has joined #ruby
[16:49:38] agent_white: has joined #ruby
[16:50:44] houhoulis: has joined #ruby
[16:51:03] dpapp: has joined #ruby
[16:51:19] dpapp: has left #ruby: ()
[16:57:17] Tempesta: has joined #ruby
[16:57:33] jefffrails35: has joined #ruby
[17:08:29] krawchyk: has joined #ruby
[17:12:33] llua: has joined #ruby
[17:17:13] duderonomy: has joined #ruby
[17:21:13] dsmythe: has joined #ruby
[17:22:03] Swyper: has joined #ruby
[17:24:21] fphilipe: has joined #ruby
[17:25:54] hightower2: has joined #ruby
[17:31:53] fphilipe: has joined #ruby
[17:34:10] krawchyk: has joined #ruby
[17:44:53] Swyper: rspec ./spec/0_hangman_spec.rb:116 # Hangman PART 1 #get_matching_indices should return an array containing all indices of @secret_word where the char can be found
[17:45:24] Swyper: any good methods for arrays which return all indices matching a certain pattern?
[17:46:02] Swyper: I see find_index, and I know I can just iterate through the elements of the array to solve this - just wondering if there a simpler ruby way to implement this
[17:48:01] phaul: &>> [1,2,3,5,7].each_with_index.select { |ix, e| e.odd? }
[17:48:05] rubydoc: # => [[2, 1], [5, 3]] (https://carc.in/#/r/6t2t)
[17:48:54] phaul: hm. obviously ^ doesn't work then
[17:49:25] Swyper: I could do each_with_index and store the indexes where there is a match in a new array
[17:50:13] phaul: ah, it's backwards. each_with_index puts the index to the second elem
[17:50:32] phaul: &>> [1,2,3,5,7].each_with_index.select { |e, ix| e.odd? }
[17:50:33] rubydoc: # => [[1, 0], [3, 2], [5, 3], [7, 4]] (https://carc.in/#/r/6t2u)
[17:53:42] phaul: so you can include the indices, you still get an Enumerator, which is Enumerable, so everything in the Enumerable interface is available select, sort etc
[17:54:04] ramfjord: has joined #ruby
[17:54:25] phaul: it's common to daisy chain Enumerators like that.
[17:55:30] jmcgnh: has joined #ruby
[18:00:23] phaul: you could map down to indices only by chaining a map(&:last) on it.
[18:00:44] phaul: &>> [1,2,3,5,7].each_with_index.select { |e, ix| e.odd? }.map(&:last)
[18:00:45] rubydoc: # => [0, 2, 3, 4] (https://carc.in/#/r/6t2v)
[18:02:12] krawchyk: has joined #ruby
[18:08:43] akem: has joined #ruby
[18:11:12] fphilipe: has joined #ruby
[18:13:11] cthulchu_: has joined #ruby
[18:16:07] Swyper: https://dpaste.de/qbe7
[18:16:16] Swyper: not sure why its not working
[18:16:40] Swyper: expected: [1, 2]
[18:19:58] pupsikov: has joined #ruby
[18:21:37] hightower3: has joined #ruby
[18:21:46] phaul: &>> 'hangman'.split
[18:21:47] rubydoc: # => ["hangman"] (https://carc.in/#/r/6t2y)
[18:22:03] phaul: &>> 'hangman'.chars
[18:22:04] rubydoc: # => ["h", "a", "n", "g", "m", "a", "n"] (https://carc.in/#/r/6t2z)
[18:23:20] phaul: &>> 'hangman'.split('')
[18:23:22] rubydoc: # => ["h", "a", "n", "g", "m", "a", "n"] (https://carc.in/#/r/6t31)
[18:25:01] sameerynho: has joined #ruby
[18:28:25] jmcgnh: has joined #ruby
[18:45:35] planigan: has joined #ruby
[18:56:21] jrafanie: has joined #ruby
[18:58:03] ramfjord_: has joined #ruby
[19:01:32] nowhereman: has joined #ruby
[19:02:26] fphilipe: has joined #ruby
[19:07:05] ngw: has joined #ruby
[19:15:40] krawchyk: has joined #ruby
[19:17:25] dsmythe: has joined #ruby
[19:22:19] kyrylo: has joined #ruby
[19:22:21] PepeLePewPew: has left #ruby: ()
[19:25:42] hightower3: has joined #ruby
[19:25:57] mochiyoda_: has joined #ruby
[19:33:21] vondruch_: has joined #ruby
[19:41:12] violentE: has joined #ruby
[19:43:50] houhoulis: has joined #ruby
[19:45:09] ramfjord: has joined #ruby
[19:48:46] ngw: has joined #ruby
[19:50:53] tdy1: has joined #ruby
[19:57:34] ramfjord: has joined #ruby
[19:57:56] jottr: has joined #ruby
[20:00:13] yos: has joined #ruby
[20:02:47] ua: has joined #ruby
[20:04:50] ngw: has joined #ruby
[20:06:38] eckhardt: has joined #ruby
[20:06:57] Eiam: has joined #ruby
[20:08:29] jenrzzz: has joined #ruby
[20:14:12] yoyo: has joined #ruby
[20:14:56] jottr: has joined #ruby
[20:19:45] doodlebug: has joined #ruby
[20:24:39] lord4163: has joined #ruby
[20:27:03] ngw: has joined #ruby
[20:29:22] nowhere_man: has joined #ruby
[20:30:33] Dbugger: has joined #ruby
[20:31:16] al2o3-cr: has joined #ruby
[20:33:01] waheedi: has joined #ruby
[20:35:42] yxhuvud: has joined #ruby
[20:39:48] cthu|: has joined #ruby
[20:41:21] jottr: has joined #ruby
[20:43:49] jenrzzz: has joined #ruby
[20:45:04] cd: has joined #ruby
[20:47:16] ngw: has joined #ruby
[21:01:25] Fernando-Basso: has joined #ruby
[21:07:38] ngw: has joined #ruby
[21:10:16] ur5us: has joined #ruby
[21:10:35] pupsikov: has joined #ruby
[21:12:08] lupine: has joined #ruby
[21:15:16] jelera: has joined #ruby
[21:19:40] jottr: has joined #ruby
[21:23:47] elcontrastador: has joined #ruby
[21:24:17] lupine: has joined #ruby
[21:24:49] ngw: has joined #ruby
[21:45:07] ngw: has joined #ruby
[21:48:36] jottr: has joined #ruby
[21:54:38] sp01nk: has joined #ruby
[22:05:12] ngw: has joined #ruby
[22:09:31] jottr: has joined #ruby
[22:25:37] ngw: has joined #ruby
[22:29:42] queip: has joined #ruby
[22:33:38] jelera: has joined #ruby
[22:35:45] gix-: has joined #ruby
[22:42:02] tdy1: has joined #ruby
[22:45:24] ur5us: has joined #ruby
[22:45:45] ngw: has joined #ruby
[22:46:23] ur5us: has joined #ruby
[22:55:18] galaxie: has joined #ruby
[22:58:42] comet23: has joined #ruby
[22:59:05] comet23: is lexical scope and local scope the same thing?
[22:59:26] eckhardt: has joined #ruby
[23:00:13] eckhardt: has joined #ruby
[23:00:47] phaul: hm. that can of worm. I opened it in the past and got all my pinkies burnt
[23:01:13] eckhardt: has joined #ruby
[23:01:36] phaul: it's more like " there is many different scopes" and it all depends on the context
[23:01:53] eckhardt: has joined #ruby
[23:01:58] comet23: i thought i had it figured out
[23:02:06] comet23: or at least understood what the text was talking about
[23:02:15] jelera: has joined #ruby
[23:02:45] eckhardt: has joined #ruby
[23:03:05] phaul: probably it was correct, but maybe incomplete. there is scope for constant lookup. there is scope for variablbe lookup, there is the current self, etc
[23:03:35] eckhardt: has joined #ruby
[23:05:51] ngw: has joined #ruby
[23:07:06] comet23: i was just trying to understand lexical scope
[23:07:26] doodleb45: has joined #ruby
[23:10:12] phaul: yeah,. the main thing is to ask, what you are trying to look up. then that defines the scope for it
[23:10:23] dsmythe_: has joined #ruby
[23:15:23] jottr: has joined #ruby
[23:18:34] phaul: I did this thing it might be or might not be useful, but here it is https://github.com/phaul/ruby_101/blob/master/content/book.md#constant-visibility-and-lexical-scopes
[23:18:54] fphilipe: has joined #ruby
[23:24:54] edwardly: has joined #ruby
[23:24:54] edwardly: has joined #ruby
[23:26:02] ngw: has joined #ruby
[23:35:12] clemens3_: has joined #ruby
[23:39:10] _whitelogger: has joined #ruby
[23:39:28] krawchyk: has joined #ruby
[23:44:16] CableNinja: has joined #ruby
[23:45:02] CableNinja: hey guys, I was in here askin last night, but didnt get a response. trying to do an SSL server/client setup (straight tcp/ssl via TCP/SSL network sockets). I'm struggling to get a complete connection. using openssl_sclient I get correct info, but when I connect using the ruby client I get "unexpected message" on the client side, and "wrong version number" on the server side. Both are running on same system, running same ssl version
[23:46:27] ngw: has joined #ruby
[23:47:01] comet23: phaul did you write that page?
[23:58:59] phaul: many many years ago in a galaxy far far away...