The Hidden Gems of Ruby - RUBY 651 - podcast episode cover

The Hidden Gems of Ruby - RUBY 651

Sep 11, 202456 min
--:--
--:--
Download Metacast podcast app
Listen to this episode in Metacast mobile app
Don't just listen to podcasts. Learn from them with transcripts, summaries, and chapters for every episode. Skim, search, and bookmark insights. Learn more

Episode description

Transcript

Speaker 1

Hey everybody, and welcome to another episode of the Ruby Rokes podcast. This week, on our panel, we have John Epperson. Hello, everybody, book stutters Hello. I'm Charles Maxwood from dev chat dot tv. I just want to shout out go check out dev influencers dot com if you're looking to be a dev influencer.

I guess that's pretty straightforward. We have a special guest this week, and that's Voluntino Stole Valentino, do you want to introduce yourself, let everybody know why you're offesome and all that good stuff.

Speaker 2

Say there?

Speaker 3

Sure.

Speaker 2

I'm a software engineer at doc Simity. I've been working there for quite some time now. I've been working on Ruby quite a long time, and it's kind of my go to crutch of a language, if you will. But I really enjoy hacking away on embedded systems with Ruby. That's been my latest craze. And you know, I've really been digging deep into the Ruby core library and kind of just exploring it and it's really not that scary.

So I'm hoping to kind of make people a little make it a little more approachable for people, and hopefully get some more contributors out of it, including myself.

Speaker 1

Nice, So we have you on the docket to talk about the hidden gems of Ruby's IRB. But before we dive into that, you said embedded systems with Ruby. So are you using what is it m ruby for that?

Speaker 2

Or for some projects I have? Primarily I've been working on a Raspberry Pie. I'm no expert, so I picked up one of those starter kits that has a bajillion tiny little components to work with and slowly chipping away at converting some Python examples to prepare for this episode.

Speaker 3

I also bought a collection of roster Pie related devices. Oh there you go too, could code along with Valentino's Ruby guide, and as he says, the Python Python is infested, absolutely infested the rollsby pint ecosystem. There's Python everywhere and trying to try to root it out, trying to root it out of the hard but getting getting a kind of Ruby pitch fork and digging all of a Python out of the examples is a really fantastic work. So thank you very much for doing that.

Speaker 1

Code by code, we'll make it through gross python anyway. So yeah, well we'll send people over to your Raspberry Pie Ruby stuff because that that that's just cool stuff. In fact, we should just get you back to nerd out with that on anyway. Sure, but yeah, let's talk about IRB because it's a tool that we kind of all go to. Whether we realize that it's the Rails console kind of runs on top of IRB, or whether we just run it ourselves and then run stuff in it.

Why don't we kind of go with kind of a high level overview of what IRB is for people who are just getting into Ruby, and then we can just assume that people know it and use it and we can into okay, stuff you didn't know about, right, Sure?

Speaker 2

Yeah, I mean IRB's basically just a repel. 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 repels all the time. If you open up any console that's a repel and a bash

shell basically. But Ruby's IRB kind of has a hierarchy to it that you know, breaks it all the different pieces of it into little modules that then pipe 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. Ruby's core evaluation is the binding object, and then through the binding, it can basically compile Ruby on the fly into you know, 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?

Speaker 1

Right.

Speaker 2

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 what, learning Ruby is so easy to do the same thing. You open up the IRB session and then just type anything that you want

and you could play around with the language. It's pretty powerful.

Speaker 1

Yep, absolutely so, yeah, I don't want to go too deep into you know what it is, and you kind of connected the dots, I guess on how it evaluates the code but but I'm always looking for kind of the neat tricks, right, So let's start there and then if we have time, we can come back around to internals or other things you learn while you dove into this. Sure, so, so what are the neat tricks like? What what were the things that you didn't know? It did? That? It that it does?

Speaker 2

So coming into this definitely the customization of the prompt itself. So I believe it 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 pay. 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 I R B r C 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 I RB 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 i RB file for whatever

that context might be. So that was probably my biggest you know aha moment is And as an example, what we eventually ended up doing Docimity 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.

Speaker 1

Gotcha. So so then we know, you know, John is a witch. He turned me into a news right, Yeah, exactly, I got I got better anyway. Yeah, but yeah, you could see where that change happened, right, and you can go and you can reverse it or go slap somebody's hand or something like that, right, Yeah.

Speaker 2

More for accountability than anything else, you say, hey, you know 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, you know, as a side effect.

Speaker 1

Yeah, makes sense. Do either of you, Luke or John use a custom I what is I RBRC.

Speaker 3

I didn't even know it existed?

Speaker 4

Is this the same thing as Pride? Because I use PRIE all the time. But but I feel like a question for me. You know, he's good, he's a Pride.

Speaker 2

No short answer, No. I mean there's a kind of a discrepancy to here, and it's two worlds colliding where somebody made a better I RB at one point, and now kind of the features of PRIE are sneaking into the native Ruby I RB and awesome yep, So I mean they're very they're completely different.

