« Back to channel list

#ruby - 14 March 2019

« Back 1 day Forward 1 day »
[00:00:21] crankharder: has joined #ruby
[00:05:10] thebrianguy: has joined #ruby
[00:05:44] thebrianguy: has left #ruby: ()
[00:10:51] Renich: has joined #ruby
[00:12:33] duderonomy: has joined #ruby
[00:12:51] bmurt: has joined #ruby
[00:20:45] thebrianguy: has joined #ruby
[00:22:05] thebrianguy: has left #ruby: ()
[00:22:14] thebrianguy: has joined #ruby
[00:34:38] Devalo: has joined #ruby
[00:46:43] Renich_: has joined #ruby
[00:46:51] orbyt_: has joined #ruby
[00:48:39] DaRock: has joined #ruby
[00:48:39] houhoulis: has joined #ruby
[00:55:17] t0x: has joined #ruby
[00:57:28] r3m: has joined #ruby
[00:57:35] donofrio: has joined #ruby
[01:02:04] r3m: has joined #ruby
[01:02:04] ylshao: has joined #ruby
[01:02:27] Krebsgewehr: has joined #ruby
[01:19:36] Renich: has joined #ruby
[01:26:06] esrse: has joined #ruby
[01:26:43] cd: has joined #ruby
[01:30:30] unreal: has joined #ruby
[01:30:33] crankharder: has joined #ruby
[01:35:29] ansraliant: has joined #ruby
[01:41:22] laaron: has joined #ruby
[01:50:56] xaxisx: has joined #ruby
[01:57:27] Renich_: has joined #ruby
[01:59:30] Swyper: has joined #ruby
[02:03:53] Krebsgewehr: has joined #ruby
[02:05:00] bmurt: has joined #ruby
[02:05:20] Swyper: has joined #ruby
[02:06:00] xaxisx: has joined #ruby
[02:08:13] Swyper: has joined #ruby
[02:24:04] FernandoBasso: has joined #ruby
[02:25:35] Swyper: has joined #ruby
[02:37:40] mangold: has joined #ruby
[02:44:10] crankharder: has joined #ruby
[03:02:10] Swyper: has joined #ruby
[03:07:30] Devalo: has joined #ruby
[03:09:52] mniip: has joined #ruby
[03:11:24] TvL2386: has joined #ruby
[03:18:17] DTZUZO: has joined #ruby
[03:26:01] ubuntuisloved: has joined #ruby
[03:28:28] arekushi: has joined #ruby
[03:37:22] xuanrui: has joined #ruby
[04:03:51] eckhardt: has joined #ruby
[04:05:58] maryo: has joined #ruby
[04:09:42] braincrash: has joined #ruby
[04:13:32] cam27: has joined #ruby
[04:22:10] Dounx: has joined #ruby
[04:25:29] Dounx: has left #ruby: ()
[04:37:10] facest: has joined #ruby
[04:40:50] mangold: has joined #ruby
[04:41:20] dellavg__: has joined #ruby
[04:44:16] claw: has joined #ruby
[04:46:04] Stan: has joined #ruby
[04:56:12] jud: has joined #ruby
[04:56:12] jud: has joined #ruby
[04:58:34] crankharder: has joined #ruby
[04:59:58] ricekrispie2: has joined #ruby
[05:01:18] tdy1: has joined #ruby
[05:12:04] devil_tux: has joined #ruby
[05:21:19] TvL2386: has joined #ruby
[05:34:01] bhaak: has joined #ruby
[05:44:06] devil_tux: has joined #ruby
[05:46:29] sauvin: has joined #ruby
[05:54:16] conta: has joined #ruby
[05:56:36] hahuang65: has joined #ruby
[06:07:11] Ai9zO5AP: has joined #ruby
[06:11:21] sagax: what different between dot notation `.` and `::`
[06:18:05] am0123: has joined #ruby
[06:22:00] reber: has joined #ruby
[06:22:40] iMadper: has joined #ruby
[06:24:17] Fusl: has joined #ruby
[06:26:07] zenspider: sagax: :: is super old notation meant for class constant access X::Y or for calling class methods, but nobody ever does the latter
[06:34:17] Devalo: has joined #ruby
[06:41:35] e3: has joined #ruby
[06:46:15] devil_tux: has joined #ruby
[06:58:06] crankharder: has joined #ruby
[07:14:35] luminousnine: has joined #ruby
[07:14:36] luminousnine: has joined #ruby
[07:24:54] mangold: has joined #ruby
[07:28:19] schleppel: has joined #ruby
[07:29:48] Echo: has joined #ruby
[07:32:00] aufi: has joined #ruby
[07:35:22] clemens3_: has joined #ruby
[07:36:04] gix: has joined #ruby
[07:37:52] eckhardt: has joined #ruby
[07:38:10] sagax: if i need all without first element - it's normal way?
[07:38:12] sagax: f=[1,2,3,4,5]; f.slice(1, f.length)
[07:40:43] andikr: has joined #ruby
[07:41:09] leftylink: sagax: consider `f.drop(1)`
[07:41:26] leftylink: f[1..-1] might also be appropriate as well
[07:44:38] gix-: has joined #ruby
[07:44:50] yxhuvud: or f.shift if you just want to modify it.
[07:45:56] vondruch: has joined #ruby
[07:46:54] sagax: no, without modified
[07:48:29] teclator: has joined #ruby
[07:49:12] leftylink: wrong window
[07:55:56] devil_tux: has joined #ruby
[08:05:13] suukim: has joined #ruby
[08:22:21] clemens3_: has joined #ruby
[08:26:17] am0123: has joined #ruby
[08:29:51] _joes_: has joined #ruby
[08:37:26] andikr: has joined #ruby
[08:42:04] conta1: has joined #ruby
[08:50:05] lxsameer: has joined #ruby
[08:51:49] mangold: has joined #ruby
[09:01:30] dhollin3: has joined #ruby
[09:05:59] andikr: has joined #ruby
[09:06:08] cyberarm: has joined #ruby
[09:06:39] al2o3-cr: has joined #ruby
[09:08:39] marcoecc: has joined #ruby
[09:13:30] ryouba: good morning rubyists
[09:18:07] qual: has joined #ruby
[09:20:03] claudiuinberlin: has joined #ruby
[09:29:40] Renich: has joined #ruby
[09:31:59] devil_tux: has joined #ruby
[09:39:41] ellcs: has joined #ruby
[09:39:59] matthewd: has joined #ruby
[09:44:37] Nicmavr: has joined #ruby
[09:44:51] qual: has joined #ruby
[09:45:31] hahuang65: has joined #ruby
[09:50:41] crankharder: has joined #ruby
[09:51:13] apparition: has joined #ruby
[09:55:09] kapil____: has joined #ruby
[10:01:27] TomyWork: has joined #ruby
[10:07:19] Brian-W-Gray: has joined #ruby
[10:07:59] ua: has joined #ruby
[10:08:43] yqt: has joined #ruby
[10:15:15] xuyuheng: has joined #ruby
[10:16:32] Echo: has joined #ruby
[10:20:25] qual: has joined #ruby
[10:25:22] am0123: has joined #ruby
[10:28:03] dar123: has joined #ruby
[10:29:25] iMadper|MIGA: has joined #ruby
[10:29:33] AJA4350: has joined #ruby
[10:33:28] _joes_: has joined #ruby
[10:35:15] sphenxes: has joined #ruby
[10:35:57] Devalo: has joined #ruby
[10:38:57] dante: has joined #ruby
[10:40:56] devil_tux: has joined #ruby
[10:48:04] GreyHame: has joined #ruby
[10:49:50] za1b1tsu: has joined #ruby
[10:55:17] Stimpy_: has joined #ruby
[11:01:15] Stimpy_: has joined #ruby
[11:02:12] Stimpy_: has joined #ruby
[11:10:20] qual: has joined #ruby
[11:20:16] devil_tux: has joined #ruby
[11:21:08] hhzza: has joined #ruby
[11:35:54] ldnunes: has joined #ruby
[11:39:16] xrexeon: has joined #ruby
[11:46:39] ubuntuisloved: has joined #ruby
[11:48:26] TomyWork: has joined #ruby
[11:49:23] jim4: has joined #ruby
[11:50:13] bmurt: has joined #ruby
[11:50:13] jim4: regarding publishing a gem, i wish to publish a library, do i need to use a class or a module ? do i need to use a namespace ? ; it is a single file .rb
[11:57:55] phaul: jim4: have a look at https://guides.rubygems.org/make-your-own-gem/
[11:59:56] phaul: class vs module is an orthogonal question, it's a design decision not a packaging one. Namespacing you code is a good idea.
[12:07:46] cam27: has joined #ruby
[12:10:13] stryek: has joined #ruby
[12:10:41] _joes_: has joined #ruby
[12:15:38] dar123: has joined #ruby
[12:21:17] sagax: what the best? [].append or [] << ?
[12:23:29] tiogrand_: has joined #ruby
[12:25:14] asio: has joined #ruby
[12:26:39] themsay: has joined #ruby
[12:28:24] phaul: << saves 4 bytes of source code
[12:29:02] houhoulis: has joined #ruby
[12:29:56] qual: has joined #ruby
[12:31:50] _joes_1: has joined #ruby
[12:31:58] devil_tux: has joined #ruby
[12:32:20] hahuang65: has joined #ruby
[12:33:37] sagax: [] << some_value
[12:34:39] ubuntuisloved: has joined #ruby
[12:37:53] Tau: has joined #ruby
[12:40:36] al2o3-cr: sagax: bear in mind, append is variadic whilst << is not. so, if you appending multilple values use append/push as you see fit.
[12:51:56] andikr: has joined #ruby
[12:57:58] Macrobiotic: has left #ruby: ()
[13:03:06] xrexeon: has joined #ruby
[13:03:42] ricekrispie: has joined #ruby
[13:06:13] ubuntuisloved: has joined #ruby
[13:08:21] mangold: has joined #ruby
[13:10:59] Devalo: has joined #ruby
[13:21:30] griffindy: has joined #ruby
[13:23:30] tiogrand__: has joined #ruby
[13:23:58] krawchyk: has joined #ruby
[13:29:59] orbyt_: has joined #ruby
[13:48:19] ams__: has joined #ruby
[14:00:53] lucasb: has joined #ruby
[14:18:40] cam27: has joined #ruby
[14:23:26] Swyper: has joined #ruby
[14:26:33] gnufied: has joined #ruby
[14:36:12] xco: has joined #ruby
[14:36:26] xco: Hi everyone! is there a method in Rails/Ruby that does this? ‘Time.now.to_i.to_s’
[14:37:01] Inline: has joined #ruby
[14:37:30] bhaak: depends on what you want it to do. this is a valid chain of methods in Ruby
[14:38:04] xco: yeah it’s valid but i was wondering if there could be a short cut because it looks like something people might want to do often
[14:39:36] bhaak: it's pretty short already. if you use String interpolation, you don't need to to_s: "something #{Time.now.to_i} something else"
[14:44:09] xco: bhaak: thanks :)
[14:51:10] grilix: has joined #ruby
[15:02:50] krawchyk: has joined #ruby
[15:04:56] alem0lars: has joined #ruby
[15:05:08] polishdub: has joined #ruby
[15:05:30] Swyper: has joined #ruby
[15:07:42] marcoecc: has joined #ruby
[15:11:18] laaron: has joined #ruby
[15:11:19] Swyper: has joined #ruby
[15:12:16] rippa: has joined #ruby
[15:13:00] alanmaxwell: has joined #ruby
[15:21:39] SeepingN: has joined #ruby
[15:30:47] za1b1tsu: has joined #ruby
[15:30:55] mangold: has joined #ruby
[15:31:24] jaddison: has joined #ruby
[15:34:24] wallace_mu: has joined #ruby
[15:56:16] dar123: has joined #ruby
[15:58:32] devil_tux: has joined #ruby
[15:58:56] apparition: has joined #ruby
[15:59:22] Swyper: has joined #ruby
[15:59:31] robotcars: with httparty, how do I get the :id into the URL instead of the query string?
[15:59:38] robotcars: I have, /courses?course_id=123&courses[event]=offer
[15:59:43] krawchyk: has joined #ruby
[15:59:53] robotcars: i need, /courses/123?courses[event]=offer
[16:00:38] robotcars: using class > self.class.put()
[16:00:56] xrexeon: has joined #ruby
[16:03:06] t0x: has joined #ruby
[16:03:58] mangold: has joined #ruby
[16:05:30] dar123: has joined #ruby
[16:06:35] krawchyk: has joined #ruby
[16:08:17] Renich: has joined #ruby
[16:11:57] krawchyk: has joined #ruby
[16:24:25] qual: has joined #ruby
[16:26:16] Swyper: has joined #ruby
[16:27:43] cthulchu_: has joined #ruby
[16:27:51] [Butch]: has joined #ruby
[16:29:52] grilix: has joined #ruby
[16:30:54] asdf23redf345gfd: has joined #ruby
[16:32:41] Renich_: has joined #ruby
[16:32:50] canurabus: has joined #ruby
[16:33:28] Swyper: has joined #ruby
[16:33:38] tdy1: has joined #ruby
[16:33:52] canurabus: Hi. I'm looking for some help in understanding a line of code. I'm lost in what is going on here: "matches = text.to_enum(:scan, MatchRegExp).map { Regexp.last_match }"
[16:34:38] canurabus: I don't get what 'to_enum' does to text (which is a String)
[16:35:57] asdf23redf345gfd: has left #ruby: ()
[16:36:01] Swyper: has joined #ruby
[16:36:52] tdy1: has joined #ruby
[16:38:31] wallace_mu: has joined #ruby
[16:39:52] canurabus: Actually I think I get that to_enum(:scan, MatchRegExp) creates an enumerator that will generate an enumeration of all the matches from the RegExp? ie basically an enumeration of 'text.scan(MatchRegExp)'. But I don't get why calling map on that enumeration with Regexp.last_match works
[16:41:11] al2o3-cr: canurabus: to_enum takes a method (defaults to :each) and variable amount of args. in your case you're passing :scan which is an instance method of String class with a regex argument.
[16:41:46] al2o3-cr: and returns an enumerator instead of an array.
[16:43:24] canurabus: Right. And calling scan on the string will generate an array of matches (of type string). But the final result is a set of matches (of type MatchData). I guess I don't get the 'trick'. Is it that because its an enumerable the map block is executed once after each match is found rather than after all matches are found?
[16:44:34] al2o3-cr: Regexp.last_match with give you Matchdata objects
[16:44:37] krawchyk: has joined #ruby
[16:45:03] al2o3-cr: &>> "foo $ bar £ baz".to_enum(:scan, /\p{S}/).to_a
[16:45:08] rubydoc: stderr: -e:2: invalid multibyte char (US-ASCII) (https://carc.in/#/r/6hr2)
[16:45:36] bmurt: has joined #ruby
[16:45:44] al2o3-cr: &>> "foo 1 bar 2 baz".to_enum(:scan, /\d+/).to_a
[16:45:44] rubydoc: # => ["1", "2"] (https://carc.in/#/r/6hr3)
[16:46:05] al2o3-cr: &>> "foo 1 bar 2 baz".to_enum(:scan, /\d+/).map { Regexp.last_match }
[16:46:05] rubydoc: # => [#<MatchData "1">, #<MatchData "2">] (https://carc.in/#/r/6hr4)
[16:46:14] canurabus: Yeah, but I get a different set of results if I do this: 'matches = text.scan(MatchRegExp); mds = matches.map { Regexp.last_match }'
[16:46:20] hahuang65: has joined #ruby
[16:46:28] KeyJoo: has joined #ruby
[16:46:51] al2o3-cr: you will do
[16:50:06] al2o3-cr: matches.map { Reg... } will just give you same Matchdata object to the size of matches array
[16:50:19] orbyt_: has joined #ruby
[16:50:53] vondruch: has joined #ruby
[16:51:36] canurabus: I don't clearly understand why that is the case. Is it because in the latter case I am passing the 'already complete' Array to map, whereas before its an Enumerator whcih will call yield after each single regexp match?
[16:52:12] al2o3-cr: canurabus: in effect, yes.
[16:52:39] canurabus: Ok, thanks. Still a bit fuzzy on enumerators, will do more reading.
[16:53:14] al2o3-cr: canurabus: you'll get the hang soon enough.
[16:53:36] al2o3-cr: "foo 1 bar 2 baz 3".to_enum(:scan, /\d+/) # this returns a enumerator
[16:54:00] al2o3-cr: &>> "foo 1 bar 2 baz 3".to_enum(:scan, /\d+/).next # next in enumerator == "1"
[16:54:00] rubydoc: # => "1" (https://carc.in/#/r/6hr6)
[16:54:13] al2o3-cr: &>> "foo 1 bar 2 baz 3".to_enum(:scan, /\d+/).next.next # next in enumerator == "2" and so on
[16:54:14] rubydoc: # => "2" (https://carc.in/#/r/6hr7)
[16:54:32] noboruma: has joined #ruby
[16:55:01] al2o3-cr: when you map an enumerator each element in that enumerator will be processed.
[16:55:50] al2o3-cr: sequentially, i should add.
[17:01:09] krawchyk: has joined #ruby
[17:03:38] orbyt_: has joined #ruby
[17:03:54] krawchyk: has joined #ruby
[17:06:25] sagax: we have some like as `filter` from array?
[17:07:11] al2o3-cr: exactly that.
[17:07:29] al2o3-cr: or if your using ruby < 2.6 select
[17:07:50] al2o3-cr: or find_all
[17:08:18] sagax: yes, 2.5.1 ruby
[17:09:12] al2o3-cr: sagax: Array#select or Enumerable#find_all
[17:10:16] code_zombie: has joined #ruby
[17:10:35] al2o3-cr: &>> [1,2,3,4].select { |n| n.even? } # filters all even numbers
[17:10:36] rubydoc: # => [2, 4] (https://carc.in/#/r/6hrp)
[17:12:33] al2o3-cr: &>> [1,2,3,4].filter { |n| n.odd? } # filters all odd numbers ruby (2.6)
[17:12:34] rubydoc: # => [1, 3] (https://carc.in/#/r/6hrq)
[17:12:52] Swyper: has joined #ruby
[17:15:09] Dbugger: has joined #ruby
[17:18:01] gix: has joined #ruby
[17:18:56] n13z: has joined #ruby
[17:20:03] grilix: has joined #ruby
[17:27:16] mello: has joined #ruby
[17:29:21] sagax: `if not` it's normal way? or better write `!=` ?
[17:40:49] RougeR: has joined #ruby
[17:40:57] jcarl43: has joined #ruby
[17:42:34] orbyt_: has joined #ruby
[17:43:43] aufi: has joined #ruby
[17:46:50] kapil____: has joined #ruby
[17:50:40] dionysus70: has joined #ruby
[17:50:53] xrexeon: has joined #ruby
[18:03:11] ravenousmoose: has joined #ruby
[18:04:28] MyMind: has joined #ruby
[18:06:06] postmodern: has joined #ruby
[18:17:31] grilix: has joined #ruby
[18:21:06] cam27: has joined #ruby
[18:21:32] dar123: has joined #ruby
[18:25:11] tdy2: has joined #ruby
[18:27:04] orbyt_: has joined #ruby
[18:29:43] Devalo: has joined #ruby
[18:32:58] ubuntuisloved: has joined #ruby
[18:34:34] tdy: has joined #ruby
[18:40:00] iMadper|`: has joined #ruby
[18:41:43] grilix_: has joined #ruby
[18:45:28] Justine5: has joined #ruby
[18:45:38] Justine5: Hello guyes
[18:47:46] PeterNewbie: has joined #ruby
[18:48:13] xco: has left #ruby: ()
[18:48:37] PeterNewbie: I wish to build a method that will check if an email is like *@*.*
[18:48:45] PeterNewbie: so here is what i tried :
[18:50:04] PeterNewbie: def email?(e) ; rgx=Regexp.new('^*@*\.*$') ; rgx.match?(e) ; end;
[18:50:55] PeterNewbie: if i try : email('test') => True
[18:51:00] PeterNewbie: anyone can help me ?
[18:51:03] hahuang65_: has joined #ruby
[18:51:46] Swyper: if email?.contain?('@') return true ?
[18:51:58] Swyper: or the regex you just posted o-o
[18:52:46] PeterNewbie: i need this shape : localpart@domain.extension
[18:53:59] phaul: try rubular.com, PeterNewbie
[18:54:00] leftylink: recall from https://rubular.com/ or a regexp tutorial that * matches zero-or-more occurrences
[18:54:29] phaul: leftylink: :) 1 second diff
[18:54:43] al2o3-cr: &>> require 'uri'; def valid_email?(email) URI::MailTo::EMAIL_REGEXP.match? email end; valid_email? "localpart@domain.extension"
[18:54:44] rubydoc: # => true (https://carc.in/#/r/6htt)
[18:55:07] leftylink: very interesting.
[18:56:54] orbyt_: has joined #ruby
[18:56:59] clemens3_: has joined #ruby
[18:58:53] PeterNewbie: al2o3-cr: what is the 'p begin' ?
[18:59:29] leftylink: &ri Kernel#p PeterNewbie
[18:59:29] rubydoc: PeterNewbie: https://ruby-doc.org/core-2.6/Kernel.html#method-i-p
[18:59:44] phaul: PeterNewbie: that's just the bots way of ensuring that broken user input can be printed
[19:00:41] leftylink: https://docs.ruby-lang.org/en/2.6.0/syntax/exceptions_rdoc.html can explain about begin/end
[19:02:17] leftylink: re emails, recall that https://www.mcsweeneys.net/articles/e-mail-addresses-it-would-be-really-annoying-to-give-out-over-the-phone exists
[19:03:13] PeterNewbie: thanks so much guys!
[19:04:09] rindolf: has joined #ruby
[19:06:06] tdy1: has joined #ruby
[19:06:28] gix: has joined #ruby
[19:08:38] tdy1: has joined #ruby
[19:11:14] lektrik: has joined #ruby
[19:12:31] tdy2: has joined #ruby
[19:14:18] sameerynho: has joined #ruby
[19:20:18] hahuang65: has joined #ruby
[19:20:38] crankharder: has joined #ruby
[19:26:06] gaussblurinc1: has joined #ruby
[19:26:46] gaussblurinc1: HI! Is there any build-in method to iterate over array by n elements without overlap?
[19:27:42] sansi: has joined #ruby
[19:27:58] al2o3-cr: gaussblurinc1: each_slice
[19:29:08] gaussblurinc1: al2o3-cr: thanks!
[19:41:13] sanscoeur: has joined #ruby
[19:43:03] cam27: has joined #ruby
[19:46:44] oncall-pokemon: has joined #ruby
[19:48:28] bjpenn: has joined #ruby
[19:48:30] bjpenn: has joined #ruby
[19:49:14] bjpenn: trying to run spec, and im getting a weird warning WARN: Unresolved specs during Gem::Specification.reset: minitest (~> 5.1)
[19:50:00] bjpenn: i did a gem list and there are two versions of minitest, but when i do gem uninstall minitest --version <older version>, the output says uninstalled, but when i do a gem list again, it remains in there
[19:50:13] bjpenn: when i do a bundle exec gem list, only the newer version is listed
[19:50:45] bjpenn: any clues on how to resolve?
[19:53:56] orbyt_: has joined #ruby
[19:57:41] lord4163: has joined #ruby
[19:58:11] bjpenn: finally found something online that helped!
[19:59:12] bjpenn: i did a bundle cleanup --force, followed by a bundle install, i think the idea here was to get my gem list in a clean state
[19:59:44] bjpenn: i got the error message saying a bunch of gems belonging to groups are not installed
[20:00:41] bjpenn: there was no such thing as ~/.bundle/config file, so i was wondering why it was not installing, so i happened to come across this command bundle config . Actually my bundle config was located in an rvm directory, so i went in there, and removed hardcoded entries which prevented gems from installing within a group
[20:00:46] bjpenn: this fixed it :D
[20:01:31] bjpenn: (after running bundle install again) it fixed it
[20:10:33] Eiam: has joined #ruby
[20:10:56] ur5us: has joined #ruby
[20:12:24] ur5us: has joined #ruby
[20:14:32] ubuntuisloved: has joined #ruby
[20:17:20] laaron: has joined #ruby
[20:24:52] Nicmavr: has joined #ruby
[20:27:02] tpanarch1st: has joined #ruby
[20:28:28] Stan: has joined #ruby
[20:34:55] bjpenn: has joined #ruby
[20:49:18] orbyt_: has joined #ruby
[21:10:43] crawler: has joined #ruby
[21:11:20] Swyper: has joined #ruby
[21:13:02] unreal: has joined #ruby
[21:14:26] Fernando-Basso: has joined #ruby
[21:19:59] ravenousmoose: has joined #ruby
[21:33:00] marmotini_: has joined #ruby
[21:45:36] cthu|: has joined #ruby
[21:46:12] rbdr: has joined #ruby
[21:46:40] Swyper: has joined #ruby
[21:57:16] Swyper: has joined #ruby
[21:58:12] Devalo: has joined #ruby
[21:59:35] marmotini_: has joined #ruby
[22:02:08] eddof13: has joined #ruby
[22:07:04] uplime: is there any difference memory/perforance wise between double and single quotes? I remember (vaguely) hearing about this at a meetup from a while ago, and can't quite recall what was said
[22:09:03] c-c: Ok, I got to another gold spike. Spawning processes and their messaging abstracted to (read)next_msg/send https://gist.github.com/csmr/ffc1c691c24cc9bf7b0f2e9bd729c471
[22:09:45] c-c: It spawns 3 processes that helo each other with loop n
[22:10:21] c-c: (as you can read in the logfile, don't forget to $ killall ruby
[22:11:09] c-c: its still pretty ugly, input welcome
[22:15:22] c-c: uplime: maybe the string in single quotes is literal and the double quotes is interpolated?
[22:15:35] uplime: hm, good point
[22:16:13] c-c: uplime: that was a question
[22:24:12] ur5us_: has joined #ruby
[22:29:09] havenwood: &>> require 'ripper'; Ripper.sexp("'uptime'") == Ripper.sexp('"uptime"')
[22:29:13] rubydoc: # => true (https://carc.in/#/r/6hxl)
[22:29:16] c-c: Hmm, next I'll have to write the engine-from-rules -thing. I still think the rules should be possible to write in yml
[22:30:18] havenwood: uplime: there's difference in how they're parsed, but they create the same Ruby AST - so they get evaluated identically by the VM.
[22:30:18] c-c: engine-genny
[22:30:49] havenwood: uplime: the parsing speed difference should be negligible, if any
[22:31:08] havenwood: uplime: there's no IR evaluation speed difference
[22:31:48] uplime: thanks, i figured as much. i like to use a consistent quoting "scheme", but rubocop wasn't too happy about that
[22:33:41] c-c: rubocop would retire if it saw my code
[22:34:08] c-c: have to clean up first
[22:36:36] t0x: has joined #ruby
[22:43:50] cam27: has joined #ruby
[22:47:13] sanscoeur: has joined #ruby
[22:52:08] Swyper_: has joined #ruby
[22:53:39] zenspider: uplime: there are (were?) performance differences in PERL... not in ruby
[22:54:38] orbyt_: has joined #ruby
[22:55:02] zenspider: uplime: I wrestled with rubocop to implement "seattle style" which includes only using double quoted strings (or % forms)... eventually decided it wasn't worth it
[23:02:03] bjpenn: has joined #ruby
[23:03:16] baweaver: zenspider: evil me is writing in only double-quotes for the book
[23:03:39] baweaver: It feels like a bad idea to teach newbies otherwise, too much potential for confusion for very little gain.
[23:05:36] zenspider: I don't see how or why that is "evil"
[23:07:59] baweaver: Fair. Trying not to add a ton of nuance to the book, and more of just "do it this way"
[23:09:43] al2o3-cr: &>> x = ?y; [%q(#{x}), %Q(#{x}), *%w(#{x}), *%W(#{x}), *%i(#{x}), *%I(#{x}), %r(x), %r(#{x}), %s(x), %s(#{x})]
[23:09:46] rubydoc: # => ["\#{x}", "y", "\#{x}", "y", :"\#{x}", :y, /x/, /y/, :x, :"\#{x}"] (https://carc.in/#/r/6hyi)
[23:15:04] uplime: zenspider: yeah, i just stoppped using rubocop all together for now
[23:15:22] uplime: i'll probably turn it (and reek) back on soon though
[23:19:22] Swyper: has joined #ruby
[23:22:39] al2o3-cr: even %x() interpolates
[23:27:59] Swyper: has joined #ruby
[23:34:11] ellcs: has joined #ruby
[23:37:55] orbyt_: has joined #ruby
[23:38:37] Swyper: has joined #ruby
[23:38:38] al2o3-cr: &>> %(#{%r{#{%w(1 2 3)}}})
[23:38:41] rubydoc: # => "(?-mix:[\"1\", \"2\", \"3\"])" (https://carc.in/#/r/6i0o)
[23:47:39] daed: has joined #ruby
[23:49:03] elcontrastador: has joined #ruby