Valentino Stoll
speaker
350 appearances
6 recordings
1 series
first heard Sep 2024
last heard Oct 2024
Valentino Stoll’s voice in public audio — every appearance, attributed to the second.
Trend
recordings per month · last 12 monthsNo recordings in the last 12 months.Older appearances are listed below; set an alert to hear about the next one.
Appearances
Oh, there you go.
Sure. Yeah, I mean... IRB is basically just a REPL. You give it input and it'll evaluate the Ruby that you give it, analyze the syntax of it, and then directly show you the output for whatever that it is that you give it. So people work in REPLs all the time. If you open up any console, that's a REPL in a bash shell, basically. But Ruby's IRB kind of has a hierarchy to it.
that breaks all the different pieces of it into little modules that then pipe it through as it's going through and evaluating just the strings that you're giving it. And it does that in real time. And it does that basically in what they call a session and wraps that in a context and then evaluates it inside of a binding, which is really the underpinnings of Ruby code
Ruby's own core evaluation is the binding object. And then through the binding, it can basically compile Ruby on the fly into low-level code and do whatever it is that you tell it to do. You know, IRB, it's kind of like what gets you really into Ruby, right? You go and you're trying to learn a new, like try and learn any new language, even JavaScript as an example.
You'll go and what do you do is you open up the JavaScript console and you try and play around and move elements around or, you know. try and be the first to purchase a pair of sneakers or something like that. But, you know, learning Ruby is so easy. You don't do the same thing. You open up an IRB session and they just type anything that you want and you can play around with the language.
It's pretty powerful. Yep, absolutely.
So coming into this, definitely the customization part.
of the prompt itself so i believe it was matt swanson that i discovered the uh you know customization of the prompt for when you're in a production server that you could just signal hey this is a different server than your development console you might want to be careful what you write in here and from there it kind of just exploded into okay well what else is in this
customization and you know you open up your you find out you start you start with the irbrc as like your starting point and it kind of leads you into the rabbit hole of customization and what i realize is that you can basically make this file that will evaluate anytime you open up irb and do whatever you want with it so anytime you're trying to you know open up
specific set of code in a specific context, you can make a custom IRB file for whatever that context might be. So that was probably my biggest, you know, aha moment. And as an example, what we eventually ended up doing at Doximity was making a special Rails console that tagged the system internally
to say, hey, any changes made to the database, you know, make sure they're attributed to whoever the current user is. So we implemented that and then allowed, you know, full auditing for whatever user was logged into the system, you know, with just a simple little Rails customization. Gotcha.
Yeah, more for accountability than anything else. You say, hey, what were you doing during this change? Sometimes you just need to audit the specific scenario of a change so that you can go and make sure it didn't affect anything else as a side effect.
Short answer, no. I mean, there's a kind of a discrepancy here. And it's two worlds colliding where somebody made a better IRB at one point. And now kind of the features of Pry are sneaking into the native Ruby IRB. Which is awesome. Yeah. So, I mean, they're very... They're completely different things at this point.
Yes. Rails console is wrapped on IRB.
Gotcha. Yeah. So as far as like what Rails is doing, it's probably just an elaborate IRB RC thing. Because anything you have in your IRB-C will be in the context of whatever ends up being the IRB session you're in. So when you do Rails C, I imagine it just loads the application and makes a few things available to the terminal, like the reload command or something like that.
Yeah, that makes sense.
That's kind of the value of the IRB-C2 is like you can define methods in there that do whatever you want. So, you know, Rails has the customizations with a bunch of methods that it'll inject into the session and, you know, give you that available. So I have some myself, which will give me me. as an example.
So then I have a who am I, basically, that gives you access to your current user's name and a bunch of related ones to that.
I mean, what you could do is you can make your own input method that then remaps all of the characters. So as you're typing, it'll output a different character. Yeah, yeah.
Not technically the IRBRC. We have a custom initializer for Rails itself that will just make some modifications to the Rails console itself and then start up kind of call super on it.
Showing 241–260 of 350 · page 13 of 18
← Previous
Next →