Slide 1

Slide 1 text

ྉཧΛࢧ͑Δ ٕज़ ؘ໺༞Ұ

Slide 2

Slide 2 text

ఏڙ

Slide 3

Slide 3 text

JETFDPOEMJGF ؘ໺༞Ұ :VJDIJ5BUFOP

Slide 4

Slide 4 text

@hotchpotch

Slide 5

Slide 5 text

Shibuya.js

Slide 6

Slide 6 text

༓ྶ෦һ

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

ྉཧΛࢧ͑Δ ٕज़

Slide 9

Slide 9 text

2011 ↓ 2012

Slide 10

Slide 10 text

2011 http://techlife.cookpad.com/2011/07/19/rubykaigi2011/

Slide 11

Slide 11 text

2012

Slide 12

Slide 12 text

- Rails 2.3 + Rails 3.0 2012

Slide 13

Slide 13 text

3BJMT ΁ͷಓ http://www.flickr.com/photos/skreuzer/4285271145/

Slide 14

Slide 14 text

݄ؒར༻ऀ ສҎ্ Ϩγϐ਺ສҎ্ Ͳ͏΍ͬͯ େن໛3BJMTΞϓϦΛ όʔδϣϯΞοϓͨ͠ͷ͔

Slide 15

Slide 15 text

ͳͥ3BJMTͷόʔδϣϯΛ ্͛Δඞཁ͕͋Δͷ͔

Slide 16

Slide 16 text

✓3BJMTʹू໿͞Ε͍ͯΔɺ ༷ʑͳϥΠϒϥϦΛ ར༻Ͱ͖ͳ͘ͳΔ

Slide 17

Slide 17 text

http://www.flickr.com/photos/dskley/4669454041/ ৽͍͠3BJMʹ ✓৐Δ ৐Βͳ͍

Slide 18

Slide 18 text

)PXUP Ͳ͏΍Δͷʁ

Slide 19

Slide 19 text

Rails 2.3 -> 3.0 RSpec 1.3 -> 2.2

Slide 20

Slide 20 text

$  bundle  exec  rake  cookpad:spec

Slide 21

Slide 21 text

$  bundle  exec  rake  cookpad:spec F

Slide 22

Slide 22 text

$  bundle  exec  rake  cookpad:spec FFFF

Slide 23

Slide 23 text

$  bundle  exec  rake  cookpad:spec FFFFFFFFFFFFFFFFFFFFFFFFFFFFF

Slide 24

Slide 24 text

$  bundle  exec  rake  cookpad:spec FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFF...F....F.FFFFFFFFF FFFFFF.FFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFF...FFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFF.FFFFFFFFFFFFFFF..FFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFF...FFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFF..F.FFFFFFFF.FFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFF....F...FFFFF

Slide 25

Slide 25 text

$  bundle  exec  rake  cookpad:spec FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFF...F....F.FFFFFFFFF FFFFFF.FFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFF...FFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFF.FFFFFFFFFFFFFFF..FFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFFFFF...FFFFFFF FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FFF..F.FFFFFFFF.FFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFF....F...FFFFF ʗ ?P? ʘ

Slide 26

Slide 26 text

http://www.flickr.com/photos/aizaz/3512778599/ ஍ಓʹ ͭͿ͍ͯ͘͠࡞ۀ

Slide 27

Slide 27 text

http://www.flickr.com/photos/aizaz/3512778599/ ✓Կ͔Λ౗͢ͱҰؾʹݮΔ ✓ϘεతͳϠπ΋͍Δ ✓౗͢ͱผͷϠπ͕෮׆͢Δ ׂͱήʔϜͬΆ͍

Slide 28

Slide 28 text

http://www.flickr.com/photos/aizaz/3512778599/ ✓Կ͔Λ౗͢ͱҰؾʹݮΔ ✓ϘεతͳϠπ΋͍Δ ׂͱήʔϜͬΆ͍ ࢲ͸ ΍ͬͯͳ͍Μ Ͱ͚͢ͲͶ ʢʍТɾʣ

Slide 29

Slide 29 text

Team 34QFD૊ !TIJOHP<Խ> !B@NBUTVEB<༭ฌ> ͦͷଞ !IPUDIQPUDI

Slide 30

Slide 30 text

ࣗಈ IUNMFTDBQF ରԠ

