SlideShare a Scribd company logo
1 of 45
Ruby1.9.1
Ruby1.9.1
 Brad Feeley
Ruby1.9.1
 Brad Feeley
 I work at Digitaria
Ruby1.9.1




        What is it?
Ruby1.9.1




           What is it?

  “ Ruby 1.9 is a new series of Ruby. It is modern,
  faster, with clearer syntax, multilingualized,
          a much improved version of Ruby.
Ruby1.9.1




            Faster   JRuby
Ruby1.9.1




               Faster
            New virtual machine YARV
Ruby1.9.1




               Faster                  Maybe another
                                       presentation?



            New virtual machine YARV
             Kernal (native) threads
Ruby1.9.1




   Multilingualized
            a.k.a. m17n
Ruby1.9.1




   Multilingualized
            File Level Encoding
Ruby1.9.1




   Multilingualized
            File Level Encoding

        # encodeing: utf-8
        alias π = Math::PI
Ruby1.9.1




   Multilingualized
            String Level Encoding
Ruby1.9.1




   Multilingualized
            String Level Encoding

   my_string.encode(“iso-8859-1”)
Ruby1.9.1




   Multilingualized
            IO Level Encoding
Ruby1.9.1




   Multilingualized
            IO Level Encoding

   f.open(‘file.txt’, ‘r:ascii’)
   data = f.read
   data.encoding.name
    # => ‘US-ASCII’
Ruby1.9.1




    Cleaner Syntax
Cleaner Syntax
Ruby1.9.1



              String
            No longer Enumerable
Cleaner Syntax
Ruby1.9.1



                 String
              No longer Enumerable

1.8   String.ancestors
      => [String, Enumerable, Comparable, Object, Kernel]



1.9   String.ancestors
      => [String, Comparable, Object, Kernel]
Cleaner Syntax
Ruby1.9.1



                 String
              No longer Enumerable

1.8   my_string_var.each { |line| puts line }




1.9   my_string_var.each_line { |line| puts line }
Cleaner Syntax
Ruby1.9.1



                     String
 str = “test”
 str.clear # => “”

 “hellonworld”.lines # => [“hellon”, “world”]

 “hello”.encoding # => “UTF-8”

 “kitty”.start_with? “cat” # => false
 “kitty”.end_with? “tty”   # => true
Cleaner Syntax
Ruby1.9.1



            Array
Cleaner Syntax
Ruby1.9.1



                         Array
 vowels = ['a','e','i', ‘o’, ‘u’]
 vowels.index{|letter| letter == 'e'} # => 1

 a = [1,2,3]
 a.permutation(2).to_a   #=> [[1,2],[1,3],[2,1],[2,3],[3,1],[3,2]]
 a.combination(2).to_a   #=> [[1, 2], [1, 3], [2, 3]]

 a.to_s # => “[1, 2, 3]”

 a.pop(2) #=> [2, 3]
Cleaner Syntax
Ruby1.9.1



            Hash
Cleaner Syntax
Ruby1.9.1



               Hash
            New Key Value Syntax
Cleaner Syntax
Ruby1.9.1



                  Hash
              New Key Value Syntax

1.8   render :action => ‘new’
Cleaner Syntax
Ruby1.9.1



                  Hash
              New Key Value Syntax

1.8   render :action => ‘new’




1.9   render action: ‘new’
Cleaner Syntax
Ruby1.9.1



                  Hash
               Order Preservation
   h = {:a => 1, :b => 2, :c => 3 }
   h[:d] = 4

1.8   puts h.inspect => {:4 => d, :a => 1, :b => 2, :c => 3 }
Cleaner Syntax
Ruby1.9.1



                  Hash
               Order Preservation
   h = {:a => 1, :b => 2, :c => 3 }
   h[:d] = 4

1.8   puts h.inspect => {:4 => d, :a => 1, :b => 2, :c => 3 }




