Slide 1

Slide 1 text

Ruby 2.0 & Rails 4.0 দా ໌ (@a_matsuda)

Slide 2

Slide 2 text

whoami GitHub: amatsuda Twitter: @a_matsuda

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

https://forkwell.com/ ϑϦʔϥϯεͷࣾ֎औక໾ (Ṗ) pull requestʹίϝϯτॻ͘ͻͱ

Slide 5

Slide 5 text

before

Slide 6

Slide 6 text

ůŢ RubyKaigiʹࢀՃͨ͜͠ͱ͋Δਓʁ Railsษڧձ@౦ژʹࢀՃͨ͜͠ͱ͋Δਓʁ Asakusa.rbʹࢀՃͨ͜͠ͱ͋Δਓʁ

Slide 7

Slide 7 text

begin

Slide 8

Slide 8 text

ຊ೔ͷ͓୊ 2ͭͷʮϝδϟʔόʔδϣϯΞοϓʯ

Slide 9

Slide 9 text

ϝδϟʔόʔδϣϯΞοϓʂ Ruby: 1.9.3 => 2.0.0 Rails: 3.2.9 => 4.0.0

Slide 10

Slide 10 text

ۭલͷ ϝδϟʔόʔδϣϯΞοϓظʂ 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 ...

Slide 11

Slide 11 text

ϝδϟʔόʔδϣϯΞοϓظ ࣌୅ͷస׵఺ ৺ػҰస ࢀೖͷνϟϯεʂ

Slide 12

Slide 12 text

Ruby 2.0

Slide 13

Slide 13 text

Ruby 2.0 (Matzͷ)௕೥ͷ൵ئ 2001೥ͷୈ1ճRubyConfͷΩʔϊʔτͰ Matz͕طʹRuby 2.0ʹݴٴ ʮֆʹඳ͍ͨṷʯʮ೩ྉʯʮχϯδϯʯ ʮPerl 6ʯ

Slide 14

Slide 14 text

Rubyͷྺ࢙ 1993೥02݄ ஀ੜ (1993/2/24) 1995೥12݄ ެ։ (0.95) 1996೥12݄ 1.0 1997೥08݄ 1.1 1998೥12݄ 1.2 1999೥08݄ 1.4 2000೥09݄ 1.6 2003೥08݄ 1.8 2013೥02݄ 2.0

Slide 15

Slide 15 text

Rubyͷྺ࢙ 1993೥02݄ ஀ੜ 1995೥12݄ ެ։ (0.95) 1996೥12݄ 1.0 1997೥08݄ 1.1 1998೥12݄ 1.2 1999೥08݄ 1.4 2000೥09݄ 1.6

Slide 16

Slide 16 text

Rubyͷྺ࢙ 1993೥02݄ ஀ੜ 1995೥12݄ ެ։ (0.95) 1996೥12݄ 1.0 1997೥08݄ 1.1 1998೥12݄ 1.2 1999೥08݄ 1.4 2000೥09݄ 1.6 2003೥08݄ 1.8

Slide 17

Slide 17 text

͜ͷࠒͷόʔδϣχϯάϧʔϧ ۮ਺൪߸͕҆ఆ൛

Slide 18

Slide 18 text

Rubyͷྺ࢙ 1993೥02݄ ஀ੜ 1995೥12݄ ެ։ (0.95) 1996೥12݄ 1.0 1997೥08݄ 1.1 1998೥12݄ 1.2 1999೥08݄ 1.4 2000೥09݄ 1.6 2003೥08݄ 1.8 2007೥12݄ 1.9.0 (։ൃ൛) Matz's Ruby Ko1's Ruby

Slide 19

Slide 19 text

͜ͷࠒͷόʔδϣχϯάϧʔϧ 2έλͷ਺ࣈ͸࢖͍ͨ͘ͳ͍ => 1.10.0 ͸͋Γಘͳ͍ 2.0ͬͯ਺ࣈ͸·ͩ࢖͍ͨ͘ͳ͍ 1.9.0͸։ൃ൛ɺ1.9.1͕҆ఆ൛ͰͲ͏͔

