SlideShare a Scribd company logo
The Language Tools
Ruby: Why We Love It
https://github.com/Kelsin/ruby-presentation
Christopher Giroir
November 8th, 2011
Christopher Giroir Ruby: Why We Love It
The Language Tools
1 The Language
Basics
Why We Love It
Gems
2 Tools
Bundler
RVM
Christopher Giroir Ruby: Why We Love It
The Language Tools
Basics
Overview
Inspired by Smalltalk (which I love)
Also draws from Perl, Eiffel, Ada and LISP
Includes a REPL
Built for developers as a language they would love to use
Dynamic, strict, reflective, object oriented
Everything is an expression (even statements)
Everything is executed imperatively (even declarations)
Christopher Giroir Ruby: Why We Love It
The Language Tools
Basics
Overview
Inspired by Smalltalk (which I love)
Also draws from Perl, Eiffel, Ada and LISP
Includes a REPL
Built for developers as a language they would love to use
Dynamic, strict, reflective, object oriented
Everything is an expression (even statements)
Everything is executed imperatively (even declarations)
Christopher Giroir Ruby: Why We Love It
The Language Tools
Basics
Overview
Inspired by Smalltalk (which I love)
Also draws from Perl, Eiffel, Ada and LISP
Includes a REPL
Built for developers as a language they would love to use
Dynamic, strict, reflective, object oriented
Everything is an expression (even statements)
Everything is executed imperatively (even declarations)
Christopher Giroir Ruby: Why We Love It
The Language Tools
Basics
Overview
Inspired by Smalltalk (which I love)
Also draws from Perl, Eiffel, Ada and LISP
Includes a REPL
Built for developers as a language they would love to use
Dynamic, strict, reflective, object oriented
Everything is an expression (even statements)
Everything is executed imperatively (even declarations)
Christopher Giroir Ruby: Why We Love It
The Language Tools
Basics
Overview
Inspired by Smalltalk (which I love)
Also draws from Perl, Eiffel, Ada and LISP
Includes a REPL
Built for developers as a language they would love to use
Dynamic, strict, reflective, object oriented
Everything is an expression (even statements)
Everything is executed imperatively (even declarations)
Christopher Giroir Ruby: Why We Love It
The Language Tools
Basics
Overview
Inspired by Smalltalk (which I love)
Also draws from Perl, Eiffel, Ada and LISP
Includes a REPL
Built for developers as a language they would love to use
Dynamic, strict, reflective, object oriented
Everything is an expression (even statements)
Everything is executed imperatively (even declarations)
Christopher Giroir Ruby: Why We Love It
The Language Tools
Basics
Overview
Inspired by Smalltalk (which I love)
Also draws from Perl, Eiffel, Ada and LISP
Includes a REPL
Built for developers as a language they would love to use
Dynamic, strict, reflective, object oriented
Everything is an expression (even statements)
Everything is executed imperatively (even declarations)
Christopher Giroir Ruby: Why We Love It
The Language Tools
Basics
Object Oriented
Everything is an object
Single Inheritance
Modules can be mixed in
Dynamic Dispatch
Christopher Giroir Ruby: Why We Love It
The Language Tools
Basics
Object Oriented
Everything is an object
Single Inheritance
Modules can be mixed in
Dynamic Dispatch
Christopher Giroir Ruby: Why We Love It
The Language Tools
Basics
Object Oriented
Everything is an object
Single Inheritance
Modules can be mixed in
Dynamic Dispatch
Christopher Giroir Ruby: Why We Love It
The Language Tools
Basics
Object Oriented
Everything is an object
Single Inheritance
Modules can be mixed in
Dynamic Dispatch
Christopher Giroir Ruby: Why We Love It
The Language Tools
Basics
Simple Code
1 5.times { print "Hello" }
This outputs:
1 Hello
2 Hello
3 Hello
4 Hello
5 Hello
6 => 5
Christopher Giroir Ruby: Why We Love It
The Language Tools
Basics
Simple Code
1 5.times { print "Hello" }
This outputs:
1 Hello
2 Hello
3 Hello
4 Hello
5 Hello
6 => 5
Christopher Giroir Ruby: Why We Love It
The Language Tools
Basics
Types
1 # Strings
2 s = ’Testing’
3
4 # Interpreted Strings
5 t = "Double #{str}"
6
7 # Symbols
8 sym = :chris
9
10 # Arrays
11 a = [1,2,3]
12
13 # Hashes
14 h = { :key => ’value’, :chris => ’awesome’ }
Christopher Giroir Ruby: Why We Love It
The Language Tools
Basics
Classes
1 class Box
2 def initialize(w,h,d)
3 @width = w
4 @height = h
5 @depth = d
6 end
7
8 def volume
9 @width * @height * @depth
10 end
11 end
12
13 box = Box.new(2,2,2)
14 box.volume # => 8
Christopher Giroir Ruby: Why We Love It
The Language Tools
Basics
Simple Inheritance
1 class JackInTheBox < Box
2 def initialize(msg)
3 @msg = msg
4 super(3,3,3)
5 end
6
7 def open
8 puts @msg
9 end
10 end
11
12 jbox = JackInTheBox.new(’Surprise!’)
13 jbox.volume # => 27
14 jbox.open # prints ’Surprise!’
Christopher Giroir Ruby: Why We Love It
The Language Tools
Basics
Control
1 while true == false
2 if var == 5
3 break
4 end
5
6 begin
7 var - 1
8 end while var < 4
9
10 next if var == 6
11 end
Christopher Giroir Ruby: Why We Love It
The Language Tools
Basics
Blocks
1 [1,2,3].each { |n| puts n }
This outputs:
1 1
2 2
3 3
4 => [1,2,3]
Christopher Giroir Ruby: Why We Love It
The Language Tools
Basics
Blocks
1 [1,2,3].each { |n| puts n }
This outputs:
1 1
2 2
3 3
4 => [1,2,3]
Christopher Giroir Ruby: Why We Love It
The Language Tools
Basics
Block Syntax
1 5.upto(10) { |n| puts n }
This is exactly the same as the following:
1 5.upto(10) do |n|
2 puts n
3 end
Christopher Giroir Ruby: Why We Love It
The Language Tools
Why We Love It
Attribute Methods
1 class Person
2 def name
3 @name
4 end
5 def social=(s)
6 @social = s
7 end
8 def age
9 @age
10 end
11 def age=(a)
12 @age = a
13 end
14 end
Christopher Giroir Ruby: Why We Love It
The Language Tools
Why We Love It
The Easy Way
1 class Person
2 attr_reader :name
3 attr_writer :social
4 attr_accessor :age
5 end
Christopher Giroir Ruby: Why We Love It
The Language Tools
Why We Love It
The Easy Way Explained
1 class Person
2 attr_reader :name
3 attr_writer :social
4 attr_accessor :age
5 end
Ruby syntax allows method calls without ()
Result is clean and looks like a language feature
Christopher Giroir Ruby: Why We Love It
The Language Tools
Why We Love It
The Easy Way Explained
1 class Person
2 attr_reader :name
3 attr_writer :social
4 attr_accessor :age
5 end
Ruby syntax allows method calls without ()
Result is clean and looks like a language feature
Christopher Giroir Ruby: Why We Love It
The Language Tools
Why We Love It
We can implement this ourselves
Untested code, please do not copy:
1 class Object
2 def self.attr_reader(var)
3 class_eval <<-METHODS
4 def #{var}
5 @#{var}
6 end
7 METHODS
8 end
9 end
Christopher Giroir Ruby: Why We Love It
The Language Tools
Why We Love It
We can implement this ourselves
Untested code, please do not copy:
1 class Object
2 def self.attr_reader(var)
3 class_eval <<-METHODS
4 def #{var}
5 @#{var}
6 end
7 METHODS
8 end
9 end
Christopher Giroir Ruby: Why We Love It
The Language Tools
Why We Love It
Why Blocks
1 (map (lambda (n)
2 (+ n 5))
3 ’(1 2 3))
Becomes:
1 [1,2,3].map do |n|
2 n + 5
3 end
Results in:
1 => [6,7,8]
Christopher Giroir Ruby: Why We Love It
The Language Tools
Gems
Modules
1 module Voice
2 def say(msg)
3 puts msg
4 end
5 end
6
7 class Person
8 include Voice
9 end
10
11 p = Person.new
12 p.say(’Hello’) # prints ’Hello’
Christopher Giroir Ruby: Why We Love It
The Language Tools
Gems
Using Gems
Require loads in files
1 require ’saver’ # pulls in ’saver.rb’
Gems allow us to not deal with paths
1 require ’rubygems’
2 require ’saver’
3
4 class Item
5 include Saver
6 end
Christopher Giroir Ruby: Why We Love It
The Language Tools
Gems
Writing Gems
1 Gem::Specification.new do |s|
2 s.name = "saver"
3 s.version = Saver::VERSION
4 s.authors = ["Christopher Giroir"]
5 s.email = ["kelsin@valefor.com"]
6 s.homepage = "http://kelsin.github.com/saver/"
7
8 s.files = ‘git ls-files‘.split("n")
9 s.require_paths = ["lib"]
10
11 s.add_dependency ’activesupport’, ’~> 3.0.0’
12 s.add_dependency ’mongo_mapper’
13 end
Christopher Giroir Ruby: Why We Love It
The Language Tools
Bundler
Why Bundler?
Many projects (i.e. rails apps) are not gems themselves
They do have gem dependencies
Easy way to install and keep track of these dependencies
Making sure ONLY the proper gems are used
Christopher Giroir Ruby: Why We Love It
The Language Tools
Bundler
Why Bundler?
Many projects (i.e. rails apps) are not gems themselves
They do have gem dependencies
Easy way to install and keep track of these dependencies
Making sure ONLY the proper gems are used
Christopher Giroir Ruby: Why We Love It
The Language Tools
Bundler
Why Bundler?
Many projects (i.e. rails apps) are not gems themselves
They do have gem dependencies
Easy way to install and keep track of these dependencies
Making sure ONLY the proper gems are used
Christopher Giroir Ruby: Why We Love It
The Language Tools
Bundler
The Gemfile
1 source ’http://tools1.savewave.com/rubygems’
2 source ’http://rubygems.org’
3
4 gem ’rails’, ’3.0.7’
5
6 gem ’sw-model’, ’0.13.0’
7
8 group :development, :test do
9 gem "rspec"
10 end
Christopher Giroir Ruby: Why We Love It
The Language Tools
Bundler
Using Bundler
1 # Install the gems from the Gemfile
2 bundle install
3
4 # Update gems to new versions
5 bundle update
6
7 # Execute command with proper gems
8 bundle exec rake spec
In your ruby code
1 require "rubygems"
2 require "bundler/setup"
3 require "saver"
Christopher Giroir Ruby: Why We Love It
The Language Tools
Bundler
Gemfile.lock
When you initially install versions are saved to Gemfile.lock
After they are only updated on bundle update
SHOULD be checked into version control
Protects from version updates
Christopher Giroir Ruby: Why We Love It
The Language Tools
Bundler
Gemfile.lock
When you initially install versions are saved to Gemfile.lock
After they are only updated on bundle update
SHOULD be checked into version control
Protects from version updates
Christopher Giroir Ruby: Why We Love It
The Language Tools
Bundler
Gemfile.lock
When you initially install versions are saved to Gemfile.lock
After they are only updated on bundle update
SHOULD be checked into version control
Protects from version updates
Christopher Giroir Ruby: Why We Love It
The Language Tools
RVM
Why RVM?
Different projects might use different versions of rails
Different projects might use different ruby interpreters
Ruby
JRuby
Rubinus
While bundler helps, complete gem isolation is better!
It’s nice to keep your system ruby separate and not update it
Christopher Giroir Ruby: Why We Love It
The Language Tools
RVM
Why RVM?
Different projects might use different versions of rails
Different projects might use different ruby interpreters
Ruby
JRuby
Rubinus
While bundler helps, complete gem isolation is better!
It’s nice to keep your system ruby separate and not update it
Christopher Giroir Ruby: Why We Love It
The Language Tools
RVM
Why RVM?
Different projects might use different versions of rails
Different projects might use different ruby interpreters
Ruby
JRuby
Rubinus
While bundler helps, complete gem isolation is better!
It’s nice to keep your system ruby separate and not update it
Christopher Giroir Ruby: Why We Love It
The Language Tools
RVM
Why RVM?
Different projects might use different versions of rails
Different projects might use different ruby interpreters
Ruby
JRuby
Rubinus
While bundler helps, complete gem isolation is better!
It’s nice to keep your system ruby separate and not update it
Christopher Giroir Ruby: Why We Love It
The Language Tools
RVM
Using RVM
1 # Install the default 1.9.2 ruby interpretor
2 rvm install 1.9.2
3
4 # Switch to using 1.9.2
5 rvm use 1.9.2
6
7 # List installed rubies
8 rvm list
Christopher Giroir Ruby: Why We Love It
The Language Tools
RVM
RVM Gemsets
1 # Create a new gemset
2 rvm gemset create savingstar-web
3
4 # List gemsets
5 rvm gemset list
6
7 # Switch to a ruby and gemset together
8 rvm use 1.9.2@savingstar-web
Christopher Giroir Ruby: Why We Love It
The Language Tools
RVM
.rvmrc
A .rvmrc file per project allows you to say which ruby and
gemset to use
Should be in source control. Helps RVM users out, ignored for
others
It’s a shell script that’s executed everytime you cd (very
unsafe)
Makes life very easy however!
1 rvm use 1.9.2@saveingstar-web --create
Christopher Giroir Ruby: Why We Love It
The Language Tools
RVM
.rvmrc
A .rvmrc file per project allows you to say which ruby and
gemset to use
Should be in source control. Helps RVM users out, ignored for
others
It’s a shell script that’s executed everytime you cd (very
unsafe)
Makes life very easy however!
1 rvm use 1.9.2@saveingstar-web --create
Christopher Giroir Ruby: Why We Love It
The Language Tools
RVM
.rvmrc
A .rvmrc file per project allows you to say which ruby and
gemset to use
Should be in source control. Helps RVM users out, ignored for
others
It’s a shell script that’s executed everytime you cd (very
unsafe)
Makes life very easy however!
1 rvm use 1.9.2@saveingstar-web --create
Christopher Giroir Ruby: Why We Love It
The Language Tools
RVM
.rvmrc
A .rvmrc file per project allows you to say which ruby and
gemset to use
Should be in source control. Helps RVM users out, ignored for
others
It’s a shell script that’s executed everytime you cd (very
unsafe)
Makes life very easy however!
1 rvm use 1.9.2@saveingstar-web --create
Christopher Giroir Ruby: Why We Love It
The Language Tools
RVM
.rvmrc
A .rvmrc file per project allows you to say which ruby and
gemset to use
Should be in source control. Helps RVM users out, ignored for
others
It’s a shell script that’s executed everytime you cd (very
unsafe)
Makes life very easy however!
1 rvm use 1.9.2@saveingstar-web --create
Christopher Giroir Ruby: Why We Love It

