Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
Ruby 2.5 What's New
Urabe Shyouhei
November 29, 2017
Technology
0
1.1k
Ruby 2.5 What's New
Urabe Shyouhei
November 29, 2017
Tweet
Share
More Decks by Urabe Shyouhei
See All by Urabe Shyouhei
On sending methods
shyouhei
0
460
The send-pop optimisation
shyouhei
2
5.7k
Glitching Ruby Script
shyouhei
2
570
Being an Open Source Developer, at work
shyouhei
11
6k
Optimizing Ruby
shyouhei
7
1.8k
Ruby and its evaluation
shyouhei
10
2.6k
Deeper look at RFC7159 the JSON
shyouhei
4
1.2k
What's New in Ruby 2.0
shyouhei
72
24k
Other Decks in Technology
See All in Technology
Stripe / Okta Customer Identity Cloud(旧Auth0) の採用に至った理由 〜モリサワの SaaS 戦略〜
tomuro
0
140
YouTuber も編集マンもクラウド使って編集しよう。クラウド編集のキホン
eijikominami
0
130
MoT/コネヒト/Kanmu が語るプロダクト開発xデータ分析 - 分析から機械学習システムの開発まで一人で複数ロールを担う大変さ
masatakashiwagi
3
810
MLOps Workshopでの学びと弥生の研究開発基盤 / takeaways from MLOps workshop and YAYOI's research and development infrastructure
yayoi_dd
0
220
macOSの更新を促す通知機能 を実装してみた
shimosyan
1
100
SSMパラメーターストアでクロススタック参照の罠を回避する
shuyakinjo
0
8k
FlexScan HD2452Wの 後継を探して
tring
0
6.6k
Bill One 開発エンジニア 紹介資料
sansantech
PRO
0
130
DNS権威サーバのクラウドサービス向けに行われた攻撃および対策 / DNS Pseudo-Random Subdomain Attack and mitigations
kazeburo
5
1.4k
OpenShiftのリリースノートを整理してみた
loftkun
2
460
インフラ技術基礎勉強会 開催概要
toru_kubota
0
190
モバイルモーションキャプチャーデバイス「mocopi」を軽く試してみた / IoTLT vol.95 (新年会IoTLTラジオ)
you
0
100
Featured
See All Featured
The Power of CSS Pseudo Elements
geoffreycrofte
52
4.3k
Designing the Hi-DPI Web
ddemaree
273
32k
Making the Leap to Tech Lead
cromwellryan
117
7.7k
YesSQL, Process and Tooling at Scale
rocio
159
12k
Testing 201, or: Great Expectations
jmmastey
25
5.7k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
657
120k
The Illustrated Children's Guide to Kubernetes
chrisshort
22
43k
How GitHub (no longer) Works
holman
298
140k
Product Roadmaps are Hard
iamctodd
38
7.7k
The Invisible Customer
myddelton
113
12k
Designing for Performance
lara
600
65k
Optimizing for Happiness
mojombo
365
64k
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