« Back to channel list

#ruby - 01 April 2019

« Back 1 day Forward 1 day »
[00:03:20] galtgendo: ...OK, I think I finally found something useful...
[00:04:17] doodleb9: has joined #ruby
[00:13:17] cd: has joined #ruby
[00:24:28] doodlebug: has joined #ruby
[00:28:55] yokel: has joined #ruby
[00:37:44] Swyper: has joined #ruby
[00:51:59] interruptinuse: has joined #ruby
[00:57:24] uplime: I've got some certificates (let's just say they're all PEM encoded right now) in a single file that I can read into a string easily enough, but does anyone have a good way to split it up so I can store each certificate in their own `OpenSSL::X509::Certificate` instance? The only thing I can think of is splitting on "-----\n-----", but that doesn't seem like a very good method
[00:57:47] PaulePanter: has joined #ruby
[01:08:45] Swyper: has joined #ruby
[01:17:01] brool: has joined #ruby
[01:20:43] jinie: has joined #ruby
[01:24:10] _whitelogger: has joined #ruby
[01:29:30] mangold: has joined #ruby
[01:29:37] orbyt_: has joined #ruby
[01:33:28] spacesuitdiver: has joined #ruby
[01:38:01] interruptinuse: has joined #ruby
[01:42:22] sgen: has joined #ruby
[01:42:49] zlogan2003: has joined #ruby
[02:11:15] t0xik: has joined #ruby
[02:20:15] adam12: uplime: Looks OK to me. Might be the best you can get.
[02:25:46] sgen: has joined #ruby
[02:43:47] jcarl43: has joined #ruby
[02:44:17] DmitryBochkarev: has joined #ruby
[02:51:06] orbyt_: has joined #ruby
[02:55:21] GodFather: has joined #ruby
[02:57:37] Swyper: has joined #ruby
[03:02:54] Swyper: has joined #ruby
[03:10:55] braincrash: has joined #ruby
[03:15:59] Swyper: has joined #ruby
[03:16:59] cschneid: has joined #ruby
[03:18:33] bmurt: has joined #ruby
[03:32:14] Swyper: has joined #ruby
[03:41:35] ur5us: has joined #ruby
[03:47:18] sgen: has joined #ruby
[03:54:44] Swyper: has joined #ruby
[04:38:41] dysaniak: has joined #ruby
[04:39:12] dysaniak: Anybody know why Random.new(1) sometimes behaves like Random.new?
[04:41:55] dysaniak: When I define it in a function, it freezes properly, but if I define it outside the scope of the function, it behaves truly randomly.
[04:42:00] dysaniak: def foo; Random.new(1).rand; end
[04:42:16] dysaniak: RAND=Random.new(1); def bar; RAND.rand; end
[04:42:39] dysaniak: #foo is deterministic, while #bar is random
[04:44:53] dysaniak: Oh, I get it.
[04:45:50] dysaniak: Each call to rand increments something. Hence the method-level definition stays locked: it resets the incrementer.
[04:45:54] dysaniak: Thanks, everyone.
[04:47:38] ferr: has joined #ruby
[04:59:27] mangold: has joined #ruby
[05:16:23] DmitryBochkarev: has joined #ruby
[05:18:14] conta: has joined #ruby
[05:28:45] pwnd_nsfw`: has joined #ruby
[05:36:29] sidx64: has joined #ruby
[05:55:32] mangold: has joined #ruby
[06:12:24] v01d4lph4: has joined #ruby
[06:17:42] al2o3-cr: has joined #ruby
[06:26:34] Terens: has joined #ruby
[06:42:16] jmcgnh_: has joined #ruby
[06:45:16] aufi: has joined #ruby
[07:00:08] queip: has joined #ruby
[07:01:54] andikr: has joined #ruby
[07:05:28] alem0lars: has joined #ruby
[07:06:10] al2o3-cr: morning ruby it's a brand new day! ;)
[07:07:38] Renich: has joined #ruby
[07:10:20] iMadper: has joined #ruby
[07:10:26] clemens3: has joined #ruby
[07:21:21] jenrzzz: has joined #ruby
[07:21:32] TomyWork: has joined #ruby
[07:28:00] queip: has joined #ruby
[07:29:57] pwnd_nsfw: has joined #ruby
[07:30:14] sidx64: has joined #ruby
[07:36:11] aupadhye: has joined #ruby
[07:36:56] claudiuinberlin: has joined #ruby
[07:43:51] mikecmpbll: has joined #ruby
[07:44:15] jenrzzz: has joined #ruby
[07:46:50] crankharder: has joined #ruby
[07:50:36] ellcs: has joined #ruby
[07:50:38] hightower2: has joined #ruby
[07:54:45] schleppel: has joined #ruby
[08:17:16] pwnd_nsfw`: has joined #ruby
[08:17:17] evdubs_: has joined #ruby
[08:17:41] ur5us: has joined #ruby
[08:23:46] zlogan2003: has joined #ruby
[08:23:48] sidx64: has joined #ruby
[08:30:12] _whitelogger: has joined #ruby
[08:32:28] WhereIsMySpoon: has joined #ruby
[08:37:39] vondruch: has joined #ruby
[08:38:16] reber: has joined #ruby
[08:39:34] vondruch: has joined #ruby
[08:39:40] mikecmpb_: has joined #ruby
[08:50:14] aupadhye: has joined #ruby
[08:58:07] kyrylo: has joined #ruby
[09:04:00] d10n-work: has joined #ruby
[09:16:13] dhollinger: has joined #ruby
[09:23:39] pwnd_nsfw: has joined #ruby
[09:25:26] snickers: has joined #ruby
[09:32:51] mangold: has joined #ruby
[09:35:59] alem0lars: has joined #ruby
[09:37:51] ur5us: has joined #ruby
[09:42:05] pwnd_nsfw`: has joined #ruby
[09:51:05] jenrzzz: has joined #ruby
[10:02:15] esrse: has joined #ruby
[10:02:18] kapil____: has joined #ruby
[10:04:59] conta: has joined #ruby
[10:05:40] Furai: has joined #ruby
[10:05:44] aupadhye: has joined #ruby
[10:12:23] pwnd_nsfw: has joined #ruby
[10:14:15] lxsameer: has joined #ruby
[10:15:00] Furai: has joined #ruby
[10:38:04] AndreYuhai: has joined #ruby
[10:39:03] yokel: has joined #ruby
[10:39:47] AndreYuhai: Hello there, I want to select a range from the array which will be from the index number 1 to the last index. I've tried this: arr[1..] and this worked on irb, but then RuboCop warns me on RubyMine. Is that expression correct?
[10:46:00] al2o3-cr: AndreYuhai: what ruby version?
[10:47:08] AndreYuhai: al2o3-cr: ruby 2.6.1p33 (2019-01-30 revision 66950) [x86_64-linux]
[10:47:29] al2o3-cr: what's the warning?
[10:48:22] AndreYuhai: al2o3-cr: unexpected token trBRACK
[10:48:49] ellcs: has joined #ruby
[10:50:06] al2o3-cr: yeah, seems rubocop is at fault there.
[10:50:17] al2o3-cr: that shouldn't be an error.
[10:50:54] hightower2: has joined #ruby
[10:51:02] AJA4350: has joined #ruby
[10:53:33] al2o3-cr: AndreYuhai: have you configured `TargetRubyVersion' in rubocop.yml?
[10:54:10] AndreYuhai: al2o3-cr: no I didn't
[10:54:57] al2o3-cr: set your ruby version to 2.6.
[10:55:14] AndreYuhai: al2o3-cr: okay I will just a sec.
[10:56:42] Tau: has joined #ruby
[10:56:52] al2o3-cr: AndreYuhai: under AllCops btw.
[11:01:39] Swyper: has joined #ruby
[11:03:42] AndreYuhai: al2o3-cr: should I create the rubocop.yml file for each project separately? Because I can't find it.
[11:04:24] al2o3-cr: AndreYuhai: yes, or create .ruby_version file.
[11:04:41] al2o3-cr: * .ruby-version
[11:06:34] al2o3-cr: AndreYuhai: wait, did you even configure one in the first place?
[11:07:03] AndreYuhai: al2o3-cr: No I didn't that's why I do not know about it. :D
[11:07:16] al2o3-cr: hehe, ok np.
[11:07:22] al2o3-cr: run: rubocop --auto-gen-config
[11:10:21] AndreYuhai: al2o3-cr: Thank you. Now I've created them but in rubocop.yml it says inherit from rubocop_todo.yml but in todo there is nothing about AllCops
[11:11:56] crankharder: has joined #ruby
[11:12:10] al2o3-cr: add it to rubocop_todo.yml
[11:12:44] sphenxes: has joined #ruby
[11:13:13] al2o3-cr: TargetRubyVersion: 2.6
[11:14:01] vondruch: has joined #ruby
[11:15:17] al2o3-cr: AndreYuhai: or just create a specific rubocop.yml for each project.
[11:16:28] alem0lars: has joined #ruby
[11:17:27] al2o3-cr: AndreYuhai: "rm .rubocop_todo.yml .rubocop.yml"
[11:17:48] al2o3-cr: and just create a rubocop.yml and add them lines above.
[11:25:19] AndreYuhai: al2o3-cr: I just added it but the warning is still the same
[11:25:56] al2o3-cr: AndreYuhai: rm .rubocop_todo.yml .rubocop.yml
[11:26:38] AndreYuhai: al2o3-cr: oh sorry I will do that now.
[11:27:02] al2o3-cr: AndreYuhai: it's my error not yours :P
[11:28:13] al2o3-cr: then: touch $HOME/.rubocop.yml
[11:28:38] al2o3-cr: TargetRubyVersion: 2.6
[11:28:47] al2o3-cr: then add these two lines.
[11:29:52] AndreYuhai: but the one in the project directory will stay too, right?
[11:30:50] al2o3-cr: did you create a rubocop.yml in the project directory?
[11:31:02] al2o3-cr: ^ AndreYuhai
[11:31:07] AndreYuhai: al2o3-cr: yes in $HOME and project directory
[11:31:23] AndreYuhai: al2o3-cr: now everything is fine but I do not know because of which one :D
[11:31:40] al2o3-cr: delete the one in the project directory
[11:31:51] AndreYuhai: al2o3-cr: okay
[11:32:25] al2o3-cr: AndreYuhai: then all you've got now is $HOME/.rubocop.yml ?
[11:32:33] AndreYuhai: al2o3-cr: Yes now that is all.
[11:32:41] AndreYuhai: al2o3-cr: and it worked, thank you. :)
[11:33:26] al2o3-cr: AndreYuhai: that is way longer than should of been :P (my fault)
[11:34:05] al2o3-cr: AndreYuhai: now just add rules as you see fit in $HOME/.rubocop.yml
[11:34:13] AndreYuhai: al2o3-cr: anyway I appreciate the help ^^
[11:34:37] al2o3-cr: AndreYuhai: no worries :)
[11:38:02] Swyper: has joined #ruby
[11:42:34] jcalla: has joined #ruby
[11:44:51] silviu8: has joined #ruby
[11:46:04] helpa: has joined #ruby
[11:56:23] PaulePanter: has joined #ruby
[12:09:15] mangold: has joined #ruby
[12:10:36] al2o3-cr: AndreYuhai: can i just make a suggestion. use can use arr.drop(1) which is ~2x faster
[12:11:51] AndreYuhai: al2o3-cr: Oh I didn't know about that method. Sure that is even better what I needed was just to drop first index (table header :D)
[12:12:31] griffindy: has joined #ruby
[12:12:48] AndreYuhai: al2o3-cr: Thanks once again! :)
[12:13:00] al2o3-cr: AndreYuhai: np
[12:14:22] al2o3-cr: is this csv?
[12:15:57] al2o3-cr: ^ AndreYuhai
[12:16:48] AndreYuhai: al2o3-cr: No, that is a table from HTML
[12:19:28] al2o3-cr: AndreYuhai: [1..-1] though, is roughly the same. fyi ;)
[12:21:27] vondruch_: has joined #ruby
[12:23:25] ldnunes: has joined #ruby
[12:28:17] ellcs1: has joined #ruby
[12:36:39] Milos: has joined #ruby
[12:38:00] Ai9zO5AP: has joined #ruby
[12:40:52] bmurt: has joined #ruby
[12:41:46] crankharder: has joined #ruby
[12:46:04] Azure: has joined #ruby
[12:59:12] jottr: has joined #ruby
[13:14:30] fredolinhares: has joined #ruby
[13:22:30] doodlebug: has joined #ruby
[13:23:28] snickers: has joined #ruby
[13:24:21] jcalla: has joined #ruby
[13:31:02] vondruch: has joined #ruby
[13:31:15] Superhanz: has joined #ruby
[13:32:11] lele: has joined #ruby
[13:32:20] Superhanz: how do i store tuples in ruby?
[13:32:42] Superhanz: I want to store two strings: [("description of award", "team's name")]
[13:32:54] suukim: has joined #ruby
[13:33:15] Superhanz: so that I could have [("fastest time", "blue team"), ("least hints", "red team"), ... ]
[13:33:28] Superhanz: but only can see arrays and hashes?
[13:33:31] Superhanz: are there also tuples?
[13:34:12] phaul: arrays, hashes, structs, openstructs, custom type
[13:34:49] Superhanz: so best way is gonna just be a 2D array?
[13:34:58] Superhanz: that seems so sloppy idk... ah well
[13:35:30] phaul: it's one option, idk about best.
[13:35:36] phaul: struct maybe?
[13:36:11] Superhanz: hmmm i wil look into structs, never heard of them tbh
[13:36:24] phaul: &ri Struct
[13:36:24] rubydoc: https://ruby-doc.org/core-2.6/Struct.html
[13:36:27] Superhanz: thanks for help by the way phaul
[13:37:28] Superhanz: oh struct looks good
[13:51:47] gigetoo: has joined #ruby
[13:54:05] dlfjklgjelkrtj: has joined #ruby
[14:04:30] jottr: has joined #ruby
[14:04:51] noboruma: has joined #ruby
[14:05:25] AJA4350: has joined #ruby
[14:08:24] vondruch: has joined #ruby
[14:13:35] noboruma: has joined #ruby
[14:27:04] dante: has joined #ruby
[14:30:00] spacesuitdiver: has joined #ruby
[14:34:49] lucasb: has joined #ruby
[14:36:51] crankharder: has joined #ruby
[14:37:23] SeepingN: has joined #ruby
[14:49:52] rippa: has joined #ruby
[14:51:25] dante: has joined #ruby
[14:53:38] LtHummus: has joined #ruby
[14:58:39] brool: has joined #ruby
[14:59:12] dante: has joined #ruby
[14:59:40] mangold: has joined #ruby
[15:00:05] hightower2: has joined #ruby
[15:03:29] polishdub: has joined #ruby
[15:07:48] hoffentlichja: has joined #ruby
[15:10:17] gb_away: has joined #ruby
[15:10:55] jottr: has joined #ruby
[15:11:56] Nicmavr: has joined #ruby
[15:13:30] AJA4350: has joined #ruby
[15:13:56] spiette: has joined #ruby
[15:17:01] sgen: has joined #ruby
[15:17:56] duderonomy: has joined #ruby
[15:18:08] rails759: has joined #ruby
[15:18:17] i1nfusion: has joined #ruby
[15:18:18] ChanServ: +o havenwood
[15:18:21] i1nfusion1: has joined #ruby
[15:18:21] havenwood: rails759: hi
[15:18:35] rails759: I installed ruby on rails and I am obtaining this error
[15:18:40] rails759: An error occurred while installing bootsnap (1.4.2), and Bundler cannot continue. Make sure that gem install bootsnap -v '1.4.2' --source 'https://rubygems.org/' succeeds before bundling.
[15:18:58] rails759: can someone please help me?
[15:19:00] ChanServ: -o havenwood
[15:19:32] i1nfusion: has joined #ruby
[15:19:32] i1nfusion1: has joined #ruby
[15:19:43] havenwood: rails759: What error do you get when you try to install the bootsnap gem as it recommends?
[15:20:07] rails759: it says make failed, exit code 2
[15:20:46] rails759: and after that In Gemfile: bootsnap
[15:22:21] rails759: I also see: Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
[15:22:48] DmitryBochkarev: has joined #ruby
[15:30:55] AJA4350: has joined #ruby
[15:31:51] akem: has joined #ruby
[15:33:54] clemens3: has joined #ruby
[15:34:40] jottr: has joined #ruby
[15:34:57] conta: has joined #ruby
[15:38:36] Swyper: has joined #ruby
[15:39:03] nowhere_man: has joined #ruby
[15:42:03] kyrylo: has joined #ruby
[15:42:47] havenwood: rails759: It's hard to say without seeing the rest of the build error. Do you have system build tools installed?
[15:43:08] havenwood: rails759: What OS/distro?
[15:43:16] rails759: I don't think I do. I am using windows 10
[15:43:41] havenwood: rails759: Are you installing in Windows or WSL?
[15:43:56] havenwood: rails759: Could you gist the full error?
[15:44:14] havenwood: rails759: Did you use Windows Installer?
[15:44:22] rails759: I am installing on windows
[15:44:34] rails759: I used the windows intaller
[15:45:09] havenwood: rails759: You'll want to install the "DevKit" then: https://rubyinstaller.org/add-ons/devkit.html
[15:45:23] havenwood: rails759: Try: ridk install
[15:47:09] rails759: very good, I am installing the devkit, thank you so much for your help and response
[15:47:34] jottr: has joined #ruby
[15:56:27] havenwood: Ooh, that's an interesting new experimental feature... the fourquals operator: ====
[16:03:13] havenwood: Ruby 2.4 version bump time! Ruby 2.4.6 was released with a variety of little backported fixes.
[16:03:47] havenwood: It's ready to go on ruby-install, RVM and ruby-build.
[16:12:08] gix: has joined #ruby
[16:13:35] mangold: has joined #ruby
[16:19:06] ngw: has joined #ruby
[16:20:27] ngw: hello *, I'm struggling with a problem that I guess is quite easy: I'm using a node.js module to encrypt some variables with Aws kms, variables that I want to decrypt using ruby and obviously the aws-kms module
[16:22:05] ngw: I can see everything is happening here: https://github.com/nordcloud/serverless-kms-secrets/blob/master/index.js#L81-L94
[16:22:40] ngw: I'm not sure what that `Buffer.from` is in Node.js and how to emulate it in Ruby, but unfortunately I can't make it work
[16:23:20] ngw: The whole thing is summarized in https://stackoverflow.com/questions/55168878/decrypting-keys-from-aws-kms-in-ruby if someone wants some reputation points on SO
[16:23:45] dar123: has joined #ruby
[16:24:01] [Butch]: has joined #ruby
[16:24:41] doodleb1: has joined #ruby
[16:26:39] ngw: omg what an idiot I am
[16:28:14] orbyt_: has joined #ruby
[16:28:16] Renich: has joined #ruby
[16:34:22] electrofelix: has joined #ruby
[16:35:32] Inline: has joined #ruby
[16:39:55] Swyper: has joined #ruby
[16:45:11] doodlebug: has joined #ruby
[16:46:12] nowhere_man: has joined #ruby
[16:56:02] claudiuinberlin: has joined #ruby
[16:59:40] sgen: has joined #ruby
[17:04:38] duderonomy: has joined #ruby
[17:12:03] duderonomy: has joined #ruby
[17:20:55] terabytes: has joined #ruby
[17:27:02] ryouba: has left #ruby: ("WeeChat 1.6")
[17:27:54] DmitryBochkarev: has joined #ruby
[17:28:52] SuperLag: has joined #ruby
[17:31:48] mangold: has joined #ruby
[17:33:54] nowhere_man: has joined #ruby
[17:37:59] [Butch]: has joined #ruby
[17:50:42] ldnunes: has joined #ruby
[17:52:48] reber: has joined #ruby
[18:06:52] sgen: has joined #ruby
[18:07:07] zachk: has joined #ruby
[18:12:53] conta: has joined #ruby
[18:14:38] JL: has joined #ruby
[18:14:42] doodlebug: has joined #ruby
[18:17:23] JL: Hi. Does anyone recall the name of the Ruby lessons that took you from simple to more complex Ruby concepts and would check your work. I used it years ago and thought it was excellent. It may have been a Gem but recall it being a Japanese name. It had about 100 lessons and you used the terminal to modify the code it started you with. Thank you.
[18:18:44] i1nfusion: has joined #ruby
[18:18:48] i1nfusion1: has joined #ruby
[18:22:30] duderonomy: has joined #ruby
[18:30:07] lxsameer: has joined #ruby
[18:30:30] baweaver: JL: RubyKatas iirc
[18:30:35] baweaver: Or RubyMonk
[18:30:52] baweaver: The latter is up and down depending on how much the owners are paying attention
[18:35:29] i1nfusion: has joined #ruby
[18:35:37] i1nfusion1: has joined #ruby
[18:37:14] JL: baweaver: Thank you. Maybe RubyKatas. It sounds Japanese to me. I'll look google that. I don't think it was RubyMonk because I did the lessons on my own system on the command line.
[18:40:41] jenrzzz: has joined #ruby
[18:45:05] JL: It was the RubyKoans! That was driving me crazy.
[18:45:25] claudiuinberlin: has joined #ruby
[18:53:33] c0dec: has joined #ruby
[19:01:16] jenrzzz_: has joined #ruby
[19:04:49] havenwood: JL: Ahhh, the Koans! Nice
[19:05:06] havenwood: Those are wonderful
[19:06:17] snickers: has joined #ruby
[19:11:50] yokel: has joined #ruby
[19:16:13] cd: has joined #ruby
[19:16:13] hiroaki: has joined #ruby
[19:16:48] tdy: has joined #ruby
[19:22:41] hightower2: has joined #ruby
[19:25:39] code_zombie: has joined #ruby
[19:27:38] hightower2: has joined #ruby
[19:29:25] jenrzzz: has joined #ruby
[19:29:36] miah: also check out exercism.io
[19:34:47] zapata: has joined #ruby
[19:37:57] kyrylo: has joined #ruby
[19:59:16] eckhardt: has joined #ruby
[20:05:28] Azure: has joined #ruby
[20:08:20] doodlebug: has joined #ruby
[20:08:55] doodlebug: has joined #ruby
[20:13:47] ur5us: has joined #ruby
[20:30:41] jenrzzz: has joined #ruby
[20:31:16] yokel: has joined #ruby
[20:36:08] fredolinhares: has joined #ruby
[20:45:49] jenrzzz: has joined #ruby
[20:50:43] bambanx: has joined #ruby
[20:51:18] stanc: has joined #ruby
[20:54:44] Sylario: has joined #ruby
[20:56:19] catbusters: has joined #ruby
[20:59:41] infernix: has joined #ruby
[21:00:53] lxsameer: has joined #ruby
[21:04:17] Dirak: has joined #ruby
[21:05:36] ur5us: has joined #ruby
[21:09:24] dante: has joined #ruby
[21:15:58] remi: has joined #ruby
[21:18:40] hiroaki: has joined #ruby
[21:21:48] yokel: has joined #ruby
[21:27:26] yokel: has joined #ruby
[21:33:59] al2o3-cr: has joined #ruby
[21:41:24] eckhardt: has joined #ruby
[21:41:45] noboruma: has joined #ruby
[21:46:48] havenwood: has joined #ruby
[21:46:48] havenwood: has joined #ruby
[21:48:53] yokel: has joined #ruby
[21:50:06] infernix: has joined #ruby
[22:04:42] AJA4350: has joined #ruby
[22:17:30] zenspider: has joined #ruby
[22:19:19] Dirak: has joined #ruby
[22:23:16] remi: has left #ruby: ()
[22:29:55] Renich: has joined #ruby
[22:31:56] jenrzzz: has joined #ruby
[22:35:00] cd: has joined #ruby
[22:47:01] isakovic: has joined #ruby
[22:47:08] crankharder: has joined #ruby
[22:47:11] hiroaki: has joined #ruby
[23:00:29] dinfuehr_: has joined #ruby
[23:14:49] mikecmpbll: has joined #ruby
[23:37:49] Renich: has joined #ruby
[23:50:58] iMadper: has joined #ruby
[23:52:41] arescorpio: has joined #ruby