Speaker 1

Things at this point. What about the Rails console? Then it's built on top of I RB, right.

Speaker 2

Yes, Reils console is wrapped.

Speaker 4

On IRB unless stall reels PRIE and then new hook and prime.

Speaker 1

Yeah, and it PRIBE has a prior C, doesn't it?

Speaker 4

It does?

Speaker 1

Ye? So so what does RAILS do in order to uh torture or otherwise modify IRB.

Speaker 2

I haven't looked into it.

Speaker 4

You haven't looked at that, Okay. I don't know that it's torturing it my understanding. So so you know, obviously, if I'm wrong, let me let us know. But my understanding is that most of what Rails is doing with its shell is just loading a bunch of Rails files. You're just loading your environment, right, so you're adding to the context.

Speaker 1

Yeah.

Speaker 4

I mean if you open an IRB show, right, even if you open it in your Rails directory, you don't have all those files loaded. But if you open your Rails console, it's already just like if you're running a rail server preloaded everything and run the initializers and all that kind of stuff.

Speaker 1

Gotcha.

Speaker 2

Yeah, So as far as like what Rails is doing, it's probably just an elaborate IRB r C because anything you have in your IRB C will be in the context of whatever the ends up being the IRB session you're in. So when you do rail C, I imagine it just loads the application and makes you know, a few things available to the terminal, like you know, the reload command or something like that.

Speaker 1

Yeah, that makes sense. Well, the reload can't command is just part of Rails anyway, so yeah, I mean that that yeah, makes sense that that would be in there.

Speaker 2

Yeah, So I mean that's that's kind of the value of the IRB C too, 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 you know a bunch of related ones to that.

Speaker 1

See, and now I want to create an evil I rb r C that like redefines common methods off of kernel.

Speaker 2

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.

Speaker 1

Yeah.

Speaker 4

Yeah, sounds like my my Apple Butterfly keyboard.

Speaker 1

Already implemented in hardware. That's what John John is saying.

Speaker 4

It's good.

Speaker 1

It's yeah, it works my Butterfly keyboard. It didn't do that. It was just p pppppppppp you know. Ye, I just tapped it once.

Speaker 4

So all right, so I have this really sweet So so first of all, I've actually done the auditing thing. Right, we did do it through an irbr C or whatever. Uh we did differently or whatever, So that totally makes sense to me. But you guys, you guys implemented that through your I.

Speaker 2

R B r C, not technically the IRB r C. 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.

Speaker 4

Okay, So so we're just talking about extensions here to our environment, all right, yep, no worries, No worries.

Speaker 3

So this kind of environment automation and warning is kind of really important for you because you're dealing with medical data and things, so it's kind of really important you don't get it wrong.

Speaker 2

Yeah, that's right, And I mean the customization of the prompt too, is just hugely helpful, especially when you have to jump contexts through many servers. So we have a proximity 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 you know, are all different and it's nice to see them labeled so you know instantly, Especially if you have a bunch of different terminal windows open right that all have an IRB session in it, you don't want to get confused about which one you're in right.

Speaker 1

Of course, I've worked at a lot of places that don't even give you that kind of access to the production systems to even be able to run IRB. Right. I mean you might your ops people might be able to do it right, and you might be able to give them specific constructions or check in rate task or something that we'll do with the work and then they can run the rate task for you.

Speaker 2

But yeah, yeah, and I mean we don't all have access, and it's it's certainly.

Speaker 4

Limited, but somebody's got to lug in when all the systems go down and it's Friday afternoon and just it just happens, you know.

Speaker 3

Yeah, this is the kind of double edged problem of this your sphere is because not only does it have to be really high security, but it also has to be high availability because the code is literally saving people's lives.

Speaker 1

Yep.

Speaker 4

All right, So we talked about some stuff that's coming over from PRY. I actually I'm like super interested because as a very heavy user of FRY basically since I discovered it, like I don't know, I don't even remember, because I don't remember my life before Pride to be frank, what.

Speaker 3

Are the checking this ILB tool could try me.

Speaker 1

Okay, all right.

Speaker 4

There are there are times when I load up IRB right, and it's primarily when either I'm writing like a Ruby script right, so I don't have a rail thing going on right, and you know, and I just want to load something up really fast, or if I'm working on a very large rail system that takes forever to load and I just want to test out something really fast, so then I just like load up IRB, require one or two files and do a thing and then exit right.

And in both of those instances, one of the first things that I often do is I type IRB and then I go require pride. So I have not lived without Pride for a very long time. So what are some of the cool features that that will get over if you know them?

Speaker 2

Sure? I know a couple the I mean a lot of these are like brand new, like in reels three, but they there was just merged a pride 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 you know, the CD command to priy, where you can you know, basically move into the object 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 i RB that instance, then you're in the context of the instance, and you could do the same with the class at pretty much any you know object in Ruby.

Speaker 3

How do you do that? How do you go inside the object?

Speaker 2

