Ruby is an open-source, interpreted, dynamic, high-level language. It markets itself as natural simple, and easy to read.
Released in 1995, Ruby was developed by japansese hacker Yukihiro “Matz” Matsumoto. Matsumoto's goal was to create an easy scripting language with Object Oriented programming patterns and had great practicality.
To achieve this vision, he combined aspects of Perl, Smalltalk, Eiffel, Ada, and Lisp, to create his vision had functional and imperative programming aspects.
This gave the language some very unique features.
By 2005 Ruby became a highly dominant language largely because of Ruby on Rails.
A more complete list of available resources can be found at Ruby's Documentation page.
Ruby has several installation options. The first and likely easiest is using your system's package manager. Whether that be apt for Debian based systems, pacman for Arch, homebrew for mac or choco for windows.
$ sudo apt-get install ruby-full
$ sudo pacman -S ruby
$ brew install ruby
> choco install ruby
As it is open-source, ruby's source files are freely available to build.
$ ./configure
$ make
$ sudo make install
Alternatively, a third-party installer can be used. Further install instructions and options can be found at Ruby's Installation Documentation
Ruby's hello world is incredibly simple, moreso than even python.
Simply putting the following will print the famous "Hello World" on the terminal
Code:
puts 'Hello world'
Run:
$ ruby hello-world.rb
Hello world
One unique feature of the language is that everything is an object in Ruby.
This includes the langauge's primitives.
Here is a snippet of code from the about ruby page that demonstrates this.
Code:
5.times { print "We *love* Ruby -- it's outrageous!" }
Run:
$ ruby love-ruby.rb
We *love* Ruby -- it's outrageous!We *love* Ruby -- it's outrageous!We *love* Ruby -- it's outrageous!We *love* Ruby -- it's outrageous!We *love* Ruby -- it's outrageous!