SlideShare a Scribd company logo
RUBY 2.5
IRENEUSZ SKROBIŚ
Lead developer @ SELLEO
AGENDA
AGENDA
new features
AGENDA
new features
performance
improvements
AGENDA
new features
performance
improvements
other notable
changes
New features
1
rescue/else/ensure are now allowed
to be used directly with do/end blocks
AFTER:
lambda do
raise 'err'
rescue
$! # => #<RuntimeError: err>
end.call
BEFORE:
lambda do
begin
raise 'err'
rescue
$! # => #<RuntimeError: err>
end
end.call
Add yield_self to yield given block in its context
class Object
def yield_self(*args)
yield(self, *args)
end
end
2.yield_self { |x| x*x } # => 4
Hash#slice & Hash#except
{ a: 1, b: 2, c: 3, d: 4 }.slice(:a, :b)
# => { a: 1, b: 2 }
{ a: 1, b: 2, c: 3, d: 4 }.except(:a, :b)
# => { c: 3, d: 4 }
Hash#transform_keys
{ a: 1, b: 2 }.transform_keys { |k| k.to_s }
=> { "a"=>1, "b"=>2 }
Struct.new can create classes that accept keyword arguments
Point = Struct.new(:x, :y, :color)
point1 = Point.create(x: 1, y: 2)
# => Point<x: 1, y: 2, color: nil>
point2 = Point.create!(x: 1, y: 2)
# => ArgumentError, color not specified.
Enumerable#any?, all?, none?, and one? accept a pattern argument
[1, 3.14, 2ri].all?(Numeric) # => true
if should_be_all_symbols.any?(String)
...
end
some_strings.none?(/aeiou/i)
Array#prepend/append as aliases of unshift/push
array = [3, 4]
array.prepend(1, 2) #=> [1, 2, 3, 4]
array #=> [1, 2, 3, 4]
array = [1, 2]
array.append(3, 4) #=> [1, 2, 3, 4]
array #=> [1, 2, 3, 4]
Top-level constant look-up is no longer available
# this is removed:
irb(main):001:0> class Auth; end
=> nil
irb(main):002:0> class Twitter; end
=> nil
irb(main):003:0> Twitter::Auth
(irb):3: warning: toplevel constant Auth referenced by Twitter::Auth
=> Auth
Print backtrace and error message in reverse order
AFTER:
stack frame 3
stack frame 2
stack frame 1
Main Error Message
.....
BEFORE:
Main Error Message
stack frame 1
stack frame 2
stack frame 3
.....
Performance improvements
2
Performance improvements
◉ About 5-10% performance improvement by removing all
trace instructions from overall bytecode (instruction
sequences)
Performance improvements
◉ About 5-10% performance improvement by removing all
trace instructions from overall bytecode (instruction
sequences)
◉ Block passing by a block parameter
(e.g. def foo(&b); bar(&b); end)
is about 3 times faster than Ruby 2.4
Performance improvements
◉ About 5-10% performance improvement by removing all
trace instructions from overall bytecode (instruction
sequences)
◉ Block passing by a block parameter
(e.g. def foo(&b); bar(&b); end)
is about 3 times faster than Ruby 2.4
◉ ERB now generates code from a template twice as fast as
Ruby 2.4
Performance improvements
◉ About 5-10% performance improvement by removing all
trace instructions from overall bytecode (instruction
sequences)
◉ Block passing by a block parameter
(e.g. def foo(&b); bar(&b); end)
is about 3 times faster than Ruby 2.4
◉ ERB now generates code from a template twice as fast as
Ruby 2.4
◉ (and more…)
Other notable changes
3
Other notable changes
◉ Thread.report_on_exception is now set to true by default.
Other notable changes
◉ Thread.report_on_exception is now set to true by default.
◉ SecureRandom now prefers OS-provided sources over
OpenSSL
Other notable changes
◉ Thread.report_on_exception is now set to true by default.
◉ SecureRandom now prefers OS-provided sources over
OpenSSL
◉ Promote cmath, csv, date, dbm, etc, fcntl, fiddle, fileutils,
gdbm, ipaddr, scanf, sdbm, stringio, strscan, webrick, zlib
from standard libraries to default gems.
Other notable changes
◉ Thread.report_on_exception is now set to true by default.
◉ SecureRandom now prefers OS-provided sources over
OpenSSL
◉ Promote cmath, csv, date, dbm, etc, fcntl, fiddle, fileutils,
gdbm, ipaddr, scanf, sdbm, stringio, strscan, webrick, zlib
from standard libraries to default gems.
◉ Update supported Unicode version to 10.0.0.
Other notable changes
◉ Thread.report_on_exception is now set to true by default.
◉ SecureRandom now prefers OS-provided sources over
OpenSSL
◉ Promote cmath, csv, date, dbm, etc, fcntl, fiddle, fileutils,
gdbm, ipaddr, scanf, sdbm, stringio, strscan, webrick, zlib
from standard libraries to default gems.
◉ Update supported Unicode version to 10.0.0.
◉ Update to RubyGems 2.7.3, RDoc 6.0.1.
Other notable changes
◉ Thread.report_on_exception is now set to true by default.
◉ SecureRandom now prefers OS-provided sources over
OpenSSL
◉ Promote cmath, csv, date, dbm, etc, fcntl, fiddle, fileutils,
gdbm, ipaddr, scanf, sdbm, stringio, strscan, webrick, zlib
from standard libraries to default gems.
◉ Update supported Unicode version to 10.0.0.
◉ Update to RubyGems 2.7.3, RDoc 6.0.1.
◉ (and more…)
SUMMARY
new features
performance
improvements
other notable
changes
THANKS!
Live long and prosper :)
Ireneusz Skrobiś
@ireneuszskrobis