Slide 20

Slide 20 text

Rubyͷྺ࢙ 1993೥02݄ ஀ੜ 1995೥12݄ ެ։ (0.95) 1996೥12݄ 1.0 1997೥08݄ 1.1 1998೥12݄ 1.2 1999೥08݄ 1.4 2000೥09݄ 1.6 2003೥08݄ 1.8 2007೥12݄ 1.9.0 (։ൃ൛) 2010೥08݄ 1.9.2 (΄Μͱ͏ͷ҆ఆ൛)

Slide 21

Slide 21 text

Rubyͷྺ࢙ 1993೥02݄ ஀ੜ 1995೥12݄ ެ։ (0.95) 1996೥12݄ 1.0 1997೥08݄ 1.1 1998೥12݄ 1.2 1999೥08݄ 1.4 2000೥09݄ 1.6 2003೥08݄ 1.8 2007೥12݄ 1.9.0 (։ൃ൛) 2010೥08݄ 1.9.2 (҆ఆ൛) 2011೥10݄ 1.9.3 (҆ఆ൛)

Slide 22

Slide 22 text

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

Slide 23

Slide 23 text

Rubyͷྺ࢙ 1993೥02݄ ஀ੜ 1995೥12݄ ެ։ (0.95) 1996೥12݄ 1.0 1997೥08݄ 1.1 1998೥12݄ 1.2 1999೥08݄ 1.4 2000೥09݄ 1.6 2003೥08݄ 1.8 2007೥12݄ 1.9.0 (։ൃ൛) 2010೥08݄ 1.9.2 (҆ఆ൛) 2011೥10݄ 1.9.3 (҆ఆ൛) 2013೥02݄ 2.0

Slide 24

Slide 24 text

2003೥ͷ·ͭ΋ͱ͞ΜͷεϥΠυ http://www.rubyist.net/~matz/slides/rc2003/mgp00009.html

Slide 25

Slide 25 text

2003೥ͷ·ͭ΋ͱ͞ΜͷεϥΠυ http://www.rubyist.net/~matz/slides/rc2003/mgp00009.html ࠓճͷ2.0Ͱ࣮૷

Slide 26

Slide 26 text

Rubyͷྺ࢙ 1993೥02݄ ஀ੜ 1995೥12݄ ެ։ (0.95) 1996೥12݄ 1.0 1997೥08݄ 1.1 1998೥12݄ 1.2 1999೥08݄ 1.4 2000೥09݄ 1.6 2003೥08݄ 1.8 2007೥12݄ 1.9.0 (։ൃ൛) 2010೥08݄ 1.9.2 (҆ఆ൛) 2013೥02݄ 2.0

Slide 27

Slide 27 text

2.0ͷϦϦʔε 2013೥2݄24೔ ʮ஀ੜʯ͔Βͪΐ͏Ͳ20प೥ લ೔ͱ͔ʹ 2.0ϦϦʔεه೦ & ஀ੜ20प೥Πϕϯτ Έ͍ͨͳͷ͕͋ΔΜ͡Όͳ͍͔ͳ͊

Slide 28

Slide 28 text

1.9.3..2.0.0 1.8..1.9΄Ͳͷbig jumpͰ͸ͳ͍ ຊ౰ʹॏ͍ͨมߋ(= Ѩඓڣש)͸ 1.9Ͱࡁ·ͤͨ YARVɹ Encodingɹ 1.9͸2.0 preͩͬͨɺͱ΋ݴ͑Δ͔΋

Slide 29

Slide 29 text

2.0ͷಛ௃ ࠷ॳ͔Β҆ఆ൛Λࢤ޲ 2.0.0͕ग़ͨॠ͔ؒΒ ҆৺͓ͯ͠࢖͍͍͚ͨͩ·͢ 1.9.3ͱͷޓ׵ੑΛॏࢹ 1.9.3͔ΒεϜʔζʹҠߦͰ͖·͢ ඇޓ׵ͳมߋ͸2.1Ҏ߱ʹ