Sure, so when you're in there IRB console itself, you just run i RB and then the object. So if you did you know string new, and you just said irab string new, you can enter inside the instance of a string and play with all the methods like that. You don't have to do the strings object name as the variable and then dot whatever. You just enter the method. So it's kind of a fun way to explore the object and without having to you know, run a bunch of chained methods, you can get you.

Speaker 1

Know, how smart, e how smart I'm gonna look at work tomorrow.

Speaker 3

I didn't know that I did not know that.

Speaker 1

I didn't either.

Speaker 2

Yeah, And I mean another another cool thing which probe gives that maybe you just don't know about i RB, 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 call in some the name of some method, uh, it returns a special Ruby object that describes what the method is, what it does, the source location, 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 often, well, I'll have a special you know method in my I R v r C that allows me to open Vim you know editor with whatever the source location is for

the method that I'm interested in in the context of an I RB session. So it ends up you know, being a you can open up any editor it can be, doesn't have to be them.

Speaker 1

Yeah, right, but no, that makes sense that that sounds really handy.

Speaker 2

Yep.

Speaker 4

So the only the only Yeah, one of the main reasons that I like probably is actually this. But it's not because you just use show desk source right, right. But it's mostly because it's complicated to remember all the stuff that you have to do, right to grab the method as an object then call you know, source location or whatever.

Speaker 1

The other.

Speaker 4

The other thing that's the issue here is that probably actually does a reasonably good job. Now it didn't used to, but it does a reasonably good job of showing me, like all the dynamic stuff that goes on when I like prepend eight things into which you know it's just going to cause problems anyway. But you know, if I'm overriding my method a million times in weird odd ways, things can get weird. So yeah, I.

Speaker 2

Don't know if anybody else has looked in and not to plug pry again, but the there's actually a project called Ruby Jarred that combines PRI with buybug and it's

pretty incredible. You basically can do just like you can you know, binding do i RB in your source code or you know PRI in your source code, you can do a jarred in your source code, and when it stops the execution, it has this really beautiful kind of split pain debugging session where it shows you the current line in context but also shows you some lower level like definitions within that context, and it's it's pretty wild.

I definitely recommend people check that out. I've been using that on a couple of projects as well, but Irby is still my go to for, you know, just testing out random Rube files.

Speaker 4

Yeah, I'm pretty sure I saw that in a Ruby Weekly, and I just a bit slow to get it around to looking at it. But I like pretty things, so I'm we'll be checking out.

Speaker 1

Yeah that's really great.

Speaker 4

All right, So some sweet any other like things that are coming over so we can wrap up that part.

Speaker 1

Sure.

Speaker 2

Yeah, let's see from from priy itself. I'm not sure. I do know that they that I RB itself has introduced kind of some tracing mechanisms and measure utility to make it easy to you know, trace the execution of specific method calls while you're going through as well as you know, processing time. So I actually do that for a lot of just quick performance testing of you know, will this array method look up work faster than this

one in this context? You know, just turn on theasuring processor and just check how fast it runs.

Speaker 1

With each case.

Speaker 4

That's the thing that comes with Ruby three right specifically.

Speaker 2

Yeah, I believe so.

Speaker 3

So that's really nice interlace because it just does it for you. Off you turn it on, yep, so you type measure and then anything you run from your IRB or whatever off that that gets measured.

Speaker 1

Yeah.

Speaker 2

And it's line by line measuring too, so whatever you enter, every single thing will be you know, show you the processing time for it, which is really nice.

Speaker 4

Is that combined with the tracing stuff? So is it kinda? So if I if I create, if I turn on tracing right, and then it's giving me my whole back trace. Am I also getting whatever we call benchmarking right for each of those lines? Yep, that's pretty sweet.

Speaker 1

I'm going to go into my IRB r C and I'm gonna alias that to Vanity. It's called type in Vanity, and then they tell me how fast all my stuff is? What else is coming to Ruby three? Oh? I was gonna say.

Speaker 4

I saw one thing that I saw that I thought was really nice in the article that they kind of spawned this particular interview, was that Irby's getting colors. Now I don't have to Oh yeah, there's something separate to get colors.

Speaker 2

That's that's actually in two point seven. So if you're already on two point seven, you should have colors.

Speaker 4

Nope, I'm part of the crowd skipping from two point six to three. Oh there you God for that. No, I believe it's turned on by default.

Speaker 2

But one other thing I will note, at least with Ruby three, actually it's two point seven, was the inline documentation. So if you just double tab while you're on a particular method name, it'll give you the documentation in the context, kind of like a man page. Oh nah, and it does that through our docs. So I don't know if anybody else here has a GMRC that doesn't include documentation

when you install gems because it takes longer. I used to have that dash dash dash Yeah, so I have turned that back on now because it's so great to see, you know, tab tab How does this method work? I use that all the time now.

Speaker 1

Well, yeah, because you had to use the command line utility to get our docs before or open up some kind of wonky web interface and it just was never worth it, right, But if it's in line when I'm working, that makes a lot more sense. Yep, because because really, to be frank, the only good docs readers were all web browsers.