More Related Content

What's hot

Devel::NYTProf 2009-07 (OUTDATED, see 201008)
Devel::NYTProf 2009-07 (OUTDATED, see 201008)Devel::NYTProf 2009-07 (OUTDATED, see 201008)
Devel::NYTProf 2009-07 (OUTDATED, see 201008)
Tim Bunce
 
PL/Perl - New Features in PostgreSQL 9.0
PL/Perl - New Features in PostgreSQL 9.0PL/Perl - New Features in PostgreSQL 9.0
PL/Perl - New Features in PostgreSQL 9.0
Tim Bunce
 
Fabric Fast & Furious edition
Fabric Fast & Furious editionFabric Fast & Furious edition
Fabric Fast & Furious edition
Alejandro E Brito Monedero
 
Terraform Immutablish Infrastructure with Consul-Template
Terraform Immutablish Infrastructure with Consul-TemplateTerraform Immutablish Infrastructure with Consul-Template
Terraform Immutablish Infrastructure with Consul-Template
Zane Williamson
 
Setup 3 Node Kafka Cluster on AWS - Hands On
Setup 3 Node Kafka Cluster on AWS - Hands OnSetup 3 Node Kafka Cluster on AWS - Hands On
Setup 3 Node Kafka Cluster on AWS - Hands On
hkbhadraa
 
Capistrano, Puppet, and Chef
Capistrano, Puppet, and ChefCapistrano, Puppet, and Chef
Capistrano, Puppet, and Chef
David Benjamin
 
Exploring Code with Pry!
Exploring Code with Pry!Exploring Code with Pry!
Exploring Code with Pry!
Clayton Parker
 
Powershell alias
Powershell aliasPowershell alias
Powershell alias
LearningTech
 
Working with databases in Perl
Working with databases in PerlWorking with databases in Perl
Working with databases in Perl
Laurent Dami
 
Server::Starter meets Java
Server::Starter meets JavaServer::Starter meets Java
Server::Starter meets Java
Tokuhiro Matsuno
 
Stackless Python In Eve
Stackless Python In EveStackless Python In Eve
Stackless Python In Eve
l xf
 
Tuning Solr for Logs
Tuning Solr for LogsTuning Solr for Logs
Tuning Solr for Logs
Sematext Group, Inc.
 
CoreOS + Kubernetes @ All Things Open 2015
CoreOS + Kubernetes @ All Things Open 2015CoreOS + Kubernetes @ All Things Open 2015
CoreOS + Kubernetes @ All Things Open 2015
Brandon Philips
 
Real Time Analytics - Stream Processing (Colombo big data meetup 18/05/2017)
Real Time Analytics - Stream Processing (Colombo big data meetup 18/05/2017)Real Time Analytics - Stream Processing (Colombo big data meetup 18/05/2017)
Real Time Analytics - Stream Processing (Colombo big data meetup 18/05/2017)
mahesh madushanka
 
Deploy, Scale and Sleep at Night with JRuby
Deploy, Scale and Sleep at Night with JRubyDeploy, Scale and Sleep at Night with JRuby
Deploy, Scale and Sleep at Night with JRuby
Joe Kutner
 
