SlideShare a Scribd company logo
1 of 39
Ruby 2.0
  What’s	
  new?
r                          ions
@ gee_for            Interne
                             t Solut




              About me


         by
 I <3 Ru              #rub yOnBeer
History             Install



            Deep
          Changes

  Big                Little
Changes             Changes


            Eco
          System
History
Ruby’s History

                                  0.95                                                                                      Rails	
  arrives	
  on	
  the	
  
                                                                                                                            scene.	
  Arguably	
  the	
  
                            First	
  public	
  release                                                                      start	
  of	
  Ruby’s	
  rise.



          Feb 24                                         Dec 25                          Aug
           1993                                           1996                    1.2    1999   1.6
                                                                                                              Aug
                                                                                                              2003
                                                                                                                                                                Dec
                                                                                                                                                                2007


                                         Dec 21                                   Dec            Sep                                Dec 13
                                          1995                                    1998   1.4    2000                                 2005



I	
  want	
  a	
  language	
  more	
  
powerful	
  than	
  Perl	
  and	
               Start	
  of	
  Xmas	
  Tradi.on                    Language	
  starts	
  gaining	
                 Language	
  hits	
  the	
  big	
  
more	
  OO	
  than	
  Python                                                                       serious	
  trac.on                              .me.



                                                          1.0                                                 1.8                                               1.9
Ruby’s History

                       Rails	
  arrives	
  on	
  the	
  
                       scene.	
  Arguably	
  the	
  
                       start	
  of	
  Ruby’s	
  rise.




        Aug                                                Dec
        2003                                               2007


                               Dec 13
                                                                              2.0
                                2005




nguage	
  starts	
  gaining	
  
                                                                             Feb 24
                            Start	
  of	
  Xmas	
  Tradi.on the	
  big	
  
                                            Language	
  hits	
  
rious	
  trac.on                            .me.
                                                                              2013
        1.8                                                1.9
Install
The one tru
                                 e way
                             t rue way
                     The one


RVM                              RBENV
✦Update	
  RVM                   ✦Update	
  rbenv

✦rvm install ruby-2.0.0          ✦rbenv install 2.0.0-p0
Deep Changes
X
         X   X


BItmap Garbage
   Collection

     X   X   X
1.9 GC
                                                 Heap based M&S
                                                 Ruby	
  structures	
  are	
  divided	
  in	
  2	
  	
  
                                                 halves,	
  data	
  and	
  flags.	
  Each	
  
                                                 structure	
  has	
  its	
  own	
  flag.	
  Mark	
  
                                                 phase	
  trawls	
  through	
  heap	
  and	
  
                                                 updates	
  FL_MARK	
  flag	
  in	
  every	
  
                                                 object




         RString diagram from: http://patshaughnessy.net/2012/3/23/why-you-should-be-excited-about-garbage-collection-in-ruby-2-0
2.0 GC
                                              Bitmap marking
                                              All	
  mark	
  flags	
  for	
  heap	
  move	
  to	
  
                                              single	
  dedicated	
  data	
  structure.	
  
                                              1	
  for	
  In	
  Use,	
  0	
  for	
  Collectable.

                                              Flag	
  not	
  wriMen	
  to	
  data	
  
                                              structure,	
  much	
  more	
  friendly	
  
                                              to	
  copy-­‐on-­‐write




         Heap diagram from: http://patshaughnessy.net/2012/3/23/why-you-should-be-excited-about-garbage-collection-in-ruby-2-0
X
         X   X


   Backward
Compatible With
      1.9
     X   X   X
X
         X   X


require() speed
 improvements

     X   X   X
Big Changes
X
      X   X


 Keyword
Arguments

  X   X   X
Big Changes



 Keyword
Arguments
     def foo(foo: ‘bar’, baz: ‘qux’, **rest)
       # Do something
     end
     foo(baz: ‘noqux’, foo: ‘frob’)
X
     X   X


Module
Prepend

 X   X   X
Big Changes

Module
Prepend
    module IncludableModule
      def something; end
    end
    class MyClass
      prepend IncludableModule
    end
X
       X   X


    Lazy
Enumerators

   X   X   X
Big Changes

   Lazy
Enumerators
               to_infinity = (0..Float::Infinity)
beyond = to_infinity.lazy.select do |n|
  num % 42 == 0
end

100.times do { |n| puts beyond.next }
X
      X   X




Tracepoint

  X   X   X
Big Changes

         Trace
         Point
OO	
  alterna*ve	
  to	
  set_trace_func
