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
Whats up in Ruby 2.0
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Domas Bitvinskas
March 23, 2013
Programming
1.6k
6
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Whats up in Ruby 2.0
A quick overview of the cool changes in Ruby 2.0 release.
Domas Bitvinskas
March 23, 2013
More Decks by Domas Bitvinskas
See All by Domas Bitvinskas
3 cool AI things
nedomas
0
600
Apollo & GraphQL: What we learned building a multi-platform chat app
nedomas
1
430
Best kept secrets for 2019: GraphQL + Prisma
nedomas
1
110
Tensorflow.js ir web ateitis
nedomas
1
220
Hack the Open Source Growth
nedomas
1
190
Market your Open Source or kill it
nedomas
1
1k
Ruby on Rails is dead
nedomas
2
1.3k
Why does Ruby own the startup world?
nedomas
0
740
Rockstars and Productivity
nedomas
1
1k
Other Decks in Programming
See All in Programming
週末にAI-DLCを本気で回したら$1,600溶けた
hbashimizu
0
120
書籍「プロフェッショナルAI駆動開発」紹介スライド
juntaromatsumoto
0
960
Cloudflare is Agents
chimame
0
190
GraphRAGのKnowledge Graphを 直接!見る/View-GraphRAG's-KnowledgeGraph-directly!
tyumugi1113
0
170
Foundry Localでエージェント開発
seosoft
0
110
AIは賢い。でも実行環境は? CLIおじさんがAI時代に伝えたいこと ~ CLIおじさんがAI時代に伝えたいこと ~
curekoshimizu
1
120
高専、大学編入、そして未踏へ〜プロダクト開発とキャリアの歩み - Technical College, University Transfer, and On to “Mitou” / My Journey in Product Development and Career
pkmiya
0
130
AIを上手に使っていこうとしたら越境せざるを得なくなった話 〜実践1年で見えた境界を越えなければならない理由と進め方〜 / Crossing borders with AI
tomoyakitaura
2
990
コンパウンドプロダクト開発のためのローカルプロセスマネージャー再発明 #layerxgo
izumin5210
0
620
FDEとは、何者なのか?
masapyon1212
0
130
いまどきの Codex で開発する visionOS アプリの開発スタイルについて
karad
0
180
My Marp Sample
sinoue0108
0
140
Featured
See All Featured
From π to Pie charts
rasagy
0
350
Technical Leadership for Architectural Decision Making
baasie
3
550
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
340
How to Think Like a Performance Engineer
csswizardry
28
2.8k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
260
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
570
Amusing Abliteration
ianozsvald
1
280
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
4
560
A Modern Web Designer's Workflow
chriscoyier
698
190k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
510
Agile that works and the tools we love
rasmusluckow
331
22k
HDC tutorial
michielstock
2
840
Transcript
RUBY 2.0 What u in DOMAS BITVINSKAS domasbitvinskas.com @Nedomas
20 27.days.ago ruby can almost play poke lega y
Syntax sparkle Evolved monkeys PERFORMANCE booooost PR “100 hundred procent
compatibl” - Matz
❤ = 'love' puts ❤ UTF-8 default encoding
class Integer def dalinasi_iš?(skaičius) skaičius != 0 ? self %
skaičius == 0 : zero? end end puts 6.dalinasi_iš?(2)
kwargs
# ruby 1.9 def shout(opts={}) loud = opts[:loud] || 'Hello'
quiet = opts[:quiet] || 'World' p "#{loud} #{quiet}!" end shout loud: "Old", quiet: "School" # ruby 2.0 def shout(loud: 'Hello', quiet: 'World') p "#{loud} #{quiet}!" end shout loud: "New", quiet: "School"
%i(an array of symbols) => [:an, :array, :of, :symbols] %I(#{100-50}
shades of grey) => [:"50", :shades, :of, :grey] PRO-TIP
module Logger def log(msg) p msg end end class Logic
include Logger def log(msg) p msg.reverse end end Module prepend
module Logger def log(msg) p msg end end class Logic
prepend Logger def log(msg) p msg.reverse end end Logic.new.log("Some message") # "Some message" Logic.ancestors # include => [Logic, Logger, Object, Kernel, BasicObject] # prepend => [Logger, Logic, Object, Kernel, BasicObject] Module prepend
ENUMERATORS even_numbers = (1..10000).select(&:even?).map(&:to_s) even_numbers = (1..10000).inject([]) do |acc, number|
if number.even? acc << number.to_s else acc end end for the lazy
ENUMERATORS even_numbers = (1..10000).lazy.select(&:even?).map(&:to_s) even_numbers = (1..10000).inject([]) do |acc, number|
if number.even? acc << number.to_s else acc end end for the lazy
REFINEMENTS experimental module Fun refine Fixnum do def +(_) super
- rand(3) end end end using Fun p 5 + 5
MAŽI GRAŽŪS DALYKAI
Drummer = Struct.new(:name, :age, :band) idol = Drummer.new("Carter Beauford", 55,
"Dave Matthews Band") p idol # => #<struct Drummer name="Carter Beauford", age=55, band="Dave Matthews Band"> p idol.to_h # => {:name=>"Carter Beauford", :age=>55, :band=>"Dave Matthews Band"} .to_h
ONIGMO REGEX VARIKLIS "this\nis\vMr.\rNeo".gsub(/\R/, ' ')
Array Range #bsearch p [1, 2, 3, 6, 9, 15].bsearch
{|i| i > 4 } p (1..10000000000000).bsearch {|i| i > 9 }
_ _di _ _
IMPROVE GARBAGE & STUFF! RubyGem 2.0 & RDoc 4.0
AČIŪ