Slide 30

Slide 30 text

1.9.3..2.0.0 ৽ػೳ ύϑΥʔϚϯεͷ޲্ VM GC require σϑΥϧτεΫϦϓτΤϯίʔσΟϯά ͍ͭʹσϑΥϧτUTF-8ʹʂ ΋͔ͨ͠͠Β࠷େͷඇޓ׵ (ʁ)

Slide 31

Slide 31 text

ύϑΥʔϚϯεͷ޲্ VM GC require

Slide 32

Slide 32 text

VM: @ko1

Slide 33

Slide 33 text

No content

Slide 34

Slide 34 text

GC: @nari3

Slide 35

Slide 35 text

No content

Slide 36

Slide 36 text

ύϑΥʔϚϯεͷ޲্ (DEMO) Railsͷىಈ࣌ؒ RubyͷόʔδϣϯΛ্͛Δ͚ͩͰഒ଎ʹʂ

Slide 37

Slide 37 text

σϑΥϧτεΫϦϓτΤϯίʔσΟϯά ͍ͭʹσϑΥϧτUTF-8ʹʂ (Ϛδίϝͱ͸Կͩͬͨͷ͔…) ΋͔ͨ͠͠Β࠷େͷඇޓ׵ (ʁ)

Slide 38

Slide 38 text

Ϛδίϝͱ͸Կͩͬͨͷ͔ ๻ΒϢʔβʔʹͱͬͯඞཁͳஈ֊ͩͬͨ String͕encodingΛ࣋ͭͱ͍͏֓೦ CSIɹ internal encoding, external encodingɹ US-ASCII, ASCII-8BIT, BINARYɹ mojibake == ࢮ

Slide 39

Slide 39 text

ਆల։ encodingɺͳΜͱͳ͘Θ͔ͬͨͰ͠ΐʁ => σϑΥϧτUTF-8 ੒੉͞Μ͍͢͝

Slide 40

Slide 40 text

@nalsh

Slide 41

Slide 41 text

No content

Slide 42

Slide 42 text

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

Slide 43

Slide 43 text

Ruby 2.0ͷ৽ػೳ Refinements Module#prepend Enumerable#lazy ΩʔϫʔυҾ਺ ͳͲͳͲ

Slide 44

Slide 44 text

Ruby 2.0ͷ৽ػೳ ͋ͱͰ

Slide 45

Slide 45 text

Rails 4.0

Slide 46

Slide 46 text

Railsͷόʔδϣϯ൪߸ͷભҠ 2004೥07݄ ެ։ 2005೥12݄ 1.0 2007೥12݄ 2.0 2010೥08݄ 3.0 2012-2013 4.0

Slide 47

Slide 47 text

ϝδϟʔόʔδϣϯΞοϓʹ൐͏ ৽ύϥμΠϜ 1.0 DRY, CoC 2.0 RESTful 3.0 Modularity

Slide 48

Slide 48 text

ϝδϟʔόʔδϣϯΞοϓʹ൐͏ ৽ύϥμΠϜ 1.0 DRY, CoC 2.0 RESTful 3.0 Modularity 4.0 ಛʹͳ͠ʂ

Slide 49

Slide 49 text

Rails 4 ʮ৽ػೳʯ͸͍Ζ͍Ζ ʮ৽ύϥμΠϜʯ͸ಛʹͳ͍ جຊతʹ͸3.2ͷਖ਼ৗਐԽܥ 4.0ʹ͖͔͚ͨͬ͠͸ɺRuby 1.8αϙʔτͷ ऴྃ(ʁ)

Slide 50

Slide 50 text

Railsͷόʔδϣϯ൪߸ઓུ όʔδϣϯ൪߸ͳΜͯ০Γ Rails͸ઈ͑ؒͳ͘มԽ͢Δ1ຊͷઢ࿏Ͱɺ όʔδϣϯͷ۠੾Γ͸్தӺͷΑ͏ͳ΋ͷ

