Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
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
620
Apollo & GraphQL: What we learned building a multi-platform chat app
nedomas
1
440
Best kept secrets for 2019: GraphQL + Prisma
nedomas
1
110
Tensorflow.js ir web ateitis
nedomas
1
230
Hack the Open Source Growth
nedomas
1
200
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
Kubernetes祭り #2 OP/ED
bells17
0
110
setup-vp GitLab対応の裏側
naokihaba
0
160
CodeRabbitの効果検証と過ごしてみた3ヶ月
armondando
0
210
更なる可用性を求めて、5年間運用したKotlinのアプリケーションをGoでリプレイスする話
ken_tunc
0
470
動作中のプログラムの中身をリアルタイムに覗く / Realtime Debugger for CSharp with Roslyn
prota
1
1.8k
Streamlitで実現する自然言語データアプリ開発
ayumu_yamaguchi
1
350
Starting & Sustaining Code-Based E2E Testing for Non-Coding QA Teams( #jasstniigata )
teyamagu
PRO
1
960
速く作れる。その次は、速く確かめられる開発へ 〜AIネイティブ開発を支える、Shift Down〜 / Can build fast. Next, moving to development where we can verify fast.
rkaga
8
5.6k
コードで差別化できない時代の ソフトウェアエンジニアリング / Software Engineering in an Era Where Code Doesn’t Differentiate
kishida
2
140
Agentic Software Factoryに、すごく賢いIF文を。 / super smart IF statement into the Agentic Software Factory.
rkaga
8
2.1k
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
600
Jetpack Compose Mechanisms
skydoves
2
680
Featured
See All Featured
Scaling GitHub
holman
464
140k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
400
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.8k
Documentation Writing (for coders)
carmenintech
77
5.6k
Statistics for Hackers
jakevdp
799
230k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
4
4.3k
How Software Deployment tools have changed in the past 20 years
geshan
2
35k
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
3
3.9k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.4k
What's in a price? How to price your products and services
michaelherold
247
13k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
740
AI: The stuff that nobody shows you
jnunemaker
PRO
10
1.1k
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Ū