I/O, You Own: Regaining Control of Your Disk in the Presence of Bootkits
I/O, You Own: Regaining Control of Your Disk in the Presence of BootkitsI/O, You Own: Regaining Control of Your Disk in the Presence of Bootkits
I/O, You Own: Regaining Control of Your Disk in the Presence of Bootkits
CrowdStrike
 
PHP Optimization
PHP OptimizationPHP Optimization
PHP Optimization
djesch
 
Power of Puppet 4
Power of Puppet 4Power of Puppet 4
Power of Puppet 4
Martin Alfke
 
JavaOne 2015 Java Mixed-Mode Flame Graphs
JavaOne 2015 Java Mixed-Mode Flame GraphsJavaOne 2015 Java Mixed-Mode Flame Graphs
JavaOne 2015 Java Mixed-Mode Flame Graphs
Brendan Gregg
 
Mysqlnd, an unknown powerful PHP extension
Mysqlnd, an unknown powerful PHP extensionMysqlnd, an unknown powerful PHP extension
Mysqlnd, an unknown powerful PHP extension
julien pauli
 

What's hot (20)

Devel::NYTProf 2009-07 (OUTDATED, see 201008)
Devel::NYTProf 2009-07 (OUTDATED, see 201008)Devel::NYTProf 2009-07 (OUTDATED, see 201008)
Devel::NYTProf 2009-07 (OUTDATED, see 201008)
 
PL/Perl - New Features in PostgreSQL 9.0
PL/Perl - New Features in PostgreSQL 9.0PL/Perl - New Features in PostgreSQL 9.0
PL/Perl - New Features in PostgreSQL 9.0
 
Fabric Fast & Furious edition
Fabric Fast & Furious editionFabric Fast & Furious edition
Fabric Fast & Furious edition
 
Terraform Immutablish Infrastructure with Consul-Template
Terraform Immutablish Infrastructure with Consul-TemplateTerraform Immutablish Infrastructure with Consul-Template
Terraform Immutablish Infrastructure with Consul-Template
 
Setup 3 Node Kafka Cluster on AWS - Hands On
Setup 3 Node Kafka Cluster on AWS - Hands OnSetup 3 Node Kafka Cluster on AWS - Hands On
Setup 3 Node Kafka Cluster on AWS - Hands On
 
Capistrano, Puppet, and Chef
Capistrano, Puppet, and ChefCapistrano, Puppet, and Chef
Capistrano, Puppet, and Chef
 
Exploring Code with Pry!
Exploring Code with Pry!Exploring Code with Pry!
Exploring Code with Pry!
 
Powershell alias
Powershell aliasPowershell alias
Powershell alias
 
Working with databases in Perl
Working with databases in PerlWorking with databases in Perl
Working with databases in Perl
 
Server::Starter meets Java
Server::Starter meets JavaServer::Starter meets Java
Server::Starter meets Java
 
Stackless Python In Eve
Stackless Python In EveStackless Python In Eve
Stackless Python In Eve
 
Tuning Solr for Logs
Tuning Solr for LogsTuning Solr for Logs
Tuning Solr for Logs
 
CoreOS + Kubernetes @ All Things Open 2015
CoreOS + Kubernetes @ All Things Open 2015CoreOS + Kubernetes @ All Things Open 2015
CoreOS + Kubernetes @ All Things Open 2015
 
Real Time Analytics - Stream Processing (Colombo big data meetup 18/05/2017)
Real Time Analytics - Stream Processing (Colombo big data meetup 18/05/2017)Real Time Analytics - Stream Processing (Colombo big data meetup 18/05/2017)
Real Time Analytics - Stream Processing (Colombo big data meetup 18/05/2017)
 
Deploy, Scale and Sleep at Night with JRuby
Deploy, Scale and Sleep at Night with JRubyDeploy, Scale and Sleep at Night with JRuby
Deploy, Scale and Sleep at Night with JRuby
 
I/O, You Own: Regaining Control of Your Disk in the Presence of Bootkits
I/O, You Own: Regaining Control of Your Disk in the Presence of BootkitsI/O, You Own: Regaining Control of Your Disk in the Presence of Bootkits
I/O, You Own: Regaining Control of Your Disk in the Presence of Bootkits
 
PHP Optimization
PHP OptimizationPHP Optimization
PHP Optimization
 
Power of Puppet 4
Power of Puppet 4Power of Puppet 4
Power of Puppet 4
 