Speaker 4

And so whenever whenever my internet goes out, I have to be like oh, and then like go re remember how to get my docks working locally again, like for the three hours that it's.

Speaker 1

Top yep, or get it on the fifth try. Oh oh, these are the right parameters. Yep. That's super cool.

Speaker 2

Yeah, it's all as you know, if you use a higher level like documentation app right, which has some nice things as well, like if I use Dash as an example, but it has some drawbacks and they have to know what you're looking up, and so it's it's nice having it in the direct context that you're in without having to go, okay, let me go to this other app you know, look up this context, this method.

Speaker 4

Yeah, I stopped using Dash because I didn't like paying for it. I felt like my web browser version was better. It just that's this is kind of what I meant. But the web browser version is weak whenever my internet goes out, so right.

Speaker 2

I don't pay for the DASH, I just wait for it to load.

Speaker 4

So you mentioned the banner thing that that kind of like started you down this road where there any were there as as somebody who likes my consolet to look aesthetically pleasing, you know, were there any things that you were just like, oh, yeah, no, Now I do this all the time, customize my RB show and everything is you know, pink and green or something. I don't know.

Speaker 1

I have a light I shouldn't.

Speaker 4

Say that sure pleasing stuff and then immediately pick those two colors in contruction.

Speaker 2

But I have a thing with lightning. Bolts. My you know, starting prompt is a lightning bolt. It tells me I'm in i RB. That's kind of nice. My, I use that for the longest time. Use there's a oh mysosh theme that has a cloud and when you have changes in your Git repository or in whatever repository you're working with, it'll show a lightning bolt to tell you that there's changes made, so you know whether you're clean in a clean state or not. So it's just fun, that's cool.

It was kind of interesting making the custom prompt because I was kind of, you know, playing with it, seeing what you could do. And so I had actually picked up the quoting. So what when you're in different modes in IRB, So example, like in a string and you have a string open in line that basically has a signal to IRB to style it differently, and so I, you know, I wrapped it in the quote's icon, so that like an emoji quotes, which was kind of interesting

to use on a regular basis for a while. I definitely will be using some emojis in my prompt for a while now.

Speaker 1

Nice. I was trying to figure out to get an X wing on there. That's possible real emoji, probably not.

Speaker 4

I don't know. There's probably everything in the emoji space. What I'm saying, you.

Speaker 1

Might be able to find an emoji font that has it, you know, it's like a it's a smiley emoji, excepted I don't.

Speaker 2

Know, there's probably a power line font out there with it in there.

Speaker 1

Yeah, anyway, very cool. You mentioned, yeah that you kind of got into this because you you saw somebody else doing some stuff with it. What's the store as far as like you learning this stuff, right, Because I'm assuming there's a bit of a journey there, and you know it didn't just like you know, upload to your brain, right, So so what was the journey there? And how did this kind of get implemented over time at work and things like that.

Speaker 2

Sure, I had dealt with IRB customizations for a long time, so I was familiar at least with the notion of IRBRC and being able to kind of customize small things, but I didn't know the extent at which you can

do it. Like probably another topic of conversation or blog posts is the history itself IRB and even kind of save those histories in as files so you could in essence and that's kind of where I'm going to go next with some of our servers is to customize the IRB session per user so they all have their own history.

Especially when you deal with a shared server setting, you run into a lot of oh, you hit up a few times and you're scrolling through somebody else's history that's sharing the session with you, And so that that's an easy fix scoping to a particular final and so it started, you know, just small realizations over time of oh, hey, you can do this, you can do this, and then finding the actual need was we have we have these hack days at doc Simity where the whole team will

split up and work on anything in particular that could help be useful for the team. And one of the problems we had was this auditing in that our auditing would be had to be explicitly, explicitly set anytime any user logged into a higher B session or Rails console, and so you know, sometimes it would be forgotten, the auditing would gets you know, get lost, and we'd have

to go back and readdress those data concerns. And so somebody was like, hey, it would be nice if we can just automatically do this, and that basically is what started me down this rabbit hole to begin with. Is that possible one? And there were some prerequisites to that in that, you know, how do you know what user in the system is related to the user that logged into the server. We happen to have some you know, formalities in place that lined up those user it aims.

So it kind of working out really well and being easier than was expected. And then so as you go through and once you have a custom Rails console, it makes you think, oh, well, what else can we put in here? What are there you know, proximity specific customizations can we inject inside the Rails console, limitations, you know, how can we add restrictions things like that? And it becomes very easy once you have that place, that source of truth, to kind of make the customizations. And I

work in the terminal almost exclusively. That's kind of why I Jim right, Yeah, because Bim, But more so I have a very elaborate Tea Bucks setup as well that I've just grown comfortable with, and so I try and do as much as pot I don't like leaving the console at all. Even I've been looking at a couple of projects to do even code reviews from the terminal. They're not quite there yet, but that would be my

