 My name is Rogelio Jason Moore. If you can't pronounce my first name, I go by Ro. I am a Solutions Barista over at Hashrocket. I have been a Linux sys admin, a software engineer, and tall for a longish time. So, follow me at the RubyMug. Email me. Check out my five blog posts. They're very, very, very, very relevant to what we're doing. And that's my GitHub. And that's it for me. So, how would I have your attention? Feast your eyes on this. Medium turkey chili. Medium crab bisque. I didn't get any bread. Just forget it, let it go. Excuse me, I think you forgot my bread. Bread, two dollars extra. Two dollars, but everyone in front of me got free bread. You want bread? Yes, please. Three dollars! No suit for you! So, no suit for you! You may be wondering what that clip had to do with this talk. Absolutely nothing. So, there we go. Thank you, thank you very much. Ta-da! However, I do have... I'm going to go ahead and tell you what our mission, what today's mission is. No suit of the final frontier. To explore a near perfect development of art. To seek out cases for suit of. To boldly go where no developer has gone before. Not really, but it sounded good. You may learn some other things along the way. First, let's just jump in. Pseudo does have its place, right? Mostly in multi-user environments. It allows for logging. So, let me just show you a couple of commands. So, this is Pseudo, my SQL status. I'm sure a lot of you are familiar with that. And that's SU, so you're just running this, you know, as a user logged in, and then you're running Pseudo, and then you just... As that user, you're just running the SU, and then running that command. The difference is, as you'll see, when you run Pseudo, it says, this was the user, you run it as root, and then that's the command over there. When you run it here, it just says that the user fry ran a command. We don't know what. So, I mean, it does have its place. It's not bad. So, it's nothing really wrong with Pseudo itself. And it's really used to install trustworthy tools. So, why no Pseudo? Well, part of the problem is, as, you know, most of us use either OS 10 or Ubuntu, you know, or something like that. Ubuntu, especially. And what happens is, they have a weak... Or no, they don't say set a default password for root, which forces us to use Pseudo on potentially weak passwords, right? And Pseudo can potentially wreak havoc in your box. It also installs... Well, let me just camp on this one for a second. Say there's a make file that rm-rf is your stuff and you Pseudo make install that and then you're very much in trouble. And I guess it's stuff that... If you're going to use Pseudo to install trustworthy tools, it's fine, but, you know, in our case, it doesn't really make sense. Again, Pseudo installs gems under your system Ruby, which we'll see. It doesn't really work with... If you're using RBM, which is a key part of this. It's also not ideal for homebrew. You know, OS 10. So, and I think about, hey, I don't know, 50%, 60%, 70%, 70% of people are on OS 10. So great. All right. So, here it is. Debian and Ubuntu folks have apt. Gentoo peeps have portage. It's pretty awesome. I love portage, by the way. Macaulay's 10 dudes? Nothing. Pure crap. It's what I think. Nothing until homebrew came along to save the day. It is truly the missing package manager for OS 10. And I'll give you a brief synopsis, and I'm not going to go into how to install it. I'm just going to, you know, gloss over it for the purposes of experience. Yes, there are instructions. And by the way, if you have a question just like Jim did, go ahead and interrupt me in the middle of my talk. I don't care. You know, so there is time for that now. We don't have to wait until the end. So there is instructions on how to set up exactly what you'll see the demo that I'll show you here. It's on my blog, blog.derimug.com. And there's instructions for both Ubuntu and Debian and for OS 10. So, homebrew. I install it under user local, which, you know, kind of the best way to do that is to change the ownership of user local to your developer username. And the reason is, this is my tool. This is how, this is my crap. This is what I use. So it doesn't matter. I mean, you don't have to, it doesn't have to be. First of all, user local, when you install OS 10, it's empty. So if you have an empty install, you can just, you know, change the ownership for that and install it there. And then you can install everything from postgres to, as we'll see here. So for Debian, you have curl, bison, the build essential stuff. For OS 10, you need Xcode and homebrew, which will give you vim or macvim. You can now brew, install, and macvim. Firefox and Chrome, you'll need that. MySQL, postgres, N or SQLite, or Wget, proctools, all these things you can install with homebrew. Stuff that you take for granted in Debian, right, and in Ubuntu that are just there. Nmap, you name it. Those things are available to you in formulas and homebrew. And it allows you to, if it's not there, it allows you to write Ruby code to install new formulas for whatever it is. And it's all compiled and it uses Xcode, so it doesn't have to read download that Mac ports did. So, all this is kind of coming to a head when I, because the biggest thing that I have encountered to install in my Ruby environment to make my life easier is my friend, RBM. And RBM stands for Ruby Version Manager. It's a combined tool. It installs multiple Ruby interpreters and versions of that interpreter. It manages sets of gems per Ruby version, performs operations over installed interpreters and gem sets. And this is the biggest part. Gem isolation on a per-project basis, right? So you have gem sets, and I'm going to show you all this. So I'm just going to get into the meat with all this stuff. You can have a per-project RVMRC and you can have also, once you start developing and I'll show you this too, a single command to run your specs against. So you can say I want to run my command, I want to run my test against 8186RE, 192, JRuby, whatever you want. And it also gives you the flexibility to say, oops, I messed up, I'm going to start over and with the help of gem sets and bundler, I think you're back up and running in five seconds. So there are any questions so far? Cool. I'm going to do the live coding. So you guys ready? All right, here we go. All right, so Hitch is my little gem command line tool that allows me to pair with people. I use option parse if you're here for the command line tool stuff. I use option parse for that stuff. So we're going to go ahead and run rake, everything passes and rvm has this thing called rvm info and you'll notice under gem home here that I'm running that it's in the gem set called Hitch and how I got there is by saying there's a file here, sorry, vi.rvm.rc and this file says, it says this flag so if you say rvm use, rvm gem set use Hitch, if it doesn't exist it'll create it for you but now you're on that gem set, okay? Now I'm going to run that command I was telling you about, not that one, this one. So if you see, it's running with 186, re187 and then 192 and they all pass. Great, that's awesome. But now let's say I want to add, I got an issue that somebody wanted to, so let me show you what it does right now. So I say Hitch, the ruby mug, that's my github name and T-Pope, which is T-Pope's name, let's say he was here but he's not and then we're hitched. Now the commit messages are going to show my full name and his name, dev plus the ruby mug at T-Pope and Hedgehog. I don't know if most of you may not be familiar with this, if you're pair programming, this is a great way to have author attribution for a pair and not just one person. I'll just do a local commit so you see what I'm talking about. You'll see that the author shows up there and so here I'm going to say, change spec cops, whatever. Doesn't matter. And now when I say get log dash dash pretty equals full, you'll see that the committer is still me because that's my local computer but the author is T-Pope and I, which is false so, well whatever, for the purpose of this exercise, I just wanted to show you what it does. I got an issue, somebody wanted to add, well what if we're doing a trio? I was like, that's fine. If you do a trio, we can say hitch, you know, and then I can say, Jim, what's your big tiger? And it doesn't know who big tiger is so I'm going to say, do I want to add it to hitch pairs? I say yes, Jim, Ramsey. And then cool, now you have Jim, Ramsey and Rogelio, Jason Moore and T-Pope. And what this dude wanted to do is he wanted to say Jim, Ramsey, comma, Rogelio, Jason Moore, comma and T-Pope. And I was like, that's fine. So I'm not going to add the whole feature today but I want to add like the first step of that feature that's on hitch just to make sure we're cool. And now, wait, let me run that again. What this does, all this is doing is it's exporting these two things that get users before you commit. And unhitch just unsets those variables. But it also, as you saw, it keeps track of who you paired in the past. So anyway, let me unhitch very quick and then run that again, of course it's empty. And now let's open up this little guy or this little guy. And you can see down here. The first thing that I think we want to do is let's open the, this is the spec for the main hitch library. So I'm going to add a, how's that? That's good? Cool. So we're going to call this one number of pairs. This method is going to, it's a very simple method. Right? In this method, it returns the number of pairs. Right? So we're going to say hitch.currentPair this one. All right? Cool. That's my setup. And then, so when I call it, number of pairs should equal to, very simple, right? Bear with me here, I know this is boring. So now, let's run the test. It's going to say there's no method. Blah, blah, blah. Cool. Let's add a method here. We're going to call it number of pairs. Right? And it's going to say currentPair.Count. Because that sounds cool. And that is going to make it pass. Right? Very simple. Cool. I'm ready to push this. So now, I'm going to say wow, man. I want to make sure this works on 192, 186. And of course, there's no reason why it shouldn't. So you run it. Oh, crap. It didn't work for 186. It worked for RE and it worked for 192. And the reason why it didn't work for 186 is a simple reason. And that's because a ray didn't have count in 186. It only had size. Of course, to make my code work for everything, for every version going back to 186, I simply change that to size, come back here and run my stuff. And everything passes. And that, my friends, is the power of gem sets and being able to say to isolate all your stuff and run your library and all your tests against different versions of Ruby. Cool. Any questions? Yes. I'm about to show you how I got to this point right now. So if anybody else doesn't have any more questions, I'm going to jump right into that. So how did I get here? If we say Ruby... I mean, is this font too small for this? All right. So if I say Ruby-V, it says I'm right now in RE. So if I wanted to say I want to go to... And again, in RVM... So I'm going to say gem list. And it shows me the stuff that's installed. I'm going to say RVM gem set empty. Hitch. It's going to prompt me, are you sure? Blah, blah, blah, yes. Cool. Gem list. It should only be one or two gems installed. And these four guys are installed in the global gem set. So every Ruby version has a global gem set and you can have n number of gem sets within that. But there's always a global one that's shared among all of them. All right. So now, since I have bundler installed, I have to say, well, since I have bundler, I can just... The only thing I would have... The only gem I would have to install is install bundler. Pretty. And hopefully the internet will be nice to me. Thank you. And then I just do bundle install. And again, do a gem list. And this bundle is actually part of this one. And I say bundle install. Oh, to else. How about that? And the thing about the newest bundler, you don't need to do re-lock. It automatically re-locks your gem file. Oh. It's deleting it. So ignore that. And right now it's going out and looking at my gem file. And I mean, are most of you guys familiar with bundler? Yes? Two, three, four of you? Five? Most of you? Great. So, how about the Nyankees? Pretty cool. Doing pretty good this year. Come on. Rangers. That's right. I mean, thanks because I forget this. That's right. So there you go. So now I say gem list. And all my stuff is there. And I say RVM info. Oh, you know what? Yeah. RVM info. And yeah, I was, the bundle path is hitch. And the gem home is hitch. So all that stuff got installed on my hitch gem set. And I pretty much had to do the same thing for 186. And then you can do this little trick to switch over to that gem set. So now I say RVM info. And now it's going to say 186. And then if you see this, it kind of wrapped around, but it's hitch. So now I can empty this one. And I basically did this for all three versions. So I did 186, I gem install bundler, then pre, and then bundle install on that gem set, and all three of them so that I was able to then do the one disk command. So that I could run that without any hitch. No pun intended. So there you go. Am I? Is it what? Sure. That is the command right there. You see it? Yeah. So if I had a little pointer, I could show you. But I have a pointer here. It's called a mouse. Here you go. So that's the first version separated by comma. So 186 at hitch, RE at hitch. And you can see which ones are installed on your RVM by doing that number. One per Ruby version. Yeah. So every version, as you saw, so let me just create a new one. Actually, you can just say use because I have a flag. We're going to call it LSRC. So now we're using this gem set. And so if I say gem list, it's empty, completely empty. So if I say gem install bundler dash dash pre, and then bundle install, that is going to do exactly what I did earlier. But for this particular version of Ruby, which is 186. Yeah. Yeah. I think because when you create the gem set and you create it and you use it, some RVM, by the way, RVM, if you're using RVM, remember this command, RVM update dash dash head, and run that command every day if you can. Because Wayne updates this stuff. I mean, there's a bug and he fixes it quickly, super, super. He's on target with that stuff. And Yehuda found a crazy bug with the seashell and this stuff, and then he fixed it pretty much almost immediately. So this is taking a while, I guess, because all you guys are downloading stuff from Torrents. What's up? Because you're right. That's right. That's great. What's that? No, it's actually an environment issue. If I were to open right now as we're talking this, and then I do my... HDD is basically the dot matrix thing. Once you, if you look at my blog post, you'll see what I mean. See, it's using Hitch. So actually, let me do this. Let me change this to LSRC. Save that. CD and then CD dash. So now we're using LSRC, but you know why it's already installing Lyre? There it is. That's the global. It's still installing the stuff in the other one. But it was just a matter of, because the RBM stuff had not been resourced. The environment was kind of still in like an empty limbo. But again, nothing a new terminal can't fix. I see a lot of puzzle looks questions. Yeah, yeah. At least for project, right? And if I have several versions. See, normally if you're doing rail stuff, you're not going to have, you're not going to be coding against different versions of Ruby, unless you have like your deployment, your production is 187, RE or whatever, right? And you want to see, you want to make sure that your tests are all running against 192, because that's the ultimate goal for now, 19. That's where you want to go because it's faster. So maybe then you'll have to, you'll be running your tests against the RE gem set and the 192 gem set. In this particular case, it's a gem, so I want to make sure that it works with 186, 187, 192, because, you know, you want to make sure that it just works, especially if you're using RBM. And Hitch is something that gets run pretty much every time I open a new window. So if I say, then I open a new window, that needs to be ready to go in whatever version I'm running it in. So that's something to keep in mind if you're going to install Hitch, that you install it in the global gem set of every Ruby version that you're going to be using, especially your default Ruby version. So, am I early? I'm pretty sure it is. Ta-da! It's Mondo here. He's not, huh? That guy. So there you go. This gem set, sorry. This is the LSRC gem set. And I just populated it just like that. So, yes. Yeah, that's exactly right. As a matter of fact, the gem file for this guy, see, actually it got fixed. Ruby debug got fixed for 192. Just like yesterday. Yeah, today maybe. Maybe yesterday, late night. So I had a little, unless here, unless it's 187. So don't install the Ruby debug because it wasn't working yet. So it was messing everything up. Questions? Comments? That's it. Oh, I did want to show you wherever the mouse is. If you go to blog. We have a hitch dealio here, but I have the Snow Leopard edition and the Debian edition of what I just talked about on my blog, step by step. And ideally what I'm going to do is, now I'm going to tell you, so I'm going to have to do it now, is a, okay, Atmos. I don't know if most of you guys know Donahoe. Corey Donahoe used to work at NGR Networks at GitHub. He created a gem called Cider, and he basically took all these steps and some steps that he already had and put them into Chef recipes and hosted them somewhere. And then you pretty much are now able to run Cider and install, you know, what he had. What I wanted to do is take that a step further and say, you go in and you say, I want to uninstall Macboards. That's a Chef recipe. I want to do this, this, this, this. You select what recipes you want to use and it follows pretty much this and then it does that and it installs it the first time. And if you run it again, it updates everything else, right? So it'll update all your formulas, formulae, formulas, whatever. And keep your stuff up to date. Even for OS 10, there is a software update command line tool that you can run. So you don't have to even worry about messing with the stuff when it runs here. You can have that Chef recipe take care of that and run all your OS 10 updates from it. So, for real now. Thanks for listening. That's all I got.