trace = TracePoint.new(:raise) do |t|
  puts "Alert: Exception raised!"
end

trace.enable
X
       X   X




Refinements

   X   X   X
Big Changes

Refinements
     *
Localised	
  and	
  contained	
  monkey	
  patching
Module MyString
  refine String do
    def palindrome?
      self == self.reverse
    end
  end
end

using MyString # Monkey patch now active for context
little Changes
Little Changes

  Literal
Symbol lists
sym_list = %i{eeny meeny miny moe}

# => [:eeny, :meeny, :miny, :moe]
Little Changes

      Binary
      Search
haystack = (1..99999999)


haystack.bsearch do |needle|
    needle == 12345
end

# => 12345
Little Changes

    UTF-8
On by Default
#!/usr/bin/env ruby1.9
#encoding: utf-8

puts “✖ ✹ ✚ ✭”

#!/usr/bin/env ruby-2.0

puts “✖ ✹ ✚ ✭”
Little Changes


           __Dir__
          keyword
Similar	
  in	
  func*onality	
  to	
  __FILE__
Shows	
  absolute	
  path	
  to	
  file’s	
  directory
No	
  more	
  clunky	
  File.dirname(__FILE__)
Little Changes


                   .to_h
Follows	
  conven*on	
  started	
  by	
  .to_s,	
  to_i,	
  to_a,	
  etc
Super	
  useful	
  for	
  conver*ng	
  Structs
Little Changes


                   Grab
                   Bag
CGI	
  is	
  now	
  HTML5	
  compa*ble
net/hLp	
  supports	
  Server	
  Name	
  Indica*on	
  (SNI)

Zlib	
  runs	
  outside	
  of	
  the	
  Global	
  Interpreter	
  Lock
Unused	
  variables	
  can	
  be	
  prepended	
  with	
  _	
  to	
  avoid	
  warnings
Ecosystem
Ecosystem


         RubyGems
            2.0
Start	
  of	
  support	
  for	
  stdlib	
  gems
No	
  more	
  out	
  of	
  place	
  requires!	
  MOAR	
  BUNDLAR!

Searching	
  is	
  remote	
  by	
  default
Metadata	
  through	
  Gem::Specifica*on#metadata
Simplified	
  --document/--no-document
No	
  more	
  --no-rdoc --no-ri mantra
Ecosystem


        Bundler
         1.3(.1)
Supports	
  Ruby	
  2.0
Supports	
  Rubygems	
  2.0

Supports	
  Rails	
  4.0
install and update up	
  to	
  150x	
  faster
Support	
  for	
  signed	
  gems!
EcoSystem


               Rails
             4.0 beta
Ruby	
  2.0	
  is	
  the	
  official	
  preferred	
  ruby	
  version
Beta	
  released	
  1	
  day	
  a_er	
  Ruby	
  2.0
gem install rails --version 4.0.0.beta1 --no-document
gem ‘rails’, ‘4.0.0-beta1’
Now what
Thanks


   Any
Questions?

             @gee_forr
             GEE.FORR@GMAIL.COM

More Related Content

Recently uploaded

🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
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
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
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
 
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
 
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
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
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
 
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
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
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
 
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
 
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
 

Recently uploaded (20)

🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
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
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
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
 
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
 
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
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced 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
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
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
 
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
 
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...
 

Featured

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 

Featured (20)

Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 