More Related Content

What's hot

TypeProf for IDE: Enrich Development Experience without Annotations
TypeProf for IDE: Enrich Development Experience without AnnotationsTypeProf for IDE: Enrich Development Experience without Annotations
TypeProf for IDE: Enrich Development Experience without Annotations
mametter
 
IronRuby for the .NET Developer
IronRuby for the .NET DeveloperIronRuby for the .NET Developer
IronRuby for the .NET Developer
Cory Foy
 
ruby-cocoa
ruby-cocoaruby-cocoa
ruby-cocoa
tutorialsruby
 
Jaoo irony
Jaoo ironyJaoo irony
Jaoo irony
Nick Hodge
 
Ruby tutorial
Ruby tutorialRuby tutorial
Ruby tutorial
knoppix
 
Simulating TUM Drone 2.0 by ROS
Simulating TUM Drone 2.0  by ROSSimulating TUM Drone 2.0  by ROS
Simulating TUM Drone 2.0 by ROS
esraatarekahmedhasansadek
 
Hijacking Ruby Syntax in Ruby (RubyConf 2018)
Hijacking Ruby Syntax in Ruby (RubyConf 2018)Hijacking Ruby Syntax in Ruby (RubyConf 2018)
Hijacking Ruby Syntax in Ruby (RubyConf 2018)
SATOSHI TAGOMORI
 