Slide 31

Slide 31 text

<%=  ""  %>

Slide 32

Slide 32 text

<%=  ""  %> Rails  2.3 #=>  

Slide 33

Slide 33 text

<%=  ""  %> Rails  3.0 #=>  <hello> Rails  2.3 #=>  

Slide 34

Slide 34 text

ඪ४ͰϏϡʔ͕ IUNMFTDBQF͞ΕΔ ˺ IUNMFTDBQFલఏ΁ͱ ͢΂ͯͷίʔυΛॻ͖௚͢

Slide 35

Slide 35 text

rails_xss plugin https://github.com/nzkoz/rails_xss ✓3BJMT؀ڥʹಋೖՄೳ

Slide 36

Slide 36 text

<%=  ""  %> Rails  3.0 #=>  <hello> Rails  2.3 #=>  <hello>

Slide 37

Slide 37 text

rails_xss plugin https://github.com/nzkoz/rails_xss ✓3BJMT؀ڥʹಋೖՄೳ ✓3BJMTͰSBJMT@YTT༗ޮͰ໰୊ͳ ͍˺SBJMTͰ΋໰୊ͳ͍

Slide 38

Slide 38 text

ࢗ਎ http://www.flickr.com/photos/htakashi/5696799508/

Slide 39

Slide 39 text

Slide 40

Slide 40 text

spec ↓ html

Slide 41

Slide 41 text

✓ functional test 34QFD$POUSPMMFS ✓ integration test $BQZCBSB 8FCSBU 3300+ examples

Slide 42

Slide 42 text

RSpec Capybara, Webrat dirty hack !

Slide 43

Slide 43 text

$  spec  -­‐l  139  spec/controller/ recipe_spec.rb write:  normal/spec/controller/ recipe_spec.rb:139.html $  RAILS_XSS=1  spec  -­‐l  139  spec/ controller/recipe_spec.rb write:  htmlsafe/spec/controller/ recipe_spec.rb:139.html

Slide 44

Slide 44 text

No content

Slide 45

Slide 45 text

IUNMFTDBQFͷ lࠩҧ͚ͩz ஌Γ͍ͨ

Slide 46

Slide 46 text

IUNMFTDBQFͷ lࠩҧ͚ͩz ஌Γ͍ͨ git  diff -­‐-­‐word-­‐diff-­‐regex

Slide 47

Slide 47 text

$  git  diff  -­‐-­‐word-­‐diff-­‐regex=    '(<)|(&)|(>)|(")|(')'    -­‐-­‐color  -­‐-­‐ignore-­‐all-­‐space    -­‐-­‐word-­‐diff=plain    -­‐-­‐no-­‐index  -­‐-­‐    #{normal}  #{htmlsafe}

Slide 48

Slide 48 text

No content

Slide 49

Slide 49 text

No content

Slide 50

Slide 50 text

http://www.flickr.com/photos/aizaz/3512778599/ $  ./script/escape_spec        spec/**/*

Slide 51

Slide 51 text

$  bundle  exec  rake  cookpad:spec

Slide 52

Slide 52 text

$  bundle  exec  rake  cookpad:spec ......FFF...................... ...............F...FFF......... ............................... ............................... ....FFF........................ ............................... ..............................F ..............................F ............................... ..............FF............... ............................... ...............F.F............. ....FFFFFF..................... ......................F..F.....

Slide 53

Slide 53 text

$  bundle  exec  rake  cookpad:spec ......FFF...................... ...............F...FFF......... ............................... ............................... ....FFF........................ ............................... ..............................F ..............................F ............................... ..............FF............... ............................... ...............F.F............. ....FFFFFF..................... ......................F..F..... $  RAILS_ENV=production bundle  exec  rails  server

Slide 54

Slide 54 text

http://www.flickr.com/photos/naotakem/3524078643/ performance performance

Slide 55

Slide 55 text

http://www.flickr.com/photos/naotakem/3524078643/ performance performance performance

Slide 56

Slide 56 text

✓BC BQBDIFCFODI ✓+.FUFS http://www.flickr.com/photos/wwarby/3296379139/ #FODINBSL

Slide 57

Slide 57 text

݁Ռ 3VCZ ˣ 3&& UDNBMMPDແޮ ˣ 3&& UDNBMMPD ˣ