JavaOne 2015 Java Mixed-Mode Flame Graphs
JavaOne 2015 Java Mixed-Mode Flame GraphsJavaOne 2015 Java Mixed-Mode Flame Graphs
JavaOne 2015 Java Mixed-Mode Flame Graphs
 
Mysqlnd, an unknown powerful PHP extension
Mysqlnd, an unknown powerful PHP extensionMysqlnd, an unknown powerful PHP extension
Mysqlnd, an unknown powerful PHP extension
 

Similar to New features in Ruby 2.5

Course 102: Lecture 8: Composite Commands
Course 102: Lecture 8: Composite Commands Course 102: Lecture 8: Composite Commands
Course 102: Lecture 8: Composite Commands
Ahmed El-Arabawy
 
Testing NodeJS with Mocha, Should, Sinon, and JSCoverage
Testing NodeJS with Mocha, Should, Sinon, and JSCoverageTesting NodeJS with Mocha, Should, Sinon, and JSCoverage
Testing NodeJS with Mocha, Should, Sinon, and JSCoverage
mlilley
 
More on bpftrace for MariaDB DBAs and Developers - FOSDEM 2022 MariaDB Devroom
More on bpftrace for MariaDB DBAs and Developers - FOSDEM 2022 MariaDB DevroomMore on bpftrace for MariaDB DBAs and Developers - FOSDEM 2022 MariaDB Devroom
More on bpftrace for MariaDB DBAs and Developers - FOSDEM 2022 MariaDB Devroom
Valeriy Kravchuk
 
The Hitchhiker's Guide to Faster Builds. Viktor Kirilov. CoreHard Spring 2019
The Hitchhiker's Guide to Faster Builds. Viktor Kirilov. CoreHard Spring 2019The Hitchhiker's Guide to Faster Builds. Viktor Kirilov. CoreHard Spring 2019
The Hitchhiker's Guide to Faster Builds. Viktor Kirilov. CoreHard Spring 2019
corehard_by
 
Toolbox of a Ruby Team
Toolbox of a Ruby TeamToolbox of a Ruby Team
Toolbox of a Ruby Team
Arto Artnik
 
CoreOS, or How I Learned to Stop Worrying and Love Systemd
CoreOS, or How I Learned to Stop Worrying and Love SystemdCoreOS, or How I Learned to Stop Worrying and Love Systemd
CoreOS, or How I Learned to Stop Worrying and Love Systemd
Richard Lister
 
Gun make
Gun makeGun make
Infrastructureascode slideshare-160331143725
Infrastructureascode slideshare-160331143725Infrastructureascode slideshare-160331143725
Infrastructureascode slideshare-160331143725
miguel dominguez
 
Infrastructureascode slideshare-160331143725
Infrastructureascode slideshare-160331143725Infrastructureascode slideshare-160331143725
Infrastructureascode slideshare-160331143725
MortazaJohari
 
Infrastructure as code: running microservices on AWS using Docker, Terraform,...
Infrastructure as code: running microservices on AWS using Docker, Terraform,...Infrastructure as code: running microservices on AWS using Docker, Terraform,...
Infrastructure as code: running microservices on AWS using Docker, Terraform,...
Yevgeniy Brikman
 
stackconf 2022: Cluster Management: Heterogeneous, Lightweight, Safe. Pick Three
stackconf 2022: Cluster Management: Heterogeneous, Lightweight, Safe. Pick Threestackconf 2022: Cluster Management: Heterogeneous, Lightweight, Safe. Pick Three
stackconf 2022: Cluster Management: Heterogeneous, Lightweight, Safe. Pick Three
NETWAYS
 
running stable diffusion on android
running stable diffusion on androidrunning stable diffusion on android
running stable diffusion on android
Koan-Sin Tan
 
TorqueBox: The beauty of Ruby with the power of JBoss. Presented at Devnexus...
TorqueBox: The beauty of Ruby with the power of JBoss.  Presented at Devnexus...TorqueBox: The beauty of Ruby with the power of JBoss.  Presented at Devnexus...
TorqueBox: The beauty of Ruby with the power of JBoss. Presented at Devnexus...
bobmcwhirter
 
Debugging Python with gdb
Debugging Python with gdbDebugging Python with gdb
Debugging Python with gdb
Roman Podoliaka
 
The why and how of moving to PHP 5.5/5.6
The why and how of moving to PHP 5.5/5.6The why and how of moving to PHP 5.5/5.6
The why and how of moving to PHP 5.5/5.6
Wim Godden
 
