Introduction To Ruby Programming Language On Linux

Course Instructor
course instructor image
David Smith
David loves computers, especially alternative operating systems, coding, and crazy desktop managers. David has been an avid Linux user since 1999, when he installed Slackware for the first time. Since then, he has taught himself the ins and outs of Linux and web programming.

Getting ready to code.

Introduction

Course Overview

00:03:13

What's a Programming Language?

00:06:59

Installing Ruby

00:08:48

The Ruby Environment

00:04:59

Exercise: Ruby Environment Setup

00:30:00

Learning Basic Ruby Syntax

Ruby Basics

Hello World!

00:03:10

Variables

00:05:32

Types of Variables

00:09:22

Basic Math

00:03:49

Conditionals

00:06:24

Conditionals Continued

00:07:33

Iterators

00:05:49

Arrays and Hashes

00:06:28

Strings

00:04:19

While Loop

00:06:40

For Loop

00:02:55

Loop Control

00:04:39

Methods

00:08:12

Methods Continued

00:05:20

Using Classes

00:05:53

Creating Classes

00:07:10

Creating Classes Continued

00:07:52

Variable Scope Revisited

00:03:46

Class Methods and Singletons

00:07:56

Exercise: Getting Acquainted with Ruby (Hello World - Conditionals)

00:30:00

Exercise: Practice with Nested Hashes and Iterators

00:30:00

Exercise: Writing Methods

00:30:00

Exercise: Writing a program that utilizes a class.

00:30:00

Start Building a Log Parsing Program

Intermediate Ruby

Log Parsing Program

00:08:55

Strings and Escapes

00:08:49

User Input

00:08:33

Exception Handling

00:05:30

Filling in the MVC stubs

00:16:16

File Objects

00:08:16

Reading a Log File

00:09:11

Regular Expressions

00:11:25

Building the LogEntry Class

00:08:32

Time

00:06:19

Symbols, Strings, Comments

00:04:44

Modules and Mixins

00:04:31

Advanced Math

00:02:02

Sorting Part 1

00:14:16

Sorting Part 2

00:15:35

Exceptions Revisited

00:06:36

LogEntry Display

00:03:56

Method Arguments Addendum

00:04:23

Dive into concurrent processing models.

Advanced Ruby

Threads

00:13:42

Thread Queue

00:03:59

Progress Bar

00:09:41

Mutex

00:04:38

Fibers

00:07:39

Sub Processes, etc

00:10:14

Details

This course will teach the basics of the Ruby programming language. We will cover basics of installing Ruby via the package manager of CentOS and Ubuntu, as well as installing Ruby with RVM, the Ruby Version Manager. We will learn the basic syntax of Ruby, and cover how to code our own methods, classes, modules and much more. Through the Intermediate and Advanced sections of the course we will build an Apache log parsing program. We will build upon it throughout the later lessons, until we end up with a nice working log parsing program.

Study Guides

Course Overview

The basics of what this course is going to cover

What's a Programming Language

Brief overview of programming languages and the kind of language Ruby is.

Installing Ruby

How to install ruby. Note the rvm installation method has changed slightly since this guide was written. Check the rvm website's installation instructions.

The Ruby Environment

Learn a little about the various Ruby command line tools.

Hello World!

Write your first ruby program!

Variables

Learn how to create a variable.

Types of Variables.

Learn about the types of variables in Ruby.

Basic Math

Learn how to do basic arithmetic in Ruby.

Conditionals

Learn how to make your program do more than one thing.

Conditionals Continued

Conditionals can do even more than we covered in the last lesson. Let's learn a little more.

Iterators

These programming structures allow you do the same thing several times in a row, in order to operate on each element in an array or hash.

Arrays and Hashes

A deeper look at what we can do with arrays and hashes in Ruby.

Strings

We already know how to define a string, but Ruby offers so much more. Here we will look at ways to manipulate string data.

While Loop

Iterators help our when we have a data set already. But sometimes we don't have one, and we still need to run the same bit of code more than once. The while loop is one way of doing that.

For Loop

The For loop is another way to repeat code multiple times.

Loop Control

Sometimes you need to interrupt the loop in various ways. These special keywords will help you do this.

Methods

Here we will learn how to write our own methods.

Methods Continued

Let look at more complicated methods, and some of other things methods can do.

Using Classes

We're looking at classes, what they are and how we use them in Ruby

Creating Classes

Now that we know how to use classes, we will learn how to write them.

Creating Classes Continued

Here we will go into more depth about writing our own classes.

Variable Scope Revisited

We briefly mentioned variable scope earlier, but now we need to look at again, since we know more about classes and how to write them.

Class Methods and Singletons

Classes can have another kind of method, the class method. Here we will discuss how to use these, and a related topic, the singleton.

Log Parsing Program

Throughout the intermediate section of the course, we will be building a log parsing program. In this lesson we will talk about code organizational strategies in an MVC framework, and begin to write our program.

Strings and Escapes

Here we will look at special characters that can occur in strings, and how certain characters can change how our terminal window prints out data.

User Input

Some times the 'gets' method doesn't meet our needs, but we still need to collect user input. Here we will look at lower level means of getting input from the user.

Exception Handling

Ruby has a mechanism for what to do when the program or user does something unexpected. Here we will learn how to use this mechanism.

Filling in the MVC stubs

Here we will add code into our program stubs.

File Objects

We are going to need to read a file in order to parse the apache logs. Here we will look at Ruby's system for reading file data.

Reading a Log File

Here we will apply what we have learned in order to read a log file.

Regular Expressions

Regular expressions are a fancy way of matching patterns in string data. Here we will learn the basics.

Building the LogEntry Class

Since we now know how to break down a line of a log file, lets fir all this information into separate variables inside the LogEntry class.

Time

Ruby has all sorts of way to handle time data. In this lesson we will learn how to work with time data in Ruby.

Symbols, Strings, and Comments

In this lesson we will learn about one of Ruby's more interesting features, the symbol. We will also learn how to make comments in our code.

Modules and Mixins

Ruby has a way to segment of sets of classes, and add functionality to other classes. In this lesson we will learn how to use these.

Advanced Math (Math Module)

Sometimes the basic arithmetic is not enough. Here we will learn how to do some more advanced math in Ruby.

Sorting Part 1

In this lesson we will figure out how to sort the data in the log file.

Sorting Part 2

In this lesson we will look at how to filter the data. We will also cover how to call a method using a symbol.

Exceptions Revisited

In this lesson we will go into more depth about exceptions.

LogEntry Display (Single Entry View)

Here we will write some code to display a single log entry.

Method Arguments Addendum

We've already looked at the basics of how to supply arguments to methods. In this lesson we will look at some other ways to do this.

Threads

In this lesson we will look at basic concurrent processing. We will learn how to create threads and use them.

Thread Queues

Sometimes we need to pass data between different threads. A thread queue can help us do that.

Progress Bar

In this lesson we will create a progress bar for our log parsing program.

Mutex

In this lesson we will look at a mutex and how to use it to keep data in sync.

Fibers

In this lesson we will discuss a minimal approach to concurrent processing, the Fiber.

Sub Processes, etc

In this lesson we will look at way to execute external programs, and interact with them.

Instructor Deck

Community

Looking For Team Training?

Learn More