Slide 58

Slide 58 text

݁Ռ 3VCZ ˣ 3&& UDNBMMPDແޮ ˣ 3&& UDNBMMPD ˣ ஗͍

Slide 59

Slide 59 text

଎͕͞଍Γͳ͍ʂʂ

Slide 60

Slide 60 text

ʮͦΜͳ࣌͸ϓϩϑΝΠϦϯάͷ࣌ؒͰ͢Ͷɻʯ

Slide 61

Slide 61 text

No content

Slide 62

Slide 62 text

Α͘Θ͔Βͳ͍

Slide 63

Slide 63 text

ຖճωοΫͱͳΔ ৔ॴ͕มΘΔ ($

Slide 64

Slide 64 text

Passenger ↓ Unicorn

Slide 65

Slide 65 text

Unicorn module   Unicorn::OobGC

Slide 66

Slide 66 text

GC timing request GC

Slide 67

Slide 67 text

GC timing request GC.start GC.disable

Slide 68

Slide 68 text

GC timing

Slide 69

Slide 69 text

GC timing FAST

Slide 70

Slide 70 text

   disabled  =  GC.enable    GC.start    GC.disable  if  disabled after_fork  do  |server,  worker|    GC.disable  if  RAILS_ENV=='production'

Slide 71

Slide 71 text

No content

Slide 72

Slide 72 text

No content

Slide 73

Slide 73 text

No content

Slide 74

Slide 74 text

150% fast !

Slide 75

Slide 75 text

http://www.flickr.com/photos/adamkr/4650637393/ ύϑΥʔϚϯε ղܾʂʂ

Slide 76

Slide 76 text

!NJSBLVJ ✓3BJMTߴ଎Խ ✓ϓϩϑΝΠϥ ✓6OJDPSO ✓Ωϟογϡ ✓ύϯμ

Slide 77

Slide 77 text

$  bundle  exec  rake  cookpad:spec ............................... .....................F......... ............................... ............................... .....F......................... ............................... ............................... ............................... ............................... ............................... ............................... ............................... ............................... .........................F.....

Slide 78

Slide 78 text

࠷ऴ ֬ೝ ✓

Slide 79

Slide 79 text

ςετͰ ൃݟͰ͖ͳ͍໰୊Λ Ͳ͏ղܾ͢Δ͔

Slide 80

Slide 80 text

✓ຊ൪ϦΫΤετΛ ࣮ࡍʹྲྀ͢

Slide 81

Slide 81 text

em-proxy https://github.com/igrigorik/em-proxy EventMachine Proxy DSL for writing high-performance transparent / intercepting proxies in Ruby.

Slide 82

Slide 82 text

em-proxy app Rails 2.3 app Rails 3.0 (readonly) proxy request only https://github.com/igrigorik/em-proxy/blob/master/examples/duplex.rb dup request

Slide 83

Slide 83 text

[app-­‐rails-­‐3.0] $  tail  -­‐f  produciton.log  |  grep  500

Slide 84

Slide 84 text

$  bundle  exec  rake  cookpad:spec ............................... ............................... ............................... ............................... ............................... ............................... ............................... ............................... ............................... ............................... ............................... ............................... ............................... ...............................

Slide 85

Slide 85 text

/FYU 4UFQ ࣍ͷ ֬ೝεςοϓ

Slide 86

Slide 86 text

Ұ෦Ϣʔβʹ ࣮ࡍʹϦϦʔε͢Δ

Slide 87

Slide 87 text

໰୊ ͳ͠ʁ 3BJMT ✓ςετ ✓ύϑΥʔϚϯε ✓ෳ੡ϦΫΤετ

Slide 88

Slide 88 text

Cookie:   r3balance=xxx YYY͕ಛఆ஋ͷ ϢʔβΛ3BJMT ʹྲྀ͢

Slide 89

Slide 89 text

✓4FTTJPO4UPSF$BDIF γϦΞϥΠζܗࣜͷҧ͍ ✓.Z42-΁ͷ ͓͔͠ͳNBTUFS΁ͷΫΤϦ ✓+BWB4DSJQUΤϥʔ ൃݟ

Slide 90

Slide 90 text

✓ςετ ✓ύϑΥʔϚϯε ✓ෳ੡ϦΫΤετ ✓࣮ΞΫηε

Slide 91

Slide 91 text

ϦϦʔε࡞ۀ ✓ςετ ✓ύϑΥʔϚϯε ✓ෳ੡ϦΫΤετ ✓࣮ΞΫηε

Slide 92

Slide 92 text

AWS EC2 app Rails 2.3 app Rails 2.3 app Rails 2.3 app Rails 2.3 x50 proxy app Rails 3.0 app Rails 3.0 app Rails 3.0 app Rails 3.0 x50

Slide 93

Slide 93 text

AWS EC2 app Rails 2.3 app Rails 2.3 app Rails 2.3 app Rails 2.3 x50 proxy app Rails 3.0 app Rails 3.0 app Rails 3.0 app Rails 3.0 x50

Slide 94

Slide 94 text

http://www.flickr.com/photos/skreuzer/4285271145/ ೥݄೔ 3BJMT ϦϦʔεʂʂ

Slide 95

Slide 95 text

http://www.flickr.com/photos/skreuzer/4285271145/ ೥݄೔ 3BJMT ϦϦʔεʂʂ େ͖ͳ ໰୊ͳ͠ʂ

Slide 96

Slide 96 text

http://www.flickr.com/photos/skreuzer/4285271145/ ೥݄೔ 3BJMT ϦϦʔεʂʂ ࡀͷ ஀ੜ೔ ʘ ?P? ʗ

Slide 97

Slide 97 text

2012

Slide 98

Slide 98 text

+ Sara Framework 2012

Slide 99

Slide 99 text

http://www.flickr.com/photos/norio_nomura/4713348873/ ࡼ ϑϨʔϜϫʔΫ

Slide 100

Slide 100 text

2TBSBGSBNFXPSLͬͯ "5XJUUFS#PPUTUSBQ Έ͍ͨͳ෺ͷ$00,1"%൛

Slide 101

Slide 101 text

ͳͥ 5XJUUFS#PPUTUSBQ Ͱ͸ͳ͍ͷʁ ͳͥ ಠࣗʹ࡞Δͷʁ

Slide 102

Slide 102 text

l$00,1"%z σβΠϯͷந৅Խ

Slide 103

Slide 103 text

l$00,1"%z Ͱ͸͜͏͋Δ΂͖ 6*69ͷந৅Խ

Slide 104

Slide 104 text

l$00,1"%σβΠϯz ͷந৅Խ 㾎σβΠϯͷ஌ࣝ 㾎6*69ͷ஌ࣝ 㾎͜͏͋Δ΂͖ͱ͍͏ߟ͑ 㾎$44 4BTT ͷ࣮૷ྗ

Slide 105

Slide 105 text

No content

Slide 106

Slide 106 text

!UJLFEB

Slide 107

Slide 107 text

http://www.flickr.com/photos/norio_nomura/4713348873/ ࡼ ϑϨʔϜϫʔΫ

Slide 108

Slide 108 text

Slide 109

Slide 109 text

Slide 110

Slide 110 text

Slide 111

Slide 111 text

Slide 112

Slide 112 text

σβΠϯΛ౰ͯΔ ෛ୲͕ݮগ ΑΓ෼ۀ͠΍͘͢

Slide 113

Slide 113 text

2012

Slide 114

Slide 114 text

2012 Android App + html5 (webview) - native

Slide 115

Slide 115 text

2012 2011 native html5

Slide 116

Slide 116 text

2012 2011 㾎3BJMT্Ͱͷػೳ։ൃɾΤϯδ χΞ୭Ͱ΋͍͡ΕΔ 㾎εϚʔτϑΥϯ޲͚IUNMͱಉ ࣌։ൃՄೳ 㾎OBUJWFͷػೳΛ࢖͏৔߹ɺ+4 Ͱ௨৴

Slide 117

Slide 117 text

2012 2011 㾎3BJMT্ͷ࣮૷Ͱػೳ։ൃɾΤ ϯδχΞ୭Ͱ΋͍͡ΕΔ 㾎εϚʔτϑΥϯϒϥ΢βͱಉ࣌ ։ൃՄೳ 㾎OBUJWFͷػೳΛ࢖͏৔߹ɺ+4 Ͱ௨৴ )5.-ʹౌ͚ͨͷ͸ ࣦഊͩͬͨ ϚʔΫ