1.9   puts h.inspect => {:a => 1, :b => 2, :c => 3, :4 => d }
Cleaner Syntax
Ruby1.9.1



            Proc
Cleaner Syntax
Ruby1.9.1



                 Proc
            New Declaration Syntax


 1.8   say_hi = lambda { |a| “Hello, #{a}” }
Cleaner Syntax
Ruby1.9.1



                 Proc
            New Declaration Syntax


 1.8   say_hi = lambda { |a| “Hello, #{a}” }



 1.9   say_hi = ->(a){ “Hello, #{a}” }
Cleaner Syntax
Ruby1.9.1



                 Proc
            New Declaration Syntax


 1.8   a = lambda { |x, y=1| x * y } #=> ERROR
Cleaner Syntax
Ruby1.9.1



                 Proc
            New Declaration Syntax


 1.8   a = lambda { |x, y=1| x * y } #=> ERROR



 1.9   a = ->(x, y=1){ x * y }
       a = ->(&x){ x.call }
Cleaner Syntax
Ruby1.9.1



                 Proc
             New Calling Syntax
 say_hi = lambda { |a| “Hello, #{a}” }


1.8   say_hi.call(‘Quentin’) # => Hello, Quentin
Cleaner Syntax
Ruby1.9.1



                 Proc
             New Calling Syntax
 say_hi = lambda { |a| “Hello, #{a}” }


1.8   say_hi.call(‘Quentin’) # => Hello, Quentin


1.9   say_hi.(‘Quentin’) # => Hello, Quentin
Cleaner Syntax
Ruby1.9.1



       Block Scope
            n = “Hello, World!”
            [1,2,3].each do |n|
              #do something
            end
Cleaner Syntax
Ruby1.9.1



       Block Scope
            n = “Hello, World!”
            [1,2,3].each do |n|
              #do something
            end


1.8   puts n # => 3
Cleaner Syntax
Ruby1.9.1



       Block Scope
            n = “Hello, World!”
            [1,2,3].each do |n|
              #do something
            end


1.8   puts n # => 3


1.9   puts n # => “Hello, World!”
Cleaner Syntax
Ruby1.9.1



       Debugging
Cleaner Syntax
Ruby1.9.1



         Debugging
   -w whitespace
Cleaner Syntax
Ruby1.9.1



         Debugging
   -w whitespace

   Method#owner
     #=> module the method belongs to

   Method#source_location
     #=> where the method is defined
Ruby1.9.1



             Installation
 http://gist.github.com/59130
 wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.1-p0.tar.bz2
 tar -xjvf ruby-1.9.1-p0.tar.bz2
 cd ruby-1.9.1-p0
 ./configure --prefix=/usr --program-suffix=19 --enable-shared
 make && make install
Ruby1.9.1



     Ruby on Rails
Ruby1.9.1



        Resources
            •http://www.google.com
Ruby1.9.1



       Questions?

More Related Content

What's hot

Optimizing Erlang Code for Speed
Optimizing Erlang Code for SpeedOptimizing Erlang Code for Speed
Optimizing Erlang Code for SpeedViktor Sovietov
 
Perl - laziness, impatience, hubris, and one liners
Perl - laziness, impatience, hubris, and one linersPerl - laziness, impatience, hubris, and one liners
Perl - laziness, impatience, hubris, and one linersKirk Kimmel
 
Write a redis client of your own
Write a redis client of your ownWrite a redis client of your own
Write a redis client of your ownChao Gao
 
Introduction To Distributed Erlang
Introduction To Distributed ErlangIntroduction To Distributed Erlang
Introduction To Distributed ErlangDavid Dossot
 
Debug Line Issues After Relaxation.
Debug Line Issues After Relaxation.Debug Line Issues After Relaxation.
Debug Line Issues After Relaxation.Wang Hsiangkai
 
Parboiled explained
Parboiled explainedParboiled explained
Parboiled explainedPaul Popoff
 
TDC2016POA | Trilha Programacao Funcional - Ramda JS como alternativa a under...
TDC2016POA | Trilha Programacao Funcional - Ramda JS como alternativa a under...TDC2016POA | Trilha Programacao Funcional - Ramda JS como alternativa a under...
TDC2016POA | Trilha Programacao Funcional - Ramda JS como alternativa a under...tdc-globalcode
 
Release with confidence
Release with confidenceRelease with confidence
Release with confidenceJohn Congdon
 
Caching
CachingCaching
Cachingjo7714
 
Performance testing of microservices in Action
Performance testing of microservices in ActionPerformance testing of microservices in Action
Performance testing of microservices in ActionAlexander Kachur
 
Return Oriented Programming (ROP chaining)
Return Oriented Programming (ROP chaining)Return Oriented Programming (ROP chaining)
Return Oriented Programming (ROP chaining)Abhinav Chourasia, GMOB
 

What's hot (19)

Optimizing Erlang Code for Speed
Optimizing Erlang Code for SpeedOptimizing Erlang Code for Speed
Optimizing Erlang Code for Speed
 
Perl - laziness, impatience, hubris, and one liners
Perl - laziness, impatience, hubris, and one linersPerl - laziness, impatience, hubris, and one liners
Perl - laziness, impatience, hubris, and one liners
 
Source Plugins
Source PluginsSource Plugins
Source Plugins
 
Intro to MQ
Intro to MQIntro to MQ
Intro to MQ
 
Write a redis client of your own
Write a redis client of your ownWrite a redis client of your own
Write a redis client of your own
 
Introduction To Distributed Erlang
Introduction To Distributed ErlangIntroduction To Distributed Erlang
Introduction To Distributed Erlang
 
Debug Line Issues After Relaxation.
Debug Line Issues After Relaxation.Debug Line Issues After Relaxation.
Debug Line Issues After Relaxation.
 
Parboiled explained
Parboiled explainedParboiled explained
Parboiled explained
 
email delivery
email deliveryemail delivery
email delivery
 
Algorithm 4
Algorithm  4Algorithm  4
Algorithm 4
 
TDC2016POA | Trilha Programacao Funcional - Ramda JS como alternativa a under...
TDC2016POA | Trilha Programacao Funcional - Ramda JS como alternativa a under...TDC2016POA | Trilha Programacao Funcional - Ramda JS como alternativa a under...
TDC2016POA | Trilha Programacao Funcional - Ramda JS como alternativa a under...
 
Release with confidence
Release with confidenceRelease with confidence
Release with confidence
 
Caching
CachingCaching
Caching
 
Polling server
Polling serverPolling server
Polling server
 
Subversion To Mercurial
Subversion To MercurialSubversion To Mercurial
Subversion To Mercurial
 
Performance testing of microservices in Action
Performance testing of microservices in ActionPerformance testing of microservices in Action
Performance testing of microservices in Action
 
DNS 101: Introducción a DNS en Español
DNS 101: Introducción a DNS en EspañolDNS 101: Introducción a DNS en Español
DNS 101: Introducción a DNS en Español
 
gRPC in Go
gRPC in GogRPC in Go
gRPC in Go
 
Return Oriented Programming (ROP chaining)
Return Oriented Programming (ROP chaining)Return Oriented Programming (ROP chaining)
Return Oriented Programming (ROP chaining)
 

Viewers also liked

Enhance you APDEX.. naturally!
Enhance you APDEX.. naturally!Enhance you APDEX.. naturally!
Enhance you APDEX.. naturally!Dimelo R&D Team
 
Exceptions in Ruby - Tips and Tricks
Exceptions in Ruby - Tips and TricksExceptions in Ruby - Tips and Tricks
Exceptions in Ruby - Tips and TricksDimelo R&D Team
 
Rails performance: Ruby GC tweaking
Rails performance: Ruby GC tweaking Rails performance: Ruby GC tweaking
Rails performance: Ruby GC tweaking Dimelo R&D Team
 
Encodings - Ruby 1.8 and Ruby 1.9
Encodings - Ruby 1.8 and Ruby 1.9Encodings - Ruby 1.8 and Ruby 1.9
Encodings - Ruby 1.8 and Ruby 1.9Dimelo R&D Team
 
Problemas 1 al 7, diagrama de flujo problema 7, y pseudocódigo y diagrama de ...
Problemas 1 al 7, diagrama de flujo problema 7, y pseudocódigo y diagrama de ...Problemas 1 al 7, diagrama de flujo problema 7, y pseudocódigo y diagrama de ...
Problemas 1 al 7, diagrama de flujo problema 7, y pseudocódigo y diagrama de ...juangui1989
 
4 cylinder diesel engine (1.9 l engine) VW
4 cylinder diesel engine (1.9 l engine) VW4 cylinder diesel engine (1.9 l engine) VW
4 cylinder diesel engine (1.9 l engine) VWcerjs
 

Viewers also liked (7)

ObjectId in Mongodb
ObjectId in MongodbObjectId in Mongodb
ObjectId in Mongodb
 
Enhance you APDEX.. naturally!
Enhance you APDEX.. naturally!Enhance you APDEX.. naturally!
Enhance you APDEX.. naturally!
 
Exceptions in Ruby - Tips and Tricks
Exceptions in Ruby - Tips and TricksExceptions in Ruby - Tips and Tricks
Exceptions in Ruby - Tips and Tricks
 
Rails performance: Ruby GC tweaking
Rails performance: Ruby GC tweaking Rails performance: Ruby GC tweaking
Rails performance: Ruby GC tweaking
 
Encodings - Ruby 1.8 and Ruby 1.9
Encodings - Ruby 1.8 and Ruby 1.9Encodings - Ruby 1.8 and Ruby 1.9
Encodings - Ruby 1.8 and Ruby 1.9
 
Problemas 1 al 7, diagrama de flujo problema 7, y pseudocódigo y diagrama de ...
Problemas 1 al 7, diagrama de flujo problema 7, y pseudocódigo y diagrama de ...Problemas 1 al 7, diagrama de flujo problema 7, y pseudocódigo y diagrama de ...
Problemas 1 al 7, diagrama de flujo problema 7, y pseudocódigo y diagrama de ...
 
4 cylinder diesel engine (1.9 l engine) VW
4 cylinder diesel engine (1.9 l engine) VW4 cylinder diesel engine (1.9 l engine) VW
4 cylinder diesel engine (1.9 l engine) VW
 

Similar to Ruby 1.9 Introduction

Migrating To Ruby1.9
Migrating To Ruby1.9Migrating To Ruby1.9
Migrating To Ruby1.9tomaspavelka
 
Ruby19 osdc-090418222718-phpapp02
Ruby19 osdc-090418222718-phpapp02Ruby19 osdc-090418222718-phpapp02
Ruby19 osdc-090418222718-phpapp02Apoorvi Kapoor
 
The Ring programming language version 1.9 book - Part 17 of 210
The Ring programming language version 1.9 book - Part 17 of 210The Ring programming language version 1.9 book - Part 17 of 210
The Ring programming language version 1.9 book - Part 17 of 210Mahmoud Samir Fayed
 
Use PEG to Write a Programming Language Parser
Use PEG to Write a Programming Language ParserUse PEG to Write a Programming Language Parser
Use PEG to Write a Programming Language ParserYodalee
 
Ruby presentasjon på NTNU 22 april 2009
Ruby presentasjon på NTNU 22 april 2009Ruby presentasjon på NTNU 22 april 2009
Ruby presentasjon på NTNU 22 april 2009Aslak Hellesøy
 
Ruby presentasjon på NTNU 22 april 2009
Ruby presentasjon på NTNU 22 april 2009Ruby presentasjon på NTNU 22 april 2009
Ruby presentasjon på NTNU 22 april 2009Aslak Hellesøy
 
Ruby presentasjon på NTNU 22 april 2009
Ruby presentasjon på NTNU 22 april 2009Ruby presentasjon på NTNU 22 april 2009
Ruby presentasjon på NTNU 22 april 2009Aslak Hellesøy
 
Impacta - Show Day de Rails
Impacta - Show Day de RailsImpacta - Show Day de Rails
Impacta - Show Day de RailsFabio Akita
 
What's up with Prototype and script.aculo.us?
What's up with Prototype and script.aculo.us?What's up with Prototype and script.aculo.us?
What's up with Prototype and script.aculo.us?Christophe Porteneuve
 
A Toda Maquina Con Ruby on Rails
A Toda Maquina Con Ruby on RailsA Toda Maquina Con Ruby on Rails
A Toda Maquina Con Ruby on RailsRafael García
 
Advanced Perl Techniques
Advanced Perl TechniquesAdvanced Perl Techniques
Advanced Perl TechniquesDave Cross
 
Get your ass to 1.9
Get your ass to 1.9Get your ass to 1.9
Get your ass to 1.9Nic Benders
 
The Ring programming language version 1.8 book - Part 15 of 202
The Ring programming language version 1.8 book - Part 15 of 202The Ring programming language version 1.8 book - Part 15 of 202
The Ring programming language version 1.8 book - Part 15 of 202Mahmoud Samir Fayed
 
The Ring programming language version 1.5.1 book - Part 38 of 180
The Ring programming language version 1.5.1 book - Part 38 of 180The Ring programming language version 1.5.1 book - Part 38 of 180
The Ring programming language version 1.5.1 book - Part 38 of 180Mahmoud Samir Fayed
 
The details of CI/CD environment for Ruby
The details of CI/CD environment for RubyThe details of CI/CD environment for Ruby
The details of CI/CD environment for RubyHiroshi SHIBATA
 
Practical Testing of Ruby Core
Practical Testing of Ruby CorePractical Testing of Ruby Core
Practical Testing of Ruby CoreHiroshi SHIBATA
 

Similar to Ruby 1.9 Introduction (20)

Migrating To Ruby1.9
Migrating To Ruby1.9Migrating To Ruby1.9
Migrating To Ruby1.9
 
Ruby19 osdc-090418222718-phpapp02
Ruby19 osdc-090418222718-phpapp02Ruby19 osdc-090418222718-phpapp02
Ruby19 osdc-090418222718-phpapp02
 
An introduction to Ruby
An introduction to RubyAn introduction to Ruby
An introduction to Ruby
 
Ruby 1.9
Ruby 1.9Ruby 1.9
Ruby 1.9
 
The Ring programming language version 1.9 book - Part 17 of 210
The Ring programming language version 1.9 book - Part 17 of 210The Ring programming language version 1.9 book - Part 17 of 210
The Ring programming language version 1.9 book - Part 17 of 210
 
Use PEG to Write a Programming Language Parser
Use PEG to Write a Programming Language ParserUse PEG to Write a Programming Language Parser
Use PEG to Write a Programming Language Parser
 
Ruby presentasjon på NTNU 22 april 2009
Ruby presentasjon på NTNU 22 april 2009Ruby presentasjon på NTNU 22 april 2009
Ruby presentasjon på NTNU 22 april 2009
 
Ruby presentasjon på NTNU 22 april 2009
Ruby presentasjon på NTNU 22 april 2009Ruby presentasjon på NTNU 22 april 2009
Ruby presentasjon på NTNU 22 april 2009
 
Ruby presentasjon på NTNU 22 april 2009
Ruby presentasjon på NTNU 22 april 2009Ruby presentasjon på NTNU 22 april 2009
Ruby presentasjon på NTNU 22 april 2009
 
Dutch PHP Conference 2013: Distilled
Dutch PHP Conference 2013: DistilledDutch PHP Conference 2013: Distilled
Dutch PHP Conference 2013: Distilled
 
Impacta - Show Day de Rails
Impacta - Show Day de RailsImpacta - Show Day de Rails
Impacta - Show Day de Rails
 
What's up with Prototype and script.aculo.us?
What's up with Prototype and script.aculo.us?What's up with Prototype and script.aculo.us?
What's up with Prototype and script.aculo.us?
 
A Toda Maquina Con Ruby on Rails
A Toda Maquina Con Ruby on RailsA Toda Maquina Con Ruby on Rails
A Toda Maquina Con Ruby on Rails
 
Advanced Perl Techniques
Advanced Perl TechniquesAdvanced Perl Techniques
Advanced Perl Techniques
 
Get your ass to 1.9
Get your ass to 1.9Get your ass to 1.9
Get your ass to 1.9
 
The Ring programming language version 1.8 book - Part 15 of 202
The Ring programming language version 1.8 book - Part 15 of 202The Ring programming language version 1.8 book - Part 15 of 202
The Ring programming language version 1.8 book - Part 15 of 202
 
The Ring programming language version 1.5.1 book - Part 38 of 180
The Ring programming language version 1.5.1 book - Part 38 of 180The Ring programming language version 1.5.1 book - Part 38 of 180
The Ring programming language version 1.5.1 book - Part 38 of 180
 
Week1
Week1Week1
Week1
 
The details of CI/CD environment for Ruby
The details of CI/CD environment for RubyThe details of CI/CD environment for Ruby
The details of CI/CD environment for Ruby
 
Practical Testing of Ruby Core
Practical Testing of Ruby CorePractical Testing of Ruby Core
Practical Testing of Ruby Core
 

Recently uploaded

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 

Recently uploaded (20)

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 

Ruby 1.9 Introduction

  • 3. Ruby1.9.1 Brad Feeley I work at Digitaria
  • 4. Ruby1.9.1 What is it?
  • 5. Ruby1.9.1 What is it? “ Ruby 1.9 is a new series of Ruby. It is modern, faster, with clearer syntax, multilingualized, a much improved version of Ruby.
  • 6. Ruby1.9.1 Faster JRuby
  • 7. Ruby1.9.1 Faster New virtual machine YARV
  • 8. Ruby1.9.1 Faster Maybe another presentation? New virtual machine YARV Kernal (native) threads
  • 9. Ruby1.9.1 Multilingualized a.k.a. m17n
  • 10. Ruby1.9.1 Multilingualized File Level Encoding
  • 11. Ruby1.9.1 Multilingualized File Level Encoding # encodeing: utf-8 alias π = Math::PI
  • 12. Ruby1.9.1 Multilingualized String Level Encoding
  • 13. Ruby1.9.1 Multilingualized String Level Encoding my_string.encode(“iso-8859-1”)
  • 14. Ruby1.9.1 Multilingualized IO Level Encoding
  • 15. Ruby1.9.1 Multilingualized IO Level Encoding f.open(‘file.txt’, ‘r:ascii’) data = f.read data.encoding.name # => ‘US-ASCII’
  • 16. Ruby1.9.1 Cleaner Syntax
  • 17. Cleaner Syntax Ruby1.9.1 String No longer Enumerable
  • 18. Cleaner Syntax Ruby1.9.1 String No longer Enumerable 1.8 String.ancestors => [String, Enumerable, Comparable, Object, Kernel] 1.9 String.ancestors => [String, Comparable, Object, Kernel]
  • 19. Cleaner Syntax Ruby1.9.1 String No longer Enumerable 1.8 my_string_var.each { |line| puts line } 1.9 my_string_var.each_line { |line| puts line }
  • 20. Cleaner Syntax Ruby1.9.1 String str = “test” str.clear # => “” “hellonworld”.lines # => [“hellon”, “world”] “hello”.encoding # => “UTF-8” “kitty”.start_with? “cat” # => false “kitty”.end_with? “tty” # => true
  • 22. Cleaner Syntax Ruby1.9.1 Array vowels = ['a','e','i', ‘o’, ‘u’] vowels.index{|letter| letter == 'e'} # => 1 a = [1,2,3] a.permutation(2).to_a #=> [[1,2],[1,3],[2,1],[2,3],[3,1],[3,2]] a.combination(2).to_a #=> [[1, 2], [1, 3], [2, 3]] a.to_s # => “[1, 2, 3]” a.pop(2) #=> [2, 3]
  • 24. Cleaner Syntax Ruby1.9.1 Hash New Key Value Syntax
  • 25. Cleaner Syntax Ruby1.9.1 Hash New Key Value Syntax 1.8 render :action => ‘new’
  • 26. Cleaner Syntax Ruby1.9.1 Hash New Key Value Syntax 1.8 render :action => ‘new’ 1.9 render action: ‘new’
  • 27. Cleaner Syntax Ruby1.9.1 Hash Order Preservation h = {:a => 1, :b => 2, :c => 3 } h[:d] = 4 1.8 puts h.inspect => {:4 => d, :a => 1, :b => 2, :c => 3 }
  • 28. Cleaner Syntax Ruby1.9.1 Hash Order Preservation h = {:a => 1, :b => 2, :c => 3 } h[:d] = 4 1.8 puts h.inspect => {:4 => d, :a => 1, :b => 2, :c => 3 } 1.9 puts h.inspect => {:a => 1, :b => 2, :c => 3, :4 => d }
  • 30. Cleaner Syntax Ruby1.9.1 Proc New Declaration Syntax 1.8 say_hi = lambda { |a| “Hello, #{a}” }
  • 31. Cleaner Syntax Ruby1.9.1 Proc New Declaration Syntax 1.8 say_hi = lambda { |a| “Hello, #{a}” } 1.9 say_hi = ->(a){ “Hello, #{a}” }
  • 32. Cleaner Syntax Ruby1.9.1 Proc New Declaration Syntax 1.8 a = lambda { |x, y=1| x * y } #=> ERROR
  • 33. Cleaner Syntax Ruby1.9.1 Proc New Declaration Syntax 1.8 a = lambda { |x, y=1| x * y } #=> ERROR 1.9 a = ->(x, y=1){ x * y } a = ->(&x){ x.call }
  • 34. Cleaner Syntax Ruby1.9.1 Proc New Calling Syntax say_hi = lambda { |a| “Hello, #{a}” } 1.8 say_hi.call(‘Quentin’) # => Hello, Quentin
  • 35. Cleaner Syntax Ruby1.9.1 Proc New Calling Syntax say_hi = lambda { |a| “Hello, #{a}” } 1.8 say_hi.call(‘Quentin’) # => Hello, Quentin 1.9 say_hi.(‘Quentin’) # => Hello, Quentin
  • 36. Cleaner Syntax Ruby1.9.1 Block Scope n = “Hello, World!” [1,2,3].each do |n| #do something end
  • 37. Cleaner Syntax Ruby1.9.1 Block Scope n = “Hello, World!” [1,2,3].each do |n| #do something end 1.8 puts n # => 3
  • 38. Cleaner Syntax Ruby1.9.1 Block Scope n = “Hello, World!” [1,2,3].each do |n| #do something end 1.8 puts n # => 3 1.9 puts n # => “Hello, World!”
  • 40. Cleaner Syntax Ruby1.9.1 Debugging -w whitespace
  • 41. Cleaner Syntax Ruby1.9.1 Debugging -w whitespace Method#owner #=> module the method belongs to Method#source_location #=> where the method is defined
  • 42. Ruby1.9.1 Installation http://gist.github.com/59130 wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.1-p0.tar.bz2 tar -xjvf ruby-1.9.1-p0.tar.bz2 cd ruby-1.9.1-p0 ./configure --prefix=/usr --program-suffix=19 --enable-shared make && make install
  • 43. Ruby1.9.1 Ruby on Rails
  • 44. Ruby1.9.1 Resources •http://www.google.com
  • 45. Ruby1.9.1 Questions?

Editor's Notes