Ruby on Rails 3 Day BC
Ruby on Rails 3 Day BCRuby on Rails 3 Day BC
IronRuby for the Rubyist
IronRuby for the RubyistIronRuby for the Rubyist
IronRuby for the Rubyist
Will Green
 
IronRuby And The DLR
IronRuby And The DLRIronRuby And The DLR
IronRuby And The DLR
Andre John Cruz
 
Intro for RoR
Intro for RoRIntro for RoR
I Know Kung Fu - Juggling Java Bytecode
I Know Kung Fu - Juggling Java BytecodeI Know Kung Fu - Juggling Java Bytecode
I Know Kung Fu - Juggling Java Bytecode
Alexander Shopov
 
How to develop the Standard Libraries of Ruby?
How to develop the Standard Libraries of Ruby?How to develop the Standard Libraries of Ruby?
How to develop the Standard Libraries of Ruby?
Hiroshi SHIBATA
 
XRuby_Overview_20070831
XRuby_Overview_20070831XRuby_Overview_20070831
XRuby_Overview_20070831
dreamhead
 
A Static Type Analyzer of Untyped Ruby Code for Ruby 3
A Static Type Analyzer of Untyped Ruby Code for Ruby 3A Static Type Analyzer of Untyped Ruby Code for Ruby 3
A Static Type Analyzer of Untyped Ruby Code for Ruby 3
mametter
 
Week2
Week2Week2
Week2
reneedv
 
Enjoy Ruby Programming in IDE and TypeProf
Enjoy Ruby Programming in IDE and TypeProfEnjoy Ruby Programming in IDE and TypeProf
Enjoy Ruby Programming in IDE and TypeProf
mametter
 
MacRuby
MacRubyMacRuby
MacRuby
bostonrb
 
Type Profiler: An Analysis to guess type signatures
Type Profiler: An Analysis to guess type signaturesType Profiler: An Analysis to guess type signatures
Type Profiler: An Analysis to guess type signatures
mametter
 
tDiary annual report 2009 - Sapporo Ruby Kaigi02
tDiary annual report 2009 - Sapporo Ruby Kaigi02tDiary annual report 2009 - Sapporo Ruby Kaigi02
tDiary annual report 2009 - Sapporo Ruby Kaigi02
Hiroshi SHIBATA
 

What's hot (20)

TypeProf for IDE: Enrich Development Experience without Annotations
TypeProf for IDE: Enrich Development Experience without AnnotationsTypeProf for IDE: Enrich Development Experience without Annotations
TypeProf for IDE: Enrich Development Experience without Annotations
 
IronRuby for the .NET Developer
IronRuby for the .NET DeveloperIronRuby for the .NET Developer
IronRuby for the .NET Developer
 
ruby-cocoa
ruby-cocoaruby-cocoa
ruby-cocoa
 
Jaoo irony
Jaoo ironyJaoo irony
Jaoo irony
 
Ruby tutorial
Ruby tutorialRuby tutorial
Ruby tutorial
 
Simulating TUM Drone 2.0 by ROS
Simulating TUM Drone 2.0  by ROSSimulating TUM Drone 2.0  by ROS
Simulating TUM Drone 2.0 by ROS
 
