Hello and welcome to this lecture him this lecture.
Ah be walking you through how to interact with Ruby using Ruby far.
We are going to be using a text editor for this link.
Text pelletized basically where you write your code just like you would use a Word document Microsoft
Word to write or text.
So I'll be using a text editor called sublime text.
You can use whatever text editor or you've got already on your computer and that should work the same
way.
I've got sublime text had it open so I'm going to enter some commands.
So I'm going to put this
747 into another puts.
This time I'm going to put a text and then say hello.
Next I'm going to enter a print command.
And when I do a print a number 247.
Notice that when you enter commands in a text editor you don't need to put any quotes around the puts.
Hall print also.
Do I given spaces here spaces don't really matter in terms of Ruby Ruby.
Is white space independent so it doesn't really care what spaces you put.
He ignores it.
It's not dependent on the way the code output is not dependent on the white spaces.
So now we've got a few commands here to get Ruby to read this file for us to be able to interact with
Ruby.
True this far we need to save the file with the file extension cord.
Dot R B we indicate Ruby once we saved this file with a dot RB extension discolouration.
Inside this text editor will also change to reflect the commands in here are Ruby commands.
So let's say that a file will have to file See if you can save it any way you want.
When going to save it to my documents you can also call it whatever name you like and when a call this
test then to test don't are be key team is the RB.
Make sure whether by name you give it as a dot.
Ah be extension.
If not a ruby will not be able to read the FAQ.
So click save.
Once you've done that you can see the chlorine has changed to reflect that.
I've got a file called Test don't.
Ah.
So now how do we interact.
How do we get Ruby to read this far.
We need to open up our command prompt.
I am going to be using my kit bass command.
So use whatever command tool you've got and going to minimize that till the first thing you need to
do is change directory to where you have saved the file.
Or you can copy the full directory path if you know that I am going to change derech free to a Web site
fast.
Much easier to do that.
I am going to do C and then the name of the directory.
I know it's in my documents folder so I've changed to a directory called my documents.
All right.
So you can do the same.
If you are on a Mac as well you need you can you see these to change territory so I'm now in the directory
where I see the ruby far so to call that far in order to interact with Ruby I typee ruby space the name
of the FAQ with this test.
Dot can't be.
And that should display the contents.
There you go.
So that's the first put.
7 4 7 not is with input.
It gives you a single chiras line return had space.
This is on the that portela would give.
You can see a little space underneath the hell you want and then you've got the print print doesn't
give you a carriage return.
So if I open up the code you can see the code here and just minimize that.
So that's the code here.
You can see the port is this one here.
Some for 7.
This is the other.
Put her there.
Well that's it.
This is the print asset.
So that's how you interact with Ruby use in a far.
Once you've kaeding your code inside be text say it or you say who were the daut are B file extension
and then you reference that VI command line utilities by calling the file name.
We should have a dot R be file extension so that's it for this lecture.
Interacting with Ruby VI he Ruby.
Far many thanks for watching.
Bye for now.