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 and Rails 4
Search
Akira Matsuda
November 21, 2012
Programming
43
7k
Ruby 2 and Rails 4
「Ruby 2.0 & Rails 4.0先取りセミナー」の講演資料
(2012/11/21, Web CAT Studioさん主催)
http://atnd.org/events/33996
Akira Matsuda
November 21, 2012
Tweet
Share
More Decks by Akira Matsuda
See All by Akira Matsuda
初心者のためのRubyKaigi入門/RubyKaigi Introduction
a_matsuda
13
4.7k
Hanamiを支える技術 2023 / Asakusa.rb Hanami 2023
a_matsuda
2
530
Rails 7.1をn倍速くした話
a_matsuda
11
12k
RubyKaigi 2022 After Talk
a_matsuda
0
400
Coming Soon…💎 / coming soon
a_matsuda
12
7.7k
Rails Performance Issues and Solutions
a_matsuda
9
35k
Extending Rails for Real World App Development
a_matsuda
9
7.4k
A RubyKaigi Talk
a_matsuda
8
2.3k
Ginza Rails 1
a_matsuda
6
1.2k
Other Decks in Programming
See All in Programming
とにかくAWS GameDay!AWSは世界の共通言語! / Anyway, AWS GameDay! AWS is the world's lingua franca!
seike460
PRO
1
860
受け取る人から提供する人になるということ
little_rubyist
0
230
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
110
ActiveSupport::Notifications supporting instrumentation of Rails apps with OpenTelemetry
ymtdzzz
1
230
Outline View in SwiftUI
1024jp
1
330
카카오페이는 어떻게 수천만 결제를 처리할까? 우아한 결제 분산락 노하우
kakao
PRO
0
110
Flutterを言い訳にしない!アプリの使い心地改善テクニック5選🔥
kno3a87
1
160
Realtime API 入門
riofujimon
0
150
What’s New in Compose Multiplatform - A Live Tour (droidcon London 2024)
zsmb
1
470
2024/11/8 関西Kaggler会 2024 #3 / Kaggle Kernel で Gemma 2 × vLLM を動かす。
kohecchi
5
910
シェーダーで魅せるMapLibreの動的ラスタータイル
satoshi7190
1
480
イベント駆動で成長して委員会
happymana
1
320
Featured
See All Featured
Side Projects
sachag
452
42k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
25
1.8k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
250
21k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
10 Git Anti Patterns You Should be Aware of
lemiorhan
654
59k
Ruby is Unlike a Banana
tanoku
97
11k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
44
2.2k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
Building an army of robots
kneath
302
43k
Navigating Team Friction
lara
183
14k
Gamification - CAS2011
davidbonilla
80
5k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
126
18k
Transcript
Ruby 2.0 & Rails 4.0 দా ໌ (@a_matsuda)
whoami GitHub: amatsuda Twitter: @a_matsuda
None
https://forkwell.com/ ϑϦʔϥϯεͷࣾ֎औక (Ṗ) pull requestʹίϝϯτॻ͘ͻͱ
before
ůŢ RubyKaigiʹࢀՃͨ͜͠ͱ͋Δਓʁ Railsษڧձ@౦ژʹࢀՃͨ͜͠ͱ͋Δਓʁ Asakusa.rbʹࢀՃͨ͜͠ͱ͋Δਓʁ
begin
ຊͷ͓ 2ͭͷʮϝδϟʔόʔδϣϯΞοϓʯ
ϝδϟʔόʔδϣϯΞοϓʂ Ruby: 1.9.3 => 2.0.0 Rails: 3.2.9 => 4.0.0
ۭલͷ ϝδϟʔόʔδϣϯΞοϓظʂ Ruby 2.0 Rails 4.0 Rake 10.0 RubyGems 2.0
RDoc 4.0 RSpec 3.0 Sprockets 3.0 Capybara 2.0 Rubinius 2.0 ...
ϝδϟʔόʔδϣϯΞοϓظ ࣌ͷస ৺ػҰస ࢀೖͷνϟϯεʂ
Ruby 2.0
Ruby 2.0 (Matzͷ)ͷ൵ئ 2001ͷୈ1ճRubyConfͷΩʔϊʔτͰ Matz͕طʹRuby 2.0ʹݴٴ ʮֆʹඳ͍ͨṷʯʮ೩ྉʯʮχϯδϯʯ ʮPerl 6ʯ
Rubyͷྺ࢙ 199302݄ ੜ (1993/2/24) 199512݄ ެ։ (0.95) 199612݄ 1.0 199708݄
1.1 199812݄ 1.2 199908݄ 1.4 200009݄ 1.6 200308݄ 1.8 201302݄ 2.0
Rubyͷྺ࢙ 199302݄ ੜ 199512݄ ެ։ (0.95) 199612݄ 1.0 199708݄ 1.1
199812݄ 1.2 199908݄ 1.4 200009݄ 1.6
Rubyͷྺ࢙ 199302݄ ੜ 199512݄ ެ։ (0.95) 199612݄ 1.0 199708݄ 1.1
199812݄ 1.2 199908݄ 1.4 200009݄ 1.6 200308݄ 1.8
͜ͷࠒͷόʔδϣχϯάϧʔϧ ۮ൪߸͕҆ఆ൛
Rubyͷྺ࢙ 199302݄ ੜ 199512݄ ެ։ (0.95) 199612݄ 1.0 199708݄ 1.1
199812݄ 1.2 199908݄ 1.4 200009݄ 1.6 200308݄ 1.8 200712݄ 1.9.0 (։ൃ൛) Matz's Ruby Ko1's Ruby
͜ͷࠒͷόʔδϣχϯάϧʔϧ 2έλͷࣈ͍ͨ͘ͳ͍ => 1.10.0 ͋Γಘͳ͍ 2.0ͬͯࣈ·͍ͩͨ͘ͳ͍ 1.9.0։ൃ൛ɺ1.9.1͕҆ఆ൛ͰͲ͏͔
Rubyͷྺ࢙ 199302݄ ੜ 199512݄ ެ։ (0.95) 199612݄ 1.0 199708݄ 1.1
199812݄ 1.2 199908݄ 1.4 200009݄ 1.6 200308݄ 1.8 200712݄ 1.9.0 (։ൃ൛) 201008݄ 1.9.2 (΄Μͱ͏ͷ҆ఆ൛)
Rubyͷྺ࢙ 199302݄ ੜ 199512݄ ެ։ (0.95) 199612݄ 1.0 199708݄ 1.1
199812݄ 1.2 199908݄ 1.4 200009݄ 1.6 200308݄ 1.8 200712݄ 1.9.0 (։ൃ൛) 201008݄ 1.9.2 (҆ఆ൛) 201110݄ 1.9.3 (҆ఆ൛)
Rubyͷόʔδϣϯ൪߸ͷมભ 1 1.2 1.4 1.6 1.8 2 1995/12 1996/12 1997/08
1998/12 1999/08 2000/09 2003/08 2007/12 2010/08 2011/10
Rubyͷྺ࢙ 199302݄ ੜ 199512݄ ެ։ (0.95) 199612݄ 1.0 199708݄ 1.1
199812݄ 1.2 199908݄ 1.4 200009݄ 1.6 200308݄ 1.8 200712݄ 1.9.0 (։ൃ൛) 201008݄ 1.9.2 (҆ఆ൛) 201110݄ 1.9.3 (҆ఆ൛) 201302݄ 2.0
2003ͷ·ͭͱ͞ΜͷεϥΠυ http://www.rubyist.net/~matz/slides/rc2003/mgp00009.html
2003ͷ·ͭͱ͞ΜͷεϥΠυ http://www.rubyist.net/~matz/slides/rc2003/mgp00009.html ࠓճͷ2.0Ͱ࣮
Rubyͷྺ࢙ 199302݄ ੜ 199512݄ ެ։ (0.95) 199612݄ 1.0 199708݄ 1.1
199812݄ 1.2 199908݄ 1.4 200009݄ 1.6 200308݄ 1.8 200712݄ 1.9.0 (։ൃ൛) 201008݄ 1.9.2 (҆ఆ൛) 201302݄ 2.0
2.0ͷϦϦʔε 20132݄24 ʮੜʯ͔Βͪΐ͏Ͳ20प લͱ͔ʹ 2.0ϦϦʔεه೦ & ੜ20पΠϕϯτ Έ͍ͨͳͷ͕͋ΔΜ͡Όͳ͍͔ͳ͊
1.9.3..2.0.0 1.8..1.9΄Ͳͷbig jumpͰͳ͍ ຊʹॏ͍ͨมߋ(= Ѩඓڣש) 1.9Ͱࡁ·ͤͨ YARVɹ Encodingɹ 1.92.0 preͩͬͨɺͱݴ͑Δ͔
2.0ͷಛ ࠷ॳ͔Β҆ఆ൛Λࢤ 2.0.0͕ग़ͨॠ͔ؒΒ ҆৺͓͍͍͚ͯͨͩ͠·͢ 1.9.3ͱͷޓੑΛॏࢹ 1.9.3͔ΒεϜʔζʹҠߦͰ͖·͢ ඇޓͳมߋ2.1Ҏ߱ʹ
1.9.3..2.0.0 ৽ػೳ ύϑΥʔϚϯεͷ্ VM GC require σϑΥϧτεΫϦϓτΤϯίʔσΟϯά ͍ͭʹσϑΥϧτUTF-8ʹʂ ͔ͨ͠͠Β࠷େͷඇޓ (ʁ)
ύϑΥʔϚϯεͷ্ VM GC require
VM: @ko1
None
GC: @nari3
None
ύϑΥʔϚϯεͷ্ (DEMO) Railsͷىಈ࣌ؒ RubyͷόʔδϣϯΛ্͛Δ͚ͩͰഒʹʂ
σϑΥϧτεΫϦϓτΤϯίʔσΟϯά ͍ͭʹσϑΥϧτUTF-8ʹʂ (ϚδίϝͱԿͩͬͨͷ͔…) ͔ͨ͠͠Β࠷େͷඇޓ (ʁ)
ϚδίϝͱԿͩͬͨͷ͔ ΒϢʔβʔʹͱͬͯඞཁͳஈ֊ͩͬͨ String͕encodingΛ࣋ͭͱ͍͏֓೦ CSIɹ internal encoding, external encodingɹ US-ASCII, ASCII-8BIT,
BINARYɹ mojibake == ࢮ
ਆల։ encodingɺͳΜͱͳ͘Θ͔ͬͨͰ͠ΐʁ => σϑΥϧτUTF-8 ͞Μ͍͢͝
@nalsh
None
M17Nʹ͍ͭͯৄ͘͠ ʰA Reintroduction To Ruby M17Nʱ http://www.slideshare.net/nalsh/a-reintroduction- to-ruby-m17-n ʰ Ruby
M17N ͷઃܭͱ࣮ʱ http://jp.rubyist.net/magazine/?0025- Ruby19_m17n
Ruby 2.0ͷ৽ػೳ Refinements Module#prepend Enumerable#lazy ΩʔϫʔυҾ ͳͲͳͲ
Ruby 2.0ͷ৽ػೳ ͋ͱͰ
Rails 4.0
Railsͷόʔδϣϯ൪߸ͷભҠ 200407݄ ެ։ 200512݄ 1.0 200712݄ 2.0 201008݄ 3.0 2012-2013
4.0
ϝδϟʔόʔδϣϯΞοϓʹ͏ ৽ύϥμΠϜ 1.0 DRY, CoC 2.0 RESTful 3.0 Modularity
ϝδϟʔόʔδϣϯΞοϓʹ͏ ৽ύϥμΠϜ 1.0 DRY, CoC 2.0 RESTful 3.0 Modularity 4.0
ಛʹͳ͠ʂ
Rails 4 ʮ৽ػೳʯ͍Ζ͍Ζ ʮ৽ύϥμΠϜʯಛʹͳ͍ جຊతʹ3.2ͷਖ਼ৗਐԽܥ 4.0ʹ͖͔͚ͨͬ͠ɺRuby 1.8αϙʔτͷ ऴྃ(ʁ)
Railsͷόʔδϣϯ൪߸ઓུ όʔδϣϯ൪߸ͳΜͯ০Γ Railsઈ͑ؒͳ͘มԽ͢Δ1ຊͷઢ࿏Ͱɺ όʔδϣϯͷ۠Γ్தӺͷΑ͏ͳͷ
Railsͷʮ৽ʯόʔδϣϯ൪߸ઓུ ৽͍͠όʔδϣϯͰ͑ͳ͘ͳΔػೳ ͍͖ͳΓফ͞ͳ͍ 1ݸલͷόʔδϣϯͰ deprecation warningΛ ग़͢ ࣍ͷόʔδϣϯͰফ͢
4.0ͷಛ ࠷ॳ͔Β҆ఆ൛Λࢤ 4.0.0͕ग़ͨॠ͔ؒΒ ҆৺͓͍͍͚ͯͨͩ͠·͢ 3.2.xͱͷޓੑΛॏࢹ 3.2.x͔ΒεϜʔζʹҠߦͰ͖·͢
Railsͷόʔδϣϯ൪߸ઓུ όʔδϣϯ൪߸ͳΜͯ০Γ Railsઈ͑ؒͳ͘มԽ͢Δ1ຊͷઢ࿏Ͱɺ όʔδϣϯͷ۠Γ్தӺͷΑ͏ͳͷ ͳͷͰɺ4.0ͷ৽ػೳ͕Ͳ͏͜͏ݴ͏ΑΓ ·ͣɺେ͖ͳྲྀΕΛѲ͢Δͱྑ͍͔
࠷ۙͷைྲྀ Modern Speed Security Real-time web ActiveRecord Social coding
Modern Ruby '>= 1.9.3'ɹ APIͷ͞ΒͳΔચ࿅ ݹ͍ػೳɺ͋Μ·ΓΘΕͯͳ͍ػೳΛ ΓΓ֎෦Gem
৽API AR͍Ζ͍Ζ AR.where! AR.all (= .scoped) scope :foo, -> {}
NullRelation AR::Model, AMo::Model update_columns AR.where.not PATCH verb routing concern Russian doll caching
RIP Ruby 1.8 support vendor/plugins ActiveResource AR.find :all dynamic finders
ActiveRecord::SessionStore Rack::Cache
Speed ύϑΥʔϚϯε্ Ruby 1.9Ҡߦʹ͏ίʔυͷεϦϜԽ Sprocketsͷprecompile threadsafe! AS::Queue TurboLinks
Security ʮMass Assignment Securityʯ =>ʮStrong Parametersʯ
Real-time web AC::Live (@tenderlove)
@tenderlove
AC::Live "Real Time Salami" https://speakerdeck.com/ tenderlove/real-time-salami
ActiveRecord @tenderlove @jonleighton PostgreSQL
@jonleighton
Social coding 2721 peopleʂ http://contributors.rubyonrails.org/ɹ ೆถ @josevalim @spastorino ൴Βʹଓ͘ୈ3ੈ
@josevalim
@spastorino
͓͠Βͤ @josevailm is speaking at RubyKaigi 2013ʂ
Ruby 2.0ͷʁ
RubyConfͰ͠Όͬͨͭ Ruby 2.0 on Rails http://speakerdeck.com/u/a_matsuda/p/ruby-2- dot-0-on-rails Ruby 2.0 on
Rails (video) http://www.confreaks.com/videos/1275- rubyconf2012-ruby-2-0-on-rails
ensure The new Ruby world is coming!ɹ People are making
the Ruby world better everyday! Meet the people (= the community) and say "Hi!" to them! <3 <3 <3
ensure Welcome to the new Ruby world!ɹ Meet the people
at: Asakusa.rbɹ Railsษڧձ େߐށRubyձٞ03 RubyKaigi 2013
end