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.7k
理想的なマイクロサービスアーキテクチャを目指す継続的改善 / Re-architecturing of Microservices #CNDT2019
south37
10
14k
gcpc: Google Cloud Pub/Sub Client for Ruby #tqrk13
south37
1
760
実行計画から学ぶ PostgreSQL の内部動作とクエリ最適化 / Learn PostgreSQL from Explain
south37
8
39k
学びを得るための新卒 ISUCON / New Grad ISUCON for Learning
south37
4
41k
Other Decks in Programming
See All in Programming
最新TCAキャッチアップ
0si43
0
140
Jakarta EE meets AI
ivargrimstad
0
600
リアーキテクチャxDDD 1年間の取り組みと進化
hsawaji
1
220
C++でシェーダを書く
fadis
6
4.1k
ピラミッド、アイスクリームコーン、SMURF: 自動テストの最適バランスを求めて / Pyramid Ice-Cream-Cone and SMURF
twada
PRO
10
1.3k
ヤプリ新卒SREの オンボーディング
masaki12
0
130
詳細解説! ArrayListの仕組みと実装
yujisoftware
0
580
OnlineTestConf: Test Automation Friend or Foe
maaretp
0
110
ActiveSupport::Notifications supporting instrumentation of Rails apps with OpenTelemetry
ymtdzzz
1
230
NSOutlineView何もわからん:( 前編 / I Don't Understand About NSOutlineView :( Pt. 1
usagimaru
0
330
Arm移行タイムアタック
qnighy
0
320
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
1
100
Featured
See All Featured
The Invisible Side of Design
smashingmag
298
50k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
840
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
28
2k
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.3k
Typedesign – Prime Four
hannesfritz
40
2.4k
A better future with KSS
kneath
238
17k
BBQ
matthewcrist
85
9.3k
GitHub's CSS Performance
jonrohan
1030
460k
10 Git Anti Patterns You Should be Aware of
lemiorhan
654
59k
Git: the NoSQL Database
bkeepers
PRO
427
64k
Writing Fast Ruby
sferik
627
61k
Raft: Consensus for Rubyists
vanstee
136
6.6k
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͠Α͏ʂ