« Back to channel list

#ruby - 13 December 2017

« Back 1 day Forward 1 day »
[00:00:09] nowhere_man: has joined #ruby
[00:03:26] jackjackdripper1: has joined #ruby
[00:04:42] cagomez: has joined #ruby
[00:09:06] kishmesh: has joined #ruby
[00:10:11] kishmesh: hi. i'm trying to use forwardable module which works fine. however, when I try to forward "sort" to an array, and I call sort on my instance with a block, I get forwardable.rb:229:in `sort': wrong number of arguments (given 1, expected 0) (ArgumentError)
[00:10:15] kishmesh: what is the problem?
[00:14:44] enterprisey: has joined #ruby
[00:16:22] sanscoeur: has joined #ruby
[00:16:57] sanscoeur: has joined #ruby
[00:17:16] mim1k: has joined #ruby
[00:17:42] sanscoeur: has joined #ruby
[00:18:09] knight33: has joined #ruby
[00:19:22] sanscoeur: has joined #ruby
[00:21:07] oetjenj: has joined #ruby
[00:24:49] oetjenj_: has joined #ruby
[00:25:04] ramfjord: has joined #ruby
[00:25:23] elphe: has joined #ruby
[00:26:42] oetjenj: has joined #ruby
[00:27:49] oetjenj__: has joined #ruby
[00:28:43] mikeiniowa: has joined #ruby
[00:29:41] zenspider: kishmesh: how can anyone answer that with that little info?
[00:30:43] mtkd: has joined #ruby
[00:31:05] kishmesh: zenspider: i'm sorry my fault. sorry for the noise. obviously I need some sleep.
[00:31:17] N64N64: has joined #ruby
[00:31:21] ruby[bot]: How to ask the right questions to get you the right answer: https://www.mikeash.com/getting_answers.html
[00:31:44] zenspider: I'd start by providing a gist of what you tried
[00:32:22] charliesome: has joined #ruby
[00:36:16] uZiel: has joined #ruby
[00:38:28] kishmesh: zenspider: please ignore my question. next time I will try to do better. again sorry for the noise.
[00:39:13] Technodrome: has joined #ruby
[00:42:06] alfiemax: has joined #ruby
[00:44:40] allcentury: has joined #ruby
[00:49:34] baweaver: kishmesh: calm down, he's just telling you how to ask questions
[00:49:54] cdg: has joined #ruby
[00:51:07] baweaver: >>class A;extend Forwardable;def_delegators :@a,:size,:sort;def initialize(*a) @a=a end; end; a = A.new(1,2,3); [a.size, a.sort, a.sort { |v| v }]
[00:51:09] ruby[bot]: baweaver: # => uninitialized constant A::Forwardable (NameError) ...check link for more (https://eval.in/918042)
[00:51:41] baweaver: well something like that
[00:51:46] pastorinni: has joined #ruby
[00:52:17] ogres: has joined #ruby
[00:52:26] baweaver: >> class Ary;extend Forwardable;def_delegators :@a,:size,:sort;def initialize(*a) @a=a end; end; a = Ary.new(1,2,3); {size: a.size, sort: a.sort, sort_block: a.sort { |v| v }}
[00:52:27] ruby[bot]: baweaver: # => uninitialized constant Ary::Forwardable (NameError) ...check link for more (https://eval.in/918046)
[00:52:41] baweaver: ah. Well that's just downright silly.
[00:52:50] baweaver: >> require 'forwardable'; class Ary;extend Forwardable;def_delegators :@a,:size,:sort;def initialize(*a) @a=a end; end; a = Ary.new(1,2,3); {size: a.size, sort: a.sort, sort_block: a.sort { |v| v }}
[00:52:51] ruby[bot]: baweaver: # => {:size=>3, :sort=>[1, 2, 3], :sort_block=>[3, 2, 1]} (https://eval.in/918049)
[00:52:51] funkytwig: kishmesh, a gist (https://gist.github.com/) is a way of sharing code with people (call it something like info.rb and it will give you nice colour formatting). Basically copy the code to it and when you create it it makes a link).
[00:53:01] baweaver: there we go
[00:53:41] baweaver: Though really you probably want to just use SimpleDelegator
[00:53:42] baweaver: &ri SimpleDelegator
[00:53:42] `derpy: http://ruby-doc.org/stdlib-2.4.1/libdoc/delegate/rdoc/SimpleDelegator.html
[00:54:04] ResidentBiscuit: has joined #ruby
[00:56:32] enterprisey: has joined #ruby
[01:00:05] chocoelho: has joined #ruby
[01:03:51] jackjackdripper: has joined #ruby
[01:05:35] charliesome: has joined #ruby
[01:06:30] ResidentBiscuit: has joined #ruby
[01:11:03] shinnya: has joined #ruby
[01:13:49] oetjenj: has joined #ruby
[01:14:12] alfiemax: has joined #ruby
[01:14:34] oetjenj: has joined #ruby
[01:15:20] oetjenj: has joined #ruby
[01:16:06] oetjenj: has joined #ruby
[01:16:09] bmurt: has joined #ruby
[01:16:52] oetjenj: has joined #ruby
[01:18:19] veeti: has joined #ruby
[01:20:02] enterprisey: has joined #ruby
[01:21:12] PresidentBiscuit: has joined #ruby
[01:23:24] pilne: has joined #ruby
[01:25:56] Technodrome: has joined #ruby
[01:34:53] jackjackdripper: has joined #ruby
[01:37:08] lele: has joined #ruby
[01:41:30] jackjackdripper: has joined #ruby
[01:41:45] cdg: has joined #ruby
[02:03:11] Dimik: has joined #ruby
[02:04:05] jottr_: has joined #ruby
[02:04:09] alfiemax: has joined #ruby
[02:07:06] oetjenj: has joined #ruby
[02:17:44] mim1k: has joined #ruby
[02:17:48] knight33: has joined #ruby
[02:26:16] shtirlic: has joined #ruby
[02:27:35] ledestin: has joined #ruby
[02:29:50] gizmore|2: has joined #ruby
[02:36:04] mtkd: has joined #ruby
[02:45:30] nankyoku_: has joined #ruby
[02:46:26] d^sh: has joined #ruby
[02:49:02] milardovich: has joined #ruby
[02:56:04] cvander: has joined #ruby
[02:57:09] fclausen: has joined #ruby
[02:59:58] pastorinni: has joined #ruby
[03:00:19] cadillac_: has joined #ruby
[03:06:05] cognoscente: has joined #ruby
[03:08:21] guardianx: has joined #ruby
[03:10:46] sammi`: has joined #ruby
[03:12:06] zenspider: anyone have time to do a code review on a minitest patch?
[03:17:48] jenrzzz_: has joined #ruby
[03:18:15] funburn: has joined #ruby
[03:20:13] rrutkowski: has joined #ruby
[03:20:58] DmitryBochkarev: has joined #ruby
[03:22:02] funburn: has joined #ruby
[03:24:13] uZiel: has joined #ruby
[03:26:00] alfiemax: has joined #ruby
[03:29:47] cajone: has joined #ruby
[03:36:10] havenwood: zenspider: I will have in 20 min if you'd still like then.
[03:39:11] Dykam: has joined #ruby
[03:39:24] funburn: has joined #ruby
[03:40:09] funburn: has joined #ruby
[03:40:50] funburn: has joined #ruby
[03:44:18] QualityAddict: has joined #ruby
[03:49:59] jenrzzz: has joined #ruby
[03:49:59] jenrzzz: has joined #ruby
[03:50:00] cdg: has joined #ruby
[03:55:02] havenwood: zenspider: which patch?
[03:56:54] vikaton: has joined #ruby
[04:01:57] cajone: has joined #ruby
[04:09:00] havenwood: For the most recent commit on master the only comment I'd have is that `@time = Minitest.clock_time - t0` might be worth considering since that bit is time-sensitive and setting the instance variable is faster than the method call.
[04:09:39] Prutheus: has joined #ruby
[04:10:05] Dykam: has joined #ruby
[04:10:16] uZiel: has joined #ruby
[04:12:57] sandroqz: has joined #ruby
[04:14:38] sandroqz: has joined #ruby
[04:15:22] Prutheus: Hello. I am using a bittrex api wrapper for ruby, where I can do a client get request to the api with parameters (see https://github.com/mwerner/bittrex/blob/master/lib/bittrex/client.rb). I want to call /account/getorderhistory (see here https://bittrex.com/home/api). So after i setted up my client with secret and key, i do c.get('account/getorderhistory') this works
[04:15:45] Prutheus: but now, i also wanna pass the optional paramter market, so i do c.get('account/getorderhistory', {market: 'BTC-ETH'})
[04:15:57] Prutheus: but now, i just get returned a nil, why? what am i doing wrong?
[04:16:26] cognoscente: has joined #ruby
[04:18:06] mim1k: has joined #ruby
[04:27:15] gix: has joined #ruby
[04:27:58] jamesaxl: has joined #ruby
[04:28:37] Prutheus: anyone an idea? maybe? please ...
[04:33:08] Prutheus: for getticker it works
[04:33:09] Prutheus: c.get('public/getticker', {market:'USDT-BTC'})
[04:35:19] BTRE: has joined #ruby
[04:50:49] mozzarella: prutheus: what does the server send?
[04:53:54] Prutheus: I dont know, I jsut get nil ... how can I see the resonse without manipulating the gem?
[04:57:09] duderonomy: has joined #ruby
[05:01:33] konsolebox: has joined #ruby
[05:01:56] dtzuzu: has joined #ruby
[05:04:17] Prutheus: mozzarella: ?
[05:04:32] goepsilongo: has joined #ruby
[05:05:05] Exhiled: has joined #ruby
[05:06:13] orbyt_: has joined #ruby
[05:06:38] kryptoz: has joined #ruby
[05:10:06] mozzarella: prutheus: you could use a packet sniffer
[05:10:16] kryptoz: Hi, I have a colleague who told me "Use a map, which will perform better for equality lookups." for "_xx_list.member?(somename)".. I thought both iterate over the list and one cannot be better than the other..
[05:10:28] kryptoz: btw, new to ruby, hence the doubt!
[05:10:59] nofxx__: has joined #ruby
[05:11:32] kryptoz: should I use map or the Array.member? is good?
[05:15:47] mozzarella: kryptoz: how would you use map?
[05:16:39] cognoscente: has joined #ruby
[05:16:45] kryptoz: that was my confusion as well. i thought it two ways, one convert the array to a hash "hash = arr.map {|x| [x,true]}.to_h" and then check using has_key?
[05:16:56] mim1k: has joined #ruby
[05:17:13] kryptoz: or "arr.map { |x| true if x == 'name' }.any?"
[05:17:27] kryptoz: either way it looks complicated than arr.member?
[05:17:35] DmitryBochkarev: has joined #ruby
[05:18:54] oetjenj: has joined #ruby
[05:19:42] apeiros: mozzarella: your collegue means Hash (aka hashmap)
[05:19:50] apeiros: kryptoz: ^
[05:20:27] kryptoz: @apeiros so the first method works?
[05:20:33] apeiros: and no, a hash does not need to iterate its entries to find a key. which it's why hash.include?(key) is much faster than array.include?(value)
[05:21:11] apeiros: yes. once you've built your hash, it'll be quite a bit faster.
[05:21:18] kryptoz: that explains..!
[05:21:26] kryptoz: thank you so much @apeiros
[05:21:36] apeiros: assuming you mean `hash = arr.map {|x| [x,true]}.to_h` by "first method"
[05:21:49] kryptoz: that was what I meant !
[05:21:53] kryptoz: thank you!
[05:21:54] apeiros: you can also use set: `set = arr.to_set; set.include?(x)`
[05:22:05] apeiros: it internally does exactly what your code does
[05:23:16] kryptoz: great! thank you so much for helping me with the doubt! :)
[05:30:12] rhebz916: has joined #ruby
[05:33:50] dtzuzu: has joined #ruby
[05:34:17] aupadhye: has joined #ruby
[05:44:27] Technodrome: has joined #ruby
[05:45:14] iamarun: has joined #ruby
[05:46:23] Dykam: has joined #ruby
[05:46:39] spectrum: has joined #ruby
[05:53:36] oetjenj: has joined #ruby
[05:57:00] anisha: has joined #ruby
[05:58:16] waveprop: has joined #ruby
[05:59:10] Dykam: has joined #ruby
[06:03:35] anisha: has joined #ruby
[06:03:36] cognoscente: has joined #ruby
[06:05:30] reber: has joined #ruby
[06:06:51] djbkd_: has joined #ruby
[06:06:55] uZiel: has joined #ruby
[06:11:25] konsolebox: has joined #ruby
[06:12:24] uZiel: has joined #ruby
[06:19:05] rrutkowski: has joined #ruby
[06:19:50] mjolnird: has joined #ruby
[06:21:59] rrutkowski: has left #ruby: ()
[06:22:51] rrutkowski: has joined #ruby
[06:35:05] reber: has joined #ruby
[06:38:41] DTZUZO: has joined #ruby
[06:39:27] Dimik: has joined #ruby
[06:40:36] reber: has joined #ruby
[06:41:06] rabajaj: has joined #ruby
[06:41:45] char_var[buffer]: has joined #ruby
[06:48:36] nfsnobody: has joined #ruby
[06:52:35] LocaMocha: has joined #ruby
[06:57:25] char_var[buffer]: has joined #ruby
[06:57:33] fclausen_: has joined #ruby
[07:01:07] aufi: has joined #ruby
[07:01:31] jnyw: has joined #ruby
[07:03:22] kies: has joined #ruby
[07:04:42] enterprisey: has joined #ruby
[07:07:19] alex``: has joined #ruby
[07:08:58] LocaMocha: has joined #ruby
[07:10:03] jenrzzz: has joined #ruby
[07:10:03] jenrzzz: has joined #ruby
[07:11:35] shady0wl_: has joined #ruby
[07:11:41] alex``: has joined #ruby
[07:15:26] dionysus69: has joined #ruby
[07:16:51] roshanavand: has joined #ruby
[07:18:24] rrutkowski: has joined #ruby
[07:19:00] cognoscente: has joined #ruby
[07:22:15] cadillac_: has joined #ruby
[07:23:44] ur5us: has joined #ruby
[07:26:14] andikr: has joined #ruby
[07:26:22] LocaMocha: has joined #ruby
[07:27:50] djbkd: has joined #ruby
[07:29:26] despai: has joined #ruby
[07:29:40] ur5us: has joined #ruby
[07:30:36] kryptoz: has joined #ruby
[07:32:35] jenrzzz: has joined #ruby
[07:32:35] jenrzzz: has joined #ruby
[07:39:00] LocaMocha: has joined #ruby
[07:41:48] bkxd: has joined #ruby
[07:42:15] anisha: has joined #ruby
[07:50:24] bkxd_: has joined #ruby
[07:50:38] cdg: has joined #ruby
[07:52:38] dreamthese: has joined #ruby
[07:57:35] plexigras: has joined #ruby
[07:58:00] jackjackdripper: has joined #ruby
[07:59:11] JaccoP: has joined #ruby
[08:02:26] agent_white: has joined #ruby
[08:06:00] InfinityFye: has joined #ruby
[08:06:37] conta: has joined #ruby
[08:07:05] InfinityFye: has left #ruby: ()
[08:10:02] Mon_Ouie: has joined #ruby
[08:13:15] lytol_: has joined #ruby
[08:16:13] TomyWork: has joined #ruby
[08:19:13] cognoscente: has joined #ruby
[08:22:11] ur5us: has joined #ruby
[08:22:20] jenrzzz: has joined #ruby
[08:22:20] jenrzzz: has joined #ruby
[08:23:59] larcara: has joined #ruby
[08:29:55] mark_66: has joined #ruby
[08:32:37] howdoi: has joined #ruby
[08:35:38] bkxd: has joined #ruby
[08:38:27] pwnd_nsfw: has joined #ruby
[08:41:36] agent_white: has joined #ruby
[08:42:50] Beams: has joined #ruby
[08:43:00] Sparda: has joined #ruby
[08:43:20] Sparda: Please let me know if anyone is online. I would like some help.
[08:52:02] anisha: has joined #ruby
[08:52:32] claudiuinberlin: has joined #ruby
[08:54:38] biberu: has joined #ruby
[08:56:15] Sparda: Hello anyone online yet?
[08:56:49] RougeT430: has joined #ruby
[08:57:13] RevanOne: has joined #ruby
[09:00:32] guille-moe: has joined #ruby
[09:03:15] mtkd: has joined #ruby
[09:05:27] Emmanuel_Chanel: has joined #ruby
[09:06:03] Emmanuel_Chanel: has joined #ruby
[09:08:31] funkytwig: has joined #ruby
[09:13:59] Defenestrate: has joined #ruby
[09:13:59] Defenestrate: has joined #ruby
[09:15:34] jamesaxl: has joined #ruby
[09:16:49] Emmanuel_Chanel: has joined #ruby
[09:18:49] jnollette: has joined #ruby
[09:19:27] cognoscente: has joined #ruby
[09:19:31] burgestrand: has joined #ruby
[09:21:14] bkxd: has joined #ruby
[09:23:09] qba73: has joined #ruby
[09:26:54] jenrzzz: has joined #ruby
[09:26:54] jenrzzz: has joined #ruby
[09:28:00] xco: has joined #ruby
[09:28:17] xco: hi. are these two methods equivalent? https://gist.github.com/xcobar/fb0511731aaf3e4a4b5cc83f3dcb3ab8
[09:29:06] alfiemax: has joined #ruby
[09:29:54] anas: has joined #ruby
[09:31:38] burgestrand: no, exit conditions are different
[09:32:10] lele: has joined #ruby
[09:32:17] hfp_work: has joined #ruby
[09:33:31] xco: Burgestrand: thanks. how about generate_token1 vs generate_token3? https://gist.github.com/xcobar/fb0511731aaf3e4a4b5cc83f3dcb3ab8
[09:33:46] Puppet`: has joined #ruby
[09:37:03] jenrzzz: has joined #ruby
[09:37:04] jenrzzz: has joined #ruby
[09:37:20] qba73: has joined #ruby
[09:41:55] moei: has joined #ruby
[09:44:10] qba73: has joined #ruby
[09:45:32] rhyselsmore: has joined #ruby
[09:45:54] JaccoP: has joined #ruby
[09:46:04] mochiyoda: has joined #ruby
[09:49:54] konsolebox: has joined #ruby
[09:51:12] alfiemax: has joined #ruby
[09:55:39] xcesariox: has joined #ruby
[09:58:21] guille-moe: has joined #ruby
[09:58:39] mim1k: has joined #ruby
[10:04:12] bkxd_: has joined #ruby
[10:04:55] jaruga: has joined #ruby
[10:05:45] camilasan: has joined #ruby
[10:05:51] bkxd: has joined #ruby
[10:10:25] Cavallari: has joined #ruby
[10:12:17] Musashi007: has joined #ruby
[10:12:49] xco: hi. how can i rewrite this to use “break or next” instead of “return”? https://gist.github.com/xcobar/fb0511731aaf3e4a4b5cc83f3dcb3ab8
[10:13:17] dminuoso: xco: Your question does not make much sense.
[10:13:53] dminuoso: xco: `next` is basically `return` for blocks, and `break` is `return` for loops.
[10:14:18] xco: dminuoso: i asked because i’m using rubocop and it’s warning me with this suggestion “Non-local exit from iterator, without return value. next, break, Array#find, Array#any?, etc. is preferred.”
[10:14:30] dminuoso: xco: Can you please gist the code with the context?
[10:14:50] dminuoso: xco: Is this possibly inside a block?
[10:14:55] sepp2k: has joined #ruby
[10:15:00] xco: one sec i’ll show you
[10:16:14] xco: dminuoso: here https://gist.github.com/xcobar/fb0511731aaf3e4a4b5cc83f3dcb3ab8#file-rb-rb-L16
[10:16:34] dminuoso: xco: Ah yes. The problem is `return` does not what you think it does.
[10:16:36] dminuoso: 11:13 dminuoso | xco: `next` is basically `return` for blocks, and `break` is `return` for loops.
[10:17:00] dminuoso: xco: Let's consider a block an anonymous function, equivalent to a proc{} ok?
[10:18:21] dminuoso: xco: Inside a proc the keyword `return` does not return from the `proc` for super annoying reasons.
[10:18:31] dminuoso: What is `return` to a method or a lambda, is `next` to a block
[10:18:53] dminuoso: `return` will do this: it will stop execution and return from the current *method* that is being evaluated.
[10:19:07] dminuoso: Which is some test runner method from your test framework.
[10:19:29] dminuoso: xco: So just use `next` or use a lambda.
[10:19:30] qba73: has joined #ruby
[10:19:42] cognoscente: has joined #ruby
[10:19:56] xco: so i can just replace “return” with “next” in this case?
[10:20:01] Technodrome: has joined #ruby
[10:20:06] dminuoso: xco: If your intend is to skip the rest of the test, yes.
[10:20:25] dminuoso: xco: though I think what you are doing is ill-conceived.
[10:20:53] dminuoso: xco: https://gist.github.com/xcobar/fb0511731aaf3e4a4b5cc83f3dcb3ab8#file-rb-rb-L14-L19 this region of code does not clearly test behavior
[10:21:09] dminuoso: It admits that for any `i` there is two (possibly random!) behehaviors.
[10:22:31] xco: dminuoso: thank you. i’m making changes
[10:23:16] qba73: has joined #ruby
[10:26:31] EXCHGR: has joined #ruby
[10:28:16] dminuoso: xco: Also the `return` is unnecessary because there's no further code anyway. So there's that as well.
[10:28:48] xco: dminuoso: makes sense :)
[10:28:51] dminuoso: xco: Also I dont think you know what that region is testing.
[10:28:58] Serpent7776: has joined #ruby
[10:29:02] dminuoso: xco: Effectively the code region is testing that assert_response does what its supposed to.
[10:29:31] xco: i know that
[10:31:42] bruce_lee: has joined #ruby
[10:31:42] bruce_lee: has joined #ruby
[10:31:45] xco: dminuoso: i change it to this
[10:31:47] xco: https://gist.github.com/xcobar/fb0511731aaf3e4a4b5cc83f3dcb3ab8
[10:31:50] xco: if it makes sense :)
[10:31:59] xco: now that you asked if i know what it’s testing
[10:33:05] dminuoso: xco: Still. Are you trying to test minitest or your (just a guess) rack middleware?
[10:34:06] dminuoso: xco: https://gist.github.com/xcobar/fb0511731aaf3e4a4b5cc83f3dcb3ab8#file-rb-rb-L21-L23 what is this supposed to test?
[10:34:10] dminuoso: You still admit random behavior.
[10:35:00] dminuoso: What if this never produces the rack status code too_many_requests ?
[10:35:27] xco: now you got me thinking
[10:35:28] cognoscente: has joined #ruby
[10:36:59] bonhoeffer: has joined #ruby
[10:37:19] bonhoeffer: how do folks like to install ruby on windows?
[10:37:21] ldnunes: has joined #ruby
[10:37:41] bonhoeffer: i generally like to build from source on mac
[10:37:58] dminuoso: bonhoeffer: RubyInstaller is probably the defacto standard.
[10:38:30] bonhoeffer: dminuoso, thanks
[10:42:25] bonhoeffer: what is msys2?
[10:42:39] bonhoeffer: i chose the system update
[10:43:13] bonhoeffer: whole linux build environment?
[10:45:03] marr: has joined #ruby
[10:47:12] guille-moe: has joined #ruby
[10:47:26] bkxd_: has joined #ruby
[10:48:37] Beams: has joined #ruby
[10:55:25] bkxd: has joined #ruby
[10:56:30] bonhoeffer: has joined #ruby
[10:56:52] bonhoeffer: msys2 recommended on windows?
[10:57:14] Riddell: has joined #ruby
[10:57:25] drowze: has joined #ruby
[10:58:26] Lyubo1: has joined #ruby
[10:58:37] Exagone313: has joined #ruby
[10:58:39] bkxd_: has joined #ruby
[10:58:40] qba73: has joined #ruby
[11:02:17] funburn: has joined #ruby
[11:08:18] mtkd: has joined #ruby
[11:08:29] DTZUZO: has joined #ruby
[11:08:44] konsolebox: has joined #ruby
[11:11:15] ur5us: has joined #ruby
[11:18:53] mikecmpbll: has joined #ruby
[11:20:09] Beams_: has joined #ruby
[11:20:45] karapetyan: has joined #ruby
[11:24:37] bonhoeffer: so with rubyinstaller -- how do you manage packages on windows?
[11:25:07] tlaxkit: has joined #ruby
[11:25:16] sonOfRa: Step 1: Get a Linux VM. Step 2: Install ruby. Step 3: there is no step 3
[11:25:29] bonhoeffer: ha -- true enough
[11:25:46] bonhoeffer: do you use vmware on windows for that?
[11:25:50] sonOfRa: everything on windows is just so ugh
[11:26:01] sonOfRa: No I just run linux
[11:26:09] sonOfRa: Windows gets booted for play, not for work
[11:26:11] konsolebox: has joined #ruby
[11:27:59] dminuoso: bonhoeffer: I do.
[11:28:13] dminuoso: bonhoeffer: I got some mint VMs for developing.
[11:28:26] dminuoso: From what I hear, Ruby on Windows is mostly fine though.
[11:31:03] jenrzzz: has joined #ruby
[11:31:03] jenrzzz: has joined #ruby
[11:31:47] bonhoeffer: maybe -- but installing devkit is difficult for me
[11:32:02] bonhoeffer: looks like it doesn't work with rubyinstaller 2.4 or newer
[11:35:54] karapetyan: has joined #ruby
[11:37:12] milardovich: has joined #ruby
[11:37:29] karapetyan: has joined #ruby
[11:39:04] qba73: has joined #ruby
[11:39:04] karapetyan: has joined #ruby
[11:39:49] karapetyan: has joined #ruby
[11:40:06] char_var[buffer]: has joined #ruby
[11:40:36] bkxd: has joined #ruby
[11:40:43] bonhoeffer: yeah -- on windows, i'm not sure how to get to a "gem install" prompt
[11:41:35] bkxd: has joined #ruby
[11:43:40] qba73: has joined #ruby
[11:43:42] bkxd__: has joined #ruby
[11:44:51] karapety_: has joined #ruby
[11:46:47] tsglove: has joined #ruby
[11:47:33] drowze: has joined #ruby
[11:50:25] zautomata: has joined #ruby
[11:51:12] cognoscente: has joined #ruby
[11:51:17] cdg: has joined #ruby
[11:51:49] zautomata: has joined #ruby
[11:58:24] vtx: has joined #ruby
[11:59:31] vtx: hi guys, if i have a hash of 20 key-value pairs, how can i select a subset of the key-value pairs? e.g. i want to paginate my hash to the client, so how would i skip the first 10 keys, then get the next 5 keys, returning keys and values 10-15 to the client?
[12:07:05] AJA4350: has joined #ruby
[12:07:11] ldnunes: has joined #ruby
[12:07:45] karapetyan: has joined #ruby
[12:10:15] karapetyan: has joined #ruby
[12:12:27] larcara: has joined #ruby
[12:13:49] dviola: has joined #ruby
[12:14:13] milardovich: has joined #ruby
[12:15:12] jaruga: has joined #ruby
[12:16:40] cognoscente: has joined #ruby
[12:18:44] milardovich: has joined #ruby
[12:21:19] jaruga: has joined #ruby
[12:29:34] bkxd: has joined #ruby
[12:31:30] aufi: has joined #ruby
[12:33:13] helpa: has joined #ruby
[12:33:24] funburn: has joined #ruby
[12:33:47] helpa: has joined #ruby
[12:38:30] Amorphia: has joined #ruby
[12:38:54] Amorphia: Hello any suggestions for a CLI parse lib?
[12:39:12] jespada: has joined #ruby
[12:39:50] qba73: has joined #ruby
[12:39:54] jespada: has joined #ruby
[12:43:41] tvw: has joined #ruby
[12:46:22] howdoi: has joined #ruby
[12:47:51] Puffball_: has joined #ruby
[12:48:11] larcara: has joined #ruby
[12:48:56] cdg: has joined #ruby
[12:49:45] govg: has joined #ruby
[12:50:47] shinnya: has joined #ruby
[12:51:17] aufi_: has joined #ruby
[12:56:23] mim1k: has joined #ruby
[12:57:14] guardianx: has joined #ruby
[12:59:33] Defenestrate: has joined #ruby
[12:59:34] Defenestrate: has joined #ruby
[13:00:04] synthroid: has joined #ruby
[13:00:26] vondruch_: has joined #ruby
[13:02:22] DmitryBochkarev: has joined #ruby
[13:02:37] anas: has joined #ruby
[13:02:50] karapetyan: has joined #ruby
[13:04:56] karapetyan: has joined #ruby
[13:05:38] mim1k: has joined #ruby
[13:06:01] karapetyan: has joined #ruby
[13:06:03] knight33: has joined #ruby
[13:07:10] karapetyan: has joined #ruby
[13:07:50] alfiemax: has joined #ruby
[13:08:05] karapetyan: has joined #ruby
[13:09:26] nankyokusei: has joined #ruby
[13:10:24] kapil___: has joined #ruby
[13:11:13] karapetyan: has joined #ruby
[13:12:09] ur5us: has joined #ruby
[13:12:18] karapetyan: has joined #ruby
[13:13:19] mtkd: has joined #ruby
[13:13:20] karapetyan: has joined #ruby
[13:15:26] karapetyan: has joined #ruby
[13:16:04] uZiel: has joined #ruby
[13:16:26] karapetyan: has joined #ruby
[13:16:34] truenito: has joined #ruby
[13:16:54] cognoscente: has joined #ruby
[13:17:08] nankyoku_: has joined #ruby
[13:17:18] hinbody: has joined #ruby
[13:17:34] karapetyan: has joined #ruby
[13:18:36] karapety_: has joined #ruby
[13:19:34] karapetyan: has joined #ruby
[13:20:57] loveablelobster: has joined #ruby
[13:21:37] karapety_: has joined #ruby
[13:22:44] larcara: has joined #ruby
[13:22:51] karapetyan: has joined #ruby
[13:23:39] bmurt: has joined #ruby
[13:23:40] karapetyan: has joined #ruby
[13:24:06] apparition: has joined #ruby
[13:24:20] quobo: has joined #ruby
[13:25:48] karapetyan: has joined #ruby
[13:25:54] vondruch_: has joined #ruby
[13:25:54] truenito: has joined #ruby
[13:26:45] nankyokusei: has joined #ruby
[13:26:48] karapetyan: has joined #ruby
[13:27:33] dviola: has joined #ruby
[13:28:03] karapetyan: has joined #ruby
[13:28:56] Amorphia: has left #ruby: ()
[13:29:03] karapetyan: has joined #ruby
[13:29:58] karapetyan: has joined #ruby
[13:31:02] karapety_: has joined #ruby
[13:32:03] karapetyan: has joined #ruby
[13:33:07] karapetyan: has joined #ruby
[13:33:08] milardovich: has joined #ruby
[13:34:02] karapetyan: has joined #ruby
[13:34:38] im0nde: has joined #ruby
[13:34:41] Ouchy: has joined #ruby
[13:34:42] Ouchy: has joined #ruby
[13:35:03] Ouchy`w: has joined #ruby
[13:35:07] karapetyan: has joined #ruby
[13:36:13] karapetyan: has joined #ruby
[13:37:17] karapety_: has joined #ruby
[13:37:49] ams__: has joined #ruby
[13:38:16] karapetyan: has joined #ruby
[13:38:36] milardovich: has joined #ruby
[13:40:21] karapetyan: has joined #ruby
[13:40:37] gigetoo: has joined #ruby
[13:41:08] nankyoku_: has joined #ruby
[13:41:26] karapetyan: has joined #ruby
[13:43:07] joast: has joined #ruby
[13:43:30] karapetyan: has joined #ruby
[13:44:31] karapety_: has joined #ruby
[13:46:40] karapetyan: has joined #ruby
[13:47:39] karapety_: has joined #ruby
[13:48:11] milardovich: has joined #ruby
[13:48:28] karapetyan: has joined #ruby
[13:49:18] tcopeland: vtx is it a ActiveSupport::OrderedHash? otherwise seems like order would not be guaranteed
[13:49:34] hfp_work: has joined #ruby
[13:52:55] Barrt: has joined #ruby
[13:53:57] znz_jp: has joined #ruby
[13:54:00] alex``: has joined #ruby
[13:58:21] larcara: has joined #ruby
[14:01:03] cdg: has joined #ruby
[14:01:48] Musashi007: has joined #ruby
[14:01:58] burgestrand: Rubys hashes retain insertion order since 2.0 (?), but before that order was undefined
[14:04:48] Bish: has joined #ruby
[14:04:48] Puffball: has joined #ruby
[14:09:29] cdg: has joined #ruby
[14:12:37] cdg_: has joined #ruby
[14:13:11] Beams: has joined #ruby
[14:14:40] Musashi007: has joined #ruby
[14:15:11] aufi: has joined #ruby
[14:16:03] cdg: has joined #ruby
[14:16:22] aufi: has joined #ruby
[14:17:12] cognoscente: has joined #ruby
[14:17:47] truenito1: has joined #ruby
[14:22:52] chocoelho: has joined #ruby
[14:23:12] cdg: has joined #ruby
[14:23:16] allcentury: has joined #ruby
[14:25:58] dminuoso: Burgestrand: break.
[14:26:05] dminuoso: How does it work?
[14:26:08] burgestrand: dminuoso Hammer time
[14:26:34] dminuoso: asm>> f { break }
[14:26:39] dminuoso: ACTION kicks ruby[bot]
[14:27:29] dminuoso: Mmm, so break is like throw.
[14:27:44] dminuoso: What sets up the catch table for break?
[14:27:53] burgestrand: No idea, don't care :p
[14:28:17] alfiemax: has joined #ruby
[14:28:49] dminuoso: https://eval.in/918572
[14:29:09] dminuoso: Is `break` possibly equivalent to `return` ?
[14:30:14] dminuoso: Burgestrand: https://eval.in/918578
[14:30:51] burgestrand: https://eval.in/918579
[14:31:43] dminuoso: Burgestrand: `loop` aside.
[14:31:45] dminuoso: I think its a special case
[14:31:57] dminuoso: For normal blocks `return` seems to compile into the same assembly as `break`
[14:32:03] dminuoso: https://eval.in/918581
[14:32:05] dminuoso: https://eval.in/918580
[14:32:15] burgestrand: You asked if it's equivalent
[14:32:22] burgestrand: Special case or not they're not equivalent :P
[14:32:30] dminuoso: Fair enough.
[14:32:42] larcara: has joined #ruby
[14:33:02] grr123: has joined #ruby
[14:34:26] burgestrand: dminuoso also lambdas make them behave differently https://eval.in/918590
[14:35:20] dminuoso: Burgestrand: with lambda its obvious.
[14:35:54] karapetyan: has joined #ruby
[14:35:58] veeti: has joined #ruby
[14:36:08] DLSteve_: has joined #ruby
[14:36:08] burgestrand: dminuoso how so?
[14:36:13] ltem: has joined #ruby
[14:36:49] dminuoso: Burgestrand: Okay not obvious, but not news.
[14:37:03] safetypin: has joined #ruby
[14:37:09] karapetyan: has joined #ruby
[14:38:01] karapetyan: has joined #ruby
[14:39:01] karapetyan: has joined #ruby
[14:40:02] jamesst20: has joined #ruby
[14:40:06] Psybur: has joined #ruby
[14:40:07] karapety_: has joined #ruby
[14:41:01] Musashi007: has joined #ruby
[14:41:09] karapetyan: has joined #ruby
[14:42:11] karapetyan: has joined #ruby
[14:42:38] Musashi007: has joined #ruby
[14:42:52] aufi: has joined #ruby
[14:43:14] karapetyan: has joined #ruby
[14:43:46] qba73: has joined #ruby
[14:44:01] funburn: has joined #ruby
[14:44:19] karapetyan: has joined #ruby
[14:45:05] burgestrand: dminuoso fun to play with
[14:45:07] burgestrand: https://eval.in/918618
[14:45:23] karapetyan: has joined #ruby
[14:46:27] karapetyan: has joined #ruby
[14:48:16] oleo: has joined #ruby
[14:49:45] bmurt: has joined #ruby
[14:49:45] pastorinni: has joined #ruby
[14:50:22] qba73: has joined #ruby
[14:51:13] aScottishBoat: has joined #ruby
[14:56:56] bmurt: has joined #ruby
[14:59:38] vtx: has joined #ruby
[14:59:50] alfiemax: has joined #ruby
[15:00:52] aScottishBoat: has joined #ruby
[15:03:07] milardovich: has joined #ruby
[15:03:35] LoRez: has joined #ruby
[15:04:16] dalitom_: has joined #ruby
[15:04:32] vondruch: has joined #ruby
[15:04:35] dalitom_: anyone familiar with RBVMOMI
[15:04:56] dalitom_: please help
[15:05:20] pastorinni: has joined #ruby
[15:06:43] dalitom_: how do I get vm OS using rbvmomi ??? please help
[15:07:10] KeyJoo: has joined #ruby
[15:07:36] polishdub: has joined #ruby
[15:08:28] larcara: has joined #ruby
[15:08:37] jamesaxl: has joined #ruby
[15:10:07] despai: has joined #ruby
[15:11:10] aScottishBoat: has joined #ruby
[15:11:25] tcopeland: has joined #ruby
[15:12:20] uZiel: has joined #ruby
[15:12:28] ur5us: has joined #ruby
[15:13:03] mikkelsen: has joined #ruby
[15:14:30] loveablelobster: has joined #ruby
[15:17:24] Guest39900: has joined #ruby
[15:17:25] cognoscente: has joined #ruby
[15:18:26] mtkd: has joined #ruby
[15:18:39] funburn: has joined #ruby
[15:19:29] despai_: has joined #ruby
[15:19:35] Guest39900: ACTION waves
[15:20:10] Guest39900: I have not been on IRC in 20 years... how do I change my nick?
[15:20:19] mikkelsen: Welcome back
[15:20:27] mikkelsen: that's mindblowing to me
[15:20:39] mikkelsen: select the Freenode channel it'll have instructions
[15:20:47] mikkelsen: on choosing your nick and etc/
[15:21:29] FastJack: has joined #ruby
[15:23:58] milardovich: has joined #ruby
[15:24:41] aScottishBoat: has joined #ruby
[15:24:50] Rapture: has joined #ruby
[15:24:56] darix: has joined #ruby
[15:26:42] jkes: OK, thanks @mikkelsen
[15:26:53] jkes: @mikkelsen thanks
[15:27:14] jkes: Oh well. I don't remember how to do this. Either way, I registered my old nick
[15:27:36] jkes: I think I was last on IRC in 1998
[15:28:17] jkes: I need to figure out how to extract a block of text from a txt file
[15:29:15] jkes: standard raw email. I'm trying to get the body. All mime types. Don't care about that yet. I just need to get everything between the first '--' and the ending '--'
[15:29:49] jkes: but, if there are multiple mimes I need to get everything in between, even if it includes '--'
[15:30:38] jkes: So, really, I need to find the first '--' in a text file and the last '--' in a text file and get all in between, including other instances of '--'
[15:31:10] jkes: I know this might be better asked in a regex room so I'm asking in both
[15:33:54] rrutkowski: has joined #ruby
[15:34:38] dinfuehr: has joined #ruby
[15:36:17] karapetyan: has joined #ruby
[15:36:59] nofxx1: has joined #ruby
[15:38:42] rrutkowski: has joined #ruby
[15:42:45] larcara: has joined #ruby
[15:51:03] funburn: has joined #ruby
[15:51:57] kryptoz: has joined #ruby
[15:54:04] rippa: has joined #ruby
[15:54:16] troys: has joined #ruby
[15:59:47] houhoulis: has joined #ruby
[16:00:11] Neptu_: has joined #ruby
[16:04:32] selim: has joined #ruby
[16:05:21] DmitryBochkarev: has joined #ruby
[16:09:06] karapetyan: has joined #ruby
[16:10:42] karapetyan: has joined #ruby
[16:11:07] cognoscente: has joined #ruby
[16:11:57] karapetyan: has joined #ruby
[16:12:22] alfiemax: has joined #ruby
[16:12:55] sagax: has joined #ruby
[16:14:40] cagomez: has joined #ruby
[16:15:25] karapetyan: has joined #ruby
[16:17:13] vtx: has joined #ruby
[16:18:35] larcara: has joined #ruby
[16:18:54] cognoscente: has joined #ruby
[16:20:23] guille-moe: has joined #ruby
[16:23:22] karapetyan: has joined #ruby
[16:23:51] aScottishBoat: jkes, sorry for the MIA
[16:23:56] aScottishBoat: got into a language discussion with a new coworker
[16:24:20] aScottishBoat: well feel free to pick at us here in #ruby. We've a few regex wizards I've seen
[16:25:44] karapetyan: has joined #ruby
[16:27:19] karapetyan: has joined #ruby
[16:29:23] milardovich: has joined #ruby
[16:30:12] qba73: has joined #ruby
[16:30:38] ledestin: has joined #ruby
[16:34:28] karapetyan: has joined #ruby
[16:34:33] larcara: has joined #ruby
[16:35:43] karapetyan: has joined #ruby
[16:38:09] amatas_: has joined #ruby
[16:39:32] guardian: hello, I have a string which is "hello #{foo}". There are reasons that makes it containing #{foo} and not %{foo}. Which means I can't use str % arg -> new_str
[16:39:42] guardian: what's my best bet then?
[16:40:07] guardian: also I control the content of the foo variable and I trust it not to be malicious. It's not user provided
[16:40:22] guardian: I notived eval '"' + s + '"' does what I want but it looks weird
[16:40:28] guardian: is there another way? maybe better?
[16:40:40] dminuoso: guardian: I don't follow.
[16:41:00] dminuoso: Please gist an example that illustrates your question/problem.
[16:41:34] aScottishBoat: gist.github.com
[16:42:38] jackjackdripper: has joined #ruby
[16:44:05] guardian: https://pastebin.ubuntu.com/26177616/
[16:44:13] guardian: is there a more elegant way of doing this?
[16:45:42] synthroid: has joined #ruby
[16:46:21] karapetyan: has joined #ruby
[16:46:25] dminuoso: guardian: I like to use %Q() or %() if the string should also contain ""
[16:46:40] dminuoso: i.e. %("#{foo}")
[16:46:45] dminuoso: %Q("#{foo}")
[16:46:49] dminuoso: "\"#{foo}\""
[16:46:59] dminuoso: Those are three equivalent approaches
[16:47:56] karapetyan: has joined #ruby
[16:48:22] amatas_: Hi all, I'm loading a yaml file with the field "creationTimestamp: 2017-12-12T20:02:51Z" , then if I dump the same hash I get "creationTimestamp: 2017-12-12 20:02:51.000000000 Z" which is a problem in my case.
[16:48:30] amatas_: Sample code: https://gist.github.com/amatas/43b28c86c341feae4dda7ad5e7a37f74
[16:48:36] guardian: dminuoso: thanks will look into it
[16:48:55] guardian: dminuoso: also I failed the pastebin, should have been s = '#{foo}' of course
[16:49:29] amatas_: does someone know what's going on with the timestamp, and give me some clue about how to solve the issue?
[16:49:31] karapetyan: has joined #ruby
[16:49:31] dminuoso: guardian: I hope you don't intend to `eval` that.
[16:49:39] rubycoder37: has joined #ruby
[16:50:19] guardian: sure I do, I control what's inside, and I need the dynamic nature
[16:51:06] karapetyan: has joined #ruby
[16:51:23] cloaked1: has joined #ruby
[16:51:23] cloaked1: has joined #ruby
[16:51:31] guardian: I would have preferred string formatting with %{} but there's another constraint that makes it be s='#{foo}' and not s='%{foo}'
[16:53:29] karapetyan: has joined #ruby
[16:55:04] karapetyan: has joined #ruby
[16:55:50] larcara: has joined #ruby
[16:58:18] dminuoso: amatas_: Im thinking you might have to refine the Psych emitter.
[16:58:19] banisterfiend: has joined #ruby
[16:59:09] amatas_: dminuoso: thanks, I'm reading the https://ruby-doc.org/stdlib-2.4.2/libdoc/psych/rdoc/Psych/Emitter.html
[16:59:14] dminuoso: amatas_: Yup just found it.
[16:59:53] amatas_: but I'm not able to figure out how to do so. I set the "canonical" variable to true with the hope of change the output format
[16:59:54] dminuoso: amatas_: I cant tell you straight away the "clean" solution, but I can tell you exactly *where* and *how* its behaving that way.
[17:00:17] dminuoso: amatas_: (Aside from activating a refinement and monkey patching Psych itself)
[17:00:49] amatas_: dminuoso: I'm a begginer please be patient :D
[17:01:29] dminuoso: amatas_: https://github.com/ruby/ruby/blob/trunk/ext/psych/lib/psych/visitors/yaml_tree.rb#L235-L238
[17:01:32] dminuoso: this visitor calls into
[17:01:40] dminuoso: amatas_: https://github.com/ruby/ruby/blob/trunk/ext/psych/lib/psych/visitors/yaml_tree.rb#L495-L501
[17:01:45] dminuoso: And that's what produces the output.
[17:02:33] rubycoder37: I'm upset all my coworkers are now writing python instead of ruby
[17:02:41] rubycoder37: I feel, lonely
[17:02:51] amatas_: dminuoso: is it possible in ruby to overload the "format_time" method?
[17:02:55] aScottishBoat: aww rubycoder37
[17:03:10] dminuoso: amatas_: No, but you could monkey patch it in a refinement: https://ruby-doc.org/core-2.4.0/doc/syntax/refinements_rdoc.html
[17:03:22] dminuoso: (The refinement makes the monkey patch just local, which is sort of fine)
[17:03:37] dminuoso: (It's super easy to use)
[17:06:07] uZiel: has joined #ruby
[17:06:10] karapetyan: has joined #ruby
[17:06:31] amatas_: dminuoso: thanks!
[17:07:45] veeti: has joined #ruby
[17:07:55] chocoelho: has joined #ruby
[17:09:19] karapetyan: has joined #ruby
[17:12:58] karapetyan: has joined #ruby
[17:13:22] ur5us: has joined #ruby
[17:13:23] dionysus69: has joined #ruby
[17:15:18] karapetyan: has joined #ruby
[17:15:34] d10n-work: has joined #ruby
[17:16:28] karapetyan: has joined #ruby
[17:17:14] karapetyan: has joined #ruby
[17:17:21] mostlybadfly: has joined #ruby
[17:17:22] nofxx: has joined #ruby
[17:19:37] karapetyan: has joined #ruby
[17:21:34] karapetyan: has joined #ruby
[17:23:17] karapety_: has joined #ruby
[17:23:37] mtkd: has joined #ruby
[17:25:10] karapetyan: has joined #ruby
[17:28:19] karapetyan: has joined #ruby
[17:29:32] apeiros: has joined #ruby
[17:29:48] qba73: has joined #ruby
[17:30:19] orbyt_: has joined #ruby
[17:30:25] karapetyan: has joined #ruby
[17:31:20] larcara: has joined #ruby
[17:31:26] ged: has joined #ruby
[17:32:31] mahlon: has joined #ruby
[17:32:47] rubycoder37: has joined #ruby
[17:33:05] brent__: has joined #ruby
[17:36:25] eckhardt: has joined #ruby
[17:38:08] rubycoder37: python developers often brag about their explicit syntax, can someone say why implicit is better in ruby?
[17:39:19] karapetyan: has joined #ruby
[17:40:18] alfiemax: has joined #ruby
[17:40:52] clemens3: has joined #ruby
[17:42:07] Technodrome: has joined #ruby
[17:43:07] apeiros: rubycoder37: uh, you can be as explicit in ruby syntax-wise as you wish
[17:43:50] apeiros: but you're free to tone down explicity to a level where it's explicit enough for the average coder and thus reducing unnecessary noise and actually improve readability.
[17:44:01] rubycoder37: I thought implicit was preferred in ruby
[17:44:16] apeiros: maybe make an example of that so we talk about the same thing
[17:49:00] anas: has joined #ruby
[17:49:33] rubycoder37: I'm not sure avoiding to type () for function calls and not using return is unnecessary noise
[17:49:45] rubycoder37: I like that I don't have to pass self to each function all the time
[17:50:15] Exhiled: has joined #ruby
[17:50:43] rubycoder37: I'm just bitter all my coworkers are writing python and they expect me to do the same
[17:51:32] apeiros: in a method, I'd probably be fine with explicit return
[17:51:40] apeiros: but in all things block? tedious and ugly. I hate it in JS.
[17:51:55] apeiros: and the ()'s add up IMO
[17:52:06] apeiros: there are places I'd prefer people would use more ()'s in ruby, though.
[17:52:33] TomyLobo: has joined #ruby
[17:52:41] aScottishBoat: I first started with Python, so the ()'s are things I do kind of miss
[17:52:43] rubycoder37: TensorFlow is only for Python, that's why
[17:52:56] aScottishBoat: I thought TF was for C++? Or is it just written in C++?
[17:53:16] apeiros: well, ruby & python aren't so different. shouldn't be difficult to just use both.
[17:56:46] lupine: has joined #ruby
[17:57:19] rubycoder37: good thing we'll have new ruby this xmas
[17:58:42] xco: has joined #ruby
[17:58:43] aScottishBoat: I want ruby 3 :(
[17:58:48] aScottishBoat: give it to usss
[17:59:53] rrutkowski: has joined #ruby
[18:00:25] rubycoder37: what will be new in ruby 3?
[18:00:43] Technodrome: has joined #ruby
[18:01:29] rubycoder37: isn't crystal basically ruby 3?
[18:01:59] rubycoder37: or close to that
[18:02:35] aScottishBoat: If I recall there's a lot going on with GC, right?
[18:03:19] milardovich: has joined #ruby
[18:05:56] larcara: has joined #ruby
[18:08:17] modin: has joined #ruby
[18:08:32] jjaii9: has joined #ruby
[18:11:42] allcentury: has joined #ruby
[18:13:14] rubycoder37: apeiros: yes, I get what you mean, I'm also not a big JS fan
[18:13:44] aScottishBoat: anyone like perl?
[18:16:58] havenwood: rubycoder37: While it resembles Ruby aesthetically, Crystal is a substantially different language.
[18:17:14] havenwood: rubycoder37: Crystal's compiler was written in Ruby before they bootstrapped it in Crystal.
[18:17:53] rubycoder37: havenwood: I see
[18:18:44] aScottishBoat: havenwood: it was actually written in Ruby?
[18:18:57] aScottishBoat: Ruby had bindings for LLVM?
[18:19:27] havenwood: aScottishBoat: The creator of YARV has proposed gemifying the GC so it can be swapped out for different implementations in the same Ruby version.
[18:19:39] havenwood: aScottishBoat: If I recall, the compiler produced LLVM IR.
[18:20:04] havenwood: aScottishBoat: #crystal channel would know details.
[18:20:06] Exhiled: has joined #ruby
[18:20:59] mikkelsen: has joined #ruby
[18:21:06] havenwood: aScottishBoat: The GC would use an established API so you could swap it out with experimental GC implementations in gem form.
[18:21:47] havenwood: aScottishBoat: That would be great for experimentally trying out various GC implementations.
[18:22:37] havenwood: aScottishBoat: There're also massive changes proposed to Ruby internals - namely switching from an AST-based IR to a Node-based one with RTL.
[18:23:42] havenwood: aScottishBoat: The JIT proposals are also looking really strong. The JIT can be disabled to save memory or enabled to run faster.
[18:24:07] mikkelsen: has joined #ruby
[18:24:13] Dimik: has joined #ruby
[18:24:27] mikkelsen: havenwood, it's aScottishBoat. God my internet is being severe crap today
[18:24:33] havenwood: Here's the JIT with RTL branch: https://github.com/vnmakarov/ruby/tree/rtl_mjit_branch
[18:24:33] mikkelsen: anyways that's awesome, I love it
[18:24:50] havenwood: ^ that's an amazing piece of work, but it's not ready yet
[18:25:06] rubycoder37: I wonder how difficult it would be to port ruby to TempleOS
[18:25:17] mikkelsen: rubycoder37, what's TempleOS?
[18:25:19] havenwood: or here's the JIT work from the above applied to YARV instead of RTL, which is less ambitious but closer to ready: https://github.com/k0kubun/yarv-mjit
[18:25:25] mikkelsen: oh right nvm yeah I know it
[18:25:36] havenwood: The latter might be adopted while work continues on the former.
[18:26:21] havenwood: mikkelsen: Perl 6 seems nice but I haven't learned it deeply.
[18:27:10] havenwood: rubycoder37: should be doable with mruby
[18:27:39] rubycoder37: Terry A. Davis is the best, but not as crazy as Larry Wall
[18:28:13] rubycoder37: https://www.youtube.com/watch?v=lQu-7DvtPEQ
[18:29:35] kies: has joined #ruby
[18:29:50] rubycoder37: I want to see all programmers making music together like this
[18:30:44] havenwood: rubycoder37: Sam Aaron had a bunch of people dancing at RubyConf after party with Sonic Pi live coding.
[18:31:03] havenwood: rubycoder37: https://www.youtube.com/watch?v=KJPdbp1An2s
[18:32:58] havenwood: An interesting proposal is for frozen Hash and Array literals with a prepended f, like: [1, 2, 3]f
[18:33:19] rubycoder37: havenwood: wow, very nice!
[18:33:53] hahuang65: has joined #ruby
[18:34:06] slester_: has joined #ruby
[18:34:13] havenwood: []f.equal? []f #=> true
[18:34:52] havenwood: well, I guess that's not guaranteed by the proposed spec
[18:34:58] havenwood: implementation-specific
[18:35:03] slester_: Is there a way to run migrations on mock databases with Sequel? Just connecting to mock://postgres and then Sequel::Migrator.run(DB, 'migrations') doesn't seem to actually run them.
[18:35:16] bmurt: has joined #ruby
[18:37:09] dionysus69: has joined #ruby
[18:39:06] discopatrick: has joined #ruby
[18:41:25] larcara: has joined #ruby
[18:42:21] dionysus70: has joined #ruby
[18:44:42] sameerynho: has joined #ruby
[18:45:00] CrazyEddy: has joined #ruby
[18:45:20] vtx: has joined #ruby
[18:49:02] nofxx: has joined #ruby
[18:53:05] jkes: has joined #ruby
[18:53:35] truenito: has joined #ruby
[19:01:31] guille-moe: has joined #ruby
[19:02:06] milardovich: has joined #ruby
[19:05:48] |ifei5g00d: has joined #ruby
[19:07:27] |ifei5g00d: has joined #ruby
[19:11:15] cdg: has joined #ruby
[19:11:29] ur5us: has joined #ruby
[19:12:10] karapetyan: has joined #ruby
[19:13:26] apeiros: havenwood: I assume only shallowly frozen?
[19:13:36] apeiros: ACTION somehow would like []ff for deep-freeze
[19:14:31] bradleyp_: has joined #ruby
[19:14:40] havenwood: apeiros: It raises an error unless all array/hash elements are themselves frozen.
[19:15:17] havenwood: apeiros: But no, it's not deep - because there's no guarantee that the frozen elements themselves don't contain mutable objects.
[19:15:34] havenwood: "The intent is to guarantee immutability only for the array/hash and the elements contained immediately inside it."
[19:15:39] havenwood: apeiros: https://bugs.ruby-lang.org/projects/ruby-trunk/wiki/Frozen_Array_and_Hash_literals_proposal
[19:15:41] larcara: has joined #ruby
[19:15:51] havenwood: https://bugs.ruby-lang.org/issues/8909
[19:15:58] apeiros: I see, thanks
[19:16:29] joelwallis: has joined #ruby
[19:16:35] ramfjord: has joined #ruby
[19:17:02] havenwood: apeiros: Though I guess this got rejected, so nvm!
[19:17:34] havenwood: Somehow I didn't catch that they dropped the f prepend for String.
[19:18:26] havenwood: I guess they have the unary operators for frozen literals now.
[19:18:50] dx7: has joined #ruby
[19:19:48] havenwood: >> s = -''; s.frozen?
[19:19:49] ruby[bot]: havenwood: # => true (https://eval.in/918711)
[19:20:06] havenwood: >> s = -''; s = +s; s.frozen?
[19:20:08] ruby[bot]: havenwood: # => false (https://eval.in/918712)
[19:20:27] dx7: how do i assigned an actual value, if ever a variable does not exists or is nil?
[19:20:48] havenwood: dx_: What have you tried and what was the problem with it?
[19:21:04] dx7: in bash, i do it like m=${x:-13}
[19:21:28] havenwood: dx_: m = x || 13
[19:21:33] dx7: if x exists, then it is assigned to m otheriwes 13 gets assigned
[19:22:09] al2o3-cr: >> [1,2,3].map { |x, y, z| y=z=x; x<<y<<z }
[19:22:10] ruby[bot]: al2o3-cr: # => [4, 32, 192] (https://eval.in/918713)
[19:22:24] dx7: errors here..saying undefined variable or
[19:22:26] baweaver: GOOD MORNING
[19:22:36] baweaver: ACTION is channeling his inner Radar
[19:22:36] havenwood: baweaver: Radar!
[19:24:35] larcara: has joined #ruby
[19:24:37] havenwood: al2o3-cr: or just: [1, 2, 3].map { |n| n << n << n }
[19:24:54] havenwood: #=> [4, 32, 192]
[19:25:21] ule: Hey guys.. do you know if there is a magic way to get a specific value inside a structure doesn't matter if the data is nested or if its a hash or array? This is what I have:
[19:25:22] al2o3-cr: lol, i like mine better :P
[19:25:33] ule: {"class"=>"MyWorker", "args"=>["delivery_message", {"message_id"=>1063283837, "message_version"=>1, "type"=>"Message.vid"}, "2017-12-13 00:10:42 UTC"], "retry"=>true, "queue"=>"default", "jid"=>"7f8cb80d52b1115d63427d65", "created_at"=>1513192240.646089}
[19:25:47] ule: I want the value for that: "message_id"
[19:26:25] King_of_Ireland: has joined #ruby
[19:26:34] ule: but doing something like: foo.first['args'][1]['message_id'] is so ugly
[19:26:51] baweaver: I have a super secret tool that does exactly that
[19:26:53] tobiasvl: ule: what do you want to happen if there are several keys named "message_id" in the nested structure?
[19:27:01] baweaver: buuuuut it's not open source quite yet
[19:27:06] ule: I was expecting that ruby has something like: magic('message_id')
[19:27:30] ule: tobiasvl: That will never happen
[19:27:34] baweaver: It'd do Q(data).query('>message_id')
[19:27:39] ule: it's only that fixed structure always
[19:27:55] ule: baweaver: whaaattt
[19:27:56] baweaver: which says dive until you find anything with a message_id key and grab it for me
[19:28:13] meesles: Q being your liv?
[19:28:14] baweaver: It's my fun time project I'm working on open sourcing
[19:28:23] ule: whats that Q
[19:28:23] tobiasvl: ule: well, in your structure, perhaps, but if ruby had a magic method for it, it would have to consider duplicate keys
[19:28:24] baweaver: Well it's not actually Q
[19:28:28] mtkd: has joined #ruby
[19:28:29] baweaver: but that's a placeholder
[19:28:32] tobiasvl: baweaver: what does it do about duplicate keys
[19:28:43] meesles: Decent idea, I'm a fan of '
[19:28:43] baweaver: It shoves all of it into an array for any matches
[19:28:45] ule: tobiasvl: there is no duplicate keys
[19:28:50] meesles: '>' and syntax like CSS selectors to do stuff
[19:29:06] baweaver: I wanted XPath for Hashes basically
[19:29:06] al2o3-cr: ule: h.dig('args', 1, 'message_id')
[19:29:17] tobiasvl: ule: I understand that there are no duplicate keys in your specific structure.
[19:29:20] al2o3-cr: so much nicer
[19:29:25] tobiasvl: baweaver: cool
[19:29:35] meesles: http://ruby-doc.org/core-2.3.0_preview1/Hash.html#method-i-dig
[19:31:06] baweaver: different from dig in that everything responds to ===, so you can do this: Q(data).query('api.specs.method=/GET|POST/.>key=/message_id/')
[19:31:27] baweaver: ACTION is not fond of the negative lookahead he had to do for .
[19:31:56] baweaver: So any api spec with a method of GET or POST with a message_id key somewhere in it
[19:31:59] alex``: has joined #ruby
[19:32:12] ule: cool thanks guys
[19:32:14] meesles: Harder to read for sure
[19:32:16] baweaver: or if you lop off the _id anything that looks like message
[19:32:17] ule: I'm trying those suggestions here
[19:32:27] tobiasvl: class Hash; alias_method :magic, :dig; end
[19:32:27] meesles: Kind of writing a new DSL
[19:33:55] SeepingN: has joined #ruby
[19:36:01] larcara: has joined #ruby
[19:37:37] alfiemax: has joined #ruby
[19:41:41] conta2: has joined #ruby
[19:42:50] al2o3-cr: meesles: dsl is magical
[19:50:49] larcara: has joined #ruby
[19:55:10] tubbo: has joined #ruby
[19:55:17] tubbo: hey folks, i had a really weird thing happen to me today
[19:55:21] p0p0pr37: has joined #ruby
[19:55:21] p0p0pr37: has joined #ruby
[19:55:38] havenwood: tubbo: Doing your part to Keep Ruby Weird!
[19:55:44] King_of_Ireland: has joined #ruby
[19:55:53] joelwallis: has joined #ruby
[19:56:15] tubbo: haha yup havenwood...so I was trying to override Array#pop and call `super` inside it
[19:56:32] tubbo: apparently, that is not possible because there is no superclass method to call...since Array#pop is actually defined in C, not Ruby.
[19:56:57] al2o3-cr: tubbo: most are.
[19:56:58] tubbo: so is there a way to monkey-patch C-defined ruby methods? or am i SOL here?
[20:01:02] synthroid: has joined #ruby
[20:01:04] apeiros: tubbo: you have a misunderstanding there
[20:01:12] tubbo: most likely, yes
[20:01:20] apeiros: you can't call super because you defined a new pop method
[20:01:41] apeiros: it's entirely unrelated to the method being in C
[20:01:56] apeiros: and the two solutions which come to my mind work the same with ruby methods:
[20:02:17] apeiros: 1: alias, 2: keep an UnboundMethod instance around (via Module#instance_method)
[20:02:47] tubbo: apeiros: i can't really do #1, array.pop *needs* to be called, it can't be like array.my_pop
[20:02:55] tubbo: but #2 sounds interesting to me
[20:03:10] apeiros: array.pop *necessarily* is your new method
[20:03:28] apeiros: oh, 3rd way is new: use prepend
[20:04:06] marr: has joined #ruby
[20:04:12] apeiros: why is it that it can't be "my_pop"?
[20:04:29] apeiros: ACTION usually doesn't believe such blanket claims
[20:04:57] apeiros: re your misunderstanding: what you did is this: `class Foo; def bar; "original"; end; def bar; "boom, original is *gone*"; end; end`
[20:05:13] bmurt: has joined #ruby
[20:06:26] tubbo: apeiros: because i'm trying to make a joke :)
[20:06:48] apeiros: that's not really an explanation
[20:06:56] tubbo: haha true
[20:07:09] tubbo: apeiros: did you hear about that Prongles thing that cards against humanity made?
[20:07:40] cschneid_: has joined #ruby
[20:08:01] tubbo: they made this fake potato chip brand with the slogan "once you pop, that's great"
[20:08:15] tubbo: so i wanted to override Array#pop in a project as a joke to puts "that's great" every time you called it
[20:08:21] apeiros: in a play @ pringles?
[20:08:22] tubbo: which, as it turns out, is a really awful idea lol
[20:08:48] apeiros: ok, I guess you misunderstood the alias variant then
[20:09:22] apeiros: >> class Foo; def bar; "original"; end; alias bar_without_feature; def bar; puts "plopp!"; bar_without_feature; end; end
[20:09:23] ruby[bot]: apeiros: # => /tmp/execpad-061c9628c050/source-061c9628c050:2: syntax error, unexpected ';' ...check link for more (https://eval.in/918729)
[20:09:29] tubbo: Module#prepend worked though
[20:09:29] apeiros: why did I >> that?
[20:09:49] apeiros: anyway, prepend is cleaner IMO. alias was "the old ways" before prepend.
[20:10:19] apeiros: but with ^, you still do: Foo.new.bar, you don't do Foo.new.bar_without_feature (only if you want the old behavior without the new)
[20:10:30] tubbo: >> module Prongles; def pop(*args); puts "that's great"; super(*args); end; end; Array.send(:prepend, Prongles); [].pop
[20:10:32] ruby[bot]: tubbo: # => that's great ...check link for more (https://eval.in/918730)
[20:10:44] apeiros: why'd you use send?
[20:10:56] tubbo: i thought it was private like include
[20:11:04] apeiros: include isn't private
[20:11:05] tubbo: >> module Prongles; def pop(*args); puts "that's great"; super(*args); end; end; Array.prepend(Prongles); [].pop
[20:11:06] ruby[bot]: tubbo: # => that's great ...check link for more (https://eval.in/918731)
[20:11:08] tubbo: it isn't?
[20:11:11] apeiros: for a couple of years now :)
[20:11:14] tubbo: welp, TIL
[20:11:24] apeiros: didn't get the memo? :-p
[20:11:32] apeiros: iirc around 2.1
[20:11:49] apeiros: 21>> module Foo; end; Array.include Foo
[20:11:50] ruby[bot]: apeiros: # => Array (https://eval.in/918732)
[20:11:53] apeiros: 20>> module Foo; end; Array.include Foo
[20:11:55] ruby[bot]: apeiros: # => private method `include' called for Array:Class (NoMethodError) ...check link for more (https://eval.in/918733)
[20:12:08] apeiros: yupp. 2.1 made it public. and prepend never was private to begin with.
[20:14:52] tubbo: si forgot about that
[20:21:28] larcara: has joined #ruby
[20:23:06] jackjackdripper: has joined #ruby
[20:24:13] QualityAddict: has joined #ruby
[20:25:25] veeti: has joined #ruby
[20:25:30] allcentury: has joined #ruby
[20:31:16] jenrzzz: has joined #ruby
[20:31:16] jenrzzz: has joined #ruby
[20:38:27] cschneid_: has joined #ruby
[20:39:01] karapetyan: has joined #ruby
[20:39:19] Ouchy`w: has joined #ruby
[20:40:13] adaedra: Hello rubyists
[20:41:19] ur5us: has joined #ruby
[20:41:22] joelwallis: has joined #ruby
[20:41:54] Ouchy: has joined #ruby
[20:41:55] Ouchy: has joined #ruby
[20:42:29] kapil___: has joined #ruby
[20:43:05] jenrzzz: has joined #ruby
[20:43:05] jenrzzz: has joined #ruby
[20:43:05] vtx: guys are there any easy ways of measuring the performance of a sinatra endpoint? and finding out what calls take a long time to complete?
[20:43:15] ltem: has joined #ruby
[20:43:42] olblak_: has joined #ruby
[20:43:43] tekk: has joined #ruby
[20:43:45] saltsa: has joined #ruby
[20:43:45] AlHafoudh: has joined #ruby
[20:43:49] elomatreb: has joined #ruby
[20:43:50] mistym: has joined #ruby
[20:43:50] mistym: has joined #ruby
[20:43:51] iamayam: has joined #ruby
[20:43:56] jan4: has joined #ruby
[20:43:56] DanKnox: has joined #ruby
[20:43:56] timmow: has joined #ruby
[20:43:59] DarthGandalf: has joined #ruby
[20:44:01] CustosLimen: has joined #ruby
[20:44:15] volix: has joined #ruby
[20:44:16] flips: has joined #ruby
[20:44:16] N64N64: has joined #ruby
[20:44:25] chridal: has joined #ruby
[20:44:29] lunarkitty7: has joined #ruby
[20:46:37] xco: how can i avoid doing status == status in this? https://gist.github.com/xcobar/5cad7617fd651ab3b12bf1cb3ca60b71#file-rb-rb-L10
[20:47:05] orbyt_: has joined #ruby
[20:47:13] xco: i would like to use another variable for the ‘status’ in Status::VALUES.each
[20:47:44] baweaver: What are you actually trying to do here?
[20:47:57] baweaver: if you only have two statuses just write them out
[20:48:04] baweaver: you don't really need define_method there
[20:48:24] bokayio: has joined #ruby
[20:48:41] rhyselsmore: has joined #ruby
[20:48:43] raynold: has joined #ruby
[20:48:48] shortdudey123: has joined #ruby
[20:49:11] baweaver: vtx: Same as most of Ruby, rubyprof or other tools like it
[20:49:25] baweaver: Just look up Ruby performance testing on Google and you'll find a few.
[20:49:57] xco: yeah i have two statuses but i’d like to define methods for both of them. how do i just “write them out”? baweaver ?
[20:50:11] baweaver: literally as methods
[20:50:36] baweaver: def sending; end
[20:51:02] baweaver: though really this sounds a lot like a state machine
[20:51:08] xco: and not def sending; ‘sending’; end?
[20:51:13] baweaver: which is why I mention what you're actually doing
[20:51:21] gbailey: has joined #ruby
[20:51:34] baweaver: it was an example, fill in the blank
[20:52:45] bmurt: has joined #ruby
[20:55:57] milardovich: has joined #ruby
[20:56:23] zautomata: has joined #ruby
[21:00:50] enterprisey: has joined #ruby
[21:00:57] bmurt: has joined #ruby
[21:01:28] cdg: has joined #ruby
[21:02:41] pastorinni: has joined #ruby
[21:03:41] cdg_: has joined #ruby
[21:04:31] veeti: has joined #ruby
[21:04:58] krasnus: has joined #ruby
[21:05:02] eckhardt: has joined #ruby
[21:05:43] karapetyan: has joined #ruby
[21:06:55] joelwallis: has joined #ruby
[21:09:26] Nicmavr: has joined #ruby
[21:10:37] Guest12480: has joined #ruby
[21:10:53] cdg: has joined #ruby
[21:12:22] leah2: has joined #ruby
[21:12:28] dreamthese: has joined #ruby
[21:12:57] WebDawg: has joined #ruby
[21:17:46] darix: has joined #ruby
[21:19:28] BTRE: has joined #ruby
[21:21:27] bmurt: has joined #ruby
[21:27:07] jenrzzz: has joined #ruby
[21:27:07] jenrzzz: has joined #ruby
[21:29:18] PaulCapestany: has joined #ruby
[21:34:50] joelwallis: has joined #ruby
[21:37:17] veeti: has joined #ruby
[21:38:46] mtkd: has joined #ruby
[21:39:40] larcara: has joined #ruby
[21:42:03] aScottishBoat: has joined #ruby
[21:44:30] ChanServ: +o baweaver
[21:45:53] ChanServ: -o baweaver
[21:47:23] Exhiled: has joined #ruby
[21:47:28] zautomata1: has joined #ruby
[21:47:35] mtkd: has joined #ruby
[21:48:45] mahlon: has joined #ruby
[21:48:46] c0ncealed: has joined #ruby
[21:51:24] apeiros: xco: call the block variable `status_value`?
[21:52:32] apeiros: and re writing out: baweaver probably missed the ?, so def sending?; status == 'sending'.freeze'; end # f.ex.
[21:52:52] Pierreb: has joined #ruby
[21:53:44] mtkd: has joined #ruby
[21:55:13] xco: apeiros: i chose to go with writing it out as using a different block variable breaks my test with “NameError: undefined local variable or method `status' for #<Class:0x005566d38e91c8>”
[21:58:25] PaulCapestany: has joined #ruby
[22:00:09] milardovich: has joined #ruby
[22:00:19] jenrzzz: has joined #ruby
[22:00:20] jenrzzz: has joined #ruby
[22:00:38] apeiros: sounds to me like you omitted critical parts in your gist then.
[22:04:17] alfiemax: has joined #ruby
[22:05:22] jenrzzz_: has joined #ruby
[22:05:31] skweek: has joined #ruby
[22:05:39] ikopico: has joined #ruby
[22:09:42] fclausen: has joined #ruby
[22:10:05] milardovich: has joined #ruby
[22:14:39] c0ncealed: has joined #ruby
[22:14:45] mtkd: has joined #ruby
[22:14:45] ahrs: has joined #ruby
[22:15:44] milardovich: has joined #ruby
[22:15:47] cagomez: has joined #ruby
[22:15:59] PaulCapestany: has joined #ruby
[22:23:05] miskatonic: has joined #ruby
[22:29:19] truenito: has joined #ruby
[22:32:30] lucz: has joined #ruby
[22:34:46] jnollette: has joined #ruby
[22:38:18] jenrzzz: has joined #ruby
[22:38:18] jenrzzz: has joined #ruby
[22:40:32] slester_: has joined #ruby
[22:48:26] orbyt_: has joined #ruby
[22:50:50] karapetyan: has joined #ruby
[22:54:13] slester_: has joined #ruby
[22:55:47] Musashi007: has joined #ruby
[22:56:34] _aeris_: has joined #ruby
[22:58:01] simonizor: has joined #ruby
[22:58:03] yana[m]: has joined #ruby
[22:58:11] dman[m]: has joined #ruby
[22:58:51] dtcristo: has joined #ruby
[22:58:51] dtcristo: has joined #ruby
[23:00:42] code_zombie: has joined #ruby
[23:04:06] skweek: has joined #ruby
[23:07:04] Musashi007: has joined #ruby
[23:17:21] milardovich: has joined #ruby
[23:18:00] johnpaul: has joined #ruby
[23:20:03] Neptu_: has joined #ruby
[23:30:46] cagomez: has joined #ruby
[23:36:33] SCHAPiE: has joined #ruby
[23:37:33] milardovich: has joined #ruby
[23:39:18] guardianx: has joined #ruby
[23:41:41] nofxx: has joined #ruby
[23:43:37] Dimik: has joined #ruby
[23:44:34] RyanMcCoskrie: has joined #ruby
[23:46:30] tcopeland: has joined #ruby
[23:47:09] Emmanuel_Chanel: has joined #ruby
[23:48:18] xco: has joined #ruby
[23:54:58] alfiemax: has joined #ruby