Hijacking Ruby Syntax in Ruby (RubyConf 2018)
Hijacking Ruby Syntax in Ruby (RubyConf 2018)Hijacking Ruby Syntax in Ruby (RubyConf 2018)
Hijacking Ruby Syntax in Ruby (RubyConf 2018)
 
Ruby on Rails 3 Day BC
Ruby on Rails 3 Day BCRuby on Rails 3 Day BC
Ruby on Rails 3 Day BC
 
IronRuby for the Rubyist
IronRuby for the RubyistIronRuby for the Rubyist
IronRuby for the Rubyist
 
IronRuby And The DLR
IronRuby And The DLRIronRuby And The DLR
IronRuby And The DLR
 
Intro for RoR
Intro for RoRIntro for RoR
Intro for RoR
 
I Know Kung Fu - Juggling Java Bytecode
I Know Kung Fu - Juggling Java BytecodeI Know Kung Fu - Juggling Java Bytecode
I Know Kung Fu - Juggling Java Bytecode
 
How to develop the Standard Libraries of Ruby?
How to develop the Standard Libraries of Ruby?How to develop the Standard Libraries of Ruby?
How to develop the Standard Libraries of Ruby?
 
XRuby_Overview_20070831
XRuby_Overview_20070831XRuby_Overview_20070831
XRuby_Overview_20070831
 
A Static Type Analyzer of Untyped Ruby Code for Ruby 3
A Static Type Analyzer of Untyped Ruby Code for Ruby 3A Static Type Analyzer of Untyped Ruby Code for Ruby 3
A Static Type Analyzer of Untyped Ruby Code for Ruby 3
 
Week2
Week2Week2
Week2
 
Enjoy Ruby Programming in IDE and TypeProf
Enjoy Ruby Programming in IDE and TypeProfEnjoy Ruby Programming in IDE and TypeProf
Enjoy Ruby Programming in IDE and TypeProf
 
MacRuby
MacRubyMacRuby
MacRuby
 
Type Profiler: An Analysis to guess type signatures
Type Profiler: An Analysis to guess type signaturesType Profiler: An Analysis to guess type signatures
Type Profiler: An Analysis to guess type signatures
 
tDiary annual report 2009 - Sapporo Ruby Kaigi02
tDiary annual report 2009 - Sapporo Ruby Kaigi02tDiary annual report 2009 - Sapporo Ruby Kaigi02
tDiary annual report 2009 - Sapporo Ruby Kaigi02
 

Viewers also liked

First Presentation
First PresentationFirst Presentation
First Presentation
Fan Zhang
 
Basic Latex Typesetting - Session 2
Basic Latex Typesetting - Session 2Basic Latex Typesetting - Session 2
Basic Latex Typesetting - Session 2
Kiel Granada
 
45324291 a-good-ph d-student
45324291 a-good-ph d-student45324291 a-good-ph d-student
45324291 a-good-ph d-student
Suddhasheel GHOSH, PhD
 
Typesetting Theses / Reports with LaTeX : Workshop Day 3
Typesetting Theses / Reports with LaTeX : Workshop Day 3Typesetting Theses / Reports with LaTeX : Workshop Day 3
Typesetting Theses / Reports with LaTeX : Workshop Day 3
Suddhasheel GHOSH, PhD
 
Expert Lecture on GPS at UIET, CSJM, Kanpur
Expert Lecture on GPS at UIET, CSJM, KanpurExpert Lecture on GPS at UIET, CSJM, Kanpur
Expert Lecture on GPS at UIET, CSJM, Kanpur
Suddhasheel GHOSH, PhD
 
Typesetting Mathematics with LaTeX - Day 2
Typesetting Mathematics with LaTeX - Day 2Typesetting Mathematics with LaTeX - Day 2
Typesetting Mathematics with LaTeX - Day 2
Suddhasheel GHOSH, PhD
 
Watershed Analysis with GRASS
Watershed Analysis with GRASSWatershed Analysis with GRASS
Watershed Analysis with GRASS
Suddhasheel GHOSH, PhD
 
Research Prospects with Geoinformatics
Research Prospects with GeoinformaticsResearch Prospects with Geoinformatics
Research Prospects with Geoinformatics
Suddhasheel GHOSH, PhD
 
Map Calculaton using GRASS
Map Calculaton using GRASSMap Calculaton using GRASS
Map Calculaton using GRASS
Suddhasheel GHOSH, PhD
 
Kedudukan siswa dalam kelompok dan mencari nilai akhir
Kedudukan siswa dalam kelompok dan mencari nilai akhirKedudukan siswa dalam kelompok dan mencari nilai akhir
Kedudukan siswa dalam kelompok dan mencari nilai akhir
muhamad khanif
 
Basic Latex Typesetting - Session 1
Basic Latex Typesetting - Session 1Basic Latex Typesetting - Session 1
Basic Latex Typesetting - Session 1
Kiel Granada
 
The LaTeX Workshop: Typesetting Mathematics with LaTeX
The LaTeX Workshop: Typesetting Mathematics with LaTeXThe LaTeX Workshop: Typesetting Mathematics with LaTeX
The LaTeX Workshop: Typesetting Mathematics with LaTeX
Suddhasheel GHOSH, PhD
 
Beamer tutorial
Beamer tutorialBeamer tutorial
Beamer tutorial
Saifuddin Kaijar
 
Making presentations with LaTeX: Workshop Day 4
Making presentations with LaTeX: Workshop Day 4Making presentations with LaTeX: Workshop Day 4
Making presentations with LaTeX: Workshop Day 4
Suddhasheel GHOSH, PhD
 
LATEX and BEAMER for Beginners
LATEX and BEAMER for Beginners LATEX and BEAMER for Beginners
LATEX and BEAMER for Beginners
Tilak Devaraj
 
Beamer ppt
Beamer pptBeamer ppt
Beamer ppt
Shiquan Wang
 
How to use LaTeX and Beamer to prepare presentation for Slideshare
How to use LaTeX and Beamer to prepare presentation for SlideshareHow to use LaTeX and Beamer to prepare presentation for Slideshare
How to use LaTeX and Beamer to prepare presentation for Slideshare
Vesa Linja-aho
 
Beamer tutorial
Beamer tutorialBeamer tutorial
Beamer tutorial
muhamad khanif
 
Laporan Fisika (Gaya Gesek)
Laporan Fisika (Gaya Gesek)Laporan Fisika (Gaya Gesek)
Laporan Fisika (Gaya Gesek)Monika Sihaloho
 
