« Back to channel list

#ruby - 05 November 2018

« Back 1 day Forward 1 day »
[00:01:05] TheBloke: has joined #ruby
[00:07:49] tdy: has joined #ruby
[00:15:20] kapil____: has joined #ruby
[00:23:31] elphe: has joined #ruby
[00:32:17] mangold: has joined #ruby
[00:33:17] nchambers: has joined #ruby
[00:53:10] weaksauce: has joined #ruby
[00:57:40] TheBloke: has joined #ruby
[01:17:41] cagomez: has joined #ruby
[01:19:19] cagomez: has joined #ruby
[01:39:25] orbyt_: has joined #ruby
[01:44:02] cagomez: has joined #ruby
[01:48:07] roshanavand: has joined #ruby
[01:50:50] nchambers: has joined #ruby
[02:00:06] esrse: has joined #ruby
[02:03:03] mangold: has joined #ruby
[02:07:14] jetchisel: has joined #ruby
[02:09:23] cagomez: has joined #ruby
[02:20:46] cagomez: has joined #ruby
[02:25:26] TheBloke: has joined #ruby
[02:44:38] houhoulis: has joined #ruby
[02:58:38] arescorpio: has joined #ruby
[02:58:47] roshanavand: has joined #ruby
[03:02:03] za1b1tsu: has joined #ruby
[03:17:39] jetchisel: has joined #ruby
[03:46:29] elphe: has joined #ruby
[03:48:12] roshanavand: has joined #ruby
[04:01:50] mangold: has joined #ruby
[04:08:37] braincrash: has joined #ruby
[04:22:13] elphe: has joined #ruby
[04:39:31] elphe: has joined #ruby
[04:56:06] Liothen: has joined #ruby
[05:15:43] jasmith: has joined #ruby
[05:17:53] elphe: has joined #ruby
[05:20:36] asphyxia: has joined #ruby
[05:32:13] elphe: has joined #ruby
[05:45:15] elphe: has joined #ruby
[05:48:36] cgfbee: has joined #ruby
[06:00:45] elphe: has joined #ruby
[06:10:47] elphe: has joined #ruby
[06:19:43] devyn: has joined #ruby
[06:22:43] elphe: has joined #ruby
[06:32:34] elphe: has joined #ruby
[06:32:37] devyn: has joined #ruby
[06:39:43] elphe: has joined #ruby
[06:39:56] mangold: has joined #ruby
[06:42:48] conta: has joined #ruby
[06:53:38] paranoidaditya: has joined #ruby
[07:06:24] elphe: has joined #ruby
[07:08:14] aufi: has joined #ruby
[07:26:23] elphe: has joined #ruby
[07:38:10] JustForgotten: has joined #ruby
[07:45:54] DTZUZO: has joined #ruby
[07:49:33] alem0lars: has joined #ruby
[07:50:34] alem0lars: has joined #ruby
[08:02:19] gothicsouth: has joined #ruby
[08:04:13] DoubleMalt: has joined #ruby
[08:04:18] elphe: has joined #ruby
[08:10:58] venmx: has joined #ruby
[08:11:41] nchambers: has joined #ruby
[08:14:15] clemens3: has joined #ruby
[08:15:41] za1b1tsu: has joined #ruby
[08:17:02] asphyxia: has joined #ruby
[08:20:33] elphe: has joined #ruby
[08:34:44] elphe: has joined #ruby
[08:38:53] phaul: has joined #ruby
[08:39:41] RougeR: has joined #ruby
[08:41:27] Sylario: has joined #ruby
[08:44:33] elphe: has joined #ruby
[08:44:45] JamieD: has joined #ruby
[08:51:28] gix: has joined #ruby
[08:53:12] elphe: has joined #ruby
[08:55:54] Nicmavr: has joined #ruby
[08:56:35] code_zombie: has joined #ruby
[09:07:29] vondruch: has joined #ruby
[09:10:02] whysthatso: has joined #ruby
[09:17:32] lxsameer: has joined #ruby
[09:17:39] elphe: has joined #ruby
[09:31:47] cd: has joined #ruby
[09:41:53] themsay: has joined #ruby
[09:57:23] xfbs: has joined #ruby
[10:10:55] mangold: has joined #ruby
[10:19:22] jlebrech: has joined #ruby
[10:19:42] jlebrech: Iambchop: hi, thanks for the help on friday
[10:21:38] jlebrech: i have api calls that take 18 seconds, i'm thinking of implementing some kind of double buffering cache invalidation, where i retrieve the cache but immediately refresh that cache for next time.
[10:23:30] nowhere_man: has joined #ruby
[10:39:23] rubydoc: has joined #ruby
[10:39:44] phaul: ri Array al2o3-cr
[10:39:47] phaul: &ri Array al2o3-cr
[10:39:47] rubydoc: al2o3-cr: https://ruby-doc.org/core-2.5.3/Array.html
[10:41:49] nchambers: has joined #ruby
[10:41:54] phaul: also relaxed the syntax with the `,' after the class name and such, so its more accepting for suffixes
[10:55:46] Nahra: has joined #ruby
[11:11:33] al2o3-cr: phaul: that's better, now people will be notified when you want to reference the docs to them ;)
[11:18:09] Cthulu201: has joined #ruby
[11:19:37] rippa: has joined #ruby
[11:35:09] nchambers: has joined #ruby
[11:40:55] elphe: has joined #ruby
[11:41:30] anikras: has joined #ruby
[11:50:58] elphe: has joined #ruby
[11:57:15] AJA4350: has joined #ruby
[12:01:02] elphe: has joined #ruby
[12:11:11] elphe: has joined #ruby
[12:17:52] drale2k_: has joined #ruby
[12:25:06] Quintasan: Any idea why does http://rubular.com/r/MC53HATjNL but when I do /\S*(Daal Tarka|Jeera Aloo|Chana Masala)\S*/.match("dzisiaj w karmie Daal Tarka i Jeera Aloo") I get only one match?
[12:29:05] al2o3-cr: hmm, cumin potatoes ;)
[12:35:10] themsay: has joined #ruby
[12:38:22] za1b1tsu_: has joined #ruby
[12:42:06] al2o3-cr: quintasan: Regex.union will stop on first match, thus giving you back Daal Tarka. it's basically saying (Daal Tarka or Jeera Aloo or Chana Masala) so to speak.
[12:42:31] al2o3-cr: if you'd like all captures use String#scan
[12:42:53] al2o3-cr: "dzisiaj w karmie Daal Tarka i Jeera Aloo".scan /\S*(Daal Tarka|Jeera Aloo|Chana Masala)\S*/
[12:47:30] al2o3-cr: the use of \S* and () captures is not neccesary when using scan.
[13:00:53] Quintasan: al2o3-cr: Thanks!
[13:02:48] al2o3-cr: yw quintasan.
[13:03:45] tAn: has joined #ruby
[13:04:25] cd: has joined #ruby
[13:04:44] TheBloke: has joined #ruby
[13:05:24] k0mpa: has joined #ruby
[13:07:45] drale2k_: has joined #ruby
[13:10:50] z64: has joined #ruby
[13:11:58] wildermind: has joined #ruby
[13:12:28] conta: has joined #ruby
[13:16:01] scrooloose: has joined #ruby
[13:16:04] za1b1tsu: has joined #ruby
[13:17:10] clemens3: has joined #ruby
[13:18:13] vondruch_: has joined #ruby
[13:38:34] dmitch: has joined #ruby
[13:39:52] TheBloke: has joined #ruby
[13:42:45] inky: has left #ruby: ()
[13:51:14] Lytol: has joined #ruby
[13:54:43] JamieD: has joined #ruby
[13:55:03] nchambers: has joined #ruby
[13:55:03] bmurt: has joined #ruby
[13:59:36] aufi: has joined #ruby
[14:00:00] DoubleMalt: has joined #ruby
[14:02:04] Tempesta: has joined #ruby
[14:06:13] mangold: has joined #ruby
[14:07:29] desperek: has joined #ruby
[14:08:59] DoubleMalt: has joined #ruby
[14:13:48] jlebrech: has joined #ruby
[14:14:21] jlebrech: anyone know how to keep the same session throughout capybara tests?
[14:20:29] jcalla: has joined #ruby
[14:28:26] kapil____: has joined #ruby
[14:30:02] vondruch: has joined #ruby
[14:30:36] apeiros_: has joined #ruby
[14:41:58] TheBetrayer: has joined #ruby
[14:42:54] donofrio: has joined #ruby
[14:46:32] Rapture: has joined #ruby
[14:48:15] phaul: has joined #ruby
[14:50:50] nchambers: has joined #ruby
[14:56:22] gnufied: has joined #ruby
[14:56:37] cow[moo]: has joined #ruby
[15:04:46] mangold: has joined #ruby
[15:05:58] za1b1tsu: has joined #ruby
[15:06:35] spiette: has joined #ruby
[15:12:38] Inline: has joined #ruby
[15:15:20] Dbugger: has joined #ruby
[15:17:31] gnufied: has joined #ruby
[15:23:01] drale2k_: has joined #ruby
[15:35:08] za1b1tsu: has joined #ruby
[15:44:13] GodFather: has joined #ruby
[15:46:00] vondruch: has joined #ruby
[15:47:04] vondruch: has joined #ruby
[15:49:04] cow[moo]: has joined #ruby
[15:51:30] jsc: has joined #ruby
[15:58:22] tdy: has joined #ruby
[16:09:12] Inside: has joined #ruby
[16:23:52] conta: has joined #ruby
[16:26:05] apeiros: has joined #ruby
[16:27:27] Stan: has joined #ruby
[16:34:36] chouhoulis: has joined #ruby
[16:35:23] voolik: has joined #ruby
[16:49:11] desperek: has joined #ruby
[16:56:13] conta: has joined #ruby
[17:07:16] whysthatso: has joined #ruby
[17:17:14] darkhanb: has joined #ruby
[17:19:31] mangold: has joined #ruby
[17:24:10] wojnar: has joined #ruby
[17:29:02] mniip: has joined #ruby
[17:30:01] cthulchu: has joined #ruby
[17:34:04] prestorium: has joined #ruby
[17:35:35] Eiam: has joined #ruby
[17:39:10] k0mpa: has joined #ruby
[17:44:51] lxsameer: has joined #ruby
[17:46:03] ivanskie: has joined #ruby
[17:50:44] Fusl: has joined #ruby
[17:56:57] orbyt_: has joined #ruby
[18:00:36] lxsameer: has joined #ruby
[18:02:14] claudiuinberlin: has joined #ruby
[18:20:29] Sembei: has joined #ruby
[18:21:09] roshanavand: has joined #ruby
[18:22:17] Mike11: has joined #ruby
[18:23:56] Rapture: has joined #ruby
[18:26:00] eddof13: has joined #ruby
[18:30:53] mostlybadfly: has joined #ruby
[18:35:57] beefjoe: has joined #ruby
[18:37:34] reber: has joined #ruby
[18:43:40] eckhardt: has joined #ruby
[18:48:37] JasonO: why is it okay to use to_s method to print out a class when .to_s is already a Ruby method? Shouldn't this kind of thing be avoided? Would it not be similar to creating a method called puts? def puts, print etc.?
[18:52:06] orbyt_: JasonO It's a simple override
[18:52:26] roshanavand1: has joined #ruby
[18:52:26] orbyt_: Also I think .inspect is often preferred
[18:54:46] JasonO: orbyt_: I see. That's interesting. So convention is to always name this method to_s? I could never use inspect for the method name?
[18:55:31] JasonO: is inspect not simply used for debugging? and .to_s the preferred or accepted method? O_o
[19:06:43] JasonO: orbyt_: I read an accepted response on StackOverflow that stated inspect is for debugging and to_s is the acceptable method
[19:09:30] orbyt_: JasonO `to_s` simply returns a String representation of the object, while `.inspect` will do the same in addition to printing any instance variables.
[19:09:45] orbyt_: @see https://ruby-doc.org/core-2.1.1/Object.html
[19:13:22] za1b1tsu: has joined #ruby
[19:13:26] go|dfish: has joined #ruby
[19:16:07] JasonO: orbyt_: thanks!
[19:17:20] bootstrappm: has joined #ruby
[19:28:18] despai: has joined #ruby
[19:35:29] Nicmavr: has joined #ruby
[19:36:31] nofxx: has joined #ruby
[19:38:52] nowhereman: has joined #ruby
[19:51:16] defarge: has joined #ruby
[19:52:05] sanscoeur: has joined #ruby
[19:57:42] cow[moo]: has joined #ruby
[20:07:34] eddof13: has joined #ruby
[20:09:36] nfk: has joined #ruby
[20:11:33] levifig: has joined #ruby
[20:13:41] claudiuinberlin: has joined #ruby
[20:15:47] cow[moo]: has joined #ruby
[20:15:49] JamieD: has joined #ruby
[20:16:59] k0mpa: has joined #ruby
[20:26:42] apeiros__: has joined #ruby
[20:30:36] sanscoeur: has joined #ruby
[20:36:40] weaksauce: has joined #ruby
[21:01:23] za1b1tsu: has joined #ruby
[21:03:53] orbyt_: has joined #ruby
[21:10:07] postmodern: has joined #ruby
[21:14:35] sagax: has joined #ruby
[21:15:01] eddof13: has joined #ruby
[21:23:07] venmx: has joined #ruby
[21:26:33] apeiros: has joined #ruby
[21:31:31] cow[moo]: has joined #ruby
[21:40:29] eddof13: has joined #ruby
[21:42:31] themsay: has joined #ruby
[21:43:40] bmurt: has joined #ruby
[21:46:26] d10n-work: has joined #ruby
[21:46:58] SeepingN: has joined #ruby
[21:53:20] hightower3: has joined #ruby
[21:54:13] hightower3: Hey, how can I conveniently change hash keys and values while iterating over it? (Or rather, how can I conveniently do a deep clone and then modify one after iterating another)?
[21:54:41] hightower3: I would need to transform both keys and values in some places, and end up with the modified hash or its copy in the end
[21:55:29] themsay: has joined #ruby
[21:58:55] roshanavand: has joined #ruby
[22:00:53] TheBloke: has joined #ruby
[22:02:24] themsay: has joined #ruby
[22:11:07] eckhardt: has joined #ruby
[22:11:22] despai: has joined #ruby
[22:12:34] wnd: hightower3, something like i = { :a => 'abc', 1 => :bar }; Hash[i.map { |k, v| [k.to_s.to_sym, v.to_s.reverse] } ] ?
[22:13:03] wnd: somehow I'd expect that evaluation to be expensive, though
[22:14:01] hightower3: wnd: I used the suggestion from https://stackoverflow.com/questions/812541/how-to-change-hash-values#812551
[22:14:08] hightower3: with hash.inject
[22:14:20] wnd: i.each_with_object({}) { |(k, v), out| out[k.to_s.to_sym] = v.to_s.reverse } ?-)
[22:15:06] wnd: ah, same approach with each_with_object, just without having to return memo object each time
[22:15:10] themsay: has joined #ruby
[22:22:08] jesfre: has joined #ruby
[22:26:49] RougeR: has joined #ruby
[22:39:13] za1b1tsu: has joined #ruby
[22:39:41] samort7: has joined #ruby
[22:42:29] elphe: has joined #ruby
[22:44:26] phaul: has joined #ruby
[22:52:37] elphe: has joined #ruby
[23:04:14] ivanskie: has joined #ruby
[23:04:25] ivanskie: o hai there
[23:04:34] ivanskie: anyone considers themselves a Thor expert? lol
[23:05:17] ivanskie: i hijacked the bin executable, and renamed the main one so that I can do stuff in parant shell in a certain situation.
[23:05:23] Inside: ivanskie: I prefer silver age Thor over the other versions
[23:06:08] ivanskie: anyway now all help / error outputs the name of the renamed executable (i added '_'. in my case).
[23:06:16] ivanskie: is there anyway to override that behaviour?
[23:07:47] elphe: has joined #ruby
[23:17:33] hurricanehrndz: has joined #ruby
[23:34:54] havenwood: hightower3: Modern Ruby now has #transform_keys and #transform_values.
[23:35:30] hightower3: havenwood, ah, good one, thanks!
[23:35:51] havenwood: hightower3: Ruby 2.6 will have #to_h, which is like #transform_keys_and_values.
[23:36:10] havenwood: {aim: true}.to_h { |k, v| [k.to_s, v.to_s] } #=> {"aim"=>"true"}
[23:39:16] havenwood: ivanskie: You did what? I don't follow. Have an example of how you use the hacked version?
[23:40:56] ivanskie: my main executable lets say was exe/`command` i renamed it `_command` and added `command` which just has an if/else block in it. if second argumant matches it runs something else. otherwise it just starts `_command`.
[23:41:40] ivanskie: so now `$ command help` says `'_command help' - show help`
[23:41:48] ivanskie: if that makes any sense
[23:43:10] cow[moo]: has joined #ruby
[23:43:36] ivanskie: im using https://github.com/piotrmurach/tty to create the thor based gem.
[23:43:54] havenwood: ivanskie: So it's the help banner that's messed up?
[23:46:12] havenwood: ivanskie: I wonder if redefining `self.basename` would cause trouble ;)
[23:46:24] havenwood: ivanskie: you can always overwrite `self.banner`: https://gist.github.com/mattheworiordan/f3e84964bb699525a435
[23:53:04] ivanskie: it worked for main command
[23:53:12] eddof13: has joined #ruby
[23:53:16] asphyxia: has joined #ruby
[23:55:54] ivanskie: heh, have to add in every command class. alright cool. thanks havenwood