Python Deployment with Fabric
Python Deployment with FabricPython Deployment with Fabric
Python Deployment with Fabric
andymccurdy
 
How it's made: C++ compilers (GCC)
How it's made: C++ compilers (GCC)How it's made: C++ compilers (GCC)
How it's made: C++ compilers (GCC)
Sławomir Zborowski
 
Functional Smalltalk
Functional SmalltalkFunctional Smalltalk
Functional Smalltalk
ESUG
 
Live deployment, ci, drupal
Live deployment, ci, drupalLive deployment, ci, drupal
Live deployment, ci, drupal
Andrii Podanenko
 
Terraform Modules and Continuous Deployment
Terraform Modules and Continuous DeploymentTerraform Modules and Continuous Deployment
Terraform Modules and Continuous Deployment
Zane Williamson
 

Similar to New features in Ruby 2.5 (20)

Course 102: Lecture 8: Composite Commands
Course 102: Lecture 8: Composite Commands Course 102: Lecture 8: Composite Commands
Course 102: Lecture 8: Composite Commands
 
Testing NodeJS with Mocha, Should, Sinon, and JSCoverage
Testing NodeJS with Mocha, Should, Sinon, and JSCoverageTesting NodeJS with Mocha, Should, Sinon, and JSCoverage
Testing NodeJS with Mocha, Should, Sinon, and JSCoverage
 
More on bpftrace for MariaDB DBAs and Developers - FOSDEM 2022 MariaDB Devroom
More on bpftrace for MariaDB DBAs and Developers - FOSDEM 2022 MariaDB DevroomMore on bpftrace for MariaDB DBAs and Developers - FOSDEM 2022 MariaDB Devroom
More on bpftrace for MariaDB DBAs and Developers - FOSDEM 2022 MariaDB Devroom
 
The Hitchhiker's Guide to Faster Builds. Viktor Kirilov. CoreHard Spring 2019
The Hitchhiker's Guide to Faster Builds. Viktor Kirilov. CoreHard Spring 2019The Hitchhiker's Guide to Faster Builds. Viktor Kirilov. CoreHard Spring 2019
The Hitchhiker's Guide to Faster Builds. Viktor Kirilov. CoreHard Spring 2019
 
Toolbox of a Ruby Team
Toolbox of a Ruby TeamToolbox of a Ruby Team
Toolbox of a Ruby Team
 
CoreOS, or How I Learned to Stop Worrying and Love Systemd
CoreOS, or How I Learned to Stop Worrying and Love SystemdCoreOS, or How I Learned to Stop Worrying and Love Systemd
CoreOS, or How I Learned to Stop Worrying and Love Systemd
 
Gun make
Gun makeGun make
Gun make
 
Infrastructureascode slideshare-160331143725
Infrastructureascode slideshare-160331143725Infrastructureascode slideshare-160331143725
Infrastructureascode slideshare-160331143725
 
Infrastructureascode slideshare-160331143725
Infrastructureascode slideshare-160331143725Infrastructureascode slideshare-160331143725
Infrastructureascode slideshare-160331143725
 
Infrastructure as code: running microservices on AWS using Docker, Terraform,...
Infrastructure as code: running microservices on AWS using Docker, Terraform,...Infrastructure as code: running microservices on AWS using Docker, Terraform,...
Infrastructure as code: running microservices on AWS using Docker, Terraform,...
 
stackconf 2022: Cluster Management: Heterogeneous, Lightweight, Safe. Pick Three
stackconf 2022: Cluster Management: Heterogeneous, Lightweight, Safe. Pick Threestackconf 2022: Cluster Management: Heterogeneous, Lightweight, Safe. Pick Three
stackconf 2022: Cluster Management: Heterogeneous, Lightweight, Safe. Pick Three
 
running stable diffusion on android
running stable diffusion on androidrunning stable diffusion on android
running stable diffusion on android
 
TorqueBox: The beauty of Ruby with the power of JBoss. Presented at Devnexus...
TorqueBox: The beauty of Ruby with the power of JBoss.  Presented at Devnexus...TorqueBox: The beauty of Ruby with the power of JBoss.  Presented at Devnexus...
TorqueBox: The beauty of Ruby with the power of JBoss. Presented at Devnexus...
 
Debugging Python with gdb
Debugging Python with gdbDebugging Python with gdb
Debugging Python with gdb
 
The why and how of moving to PHP 5.5/5.6
The why and how of moving to PHP 5.5/5.6The why and how of moving to PHP 5.5/5.6
The why and how of moving to PHP 5.5/5.6
 