The LaTeX Workshop: Document design in LaTeX: Invocation
The LaTeX Workshop: Document design in LaTeX: InvocationThe LaTeX Workshop: Document design in LaTeX: Invocation
The LaTeX Workshop: Document design in LaTeX: Invocation
Suddhasheel GHOSH, PhD
 

Viewers also liked (20)

First Presentation
First PresentationFirst Presentation
First Presentation
 
Basic Latex Typesetting - Session 2
Basic Latex Typesetting - Session 2Basic Latex Typesetting - Session 2
Basic Latex Typesetting - Session 2
 
45324291 a-good-ph d-student
45324291 a-good-ph d-student45324291 a-good-ph d-student
45324291 a-good-ph d-student
 
Typesetting Theses / Reports with LaTeX : Workshop Day 3
Typesetting Theses / Reports with LaTeX : Workshop Day 3Typesetting Theses / Reports with LaTeX : Workshop Day 3
Typesetting Theses / Reports with LaTeX : Workshop Day 3
 
Expert Lecture on GPS at UIET, CSJM, Kanpur
Expert Lecture on GPS at UIET, CSJM, KanpurExpert Lecture on GPS at UIET, CSJM, Kanpur
Expert Lecture on GPS at UIET, CSJM, Kanpur
 
Typesetting Mathematics with LaTeX - Day 2
Typesetting Mathematics with LaTeX - Day 2Typesetting Mathematics with LaTeX - Day 2
Typesetting Mathematics with LaTeX - Day 2
 
Watershed Analysis with GRASS
Watershed Analysis with GRASSWatershed Analysis with GRASS
Watershed Analysis with GRASS
 
Research Prospects with Geoinformatics
Research Prospects with GeoinformaticsResearch Prospects with Geoinformatics
Research Prospects with Geoinformatics
 
Map Calculaton using GRASS
Map Calculaton using GRASSMap Calculaton using GRASS
Map Calculaton using GRASS
 
Kedudukan siswa dalam kelompok dan mencari nilai akhir
Kedudukan siswa dalam kelompok dan mencari nilai akhirKedudukan siswa dalam kelompok dan mencari nilai akhir
Kedudukan siswa dalam kelompok dan mencari nilai akhir
 
Basic Latex Typesetting - Session 1
Basic Latex Typesetting - Session 1Basic Latex Typesetting - Session 1
Basic Latex Typesetting - Session 1
 
The LaTeX Workshop: Typesetting Mathematics with LaTeX
The LaTeX Workshop: Typesetting Mathematics with LaTeXThe LaTeX Workshop: Typesetting Mathematics with LaTeX
The LaTeX Workshop: Typesetting Mathematics with LaTeX
 
Beamer tutorial
Beamer tutorialBeamer tutorial
Beamer tutorial
 
Making presentations with LaTeX: Workshop Day 4
Making presentations with LaTeX: Workshop Day 4Making presentations with LaTeX: Workshop Day 4
Making presentations with LaTeX: Workshop Day 4
 
LATEX and BEAMER for Beginners
LATEX and BEAMER for Beginners LATEX and BEAMER for Beginners
LATEX and BEAMER for Beginners
 
Beamer ppt
Beamer pptBeamer ppt
Beamer ppt
 
How to use LaTeX and Beamer to prepare presentation for Slideshare
How to use LaTeX and Beamer to prepare presentation for SlideshareHow to use LaTeX and Beamer to prepare presentation for Slideshare
How to use LaTeX and Beamer to prepare presentation for Slideshare
 
Beamer tutorial
Beamer tutorialBeamer tutorial
Beamer tutorial
 
Laporan Fisika (Gaya Gesek)
Laporan Fisika (Gaya Gesek)Laporan Fisika (Gaya Gesek)
Laporan Fisika (Gaya Gesek)
 
The LaTeX Workshop: Document design in LaTeX: Invocation
The LaTeX Workshop: Document design in LaTeX: InvocationThe LaTeX Workshop: Document design in LaTeX: Invocation
The LaTeX Workshop: Document design in LaTeX: Invocation
 

Similar to Ruby Presentation - Beamer

Ruby Presentation - Handout
Ruby Presentation - HandoutRuby Presentation - Handout
Ruby Presentation - Handout
Christopher Giroir
 
Ruby Presentation - Article
Ruby Presentation - ArticleRuby Presentation - Article
Ruby Presentation - Article
Christopher Giroir
 
Perl 101
Perl 101Perl 101
Perl 101
Alex Balhatchet
 
introduction-to-ruby
introduction-to-rubyintroduction-to-ruby
introduction-to-ruby
Ademar Tutor
 
Meta Programming in Ruby - Code Camp 2010
Meta Programming in Ruby - Code Camp 2010Meta Programming in Ruby - Code Camp 2010
Meta Programming in Ruby - Code Camp 2010
ssoroka
 
Elasticsearch Basics
Elasticsearch BasicsElasticsearch Basics
Elasticsearch Basics
Shifa Khan
 
Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1
Henry S
 
Go for Rubyists. August 2018. RUG-B Meetup
Go for Rubyists. August 2018. RUG-B MeetupGo for Rubyists. August 2018. RUG-B Meetup
Go for Rubyists. August 2018. RUG-B Meetup
Kirill Zonov
 
On the path to become a jr. developer short version
On the path to become a jr. developer short versionOn the path to become a jr. developer short version
On the path to become a jr. developer short version
Antonelo Schoepf
 
Mozilla Intern Summer 2014 Presentation
Mozilla Intern Summer 2014 PresentationMozilla Intern Summer 2014 Presentation
Mozilla Intern Summer 2014 Presentation
Corey Richardson
 
Intro To Ror
Intro To RorIntro To Ror
Intro To Ror
guest5dedf5
 
Rubinius and Ruby | A Love Story
Rubinius and Ruby | A Love Story Rubinius and Ruby | A Love Story
Rubinius and Ruby | A Love Story
Engine Yard
 
Ruby on Rails - Pengenalan kepada “permata” dalam pengaturcaraan
Ruby on Rails - Pengenalan kepada “permata” dalam pengaturcaraan  Ruby on Rails - Pengenalan kepada “permata” dalam pengaturcaraan
Ruby on Rails - Pengenalan kepada “permata” dalam pengaturcaraan
edthix
 
Why Ruby?
Why Ruby? Why Ruby?
Why Ruby?
IT Weekend
 
How DSL works on Ruby
How DSL works on RubyHow DSL works on Ruby
How DSL works on Ruby
Hiroshi SHIBATA
 
