Ok here it comes! This content will also be added onto a dedicated page as I write it….
Requirements to follow this tutorial:
1.PC with Windows XP
2.Internet connections
3.A little bit of time.
Downloading and installing ruby
Go to this link:http://rubyforge.org/frs/?group_id=167
Download which ever the version of ruby that you feel like using (I used ruby184-16p1.exe )
Once the file has downloaded double click the executable to set-up the ruby language on your pc.
Select c:\ruby as your installation directory. Make sure all of the installable packages are selected.
Let it rip!
Open the ruby shell (irb)
Ruby has a shell environment in which you can try out some basic commands. This environment is called the irb.
To open the shell navigate to the following directory:
c:\ruby\bin
and then double click on the irb executable.
A ruby shell will then open.
Lets play with some ruby commands
type the following commands and press enter:
Findout the length of a string:
“my name is mudâ€.length
Reverse the order of numbers in an:
“1 2 3 4 5â€.reverse
Add two numbers:
1 + 1
Assign a variable and its contents:
myname = “jason adcockâ€
Display the variable:
puts myname
Assign the reverse of the variable myname to the variable: jumble name
jumblename = myname.reverse
Capitalize the word brisbase:
“brisbaneâ€.capitalize
Assign an array of values:
myarray = [ 1, ‘cow’, ‘dog’, ‘apple’, 22, 33]
Display the first element in the array:
myarray [1]
Display the entire array:
myarray
What is the length of the array”
myarray.length
Print the array 5 times”
5.times {puts myarray}