Python Deployment with Fabric
Python Deployment with FabricPython Deployment with Fabric
Python Deployment with Fabric
 
How it's made: C++ compilers (GCC)
How it's made: C++ compilers (GCC)How it's made: C++ compilers (GCC)
How it's made: C++ compilers (GCC)
 
Functional Smalltalk
Functional SmalltalkFunctional Smalltalk
Functional Smalltalk
 
Live deployment, ci, drupal
Live deployment, ci, drupalLive deployment, ci, drupal
Live deployment, ci, drupal
 
Terraform Modules and Continuous Deployment
Terraform Modules and Continuous DeploymentTerraform Modules and Continuous Deployment
Terraform Modules and Continuous Deployment
 

More from Ireneusz Skrobiś

Bugs and non-technical client
Bugs and non-technical clientBugs and non-technical client
Bugs and non-technical client
Ireneusz Skrobiś
 
PayPal Subscriptions in Ruby on Rails application
PayPal Subscriptions in Ruby on Rails applicationPayPal Subscriptions in Ruby on Rails application
PayPal Subscriptions in Ruby on Rails application
Ireneusz Skrobiś
 
How to introduce a new developer to a project.
How to introduce a new developer to a project.How to introduce a new developer to a project.
How to introduce a new developer to a project.
Ireneusz Skrobiś
 
Geolocation Databases in Ruby on Rails
Geolocation Databases in Ruby on RailsGeolocation Databases in Ruby on Rails
Geolocation Databases in Ruby on Rails
Ireneusz Skrobiś
 
New features in Ruby 2.4
New features in Ruby 2.4New features in Ruby 2.4
New features in Ruby 2.4
Ireneusz Skrobiś
 
Geocoding with Rails and Twitter Typeahead
Geocoding with Rails and Twitter TypeaheadGeocoding with Rails and Twitter Typeahead
Geocoding with Rails and Twitter Typeahead
Ireneusz Skrobiś
 
LOL vs Dota2: Battle Of APIs
LOL vs Dota2: Battle Of APIsLOL vs Dota2: Battle Of APIs
LOL vs Dota2: Battle Of APIs
Ireneusz Skrobiś
 
What to do when there is no API
What to do when there is no APIWhat to do when there is no API
What to do when there is no API
Ireneusz Skrobiś
 

More from Ireneusz Skrobiś (8)

Bugs and non-technical client
Bugs and non-technical clientBugs and non-technical client
Bugs and non-technical client
 
PayPal Subscriptions in Ruby on Rails application
PayPal Subscriptions in Ruby on Rails applicationPayPal Subscriptions in Ruby on Rails application
PayPal Subscriptions in Ruby on Rails application
 
How to introduce a new developer to a project.
How to introduce a new developer to a project.How to introduce a new developer to a project.
How to introduce a new developer to a project.
 
Geolocation Databases in Ruby on Rails
Geolocation Databases in Ruby on RailsGeolocation Databases in Ruby on Rails
Geolocation Databases in Ruby on Rails
 
New features in Ruby 2.4
New features in Ruby 2.4New features in Ruby 2.4
New features in Ruby 2.4
 
Geocoding with Rails and Twitter Typeahead
Geocoding with Rails and Twitter TypeaheadGeocoding with Rails and Twitter Typeahead
Geocoding with Rails and Twitter Typeahead
 
LOL vs Dota2: Battle Of APIs
LOL vs Dota2: Battle Of APIsLOL vs Dota2: Battle Of APIs
LOL vs Dota2: Battle Of APIs
 
What to do when there is no API
What to do when there is no APIWhat to do when there is no API
What to do when there is no API
 

Recently uploaded

Curve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods RegressionCurve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods Regression
Nada Hikmah
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
insn4465
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
IJECEIAES
 
Computational Engineering IITH Presentation
Computational Engineering IITH PresentationComputational Engineering IITH Presentation
Computational Engineering IITH Presentation
co23btech11018
 
gray level transformation unit 3(image processing))
gray level transformation unit 3(image processing))gray level transformation unit 3(image processing))
gray level transformation unit 3(image processing))
shivani5543
 
Textile Chemical Processing and Dyeing.pdf
Textile Chemical Processing and Dyeing.pdfTextile Chemical Processing and Dyeing.pdf
Textile Chemical Processing and Dyeing.pdf
NazakatAliKhoso2
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
VICTOR MAESTRE RAMIREZ
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
kandramariana6
 