Page List & Sample Material (Repaired)
Page List & Sample Material (Repaired)Page List & Sample Material (Repaired)
Page List & Sample Material (Repaired)
Muhammad Haseeb Shahid
 
Vim 讓你寫 Ruby 的速度飛起來
Vim 讓你寫 Ruby 的速度飛起來Vim 讓你寫 Ruby 的速度飛起來
Vim 讓你寫 Ruby 的速度飛起來
Chris Houng
 
Ruby an overall approach
Ruby an overall approachRuby an overall approach
Ruby an overall approach
Felipe Schmitt
 
Introduction to Ruby
Introduction to RubyIntroduction to Ruby
Introduction to Ruby
Mark Menard
 
From Programming to Modeling And Back Again
From Programming to Modeling And Back AgainFrom Programming to Modeling And Back Again
From Programming to Modeling And Back Again
Markus Voelter
 

Similar to Ruby Presentation - Beamer (20)

Ruby Presentation - Handout
Ruby Presentation - HandoutRuby Presentation - Handout
Ruby Presentation - Handout
 
Ruby Presentation - Article
Ruby Presentation - ArticleRuby Presentation - Article
Ruby Presentation - Article
 
Perl 101
Perl 101Perl 101
Perl 101
 
introduction-to-ruby
introduction-to-rubyintroduction-to-ruby
introduction-to-ruby
 
Meta Programming in Ruby - Code Camp 2010
Meta Programming in Ruby - Code Camp 2010Meta Programming in Ruby - Code Camp 2010
Meta Programming in Ruby - Code Camp 2010
 
Elasticsearch Basics
Elasticsearch BasicsElasticsearch Basics
Elasticsearch Basics
 
Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1Code for Startup MVP (Ruby on Rails) Session 1
Code for Startup MVP (Ruby on Rails) Session 1
 
Go for Rubyists. August 2018. RUG-B Meetup
Go for Rubyists. August 2018. RUG-B MeetupGo for Rubyists. August 2018. RUG-B Meetup
Go for Rubyists. August 2018. RUG-B Meetup
 
On the path to become a jr. developer short version
On the path to become a jr. developer short versionOn the path to become a jr. developer short version
On the path to become a jr. developer short version
 
Mozilla Intern Summer 2014 Presentation
Mozilla Intern Summer 2014 PresentationMozilla Intern Summer 2014 Presentation
Mozilla Intern Summer 2014 Presentation
 
Intro To Ror
Intro To RorIntro To Ror
Intro To Ror
 
Rubinius and Ruby | A Love Story
Rubinius and Ruby | A Love Story Rubinius and Ruby | A Love Story
Rubinius and Ruby | A Love Story
 
Ruby on Rails - Pengenalan kepada “permata” dalam pengaturcaraan
Ruby on Rails - Pengenalan kepada “permata” dalam pengaturcaraan  Ruby on Rails - Pengenalan kepada “permata” dalam pengaturcaraan
Ruby on Rails - Pengenalan kepada “permata” dalam pengaturcaraan
 
Why Ruby?
Why Ruby? Why Ruby?
Why Ruby?
 
How DSL works on Ruby
How DSL works on RubyHow DSL works on Ruby
How DSL works on Ruby
 
Page List & Sample Material (Repaired)
Page List & Sample Material (Repaired)Page List & Sample Material (Repaired)
Page List & Sample Material (Repaired)
 
Vim 讓你寫 Ruby 的速度飛起來
Vim 讓你寫 Ruby 的速度飛起來Vim 讓你寫 Ruby 的速度飛起來
Vim 讓你寫 Ruby 的速度飛起來
 
Ruby an overall approach
Ruby an overall approachRuby an overall approach
Ruby an overall approach
 
Introduction to Ruby
Introduction to RubyIntroduction to Ruby
Introduction to Ruby
 
From Programming to Modeling And Back Again
From Programming to Modeling And Back AgainFrom Programming to Modeling And Back Again
From Programming to Modeling And Back Again
 

Recently uploaded

GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
MichaelKnudsen27
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
Mariano Tinti
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
Wouter Lemaire
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
SitimaJohn
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Project Management Semester Long Project - Acuity
Project Management Semester Long Project - AcuityProject Management Semester Long Project - Acuity
Project Management Semester Long Project - Acuity
jpupo2018
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
fredae14
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 

Recently uploaded (20)

GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
Nordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptxNordic Marketo Engage User Group_June 13_ 2024.pptx
Nordic Marketo Engage User Group_June 13_ 2024.pptx
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Project Management Semester Long Project - Acuity
Project Management Semester Long Project - AcuityProject Management Semester Long Project - Acuity
Project Management Semester Long Project - Acuity
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 

