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
みんなに知って欲しい Meguro.rb
Search
Nao Minami
July 29, 2018
Programming
0
280
みんなに知って欲しい Meguro.rb
東急 Ruby 会議 #12 LTで、前半は meguro.rb の紹介、後半は yard2steep の紹介 LT をしました!
Nao Minami
July 29, 2018
Tweet
Share
More Decks by Nao Minami
See All by Nao Minami
Real World Migration from HTTP to gRPC #CNDT2020
south37
3
5.7k
Real World Migration from HTTP to gRPC in Ruby #grpcconf
south37
2
4.3k
Getting Things Done をベースにした仕事の進め方 / How to Work with Getting Things Done
south37
7
7.6k
Web API に秩序を与える Protocol Buffers / Protocol Buffers for Web API #builderscon
south37
18
16k
puma v4 では SIGTERM での worker process ゾンビ化に気をつけよう / Be aware of zombie processes in puma v4
south37
0
3.6k
理想的なマイクロサービスアーキテクチャを目指す継続的改善 / Re-architecturing of Microservices #CNDT2019
south37
10
14k
gcpc: Google Cloud Pub/Sub Client for Ruby #tqrk13
south37
1
750
実行計画から学ぶ PostgreSQL の内部動作とクエリ最適化 / Learn PostgreSQL from Explain
south37
8
38k
学びを得るための新卒 ISUCON / New Grad ISUCON for Learning
south37
4
41k
Other Decks in Programming
See All in Programming
Why Spring Matters to Jakarta EE - and Vice Versa
ivargrimstad
0
610
cXML という電子商取引の トランザクションを支える プロトコルと向きあっている話
phigasui
2
2k
とにかくAWS GameDay!AWSは世界の共通言語!.pdf / Anyway, AWS GameDay! AWS is the world's lingua franca!
seike460
PRO
0
160
シールドクラスをはじめよう / Getting Started with Sealed Classes
mackey0225
3
350
Vue.js学習の振り返り
hiro_xre
2
130
飲食業界向けマルチプロダクトを実現させる開発体制とリアルな現状
hiroya0601
1
370
PagerDuty を軸にした On-Call 構築と運用課題の解決 / PagerDuty Japan Community Meetup 4
horimislime
1
100
ECSのサービス間通信 4つの方法を比較する 〜Canary,Blue/Greenも添えて〜
tkikuc
10
2.2k
Honoの来た道とこれから
yusukebe
19
3k
『ドメイン駆動設計をはじめよう』のモデリングアプローチ
masuda220
PRO
4
150
役立つログに取り組もう
irof
24
7.7k
Go言語でターミナルフレンドリーなAIコマンド、afaを作った/fukuokago20_afa
monochromegane
2
140
Featured
See All Featured
Facilitating Awesome Meetings
lara
49
6k
Bash Introduction
62gerente
608
210k
YesSQL, Process and Tooling at Scale
rocio
167
14k
BBQ
matthewcrist
85
9.3k
Speed Design
sergeychernyshev
24
560
Designing on Purpose - Digital PM Summit 2013
jponch
115
6.9k
Why Our Code Smells
bkeepers
PRO
334
57k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
Producing Creativity
orderedlist
PRO
341
39k
Building Your Own Lightsaber
phodgson
102
6k
Fashionably flexible responsive web design (full day workshop)
malarkey
404
65k
The Cost Of JavaScript in 2023
addyosmani
45
6.2k
Transcript
©2018 Wantedly, Inc. 29.Jul.2018 - Nao Minami (@south37) ΈΜͳʹͬͯཉ͍͠ YARD
Ͱ੩తܕ͖ Ruby ʢyard2steepʣ
©2018 Wantedly, Inc. 29.Jul.2018 - Nao Minami (@south37) ΈΜͳʹͬͯཉ͍͠ YARD
Ͱ੩తܕ͖ Ruby ʢyard2steepʣ ͱࢥͬͨΜͰ͕͢ɻɻɻ
©2018 Wantedly, Inc. 29.Jul.2018 - Nao Minami (@south37) ΈΜͳʹͬͯཉ͍͠ YARD
Ͱ੩తܕ͖ Ruby ʢyard2steepʣ Ͱແཧͦ͏ʂ
©2018 Wantedly, Inc. 29.Jul.2018 - Nao Minami (@south37) ΈΜͳʹͬͯཉ͍͠ Meguro.rb
©2018 Wantedly, Inc. ࣗݾհ
©2018 Wantedly, Inc. Nao Minami / @south37, @minami7o Infrastructure engineer
@ Wantedly, Inc.
©2018 Wantedly, Inc. .FHVSPSCͬͯ·͢ʂ
©2018 Wantedly, Inc.
©2018 Wantedly, Inc. ࠇۙลɻɻɻʁʁʁ
©2018 Wantedly, Inc. ҆͝৺͍ͩ͘͞ʂ
©2018 Wantedly, Inc. ࠇ֓೦ʂ
©2018 Wantedly, Inc. w ࠇӺ۠ʢʁʣ w .FHVSPSCനۚɾޒా Ͱ։࠵ʢʁʣ
©2018 Wantedly, Inc. ࠇʹڥքແ͍ʂ
©2018 Wantedly, Inc. ໌ޙΞΧπΩ͞ΜΦϑΟεͰ ։࠵ͳͷͰੋඇ͝ࢀՃ͍ͩ͘͞ʂ
©2018 Wantedly, Inc.
©2018 Wantedly, Inc. DPOOQBTTͰNFHVSPSCͰݕࡧʂ
©2018 Wantedly, Inc. എܠ ZBSETUFFQͷ͝հ ·ͱΊ ࠓ͢༰
©2018 Wantedly, Inc. ಥવͰ͕͢ɻɻɻ
©2018 Wantedly, Inc.
©2018 Wantedly, Inc. 3VCZ,JHJ ྑ͔ͬͨͰ͢Ͷʂ
©2018 Wantedly, Inc. ৭ʑͳτʔΫ͕͋Γ·͕ͨ͠ɺ 4UFFQͱ͍͏ʮ੩తܕ͚πʔϧʯ͕ ҹʹΓ·ͨ͠
©2018 Wantedly, Inc.
©2018 Wantedly, Inc. 4UFFQͱ w 3VCZʹରͯ͠੩తܕ͚͕ग़དྷΔπʔϧ w ܕఆٛϑΝΠϧͱ3VCZίʔυ͔ΒɺܕݕࠪΛߦ͏ w ܕఆٛϑΝΠϧಠࣗจ๏
w 3VCZʹࣅ͍ͯΔ͕ɺܕΛද͢ઐ༻ه๏͕͋Δ
©2018 Wantedly, Inc. 4UFFQͷܕఆٛϑΝΠϧ class Person @name: String @contacts: Array<Email
| Phone> def initialize: (name: String) -> any def name: -> String def contacts: -> Array<Email | Phone> def guess_country: -> (String | nil) end
©2018 Wantedly, Inc. 4UFFQͷ1SPT$POT w 1SPT w 3VCZͰ੩తܕݕ͕ࠪग़དྷΔʂιϑτΣΞ։ൃͷॿ͚ʹͳͬͯ͘ΕΔʂ w $POT
w ܕఆٛϑΝΠϧͷઐ༻จ๏Λ֮͑Δඞཁ͕͋Δ w ܕఆٛϑΝΠϧΛ͔Βॻ͘ͷ͕େมʂ w ATUFFQTDB⒎PMEAίϚϯυ͕ॿ͚ʹͳͬͯ͘ΕΔ͕ɻɻɻ
©2018 Wantedly, Inc. Կ͔ྑ͍ํ๏ແ͍͔ʁ
©2018 Wantedly, Inc. 3VCZͰܕͱ͍͑:"3%ʜ :"3%ͰܕνΣοΫΛߦ͑ྑ͍ͷʁ
©2018 Wantedly, Inc. ͱ͍͏͜ͱͰɺ πʔϧΛ࡞ͬͯΈͨ
©2018 Wantedly, Inc.
©2018 Wantedly, Inc.
©2018 Wantedly, Inc. ZBSETUFFQ
©2018 Wantedly, Inc. എܠ ZBSETUFFQͷ͝հ ·ͱΊ ࠓ͢༰
©2018 Wantedly, Inc. ZBSETUFFQͱ w 3VCZϓϩάϥϜதͷ:"3%Ξϊʔςʔγϣϯ ͔Βɺ4UFFQͷܕఆٛϑΝΠϧΛࣗಈੜ w 4UFFQͱΈ߹ΘͤΔࣄͰɺ:"3%Ͱ੩తܕݕ ࠪΛ࣮ݱʂ
©2018 Wantedly, Inc. %&.0
©2018 Wantedly, Inc. 3VCZίʔυΛ༻ҙ͢Δ # lib/parser.rb class AST # @return
[String] def to_s "AST" end # @param [Hash] opt def traverse!(opt) end end class Parser # @param [String] text # @param [Hash] opt # @return [AST] def parse(text, opt) ast = AST.new ast.traverse!(opt) ast end end
©2018 Wantedly, Inc. ZBSETUFFQίϚϯυΛ࣮ߦ $ yard2steep lib ZBSETUFFQͰܕఆٛϑΝΠϧΛੜ # sig/parser.rbi
class AST def to_s: -> String def traverse!: (Hash<any, any>) -> any end class Parser def parse: (String, Hash<any, any>) -> AST end
©2018 Wantedly, Inc. TUFFQͰܕνΣοΫ $ steep check lib ܕݕ͕ࠪ௨ΕɺԿग़ྗ͞Εͳ͍
©2018 Wantedly, Inc. Ͱɺܕݕ͕ࣦࠪഊ͢ΔέʔεͲ͏ͩΖ͏ʁ
©2018 Wantedly, Inc. ܕݕࠪͰࣦഊͤͯ͞ΈΔ # lib/parser.rb class AST # @return
[String] def to_s "AST" end # @param [Hash] opt def traverse!(opt) end end class Parser # @param [String] text - # @param [Hash] opt + # @param [Hash, nil] opt # @return [AST] - def parse(text, opt) + def parse(text, opt: nil) ast = AST.new ast.traverse!(opt) ast end end
©2018 Wantedly, Inc. ܕݕࠪͰࣦഊͤͯ͞ΈΔ $ yard2steep lib && steep check
lib lib/parser.rb:18:18: ArgumentTypeMismatch: receiver=::AST, expected=::Hash<any, any>, actual=(::Hash<any, any> | nil) (opt) ZBSETUFFQͱTUFFQΛΈ߹ΘͤͯܕνΣοΫ ͪΌΜͱɺAOJMAνΣοΫ͍ͯ͠ͳ͍ίʔυͰΤϥʔ ͕ग़ͨʂ
©2018 Wantedly, Inc. :"3%Ͱ੩తܕݕ͕ࠪग़དྷͯΔʂ
©2018 Wantedly, Inc. ࠷ۙͷΞοϓσʔτ w ϦϦʔεޙϲ݄Ͱͬͨ͜ͱ w BUUS@SFBEFSͳͲɺ3VCZͷΈࠐΈͷNFUBQSPHSBNNJOHܥͷػೳΛTVQQPSU w 3VCZQBSTFSͷվળ
ࣗલ࣮3JQQFSϕʔεҠߦ w ఆͷܕ͚ w FUD w Γ͍ͨ͜ͱ w :"3%BOOPUBUJPOͷϦονͳه๏Λαϙʔτ w BUSS@XSJUFS BUUS@BDDFTTPSͳͲͷTVQQPSU
©2018 Wantedly, Inc. എܠ ZBSETUFFQͷ͝հ ·ͱΊ ࠓ͢༰
©2018 Wantedly, Inc. ·ͱΊ w :"3%Ͱ੩తܕݕ͕ࠪͰ͖ΔΑ͏ʹͳͬͨʂ w 4UFFQͱZBSETUFFQΛΈ߹ΘͤΔࣄͰ࣮ݱ w BOZܕ͕͋ΔͷͰɺগͣͭ͠ಋೖ͕Մೳ
w ͜Ε͔Βɺ3VCZͰ)BQQZ)BDLJOH͠Α͏ʂ