International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...
gerogepatton
 
Engine Lubrication performance System.pdf
Engine Lubrication performance System.pdfEngine Lubrication performance System.pdf
Engine Lubrication performance System.pdf
mamamaam477
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
MDSABBIROJJAMANPAYEL
 
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
Yasser Mahgoub
 
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURSCompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
RamonNovais6
 
spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
Madan Karki
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
Hitesh Mohapatra
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
SUTEJAS
 
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by AnantLLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
Anant Corporation
 
Certificates - Mahmoud Mohamed Moursi Ahmed
Certificates - Mahmoud Mohamed Moursi AhmedCertificates - Mahmoud Mohamed Moursi Ahmed
Certificates - Mahmoud Mohamed Moursi Ahmed
Mahmoud Morsy
 
BRAIN TUMOR DETECTION for seminar ppt.pdf
BRAIN TUMOR DETECTION for seminar ppt.pdfBRAIN TUMOR DETECTION for seminar ppt.pdf
BRAIN TUMOR DETECTION for seminar ppt.pdf
LAXMAREDDY22
 
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
171ticu
 

Recently uploaded (20)

Curve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods RegressionCurve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods Regression
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
 
Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...Advanced control scheme of doubly fed induction generator for wind turbine us...
Advanced control scheme of doubly fed induction generator for wind turbine us...
 
Computational Engineering IITH Presentation
Computational Engineering IITH PresentationComputational Engineering IITH Presentation
Computational Engineering IITH Presentation
 
gray level transformation unit 3(image processing))
gray level transformation unit 3(image processing))gray level transformation unit 3(image processing))
gray level transformation unit 3(image processing))
 
Textile Chemical Processing and Dyeing.pdf
Textile Chemical Processing and Dyeing.pdfTextile Chemical Processing and Dyeing.pdf
Textile Chemical Processing and Dyeing.pdf
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
 
132/33KV substation case study Presentation
132/33KV substation case study Presentation132/33KV substation case study Presentation
132/33KV substation case study Presentation
 
International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...International Conference on NLP, Artificial Intelligence, Machine Learning an...
International Conference on NLP, Artificial Intelligence, Machine Learning an...
 
Engine Lubrication performance System.pdf
Engine Lubrication performance System.pdfEngine Lubrication performance System.pdf
Engine Lubrication performance System.pdf
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
 
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 02 The Building.pdf
 
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURSCompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
CompEx~Manual~1210 (2).pdf COMPEX GAS AND VAPOURS
 
spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
 
Generative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of contentGenerative AI leverages algorithms to create various forms of content
Generative AI leverages algorithms to create various forms of content
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
 
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by AnantLLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
 
Certificates - Mahmoud Mohamed Moursi Ahmed
Certificates - Mahmoud Mohamed Moursi AhmedCertificates - Mahmoud Mohamed Moursi Ahmed
Certificates - Mahmoud Mohamed Moursi Ahmed
 
BRAIN TUMOR DETECTION for seminar ppt.pdf
BRAIN TUMOR DETECTION for seminar ppt.pdfBRAIN TUMOR DETECTION for seminar ppt.pdf
BRAIN TUMOR DETECTION for seminar ppt.pdf
 
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样官方认证美国密歇根州立大学毕业证学位证书原版一模一样
官方认证美国密歇根州立大学毕业证学位证书原版一模一样
 

