Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Ruby 2.5 What's New
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Urabe Shyouhei
November 29, 2017
Technology
1.3k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Ruby 2.5 What's New
Urabe Shyouhei
November 29, 2017
More Decks by Urabe Shyouhei
See All by Urabe Shyouhei
On sending methods
shyouhei
0
730
The send-pop optimisation
shyouhei
2
7.1k
Glitching Ruby Script
shyouhei
2
880
Being an Open Source Developer, at work
shyouhei
11
6.9k
Optimizing Ruby
shyouhei
7
2.7k
Ruby and its evaluation
shyouhei
10
3.1k
Deeper look at RFC7159 the JSON
shyouhei
4
1.8k
What's New in Ruby 2.0
shyouhei
71
25k
Other Decks in Technology
See All in Technology
サービス内で複数のOP・ASを連鎖させる(OAuth/OIDC Numa (Immersion) Workshop 2026)
oidfj
PRO
0
320
最新技術に積極チャレンジ!EKS共通基盤のこれまでとこれから
daitak
0
210
研究開発部の紹介 / Sansan R&D Profile
sansan33
PRO
4
24k
RapidCopy2 Matrix I/Oエンジンによるファイルコピーソフトウェアの設計と実装
kengosawa2
1
450
サイボウズ 開発本部採用ピッチ / Cybozu Engineer Recruit
cybozuinsideout
PRO
12
86k
信頼性はSREだけのものじゃない
hkawaras
0
220
あなたの知らないバージョン命名規則
sat
PRO
2
840
OAuth SPIFFE Client Authentication(OAuth/OIDC Numa (Immersion) Workshop 2026)
oidfj
PRO
0
320
ClaudeCodeでセキュリティ監視業務を半自動化_1年の運用でわかったAIに任せる設計の5つのポイント
kintotechdev
3
760
医療の現場を変革に挑戦した半年間の軌跡 - PythonとAIで現場を変える / From Code to Care
soudai
PRO
1
640
形式手法特論:Hyperproperty とモデル検査 #kernelvm / Kernel VM Study Tokyo 19th
ytaka23
0
850
APIセキュリティを組織で実現するには~注力する点と設計・実装に入れたい対策~
riiimparm
1
400
Featured
See All Featured
Bash Introduction
62gerente
615
220k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
950
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
480
Producing Creativity
orderedlist
PRO
348
40k
Claude Code のすすめ
schroneko
67
230k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.4k
Mobile First: as difficult as doing things right
swwweet
225
10k
Google's AI Overviews - The New Search
badams
0
1.6k
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
450
Art, The Web, and Tiny UX
lynnandtonic
304
22k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
550
Transcript
Urabe, Shyouhei Ruby 2.5 What’s New
·ͣ֓ܗ͔Β
EJ⒎TUBUT ˠ 1585 files changed, 147854 insertions(+), 72571 deletions(-) ˠ
1549 files changed, 120363 insertions(+), 70385 deletions(-) ˠ 2933 files changed, 103658 insertions(+), 62082 deletions(-) ˠ 2263 files changed, 82556 insertions(+), 289978 deletions(-) ˠUSVOL 7061 files changed, 360060 insertions(+), 34025 deletions(-)
None
None
bundler w ͍·ͷͱ͜Ζ͓ͦΒ͘࠷ޙͷඪ४ఴϥΠϒϥϦ w ͔ΒɺઃఆෆཁͰ͍͖ͳΓGemfileΛ ͋Ε ಡΉΑ͏ʹͳΔ
ଞϥΠϒϥϦ • Rubyspec • RDoc 6 (ripper integration) • ERb#result_with_hash
• SecureRandom.alphanumeric • Binding#irb • etc.
ERb#result_with_hash erb = ERb.new("<%= foo %>") erb.result_with_hash(foo: "1") # =>
"1"
SecureRandom.alphanumeric SecureRandom.alphanumeric(32) # => "Xr3GCd3y2wkUgEF9lSh5pD2s5NDpeHSM"
Binding#irb def foo while true do raise unless rand <
0.5 end rescue binding.irb # <= end
ίΞΫϥε • String#delete_prefix / String#delete_suffix • Array#append / Array#prepend •
Dir#children / Dir#each_child • Hash#transform_keys • Kernel#yield_self
String#delete_prefix "log.fluentd.message {...".delete_prefix("log.") # => "fluentd.message {..."
Array#append %w'dolor sit amet'.prepend(%w'lorem ipsum') # => [["lorem", "ipsum"], "dolor",
"sit", "amet"] %w'dolor sit amet'.prepend('lorem', 'ipsum') # => ["lorem", "ipsum", "dolor", "sit", "amet"]
Hash#transform_keys {foo: 'bar'}.transform_keys(&:to_s) # => {"foo"=>"bar"}
Kernel#yield_self {foo: 'bar'}.yield_self {|i| JSON.dump(i) } # => "{\"foo\":\"bar\"}"
จ๏ͱ͔ • do … rescue … end • Toplevel constant
lookup removal • Reverse backtrace order
do … rescue … end 128.times do |i| raise unless
rand < 0.5 rescue RuntimeError puts $! end
Reverse backtrace zsh % ruby -e 'def foo; bar; end'
-e 'def bar; raise; end' -e 'foo' Traceback (most recent call last): 2: from -e:3:in `<main>' 1: from -e:1:in `foo' -e:2:in `bar': unhandled exception [1] 34131 exit 1 ruby -e ‘…’ zsh % ruby -e 'def foo; bar; end' -e 'def bar; raise; end' -e 'foo' 2>&1 | cat -e:2:in `bar': unhandled exception from -e:1:in `foo' from -e:3:in `<main>' [1] 34291 exit 1 ruby -e ‘…’ 2>&1 | 34292 done cat