Menu
Sign In Search Podcasts Charts People & Topics Add Podcast API Blog Pricing

Valentino Stoll

๐Ÿ‘ค Speaker
700 total appearances

Appearances Over Time

Podcast Appearances

Ruby Rogues
The Hidden Gems of Ruby - RUBY 651

Yeah, that's right. And I mean, the customization of the prompt, too, is just hugely helpful, especially when you have to jump context through many servers. So we have at Doximity a series of staging servers that are separate from development, right, so that we can add quality control and test out a lot of our changes. And then we have several production servers that are all different.

Ruby Rogues
The Hidden Gems of Ruby - RUBY 651

Yeah, that's right. And I mean, the customization of the prompt, too, is just hugely helpful, especially when you have to jump context through many servers. So we have at Doximity a series of staging servers that are separate from development, right, so that we can add quality control and test out a lot of our changes. And then we have several production servers that are all different.

Ruby Rogues
The Hidden Gems of Ruby - RUBY 651

And it's nice to see them labeled so you know instantly, especially if you have a bunch of different terminal windows open that all have an IRB session in it. You don't want to get confused about... which one you're in. Right.

Ruby Rogues
The Hidden Gems of Ruby - RUBY 651

And it's nice to see them labeled so you know instantly, especially if you have a bunch of different terminal windows open that all have an IRB session in it. You don't want to get confused about... which one you're in. Right.

Ruby Rogues
The Hidden Gems of Ruby - RUBY 651

Yeah. And I mean, we don't all have access and it's certainly limited.

Ruby Rogues
The Hidden Gems of Ruby - RUBY 651

Yeah. And I mean, we don't all have access and it's certainly limited.

Ruby Rogues
The Hidden Gems of Ruby - RUBY 651

Sure. I know a couple. I mean, a lot of these are brand new, like in Rails 3. But there was just merged a pry-like ls command. So you can basically list all the methods on a particular object. as an example. I imagine the next step to that would be the cd command to pry, where you can basically move into the object.

Ruby Rogues
The Hidden Gems of Ruby - RUBY 651

Sure. I know a couple. I mean, a lot of these are brand new, like in Rails 3. But there was just merged a pry-like ls command. So you can basically list all the methods on a particular object. as an example. I imagine the next step to that would be the cd command to pry, where you can basically move into the object.

Ruby Rogues
The Hidden Gems of Ruby - RUBY 651

And you can kind of already do that with IRB, because you can run IRB on any Ruby object and enter inside of the context of it. So if you make an instance of something and you IRB that instance, then you're in the context of the instance. And you could do the same with the class and pretty much any, you know, object in Ruby. How do you do that? How do you go inside the objects? Sure.

Ruby Rogues
The Hidden Gems of Ruby - RUBY 651

And you can kind of already do that with IRB, because you can run IRB on any Ruby object and enter inside of the context of it. So if you make an instance of something and you IRB that instance, then you're in the context of the instance. And you could do the same with the class and pretty much any, you know, object in Ruby. How do you do that? How do you go inside the objects? Sure.

Ruby Rogues
The Hidden Gems of Ruby - RUBY 651

So when you're in the IRB console itself, you just run IRB and then the object. So if you did, you know, string new and you just said IRB string new, you can enter inside the instance of a string and play with all the methods. You don't have to do the string's object name as a variable and then dot whatever. You just enter the method.

Ruby Rogues
The Hidden Gems of Ruby - RUBY 651

So when you're in the IRB console itself, you just run IRB and then the object. So if you did, you know, string new and you just said IRB string new, you can enter inside the instance of a string and play with all the methods. You don't have to do the string's object name as a variable and then dot whatever. You just enter the method.

Ruby Rogues
The Hidden Gems of Ruby - RUBY 651

So it's kind of a fun way to explore the object without having to run a bunch of chained methods.

Ruby Rogues
The Hidden Gems of Ruby - RUBY 651

So it's kind of a fun way to explore the object without having to run a bunch of chained methods.

Ruby Rogues
The Hidden Gems of Ruby - RUBY 651

Yeah, and I mean, another cool thing which Pry gives that maybe you just don't know about IRB is you get a lot of context from the source code just using the method method, right? So when you say, you know, method and then... colon some, the name of some method, it returns a special Ruby object that describes what the method is, what it does, the source location.

Ruby Rogues
The Hidden Gems of Ruby - RUBY 651

Yeah, and I mean, another cool thing which Pry gives that maybe you just don't know about IRB is you get a lot of context from the source code just using the method method, right? So when you say, you know, method and then... colon some, the name of some method, it returns a special Ruby object that describes what the method is, what it does, the source location.

Ruby Rogues
The Hidden Gems of Ruby - RUBY 651

And you could pull all that information to open up a new, you know, i use vim as my command or as my editor so i i often well i'll have a special you know method in my irbrc that allows me to open a vim you know editor with whatever the source location is for the method that i'm interested in in the context of an irb session so it ends up you know being a You can open up any editor.

Ruby Rogues
The Hidden Gems of Ruby - RUBY 651

And you could pull all that information to open up a new, you know, i use vim as my command or as my editor so i i often well i'll have a special you know method in my irbrc that allows me to open a vim you know editor with whatever the source location is for the method that i'm interested in in the context of an irb session so it ends up you know being a You can open up any editor.

Ruby Rogues
The Hidden Gems of Ruby - RUBY 651

It can be, it doesn't have to be Vim. Yeah. Right. But no, that makes sense. That, that sounds really handy.

Ruby Rogues
The Hidden Gems of Ruby - RUBY 651

It can be, it doesn't have to be Vim. Yeah. Right. But no, that makes sense. That, that sounds really handy.