|
| 1 | +# About Ruby |
| 2 | + |
| 3 | +--- |
| 4 | + |
| 5 | +*You will learn:* |
| 6 | +- some facts about Ruby |
| 7 | +- what a Ruby file looks like |
| 8 | +- how to use the interactive Ruby console |
| 9 | + |
| 10 | +--- |
| 11 | + |
| 12 | +## Ruby is... |
| 13 | + |
| 14 | +` " A dynamic, open source programming language with a focus on` |
| 15 | +` simplicity and productivity. It has an elegant syntax that` |
| 16 | +` is natural to read and easy to write. "` |
| 17 | + |
| 18 | +as the official Ruby page (https://www.ruby-lang.org) describes it. |
| 19 | + |
| 20 | +It was designed and built in the mid-90s by *Yukihiro "Matz" Matsumoto* in Japan. |
| 21 | + |
| 22 | +Ruby is a cross platform interpreted language with a dynamic type system and |
| 23 | +automatic memory management. Its development was inspired by multiple other |
| 24 | +programming languages, such as Perl, Smalltalk, Eiffel, Ada, and Lisp. |
| 25 | + |
| 26 | +There are several different implementations of Ruby. |
| 27 | +The *MRI* (Matz Ruby Implementation) or *CRuby* is the reference implementation. |
| 28 | +Other implementations are *JRuby*, *Rubinius*, *MacRuby*, *mruby*, *IronRuby*,... |
| 29 | + |
| 30 | +Ruby is often used to build web applications, due to the mature *Ruby on Rails* |
| 31 | +and *Sinatra* frameworks. Nevertheless it can be applied to all kinds of use |
| 32 | +cases, from prototyping, to scientific computation, to command line interfaces |
| 33 | +and desktop apps (Daigaku is also fully written in Ruby :) ). |
| 34 | + |
| 35 | +## Naming Ruby files |
| 36 | + |
| 37 | +Source code files for Ruby have a `.rb` extension and are usually named with |
| 38 | +lowercase words, which are - if necessary - joined by an underscore: |
| 39 | + |
| 40 | +e.g. `student.rb`, `multiple_words.rb`, `even_more_words.rb`. |
| 41 | + |
| 42 | +## The interactive Ruby console |
| 43 | + |
| 44 | +If you open a new tab in your terminal and enter `irb`, you will start the |
| 45 | +*interactive Ruby* console. The irb is a useful tool for rapidly trying out |
| 46 | +ruby code. You can quit the irb again by entering `exit`. Give it a try! |
0 commit comments