« Back to channel list

#ruby - 09 November 2018

« Back 1 day Forward 1 day »
[00:01:31] asphyxia: has joined #ruby
[00:04:48] chouhoulis: has joined #ruby
[00:05:08] Azure: has joined #ruby
[00:09:30] postmodern: has joined #ruby
[00:09:40] k0mpa: has joined #ruby
[00:10:12] chouhoulis: has joined #ruby
[00:13:25] ivanskie: has joined #ruby
[00:15:35] chouhoulis: has joined #ruby
[00:20:59] chouhoulis: has joined #ruby
[00:26:24] chouhoulis: has joined #ruby
[00:30:10] shoogz: has joined #ruby
[00:30:40] ellcs: has joined #ruby
[00:31:44] chouhoulis: has joined #ruby
[00:32:20] AJA4350: has joined #ruby
[00:34:22] mroutis: has joined #ruby
[00:37:05] chouhoulis: has joined #ruby
[00:42:34] chouhoulis: has joined #ruby
[00:48:09] chouhoulis: has joined #ruby
[00:53:24] chouhoulis: has joined #ruby
[00:56:30] eckhardt_: has joined #ruby
[00:57:19] orbyt_: has joined #ruby
[00:58:37] chouhoulis: has joined #ruby
[01:04:07] chouhoulis: has joined #ruby
[01:05:25] TheBloke: has joined #ruby
[01:05:53] blackmesa: has joined #ruby
[01:08:41] arescorpio: has joined #ruby
[01:09:25] chouhoulis: has joined #ruby
[01:14:54] chouhoulis: has joined #ruby
[01:20:16] chouhoulis: has joined #ruby
[01:21:01] meinside: has joined #ruby
[01:25:40] chouhoulis: has joined #ruby
[01:28:21] pyrmont: has left #ruby: ()
[01:31:06] chouhoulis: has joined #ruby
[01:36:26] chouhoulis: has joined #ruby
[01:42:18] bmurt: has joined #ruby
[01:44:37] Noroe: has joined #ruby
[01:46:04] jetchisel: has joined #ruby
[01:47:15] chouhoulis: has joined #ruby
[01:49:08] jetchisel: has joined #ruby
[01:50:15] mangold: has joined #ruby
[01:52:34] chouhoulis: has joined #ruby
[01:53:59] jetchisel: has joined #ruby
[01:57:09] jetchisel: has joined #ruby
[01:57:58] chouhoulis: has joined #ruby
[02:01:08] jetchisel: has joined #ruby
[02:03:24] chouhoulis: has joined #ruby
[02:08:52] chouhoulis: has joined #ruby
[02:09:34] jetchisel: has joined #ruby
[02:11:59] elcontrastador: has joined #ruby
[02:14:10] chouhoulis: has joined #ruby
[02:19:33] chouhoulis: has joined #ruby
[02:21:31] esrse: has joined #ruby
[02:24:57] chouhoulis: has joined #ruby
[02:26:15] havenwood: On modern Ruby, `chomp: true` is a nifty addition: File.readlines('json', chomp: true)
[02:26:40] ivanskie: has joined #ruby
[02:27:02] DTZUZO: has joined #ruby
[02:35:39] chouhoulis: has joined #ruby
[02:38:03] bambanx: has joined #ruby
[02:41:06] chouhoulis: has joined #ruby
[02:43:06] bambanxx: has joined #ruby
[02:46:28] chouhoulis: has joined #ruby
[02:51:57] chouhoulis: has joined #ruby
[02:57:17] chouhoulis: has joined #ruby
[03:01:24] bga57: has joined #ruby
[03:02:41] chouhoulis: has joined #ruby
[03:03:27] stalactit: has joined #ruby
[03:05:15] stalactit: this may interest people in this channel https://www.elttam.com.au/blog/ruby-deserialization/
[03:05:37] stalactit: it releases the first public universal gadget chain to achieve arbitrary command execution for Ruby 2.x
[03:07:17] mroutis: has joined #ruby
[03:09:09] chouhoulis: has joined #ruby
[03:09:38] stalactit: related to unsafe use of Marshal
[03:15:14] mangold: has joined #ruby
[03:31:39] mangold: has joined #ruby
[03:47:37] darkhanb: has joined #ruby
[04:09:59] braincrash: has joined #ruby
[04:25:59] mroutis_: has joined #ruby
[04:26:06] elphe: has joined #ruby
[04:35:38] kapil____: has joined #ruby
[04:35:52] za1b1tsu: has joined #ruby
[04:48:14] marz_d`ghostman: has joined #ruby
[04:49:03] marz_d`ghostman: Pertaining instance variable, I've seen people assign values to instance variables then create a attr_reader with the same name as the instance variable so they can refer to the instance variable without '@'. How does that work and what's the advantage of doing it?
[04:54:29] baweaver: They create methods which are essentially: def ivar_name; @ivar_name end
[04:54:33] baweaver: you don't have to type @, mostly.
[04:59:05] arescorpio: has joined #ruby
[05:02:24] dellavg_: has joined #ruby
[05:09:11] _whitelogger: has joined #ruby
[05:10:34] jcalla: has joined #ruby
[05:13:02] ivanskie: has joined #ruby
[05:14:08] idiocrash: has joined #ruby
[05:24:09] mangold: has joined #ruby
[05:30:37] ChatCodingLab: has joined #ruby
[05:34:43] vondruch: has joined #ruby
[05:36:03] idiocrash: has joined #ruby
[05:59:43] ChatCodingLab: has joined #ruby
[06:08:55] marz_d`ghostman: baweaver: I see. Thanks for clarifying that one
[06:10:42] marz_d`ghostman: I'm trying to override a subject inside an inner context. However, it appears that the variable inside the inner context which is suppose to be local inside the context is overriding the subject outisde of the context.
[06:23:36] mangold: has joined #ruby
[06:35:23] rubydoc: has joined #ruby
[06:38:16] reber: has joined #ruby
[06:44:48] ivanskie: has joined #ruby
[06:59:36] aufi: has joined #ruby
[07:01:45] voiceftp: has joined #ruby
[07:20:41] conta: has joined #ruby
[07:30:16] phaul: has joined #ruby
[07:39:15] roshanavand: has joined #ruby
[07:44:16] conta: has joined #ruby
[07:51:28] elphe: has joined #ruby
[08:14:39] dachi: whats up hackers!
[08:19:10] apparition: has joined #ruby
[08:20:55] clemens3_: has joined #ruby
[08:25:25] mangold: has joined #ruby
[08:34:07] gix: has joined #ruby
[08:43:49] MoritaShinobu: has joined #ruby
[08:52:12] roshanavand1: has joined #ruby
[08:52:56] JamieD: has joined #ruby
[08:55:13] Nicmavr: has joined #ruby
[08:57:13] burgestrand: has joined #ruby
[09:00:10] blackmesa: has joined #ruby
[09:00:36] Burgestr_: has joined #ruby
[09:12:21] scrooloose: dachi: greetings my child, may your facehole be ever blessed with pie
[09:17:39] tdy: has joined #ruby
[09:21:48] ua: has joined #ruby
[09:32:34] Cork: when on is defining a method_missing; is it possible when calling super (cause it isn't handled) to have the stacktrace show the original location?
[09:32:36] blackmesa: has joined #ruby
[09:36:43] irdr: has joined #ruby
[09:44:02] venmx: has joined #ruby
[09:45:42] reber__: has joined #ruby
[10:00:55] jetchisel: has joined #ruby
[10:03:43] marz_d`ghostman: when doing tests in rsped for your class method do you put each method test via describe under one whole describe 'Class'?
[10:06:59] hays_: has joined #ruby
[10:13:45] tbuehlmann: I'm usually doing this: RSpec.describe SomeClass do; describe '.some_class_method' do; <examples here>; end ; end
[10:14:03] roshanavand: has joined #ruby
[10:15:26] phaul: marz_d`ghostman: sometimes. My main rule of thumb is that it has to produce sensible description of the test when all fragments (descibe, context, it, expect) are pasted
[10:18:50] marz_d`ghostman: phaul: I'm trying to test each method of my class. So basically I have Rspec.describe Class then describe '#method'. However, my problems is I want to create a subject for each method is that even possible? I tried it but it appears that the subjects overrides each other
[10:19:23] phaul: altough subjects are scoped in describe
[10:19:38] phaul: -although ^^
[10:20:22] marz_d`ghostman: phaul: Yeah. Also, when testing, I want to terminate after an expect is met. How do I do that? so it won't go on and continue the entire script
[10:22:23] phaul: you can tell rspec which example to run on the command line, then it runs a single example
[10:23:15] conta: has joined #ruby
[10:23:53] phaul: otherwise RSpec runs all examples. There are further options to track and retry only last failing example for instance
[10:24:10] marz_d`ghostman: I see, I'll try looking into that
[10:26:07] marz_d`ghostman: just found out after block gets executed before any ensure
[10:34:20] phaul: random rambling: I think the `context' concept in rspec is broken. it's just an alias to describe afaik, but to me a context is much more. A context is like a concern to a class, we should be able to mix in any number and combination of contexts, in a flat manner, not deep embeding them into each other..
[10:35:01] phaul: but.. ppl are already think rspec is complex enough and hard to understand as it is :)
[10:37:46] despai: has joined #ruby
[10:46:03] Daneel: has joined #ruby
[10:46:25] phaul: hi Daneel
[10:46:35] Daneel: i would like to use the function captures(), how to know what require ?
[10:46:55] phaul: &list captures
[10:46:55] rubydoc: MatchData#captures, StringScanner#captures
[10:47:29] phaul: which one do you need?
[10:47:39] Daneel: what about Open3 ?
[10:48:04] Bish: has joined #ruby
[10:48:09] Bish: >> Integer === Integer
[10:48:15] ruby[bot]: Bish: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[10:48:23] Bish: why is that false :o
[10:48:37] phaul: Bish: use &>> to route it to rubydoc
[10:49:20] phaul: &>> Integer === Integer
[10:49:22] rubydoc: # => false (https://carc.in/#/r/5gyq)
[10:50:06] Daneel: i would like to do this in ruby https://gitlab.adullact.net/adullact/puppet-gitlabrunner/blob/master/lib/facter/gitlabrunners.rb#L14
[10:51:05] Bish: i mean i get what it does.. but what is the logic behind that
[10:51:36] phaul: Daneel: you have to require 'open3'
[10:52:29] Daneel: phaul: thank you
[10:52:38] Daneel: with this i get an undefined method error
[10:52:53] Daneel: so i need to install something special ?
[10:53:07] phaul: &ri Module#===, Bish
[10:53:07] rubydoc: Bish: https://ruby-doc.org/core-2.5.3/Module.html#method-i-3D-3D-3D
[10:53:12] Daneel: i am using centos7 and install yum install ruby
[10:53:18] Daneel: and got 2.1.9
[10:53:54] phaul: Bish: logic behind it is to write case 1 ; when Integer then ..
[10:54:29] phaul: === does not imply ==
[10:56:06] tdy: has joined #ruby
[10:58:44] phaul: Daneel: please paste the full error log you get
[10:59:12] moei: has joined #ruby
[10:59:33] Guest53511: has joined #ruby
[11:06:41] phaul: hm, in this case it's the other way. == does not imply === either.
[11:19:16] conta: has joined #ruby
[11:24:21] phaul: Daneel: ?
[11:34:27] kapil____: has joined #ruby
[11:37:09] theRoUS: has left #ruby: ("Off to another part of the maze of twisty little passages")
[11:42:34] tAn: has joined #ruby
[11:44:55] IanMalcolm: has joined #ruby
[11:48:19] AJA4350: has joined #ruby
[11:48:52] phaul: Bish: I did a bit of background research, and I came to the conclusion that I agree with you. === is semantically broken, because Object implements it and makes a promise that == implies ===. Then overriding implementations completely disregard super
[11:54:04] conta1: has joined #ruby
[12:14:28] n13z: has joined #ruby
[12:32:19] arand: has joined #ruby
[12:39:40] bmurt: has joined #ruby
[12:44:32] burgestrand: has joined #ruby
[12:48:27] irdr: has joined #ruby
[12:50:57] irdr: has joined #ruby
[12:51:50] Daneel: phaul: sorry i was trying a coworker by asking for him. But he went away now .
[12:51:57] Daneel: thank you for your help anyway
[12:52:31] phaul: np. important thing is that you get it working ;)
[12:57:54] Bish: phaul: well i agree on the semantically broken thing
[12:58:10] Bish: i totally fell into the == ⇒ === trap
[13:10:17] phaul: yeah, it breaks polymorphism. Class is almost like an Object but not quite. The way out is not to define === for Object, but then you get NoMethod === errors from case statements, which can also be confusing for someone who just starts off with ruby
[13:10:21] biberao: arent there any pdfs for learn ruby for beginners?
[13:15:22] leitz: has joined #ruby
[13:17:39] burgestrand: has joined #ruby
[13:20:07] JamieD: has joined #ruby
[13:21:16] Bish: biberao: just write something in ruby
[13:21:20] Bish: boom, u learned it
[13:21:37] Bish: ACTION 's guide to learning languages
[13:22:46] biberao: Bish: im a newb:D
[13:23:09] Bish: everyone is
[13:23:33] biberao: advise me how to start
[13:23:44] Bish: as i said, pick a project of your skill level work on it
[13:23:48] Bish: i suppose you want to do web?
[13:24:12] Bish: try to write the todo app with rails/sinatra/rails
[13:24:29] Bish: start by displaying a list of items, then add a form( u know those from php right? ), then save it
[13:24:45] Bish: rails/sinatra/roda *
[13:25:02] biberao: i want to start scripts first
[13:25:06] biberao: then move to another thing
[13:25:15] biberao: i dont even know syntax
[13:25:22] Bish: yeah, that's how i learned, too
[13:25:22] biberao: is this even up to date btw
[13:25:24] biberao: https://www.codeconquest.com/wp-content/uploads/Ruby-Cheat-Sheet-by-CodeConquestDOTcom.pdf
[13:25:29] Bish: i actually hated rails, but everyone was doing it
[13:25:39] Bish: still hate, btw
[13:25:52] Bish: but same principle... pick a project of your skill level
[13:25:53] venmx: has joined #ruby
[13:26:01] Bish: one of the first things i did was creating a generator for files
[13:26:20] Bish: say you have a folder template.. and you want to put that folder with parameters somewhere, like a javascript MVC thingie
[13:26:23] Bish: like yeoman
[13:26:32] biberao: Bish: how did you learn syntax
[13:26:34] biberao: and other things?
[13:35:01] voolik: has joined #ruby
[13:37:07] govg: has joined #ruby
[13:38:51] bmurt: has joined #ruby
[13:44:39] houhoulis: has joined #ruby
[14:02:14] aufi: has joined #ruby
[14:03:56] rippa: has joined #ruby
[14:05:20] burgestrand: has joined #ruby
[14:07:27] cd: has joined #ruby
[14:19:26] k0mpa: has joined #ruby
[14:22:17] apparition: has joined #ruby
[14:28:18] Tohm3: has joined #ruby
[14:31:58] Tohm3: Hey Guys, I'm New To Ruby And The Rails Environment. I've Been Google'n "Ruby On Rails App Templates". Like With LAMP Environments And Gradle Where You Can Take A Prebuilt Template And Just Edit It A Bit. But I Can't Find Any, Do These Even Exist On Rails?
[14:37:03] phaul: Lol Your Capitalize Lock Is On.
[14:37:38] Mike11: has joined #ruby
[14:39:54] Tohm3: Lol, Sorry, Force Of Habit. I Just Like To Cap The First Letter Of Every Word
[14:52:41] mnemon: Tohm3: you can find complete applications in github and such. but Gradle and Rails are pretty different.
[14:53:49] mikecmpbll: has joined #ruby
[14:54:37] burgestrand: has joined #ruby
[14:54:58] gnufied: has joined #ruby
[14:59:21] tdy: has joined #ruby
[15:02:04] samort7: has joined #ruby
[15:02:35] im0nde: has joined #ruby
[15:06:27] burgestrand: has joined #ruby
[15:07:19] irdr: has joined #ruby
[15:07:44] gix: has joined #ruby
[15:17:54] DTZUZO: has joined #ruby
[15:18:54] Inline: has joined #ruby
[15:18:54] Guest53511: has joined #ruby
[15:19:25] irdr: has joined #ruby
[15:22:28] whysthatso: has joined #ruby
[15:29:46] irdr: has joined #ruby
[15:43:26] Tohm3: I've Looked Into A Few On Github, But I'm Starting To Realize Ruby Isn't Great With Different Versions. If The App Is Built In 2.3 And I'm Using 5.2 It's A Nightmare And None Of Those Let Me Just Run A Build Command And Start A Server. I Always Run Into 1Million Errors
[15:43:40] Tohm3: Thanks Tho @mnemon
[15:44:35] Tohm3: Lol, Sorry, I'm So Used To @'n
[15:45:12] havenwood: Tohm3: Try going from PHP 5 to PHP 6! :P
[15:46:53] phaul: Tohm3: are you in here for the most polite troll award :D
[15:47:47] cow[moo]: has joined #ruby
[15:49:01] Tohm3: phaul: I'm Sorry If It Seems That Way, I'm Just New To Ruby And I'm Sharing My Experience With It So Far And Try'n To See How I Can Use It That's Similar To The Other Environments I've Used
[15:49:27] burgestrand: has joined #ruby
[15:51:29] Tohm3: I've Run Into A Lot Of Version Issues With Try'n To Get Github Repos Built On Ruby Running And I Don't Know If It's Just Stupidity On My Part Or If It's Designed That Way. It's Just My Impression.
[15:54:44] leitz: Tohm3, most of the Ruby I've done in version 2.x and greater seems to work okay, though newer versions add stuff.
[15:55:14] wojnar: has joined #ruby
[15:55:28] leitz: If you're just trying to learn, does the OS come with a version of Rails and Ruby? They will be old, and if you try to install gems and use github repositories you'll have issues.
[15:55:48] leitz: But if you can just start with the basics, it's pretty fun. Well, Ruby is. Not sure about Rails.
[15:59:50] bougyman: Tohm3: sounds like you jumped to chapter 14 without going through chapter 1
[15:59:51] bougyman: nor any of the ones between 1 and 14
[16:03:05] despai: has joined #ruby
[16:04:17] Tohm3: Thanks Guys. I Guess I Have Been Working Backwards. But TBH It's Kinda How I've Learned Everything I Know Up Till Now, Lol
[16:04:30] orbyt_: has joined #ruby
[16:04:57] Tohm3: I Guess I'll Just Have To Take A More Traditional Role With Ruby. Thanks For The Insight
[16:07:27] chouhoulis: has joined #ruby
[16:14:50] leitz: Tohm3, it sort of depends. The issue isn't Ruby, exactly, but trying to mix your sources.
[16:15:28] mikecmpb_: has joined #ruby
[16:15:30] leitz: It took me a while to like Ruby (and to put up with some of the gruff here) but once I got into it I was hooked. I've only moved away because I'm on a new career that isn't Ruby based.
[16:15:55] leitz: Have you looked at Rack and Sinatra? Or Hanami?
[16:16:01] leitz: Might be an easier learn.
[16:24:27] moei: has joined #ruby
[16:30:46] n13z: has joined #ruby
[16:34:36] mikecmpbll: has joined #ruby
[16:35:29] leitz: havenwood, i couldn't remember that one. Jeremy impresses me, though that doesn't take much.
[16:36:08] havenwood: Roda's site got a nice overhaul: http://roda.jeremyevans.net/
[16:37:41] despai: has joined #ruby
[16:45:12] leitz: Ruby was the first language I really wanted to read the reference documents on.
[16:50:07] galeido: has joined #ruby
[16:52:35] burgestrand: has joined #ruby
[16:53:52] nchambers: has joined #ruby
[16:57:02] JasonO: has joined #ruby
[16:59:43] Lytol: has joined #ruby
[17:02:57] venmx: has joined #ruby
[17:07:07] jcarl43: has joined #ruby
[17:10:23] venmx: has joined #ruby
[17:12:27] renlo: has joined #ruby
[17:15:56] conta: has joined #ruby
[17:17:12] jetchisel: has joined #ruby
[17:19:40] darkhanb: has joined #ruby
[17:22:25] cthulchu_: has joined #ruby
[17:23:58] MyMind: has joined #ruby
[17:25:54] nicesignal: has joined #ruby
[17:38:24] cthu|: has joined #ruby
[17:38:29] kapil____: has joined #ruby
[17:42:18] zapata: has joined #ruby
[18:00:06] orbyt_: has joined #ruby
[18:03:03] samort7: has joined #ruby
[18:19:47] whysthatso: has joined #ruby
[18:21:07] lancelotlac: has joined #ruby
[18:28:01] eckhardt: has joined #ruby
[18:34:55] chouhoulis: has joined #ruby
[18:35:59] buyfn: has joined #ruby
[18:45:37] chouhoulis: has joined #ruby
[18:50:20] phaul: has joined #ruby
[18:54:32] whysthatso: has joined #ruby
[18:55:58] linuxdaemon: has joined #ruby
[18:56:35] bmurt: has joined #ruby
[18:56:36] DTZUZO: has joined #ruby
[18:59:26] bmurt: has joined #ruby
[19:09:35] reber: has joined #ruby
[19:19:02] nicesignal: has joined #ruby
[19:27:57] whysthatso: has joined #ruby
[19:28:42] despai: has joined #ruby
[19:30:36] lxsameer: has joined #ruby
[19:34:15] whysthatso: has joined #ruby
[19:35:29] Nicmavr: has joined #ruby
[19:53:03] cats: has joined #ruby
[19:55:24] Fernando-Basso: has joined #ruby
[19:58:41] whysthatso: has joined #ruby
[19:59:41] Guest53511: has joined #ruby
[20:01:31] tdy: has joined #ruby
[20:14:38] bmurt: has joined #ruby
[20:25:19] Pisuke: has joined #ruby
[20:30:48] al2o3-cr: it's like YMCA hehe =)
[20:33:52] Bish: >> a = ['/','\']; "#{a.sample}o#{a.sample}"
[20:33:58] ruby[bot]: Bish: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
[20:34:00] Bish: &>> a = ['/','\']; "#{a.sample}o#{a.sample}"
[20:34:02] rubydoc: # => (https://carc.in/#/r/5h3q)
[20:37:08] baweaver: &>> a = ['/','\\']; "#{a.sample}o#{a.sample}"
[20:37:08] rubydoc: # => "\\o/" (https://carc.in/#/r/5h3r)
[20:37:34] baweaver: &>> a = ['/',"\\"]; "#{a.sample}o#{a.sample}"
[20:37:34] rubydoc: # => "\\o/" (https://carc.in/#/r/5h3s)
[20:37:41] baweaver: havenwood save me
[21:04:45] Eiam: ACTION looks up what the heck sample does
[21:04:47] postmodern: has joined #ruby
[21:05:34] havenwood: &>> [1, 2, 3].sample 4 # Eiam
[21:05:35] rubydoc: # => [2, 3, 1] (https://carc.in/#/r/5h3v)
[21:06:30] havenwood: &>> [1, 2, 3].sample 2
[21:06:31] rubydoc: # => [2, 1] (https://carc.in/#/r/5h3w)
[21:08:13] elcontrastador: has joined #ruby
[21:10:26] Bish: &>> (0..5).map { |x| (0..5).to_a.sample (1..5).rand }
[21:10:27] rubydoc: # => private method `rand' called for 1..5:Range (NoMethodError) (https://carc.in/#/r/5h3x)
[21:10:33] havenwood: &>> puts '💪o💪'.gsub(?💪) { %w[/ \\].sample }
[21:10:33] rubydoc: # => (https://carc.in/#/r/5h3y)
[21:10:43] Bish: &>> (0..5).map { |x| (0..5).to_a.sample (1..5).sample }
[21:10:43] rubydoc: # => undefined method `sample' for 1..5:Range (NoMethodError) (https://carc.in/#/r/5h3z)
[21:10:48] Bish: &>> (0..5).map { |x| (0..5).to_a.sample (1..5).to_a.sample }
[21:10:49] rubydoc: # => [[0, 2, 5, 4, 1], [5], [2, 4], [3, 1, 0, 4], [4, 2, 3, 5, 0], [1, 5, 3]] (https://carc.in/#/r/5h40)
[21:12:49] havenwood: Bish: I'd probably write that something like:
[21:12:50] havenwood: 6.times.map { [*0..5].sample rand 1..5 }
[21:14:20] nchambers: what does [*0..5] do?
[21:14:30] baweaver: Splats a range
[21:14:31] havenwood: &>> [*0..5]
[21:14:31] rubydoc: # => [0, 1, 2, 3, 4, 5] (https://carc.in/#/r/5h41)
[21:14:36] nchambers: oh that makes sense
[21:15:51] havenwood: Mm, `Array.new(n)` is also a bit nicer than `6.times.map`.
[21:15:56] havenwood: Array.new(6) { [*0..5].sample rand 1..5 }
[21:16:23] havenwood: One fewer method calls.
[21:17:21] Bish: havenwood: was just going to confuse the audience
[21:17:25] Bish: bad code is good for that
[21:20:13] stooj: has joined #ruby
[21:20:22] al2o3-cr: well i never knew you could use break in tap.
[21:25:35] DTZUZO: has joined #ruby
[21:31:30] Eiam: lol thats just cruel
[21:31:46] Eiam: 'here is this non destructive thing, lets make it destructive!'
[21:33:44] DTZUZO: has joined #ruby
[21:49:42] wolfshappen: has joined #ruby
[21:54:08] baweaver: Eiam: Well we all wanted to go out with a bank
[21:54:23] baweaver: but I guess we have to settle for taking a break instead
[21:55:13] k0mpa: has joined #ruby
[21:56:26] nchambers: i would like to go out with a bank
[21:57:58] al2o3-cr: my thoughts too.
[21:58:57] aarkerio: has joined #ruby
[22:00:13] aarkerio: hi! if I have an array of symbols like: [:HTML, :CSS, :JavaScript, :Python, :Ruby]
[22:00:40] aarkerio: how can I convert it to a "string" of symbols ?
[22:01:06] nchambers: &>> [:HTML, :CSS, :JavaScript, :Python, :Ruby].map(&:to_s)
[22:01:06] rubydoc: # => ["HTML", "CSS", "JavaScript", "Python", "Ruby"] (https://carc.in/#/r/5h4r)
[22:02:02] aarkerio: I mean, I have this method: params.require(:data).require(:name, :email, :password)
[22:02:44] aarkerio: but the arguments in the "require" method can be variable
[22:03:32] aarkerio: something like: fields = action_name == "signup" ? [:name, :email, :password] : [:email, :password]
[22:03:39] nchambers: params.require(:data).require(*mylist)
[22:03:46] aarkerio: so: params.require(:data).require(fields)
[22:04:02] aarkerio: but "require" is expecting symbols
[22:04:13] nchambers: *mylist gives it symbols
[22:05:22] eckhardt: has joined #ruby
[22:05:30] nchambers: it takes a variable number of symbols right? you could just do something like: fields = [:email, :password]; fields << :name if action_name == "signup"; params.require(*fields)
[22:07:23] rwb: has joined #ruby
[22:07:37] aarkerio: works! thanks!
[22:31:49] al2o3-cr: &>> ([*?a..?z,*' ']*'').unpack('x11aX8ax7ax7aX4ax0ax7aX23ax16aX18ax19aX3aX16aX4ax12aX14a')*''
[22:31:50] rubydoc: # => "lemurs eveywhere" (https://carc.in/#/r/5h4s)
[22:34:16] al2o3-cr: oops, i missed the *r
[22:35:53] phaul: ah, so this is basically a brainfuck interpreter
[22:38:12] al2o3-cr: phaul: hmm, nope.
[22:38:19] phaul: sort of.. some subset of it. It cant do loops
[22:40:12] al2o3-cr: but i suppose it could be, you know what i've never thought about doing it this way.
[22:40:39] mroutis: has joined #ruby
[22:41:35] phaul: hm. manipulating the data tape is an issue :(
[22:42:37] al2o3-cr: hmm, you can probably use @ ?
[22:44:26] phaul: isn't that just good for positioning the head? like move to absolute offset
[22:44:36] al2o3-cr: ah, probably not.
[22:44:54] phaul: yeah. it would have been cool :)
[22:44:54] al2o3-cr: phaul: yes.
[22:45:04] al2o3-cr: would've ayy =)
[22:45:21] al2o3-cr: oh well, good thought though.
[22:46:01] rubydoc: # => " " (https://carc.in/#/r/5h4u)
[22:47:34] nchambers: what does the * operator do?
[22:48:11] al2o3-cr: nchambers: alias to join
[22:48:24] nchambers: erm, I meant ? sorry
[22:48:42] al2o3-cr: char/byte literal
[22:53:14] clemens3_: has joined #ruby
[22:57:32] blassin: has joined #ruby
[22:59:47] eckhardt: has joined #ruby
[23:02:56] jetchisel: has joined #ruby
[23:05:20] eckhardt: has joined #ruby
[23:08:43] mikecmpbll: has joined #ruby
[23:24:28] bmurt: has joined #ruby
[23:25:58] eckhardt: has joined #ruby
[23:44:57] eckhardt: has joined #ruby
[23:45:42] asphyxia: has joined #ruby
[23:52:07] segy: has joined #ruby