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
290
みんなに知って欲しい 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
8
7.7k
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.7k
理想的なマイクロサービスアーキテクチャを目指す継続的改善 / Re-architecturing of Microservices #CNDT2019
south37
10
14k
gcpc: Google Cloud Pub/Sub Client for Ruby #tqrk13
south37
1
770
実行計画から学ぶ PostgreSQL の内部動作とクエリ最適化 / Learn PostgreSQL from Explain
south37
8
39k
学びを得るための新卒 ISUCON / New Grad ISUCON for Learning
south37
4
42k
Other Decks in Programming
See All in Programming
テストコード文化を0から作り、変化し続けた組織
kazatohiei
2
1.5k
Semantic Kernelのネイティブプラグインで知識拡張をしてみる
tomokusaba
0
180
Keeping it Ruby: Why Your Product Needs a Ruby SDK - RubyWorld 2024
envek
0
190
短期間での新規プロダクト開発における「コスパの良い」Goのテスト戦略」 / kamakura.go
n3xem
2
170
PHPUnitしか使ってこなかった 一般PHPerがPestに乗り換えた実録
mashirou1234
0
220
Cloudflare MCP ServerでClaude Desktop からWeb APIを構築
kutakutat
1
550
ドメインイベント増えすぎ問題
h0r15h0
2
350
PHPとAPI Platformで作る本格的なWeb APIアプリケーション(入門編) / phpcon 2024 Intro to API Platform
ttskch
0
260
ある日突然あなたが管理しているサーバーにDDoSが来たらどうなるでしょう?知ってるようで何も知らなかったDDoS攻撃と対策 #phpcon.2024
akase244
0
130
fs2-io を試してたらバグを見つけて直した話
chencmd
0
240
ブラウザ単体でmp4書き出すまで - muddy-web - 2024-12
yue4u
3
480
毎日13時間もかかるバッチ処理をたった3日で60%短縮するためにやったこと
sho_ssk_
1
130
Featured
See All Featured
The Language of Interfaces
destraynor
154
24k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
Unsuck your backbone
ammeep
669
57k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
66k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
Become a Pro
speakerdeck
PRO
26
5k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
We Have a Design System, Now What?
morganepeng
51
7.3k
Keith and Marios Guide to Fast Websites
keithpitt
410
22k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
Product Roadmaps are Hard
iamctodd
PRO
49
11k
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͠Α͏ʂ