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
Intro to Ruby 2.0
Search
Matt Aimonetti
March 07, 2013
Programming
7
730
Intro to Ruby 2.0
Matt Aimonetti introduces Ruby 2.0 at SDRuby in Febr 2013.
Matt Aimonetti
March 07, 2013
Tweet
Share
More Decks by Matt Aimonetti
See All by Matt Aimonetti
Designing a generic audio API
matt_aimonetti
0
83
Applied concurrency in Go
matt_aimonetti
5
6.2k
Understanding & Sharing Rails sessions
matt_aimonetti
1
1.1k
3 secrets to build web APIs in Go
matt_aimonetti
6
990
Go at Splice - Go SummerFest
matt_aimonetti
0
1.5k
Wicked Bad Ruby
matt_aimonetti
3
3.6k
Ruby vs. The World
matt_aimonetti
20
5.7k
mmmm..mruby everywhere & revisiting Ruby
matt_aimonetti
9
4.9k
Tower of Babel: A tour of programming languages
matt_aimonetti
28
10k
Other Decks in Programming
See All in Programming
nekko cloudにおけるProxmox VE利用事例
irumaru
3
420
range over funcの使い道と非同期N+1リゾルバーの夢 / about a range over func
mackee
0
110
Monixと常駐プログラムの勘どころ / Scalaわいわい勉強会 #4
stoneream
0
270
Scalaから始めるOpenFeature入門 / Scalaわいわい勉強会 #4
arthur1
1
300
創造的活動から切り拓く新たなキャリア 好きから始めてみる夜勤オペレーターからSREへの転身
yjszk
1
130
KubeCon + CloudNativeCon NA 2024 Overviewat Kubernetes Meetup Tokyo #68 / amsy810_k8sjp68
masayaaoyama
0
250
The rollercoaster of releasing an Android, iOS, and macOS app with Kotlin Multiplatform | droidcon Italy
prof18
0
150
なまけものオバケたち -PHP 8.4 に入った新機能の紹介-
tanakahisateru
1
120
StarlingMonkeyを触ってみた話 - 2024冬
syumai
3
270
今年一番支援させていただいたのは認証系サービスでした
satoshi256kbyte
1
250
Асинхронность неизбежна: как мы проектировали сервис уведомлений
lamodatech
0
700
命名をリントする
chiroruxx
1
390
Featured
See All Featured
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.6k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
810
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
29
2k
A Tale of Four Properties
chriscoyier
157
23k
Done Done
chrislema
181
16k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
Code Review Best Practice
trishagee
65
17k
KATA
mclloyd
29
14k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
28
2.1k
Mobile First: as difficult as doing things right
swwweet
222
9k
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
132
33k
Transcript
ruby 2.0 San Diego Ruby - March 2013 - Matt
Aimonetti Wednesday, March 13, 13
Barney Stinson approved Wednesday, March 13, 13
Safe for Human Consumption Wednesday, March 13, 13
horse meat free Wednesday, March 13, 13
Ruby is 20 years old! Wednesday, March 13, 13
what you really need to know Wednesday, March 13, 13
Migration from Ruby 1.9 is trivial Wednesday, March 13, 13
Ruby 1.8 reaches its end of life in June Wednesday,
March 13, 13
Performance improvement Wednesday, March 13, 13
favorite Ruby Wednesday, March 13, 13
less new features Wednesday, March 13, 13
The new REE Wednesday, March 13, 13
Heroku support Wednesday, March 13, 13
Ruby 2.1 scheduled for Xmas 2013 Wednesday, March 13, 13
getting started Wednesday, March 13, 13
rvm rbenv chruby Wednesday, March 13, 13
libyaml (recent) openssl Dependencies you might need to resolve Wednesday,
March 13, 13
new in 2.0 Wednesday, March 13, 13
default code encoding Wednesday, March 13, 13
keyword arguments Wednesday, March 13, 13
# before def create(name, opts={}) opts[:tos] ||= false
opts[:timestamp] ||= Time.now end Wednesday, March 13, 13
# now def create(name, tos: false,
timestamp: Time.now) puts [name, tos, timestamp].inspect end Wednesday, March 13, 13
create("Matt") # -‐> ["Matt", false,
2013-‐03-‐06 16:34:49 -‐0800] create("Matt", timestamp: Time.now -‐ 42) # -‐> ["Matt", false, 2013-‐03-‐06 16:34:07 -‐0800] create("Matt", tos: true, location: "SDRuby") # -‐> unknown keyword: location (ArgumentError) Wednesday, March 13, 13
create("Matt", tos: true, location:
"SDRuby") # -‐> unknown keyword: location (ArgumentError) Wednesday, March 13, 13
# more flexible API def create(name, tos: false,
timestamp: Time.now, **rest) puts [name, tos, timestamp, rest].inspect end Wednesday, March 13, 13
create("Matt") # -‐> ["Matt", false,
2013-‐03-‐06 16:30:29 -‐0800, {}] create("Matt", timestamp: Time.now -‐ 42) # -‐> ["Matt", false, 2013-‐03-‐06 16:29:47 -‐0800, {}] create("Matt", tos: true, location: "SDRuby") # -‐> ["Matt", true, 2013-‐03-‐06 16:30:29 -‐0800, {:location=>"SDRuby"}] Wednesday, March 13, 13
# required keyword param def new(name,
tos: raise("TOS is required"), admin: false) end Wednesday, March 13, 13
new("Matt", tos: false) #-‐> ["Matt", false, false] new("Matt") #-‐> TOS
is required (RuntimeError) Wednesday, March 13, 13
module #prepend Wednesday, March 13, 13
# Not our code class Action def start
"just do it" end end Wednesday, March 13, 13
# The module including our modifying code module RubyIt
def start super + " better with Ruby!" end end Wednesday, March 13, 13
module RubyIt def start super +
" better with Ruby!" end end Wednesday, March 13, 13
class Action prepend RubyIt end p Action.new.start #
-‐> "just do it better with Ruby!" Wednesday, March 13, 13
lazy streams Wednesday, March 13, 13
require 'date' # Print the next 13 Friday the
13th. puts (Date.new(2013)..Date.new(9999)) .lazy .select{|d| d.day == 13 && d.friday?} .first(13) Wednesday, March 13, 13
2013-09-13 2013-12-13 2014-06-13 2015-02-13 2015-03-13 2015-11-13 2016-05-13 2017-01-13 2017-10-13 2018-04-13
2018-07-13 2019-09-13 2019-12-13 Wednesday, March 13, 13
to_h convention Wednesday, March 13, 13
Talk = Struct.new(:title, :speaker) Talk.new("Ruby 2.0", "Matt").to_h # => {:title=>"Ruby
2.0", :speaker=>"Matt"} Wednesday, March 13, 13
%i{foo bar baz} [:foo, :bar, :baz] Wednesday, March 13, 13
tracepoint support Wednesday, March 13, 13
GC/misc optimization Wednesday, March 13, 13
more... Wednesday, March 13, 13
caller_locations caller(start, length) Wednesday, March 13, 13
dtrace support Wednesday, March 13, 13
infamous refinements Wednesday, March 13, 13
Array / Range binary search Wednesday, March 13, 13
Kernel.inspect != Kernel.to_s Wednesday, March 13, 13
String#b "déjà vu".b Wednesday, March 13, 13
Thread. current. thread_variable_set("@foo", 42)
Thread. current. thread_variable_get("@foo") Thread.current.thread_variables Wednesday, March 13, 13
https://github.com/ruby/ ruby/blob/ruby_2_0_0/NEWS Wednesday, March 13, 13
@merbist http://matt.aimonetti.net Wednesday, March 13, 13