dream to just you know, never leave. You know, I used to use what was it there was a chat service for a while when campfire was around that allowed you to do that from the terminal as well, maybe as we chat, but that would that would be my ideal environment. So, you know, playing around with i RB and being able to do as much as possible there, you know, open up any files, you know, send things to the background when I don't need to use them kind of thing. It's just a very nice workflow.

Speaker 1

So gotcha.

Speaker 2

That's that's kind of my foray into the i RB space was you know, what is possible? What can you do with it? And how can you make things easier to develop?

Speaker 1

Right?

Speaker 3

Can I ask you about the Ripper?

Speaker 2

Sure?

Speaker 3

So this is from the Hidden Chems Ruby article the the Ripper. It says it's a lexical analyzer and you run a you run the ripping command or a head world. You get loads of stuff out. How did you how did you get into using that? And what what are you using that for? Because that to me looks incredibly technical and obscure.

Speaker 2

So mostly it's for analyzing memory usage. So with the instruction sequence compiler, you can then use it to see how Ruby is, you know, making those instructions on the low level and kind of it's it's a helpful way to debug how it's compiling those instructions. And sometimes you can when you're debugging a particular memory issue, you can elaborate on that using the lexical analyzer to see how it's constructing it on the back end.

Speaker 3

Got it. So if you maybe if you're cooling in some external library that's memories going missing, that kind of situation.

Speaker 2

Yeah, something like that. It's mostly useful for really cross compiling what do they call it transpiling. I haven't used it for that, but I know what is it opal or Ruby Opal. There was some kind of project where they're translating the Ruby code to JavaScript as an example. So that's primarily the value of ripper is it's ast kind of generalization. So I don't know if anyone's familiar with tree sitter, which is what GitHub uses as their

code hinting. So anytime you've you know, been it on GitHub in a code review and you've you know, hovered over a method name and it shows, hey, this is defined in this file. Uh, they actually use an AST called tree sitter that they've made with Rust. It's pretty wild stuff.

Speaker 1

It is pretty cool.

Speaker 4

It doesn't catch all the all the dynamically named stuff or the dynamic calls mostly, but yeah, no, unfortunately, I mean that's Ruby rails specific, mostly all those after commit things.

Speaker 3

You're right.

Speaker 4

One of the things that I noticed in here was the switch from read line to reline. So does that mean that we're dropping the red line dependency? Like I guess.

Speaker 1

I tried.

Speaker 4

I tried to look that up and I couldn't find an answer. Real fest, I don't happen to you know, if you.

Speaker 2

I don't know. Unfortunately, I haven't joined the Ruby forums themselves yet. I imagine that will come soon when I want to add a feature to i RB or something like that. But so I don't know what they have plans for it at this moment, from just the master branch of the repository or have they moved a main branch. I'm not sure, but they haven't removed it still there,

so they at least have it backwards compatible. But yeah, that I mean that the re line's really cool because mostly for the multi line support so if you paste it in i don't know, fifteen twenty lines of Ruby code, you can actually just scroll up and edit it right in place. You don't have to go and you know, line by line, edit and hit up again. It's really nice to work with.

Speaker 4

Does it increase my buffer for pasting? Now that you're talking about pasting in here, I can't answer that one. I haven't played with that. I've always had a problem with that when I'm like writing long scripts or something.

Speaker 1

Cool. So I'm kind of curious now that you die. It's so funny because talking through this sm sitting here going man, I really kind of just took this for granted that it just worked, right. But yeah, now that you're yeah, go ahead.

Speaker 2

I was going to say that there was a few years back where I was looking at somebody had tasted just the lib directory of Ruby's repo, and there's a ton of Ruby files in there, And at first you know, it's just like delegate class or something like that, some simple ones that I could recognize, and then you realize, well, there's a bunch of other gems in here that are I guess this is the core library, right, that's what's included, and That's kind of what got me to i ORB eventually,

is that you know, there are all these cool things included in Ruby, and I imagine the same with rails right where there's just way too many features for you to know all of them.

Speaker 3

Right.

Speaker 2

What if you just spend a day and poke around, you're like really surprising how much stuff is in there. And I'm kind of hoping to turn this into kind of a more longer form series on what's included in Ruby's you know, core library, because there is just so much, Like like you were saying, you know, you don't even know you take it for granted that all this stuff

is there. You just open up an IRB session and do what you're trying to do in the moment and don't realize kind of what's all available to you.

Speaker 1

Yeah. So I guess what I'm kind of aiming at next is you've done all this work to understand IRB, understand how it works, you know, dive into the feature set. What do you wish it had that it doesn't.

Speaker 2

That's a good question. I guess I wish it had more native integrations, like like, as an example, you know, being able to use vs code or something like that, and you know, hooking up i RB to the editor so you can evaluate. You know, various things live from within the editor, which I know are kind of external

to the Ruby source itself. But it would be nice to have kind of some more native things, even like a mechanism that would make it easier to make more extensions to IRB, like say, for example, this Jarred project, which I know is built on something that's kind of a competitor to i RB, but they're basically they have a ton of modules that make it easy to do you know, X y Z. It would be nice if there were support from the you know, Ruby Core team