Slide 51

Slide 51 text

Railsͷʮ৽ʯόʔδϣϯ൪߸ઓུ ৽͍͠όʔδϣϯͰ࢖͑ͳ͘ͳΔػೳ͸ ͍͖ͳΓফ͞ͳ͍ 1ݸલͷόʔδϣϯͰ deprecation warningΛ ग़͢ ࣍ͷόʔδϣϯͰফ͢

Slide 52

Slide 52 text

4.0ͷಛ௃ ࠷ॳ͔Β҆ఆ൛Λࢤ޲ 4.0.0͕ग़ͨॠ͔ؒΒ ҆৺͓ͯ͠࢖͍͍͚ͨͩ·͢ 3.2.xͱͷޓ׵ੑΛॏࢹ 3.2.x͔ΒεϜʔζʹҠߦͰ͖·͢

Slide 53

Slide 53 text

Railsͷόʔδϣϯ൪߸ઓུ όʔδϣϯ൪߸ͳΜͯ০Γ Rails͸ઈ͑ؒͳ͘มԽ͢Δ1ຊͷઢ࿏Ͱɺ όʔδϣϯͷ۠੾Γ͸్தӺͷΑ͏ͳ΋ͷ ͳͷͰɺ4.0ͷ৽ػೳ͕Ͳ͏͜͏ݴ͏ΑΓ΋ ·ͣɺେ͖ͳྲྀΕΛ೺Ѳ͢Δͱྑ͍͔΋

Slide 54

Slide 54 text

࠷ۙͷைྲྀ Modern Speed Security Real-time web ActiveRecord Social coding

Slide 55

Slide 55 text

Modern Ruby '>= 1.9.3'ɹ APIͷ͞ΒͳΔચ࿅ ݹ͍ػೳɺ͋Μ·Γ࢖ΘΕͯͳ͍ػೳΛ ΋Γ΋Γ֎෦Gem΁

Slide 56

Slide 56 text

৽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

Slide 57

Slide 57 text

RIP Ruby 1.8 support vendor/plugins ActiveResource AR.find :all dynamic finders ActiveRecord::SessionStore Rack::Cache

Slide 58

Slide 58 text

Speed ύϑΥʔϚϯε޲্ Ruby 1.9Ҡߦʹ൐͏ίʔυͷεϦϜԽ Sprocketsͷprecompile threadsafe! AS::Queue TurboLinks

Slide 59

Slide 59 text

Security ʮMass Assignment Securityʯ =>ʮStrong Parametersʯ

Slide 60

Slide 60 text

Real-time web AC::Live (@tenderlove)

Slide 61

Slide 61 text

@tenderlove

Slide 62

Slide 62 text

AC::Live "Real Time Salami" https://speakerdeck.com/ tenderlove/real-time-salami

Slide 63

Slide 63 text

ActiveRecord @tenderlove @jonleighton PostgreSQL

Slide 64

Slide 64 text

@jonleighton

Slide 65

Slide 65 text

Social coding 2721 peopleʂ http://contributors.rubyonrails.org/ɹ ೆถ @josevalim @spastorino ൴Βʹଓ͘ୈ3ੈ୅

Slide 66

Slide 66 text

@josevalim

Slide 67

Slide 67 text

@spastorino

Slide 68

Slide 68 text

͓͠Βͤ @josevailm is speaking at RubyKaigi 2013ʂ

Slide 69

Slide 69 text

Ruby 2.0ͷ࿩͸ʁ

Slide 70

Slide 70 text

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

Slide 71

Slide 71 text

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

Slide 72

Slide 72 text

ensure Welcome to the new Ruby world!ɹ Meet the people at: Asakusa.rbɹ Railsษڧձ େߐށRubyձٞ03 RubyKaigi 2013

Slide 73

Slide 73 text

end