Hello and welcome to this lecture.
In this lecture hall be walking you through how to interact with Ruby using single command.
We are going to be using the command line utility if you are using a Mac.
This will be your terminal.
So if you could open up your terminology on the windows This would be your common prompt.
So I am using a Windows based computer.
So click on start all programs inside your ruby for that.
There should be command line utility that is start command prompt with Ruby so you can use this.
Alternatively if you've got kit installed it also comes with it command line utilities call it bass
guitar bass is same thing.
Does the same stuff as the command line does one window but is geared towards Linux.
So have a lot of Unix command so you can do books for the purpose of this lecture.
I'm going to be using the guitar bass option.
I prefer that one hear it's more friendly to me so I'm going to be using this for this mixture to let
ruby know we are going to use a single common version of Ruby.
We need to type in common dash before we start.
He shean the command So let me show you what I meant.
3 typing Ruby space Das E is it d'asti that lets Ruby know you're using a single command.
The first command going to use is called PUDs.
I'll explain what put this in a minute.
You quote single quote and then the word puts space followed by what she want to be.
Put it some want to be and want to display this number or 7 4 7 then single quotes and then you hit
return and it turns the number would basically is use to output some pain on a screen.
Is it Rubys way of outputting your comments on the screen.
And there is another command that does the same thing.
Is called the print.
What they see.
Big difference between the print and the put are do the same command use in a print and then I'll explain
the difference.
So typing Ruby.
Space that he followed by thingo quote and then print followed by 7 4 7 single quote and press enter.
As you can see we've got the same output.
So print put the basically do the same thing.
They used to output on the screen but there is a key difference when you use inputs.
It leaves a line carries carriage return not as a space have trades on the output.
The print doesn't leave airline carriage return for look at the output or the print.
There's no line no space underneath.
Doesn't leave a line carry.
Whereas the PUD does.
So that's the key difference between use into two.
So let me do another example using this string or a text.
So do a ruby
space that he put the PUDs followed by space because I am using a string only to two double quotes.
Hello.
Well the double quote space this single quote So this single quote might is the single quote.
What were you using quotes the cosmos most Matt so whereby you use in a thingo is firewalls used in
the single cause here.
Probably will have used a double here so where you make think what is best to keep them together.
I've used double quotes here and I have used single quotes for the PUDs so I press enter.
As you can see here is give me.
Hello world.
So if I do the same.
The print.
I will not expect a key lying carriage return one give me the space after giving me the output.
So let's go to an example is in the prints.
How do Ruby space dags space thingo quote prints are way of a star.
With a single quote.
If he is in this train his best to use a double quote for strength so they don't get confuse.
So too low.
Well.
The double quote space the single quote press to so you can see I've got the same result.
The differences with the print we use in the print.
It doesn't give you a single carriage return whereas it puts gives you a single carriage return so it
has basically the key difference between the puts you in this picture when you've learned how to use
single commands to interact with it.
Ruby is indeed Das.
And also we learnt what puts or puts that on.
So what print does there used to output the ruby commands on the screen.
Thanks for watching.
Bye for now.