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
メドピアの輪読会
Search
motsat
January 23, 2018
Programming
2
1.2k
メドピアの輪読会
2018/1/18 メドピア株式会社 × 株式会社みんなのウェディング合同勉強会、「サービスを Ruby / Rails で成長させるためにやったこと」の発表資料です。
motsat
January 23, 2018
Tweet
Share
More Decks by motsat
See All by motsat
「SmartHR基本機能」の溜まっていく技術課題への取り組み
motsat
0
1.3k
Elasticsearchで多言語検索対応してみた話.pdf
motsat
2
1.3k
Other Decks in Programming
See All in Programming
rbs-inlineを導入してYARDからRBSに移行する
euglena1215
1
290
全部見せます! クラシルリワードのSwiftTesting移行プロジェクト
uetyo
0
210
React + TextAliveでカッコいいLyric Applicatioinを作ろう!!
tosuri13
0
400
はじめてみよう量子プログラミング
itokoichi01
0
220
KSPの導入・移行を前向きに検討しよう!
shxun6934
PRO
0
280
Ruby Parser progress report 2024
yui_knk
2
230
Prompt Cachingは本当に効果的なのか検証してみた.pdf
ttnyt8701
0
530
あなたのアプリ、ログはでてますか?あるいはログをだしてますか? (Funabashi.dev用 軽量版)
uzulla
2
120
A New Era of Testing
mannodermaus
2
510
[DroidKaigi 2024] Android ViewからJetpack Composeへ 〜Jetpack Compose移行のすゝめ〜 / From Android View to Jetpack Compose: A Guide to Migration
syarihu
1
650
Jakarta EE meets AI
ivargrimstad
1
530
LangChainの現在とv0.3にむけて
os1ma
4
930
Featured
See All Featured
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
45
4.8k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
0
120
GitHub's CSS Performance
jonrohan
1030
450k
Git: the NoSQL Database
bkeepers
PRO
425
64k
The Language of Interfaces
destraynor
153
23k
Code Review Best Practice
trishagee
62
16k
WebSockets: Embracing the real-time Web
robhawkes
59
7.3k
Building a Modern Day E-commerce SEO Strategy
aleyda
36
6.8k
What’s in a name? Adding method to the madness
productmarketing
PRO
21
3k
Making the Leap to Tech Lead
cromwellryan
128
8.8k
For a Future-Friendly Web
brad_frost
174
9.3k
Build The Right Thing And Hit Your Dates
maggiecrowley
30
2.3k
Transcript
αʔϏεΛ Ruby / Rails Ͱ ͤ͞ΔͨΊʹͬͨ͜ͱ
ࣗݾհ ɹɾ໊લ ɹɹࠤ౻ ݩل ɹɾϝυϐΞྺ ɹɹ 2017/9 ʙ WebΤϯδχΞɹɹ ɹɹʢ࠷ۙElasticsearchɺAWS
SNSͰPush௨पΓʣ ɹɾͦͷલ ɹɹ- Ruby on Rails/ C++ (ιʔγϟϧήʔϜ) ɹɹ- PHP Maple/ΦϨΦϨ (ձһ੍ಈըܥαʔϏε)
ϝυϐΞͷྠಡձ
લஔ͖ ϝυϐΞͷݱঢ়
ҩࢣઐ༻αΠτʮMedPeerʯ
Ruby on Rails (৽ڥ)ͱ PHP on ಠࣗϑϨʔϜϫʔΫ(چڥ) ͕ڞଘ
ฐࣾϒϩά: ɹϨΨγʔͳಠࣗϑϨʔϜϫʔΫ͔Β٫ͯ͠RailsঃʑʹҠߦ ͍ͯ͠Δ http://tech.medpeer.co.jp/entry/2017/01/31/004227
PHP͔ΒRuby on Railsͷ Ҡߦελʔτ1.5લ
RubyΤϯδχΞ : 10ਓத2ਓ
Ҡߦͷҝʹ ɾPHP͍ͬͯΔਓ͕RubyΛ࢝ΊͨΓ ɾRubyະܦݧऀ͕ೖͬͨΓʢܦݧऀೖͬͨΓʣ
Ruby/Railsͷܦݧগͳ͍ਓ͔Βଟ͍ਓ·Ͱ ෯͍ҝɺRuby/RailsΛϝΠϯʹͷҝ ͷऔΓΈΛߦ͍ͬͯ·͢ɻ
ԬRubyձٞ: ɹϝυϐΞͷશྗRailsԽͷऔΓΈࡽ͠·͢! ( by CTO fukumura ) https://speakerdeck.com/fukumura/metohiafalsequan-li- railshua-falsequ-rizu-mishai-simasu
ओͳऔΓΈ ɾίʔυϨϏϡʔʢRailsܦݧଟ͍ਓͷϨϏϡʔʣ ɹ2017ʹ࢝ΊͨϝυϐΞΤϯδχΞνʔϜͷ৽͍͠औΓΈʹ͍ͭͯ ɹhttp://tech.medpeer.co.jp/entry/2017/12/27/180000 ɾ։ൃ߹॓ ɹ։ൃ߹॓!?ͦΕͳΒϖϯγϣϯͰ͠ΐ!! ʙ܈അݝΈͳ͔ΈொͷϝυϐΞ։ൃ߹॓ࢽʙ ɹ http://tech.medpeer.co.jp/entry/2017/12/06/110000
ओͳऔΓΈ ɾKPTͰؾʹͳΔϨϏϡʔΛৼΓฦΔ ɾಡॻձʢྠಡձʣ
ྠಡձ ɾͲ͏͍ͬͯΔ͔ ɾྑ͔ͬͨ/ѱ͔ͬͨࣄ
ྠಡձͱ ਓʑ͕ू·ͬͯɺಉ͡ڭՊॻͳͲͷຊΛಡΈɺͦͷ ༰ʹ͍ͭͯҙݟΛަΘ͢͜ͱΛҙຯ͢Δޠ
Ұਓಡॻͷྑ͍ॴ ɾ͖ͳ࣌ʹಡΊΔ ɾ͖ͳॴͰಡΊΔ ɾ͖ͳϖʔεͰಡΊΔʢௐͨΓɺࢼ ͨ͠Γ ɾͬͯΔॴඈͤΔ
ྠಡձ > Ұਓͷಡॻ ͱ͍͏Θ͚Ͱͳ͍
ྠಡձͱ ਓʑ͕ू·ͬͯɺಉ͡ڭՊॻͳͲͷຊΛಡΈɺͦ ͷ༰ʹ͍ͭͯҙݟΛަΘ͢͜ͱΛҙຯ͢Δޠ (weblioΑΓ) →ྠಡձͷதͰɺಛʹ͜ͷதͰྑ͔ͬͨ෦ͷ
ϝυϐΞͰͷΓํ ຊ͝ͱʹΓํม͑ͨΓ͍ͯ͠Δ͕ɺ ɾ1ਓ1߲ɺԻಡ͢Δ ɾಡΜͩॴͷ࣭ٞʢແ͍࣌͋Δʣ ɾ൪੍Ͱൃදऀ͕ઌʹ༰·ͱΊͨΓ ɹˠΓํ·ͩࡧத
༷ࢠ
ϝυϐΞͷΑ͏ʹɺ ɾRuby/Railsͷܦݧ →·ͪ·ͪ ɾϝυϐΞྺ → ·ͪ·ͪ ɾಉ͡ιʔείʔυʢϦϙδτϦʣ৮Δࣄ͕ଟ͍ ͱ͍͏ঢ়گͰɺ ྠಡձܗ͕ࣜྑ͔ͬͨͳͱࢥ͏ࣄྫͷհ
ྫ1 RailsGuides https://railsguides.jp/ ʢຊͱݴ͏͔αΠτͰ͕͢ʣ
ͳΜͰ͜ͷຊʹ͔ͨ͠ ɾRailsͷػೳΛମܥతʹΘ͔Γ͘͢հ͍ͯͯ͠ɺ ܦݧ(গ)ͳ͍ਓʹͱ͖͍ͬͭ͢
͜ͷຊͷྠಡձͰ͋ͬͨٞ
Action Controller ͷ֓ཁ (8.ϑΟϧλ) ࣭ٞ ʮControllerͷfillterɺonly͘͠exceptͰࢦఆ͢Δ ߹ɺͲͪΒΛ͏ʁʯ ʮͱΓ͋͑ͣ҆શଆʹΕΔํ͕ྑͦ͞͏ʯ ɹ
ɾܦݧগͳ͍ਓ ɹػೳ + ͏ஈ֊ʹͳͬͯ໎͏෦ΛઌʹҙࣝͰ͖ ͨ ɾͦΕҎ֎ͷਓ ɹνʔϜͰͲ͏͢Δ͔ͷҙࣝΛ߹ΘͤΔ͜ͱ͕ Ͱ͖ͨ ɹ
ྫ2 Everyday Rails - RSpec ʹΑΔRailsςετೖ
ͳΜͰ͜ͷຊʹ͔ͨ͠ ςετΛRSpecͰॻ͍͍͕ͯͨɺ ɾςετͷཻ͕ҧͬͨΓ ɾਖ਼͍͠ॻ͖ํͰ͖ͯΔ͔ո͍͠ʢଞͷΛਅࣅ͍ͯΔ͚ͩʁʣ ͱ͍͏ͷղফͷҝ
͜ͷຊͷྠಡձͰ͋ͬͨٞ
7.ίϯτϩʔϥεϖοΫͷΫϦʔϯΞοϓ ࣭ٞ ʮShared Examples ɺॏෳഉআͰ͖ͯྑ͍ʯ ʮॲཧ͕ݟ͑ʹ͘͘ͳΔ໘͋ΔɻݟͮΒ͘ͳΒͳ͍͔ߟ͑ ͯͬͨํ͕ྑ͍ʯ
ɾܦݧগͳ͍ਓ ɹػೳ+ܦݧऀͷͭΒΈΛઌʹΕͨ ɾͦΕҎ֎ͷਓ ɹνʔϜͰͲ͏͢Δ͔ɺҙࣝ߹ΘͤͰ͖ͨ
?.??(Ͳͷষ͔ͩͬͨΕ·ͨ͠ʣ ࣭ٞ ʮRakeλεΫςετॻ͘ʁʯ ʮmodel()ʹϩδοΫҠৡͯͦ͠ΕΛݺͼग़͚ͩ͢ʹ ͍ͨ͠ʯ ʮͰtypoνΣοΫ͚ͩͷҝͰςετ͋ͬͨ΄͏͕҆ ৺ʯ
ܦݧଟ͍/গͳ͍ݶΒͣɺνʔϜͰ ͳΜͱͳ͘;Θͬͱ͍ͯͨ͠ॴ͕߹ ͑ͨɻ·ͨɺͦͷߟ͑Λڞ༗Ͱ͖ͨɻ
ྫ3ʣΦϒδΣΫτࢦઃܭ ࣮ફΨΠυͷ߹
ͳΜͰ͜ͷຊʹ͔ͨ͠ ɾRailsҠߦ͕গ͠ਐΈɺΦϒδΣΫτࢦ ઃܭతͳ෦Ͱ͕ݟ͖͑ͯͨͨΊ
͜ͷຊͷྠಡձͰ͋ͬͨٞ
ୈ̑ষɹμοΫλΠϐϯάͰίετΛݮ͢ Δ ࣭ٞ ʮμοΫλΠϐϯάා͍ɻJavaͳΒΠϯλʔϑΣʔεͱ͔͋Δͷʹʯ ɹɹɹɹɹ
ɾPHP/Ruby ܦݧऀ ɹ੩తܕ͚ݴޠͷܦݧऀͱײ֮ͷࠩΛײ͡Εͨ ɾJava ܦݧऀ ɹಉ͡ΦϒδΣΫτࢦͰɺ࣮ํ๏ʹ͔ͳΓࠩ ͕͋Δ͜ͱ͕Θ͔ͬͨ
4.5 σϝςϧͷ๏ଇ σϝςϧͷ๏ଇɺΦϒδΣΫτΛૄ݁߹ʹ͢Δ ͨΊͷنͷू·Γɻ͜ͷதͰҕৡग़ͯ͘Δɻ
4.5 σϝςϧͷ๏ଇ ࣭ٞ ʮҕৡɺActiveRecordͰΔͳΒdelegate͕͋Δʯ ʮdelegateɺϧʔϓͰN+1͕ൃੜ͢ΔՕॴΛݟམͱ͠ ͘͢ͳΔ͜ͱʯ
ຊRubyϝΠϯͳͷͰRailsActiveRecordʹ͍ͭͯ ৮Ε͍ͯͳ͍ ͕ɺ RailsΞϓϦ։ൃϝϯόʔͰͷಡॻձͩͬͨͷͰݱͰ ͏࣌ͷ͍ํؾΛ͚ͭΔϙΠϯτΛઌʹ͢͜ͱ͕Ͱ ͖ͨɻ
ୈ6ষ ܧঝʹΑͬͯৼΔ͍Λ֫ಘ͢Δ ࣭ٞ ʮܧঝͰඍົͳڞ௨Խ͕͞ΕͯͭΒ͍ॴ͕hogeॲཧʹ͋ Δʯ ʮڞ௨Խͨͩιʔείʔυ͕ಉ͔ͩ͡Βͬͯͬͯ͘ͱޙ ͰٯʹͭΒ͘ͳΔʯ
ಉ͡ιʔείʔυΛ৮Δϝϯόʔ͔Βɺ ۩ମతͳྫͷڞ༗ͱະདྷͷͭΒΈ͙͖͔͚͕ͬ Ͱ͖ͨɻ
͜Μͳײ͡ͰɺྠಡձΛ͢Δ ࣄͰຊͷ༰Ҏ֎ʹ͍Ζ͍Ζ ಘΔͷ͕͋Γ·ͨ͠
ྠಡձΛଓ͚ΒΕΔڥ
ɾ࣌ؒ ɹۀ࣌ؒɻਫ༵10:30ʙ11:30 ɹۀޙேૣ͗͢ΔͱɺͨͿΜࢀՃऀݮΔɻ ɹશһͷͨΊͷऔΓΈͰͳ͘ͳͬͯ͠·͏ɻ
ɾຊ ɹձࣾܦඅɻ1ਓ1ɺిࢠॻ੶Ͱ࣮ͰOKɻ ɹܦඅͰམͱͤͳ͍ͱΈΜͳͰಉ͡ຊΛݟΔͱ͍͏ ϋʔυϧ্͕Δɻ
ձࣾͷཧղ͕͋ͬͯͦ͜ ಛʹ ɾۀ࣌ؒʹΔ͜ͱ ຊಡΉͷ͕ۀͳͷʁͱɺΤϯδχΞҎ֎͕ී௨ʹٙΛײ͡Δؾ͕͢Δɻ ɹˠʮಡॻձ/ྠಡձʯ໊ͬͯલ͕ۀײग़ʹ͍͘ͷͰʮγεςϜ։ൃख๏ ʹ͍ͭͯͷhogeʯͷΑ͏ͳ໊લʹͨ͠Γۀײग़͢ͷ͋Γ͔ʁ
PRϖʔδ ϝυϐΞΤϯδχΞ׆ಈʹཧղ͋ΔձࣾͰ͢ɻ CTO fukumuraʮؤுͬͯܦӦਞઆಘͯͨ͠Ͷͬͯੲͷಉ྅͔ΒݴΘΕͨɻ ͦΜͳʹؤுͬͯͨͭΓແ͔ͬͨʯ ↓࠷ۙͷ࣮ ɹRuby25पه೦ΠϕϯτɺܦඅͰߦ͚·͢ʢϝυϐΞεϙϯαʔͬ ͯ·͢ʣ
ٞࣄ ɹ͋ͬͨํ͕ྑ͍ɻ ʢձͷதͰग़ͨࢀߟURLͳͲSlackʹషͬͨΓ͍ͯ͠·͢ʣ ɹɾܽ੮ऀ͕࣍ʹࢀՃ͍͢͠Α͏ʹ ɹɾΕͳ͍Α͏ʹ ɹɾະདྷͷϝϯόʔʹΘΔΑ͏ʹ ɹɾϒϩάωλ
ࢀՃϝϯόʔ ͓ʹରͯ͠ɺܦݧଟ͍ਓ͕͍ͨํ͕ྑ͍ ɾ࣭ɺٞΛͦͷͰղܾͰ͖Δ ɾຊ͚ͩͩͱແ͍ܦݧΛઌʹͤΔ ʢϝυϐΞɺٕज़ސwillnet͞ΜʹඞͣࢀՃͯ͠ Β͍ͬͯ·͢ʣ
ͲΜͳຊ͕ྑ͔͔ͬͨʢྑͦ͞͏͔ʣ 1.ͦͷͰ͋ΔఔཧղͰ͖Δ ɹ༧श͖͍ͯͯ͠ͳ͍લఏɻࢀՃϋʔυϧ্͛ͳ͍ɻ
ͲΜͳຊ͕ྑ͔͔ͬͨʢྑͦ͞͏͔ʣ 2.αϯϓϧίʔυ͕ϝΠϯͰͳ͍ ɹ͍αϯϓϧίʔυ͕͋Δͱɺͦ͜ͰཧղͰ͖Δਓ/Ͱ͖ͳ͍ਓ͕Ͱ͖ͯ ͍͢ɻ ɹࢀߟఔʹॻ͍ͯ͋ΔͷɺRails GuidesΈ͍ͨʹͯ͘ཧղ͍͢͠ ͷେৎɻ
ͲΜͳຊ͕ྑ͔͔ͬͨʢྑͦ͞͏͔ʣ 3.༰͕ຖճ݁͢Δͷ ɹܽ੮ɺهԱ͕ඈͿͳͲɺલͷ༰͕಄ʹͳ͍ͱ࣍ͷཧղ͕͍͠ɻ ɹʮ ΦϒδΣΫτࢦઃܭ࣮ફΨΠυʯɺ͖͍ͭ෦͋Δɻ
ͲΜͳຊ͕ྑ͔͔ͬͨʢྑͦ͞͏͔ʣ 4.ͦͷ࣌ඞཁͳͷ ɹRailsҠߦॳRailsΨΠυɺগ͠ܦͬͯઃܭʹվળ͕ݟ͖͑ͯͨΒ ɹʮΦϒδΣΫτࢦઃܭ࣮ફΨΠυʯͳͲɻ ɹཧղ͠ͳ͍ͱ·͍ͣ > ཧղ͍ͨ͠
՝ ɾਓ͕૿͑Δͱո͍͠ ɹࠓ10ਓఔ͕ͩɺਓ͕૿͑Δͱ͕ࣗಡΉ ॱ൪ճΓͮΒ͘ۓுײແ͘ͳΓձͮ͠Β ͘ͳΔؾ͕͢Δ ɹ
՝ ɾ໊લ͕ී௨͔ͩΒม͍͑ͨ ɹʮྠಡձʯΛΤοδ͕ޮ͍ͨײ͡ʹ
·ͱΊ ɾҰਓಡॻྑ͍͚Ͳྠಡձ͍͍ ɾຊʹॻ͍ͯ͋Δ͜ͱҎ֎͕ಘΒΕͨ ɹ- ܦݧʢऀͷʣ ɹ- ҧ͏ࢹ ɹ- ࣗͨͪͲ͏͍͔ͯ͘͠ ɾձࣾͷཧղʢۀ࣌ؒɺ͓ۚʣඞཁ
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