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

08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
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
 
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
 
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
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
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
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
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
 
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
 

Recently uploaded (20)

08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
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
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 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
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
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
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
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
 
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
 

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