What's new in Ruby 2.0

  • 1. Ruby 2.0 What’s  new?
  • 2. r ions @ gee_for Interne t Solut About me by I <3 Ru #rub yOnBeer
  • 3. History Install Deep Changes Big Little Changes Changes Eco System
  • 5. Ruby’s History 0.95 Rails  arrives  on  the   scene.  Arguably  the   First  public  release start  of  Ruby’s  rise. Feb 24 Dec 25 Aug 1993 1996 1.2 1999 1.6 Aug 2003 Dec 2007 Dec 21 Dec Sep Dec 13 1995 1998 1.4 2000 2005 I  want  a  language  more   powerful  than  Perl  and   Start  of  Xmas  Tradi.on Language  starts  gaining   Language  hits  the  big   more  OO  than  Python serious  trac.on .me. 1.0 1.8 1.9
  • 6. Ruby’s History Rails  arrives  on  the   scene.  Arguably  the   start  of  Ruby’s  rise. Aug Dec 2003 2007 Dec 13 2.0 2005 nguage  starts  gaining   Feb 24 Start  of  Xmas  Tradi.on the  big   Language  hits   rious  trac.on .me. 2013 1.8 1.9
  • 8. The one tru e way t rue way The one RVM RBENV ✦Update  RVM ✦Update  rbenv ✦rvm install ruby-2.0.0 ✦rbenv install 2.0.0-p0
  • 10. X X X BItmap Garbage Collection X X X
  • 11.
  • 12. 1.9 GC Heap based M&S Ruby  structures  are  divided  in  2     halves,  data  and  flags.  Each   structure  has  its  own  flag.  Mark   phase  trawls  through  heap  and   updates  FL_MARK  flag  in  every   object RString diagram from: http://patshaughnessy.net/2012/3/23/why-you-should-be-excited-about-garbage-collection-in-ruby-2-0
  • 13. 2.0 GC Bitmap marking All  mark  flags  for  heap  move  to   single  dedicated  data  structure.   1  for  In  Use,  0  for  Collectable. Flag  not  wriMen  to  data   structure,  much  more  friendly   to  copy-­‐on-­‐write Heap diagram from: http://patshaughnessy.net/2012/3/23/why-you-should-be-excited-about-garbage-collection-in-ruby-2-0
  • 14. X X X Backward Compatible With 1.9 X X X
  • 15. X X X require() speed improvements X X X
  • 17. X X X Keyword Arguments X X X
  • 18. Big Changes Keyword Arguments def foo(foo: ‘bar’, baz: ‘qux’, **rest) # Do something end foo(baz: ‘noqux’, foo: ‘frob’)
  • 19. X X X Module Prepend X X X
  • 20. Big Changes Module Prepend module IncludableModule def something; end end class MyClass prepend IncludableModule end
  • 21. X X X Lazy Enumerators X X X
  • 22. Big Changes Lazy Enumerators to_infinity = (0..Float::Infinity) beyond = to_infinity.lazy.select do |n| num % 42 == 0 end 100.times do { |n| puts beyond.next }
  • 23. X X X Tracepoint X X X
  • 24. Big Changes Trace Point OO  alterna*ve  to  set_trace_func trace = TracePoint.new(:raise) do |t| puts "Alert: Exception raised!" end trace.enable
  • 25. X X X Refinements X X X
  • 26. Big Changes Refinements * Localised  and  contained  monkey  patching Module MyString refine String do def palindrome? self == self.reverse end end end using MyString # Monkey patch now active for context
  • 28. Little Changes Literal Symbol lists sym_list = %i{eeny meeny miny moe} # => [:eeny, :meeny, :miny, :moe]
  • 29. Little Changes Binary Search haystack = (1..99999999) haystack.bsearch do |needle| needle == 12345 end # => 12345
  • 30. Little Changes UTF-8 On by Default #!/usr/bin/env ruby1.9 #encoding: utf-8 puts “✖ ✹ ✚ ✭” #!/usr/bin/env ruby-2.0 puts “✖ ✹ ✚ ✭”
  • 31. Little Changes __Dir__ keyword Similar  in  func*onality  to  __FILE__ Shows  absolute  path  to  file’s  directory No  more  clunky  File.dirname(__FILE__)
  • 32. Little Changes .to_h Follows  conven*on  started  by  .to_s,  to_i,  to_a,  etc Super  useful  for  conver*ng  Structs
  • 33. Little Changes Grab Bag CGI  is  now  HTML5  compa*ble net/hLp  supports  Server  Name  Indica*on  (SNI) Zlib  runs  outside  of  the  Global  Interpreter  Lock Unused  variables  can  be  prepended  with  _  to  avoid  warnings
  • 35. Ecosystem RubyGems 2.0 Start  of  support  for  stdlib  gems No  more  out  of  place  requires!  MOAR  BUNDLAR! Searching  is  remote  by  default Metadata  through  Gem::Specifica*on#metadata Simplified  --document/--no-document No  more  --no-rdoc --no-ri mantra
  • 36. Ecosystem Bundler 1.3(.1) Supports  Ruby  2.0 Supports  Rubygems  2.0 Supports  Rails  4.0 install and update up  to  150x  faster Support  for  signed  gems!
  • 37. EcoSystem Rails 4.0 beta Ruby  2.0  is  the  official  preferred  ruby  version Beta  released  1  day  a_er  Ruby  2.0 gem install rails --version 4.0.0.beta1 --no-document gem ‘rails’, ‘4.0.0-beta1’
  • 39. Thanks Any Questions? @gee_forr GEE.FORR@GMAIL.COM