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 and What's Cool
Search
Bryce "BonzoESC" Kerley
January 15, 2018
Programming
93
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Ruby 2.5: What's New and What's Cool
Miami Ruby Brigade
Monday, January 15, 2018
Bryce "BonzoESC" Kerley
January 15, 2018
More Decks by Bryce "BonzoESC" Kerley
See All by Bryce "BonzoESC" Kerley
Ruby in 2020
bryce
1
130
Rails and the Internet of Things
bryce
1
87
It's Not Ruby, But…
bryce
0
86
docker for rubyists
bryce
0
120
Would You Like To Make A Game?
bryce
0
67
WebSockets and ActionCable
bryce
0
96
How I Learned to Stop Worrying and Like RSpec
bryce
0
89
How Do Computers Even Work?
bryce
1
220
Growing Distributed Systems: Abril Pro Ruby
bryce
0
60
Other Decks in Programming
See All in Programming
なぜ型を書くのか? TSKaigi2026で改めて考える #tskaigi_smarthr
kajitack
0
190
Creating Composable Callables in Contemporary C++
rollbear
0
190
dRuby over BLE
makicamel
2
410
ローカルLLMでどこまでコードが書けるか -拡張版 / How much code can be written on a local LLM Extended
kishida
12
4.6k
AI駆動開発を妨げる技術的負債の解消アプローチ / ai-refactoring-approach
minodriven
17
8.6k
メソッドのジェネリクスでGoの夢は広がるか? / Kyoto.go #65
utgwkk
3
1k
The NotImplementedError Problem in Ruby
koic
1
1.1k
エンジニアと一緒にテストコードの設計と実装を改善した話
mototakatsu
0
250
Dataformのリポジトリを立ち上げるときにまずやること / dataform-day0-2026
snhryt
0
210
Developing with AI Agents — Codex, Claude Code & Cowork Practical Guide
x5gtrn
PRO
0
1.3k
過去最大のMCPアップデート! 2026-07-28 RC版の謎に迫る
licux
6
440
Vue × Nuxt × Oxc どこまで使える?実運用の現在地
andpad
0
350
Featured
See All Featured
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.3k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
3.6k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
220
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
440
Speed Design
sergeychernyshev
33
1.9k
A better future with KSS
kneath
240
18k
My Coaching Mixtape
mlcsv
0
170
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.5k
Chasing Engaging Ingredients in Design
codingconduct
0
230
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
340
Side Projects
sachag
455
43k
The Invisible Side of Design
smashingmag
301
52k
Transcript
Ruby 2.5 What's New and What's Cool Miami Ruby Brigade
Monday, January 15, 2018
tl;dr • feature and performance update release • new features
are cool • some stuff is faster • some stdlibs are now default gems • some other bits & bobs have changed
Topics • Intro • Features • Demos • Q&A
https://www.ruby-lang.org/en/news/2017/12/25/ruby-2-5-0-released/
Getting Ruby 2.5 • rbenv • Docker hub • Heroku
• rvm
Running an App? Go for it (With adequate testing)
Maintaining a Library? Know it exists and test with it
do / rescue / end Exception handling in a block
doesn't require begin
https://github.com/bkerley/mastodon/commit/589cdff
Object#yield_self Similar to #tap but it returns the result instead
of the receiver
None
Hash#slice Grabs a sub-hash with the given keys
https://github.com/bkerley/tides_and_currents/commit/bbb8ab78
Hash#transform_keys • Returns a new hash with the keys mapped
to something new
None
Struct.new keyword Struct#new supports keyword arguments now
None
Enumerable#any? #all? #none? #one? threequals Find if members in a
collection threequal some pattern
None
None
Reverse backtraces • Quality of life • On a terminal,
unless you change $stderr, the most recent call is at the bottom instead of a million screens up
None
Topics • Intro • Features • Demos • Q&A
Upgrading Mastodon I decided to make Mastodon work in Ruby
2.5
Mastodon • Twitter-like • Open-source • Federated • Independent nodes
Setup Steps From a new Mastodon checkout on v2.1.3, and
after Development setup steps 1. Update README.md to note that it's a weird research project 2. Remove "< 2.5.0" constraint on Ruby version from Gemfile 3. bundle 4. Some deps also have "< 2.5.0" ruby constraint 5. bundle update
app/models/media_attachment.rb def populate_meta meta = {} file.queued_for_write.each
do |style, file| begin geo = Paperclip::Geometry.from_file file meta[style] = { width: geo.width.to_i, height: geo.height.to_i, size: "#{geo.width.to_i}x#{geo.height.to_i}", aspect: geo.width.to_f / geo.height.to_f, } rescue Paperclip::Errors::NotIdentifiedByImageMagickError meta[style] = {} end end meta end
None
app/models/media_attachment.rb def populate_meta meta = {} file.queued_for_write.each
do |style, file| begin geo = Paperclip::Geometry.from_file file meta[style] = { width: geo.width.to_i, height: geo.height.to_i, size: "#{geo.width.to_i}x#{geo.height.to_i}", aspect: geo.width.to_f / geo.height.to_f, } # rescue Paperclip::Errors::NotIdentifiedByImageMagickError # meta[style] = {} end end meta end
None
app/models/media_attachment.rb def populate_meta meta = {} file.queued_for_write.each
do |style, file| geo = Paperclip::Geometry.from_file file meta[style] = { width: geo.width.to_i, height: geo.height.to_i, size: "#{geo.width.to_i}x#{geo.height.to_i}", aspect: geo.width.to_f / geo.height.to_f, } rescue Paperclip::Errors::NotIdentifiedByImageMagickError meta[style] = {} end meta end
None
https://github.com/bkerley/mastodon/commit/589cdff
tides_and_currents • Code for Miami project • Gets tides and
currents data from NOAA • Quick and dirty ruby scripts
get_stations.rb field_names = %w{geoGroupName stationId lat lon} #
… out_json = doc['stationList'].map do |stn| # … field_names.map do |fn| stn[fn] end end.compact
None
get_stations.rb field_names = %w{geoGroupName stationId lat lon} #
… out_json = doc['stationList'].map do |stn| # … stn.slice(*field_names).values end.compact
None
https://github.com/bkerley/tides_and_currents/commit/bbb8ab78
Topics • Intro • Features • Demos • Q&A
Thanks