Slide 118

Slide 118 text

2012 2011 㾎3BJMT্Ͱػೳ։ൃɾΤϯδχ Ξ୭Ͱ΋͍͡ΕΔ 㾎εϚʔτϑΥϯ޲͚IUNMͱಉ ࣌։ൃՄೳ 㾎OBUJWFͷػೳΛ࢖͏৔߹ɺ+4 Ͱ௨৴

Slide 119

Slide 119 text

2012 + fluentd

Slide 120

Slide 120 text

2012 + fluentd 㾎3BJMTΞϓϦέʔγϣϯαʔόͰͷ ϩάू໿ 㾎਺ඦ୆ͰՔಇ 㾎3VCZͰ࣮૷͞Ε͍ͯΔ 㾎3VCZͰϓϥάΠϯهड़

Slide 121

Slide 121 text

2012 + fluentd 㾎਺ඦ୆ͷ3BJMTΞϓϦέʔγϣϯ αʔόͰͷϩάू໿ 㾎3VCZͰ࣮૷ 㾎3VCZͰϓϥάΠϯهड़ http://www.slideshare.net/hotchpotch/20120204fluent-logging

Slide 122

Slide 122 text

2012 + fluentd 㾎਺ඦ୆ͷ3BJMTΞϓϦέʔγϣϯ αʔόͰͷϩάू໿ 㾎3VCZͰ࣮૷ 㾎3VCZͰϓϥάΠϯهड़