or or something like that that could help expose what's available and make it easier to extend and say, hey, this is how you do it kind of thing.

Speaker 4

Right, It kind of sounds like IRB is giving you a lot of what you want already.

Speaker 2

I know it's hard to holes. Yeah, I mean they already add extra features that I wouldn't have thought about.

Speaker 1

So yeah, all right, Well, anything else you all want to dive into here before we do picks? All right, Well, let's let's go ahead and shout out about some cool stuff. John, do you want to start us off with picks. Yeah, I will. So.

Speaker 4

I I just recently replaced my grill. My grill of over a decade. It just I replaced the grades a few times. And why I've tried to keep that thing alive because I had it was one of those like double sided and one half was gas, one half was charcoal.

And I was very happy that I got it. And I got it for like two hundred bucks, and so, you know, I got it like a decade ago, and I'm like, oh sweet, I'm ready to spend two hundred dollars on a grill, and like, like two hundred dollars will buy you like a little dinky thing that sits on the ground, and you know, I have to crouch

down and use it. So I was like, oh, so I had to reevaluate a lot, and I went around and dug around, and event I was just pretty angry that everything that I wanted to buy was like six hundred bucks. But I eventually like found something that was pretty good, and I've been using it for like two months now, so I've been pretty pleased with it.

Speaker 1

I had to give up.

Speaker 4

Having one side charco on one side gas in order to get a good gas grill because apparently they just they just don't put those two together unless you're willing to spend you know, a small fortune on it. But yeah, so I found like this nice gas grill that gave me like six burners and like didn't completely make break the bank at three hundred and fifty bucks, so I was pretty pleased with it. I'll put a like link

to it or whatever. But it also wasn't a deal because like there was a different grill that I really wanted that was at like the four hundred dollars price point, only like my wife was like, well, you need to need to think over it for another night, and I was like, but I have been thinking about it for like a month now, and this anyway, whatever, the deal was gone by the next day, so this one is

stuck around for a while. So out about that price, pink, So that seems like this is probably its natural price monk. So yeah, anyway, got a sweet grill and it works pretty swimmingly for what it is. So and now I just have to work on convincing my wife to let me buy a separate charcoal burner so that I can do charcoal stuff when I have like more time or something. So right, so I like that, that's that's my pick

for this week or whatever been able. That's been very helpful because I my wife does not like Mexican food, and the number of things that I can cook that are not on a grill are pretty much all Mexican food because that's that's how I grew up eating, so that's what I know to make. So yeah, my wife very much appreciates that I can grill some stuff since we are dealing with baby things.

Speaker 1

Nice, All right, Luke, what are your picks?

Speaker 3

Well, I'm gonna pick my magic, haven't I? The mind mac Magic gem is definitely my pick week. What a marvelous gem it is, and.

Speaker 1

Not only version three point five or lower.

Speaker 3

You know, you know how we were talking about JavaScript features kind of coming into to really free, Well now we've got kind of MPM features coming into the gem ec system. GYM system. Really we're really really taking our lead from Java script at the moment. So I've linked to an issue on the GitHub where some developers are saying that because this license changes to GPL, then everyone has to release all their source code. This really isn't true.

This is this idea of a viral license was introduced by Microsoft in the early two thousands, and if you know, you can go with Peter and look it up. And it's kind of a smur used against the free source free software movement that that there is this kind of nasty license that if you include it in your code, then you suddenly have to release all your source CODs

and your business is over. There is a license called the age EPL which has some restrictions on software as the service systems, but there is no There is no strange magic license that you introduce that suddenly makes you do things. And people miss the point with free software a lot. They seem to kind of confuse it. The whole point of free software is that you have freedom, and if someone's making you release your source code when

you don't want to, that's not really freedom. So people need to calm down on the On the GPL side of things, the GPL is a great thing. It's built the computing infrastructure we have today. The MIT license is not so great, and I'm not such a big fan, but if you don't believe me, look into it for yourself. Sore Ago, my pick of the week, my magic. Thank you for keeping Ruby interesting.

Speaker 1

Yeah, and so I'm going to pile on there because I was going to pick similar and essentially there's an issue in the RAILS repo. I think it was introduced yesterday, the issue, and so yeah, my magic used a list of mind types that was GPR licensed in the GEM and so because of that, Yeah, the whole thread is essentially a discussion over this idea of viral licenses and you know how it does or doesn't ruin software, which

I found to be mostly not helpful. Ultimately, there's going to be you know, they're going to talk to somebody's going to talk to some lawyers. They're going to figure out what they're supposed to do, and then they're going to fix it so that if you're using RAILS you don't have to worry about it. But in the meantime, yeah, just be aware that this is a conversation that's going on. I'm going to see if I can find somebody who is an expert on this stuff so we can do

an episode on it. Right because I'm not an attorney, I don't know how all this stuff works. I don't know what the implications are. But in the meantime, yeah, it's something to watch for sure. So we'll put a link to the issue in the show notes and yeah,