Ruby Presentation - Beamer

  • 1. The Language Tools Ruby: Why We Love It https://github.com/Kelsin/ruby-presentation Christopher Giroir November 8th, 2011 Christopher Giroir Ruby: Why We Love It
  • 2. The Language Tools 1 The Language Basics Why We Love It Gems 2 Tools Bundler RVM Christopher Giroir Ruby: Why We Love It
  • 3. The Language Tools Basics Overview Inspired by Smalltalk (which I love) Also draws from Perl, Eiffel, Ada and LISP Includes a REPL Built for developers as a language they would love to use Dynamic, strict, reflective, object oriented Everything is an expression (even statements) Everything is executed imperatively (even declarations) Christopher Giroir Ruby: Why We Love It
  • 4. The Language Tools Basics Overview Inspired by Smalltalk (which I love) Also draws from Perl, Eiffel, Ada and LISP Includes a REPL Built for developers as a language they would love to use Dynamic, strict, reflective, object oriented Everything is an expression (even statements) Everything is executed imperatively (even declarations) Christopher Giroir Ruby: Why We Love It
  • 5. The Language Tools Basics Overview Inspired by Smalltalk (which I love) Also draws from Perl, Eiffel, Ada and LISP Includes a REPL Built for developers as a language they would love to use Dynamic, strict, reflective, object oriented Everything is an expression (even statements) Everything is executed imperatively (even declarations) Christopher Giroir Ruby: Why We Love It
  • 6. The Language Tools Basics Overview Inspired by Smalltalk (which I love) Also draws from Perl, Eiffel, Ada and LISP Includes a REPL Built for developers as a language they would love to use Dynamic, strict, reflective, object oriented Everything is an expression (even statements) Everything is executed imperatively (even declarations) Christopher Giroir Ruby: Why We Love It
  • 7. The Language Tools Basics Overview Inspired by Smalltalk (which I love) Also draws from Perl, Eiffel, Ada and LISP Includes a REPL Built for developers as a language they would love to use Dynamic, strict, reflective, object oriented Everything is an expression (even statements) Everything is executed imperatively (even declarations) Christopher Giroir Ruby: Why We Love It
  • 8. The Language Tools Basics Overview Inspired by Smalltalk (which I love) Also draws from Perl, Eiffel, Ada and LISP Includes a REPL Built for developers as a language they would love to use Dynamic, strict, reflective, object oriented Everything is an expression (even statements) Everything is executed imperatively (even declarations) Christopher Giroir Ruby: Why We Love It
  • 9. The Language Tools Basics Overview Inspired by Smalltalk (which I love) Also draws from Perl, Eiffel, Ada and LISP Includes a REPL Built for developers as a language they would love to use Dynamic, strict, reflective, object oriented Everything is an expression (even statements) Everything is executed imperatively (even declarations) Christopher Giroir Ruby: Why We Love It
  • 10. The Language Tools Basics Object Oriented Everything is an object Single Inheritance Modules can be mixed in Dynamic Dispatch Christopher Giroir Ruby: Why We Love It
  • 11. The Language Tools Basics Object Oriented Everything is an object Single Inheritance Modules can be mixed in Dynamic Dispatch Christopher Giroir Ruby: Why We Love It
  • 12. The Language Tools Basics Object Oriented Everything is an object Single Inheritance Modules can be mixed in Dynamic Dispatch Christopher Giroir Ruby: Why We Love It
  • 13. The Language Tools Basics Object Oriented Everything is an object Single Inheritance Modules can be mixed in Dynamic Dispatch Christopher Giroir Ruby: Why We Love It
  • 14. The Language Tools Basics Simple Code 1 5.times { print "Hello" } This outputs: 1 Hello 2 Hello 3 Hello 4 Hello 5 Hello 6 => 5 Christopher Giroir Ruby: Why We Love It
  • 15. The Language Tools Basics Simple Code 1 5.times { print "Hello" } This outputs: 1 Hello 2 Hello 3 Hello 4 Hello 5 Hello 6 => 5 Christopher Giroir Ruby: Why We Love It
  • 16. The Language Tools Basics Types 1 # Strings 2 s = ’Testing’ 3 4 # Interpreted Strings 5 t = "Double #{str}" 6 7 # Symbols 8 sym = :chris 9 10 # Arrays 11 a = [1,2,3] 12 13 # Hashes 14 h = { :key => ’value’, :chris => ’awesome’ } Christopher Giroir Ruby: Why We Love It
  • 17. The Language Tools Basics Classes 1 class Box 2 def initialize(w,h,d) 3 @width = w 4 @height = h 5 @depth = d 6 end 7 8 def volume 9 @width * @height * @depth 10 end 11 end 12 13 box = Box.new(2,2,2) 14 box.volume # => 8 Christopher Giroir Ruby: Why We Love It
  • 18. The Language Tools Basics Simple Inheritance 1 class JackInTheBox < Box 2 def initialize(msg) 3 @msg = msg 4 super(3,3,3) 5 end 6 7 def open 8 puts @msg 9 end 10 end 11 12 jbox = JackInTheBox.new(’Surprise!’) 13 jbox.volume # => 27 14 jbox.open # prints ’Surprise!’ Christopher Giroir Ruby: Why We Love It
  • 19. The Language Tools Basics Control 1 while true == false 2 if var == 5 3 break 4 end 5 6 begin 7 var - 1 8 end while var < 4 9 10 next if var == 6 11 end Christopher Giroir Ruby: Why We Love It
  • 20. The Language Tools Basics Blocks 1 [1,2,3].each { |n| puts n } This outputs: 1 1 2 2 3 3 4 => [1,2,3] Christopher Giroir Ruby: Why We Love It
  • 21. The Language Tools Basics Blocks 1 [1,2,3].each { |n| puts n } This outputs: 1 1 2 2 3 3 4 => [1,2,3] Christopher Giroir Ruby: Why We Love It
  • 22. The Language Tools Basics Block Syntax 1 5.upto(10) { |n| puts n } This is exactly the same as the following: 1 5.upto(10) do |n| 2 puts n 3 end Christopher Giroir Ruby: Why We Love It
  • 23. The Language Tools Why We Love It Attribute Methods 1 class Person 2 def name 3 @name 4 end 5 def social=(s) 6 @social = s 7 end 8 def age 9 @age 10 end 11 def age=(a) 12 @age = a 13 end 14 end Christopher Giroir Ruby: Why We Love It
  • 24. The Language Tools Why We Love It The Easy Way 1 class Person 2 attr_reader :name 3 attr_writer :social 4 attr_accessor :age 5 end Christopher Giroir Ruby: Why We Love It
  • 25. The Language Tools Why We Love It The Easy Way Explained 1 class Person 2 attr_reader :name 3 attr_writer :social 4 attr_accessor :age 5 end Ruby syntax allows method calls without () Result is clean and looks like a language feature Christopher Giroir Ruby: Why We Love It
  • 26. The Language Tools Why We Love It The Easy Way Explained 1 class Person 2 attr_reader :name 3 attr_writer :social 4 attr_accessor :age 5 end Ruby syntax allows method calls without () Result is clean and looks like a language feature Christopher Giroir Ruby: Why We Love It
  • 27. The Language Tools Why We Love It We can implement this ourselves Untested code, please do not copy: 1 class Object 2 def self.attr_reader(var) 3 class_eval <<-METHODS 4 def #{var} 5 @#{var} 6 end 7 METHODS 8 end 9 end Christopher Giroir Ruby: Why We Love It
  • 28. The Language Tools Why We Love It We can implement this ourselves Untested code, please do not copy: 1 class Object 2 def self.attr_reader(var) 3 class_eval <<-METHODS 4 def #{var} 5 @#{var} 6 end 7 METHODS 8 end 9 end Christopher Giroir Ruby: Why We Love It
  • 29. The Language Tools Why We Love It Why Blocks 1 (map (lambda (n) 2 (+ n 5)) 3 ’(1 2 3)) Becomes: 1 [1,2,3].map do |n| 2 n + 5 3 end Results in: 1 => [6,7,8] Christopher Giroir Ruby: Why We Love It
  • 30. The Language Tools Gems Modules 1 module Voice 2 def say(msg) 3 puts msg 4 end 5 end 6 7 class Person 8 include Voice 9 end 10 11 p = Person.new 12 p.say(’Hello’) # prints ’Hello’ Christopher Giroir Ruby: Why We Love It
  • 31. The Language Tools Gems Using Gems Require loads in files 1 require ’saver’ # pulls in ’saver.rb’ Gems allow us to not deal with paths 1 require ’rubygems’ 2 require ’saver’ 3 4 class Item 5 include Saver 6 end Christopher Giroir Ruby: Why We Love It
  • 32. The Language Tools Gems Writing Gems 1 Gem::Specification.new do |s| 2 s.name = "saver" 3 s.version = Saver::VERSION 4 s.authors = ["Christopher Giroir"] 5 s.email = ["kelsin@valefor.com"] 6 s.homepage = "http://kelsin.github.com/saver/" 7 8 s.files = ‘git ls-files‘.split("n") 9 s.require_paths = ["lib"] 10 11 s.add_dependency ’activesupport’, ’~> 3.0.0’ 12 s.add_dependency ’mongo_mapper’ 13 end Christopher Giroir Ruby: Why We Love It
  • 33. The Language Tools Bundler Why Bundler? Many projects (i.e. rails apps) are not gems themselves They do have gem dependencies Easy way to install and keep track of these dependencies Making sure ONLY the proper gems are used Christopher Giroir Ruby: Why We Love It
  • 34. The Language Tools Bundler Why Bundler? Many projects (i.e. rails apps) are not gems themselves They do have gem dependencies Easy way to install and keep track of these dependencies Making sure ONLY the proper gems are used Christopher Giroir Ruby: Why We Love It
  • 35. The Language Tools Bundler Why Bundler? Many projects (i.e. rails apps) are not gems themselves They do have gem dependencies Easy way to install and keep track of these dependencies Making sure ONLY the proper gems are used Christopher Giroir Ruby: Why We Love It
  • 36. The Language Tools Bundler The Gemfile 1 source ’http://tools1.savewave.com/rubygems’ 2 source ’http://rubygems.org’ 3 4 gem ’rails’, ’3.0.7’ 5 6 gem ’sw-model’, ’0.13.0’ 7 8 group :development, :test do 9 gem "rspec" 10 end Christopher Giroir Ruby: Why We Love It
  • 37. The Language Tools Bundler Using Bundler 1 # Install the gems from the Gemfile 2 bundle install 3 4 # Update gems to new versions 5 bundle update 6 7 # Execute command with proper gems 8 bundle exec rake spec In your ruby code 1 require "rubygems" 2 require "bundler/setup" 3 require "saver" Christopher Giroir Ruby: Why We Love It
  • 38. The Language Tools Bundler Gemfile.lock When you initially install versions are saved to Gemfile.lock After they are only updated on bundle update SHOULD be checked into version control Protects from version updates Christopher Giroir Ruby: Why We Love It
  • 39. The Language Tools Bundler Gemfile.lock When you initially install versions are saved to Gemfile.lock After they are only updated on bundle update SHOULD be checked into version control Protects from version updates Christopher Giroir Ruby: Why We Love It
  • 40. The Language Tools Bundler Gemfile.lock When you initially install versions are saved to Gemfile.lock After they are only updated on bundle update SHOULD be checked into version control Protects from version updates Christopher Giroir Ruby: Why We Love It
  • 41. The Language Tools RVM Why RVM? Different projects might use different versions of rails Different projects might use different ruby interpreters Ruby JRuby Rubinus While bundler helps, complete gem isolation is better! It’s nice to keep your system ruby separate and not update it Christopher Giroir Ruby: Why We Love It
  • 42. The Language Tools RVM Why RVM? Different projects might use different versions of rails Different projects might use different ruby interpreters Ruby JRuby Rubinus While bundler helps, complete gem isolation is better! It’s nice to keep your system ruby separate and not update it Christopher Giroir Ruby: Why We Love It
  • 43. The Language Tools RVM Why RVM? Different projects might use different versions of rails Different projects might use different ruby interpreters Ruby JRuby Rubinus While bundler helps, complete gem isolation is better! It’s nice to keep your system ruby separate and not update it Christopher Giroir Ruby: Why We Love It
  • 44. The Language Tools RVM Why RVM? Different projects might use different versions of rails Different projects might use different ruby interpreters Ruby JRuby Rubinus While bundler helps, complete gem isolation is better! It’s nice to keep your system ruby separate and not update it Christopher Giroir Ruby: Why We Love It
  • 45. The Language Tools RVM Using RVM 1 # Install the default 1.9.2 ruby interpretor 2 rvm install 1.9.2 3 4 # Switch to using 1.9.2 5 rvm use 1.9.2 6 7 # List installed rubies 8 rvm list Christopher Giroir Ruby: Why We Love It
  • 46. The Language Tools RVM RVM Gemsets 1 # Create a new gemset 2 rvm gemset create savingstar-web 3 4 # List gemsets 5 rvm gemset list 6 7 # Switch to a ruby and gemset together 8 rvm use 1.9.2@savingstar-web Christopher Giroir Ruby: Why We Love It
  • 47. The Language Tools RVM .rvmrc A .rvmrc file per project allows you to say which ruby and gemset to use Should be in source control. Helps RVM users out, ignored for others It’s a shell script that’s executed everytime you cd (very unsafe) Makes life very easy however! 1 rvm use 1.9.2@saveingstar-web --create Christopher Giroir Ruby: Why We Love It
  • 48. The Language Tools RVM .rvmrc A .rvmrc file per project allows you to say which ruby and gemset to use Should be in source control. Helps RVM users out, ignored for others It’s a shell script that’s executed everytime you cd (very unsafe) Makes life very easy however! 1 rvm use 1.9.2@saveingstar-web --create Christopher Giroir Ruby: Why We Love It
  • 49. The Language Tools RVM .rvmrc A .rvmrc file per project allows you to say which ruby and gemset to use Should be in source control. Helps RVM users out, ignored for others It’s a shell script that’s executed everytime you cd (very unsafe) Makes life very easy however! 1 rvm use 1.9.2@saveingstar-web --create Christopher Giroir Ruby: Why We Love It
  • 50. The Language Tools RVM .rvmrc A .rvmrc file per project allows you to say which ruby and gemset to use Should be in source control. Helps RVM users out, ignored for others It’s a shell script that’s executed everytime you cd (very unsafe) Makes life very easy however! 1 rvm use 1.9.2@saveingstar-web --create Christopher Giroir Ruby: Why We Love It
  • 51. The Language Tools RVM .rvmrc A .rvmrc file per project allows you to say which ruby and gemset to use Should be in source control. Helps RVM users out, ignored for others It’s a shell script that’s executed everytime you cd (very unsafe) Makes life very easy however! 1 rvm use 1.9.2@saveingstar-web --create Christopher Giroir Ruby: Why We Love It