O'Reilly logo

Test-Driven Infrastructure with Chef, 2nd Edition by Stephen Nelson-Smith

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 3. An Introduction to Ruby

Before we go any further, I’m going to spend a little time giving you a quick overview of the basics of the Ruby programming language. If you’re an expert, or even a novice Ruby developer, do feel free to skip this section. However, if you’ve never used Ruby, or rarely programmed at all, this should be a helpful introduction. The objective of this section is to make you feel comfortable looking at infrastructure code. The framework we’re focussing our attention on in this book - Chef - is both written in Ruby, and, fundamentally is Ruby. Don’t let that scare you - you really only need to know a few things to get started. I’ll also point you to some good resources to take your learning further. Later in the book, we’ll be doing more Ruby, but I will explain pretty much anything that isn’t explicitly covered in this section. Also - remember - we were all once in the beginners’ seat. One of the great things about the Chef community is the extent to which it’s supporting and helpful. If you get stuck, hop onto IRC and ask for help.

What is Ruby?

Let’s start right at the very beginning. What is Ruby? To quote from the very first Ruby book I ever read, the delightfully eccentric Why The Lucky Stiff’s (poignant) Guide to Ruby:

My conscience won’t let me call Ruby a computer language. That would imply that the language works primarily on the computer’s terms. That the language is designed to accommodate the computer, first and foremost. That therefore, we, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required