let everybody kind of follow up on that. But they did actually close commentary on the issue because after the first probably twenty or thirty comments, Yeah, it just kind of evolved into people arguing over what it meant as far as this is good or this is not good.

And ultimately, I think what we need to just see is what are the implications for the RAILS community at large, and you know, how do we continue to be able to write softwaware the way we write software because a lot of these conversations about kind of the social structure of software and the legal structure of software are things that we don't really want to think about. We just want to think about writing code and enjoying in enjoying technology.

So anyway, yeah, we'll get somebody on who can tell us what we have to care about. So yeah, so that's one pick. I was looking back through my Amazon history for some ideas on other things. I could pick one thing that I've really been enjoying lately. I have a soda stream, which is a carbonator you can make your own soda. They also sell mixes and then I just order drink mixes in general off of Amazon, so they have like different fruit flavors and stuff like that.

I don't drink alcohol, so it's kind of funny because I get this stuff that people add to their alcoholic it's the just or the flavors, you know, and we just carbonate that. So anyway, but I'm really liking it. They have an energy drink flavor, and a cola flavor, and a root beer flavor, and a they they don't have a cream soda flavor, but you can find one on there that is. I get the sugar Field of

flavors because I'm diabetic, so I'm gonna pick that. I've really really been liking having that, and so that's something I'm picking. And then for the dev Heroes Accelerator. One thing that's really been working out nicely for me lately that I've been using to get people in and then get them the content they need. I've been using Teachable, and I'm really liking Teachable. It's a terrific platform for just putting the videos up and giving people what they

need there. And so I've been putting videos up on Hey, you know, during a coaching call it's a group coaching call. Don't always have time to dive into everything that everybody needs. But afterward I can do a video on it, right, and then everybody has it. And so I've got some videos going up there, which is awesome. Probably going to turn it into a course at some point. People can just buy one off, right, and then if you want the you know, the direct coaching teaching, you know, you

can go for it. But yeah, I'm really digging that. If you want to apply, you can go to dev influencers dot com slash apply and get that. I'm also starting a podcast for dev influencers, So if you're thinking, hey, I'm not sure how to grow my career from here, We're going to be talking about how to grow it by building an audience, making connections through something like a podcast,

in fact, specifically through a podcast. And I'm also going to be interviewing other people who have built audiences and influence in the dev space and talking to them about how they did it, and yeah, just giving you ideas about how that can be done, right, Because some people what happens is they they kind of become senior devs. They realize that, hey, the job I have now looks a whole lot like the job I'm going to have in a few years, not really what I want long

term for my career. You know, I want to keep learning, I want to keep growing, you know, I want to get paid more five years down the line kind of thing. And so how do I do that? They don't really want to go to the architecture out, they don't really want to go to the management route, and so where do we go? So you can go the influencer route, right, And it's a lot of fun because you get to meet people, you get to explore areas you don't get to explore other ways, and you still get to code.

And so that's that's kind of what we're doing there. So anyway, long pitch, but ultimately I'm doing teachable and I'm really enjoying Teachable. And then for the cart to sign people up. I've used all kinds of stuff, all kinds of membership software. I hate them all. I hate the shopping cart and Teachable by the way, it sucks. But I've been using Thrive Cart for all that stuff and I really like it. It is terrific. It has

an affiliate system that actually works, which is awesome. And so if you're going to be selling stuff online, I highly recommend thrive Card. So those are my picks, Valentino, what are your picks?

Speaker 2

Sure? The first one I definitely recommend any developer out there is called get reflow. It's a tool I actually build a long time ago now that helps automate your get workflow, so it creates pull requests automatically for you. It makes sure to close out all your branches when you've merged down to your main branch. It does a lot of things that just save a lot of time when you do over and over again. So I highly recommend check that out. Another pick I have is for

an app called bitbar. It's if you're using the mac os. It's a nice little kind of menu bar generator, so you can run scripts and show icons and various things on a periodic timer, which is kind of nice. I use it as an example to see how many doctor containers I have up and how much CPU it's consuming, because Doctor is painful at that and a let's see, I had one one that just escaped me. Oh yes, Twilio. I Twilio is incredible. I used it not too long

to and not not to shout out to Python. But I used it to automatically orchestrate a AWS server for my kids to play Minecraft with their neighbors. So all I had to do was send a some commands to a specific Twilio number and it would start firing off commands on AWS, which was really cool. So that was kind of impressive how seamlessly that worked. And their their documentation is really well, really well worded and mapped out nice.

Speaker 1

So I now I have to ask my kids love playing Minecraft and they want to be able to play with their cousins, but we do not let them play on public servers on the internet because I do not trust who's going to be on public servers on the internet. So how do I set up a private server that their cousins can get on or you know things like that.

Speaker 4

I just put the link in the show notes that we can add. Is that what you're talking about, Valencino?

Speaker 2

