« Back to channel list

#ruby - 03 November 2017

« Back 1 day Forward 1 day »
[00:03:39] raul782: has joined #ruby
[00:05:16] shortdudey123: has joined #ruby
[00:05:35] GodFather: has joined #ruby
[00:07:12] darkmorph: has joined #ruby
[00:10:28] cagomez: has joined #ruby
[00:11:18] conta: has joined #ruby
[00:14:27] ehxor: has joined #ruby
[00:16:12] arescorpio: has joined #ruby
[00:16:29] raul782: has joined #ruby
[00:16:33] nopolitica: has joined #ruby
[00:17:47] nowhere_man: has joined #ruby
[00:17:50] Immune: has joined #ruby
[00:21:20] cdg: has joined #ruby
[00:23:29] ddd: has joined #ruby
[00:23:41] enterprisey: has joined #ruby
[00:26:34] ddd: ive got a vars file with var names like default[:foo][:bar] = "baz" and when i try to run erb -r vars.rb i get undefined local variable or method `default' for main:Object
[00:27:51] ddd: how do i make ruby not hate what i am trying to do?
[00:29:42] Ober: default = Hash.new
[00:29:56] nadir: has joined #ruby
[00:31:44] ddd: Ober so easy... thx!
[00:40:25] HasoHax: has joined #ruby
[00:41:17] HasoHax: has left #ruby: ()
[00:51:19] Dimik: has joined #ruby
[00:51:25] MrBismuth: has joined #ruby
[00:51:46] mynameisdebian: has joined #ruby
[00:52:14] neo95: has joined #ruby
[00:55:31] s3nd1v0g1us: has joined #ruby
[00:58:46] goyox86: has joined #ruby
[01:09:59] x0F: has joined #ruby
[01:14:45] baweaver: ddd / Ober : {} is shorter
[01:14:53] baweaver: Though if that's a nested default...
[01:16:07] baweaver: >> hash = Hash.new { |h,k| h[k] = Hash.new(&h.default_proc) }; hash[:a][:b][:c][:d] = 1; hash
[01:16:08] ruby[bot]: baweaver: # => {:a=>{:b=>{:c=>{:d=>1}}}} (https://eval.in/892033)
[01:17:36] nopolitica: has joined #ruby
[01:19:08] mjolnird: has joined #ruby
[01:22:42] cdg: has joined #ruby
[01:23:25] johno84: has joined #ruby
[01:23:49] jphase: has joined #ruby
[01:24:57] cahoots: has joined #ruby
[01:28:29] ehxor: has left #ruby: ()
[01:35:46] veeti: has joined #ruby
[01:37:39] nopolitica: has joined #ruby
[01:38:46] cdg: has joined #ruby
[01:44:00] bronson: has joined #ruby
[01:48:32] ap4y: has joined #ruby
[01:52:08] orbyt_: has joined #ruby
[02:04:25] Rodya_: has joined #ruby
[02:04:28] jenrzzz: has joined #ruby
[02:04:44] jenrzzz: has joined #ruby
[02:04:50] d^sh_: has joined #ruby
[02:08:17] sucks: has joined #ruby
[02:12:38] veeti: has joined #ruby
[02:13:02] RougeR: has joined #ruby
[02:29:03] Xiti: has joined #ruby
[02:35:13] xall: has joined #ruby
[02:39:42] rkoller: has joined #ruby
[02:43:16] guardianx: has joined #ruby
[02:54:59] nofxx: has joined #ruby
[02:58:22] gizmore|2: has joined #ruby
[03:01:45] cdg: has joined #ruby
[03:02:55] sucks_: has joined #ruby
[03:02:59] goyox86: has joined #ruby
[03:04:45] sucks_: has joined #ruby
[03:10:34] agent_white: has joined #ruby
[03:15:10] _whitelogger: has joined #ruby
[03:16:32] uZiel: has joined #ruby
[03:18:20] mjolnird: has joined #ruby
[03:24:47] uneeb: has joined #ruby
[03:27:42] mynameisdebian: has joined #ruby
[03:29:31] bruce_lee: has joined #ruby
[03:29:31] bruce_lee: has joined #ruby
[03:31:36] ramfjord: has joined #ruby
[03:32:24] Devalo: has joined #ruby
[03:32:53] seggy: has joined #ruby
[03:43:09] cagmz: has joined #ruby
[03:43:47] alfiemax: has joined #ruby
[03:44:22] alex``: has joined #ruby
[03:46:37] cosimo_: has joined #ruby
[03:48:22] cadillac_: has joined #ruby
[03:50:25] Technodrome: has joined #ruby
[03:55:44] cdg: has joined #ruby
[03:57:00] alfiemax_: has joined #ruby
[04:03:17] seggy: has joined #ruby
[04:04:03] cschneid_: has joined #ruby
[04:06:42] jenrzzz: has joined #ruby
[04:07:24] enterprisey: has joined #ruby
[04:07:32] ramfjord: has joined #ruby
[04:22:26] sucks__: has joined #ruby
[04:23:53] shinnya: has joined #ruby
[04:23:57] ovidnis: has joined #ruby
[04:25:21] alfiemax: has joined #ruby
[04:33:44] Devalo: has joined #ruby
[04:43:02] ramfjord: has joined #ruby
[04:44:07] AnoHito: has joined #ruby
[04:44:12] AnoHito_: has joined #ruby
[04:44:22] AnoHito: has joined #ruby
[04:44:37] Ropeney: has joined #ruby
[04:46:40] gix: has joined #ruby
[04:51:19] nadir: has joined #ruby
[04:54:37] alfiemax_: has joined #ruby
[04:54:42] sucks_: has joined #ruby
[04:54:48] cadillac_: has joined #ruby
[05:00:37] lexruee: has joined #ruby
[05:04:50] mjolnird: has joined #ruby
[05:06:21] Megamos: has joined #ruby
[05:06:58] ozcanesen: has joined #ruby
[05:09:13] sucks: has joined #ruby
[05:10:39] samlisl_: has joined #ruby
[05:18:01] cdg: has joined #ruby
[05:19:13] soloscshaw: has joined #ruby
[05:19:50] jphase: has joined #ruby
[05:22:02] ramfjord: has joined #ruby
[05:25:40] jackjackdripper: has joined #ruby
[05:32:41] LocaMocha: has joined #ruby
[05:32:42] alfiemax: has joined #ruby
[05:34:52] jphase: has joined #ruby
[05:42:41] alfiemax: has joined #ruby
[05:42:49] alfiemax: has joined #ruby
[05:43:07] aupadhye: has joined #ruby
[05:43:28] govg: has joined #ruby
[05:51:39] anisha: has joined #ruby
[05:52:41] jphase: has joined #ruby
[06:03:37] alfiemax: has joined #ruby
[06:03:55] hxegon: have a OO design question. I have a model class Story, which I have to poll for updates, but the stories come from different sources (blogs, forums, etc.). Is it better to have #poll defined in modules, or have Poller objects which loads stories from DB?
[06:05:29] alfiemax_: has joined #ruby
[06:05:34] mikecmpbll: has joined #ruby
[06:06:56] hxegon: or something else I'm not seeing
[06:09:29] iamarun: has joined #ruby
[06:13:59] baweaver: How does Enumerable work?
[06:14:00] baweaver: What must you define in a class for it to work?
[06:14:23] baweaver: Consider -able modules like Interfaces. Your class must implement a certain method in order to Interface with a Poller so to speak
[06:17:42] hxegon: baweaver: ah, seems obvious now. thanks
[06:18:22] baweaver: You _could_ use inheritance for it as well, but it's my preference to encapsulate shared actionable content instead of object structure
[06:18:58] jordanm: has joined #ruby
[06:19:01] baweaver: otherwise you end up with some really odd inheritance trees for no good reason
[06:19:41] hxegon: yeah, there's no state for #poll to keep track of that stories don't already have
[06:20:32] baweaver: I've also spent a good deal of time in Javascript lately so my habits have shifted a bit
[06:22:50] hxegon: second question, how do I handle storing which pollable module a story is associated with in the DB? Store the pollable module name as a string?
[06:23:45] hxegon: It's straightforward, but want to double check that I'm not missing something obvious here
[06:25:10] _aeris_: has joined #ruby
[06:33:51] jenrzzz: has joined #ruby
[06:33:51] jenrzzz: has joined #ruby
[06:34:03] dionysus69: has joined #ruby
[06:34:14] jenrzzz: has joined #ruby
[06:34:19] jenrzzz: has joined #ruby
[06:36:43] biberu: has joined #ruby
[06:37:20] AnoHito: has joined #ruby
[06:39:08] wunz: has joined #ruby
[06:40:53] ldepandis: has joined #ruby
[06:42:22] JsilverT: has joined #ruby
[06:44:12] aufi: has joined #ruby
[06:46:57] alfiemax: has joined #ruby
[06:49:13] cschneid_: has joined #ruby
[06:49:19] alfiemax_: has joined #ruby
[06:50:01] darkness: has joined #ruby
[06:50:09] alfiemax_: has joined #ruby
[06:53:07] _aeris_: has joined #ruby
[06:55:15] dminuoso: baweaver | [06:20:32] I've also spent a good deal of time in Javascript lately so my habits have shifted a bit
[06:55:18] dminuoso: Haha, I know the feeling.
[06:55:33] dminuoso: The liberty at which I create lambdas these days is incredible.
[06:55:38] dminuoso: Though I think Haskell has influenced me even more.
[06:56:48] reber: has joined #ruby
[07:07:27] iamarun: has joined #ruby
[07:09:18] reber: has joined #ruby
[07:09:54] AnoHito: has joined #ruby
[07:12:10] snickers: has joined #ruby
[07:16:31] alfiemax: has joined #ruby
[07:17:04] dextrey: has joined #ruby
[07:21:52] jackjackdripper: has joined #ruby
[07:22:37] ramfjord: has joined #ruby
[07:28:27] Devalo: has joined #ruby
[07:28:57] jackjackdripper: has joined #ruby
[07:29:23] FahmeF: has joined #ruby
[07:31:50] paranoicsan: has joined #ruby
[07:34:04] conta: has joined #ruby
[07:39:16] whowantstolivefo: has joined #ruby
[07:48:35] spakhm: has joined #ruby
[07:49:03] jenrzzz: has joined #ruby
[07:53:07] Devalo: has joined #ruby
[07:55:51] jenrzzz: has joined #ruby
[07:55:51] jenrzzz: has joined #ruby
[08:18:49] claudiuinberlin: has joined #ruby
[08:26:31] Beams: has joined #ruby
[08:27:00] nowhere_man: has joined #ruby
[08:29:05] mark_66: has joined #ruby
[08:29:11] jenrzzz: has joined #ruby
[08:29:12] jenrzzz: has joined #ruby
[08:29:42] kacper: has joined #ruby
[08:42:08] jphase: has joined #ruby
[08:42:39] burgestrand: has joined #ruby
[08:46:32] gz0: has joined #ruby
[08:46:46] vondruch: has joined #ruby
[08:48:19] nopoliti1: has joined #ruby
[08:49:14] Bish: hello, how would i search with xpath in the default namespace only?
[08:49:37] Bish: (nokogiri)
[08:50:21] dminuoso: ACTION pokes Bish with css selectors
[08:51:18] jphase: has joined #ruby
[08:51:42] kies: has joined #ruby
[08:53:49] dminuoso: Bish: Based on what Im seeing, it looks as if you could do //*[local-name()="Foo"]
[08:56:33] alfiemax_: has joined #ruby
[08:59:47] Bish: dminuoso: googled that too, doesnt quit work
[08:59:59] Bish: or rather.. what is "Foo" in that context, the node name?
[09:05:32] miromanyth: has joined #ruby
[09:06:10] miromanyth: has left #ruby: ("Leaving")
[09:09:09] n13z: has joined #ruby
[09:09:31] brodul: has joined #ruby
[09:12:10] mikecmpbll: has joined #ruby
[09:12:25] cdg: has joined #ruby
[09:16:08] charliesome: has joined #ruby
[09:18:07] Devalo: has joined #ruby
[09:22:49] ramfjord: has joined #ruby
[09:23:26] mim1k: has joined #ruby
[09:25:12] Defenestrate: has joined #ruby
[09:25:12] Defenestrate: has joined #ruby
[09:31:24] quobo: has joined #ruby
[09:35:15] hutch34: has joined #ruby
[09:36:20] Serpent7776: has joined #ruby
[09:40:09] wunz: has joined #ruby
[09:41:45] jphase: has joined #ruby
[09:42:47] soloscshaw: has joined #ruby
[09:42:48] Hexafox[I]: has joined #ruby
[09:43:34] meinside: has joined #ruby
[09:45:07] yabbes: has joined #ruby
[09:46:06] burgestrand: has joined #ruby
[09:47:03] mim1k_: has joined #ruby
[09:51:00] jphase: has joined #ruby
[09:53:01] vondruch: has joined #ruby
[09:54:07] adlerdias: has joined #ruby
[09:57:40] Technodrome: has joined #ruby
[09:58:17] ramfjord: has joined #ruby
[09:58:47] cdg: has joined #ruby
[10:00:09] jphase: has joined #ruby
[10:02:46] jaruga: has joined #ruby
[10:03:31] charliesome: has joined #ruby
[10:04:50] ferr: has joined #ruby
[10:04:56] ferr: has left #ruby: ()
[10:05:02] jphase: has joined #ruby
[10:05:45] mim1k: has joined #ruby
[10:08:28] bruno-: has joined #ruby
[10:10:50] mim1k: has joined #ruby
[10:13:52] ramfjord: has joined #ruby
[10:13:58] jphase: has joined #ruby
[10:18:25] nowhere_man: has joined #ruby
[10:19:11] alfiemax: has joined #ruby
[10:20:30] Devalo: has joined #ruby
[10:23:48] marr: has joined #ruby
[10:34:27] apeiros: has joined #ruby
[10:36:54] jphase: has joined #ruby
[10:40:48] Bish: dminuoso: well, what i want to have all in default namespace
[10:40:51] Bish: that still bugs me
[10:41:36] Bish: >> def y; raise "lol" if rand < 0.01; return "rofl"; rescue; retry;end;
[10:41:46] Bish: >> def y; raise "lol" if rand < 0.01; return "rofl"; rescue; retry;end;
[10:41:47] ruby[bot]: Bish: # => :y (https://eval.in/892333)
[10:42:11] ldnunes: has joined #ruby
[10:43:11] Bish: are the other languages which have a retry as cool as rubys?
[10:43:41] dminuoso: Bish: retry is essentially just a throw/goto in disguise.
[10:43:55] dminuoso: retry is not much different from raise in fact
[10:44:33] Bish: i know.. but i mean in code
[10:45:05] Bish: i know what lies behind is essentially the same
[10:45:13] Bish: but being able to express it that easily is cool
[10:48:01] matthewd: Huh.. Rails contains six retries -- which is about four more than I would've guessed
[10:49:46] howdoi: has joined #ruby
[10:50:39] jphase: has joined #ruby
[10:52:00] Bish: ACTION does not use rails
[10:58:15] govg: has joined #ruby
[10:59:50] jphase: has joined #ruby
[11:00:01] workmad3: has joined #ruby
[11:10:34] yabbes: has joined #ruby
[11:12:24] ayonkhan: has joined #ruby
[11:12:42] ldepandis: has joined #ruby
[11:14:27] cdg: has joined #ruby
[11:17:49] michael4: has joined #ruby
[11:19:55] Technodrome: has joined #ruby
[11:21:15] ludova_: has joined #ruby
[11:24:29] ludova__: has joined #ruby
[11:32:15] tcopeland: has joined #ruby
[11:32:24] Devalo: has joined #ruby
[11:33:15] nowhere_man: has joined #ruby
[11:36:44] ldnunes: has joined #ruby
[11:38:39] Sylario: If have wrapper function def wrapper(a,b,c,d) final_call a,b,c,d end
[11:39:17] hackeron_: has joined #ruby
[11:39:18] Sylario: is there a way , without a lot of if to sometime call wrapper a,b and soemtime call wrapper a,b,c,d ?
[11:39:24] Devalo: has joined #ruby
[11:39:34] Sylario: c and d are optionnal parameters of final_call
[11:40:15] ludova: has joined #ruby
[11:46:50] ludova_: has joined #ruby
[11:50:08] charliesome: has joined #ruby
[11:53:38] alex``: has joined #ruby
[11:54:02] Defenestrate: has joined #ruby
[11:56:37] ludova: has joined #ruby
[11:58:09] jphase: has joined #ruby
[11:58:12] pppktz: Hi guys, I was wondering if it possible to run ruby code without installing Ruby just using the downloaded binaries for ruby 2.3.5?
[11:58:22] pppktz: on a windows machine
[11:59:14] ineb: sylario: yes, there are quite some ways to do it. for example initialize c and d with nil def wrapper(a, b, c = nil, d = nil)
[11:59:58] Sylario: ineb: yes but final call will be finall_call a,b,nil,nil?
[12:00:33] jdawgaz: has joined #ruby
[12:01:04] Sylario: i currently do it ith a "if c && b; finall_call a,b,c,d"
[12:01:29] Sylario: But I was wondering if there was something more elegant
[12:03:12] ludova_: has joined #ruby
[12:05:26] ludova_: has joined #ruby
[12:06:46] synthroid: has joined #ruby
[12:07:17] bmurt: has joined #ruby
[12:08:09] ineb: sylario: sure, make wrapper take variable arguments and pass those to final_call. def wrapper(*args); final_call *args; end
[12:08:41] Sylario: I knew I was missing something
[12:08:43] funburn: has joined #ruby
[12:08:48] Sylario: thanks ineb
[12:11:24] ineb: sylario: to make it more clear that a and b are necessary, you can explicit list them as paramters, def wrapper(a, b, *rest); final_call a, b, *rest; end should work imho. havent tested it
[12:11:49] Sylario: ineb: it's what I am doing
[12:14:11] ineb: pppktz: why not? simply run c:\whatever\ruby.exe -e "puts 'hello world'"
[12:14:45] ineb: it gets interesting if you have gems requirements and so on. but its possible
[12:15:13] funburn_: has joined #ruby
[12:15:24] cdg: has joined #ruby
[12:15:34] quobo: has joined #ruby
[12:17:03] dminuoso: sylario: you can also just create a curried lambda.
[12:17:22] ludova: has joined #ruby
[12:17:23] charliesome_: has joined #ruby
[12:17:37] dminuoso: >> f = -> (a, b=nil) { print a; print b }.curry; f[0]; f[1,2]
[12:17:39] ruby[bot]: dminuoso: # => 012nil (https://eval.in/892438)
[12:17:44] dminuoso: >> f = -> (a, b=nil) { print a; print b }.curry; f.(0); f.(1,2)
[12:17:45] ruby[bot]: dminuoso: # => 012nil (https://eval.in/892439)
[12:17:53] jphase: has joined #ruby
[12:18:35] dminuoso: (Which makes the parameter bindings more obvious than an *args)
[12:19:35] Sylario: ok, this is new
[12:20:10] Sylario: I am not that into functionnal programming yet
[12:20:38] dminuoso: Though I'd argue that if you curry your funciton, you should absolutely not use optional arguments anymore.
[12:21:03] dminuoso: sylario: In my opinion (and this has been greatly influenced by functional paradigms), if you have two styles of invoking a functions with different amount of params, make two functions (or methods)
[12:21:40] dminuoso: Especially if the "extra args" have special meaning.
[12:21:40] Sylario: It's my only call to render in an API
[12:22:09] Sylario: sometimes i want to be more specific about the serializer, especially when I raised AR exceptions
[12:22:25] dminuoso: sylario: use an option hash instead.
[12:22:39] dminuoso: sylario: it's also much clearer on caller site what you are passing.
[12:22:57] ineb: or maybe just an argument with default serializer which can be overwritten
[12:23:08] dminuoso: render :thing, depth: 1, raise: false, serialize_nil_as: 'Nooo'
[12:23:13] dminuoso: render :thing, 1, false, 'Noo'
[12:23:23] Sylario: well, it's not really called, i Use only ! to save and I catch exception, in another shared concern
[12:23:25] dminuoso: You tell me which one is more maintainable.
[12:23:39] doublyx: has joined #ruby
[12:23:41] apeiros_: has joined #ruby
[12:24:59] Sylario: anyway my design is never final, and I'll probably end up with a collection of function in the concern where the render is done
[12:25:47] Sylario: I'll keep all of that in mind, thanks a lot for the lesson dminuoso
[12:26:12] nicesignal: has joined #ruby
[12:26:15] pppktz: thanks, I will try it
[12:26:28] michael4: has joined #ruby
[12:28:47] charliesome: has joined #ruby
[12:31:16] bmurt: has joined #ruby
[12:31:45] guille-moe: has joined #ruby
[12:32:24] InfinityFye: has joined #ruby
[12:32:48] burgestrand: has joined #ruby
[12:34:31] alfiemax_: has joined #ruby
[12:36:34] bruno-: has joined #ruby
[12:49:55] bmurt: has joined #ruby
[12:51:24] synthroid: has joined #ruby
[12:54:06] Psybur: has joined #ruby
[12:58:01] apparition: has joined #ruby
[12:58:45] synthroid: has joined #ruby
[13:01:37] jphase: has joined #ruby
[13:03:53] alnewkirk: has joined #ruby
[13:06:33] shinnya: has joined #ruby
[13:06:50] guille-moe: has joined #ruby
[13:08:20] cdg: has joined #ruby
[13:08:22] tvw: has joined #ruby
[13:09:53] ahrs: has joined #ruby
[13:12:33] alan_w: has joined #ruby
[13:18:47] hfp_work: has joined #ruby
[13:18:49] charliesome_: has joined #ruby
[13:21:35] kacper_: has joined #ruby
[13:21:40] mson: has joined #ruby
[13:22:03] lexruee: has joined #ruby
[13:23:51] michael4: has joined #ruby
[13:30:19] rikkipitt: has joined #ruby
[13:31:18] funburn: has joined #ruby
[13:34:23] chouhoulis: has joined #ruby
[13:35:07] chouhoul_: has joined #ruby
[13:35:26] GodFather: has joined #ruby
[13:35:40] rikkipitt: has joined #ruby
[13:38:06] ldnunes: has joined #ruby
[13:38:41] oleo2: has joined #ruby
[13:38:53] charliesome: has joined #ruby
[13:39:08] GodFather: has joined #ruby
[13:42:25] nadir: has joined #ruby
[13:42:54] eclm: has joined #ruby
[13:47:40] memo1: has joined #ruby
[13:47:51] JsilverT: has joined #ruby
[13:49:56] JsilverT: has joined #ruby
[13:53:22] jrafanie: has joined #ruby
[13:54:37] PaulCapestany: has joined #ruby
[13:54:48] chouhoulis: has joined #ruby
[13:55:33] dinfuehr: has joined #ruby
[13:57:13] JsilverT: has joined #ruby
[14:00:06] guille-moe: has joined #ruby
[14:01:30] darkmorph: has joined #ruby
[14:01:46] mikecmpbll: are there any tools for helping locate and reduce peak memory usage in a ruby program?
[14:03:00] charliesome: has joined #ruby
[14:11:27] oleo: has joined #ruby
[14:12:45] sysvalve: has joined #ruby
[14:14:18] MrBusiness3: has joined #ruby
[14:15:10] chouhoul_: has joined #ruby
[14:16:08] uZiel: has joined #ruby
[14:16:38] dextrey: has joined #ruby
[14:18:07] bruce_lee: has joined #ruby
[14:19:51] Rapture: has joined #ruby
[14:20:17] chouhoulis: has joined #ruby
[14:20:36] veeti: has joined #ruby
[14:22:21] moei: has joined #ruby
[14:23:27] synthroid: has joined #ruby
[14:24:00] live__: has joined #ruby
[14:24:34] Technodrome: has joined #ruby
[14:27:07] banisterfiend: has joined #ruby
[14:44:47] claudiuinberlin: has joined #ruby
[14:45:48] cdg: has joined #ruby
[14:47:25] sepp2k: has joined #ruby
[14:51:30] PaulCapestany: has joined #ruby
[14:58:24] cdg: has joined #ruby
[15:00:48] cdg_: has joined #ruby
[15:02:10] cdg__: has joined #ruby
[15:02:49] mikecmpbll: has joined #ruby
[15:04:49] cschneid_: has joined #ruby
[15:04:49] guille-moe: has joined #ruby
[15:05:35] veeti: has joined #ruby
[15:06:49] claudiuinberlin: has joined #ruby
[15:07:07] nogic: has joined #ruby
[15:09:57] guacamole: has joined #ruby
[15:10:54] vipaca: has joined #ruby
[15:12:47] guacamole: has joined #ruby
[15:17:26] guacamole: has joined #ruby
[15:18:18] rippa: has joined #ruby
[15:19:33] FrostCandy: has joined #ruby
[15:21:43] sucks: has joined #ruby
[15:27:27] xixo: has joined #ruby
[15:28:42] xixo: Hi. I'm using VCR to record fixtures, but I'm worried about checking them into version control because it seems they contain sensitive information. What is common practice to deal with this?
[15:28:46] claudiuinberlin: has joined #ruby
[15:29:58] cagomez: has joined #ruby
[15:33:05] havenwood: mikecmpbll: There are a variety of tools. One thing I do as well is use jemalloc, which can really help keep things flat.
[15:33:44] havenwood: mikecmpbll: You can just compile Ruby --with-jemalloc, if you aren't already.
[15:34:16] havenwood: mikecmpbll: ruby memory analysis
[15:34:26] havenwood: mikecmpbll: https://samsaffron.com/archive/2015/03/31/debugging-memory-leaks-in-ruby
[15:34:41] sucks: has joined #ruby
[15:34:42] mikecmpbll: not aware of jemalloc, i shall check it out!
[15:34:57] mikecmpbll: already looked at that post and the useful memory_profiler gem, but both are focussed on leaks
[15:36:22] kculpis: has joined #ruby
[15:37:33] aupadhye: has joined #ruby
[15:39:07] michael4: has joined #ruby
[15:39:19] _aeris_: has joined #ruby
[15:39:30] orbyt_: has joined #ruby
[15:44:37] atmosx: has joined #ruby
[15:49:18] BTRE: has joined #ruby
[15:54:51] pmunt: has joined #ruby
[15:56:32] claudiuinberlin: has joined #ruby
[15:56:33] michael1: has joined #ruby
[15:58:02] synthroid: has joined #ruby
[16:01:08] quobo: has joined #ruby
[16:02:56] cdg: has joined #ruby
[16:07:48] oetjenj: has joined #ruby
[16:08:58] remix2000: has joined #ruby
[16:09:58] dviola: has joined #ruby
[16:10:07] veeti: has joined #ruby
[16:12:04] uZiel: has joined #ruby
[16:14:01] troys: has joined #ruby
[16:15:11] michael1: has joined #ruby
[16:16:09] cdg: has joined #ruby
[16:17:08] eckhardt: has joined #ruby
[16:17:28] mikecmpbll: havenwood : thanks by the way, jemalloc looks really interesting 👍🏼
[16:18:31] jackjackdripper: has joined #ruby
[16:20:56] michael1: has joined #ruby
[16:21:01] conta: has joined #ruby
[16:29:27] uZiel: has joined #ruby
[16:32:09] wald0: has joined #ruby
[16:33:05] conta: has joined #ruby
[16:38:05] cdg_: has joined #ruby
[16:38:15] jottr: has joined #ruby
[16:40:33] kacper: has joined #ruby
[16:42:02] Devalo: has joined #ruby
[16:42:36] nowhere_man: has joined #ruby
[16:42:45] Bish: how do i cleverly change the order of a hash
[16:42:58] Bish: i mean.. i have 4 string keys in a hash, and i want to "set" the order
[16:44:43] Bish: >> [["a","b"],["c","d"],["e","f"],["g","h"]].to_h.sort_by {|k,v| ["g","e","c","d"].find_index(k) }
[16:44:44] ruby[bot]: Bish: # => comparison of NilClass with 2 failed (ArgumentError) ...check link for more (https://eval.in/892682)
[16:44:46] Bish: something like that?
[16:44:54] kacper_: has joined #ruby
[16:46:10] conta: has joined #ruby
[16:46:14] SeepingN: has joined #ruby
[16:47:25] Bish: >> [["a","b"],["c","d"],["e","f"],["g","h"]].to_h.sort_by {|k,v| ["g","e","c","a"].find_index(k) }.to_h
[16:47:27] ruby[bot]: Bish: # => {"g"=>"h", "e"=>"f", "c"=>"d", "a"=>"b"} (https://eval.in/892690)
[16:47:33] Bish: is tehre a quicker way to do that?
[16:47:46] mson: has joined #ruby
[16:47:48] atmosx: has joined #ruby
[16:48:30] veeti: has joined #ruby
[16:50:56] orbyt_: has joined #ruby
[16:51:25] minimalism: has joined #ruby
[16:52:01] anisha: has joined #ruby
[16:52:20] tcopeland: xixo you can filter your cassettes when recording them with https://relishapp.com/vcr/vcr/v/3-0-1/docs/configuration/filter-sensitive-data
[16:54:56] mn3m: has joined #ruby
[16:59:32] nowhereman: has joined #ruby
[17:01:01] ta: has joined #ruby
[17:01:12] vipaca: has joined #ruby
[17:01:19] mochiyoda_: has joined #ruby
[17:09:48] vipaca: has joined #ruby
[17:14:07] Dimik: has joined #ruby
[17:15:57] vipaca: has joined #ruby
[17:17:12] veeti: has joined #ruby
[17:17:13] Emmanuel_Chanel: has joined #ruby
[17:18:06] Xiti: has joined #ruby
[17:18:18] dextrey: has joined #ruby
[17:22:28] vipaca: has joined #ruby
[17:26:12] vipaca: has joined #ruby
[17:26:38] guacamole: has joined #ruby
[17:27:43] sucks: has joined #ruby
[17:28:08] sucks: has joined #ruby
[17:30:05] guacamole: has joined #ruby
[17:31:19] Freshnuts: has joined #ruby
[17:33:27] vipaca: has joined #ruby
[17:34:49] lexruee: has joined #ruby
[17:38:51] veeti: has joined #ruby
[17:38:57] jenrzzz: has joined #ruby
[17:38:57] jenrzzz: has joined #ruby
[17:39:02] SuperLag: has joined #ruby
[17:41:05] vipaca: has joined #ruby
[17:45:51] kacper: has joined #ruby
[17:46:11] kacper_: has joined #ruby
[17:47:34] orbyt_: has joined #ruby
[17:50:37] jottr: has joined #ruby
[17:58:33] alfiemax: has joined #ruby
[18:00:06] Technodrome: has joined #ruby
[18:00:08] claudiuinberlin: has joined #ruby
[18:00:40] brendan-: has joined #ruby
[18:12:14] scatterp: has joined #ruby
[18:14:14] SeepingN: has joined #ruby
[18:18:59] ramfjord: has joined #ruby
[18:26:04] raynold: has joined #ruby
[18:27:23] cagomez: has joined #ruby
[18:29:22] romain_t: has joined #ruby
[18:30:28] romain_t: has joined #ruby
[18:33:17] _main_: has joined #ruby
[18:36:04] ltem: has joined #ruby
[18:37:08] chouhoulis: has joined #ruby
[18:37:17] vipaca: has joined #ruby
[18:37:20] conta: has joined #ruby
[18:38:18] selim: has joined #ruby
[18:38:39] guille-moe: has joined #ruby
[18:42:22] rubydiamond: has joined #ruby
[18:46:33] conta3: has joined #ruby
[18:47:42] ledestin: has joined #ruby
[18:52:26] havenwood: rubydiamond: hi!
[18:53:30] orbyt_: has joined #ruby
[18:54:34] DLSteve: has joined #ruby
[18:54:59] alexertech: has joined #ruby
[18:55:46] KenSentMe: has joined #ruby
[18:56:10] cdg: has joined #ruby
[18:58:33] tomphp: has joined #ruby
[18:58:54] michael1: has joined #ruby
[19:00:25] cdg: has joined #ruby
[19:03:26] vipaca: has joined #ruby
[19:03:49] safetypin: has joined #ruby
[19:05:04] tomphp: has joined #ruby
[19:05:41] burgestrand: has joined #ruby
[19:14:21] kies: has joined #ruby
[19:16:06] Guest92794: has joined #ruby
[19:17:21] cdg_: has joined #ruby
[19:20:21] dionysus69: has joined #ruby
[19:21:37] orbyt_: has joined #ruby
[19:23:07] jarnalyrkar: has joined #ruby
[19:23:25] troulouliou_div2: has joined #ruby
[19:24:36] funburn: has joined #ruby
[19:25:49] cagomez: has joined #ruby
[19:27:35] dionysus69: has joined #ruby
[19:33:53] guille-moe: has joined #ruby
[19:33:55] funburn: has joined #ruby
[19:36:10] cschneid_: has joined #ruby
[19:41:15] jenrzzz: has joined #ruby
[19:41:16] jenrzzz: has joined #ruby
[19:43:38] imode: has joined #ruby
[19:46:19] tomphp: has joined #ruby
[19:47:50] jottr: has joined #ruby
[19:51:14] gheegh: has joined #ruby
[19:53:14] postmodern: has joined #ruby
[19:58:04] Quentinius: has joined #ruby
[19:59:29] darkmorph: has joined #ruby
[19:59:35] RickHull: has joined #ruby
[20:00:53] funburn: has joined #ruby
[20:01:41] funburn: has joined #ruby
[20:02:30] funburn: has joined #ruby
[20:08:39] jenrzzz: has joined #ruby
[20:09:42] cagomez: has joined #ruby
[20:10:49] andywww: has joined #ruby
[20:11:41] andywww: repost from #rubyonrails I’m trying to return the value of a proc rather than a proc with the following code:
[20:11:43] andywww: https://gist.github.com/anonymous/c7f230d4ef838bf0af7997fd79326352
[20:12:15] RickHull: a proc is a proc. what do you mean the value of a proc?
[20:12:20] RickHull: you mean the result of calling it?
[20:12:24] matthewd: andywww: I see neither a proc or a [relevant] array
[20:12:32] andywww: the return value of the proc once it is called
[20:13:18] sucks: has joined #ruby
[20:14:37] andywww: i would like the return value of make_request method to be whatever is returned from the handle response method once it has called the relevant handle_* method
[20:14:43] andywww: I’m just not sure how to go about it
[20:15:10] RickHull: def foo; proc { |a, b| a * b }; end; def bar(a, b); proc { |a, b| a * b }.call(a, b); end
[20:15:30] RickHull: foo returns a proc; bar returns the result of calling the proc
[20:16:16] charliesome: has joined #ruby
[20:17:14] eclm: has joined #ruby
[20:17:53] andywww: i understand i need to call it but its the return value of make_request i’m struggling with in this instance
[20:19:17] RickHull: i think you are talking about blocks rather than procs, but it shouldn't make much difference
[20:19:51] matthewd: RickHull: Did you look at the gist?
[20:19:51] RickHull: what is the return value of request.on_complete ?
[20:19:55] memo1: has joined #ruby
[20:19:58] andywww: quite possibly but as it stands, make_request is returning an array with a single proc
[20:20:02] RickHull: yeah, I don't see procs either
[20:20:23] andywww: its the behaviour of typhoeus from what i understand
[20:20:24] matthewd: andywww: make_request is returning the result of request.on_complete. You probably don't want to do that.
[20:20:45] andywww: yes thats right exactly
[20:21:08] andywww: i want to return the result of the handle_response line inside the block
[20:21:22] RickHull: you can make a temp var above the block, assign to it inside the block, and return it
[20:21:26] RickHull: but that's kind of gross
[20:21:50] matthewd: You're not using the Typhoeus API correctly.
[20:22:07] andywww: i was starting to think that
[20:22:30] andywww: what are the immediate errors?
[20:23:28] epocS60: has joined #ruby
[20:23:34] matthewd: You're returning the result of request.on_complete. You probably don't want to do that.
[20:24:00] andywww: i removed a line in my faffing about
[20:24:27] andywww: the top method now calls request.run
[20:24:37] andywww: which is making it follow the links as expected
[20:25:19] andywww: https://gist.github.com/anonymous/9152451ee7dcdcfd3a5c66641d7363f5
[20:25:34] andywww: thats got me a lot closer because it is now recursively following redirects
[20:25:50] andywww: but if you can spot any immediate errors I’d appreciate a heads up
[20:28:50] gizmore: has joined #ruby
[20:30:07] RickHull: you might have a more composable API if you return the request without running it
[20:31:44] Guest72603: does lrth drill core oo concepts?
[20:32:04] Guest72603: s/lrth/LRTHW/
[20:32:50] banisterfiend: has joined #ruby
[20:33:04] RickHull: Look Rob That's a Heavy Walrus?
[20:33:25] Guest72603: RickHull: you read my mind ;)
[20:33:25] RickHull: Learn Ruby The Hard Way
[20:33:57] RickHull: in learning ruby, I've rejected many core oo concepts
[20:34:13] RickHull: depending on your definition of core oo concepts
[20:34:50] dionysus69: has joined #ruby
[20:35:07] RickHull: basically: don't hide private state so much as minimize it
[20:35:58] RickHull: it's very easy to get cute with instance methods that spaghettify the data flow
[20:36:34] Guest72603: RickHull: thanks. I'll keep those things in mind for sure.
[20:36:42] RickHull: haven't read LRTWH though :)
[20:37:17] jarnalyrkar: has joined #ruby
[20:37:57] banisterfiend: has joined #ruby
[20:39:03] Guest72603: i did the codecademy course three times in three two years, finally took notes the last time. then i just started doing projects in ruby. i want to write good ruby though. so i'm going to work through some of the recommended books; i could stand to get some more practice using the oo paradigm
[20:40:13] Guest72603: but tbh i'm more interested in the reflective and functional parts
[20:40:29] matthewd: The only thing I know about LRTHW is that it teaches """foo""" as a special string syntax -- that's also all I feel I need to know :|
[20:41:26] Guest72603: yeah people hate his books
[20:42:35] Devalo: has joined #ruby
[20:42:37] Guest72603: i'm reading it anyway though
[20:43:16] RickHull: here's a fairly simple example of minimizing private state: https://github.com/rickhull/loremarkov/blob/master/lib/loremarkov.rb
[20:43:29] Guest72603: i figure, anything bad i learn from it can be discarded when i learn better ways from the next four books i'll read on ruby
[20:43:31] RickHull: notice most of the hard work being done by class methods, in the functional style
[20:43:57] RickHull: easier to test outputs against inputs
[20:44:32] waveprop: has joined #ruby
[20:47:31] RickHull: I tend to put functionality into functions at the class layer, and use the instance layer just to package things up for a nicer API
[20:48:12] jarnalyrkar: has joined #ruby
[20:48:30] conta: has joined #ruby
[20:49:43] waveprop: RickHull: that's what i've been trying to do as well. it's cleaner. i'm still figuring out how to separate the two spaces
[20:50:19] waveprop: RickHull: I noticed in your loremarkov code you used the construct %q{}
[20:50:34] waveprop: what are those called? i've seen %q %x %r
[20:50:39] RickHull: yes, that's because i'm nesting quote marks within
[20:50:52] RickHull: >> %w{words and stuff}
[20:50:53] ruby[bot]: RickHull: # => ["words", "and", "stuff"] (https://eval.in/892731)
[20:51:10] RickHull: i forget their name :)
[20:51:34] waveprop: np. that is very powerful shorthand anyway
[20:51:37] RickHull: usually there is an upcase / downcase distinction; q for quotes, x for execution, r for regex, w for array of words
[20:52:02] uZiel: has joined #ruby
[20:52:12] waveprop: it seems like the opposite of interpolation in a way
[20:52:17] RickHull: they are generic way to provide delimiters
[20:52:27] charliesome_: has joined #ruby
[20:52:32] jenrzzz: has joined #ruby
[20:52:32] jenrzzz: has joined #ruby
[20:52:40] RickHull: for example, in Regex, it is annoying to use /match this please/
[20:52:53] RickHull: if there are slashes in the pattern itself
[20:53:29] RickHull: likewise using quotes to delimit a string is annoying if there are quotes embedded
[20:54:23] RickHull: you can use the % delimiters with any type of parens, e.g. %r() %x[] %q{}
[20:54:38] matthewd: https://ruby-doc.org/core-2.4.0/doc/syntax/literals_rdoc.html#label-Percent+Strings
[20:54:58] matthewd: Though that list is incomplete :/
[20:55:46] waveprop: RickHull: nice. does each type of parens do differt things, or are they like an alias for the same thing. it reminds me of shell expansion
[20:55:57] waveprop: matthewd: thanks for finding that
[20:56:14] RickHull: they are synonymous -- they give you a choice in case e.g. bracket [ is in the payload
[20:56:28] waveprop: very convenient
[20:56:34] matthewd: Oh, it mentions "an uppercase letter allows interpolation".. but that leaves %W somewhat under-described
[20:56:58] waveprop: matthewd: what is the caveat in the case of %W
[20:58:01] RickHull: >> var = 'interpolation'; "this is an example of string #{var}"
[20:58:02] ruby[bot]: RickHull: # => "this is an example of string interpolation" (https://eval.in/892736)
[20:58:48] RickHull: >> var = 'stuff'; %W{words and #{stuff}} #?
[20:58:49] ruby[bot]: RickHull: # => undefined local variable or method `stuff' for main:Object (NameError) ...check link for more (https://eval.in/892737)
[20:58:50] waveprop: does sting interpolation also have the () and [] synonyms
[20:59:11] RickHull: >> var = 'stuff'; %W{words and #{var}}
[20:59:12] ruby[bot]: RickHull: # => ["words", "and", "stuff"] (https://eval.in/892738)
[20:59:33] dviola: has joined #ruby
[21:00:13] waveprop: haha. demo gods did not smile (for a moment)
[21:00:54] waveprop: RickHull: thanks for illustrating %W, is there another tricky thing about it
[21:00:59] Xiti: has joined #ruby
[21:01:03] RickHull: the #{} interpolation syntax is specific to {}
[21:01:04] matthewd: Apparently nothing... for some reason I thought %W{"foo bar" baz} gave a two element array, but it would seem I must've imagined it
[21:01:16] waveprop: RickHull: okay. just checking
[21:01:34] RickHull: I tend to prefer the % sprintf syntax these days, particularly for floats:
[21:01:43] waveprop: matthewd: ha okay cool. thanks :)
[21:01:49] RickHull: >> "pi is %0.3f" % Math::PI
[21:01:50] ruby[bot]: RickHull: # => "pi is 3.142" (https://eval.in/892739)
[21:01:59] matthewd: It is worth knowing that #{} interpolation into %W is a single element, though
[21:02:24] matthewd: >> var = 'more stuff'; %W(words and #{var})
[21:02:25] ruby[bot]: matthewd: # => ["words", "and", "more stuff"] (https://eval.in/892740)
[21:03:05] waveprop: matthewd: i see what you mean there, it doesnt split
[21:03:37] Technodrome: has joined #ruby
[21:04:06] waveprop: RickHull: that's handy. some C style formatting
[21:04:11] johno84: has joined #ruby
[21:05:01] waveprop: RickHull: does the second % there tell ruby[bot] to load the Math::PI module
[21:05:27] RickHull: https://ruby-doc.org/core-2.4.2/String.html#method-i-25
[21:05:29] elomatreb: It's a method on the String, equivalent to sprintf formatstring, values...
[21:05:56] RickHull: https://ruby-doc.org/core-2.4.2/Kernel.html#method-i-sprintf
[21:06:18] waveprop: thanks elomatreb
[21:06:19] elomatreb: btw, you'll find that many Ruby styleguides discourage the use of the that particular style, most recommend using Kernel#format as it's probably the most clear
[21:06:27] RickHull: >> "a b c d %s %s %s" % ['e', 'f', 'g']
[21:06:28] ruby[bot]: RickHull: # => "a b c d e f g" (https://eval.in/892741)
[21:06:37] cagomez: what does this regex do? "124-324".strip =~ /\A\d+-\Z/
[21:06:41] mim1k: has joined #ruby
[21:06:56] RickHull: elomatreb: interesting, I haven't looked at Kernel#format
[21:07:06] elomatreb: It's just an alternative name for sprintf, same method
[21:07:28] funburn: has joined #ruby
[21:07:33] elomatreb: As "sprintf" is a non-obvious C-ism
[21:07:37] shinnya: has joined #ruby
[21:07:55] orbyt_: has joined #ruby
[21:07:58] RickHull: i do agree, the % syntax is impenetrable
[21:07:59] workmad3: has joined #ruby
[21:08:14] waveprop: i avoided it until i learned c
[21:08:29] elomatreb: cagomez: \A and \Z anchor to the beginning and the end of the string respectively, \d+ means "one or more digits [0-9], and the - is a literal dash used like that
[21:08:31] waveprop: but then it was the easy part, lol
[21:08:35] RickHull: waveprop: I don't mean the format strings
[21:08:42] waveprop: oh, my bad.
[21:08:43] RickHull: i mean str % var
[21:09:03] elomatreb: FWIW that's the idiomatic way to do string formatting in Python, afaik
[21:09:04] RickHull: versus format(str, var1, var2 ...)
[21:11:37] waveprop: can hashes be used with set operatiors
[21:13:02] RickHull: more or less. ruby's Set is implemented with a hash, I believe
[21:13:09] ozcanesen: has joined #ruby
[21:13:22] RickHull: a ruby Set is effectively just the key portion of a Hash
[21:13:43] waveprop: is Set a class or module or something
[21:13:51] RickHull: it's a class in stdlib
[21:13:56] RickHull: not part of core
[21:13:59] havenwood: >> require 'set'; Set.class
[21:14:01] ruby[bot]: havenwood: # => Class (https://eval.in/892744)
[21:14:16] RickHull: http://ruby-doc.org/stdlib-2.4.2/libdoc/set/rdoc/Set.html
[21:14:49] havenwood: It's not yet been gemified in Ruby 2.5: https://stdgems.org/2.5.0/
[21:15:48] elomatreb: One thing you should know is that much of what we tend to call operators aren't actually operators, they're just methods on the "operands". Like `a + b` is equivalent to `a.+(b)` in Ruby
[21:15:56] RickHull: havenwood: what's the point about set.class ?
[21:16:01] RickHull: er, Set.class
[21:16:15] elomatreb: E.g. the "Set operators" do something completely different on numbers, for example.
[21:16:22] havenwood: RickHull: To show with code that it's a Class not Module.
[21:16:25] RickHull: oh, it's a class, not a module :)
[21:18:10] waveprop: Nice. that's interesting a.+(b)
[21:19:08] RickHull: array assignments like `ary[5] = 3` are defined like `def []=(val)`
[21:19:17] veeti: has joined #ruby
[21:19:30] RickHull: er, def []= (idx, val) # ?
[21:20:34] waveprop: I did notice that i was getting 'no method error: []' at ane point
[21:21:01] waveprop: and i realized ruby has been very thoughtfully designed
[21:21:12] RickHull: >> ary = [1,2,3]; ary.[]=(0, 0); ary
[21:21:13] ruby[bot]: RickHull: # => [0, 2, 3] (https://eval.in/892745)
[21:23:20] ResidentBiscuit: has joined #ruby
[21:23:23] romain_t: has joined #ruby
[21:23:39] elomatreb: >> [1, 2, 3].send :[], 1
[21:23:41] ruby[bot]: elomatreb: # => 2 (https://eval.in/892746)
[21:24:30] RickHull: and likewise:
[21:24:47] RickHull: >> ary = [1,2,3]; ary.send :[]=, 0, 99; ary
[21:24:48] ruby[bot]: RickHull: # => [99, 2, 3] (https://eval.in/892747)
[21:25:21] RickHull: >> ary = [1,2,3]; ary.send "[]=", 0, 99; ary
[21:25:22] ruby[bot]: RickHull: # => [99, 2, 3] (https://eval.in/892748)
[21:25:53] guille-moe1: has joined #ruby
[21:26:11] RickHull: ruby has some equivalence between symbols and strings -- something to be aware of. :symbol versus "string"
[21:26:23] RickHull: but they have different semantics
[21:26:45] charliesome: has joined #ruby
[21:28:57] charliesome__: has joined #ruby
[21:31:13] hahuang65: has joined #ruby
[21:33:56] alfiemax: has joined #ruby
[21:34:46] lele: has joined #ruby
[21:35:42] alfiemax: has joined #ruby
[21:36:23] alfiemax: has joined #ruby
[21:38:36] lxsameer: has joined #ruby
[21:39:02] Technodrome: has joined #ruby
[21:39:59] jenrzzz: has joined #ruby
[21:40:00] jenrzzz: has joined #ruby
[21:41:59] baweaver: RickHull: ['hip', 'hip']
[21:42:19] nofxx: has joined #ruby
[21:43:37] baweaver: Hip hip array!
[21:44:19] waveprop: Thanks guys. I'll read about differences between sym label and string
[21:45:28] ruby[bot]: -b TheRock!*@*$#ruby-banned
[21:45:37] RickHull: baweaver: -.-
[21:47:16] RickHull: >> require 'set'; Set.new %w{hip hip}
[21:47:17] ruby[bot]: RickHull: # => #<Set: {"hip"}> (https://eval.in/892751)
[21:47:26] alfiemax: has joined #ruby
[21:48:09] workmad3: has joined #ruby
[21:48:33] baweaver: You're all set now RickHull
[21:49:06] RickHull: when life give you browns, make hash
[21:50:04] _aeris_: has joined #ruby
[21:51:17] ahurst: has joined #ruby
[21:51:36] waveprop: puts 'laughter' if hash.include? kif
[21:52:37] waveprop: oh, you meant the food my bad
[21:54:57] ahurst: Hey all, total ruby newb here, trying to install some software that requires a bunch of gems being installed using bundler, and I realized after installation I need to reinstall one of them with different compile flags. Is this something that's easy to do?
[21:54:58] RickHull: make install # not heroin
[21:55:22] ahurst: It's installing in deployment mode, so not at a system level
[21:56:14] ahurst: I know how to add the compile flags with bundler already, I just don't know how to tell it to reinstall one of the gems
[21:56:17] RickHull: ahurst: do you have an example showing the install with different compiler flags? e.g. `gem install foo ...`
[21:56:47] RickHull: ahurst: oh, in that case, add the compile flags and something like bundler install or update should take care of it
[21:57:01] ahurst: ahh update, I'll try that
[21:57:15] RickHull: i'm just sort of guessing
[21:57:22] RickHull: i haven't used bundler in a while
[22:00:38] mtkd: has joined #ruby
[22:02:47] eckhardt: has joined #ruby
[22:02:59] jenrzzz_: has joined #ruby
[22:03:56] waveprop: where do i start with unit testing
[22:04:15] waveprop: rspec? minitest?
[22:04:16] ResidentBiscuit: has joined #ruby
[22:04:25] waveprop: a book on tdd?
[22:05:38] RickHull: I'm partial to minitest and minitest/spec over rspec
[22:05:47] RickHull: but rspec has a lot of mindshare
[22:05:55] elomatreb: RSpec and Minitest are just two concrete frameworks/environments for testing, you'll want to understand the more abstract concepts of testing. But I don't have a good resource either
[22:06:26] waveprop: okay elomatreb, i'll stfw for broad concepts
[22:07:31] RickHull: I like the idea of TDD but generally write a code spike (prototype) first, then tests, then refactor
[22:07:51] waveprop: RickHull: is minitest more, i don't know, minimalist? than rspec
[22:08:09] alfiemax: has joined #ruby
[22:08:14] waveprop: rad, i'll probably like it then
[22:08:42] RickHull: you can poke around here for some examples: https://github.com/rickhull/compsci/tree/master/test
[22:09:20] quuxman: has joined #ruby
[22:10:16] waveprop: i watched some videos about using the ruby debugger and also that static analyzer.. i think it's called invade? nah, i dont remember, but its a repl which allows you to probe the state of objects at a given point with no stepping
[22:10:20] jphase: has joined #ruby
[22:10:34] waveprop: thanks RickHull i'll take a look there
[22:10:41] RickHull: irb is the standard repl; look at pry for a much nicer repl
[22:10:47] waveprop: pry is the one
[22:11:02] waveprop: i do love irb
[22:11:15] SeepingN: there's wirb/wirble
[22:11:19] SeepingN: not as powerful as pry
[22:11:39] waveprop: but someone mentioned a gem which lets you switch between pry and ruby debugger, i think it was called pry-dubug or similar
[22:11:43] elomatreb: RickHull: Personally I don't like the monkey-patched test method (a.must_equal b), IMO the expect(a).to eq b syntax is much cleaner, if we're talking about Minitest/RSpec
[22:11:47] waveprop: SeepingN: i'll look at it, thanks
[22:12:49] RickHull: elomatreb: I see your point, and I think minitest/spec had a much bigger win over prior versions of rspec
[22:12:55] RickHull: but I prefer the minitest tradeoff here
[22:13:24] RickHull: i think the downside is only in pure theory, not practice
[22:13:31] elomatreb: It's definitely noticeable in the speed, I use RSpec due to getting used to it before I got used to Minitest, and it tends to get very slow very quickly
[22:15:05] Rodya_: has joined #ruby
[22:15:21] nofxx: has joined #ruby
[22:15:47] matthewd: Yeah, it's not terribly fair to blame minitest/spec for the syntax it copied from rspec (I think) largely to make a point :P
[22:16:13] mson: has joined #ruby
[22:16:20] RickHull: having to learn and grok the rspec DSL, given minitest/spec, is more of a burden, aside from performance or purity
[22:16:37] RickHull: and rspec itself was a huge win imho over test/unit or whatever
[22:19:50] waveprop: so ancestry is test/unit > rspec > minitest/spec, with the last two feeding back
[22:23:11] cdg: has joined #ruby
[22:23:11] jphase: has joined #ruby
[22:23:33] def_jam: has joined #ruby
[22:24:38] Azure: has joined #ruby
[22:24:42] eb0t_: has joined #ruby
[22:24:55] RickHull: minitest became the implementation of test/unit in ruby 1.9 IIRC
[22:25:01] RickHull: (before minitest/spec)
[22:25:34] quuxman: has joined #ruby
[22:25:54] RickHull: then rspec came around and the DSL appealed to lots of people, rails in particular IIRC
[22:26:21] RickHull: then minitest/spec did 80% of rspec in 20% of the code (or something)
[22:26:32] RickHull: and much less processing overhead
[22:26:43] RickHull: and it pushed a lot of improvement from rspec
[22:26:50] elomatreb: The "conventional" style with the test_* methods was borrowed from and is the norm in many other lanugages
[22:27:21] waveprop: elomatreb: okay good to know
[22:27:41] rivalomega: has joined #ruby
[22:28:03] RickHull: nunit, junit, etc
[22:28:37] waveprop: i have always stopped after writing nearly each function and tested it out, in shell scripts. isnt that the general idea with unit testing, except you write code to automate the test for each thing you add
[22:29:07] RickHull: yep, just a formalization that leads to easy automation
[22:29:14] ahurst: has joined #ruby
[22:29:21] waveprop: thats a great idea
[22:29:36] jottr: has joined #ruby
[22:29:40] elomatreb: And once you are testing individual methods like that, you can move on to test groups of methods/functionality pathways, "integration testing"
[22:29:41] RickHull: you can then do a code coverage measurement
[22:29:51] RickHull: see if you have any untested branches
[22:30:26] waveprop: this is really cool you guys
[22:31:04] waveprop: do these frameworks have the functionality to do integration and branch / coverage testing as well?
[22:31:21] RickHull: no, that's generally a separate package, e.g. simplecov gem
[22:31:26] eckhardt: has joined #ruby
[22:31:54] RickHull: once you have automated tests, then you can enable e.g. Travis CI
[22:31:56] waveprop: there is a lot of cross over here with fuzzing etc
[22:32:00] RickHull: and every push to github triggers a test run
[22:32:13] RickHull: (or whatever your platform)
[22:33:09] RickHull: check out the green badge at the top of the README here https://github.com/rickhull/compsci
[22:33:17] RickHull: click it to see the Travis CI results
[22:33:35] RickHull: configured with https://github.com/rickhull/compsci/blob/master/.travis.yml
[22:34:24] elomatreb: You don't *need* any of this hosted stuff though, a simpler, free alternative would just be running the tests in a git pre-commit/pre-push hook
[22:34:34] elomatreb: (Locally of course)
[22:34:36] atmosx: waveprop: pry-byebug?
[22:35:26] waveprop: RickHull: thats really cool! i'll mess with travis
[22:35:32] cagomez: is there an easy way to check if an array is flat?
[22:36:08] waveprop: elomatreb: i use a local git server, now i have a reason to learn about pre-commit hooks
[22:36:15] RickHull: ary.all? { |i| !i.is_a?(Enumerable) } # the hard way
[22:36:58] RickHull: something like that. you could test if ary.flatten == ary i guess
[22:37:03] cagomez: say I do foo + bar and bar may be an array of arrays. is the final array flat?
[22:37:06] waveprop: atmosx: sorry, i'm not sure of the gem's name. it was mentioned in passing by someone in the audience at a con-talk in a youtube video i saw
[22:37:07] elomatreb: ary.grep(Enumerable).none?
[22:37:17] matthewd: `ary.grep(Array).empty?` is more accurate
[22:37:27] matthewd: Flatten only flattens arrays, not all enumerables
[22:38:14] elomatreb: And flatten is recursive and will finish the entire array, if you just want a yes/no answer you can return false upon hitting the first non-flat element
[22:38:29] RickHull: i think #any? short circuits
[22:39:16] RickHull: cagomez: the resulting array will not be flat, I believe
[22:39:24] RickHull: cagomez: but irb or pry is a great way to TIAS
[22:39:55] RickHull: it's better to investigate on your own before looking up the answer in the back of the book ;)
[22:40:29] waveprop: elomatreb: what do you use for integration testing
[22:40:48] eclm: has joined #ruby
[22:41:09] elomatreb: You don't need any special software for integration testing (as an abstract concept), it just means testing entire high-level groups of functionality in addition to testing the individual methods
[22:41:43] waveprop: okay thanks
[22:42:02] elomatreb: In the context of web applications (e.g. Rails) you do see things like headless browsers being used though, basically simulating a user interacting with the application to test at a high level if everything is working
[22:42:24] waveprop: elomatreb: okay cool. yes i do that with curl
[22:43:13] baweaver: ACTION needs to read more context
[22:44:21] banisterfiend: has joined #ruby
[22:45:25] ramfjord: has joined #ruby
[22:45:25] al2o3-cr: has joined #ruby
[22:51:02] ramfjord: has joined #ruby
[22:52:07] jphase: has joined #ruby
[22:56:00] EE01: has joined #ruby
[22:58:04] Kug3lis: has joined #ruby
[22:58:18] rivalomega: has joined #ruby
[23:02:36] jphase: has joined #ruby
[23:04:13] mikecmpbll: has joined #ruby
[23:05:28] thinkpad: has joined #ruby
[23:06:46] cdg: has joined #ruby
[23:07:15] mim1k: has joined #ruby
[23:08:14] gz0: has joined #ruby
[23:08:42] AnoHito: has joined #ruby
[23:09:23] jphase: has joined #ruby
[23:12:13] imode: has joined #ruby
[23:20:15] cdg: has joined #ruby
[23:20:35] ResidentBiscuit: has joined #ruby
[23:20:52] ahurst: has joined #ruby
[23:21:03] AnoHito_: has joined #ruby
[23:24:26] Azure: has joined #ruby
[23:25:24] guardianx: has joined #ruby
[23:25:32] enterprisey: has joined #ruby
[23:31:36] naprimer2: has joined #ruby
[23:32:44] cagomez: has joined #ruby
[23:38:37] eckhardt: has joined #ruby
[23:39:55] Devalo: has joined #ruby
[23:40:20] cagomez: has joined #ruby
[23:40:20] Azure: has joined #ruby
[23:45:08] eckhardt: has joined #ruby
[23:46:07] guardianx: has joined #ruby
[23:46:27] conta2: has joined #ruby
[23:47:07] live__: has joined #ruby
[23:50:34] charliesome: has joined #ruby
[23:52:27] eckhardt: has joined #ruby
[23:52:38] sucks: has joined #ruby
[23:54:06] TvL: has joined #ruby
[23:54:59] ahurst: has joined #ruby
[23:59:26] Paraxial: has joined #ruby