1
00:00:00,540 --> 00:00:02,810
Hello and welcome to this lecture.

2
00:00:02,880 --> 00:00:11,660
In this lecture hall be walking you through how to interact with Ruby using single command.

3
00:00:12,180 --> 00:00:19,140
We are going to be using the command line utility if you are using a Mac.

4
00:00:19,170 --> 00:00:20,640
This will be your terminal.

5
00:00:20,640 --> 00:00:25,530
So if you could open up your terminology on the windows This would be your common prompt.

6
00:00:25,530 --> 00:00:28,050
So I am using a Windows based computer.

7
00:00:28,050 --> 00:00:33,120
So click on start all programs inside your ruby for that.

8
00:00:33,150 --> 00:00:42,120
There should be command line utility that is start command prompt with Ruby so you can use this.

9
00:00:42,450 --> 00:00:50,790
Alternatively if you've got kit installed it also comes with it command line utilities call it bass

10
00:00:51,660 --> 00:00:54,500
guitar bass is same thing.

11
00:00:54,500 --> 00:01:00,970
Does the same stuff as the command line does one window but is geared towards Linux.

12
00:01:01,080 --> 00:01:07,050
So have a lot of Unix command so you can do books for the purpose of this lecture.

13
00:01:07,050 --> 00:01:09,930
I'm going to be using the guitar bass option.

14
00:01:09,930 --> 00:01:17,610
I prefer that one hear it's more friendly to me so I'm going to be using this for this mixture to let

15
00:01:17,610 --> 00:01:23,200
ruby know we are going to use a single common version of Ruby.

16
00:01:23,280 --> 00:01:28,520
We need to type in common dash before we start.

17
00:01:28,530 --> 00:01:32,190
He shean the command So let me show you what I meant.

18
00:01:32,190 --> 00:01:44,490
3 typing Ruby space Das E is it d'asti that lets Ruby know you're using a single command.

19
00:01:44,850 --> 00:01:47,000
The first command going to use is called PUDs.

20
00:01:47,010 --> 00:01:49,380
I'll explain what put this in a minute.

21
00:01:49,510 --> 00:01:56,780
You quote single quote and then the word puts space followed by what she want to be.

22
00:01:56,820 --> 00:02:06,840
Put it some want to be and want to display this number or 7 4 7 then single quotes and then you hit

23
00:02:06,900 --> 00:02:16,670
return and it turns the number would basically is use to output some pain on a screen.

24
00:02:16,680 --> 00:02:22,240
Is it Rubys way of outputting your comments on the screen.

25
00:02:22,590 --> 00:02:25,970
And there is another command that does the same thing.

26
00:02:25,980 --> 00:02:27,820
Is called the print.

27
00:02:27,820 --> 00:02:28,820
What they see.

28
00:02:28,830 --> 00:02:36,750
Big difference between the print and the put are do the same command use in a print and then I'll explain

29
00:02:36,750 --> 00:02:37,710
the difference.

30
00:02:37,970 --> 00:02:42,490
So typing Ruby.

31
00:02:43,290 --> 00:02:57,300
Space that he followed by thingo quote and then print followed by 7 4 7 single quote and press enter.

32
00:02:57,450 --> 00:03:01,180
As you can see we've got the same output.

33
00:03:01,380 --> 00:03:04,640
So print put the basically do the same thing.

34
00:03:04,650 --> 00:03:11,220
They used to output on the screen but there is a key difference when you use inputs.

35
00:03:11,310 --> 00:03:17,970
It leaves a line carries carriage return not as a space have trades on the output.

36
00:03:18,300 --> 00:03:23,630
The print doesn't leave airline carriage return for look at the output or the print.

37
00:03:23,630 --> 00:03:26,090
There's no line no space underneath.

38
00:03:26,100 --> 00:03:27,790
Doesn't leave a line carry.

39
00:03:28,050 --> 00:03:29,790
Whereas the PUD does.

40
00:03:29,790 --> 00:03:33,000
So that's the key difference between use into two.

41
00:03:33,090 --> 00:03:38,180
So let me do another example using this string or a text.

42
00:03:38,220 --> 00:03:39,420
So do a ruby

43
00:03:41,670 --> 00:03:59,250
space that he put the PUDs followed by space because I am using a string only to two double quotes.

44
00:04:00,450 --> 00:04:02,280
Hello.

45
00:04:03,100 --> 00:04:12,500
Well the double quote space this single quote So this single quote might is the single quote.

46
00:04:12,590 --> 00:04:19,560
What were you using quotes the cosmos most Matt so whereby you use in a thingo is firewalls used in

47
00:04:19,570 --> 00:04:20,610
the single cause here.

48
00:04:20,700 --> 00:04:26,850
Probably will have used a double here so where you make think what is best to keep them together.

49
00:04:26,850 --> 00:04:33,290
I've used double quotes here and I have used single quotes for the PUDs so I press enter.

50
00:04:33,440 --> 00:04:35,000
As you can see here is give me.

51
00:04:35,040 --> 00:04:36,460
Hello world.

52
00:04:36,660 --> 00:04:38,180
So if I do the same.

53
00:04:38,220 --> 00:04:38,870
The print.

54
00:04:38,910 --> 00:04:45,680
I will not expect a key lying carriage return one give me the space after giving me the output.

55
00:04:45,750 --> 00:04:48,270
So let's go to an example is in the prints.

56
00:04:48,270 --> 00:04:59,670
How do Ruby space dags space thingo quote prints are way of a star.

57
00:04:59,730 --> 00:05:00,590
With a single quote.

58
00:05:00,590 --> 00:05:06,840
If he is in this train his best to use a double quote for strength so they don't get confuse.

59
00:05:07,140 --> 00:05:10,650
So too low.

60
00:05:12,140 --> 00:05:13,370
Well.

61
00:05:17,610 --> 00:05:25,930
The double quote space the single quote press to so you can see I've got the same result.

62
00:05:26,030 --> 00:05:29,000
The differences with the print we use in the print.

63
00:05:29,010 --> 00:05:37,230
It doesn't give you a single carriage return whereas it puts gives you a single carriage return so it

64
00:05:37,230 --> 00:05:42,330
has basically the key difference between the puts you in this picture when you've learned how to use

65
00:05:43,530 --> 00:05:46,910
single commands to interact with it.

66
00:05:46,920 --> 00:05:49,390
Ruby is indeed Das.

67
00:05:49,610 --> 00:05:54,260
And also we learnt what puts or puts that on.

68
00:05:54,300 --> 00:06:01,420
So what print does there used to output the ruby commands on the screen.

69
00:06:01,710 --> 00:06:02,910
Thanks for watching.

70
00:06:02,910 --> 00:06:03,880
Bye for now.