Slide 123

Slide 123 text

2012 + Code Review w/GHE

Slide 124

Slide 124 text

2012 + Code Review w/GHE 㾎ຖ݄໿ݸͷQVMMSFRVFTU

Slide 125

Slide 125 text

2012 + Code Review w/GHE 㾎ຖ݄໿ݸͷQVMMSFRVFTU 㾎৺Թ·Δ΄ͬ͜ΓϨϏϡʔ͔Β

Slide 126

Slide 126 text

2012 + Code Review w/GHE 㾎ຖ݄໿ݸͷQVMMSFRVFTU 㾎৺Թ·Δ΄ͬ͜ΓϨϏϡʔ͔Β 㾎ϞώΧϯͷි౤͛·Ͱ

Slide 127

Slide 127 text

2012 + Code Review w/GHE 㾎ຖ݄ݸͷQVMMSFRVFTU 㾎৺Թ·Δ΄ͬ͜ΓϨϏϡʔ͔Β 㾎ϞώΧϯͷි౤͛·Ͱ ˡ3VCZίϛολ ˡ3VCZίϛολ

Slide 128

Slide 128 text

2012 + Code Review w/GHE 㾎ຖ݄ݸͷQVMMSFRVFTU 㾎৺Թ·Δ΄ͬ͜ΓϨϏϡʔ͔Β 㾎ϞώΧϯͷි౤͛·Ͱ

Slide 129

Slide 129 text

2012 + Code Review w/GHE 9/15 (sat) LT @takai Code Review in Action

Slide 130

Slide 130 text

2012 + Code Review w/GHE 9/15 (sat) LT @takai Code Review in Action

Slide 131

Slide 131 text

2012 + Distributed CI

Slide 132

Slide 132 text

2012 + Distributed CI

Slide 133

Slide 133 text

2012 + Distributed CI

Slide 134

Slide 134 text

2012 + Distributed CI 㾎૿͑ଓ͚Δςετ 㾎ऴΘΒͳ͍ܧଓతΠϯςάϨʔγϣϯ 㾎Ͳ͏΍ͬͯ෼ࢄ34QFDΛ҆ఆͤ͞Δ͔ 㾎"84&$Λར༻ͨ͠αʔόͷࣗಈॖୀ

Slide 135

Slide 135 text

2012 + Distributed CI 9/16 (sun) 10:30 @mrkn Distributed RSpec

Slide 136

Slide 136 text

+ AWS + Chanko (open source) + kuroko (new batch system) + IMon (new monitoring system) etcetc...

Slide 137

Slide 137 text

2011 ↓ 2012

Slide 138

Slide 138 text

ఏڙ

Slide 139

Slide 139 text

͝ਗ਼ௌ ͋Γ͕ͱ͏͍͟͝·ͨ͠ Thank You