Introduction
© 2022 By Sun* - Talent Incubator Vietnam Unit - All rights reserved
Outline
1. Overview
2. History and Background
3. Installation guide
4. The first program
5. Big websites are built from Ruby
© 2022 By Sun* - Talent Incubator Vietnam Unit - All rights reserved 2
1. Overview
© 2022 By Sun* - Talent Incubator Vietnam Unit - All rights reserved 3
1. Overview
References:
❖ "The Ruby programming language" Book (446 pages)
Authors: David Flanagan, Yukihiro Matsumoto (Matz)
❖ Onlines
- https://www.ruby-lang.org/en/
- http://ruby-doc.org/
- https://apidock.com/ruby
- http://api.rubyonrails.org/
© 2022 By Sun* - Talent Incubator Vietnam Unit - All rights reserved 4
2. History and Background
❖ Developed in Japan.
❖ Ruby’s creator: Yukihiro Matsumoto.
❖ History:
➔ 02/1993, Matz develop Ruby and "Hello world" program was born in the
summer of this year.
➔ 1995, Alpha version was released.
➔ 1996, only Matz develop Ruby language, after Ruby community was
established and another develop it.
➔ 1996, Ruby 1.0 released.
❖ Aim was in “trying to make Ruby natural, not simple”.
© 2022 By Sun* - Talent Incubator Vietnam Unit - All rights reserved 5
2. History and Background
Ruby features:
❖ Scripting language.
❖ Dynamic language (as Javascript, ...).
❖ With Ruby, everything is an object (except Block)
❖ Pure OOP
❖ Natural, but not simple.
© 2022 By Sun* - Talent Incubator Vietnam Unit - All rights reserved 6
3. Installation - Windows environment
https://rubyinstaller.org/
© 2022 By Sun* - Talent Incubator Vietnam Unit - All rights reserved 7
3. Installation - Unix environment
Setup Ruby on Rails on Ubuntu: https://gorails.com/setup/ubuntu/18.04
© 2022 By Sun* - Talent Incubator Vietnam Unit - All rights reserved 8
3. Installation - cloud environment
Ruby on Google cloud platform: https://cloud.google.com/ruby/
© 2022 By Sun* - Talent Incubator Vietnam Unit - All rights reserved 9
4. The first program
Interactive with command line on Terminal:
# create file: hello_world.rb
puts "Hello world"
# On Terminal
$ ruby hello_world.rb
=> Result: Hello world
© 2022 By Sun* - Talent Incubator Vietnam Unit - All rights reserved 10
4. The first program
puts "====== Print simple text =========" #Result
print "Hello world!!!" ====== Print simple text =========
print "\n" Hello world!!!
print "Hello baby! \nI miss you!!" Hello baby!
print "\n" I miss you!!
print "Fullname \t\t Birthday \t\t Address\n" Fullname Birthday Address
print "Lung Thi Linh \t 01/02/2000 \t Ha Noi\n" Lung Thi Linh 01/02/2000 Ha Noi
print "Tran Van Gi \t 05/12/1999 \t Nam Dinh\n" Tran Van Gi 05/12/1999 Nam Dinh
puts "=========================================" =========================================
puts ""
© 2022 By Sun* - Talent Incubator Vietnam Unit - All rights reserved 11
4. The first program
# Iterator #Result
puts "====== Iterator =============" ====== Iterator =============
5.times {print "I love you!\n"} I love you!
I love you!
puts "=========================================" I love you!
puts "" I love you!
I love you!
=========================================
# Operator
puts "8 + 9 = #{8+9}" 8 + 9 = 17
puts "9 + 8 = #{8+9} and " + "9 - 8 = #{9-8}" 9 + 8 = 17 and 9 - 8 = 1
=========================================
puts "========================================="
puts ""
© 2022 By Sun* - Talent Incubator Vietnam Unit - All rights reserved 12
5. Big websites are built from Ruby
❖ https://basecamp.com/
❖ https://www.shopify.com/
❖ https://github.com/
❖ http://www.hulu.com/
❖ https://www.kickstarter.com/
❖ https://www.airbnb.com/
❖ https://www.goodreads.com/
© 2022 By Sun* - Talent Incubator Vietnam Unit - All rights reserved 13
The following programming languages are synonymous with high wages (global data 2019)
© 2022 By Sun* - Talent Incubator Vietnam Unit - All rights reserved 14
© 2022 By Sun* - Talent Incubator Vietnam Unit - All rights reserved 15
Question & Answer?
© 2022 By Sun* - Talent Incubator Vietnam Unit - All rights reserved 16
© 2022 By Sun* - Talent Incubator Vietnam Unit - All rights reserved 17