« Back to channel list

#ruby - 08 August 2018

Forward 1 day »
[05:56:20] helpa: has joined #ruby
[05:56:35] nowhereFast: has left #ruby: ()
[05:57:49] moei: has joined #ruby
[05:58:18] DTZUZO: has joined #ruby
[06:03:08] alfiemax: has joined #ruby
[06:08:06] snickers: has joined #ruby
[06:08:19] quazimodo: has joined #ruby
[06:10:32] alfiemax: has joined #ruby
[06:11:39] biberu: has joined #ruby
[06:13:13] eckhardt_: has joined #ruby
[06:13:16] apeiros_: has joined #ruby
[06:20:24] rrichardsr3: has joined #ruby
[06:22:07] r29v: has joined #ruby
[06:22:16] nowhere_man: has joined #ruby
[06:26:58] lxsameer: has joined #ruby
[06:30:02] connor_goodwolf: has joined #ruby
[06:30:14] baweaver: https://bugs.ruby-lang.org/issues/6284#change-73367
[06:30:15] baweaver: Nobu got put on composing procs
[06:35:12] havenwood: hooah! I think the << and >> syntax looks really nice. glad nobu is on it!
[06:35:24] aufi: has joined #ruby
[06:35:34] havenwood: patch monster!!
[06:35:36] baweaver: patch monster is in for the kill
[06:35:39] UserOO7: has joined #ruby
[06:37:09] lxsameer: has joined #ruby
[06:41:28] apeiros_: has joined #ruby
[06:41:35] Radar: What's this final business?
[06:43:47] hfp_work: has joined #ruby
[06:47:02] lxsameer: has joined #ruby
[06:47:21] orbyt_: has joined #ruby
[06:47:55] gnufied: has joined #ruby
[06:53:54] dionysus69: has joined #ruby
[07:06:21] snickers: has joined #ruby
[07:07:58] sysvalve: has joined #ruby
[07:11:29] yohji: has joined #ruby
[07:13:05] clemens3: has joined #ruby
[07:15:01] alex``: has joined #ruby
[07:17:11] Mike11: has joined #ruby
[07:20:12] kapil___: has joined #ruby
[07:20:37] valkyr2e: has joined #ruby
[07:23:58] desnudopenguino: has joined #ruby
[07:24:19] avelldiroll: has joined #ruby
[07:32:04] ruskie: has joined #ruby
[07:32:51] alex``: has joined #ruby
[07:33:35] alex``: has joined #ruby
[07:36:49] drale2k_: has joined #ruby
[07:40:10] havenwood: Radar: Seems the extra step of a little sugar on Symbols would be easy to take next. I think it looks pretty nice: https://gist.github.com/havenwood/d305b42f5b542e9de1eaa8e56ba6bdd7#file-compose_procs-rb-L32-L45
[07:41:08] havenwood: "We need more discussion if we would add combination methods to the Symbol class."
[07:41:14] havenwood: Seems nice to add to me.
[07:42:16] TomyWork: has joined #ruby
[07:45:38] ferhaty: has joined #ruby
[07:47:14] apeiros_: amazing that this doesn't need parens
[07:50:22] lxsameer: has joined #ruby
[07:53:46] jmcgnh: has joined #ruby
[08:03:42] mikecmpbll: has joined #ruby
[08:04:31] burgestrand: has joined #ruby
[08:06:50] dionysus69: has joined #ruby
[08:16:12] _aeris_: has left #ruby: ("Konversation terminated!")
[08:19:00] graphene: has joined #ruby
[08:19:08] Beams: has joined #ruby
[08:21:21] desperek: has joined #ruby
[08:26:06] Dbugger: has joined #ruby
[08:32:49] burgestrand: has joined #ruby
[08:40:07] kbsa: has joined #ruby
[08:40:25] quazimodo: has joined #ruby
[08:48:14] aufi: has joined #ruby
[08:50:27] alfiemax: has joined #ruby
[08:53:09] tj-: has joined #ruby
[08:56:31] vondruch: has joined #ruby
[08:57:11] vondruch: has joined #ruby
[08:59:05] rrichardsr3: has joined #ruby
[09:04:07] aufi: has joined #ruby
[09:04:56] UserOO7: has joined #ruby
[09:08:05] graphene: has joined #ruby
[09:12:18] alfiemax_: has joined #ruby
[09:15:51] orbyt_: has joined #ruby
[09:16:31] alem0lars: has joined #ruby
[09:19:02] rrichard_: has joined #ruby
[09:25:49] dhollinger: has joined #ruby
[09:31:57] graphene: has joined #ruby
[09:44:55] yohji: has joined #ruby
[09:45:30] lypsis: has joined #ruby
[10:01:03] drale2k_: has joined #ruby
[10:02:27] vondruch: has joined #ruby
[10:06:19] sleetdrop: has joined #ruby
[10:10:06] burgestrand: has joined #ruby
[10:10:37] alfiemax: has joined #ruby
[10:18:46] graphene: has joined #ruby
[10:23:56] graphene: has joined #ruby
[10:39:09] c0ncealed2: has joined #ruby
[10:45:39] FernandoBasso: has joined #ruby
[10:50:35] SuperL4g: has joined #ruby
[10:51:22] Xeago: has joined #ruby
[10:51:31] tristanp: has joined #ruby
[10:54:51] d^sh: has joined #ruby
[10:55:39] sysvalve: has joined #ruby
[10:59:38] burgestrand: has joined #ruby
[11:05:58] graphene: has joined #ruby
[11:19:46] ineb: whats a good way to design enums in ruby? Something like ["LOW","HIGH","DEFAULT"]. I was thinking about subclassing String and only allow one of these values
[11:21:24] ineb: but i would call it bad design when subclassing a string just to restrict it
[11:23:44] blackmesa: has joined #ruby
[11:30:11] aufi: has joined #ruby
[11:34:59] Nicmavr: has joined #ruby
[11:35:37] graphene: has joined #ruby
[11:35:56] AJA4350: has joined #ruby
[11:37:46] arup_r: has joined #ruby
[11:42:06] graphene: has joined #ruby
[11:44:58] graphene: has joined #ruby
[11:50:18] eblip: has joined #ruby
[11:56:40] vutral|kali: ineb: why dont you use constants
[11:58:25] blackmesa1: has joined #ruby
[12:00:54] ineb: vutral|kali: because its difficult to model COLOR::RED.is_a?(COLOR)
[12:02:09] vutral|kali: how many colors are there
[12:02:53] ineb: plenty :)
[12:03:09] vutral|kali: ineb: there are rails enum and someone wrote an enum class
[12:03:33] vutral|kali: https://github.com/dblock/ruby-enum
[12:04:18] vutral|kali: if i were you i would have a look at the rails enum class
[12:06:38] ineb: vutral|kali: looks like none of them implements it in a way where enums are actual instances of a class but constants
[12:07:01] ineb: which again would make COLOR::RED.is_a?(COLOR) not possible
[12:07:25] vutral|kali: isnt COLOR::RED already a color ?
[12:07:30] vutral|kali: doesnt make much sense to me
[12:08:09] ineb: no RED is a constant that resides inside module COLOR
[12:08:21] vutral|kali: so you still want constants
[12:08:37] ineb: no, that was your suggestion
[12:08:49] ineb: and the way ruby-enum and rails enum class are implementing them
[12:10:14] vutral|kali: if all colors are subclasses to a color class they can be a color and if they are all instances of a color class they can be a color too
[12:10:48] Beams_: has joined #ruby
[12:12:06] ineb: you mean something like class Color; def initialize(color) { @color = color }; RED = Color.new(:red); BLUE = Color.new(:blue); end
[12:13:27] thy0: has joined #ruby
[12:15:02] ineb: it would work.
[12:15:43] SuperLag: has joined #ruby
[12:15:44] vutral|kali: well thats the way its often done in programming
[12:16:08] ineb: havent seen it anywhere yet.
[12:16:12] ineb: but that would mean nothing.
[12:16:18] ineb: or maybe i have and forgot about it :)
[12:16:25] vutral|kali: well they do it in java
[12:16:37] vutral|kali: using constants to initialize classes
[12:17:03] ineb: java has real enums: enum Color { BLUE, RED; };
[12:17:23] vutral|kali: yeah you can get constants from an java enum
[12:17:39] vutral|kali: they work like in c
[12:18:08] vutral|kali: so you just have numbers describing your values
[12:18:41] vutral|kali: you cannot compare these enums
[12:18:59] vutral|kali: value one from one enough is equal to value 1 from another :p
[12:19:41] vutral|kali: the only thing which possibily works is using the enum as type
[12:19:47] ciro: has joined #ruby
[12:19:47] vutral|kali: and that you got a verification on it
[12:21:49] ineb: vutral|kali: in java, BLUE.getClass().getName() would be 'Color' in my definition above
[12:22:03] ineb: i mean Color.BLUE.getClass().getName()
[12:22:43] ineb: but you are right with C enums
[12:24:48] vutral|kali: ineb: if its an instance of color yes
[12:25:45] ineb: it always is in this case
[12:26:28] vutral|kali: well you need to choose what way you do it in i cant tell you whats quicker for your case
[12:26:36] vutral|kali: if quickness is important
[12:27:32] vutral|kali: on most modern computers it shouldnt be much overhead
[12:32:06] graphene: has joined #ruby
[12:32:47] eb0t: has joined #ruby
[12:36:14] nowhere_man: has joined #ruby
[12:41:42] graphene: has joined #ruby
[12:47:07] savolla: has joined #ruby
[12:49:38] UserOO7: has joined #ruby
[12:50:37] fmcgeough: has joined #ruby
[12:52:38] apeiros: >> module Color; Red = "red"; Blue = "blue"; Red.extend Color; Blue.extend Color; end; {color_is_a_color: Color::Red.is_a?(Color), string_is_color: "red".is_a?(Color); value: Color::Red}
[12:52:40] ruby[bot]: apeiros: # => /tmp/execpad-f8e8d7c9edfc/source-f8e8d7c9edfc:2: syntax error, unexpected ';', expecting '}' ...check link for more (https://eval.in/1045741)
[12:52:52] apeiros: >> module Color; Red = "red"; Blue = "blue"; Red.extend Color; Blue.extend Color; end; {color_is_a_color: Color::Red.is_a?(Color), string_is_color: "red".is_a?(Color), value: Color::Red}
[12:52:54] ruby[bot]: apeiros: # => {:color_is_a_color=>true, :string_is_color=>false, :value=>"red"} (https://eval.in/1045742)
[12:53:07] apeiros: vutral|kali: ^
[12:53:17] apeiros: oh, actually ineb ^
[12:53:43] apeiros: (not necessarily the solution I'd prefer, tho)
[12:58:08] alfiemax_: has joined #ruby
[12:58:27] graphene: has joined #ruby
[13:00:25] arup_r: has joined #ruby
[13:06:57] bmurt: has joined #ruby
[13:09:30] dionysus69: has joined #ruby
[13:09:35] darkhanb: has joined #ruby
[13:24:34] burgestrand: has joined #ruby
[13:38:33] dionysus69: has joined #ruby
[13:38:41] TomyWork: has joined #ruby
[13:38:59] TomyWork: has left #ruby: ("Leaving")
[13:41:18] VladGh: has joined #ruby
[13:43:38] vondruch: has joined #ruby
[13:49:55] bauruine: has joined #ruby
[13:54:35] DTZUZO: has joined #ruby
[13:56:56] vondruch: has joined #ruby
[14:00:07] HoierM: has joined #ruby
[14:01:08] bugant: has left #ruby: ()
[14:13:04] donofrio: has joined #ruby
[14:13:46] Rapture: has joined #ruby
[14:13:59] mojtaba: has joined #ruby
[14:14:05] mojtaba: Hello, I am using rails 5.1.6 and ruby 2.5.0.p0. Could you please let me know how should I update to the latest version of rails? (I am using Ubuntu 16.04 LTS)
[14:14:16] mojtaba: Also to update ruby.
[14:14:44] arup_r: has joined #ruby
[14:34:00] Rapture: has joined #ruby
[14:35:24] blackmesa1: has joined #ruby
[14:35:49] rrichardsr3: has joined #ruby
[14:37:52] mojtaba: Hello, I am using rails 5.1.6 and ruby 2.5.0.p0. Could you please let me know how should I update to the latest version of rails? (I am using Ubuntu 16.04 LTS)
[14:46:12] Aetherical: has joined #ruby
[14:46:49] alex``: has joined #ruby
[14:47:45] tuor: has joined #ruby
[14:56:24] akaiiro: has joined #ruby
[14:58:06] apeiros: ?rails mojtaba
[14:58:06] ruby[bot]: mojtaba: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[14:58:10] apeiros: hi Aetherical
[14:58:31] AnLog: has joined #ruby
[14:59:07] Aetherical: Just wanted to say, because of how there's basically no answer on google, i made a gem for linux that can make editable beeps. It's called boopbeep, and it's basic but works great.
[15:00:50] sauvin: has joined #ruby
[15:01:22] rippa: has joined #ruby
[15:01:52] BTRE: has joined #ruby
[15:03:18] blackmesa1: has joined #ruby
[15:06:14] Zaab1t: has joined #ruby
[15:07:04] mynameisdebian: has joined #ruby
[15:07:27] polishdub: has joined #ruby
[15:12:49] Inline: has joined #ruby
[15:12:50] drale2k_: has joined #ruby
[15:22:29] HoierM: has joined #ruby
[15:23:33] graphene: has joined #ruby
[15:24:54] apeiros: Aetherical: 👍🏻
[15:32:45] apeiros_: has joined #ruby
[15:33:08] chouhoulis: has joined #ruby
[15:44:23] AJA4350: has joined #ruby
[15:46:56] g-: has joined #ruby
[15:58:33] apeiros_: has joined #ruby
[16:03:04] HoierM: has joined #ruby
[16:06:54] alem0lars: has joined #ruby
[16:08:34] Mike11: has joined #ruby
[16:10:12] DTZUZO: has joined #ruby
[16:12:44] Axsuul: has joined #ruby
[16:15:07] nowhere_man: has joined #ruby
[16:19:58] ciro: has joined #ruby
[16:25:17] orbyt_: has joined #ruby
[16:35:22] r29v: has joined #ruby
[16:36:34] banisterfiend: has joined #ruby
[16:43:29] akaiiro: has joined #ruby
[16:45:27] ens: has joined #ruby
[16:45:40] ens: hi folks. learning some ruby
[16:46:31] ens: how can i do (firstvar, secondvar) = somestring.split("|", 2) ?
[16:46:52] ens: or do i have to explictly use an array for LHS
[16:47:10] lxsameer: has joined #ruby
[16:48:26] apeiros_: >> firstvar, secondvar = "some|string|foo".split("|", 2)
[16:48:27] ruby[bot]: apeiros_: # => ["some", "string|foo"] (https://eval.in/1045783)
[16:48:42] apeiros_: ok, that was not all that enlightening, let me try again :D
[16:49:00] apeiros_: >> firstvar, secondvar = "some|string|foo".split("|", 2); {first_var: firstvar, second_var: secondvar}
[16:49:02] ruby[bot]: apeiros_: # => {:first_var=>"some", :second_var=>"string|foo"} (https://eval.in/1045784)
[16:49:30] apeiros: and * if you want to be explicit (`a,b = *expr`)
[16:51:07] ens: thanks, that explicit operator looks advanced
[16:52:45] ens: i'm coming from a perl background so this is all very strange to me
[16:53:01] ciro: has joined #ruby
[16:53:29] ens: is there some main differences that i should keep in mind?
[16:53:43] ens: the interpolation of variables seems to be a big one
[16:55:08] Creatornator: has joined #ruby
[16:56:29] za1b1tsu: has joined #ruby
[16:57:11] lxsameer: has joined #ruby
[16:58:12] maryo_: has joined #ruby
[17:07:08] lxsameer: has joined #ruby
[17:08:05] apeiros: ens: the main difference is that everything is blessed in perl terms I guess? (been ages since perl)
[17:15:46] ens: apeiros: true, all things are objects
[17:16:12] ens: and iirc everything is already a pointer so no need to pass by reference
[17:16:46] ens: even regexes are objects which looks really weird at first
[17:17:02] jcarl43: has joined #ruby
[17:17:05] lxsameer: has joined #ruby
[17:19:05] SeepingN: has joined #ruby
[17:19:51] gnufied: has joined #ruby
[17:20:09] Creatornator: has joined #ruby
[17:20:18] ferhaty: has joined #ruby
[17:20:21] [Butch]: has joined #ruby
[17:22:19] snickers: has joined #ruby
[17:24:45] mikecmpbll: has joined #ruby
[17:25:34] apeiros: ens: I think the one thing which catches more people by surprise is that classes are objects too
[17:26:14] apeiros: and I guess one of the pitfalls early on is that everything except nil & false is truthy. i.e. 0, "", [], {} are all truthy expressions.
[17:27:02] lxsameer: has joined #ruby
[17:32:39] nowhere_man: has joined #ruby
[17:34:38] baweaver: [6] pry(main)> -> a, b, *as, **bs, &fn {}.parameters
[17:34:39] baweaver: => [[:req, :a], [:req, :b], [:rest, :as], [:keyrest, :bs], [:block, :fn]]
[17:34:44] baweaver: Oh I'm going to have fun with this.
[17:35:47] apeiros: I fear for the sanity of hundreds of rubyists
[17:36:07] z64: it's a yikes from me
[17:37:02] lxsameer: has joined #ruby
[17:45:15] eckhardt_: has joined #ruby
[17:46:57] baweaver: >> Point = Struct.new(:x, :y); fn = -> x, y { x + y }; asunder=->fn,t{fn.call *fn.parameters.map{|p|t.public_send(p.last)}}; asunder[fn, Point.new(0,3)]
[17:47:02] lxsameer: has joined #ruby
[17:47:04] ruby[bot]: baweaver: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[17:47:25] baweaver: >> Point = Struct.new(:x, :y); fn = -> x, y { x + y }; asunder=->fn,t{fn.call *fn.parameters.map{|p|t.public_send(p.last)}}; asunder[fn, Point.new(0,3)]
[17:47:26] ruby[bot]: baweaver: # => 3 (https://eval.in/1045791)
[17:47:26] baweaver: Work and show this brilliance bot
[17:48:21] g-: has joined #ruby
[17:48:44] graphene: has joined #ruby
[17:52:25] nicesignal: has joined #ruby
[17:55:03] sameerynho: has joined #ruby
[17:56:06] tag: has joined #ruby
[17:57:03] lxsameer: has joined #ruby
[18:00:02] baweaver: apeiros / z64 BEHOLD!
[18:00:10] apeiros: ACTION beholds
[18:00:15] apeiros: ACTION is beheld?
[18:00:30] apeiros: ACTION no english
[18:00:50] baweaver: I've just found a way to do destructured pattern matching
[18:01:53] baweaver: Qo.case(Point.new(0, 3)) { |m| m.when(x: 0) { |x, y| Point.new(1, y) } }
[18:02:03] baweaver: Let the fun begin :)
[18:02:09] safetypin: has joined #ruby
[18:02:48] baweaver: eckhardt_: Come, witness our madness
[18:03:24] eckhardt_: ACTION sprays silver paint on his mouth
[18:03:52] z64: oh dear.
[18:05:28] havenwood: "And I looked, and behold, there was a pale horse, and he that sat on it was Death, and Hades followed close behind him."
[18:05:55] tomaw: has joined #ruby
[18:06:01] apeiros: why's my dog following a pale horse?
[18:06:13] atmosx: has joined #ruby
[18:06:31] apeiros: wait, do I have a pale horse?
[18:06:37] havenwood: apeiros: are you, uhh, riding the pale horse?
[18:06:53] dionysus69: has joined #ruby
[18:07:02] lxsameer: has joined #ruby
[18:08:04] apeiros: na, I'm the origin, death is the end, so should be my sister
[18:10:45] Creatornator: has joined #ruby
[18:14:00] akaiiro: has joined #ruby
[18:17:03] lxsameer: has joined #ruby
[18:17:32] scrptktty: has joined #ruby
[18:17:57] snickers: has joined #ruby
[18:18:45] scottj: has joined #ruby
[18:20:09] alem0lars: has joined #ruby
[18:22:40] miah: is the horse pale due to malnutrition?
[18:27:02] lxsameer: has joined #ruby
[18:37:07] lxsameer: has joined #ruby
[18:40:15] bmurt: has joined #ruby
[18:40:17] HoierM: has joined #ruby
[18:47:09] lxsameer: has joined #ruby
[18:48:27] mojtaba: has joined #ruby
[18:53:28] cthulchu_: has joined #ruby
[18:57:11] lxsameer: has joined #ruby
[18:59:10] mroutis: has joined #ruby
[19:07:09] lxsameer: has joined #ruby
[19:07:18] ogres: has joined #ruby
[19:09:55] rrichardsr3: has joined #ruby
[19:16:58] lxsameer: has joined #ruby
[19:22:05] humam: has joined #ruby
[19:24:33] j416: has left #ruby: ("o/")
[19:26:54] mojtaba: has joined #ruby
[19:27:05] lxsameer: has joined #ruby
[19:27:44] alfiemax_: has joined #ruby
[19:28:21] mrush: has joined #ruby
[19:37:00] lxsameer: has joined #ruby
[19:46:47] beowuff: has joined #ruby
[19:47:02] lxsameer: has joined #ruby
[19:49:48] za1b1tsu: has joined #ruby
[19:52:03] mojtaba: has joined #ruby
[19:54:02] snickers: has joined #ruby
[19:56:35] nowhere_man: has joined #ruby
[19:57:00] lxsameer: has joined #ruby
[20:07:04] lxsameer: has joined #ruby
[20:14:03] psychicist__: has joined #ruby
[20:17:03] lxsameer: has joined #ruby
[20:22:39] mroutis: has joined #ruby
[20:26:36] zenspider: has joined #ruby
[20:26:44] s2013: has joined #ruby
[20:27:05] lxsameer: has joined #ruby
[20:37:06] lxsameer: has joined #ruby
[20:42:58] Creatornator: has joined #ruby
[20:43:12] zenspider: has joined #ruby
[20:46:23] kenichi: has joined #ruby
[20:47:07] lxsameer: has joined #ruby
[20:48:20] blackmesa1: has joined #ruby
[20:57:37] zenspider: gah. something odd is happening on my server. I can't reach gmail's smtp servers. They time out. Confirmed with `swaks` and confirmed that `swaks` works fine in the cafe I'm in... Not sure how to diagnose this
[20:58:48] zenspider: hrm... I can ping the damn thing. I think this is IPv6 BS?!?! but why? "IO::Socket::INET6: connect: timeout"
[20:58:58] zenspider: I have IPv6 set up for link-local only
[21:05:58] Xeago: has joined #ruby
[21:06:35] Legit: has left #ruby: ("WeeChat 2.2")
[21:07:09] zerowaitstate: has joined #ruby
[21:08:39] zerowaitstate: is there an alternative interactive debugger for ruby instead of pry?
[21:21:47] s2013: has joined #ruby
[21:21:54] r29v: has joined #ruby
[21:23:11] miah: i use pry-byebug its still pry, but adds a bunch of useful features
[21:23:25] miah: https://github.com/deivid-rodriguez/pry-byebug
[21:31:47] za1b1tsu: has joined #ruby
[21:38:23] alfiemax: has joined #ruby
[21:41:30] yoshida: has joined #ruby
[21:42:07] lxsameer: has joined #ruby
[21:44:34] yoshida: anyone know why #ruby-lang is a private channel?
[21:44:56] apeiros: yoshida: because #ruby is the official channel and #ruby-lang redirects here.
[21:45:38] yoshida: theres a bunch of websites that reference the other channel
[21:45:41] zenspider: zerowaitstate: you can always use the debugger that ships with ruby. tack on -rdebug
[21:45:51] zenspider: they're old websites then
[21:45:57] apeiros: yoshida: their info is outdated by 2y then.
[21:47:08] lxsameer: has joined #ruby
[21:47:09] apeiros: yoshida: https://www.ruby-lang.org/en/community/
[21:52:05] yoshida: apeiros: crazy, i must be linking to old pages
[21:52:39] apeiros: you could tell the owners of those pages to update :)
[21:53:17] gr33n7007h: has joined #ruby
[21:53:31] yoshida: im on the phone with them right now
[22:01:19] Creatornator: has joined #ruby
[22:09:32] Radar: havenwood: I meant the "final" prefix on the final comment here: https://bugs.ruby-lang.org/issues/6284#change-73367
[22:09:45] Radar: "final plus1_then_times2 = times2 << plus1"
[22:09:47] Radar: what is "final"?
[22:14:47] Nicmavr: has joined #ruby
[22:17:24] yoshida: has joined #ruby
[22:19:32] modin: has joined #ruby
[22:26:58] lxsameer: has joined #ruby
[22:31:08] havenwood: Radar: Oh, that makes more sense... I was wondering what you meant.
[22:34:13] za1b1tsu: has joined #ruby
[22:37:00] lxsameer: has joined #ruby
[22:37:16] gnufied: has joined #ruby
[22:41:37] arooni_team_b: has joined #ruby
[22:41:52] hahuang65: if I have a hash, and I separate them out with `hash.keys` and `hash.values`, am I guaranteed that the index of the values matches the index of the keys?
[22:42:27] sariyar: has joined #ruby
[22:44:13] AJA4350: has joined #ruby
[22:44:45] Radar: hahuang65: I believe it's the case that in modern Ruby versions (I think maybe post 2.2?) that hashes are ordered. So yeah?
[22:46:34] Radar: >> h = ("a".."z").zip(1..26).to_h; h.keys
[22:46:34] Radar: >> h = ("a".."z").zip(1..26).to_h; h.values
[22:46:35] ruby[bot]: Radar: # => ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", ...check link for more (https://eval.in/1045823)
[22:46:36] ruby[bot]: Radar: # => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26] (https://eval.in/1045824)
[22:47:10] Creatornator: has joined #ruby
[22:47:19] Radar: ruby[bot]: why have you forsaken me in my hour of need?
[22:47:42] hahuang65: Radar: lol thanks
[22:47:48] Radar: Oh perhaps it is because I am in the train tunnel.
[22:53:37] Xiti`: has joined #ruby
[22:54:51] mozzarel1: has joined #ruby
[22:55:43] APK: has joined #ruby
[22:56:17] duckpuppy: has joined #ruby
[22:56:53] APK: has joined #ruby
[22:57:39] spiette_: has joined #ruby
[22:57:58] havenwood: hahuang65: Yes, the order is guaranteed to match order of insertion of keys since 1.9.
[22:58:28] miah_: has joined #ruby
[22:59:19] havenwood: hahuang65: It was switched to a doubly-circularly linked list in 1.9 and the docs got the mention: "Hashes enumerate their values in the order that the corresponding keys were inserted."
[22:59:20] havenwood: hahuang65: The ISO spec also mentions that Hashes are ordered.
[23:01:05] fumk: has joined #ruby
[23:01:19] timmow_: has joined #ruby
[23:01:27] hahuang65: havenwood: thanks for the detailed explanation! really appreciate it
[23:01:44] akhkharu: has joined #ruby
[23:02:09] zenspider: hahuang65: why are you calling keys and values separately?
[23:02:24] zenspider: the question itself raises red flags
[23:03:11] syndikate: has joined #ruby
[23:03:22] alnewkirk: has joined #ruby
[23:03:34] armyriad: has joined #ruby
[23:04:09] LightStalker: has joined #ruby
[23:04:49] Paraxial: has joined #ruby
[23:06:07] Caerus: has joined #ruby
[23:06:21] Exagone313: has joined #ruby
[23:07:32] segy: has joined #ruby
[23:07:38] baweaver: :D https://twitter.com/keystonelemur/status/1027329881225408512
[23:07:39] hahuang65: zenspider: I'm not anymore, but I'm doing something similar now... something like this https://gist.github.com/hahuang65/a194c63728b9a4624ca55966706ba4e2
[23:08:11] Alina-malina: has joined #ruby
[23:08:14] cpallares: has joined #ruby
[23:09:34] Cyrus: has joined #ruby
[23:09:46] jetchisel: has joined #ruby
[23:09:57] s2013: has joined #ruby
[23:09:58] valkyr2e: has joined #ruby
[23:10:56] ArahaelPi: has joined #ruby
[23:14:00] ivanskie: has joined #ruby
[23:15:34] setient: has joined #ruby
[23:17:06] lxsameer: has joined #ruby
[23:17:25] infernix: has joined #ruby
[23:18:45] _habnabit: has left #ruby: ()
[23:19:12] jcarl: has joined #ruby
[23:20:57] cschneid_: has joined #ruby
[23:22:03] lxsameer: has joined #ruby
[23:32:12] lxsameer: has joined #ruby
[23:32:32] s2013: has joined #ruby
[23:38:35] felix_vs: has joined #ruby
[23:55:48] Creatornator: has joined #ruby