Skip to content

Commit 089f663

Browse files
committed
Simplify instructions for running Ruby scripts
I helped a student with this exercise last week at Codebar. They were using Windows, which means the sections about file permissions did not apply and caused some confusion. Instead of providing Windows-specific instructions I've opted to instruct the student to use the `ruby` command directly. This means the student doesn't have to download the empty file with shebang line anymore.
1 parent cdb9730 commit 089f663

2 files changed

Lines changed: 5 additions & 18 deletions

File tree

ruby/lesson2/tutorial.md

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,19 +59,12 @@ Random.rand(5..10)
5959

6060
In this exercise we'll create a small game to help us practise maths.
6161

62-
[Download the files](https://gist.github.com/despo/d790a4fd1844da7d85ce/download) to get started. If you are having any trouble you can get the files directly [from GitHub](https://gist.github.com/despo/d790a4fd1844da7d85ce).
62+
First, create an empty file called `numbers.rb`.
6363

64-
65-
To execute the file you must first change its permissions from the command line (to make it executable).
66-
67-
```bash
68-
chmod a+x numbers.rb
69-
```
70-
71-
and then run it
64+
To execute the file, run the following:
7265

7366
```bash
74-
./numbers.rb
67+
ruby numbers.rb
7568
```
7669

7770
In this exercise we want to generate two random numbers x and y using `Random.rand()`. We will output the numbers to the console and read in the answer.

ruby/lesson3/tutorial.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,9 @@ end
5353

5454
Using what we have learned in the last couple of ruby lessons we will create a contact list where we can store people's names and date of birth.
5555

56-
Create a new ruby script file.
56+
Create a new ruby script file named `contacts.rb`.
5757

58-
> Remember to change the permissions to make the file executable using `chmod a+x contacts`
59-
60-
First, make sure you tell the script to run in a ruby environment so you can execute it with `./contacts`
61-
62-
```ruby
63-
#!/usr/bin/env ruby
64-
```
58+
You can execute it using `ruby contacts.rb`.
6559

6660
Unlike last time, we don't want this program to exit unless we tell it to. We can do that by setting a variable to true, and only changing it to false if the user tells the program to exit.
6761

0 commit comments

Comments
 (0)