New features in Ruby 2.5

  • 1. RUBY 2.5 IRENEUSZ SKROBIŚ Lead developer @ SELLEO
  • 7. rescue/else/ensure are now allowed to be used directly with do/end blocks AFTER: lambda do raise 'err' rescue $! # => #<RuntimeError: err> end.call BEFORE: lambda do begin raise 'err' rescue $! # => #<RuntimeError: err> end end.call
  • 8. Add yield_self to yield given block in its context class Object def yield_self(*args) yield(self, *args) end end 2.yield_self { |x| x*x } # => 4
  • 9. Hash#slice & Hash#except { a: 1, b: 2, c: 3, d: 4 }.slice(:a, :b) # => { a: 1, b: 2 } { a: 1, b: 2, c: 3, d: 4 }.except(:a, :b) # => { c: 3, d: 4 }
  • 10. Hash#transform_keys { a: 1, b: 2 }.transform_keys { |k| k.to_s } => { "a"=>1, "b"=>2 }
  • 11. Struct.new can create classes that accept keyword arguments Point = Struct.new(:x, :y, :color) point1 = Point.create(x: 1, y: 2) # => Point<x: 1, y: 2, color: nil> point2 = Point.create!(x: 1, y: 2) # => ArgumentError, color not specified.
  • 12. Enumerable#any?, all?, none?, and one? accept a pattern argument [1, 3.14, 2ri].all?(Numeric) # => true if should_be_all_symbols.any?(String) ... end some_strings.none?(/aeiou/i)
  • 13. Array#prepend/append as aliases of unshift/push array = [3, 4] array.prepend(1, 2) #=> [1, 2, 3, 4] array #=> [1, 2, 3, 4] array = [1, 2] array.append(3, 4) #=> [1, 2, 3, 4] array #=> [1, 2, 3, 4]
  • 14. Top-level constant look-up is no longer available # this is removed: irb(main):001:0> class Auth; end => nil irb(main):002:0> class Twitter; end => nil irb(main):003:0> Twitter::Auth (irb):3: warning: toplevel constant Auth referenced by Twitter::Auth => Auth
  • 15. Print backtrace and error message in reverse order AFTER: stack frame 3 stack frame 2 stack frame 1 Main Error Message ..... BEFORE: Main Error Message stack frame 1 stack frame 2 stack frame 3 .....
  • 17. Performance improvements ◉ About 5-10% performance improvement by removing all trace instructions from overall bytecode (instruction sequences)
  • 18. Performance improvements ◉ About 5-10% performance improvement by removing all trace instructions from overall bytecode (instruction sequences) ◉ Block passing by a block parameter (e.g. def foo(&b); bar(&b); end) is about 3 times faster than Ruby 2.4
  • 19. Performance improvements ◉ About 5-10% performance improvement by removing all trace instructions from overall bytecode (instruction sequences) ◉ Block passing by a block parameter (e.g. def foo(&b); bar(&b); end) is about 3 times faster than Ruby 2.4 ◉ ERB now generates code from a template twice as fast as Ruby 2.4
  • 20. Performance improvements ◉ About 5-10% performance improvement by removing all trace instructions from overall bytecode (instruction sequences) ◉ Block passing by a block parameter (e.g. def foo(&b); bar(&b); end) is about 3 times faster than Ruby 2.4 ◉ ERB now generates code from a template twice as fast as Ruby 2.4 ◉ (and more…)
  • 22. Other notable changes ◉ Thread.report_on_exception is now set to true by default.
  • 23. Other notable changes ◉ Thread.report_on_exception is now set to true by default. ◉ SecureRandom now prefers OS-provided sources over OpenSSL
  • 24. Other notable changes ◉ Thread.report_on_exception is now set to true by default. ◉ SecureRandom now prefers OS-provided sources over OpenSSL ◉ Promote cmath, csv, date, dbm, etc, fcntl, fiddle, fileutils, gdbm, ipaddr, scanf, sdbm, stringio, strscan, webrick, zlib from standard libraries to default gems.
  • 25. Other notable changes ◉ Thread.report_on_exception is now set to true by default. ◉ SecureRandom now prefers OS-provided sources over OpenSSL ◉ Promote cmath, csv, date, dbm, etc, fcntl, fiddle, fileutils, gdbm, ipaddr, scanf, sdbm, stringio, strscan, webrick, zlib from standard libraries to default gems. ◉ Update supported Unicode version to 10.0.0.
  • 26. Other notable changes ◉ Thread.report_on_exception is now set to true by default. ◉ SecureRandom now prefers OS-provided sources over OpenSSL ◉ Promote cmath, csv, date, dbm, etc, fcntl, fiddle, fileutils, gdbm, ipaddr, scanf, sdbm, stringio, strscan, webrick, zlib from standard libraries to default gems. ◉ Update supported Unicode version to 10.0.0. ◉ Update to RubyGems 2.7.3, RDoc 6.0.1.
  • 27. Other notable changes ◉ Thread.report_on_exception is now set to true by default. ◉ SecureRandom now prefers OS-provided sources over OpenSSL ◉ Promote cmath, csv, date, dbm, etc, fcntl, fiddle, fileutils, gdbm, ipaddr, scanf, sdbm, stringio, strscan, webrick, zlib from standard libraries to default gems. ◉ Update supported Unicode version to 10.0.0. ◉ Update to RubyGems 2.7.3, RDoc 6.0.1. ◉ (and more…)
  • 29. THANKS! Live long and prosper :) Ireneusz Skrobiś @ireneuszskrobis