Yep, that's the one. So awesome. Yeah, it's it was a little painstaking to get set up and configured it. I kind of hoped at some point to find some time to automate this so other people could just spin up their own AWS server that you can whitelist IP addresses on the fly using Twilio app, so maybe I get to it otherwise you can, you know, go through the setup I went through to get it all configured on your own AWS account.

Speaker 1

Looks good to me.

Speaker 3

It was.

Speaker 2

It was really fun playing with land to server and things like that to kind of just spin up you know, EC two instance is on the fly, and my goal was to just drive the price down as much as possible per minute, which is where I got to a nice comfortable spot with spot instances. So hopefully I can get back to it to make it easier for other people to kind of do the same thing. But right now, it's just a series of Lamba scripts that just make it easier to spin up stuff.

Speaker 1

And how much does it cost you to actually run this?

Speaker 2

My monthly bill is maybe three to five dollars a month. Oh okay, I feel like, yeah, on the average it's around three, so, I mean they use it regularly, so it's definitely been the cheapest I've found, just not time wise.

Speaker 1

No, I like it because yeah, my I mean, especially with my kids, most of my brothers and sisters live pretty close to here. But even then, you know, they're connecting from their houses. But my my wife's family in particular, she has a brother in Oklahoma, a brother in Texas, a sister that lives an hour and a half away, right, and so yeah, it's just it's not ideal, but yeah, they'd still like to be able to connect and you know, go play in the same world. So yeah, it's beretten.

Speaker 2

Great. So what I what I ultimately did is made a way for just some environment variables. As you know, the allowed admins to white list ips, which basically just become the parents right right, So then any parent that wants to be able to get their kid to join or you know, to stop their kid from playing or anything like that, they could just text this number and say, hey, like you know, remove this white list at IP for now, and then it cuts them out of the server.

Speaker 1

Right, No, that makes sense.

Speaker 2

Yeah, so it's been really helpful, you know, just to help I mean it's hard because like you said, like, how do you trust any one of these services out side of Minecraft's you know, realms or whatever it is. And you know that that is great too, but then like any of their friends have to be in the realms also, and it becomes this thing of okay, well who's paying for what?

Speaker 1

Right? And then yeah, the other question I have then is it just it keeps your EACY two stacks. So you shut down the EC two instance, but it still saves all the data because it keeps an I have all that backed up to S three.

Speaker 2

Right is how that works?

Speaker 1

So then you know, so when they turn it back on, all their stuff still there. Yep, okay, because yeah, they like to build towers and castles and they'd be devastated if it disappeared.

Speaker 5

So, oh, I know this is the sound of Chuck's weekend disappearing. That's right, I have I have three things to do this weekend. Now I have four, but I'll tell you what.

Speaker 1

The three things I have to do this weekend make me the hero with my wife life, which pays off, right, and then the fourth one makes me to hear with my kids. And if I get it done this weekend, I get it done a week early for spring break. Boom.

Speaker 2

Well, I'll tell you what. My Minecraft service are not that hard to get configured and spin out, so at least there's that for you.

Speaker 1

Yeah, my kids keep asking me to add what they're the extensions. I can't remember mods to the server or to our set up at home right on the Xbox. And so that'd be nice too to be able to just Yeah.

Speaker 4

It's all about reducing that management time, right, Like sure,

getting it set up the first time is fine. The issue is like when you're going in there for the twentieth time because you know Minecraft is updated and your kids want this cool new mod and you're like trying to decide what dependencies are going to be an issue or hut, and you have to remember because the last time you logged in was six months ago, and now you have to like go a million things and your entire Saturday is gone before you finally finish with the darn thing.

Speaker 1

Yeah.

Speaker 2

Yeah, Luckily I haven't hit that wall yet. My kids aren't as demanding with the mods.

Speaker 1

Well I'll tell you too though, like giving my wife you know, well, I'll just take away Minecraft and all chance to do his text a number to do it. Yeah, it's pretty huge boom.

Speaker 4

About delegating the administration of it to someone else.

Speaker 1

Yes, it's the power. Yeah, all right, good deal. Well I've asked you enough questions about that. Thanks for coming, Valentino. This was awesome.

Speaker 2

Yeah, absolutely, I've had a blast. Thanks for having me on.

Speaker 1

All right, If people want to find you online, I'm assuming you're like on Twitter and get hub and stuff.

Speaker 2

Yeah, I'm on Twitter thch code name V. The code name V. Find me on GitHub at code name V. I have a blog where I post about my experiments with embedded systems than Ruby. That's that's at least been what I've been writing about currently. And that's a blog dot cod named dot com, so that's where you can find me.

Speaker 1

Awesome, and yeah, my kids lives just got better because of Twilio powered Minecraft. There you go.

Speaker 2

You're welcome, all right. Honestly, let me know how that goes, because I've been the only one that's used it so far.

Speaker 1

We'll do. Yeah, you're gonna get you're gonna get an email and it's gonna be like this was so great. All right, Thanks again and until next time, folks, Max out

Transcript source: Provided by creator in RSS feed: download file
For the best experience, listen in Metacast app for iOS or Android