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
Rubyの標準添付ライブラリを開発する
Search
Soutaro Matsumoto
May 24, 2024
Programming
2
140
Rubyの標準添付ライブラリを開発する
Nextbeat Tech Bar:第一回ライブラリ開発について考える会 (
https://nextbeat.connpass.com/event/312789/
)
Soutaro Matsumoto
May 24, 2024
Tweet
Share
More Decks by Soutaro Matsumoto
See All by Soutaro Matsumoto
Embedding it into Ruby code
soutaro
4
18k
Parsing RBS
soutaro
0
1.4k
Ruby programming with types in action
soutaro
4
860
IDE Development with Ruby
soutaro
4
1k
Ruby 3の新機能としての静的型検査の開発
soutaro
4
7.1k
An Introduction to Static Typing in Ruby 3
soutaro
3
380
The State of Ruby 3 Typing
soutaro
0
680
Ruby3 is a typed language
soutaro
0
350
Ruby Hack Challenge Holiday #8
soutaro
0
570
Other Decks in Programming
See All in Programming
Exploring: Partial and Independent Composables
blackbracken
0
100
Go の GC の不得意な部分を克服したい
taiyow
3
800
テストケースの名前はどうつけるべきか?
orgachem
PRO
0
140
CSC305 Lecture 26
javiergs
PRO
0
140
htmxって知っていますか?次世代のHTML
hiro_ghap1
0
340
モバイルアプリにおける自動テストの導入戦略
ostk0069
0
110
Kaigi on Railsに初参加したら、その日にLT登壇が決定した件について
tama50505
0
100
Spatial Rendering for Apple Vision Pro
warrenm
0
110
これが俺の”自分戦略” プロセスを楽しんでいこう! - Developers CAREER Boost 2024
niftycorp
PRO
0
190
Асинхронность неизбежна: как мы проектировали сервис уведомлений
lamodatech
0
840
range over funcの使い道と非同期N+1リゾルバーの夢 / about a range over func
mackee
0
110
KubeCon + CloudNativeCon NA 2024 Overviewat Kubernetes Meetup Tokyo #68 / amsy810_k8sjp68
masayaaoyama
0
260
Featured
See All Featured
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
17
2.3k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
132
33k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.9k
Optimising Largest Contentful Paint
csswizardry
33
3k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Unsuck your backbone
ammeep
669
57k
Docker and Python
trallard
42
3.1k
Git: the NoSQL Database
bkeepers
PRO
427
64k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
66k
Visualization
eitanlees
146
15k
It's Worth the Effort
3n
183
28k
Transcript
3VCZͷ ඪ४ఴϥΠϒϥϦΛ։ൃ͢Δ দຊफଠ!TPVUBSP
!TPVUBSP w 3VCZίϛολʔ w 3VCZͷܕΛ͍ͬͯΔ w 4UFFQ w 3#4 w
גࣜձࣾλΠϛʔ দຊफଠ
3VCZͷඪ४ϥΠϒϥϦ
3VCZͷඪ४ϥΠϒϥϦ w ৄ͘͠3VCZ,BJHJͷ)JSPTIJ4)*#"5"ͷτʔΫΛݟͯ w IUUQTSVCZLBJHJPSHQSFTFOUBUJPOTITCUIUNMEBZ w πʔϧ w ྨ
πʔϧ w HFN w 3VCZ༻ͷϥΠϒϥϦͷ͜ͱ w 3VCZ(FN w HFNΛΠϯετʔϧ͢Δπʔϧɺϗετ͍ͯ͠ΔαʔϏε w
#VOEMFS w ͲͷHFNΛΠϯετʔϧ͢Δ͔ΛϓϩδΣΫτຖʹཧ͢Δπʔϧ
$ gem install rbs ↑ rbsͱ͍͏gemʢϥΠϒϥϦʣͱͦͷґଘΛΠϯετʔϧ $ bundle install ↑
Gemfileͱ͍͏ϑΝΠϧͷઃఆʹैͬͯɺϓϩδΣΫτ͕ґଘ͢ΔgemΛΠϯετʔϧ
#VOEMFSͷϦϦʔε )JSPTIJ4)*#"5" 3VCZ,BJHJ .BWFOͷϦϦʔε
ඪ४ఴϥΠϒϥϦͷྨ w ΈࠐΈFNCFEEFE w 4UBOEBSEMJCSBSZHFNʹͳ͍ͬͯͳ͍ϥΠϒϥϦͨͪ w %FGBVMUHFNT࠷ॳ͔ΒΠϯετʔϧ͞Ε͍ͯΔHFN w #VOEMFEHFNT࠷ॳ͔ΒΠϯετʔϧ͞Ε͍ͯΔHFN🤔
)JSPTIJ4)*#"5" 3VCZ,BJHJ
IUUQTHJUIVCDPNSVCZSVCZCMPCBEEEEFDGDDEFFEFGHFNTCVOEMFE@HFNT
SCTHFNͷ։ൃ
SCTHFNͷ։ൃ w 3VCZ͔Β#VOEMFEHFNͷҰͭ w 3VCZͱผͷϦϙδτϦͰɺ3VCZDPSFͱಠཱͯ͠։ൃΛߦ͍ɺ3VCZ DPSFͱಠཱͯ͠৽͍͠όʔδϣϯΛϦϦʔε͠ɺ3VCZΛΠϯετʔϧ͢Δ ͱಉ࣌ʹΠϯετʔϧ͞ΕΔ
ͦͦ3#4ͱ w 3VCZϓϩάϥϜͷܕΛදݱ͢Δ ͨΊͷݴޠͱͦͷॲཧΛ͢Δͨ ΊͷϥΠϒϥϦ w IUUQTHJUIVCDPNSVCZSCT w SCTHFNͷதʹɺ3VCZͷΈ ࠐΈϥΠϒϥϦͷܕఆ͕ٛೖͬ
͍ͯΔ
3#4ͷλʔήοτ w 3#4·ͩ։ൃ్தͳͷͰɺ3VCZΑΓසൟʹϦϦʔε͞ΕΔ w ͦͷͨΊ࠷৽ͷϦϦʔε൛3VCZ Λલఏͱͯ͠։ൃ͞Ε͍ͯΔ w 3#4ʹؚ·Ε͍ͯΔඪ४ϥΠϒϥϦͷܕϦϦʔε൛ͷ3VCZલఏ w
͞Βʹɺ։ൃ൛ͷ3VCZ ʹ3#4ؚ·ΕΔ w ͭ·Γʜʜʁʁʁ
·͋·͋յΕΔ
ͳΜͰյΕΔʁ w 3#4ͷΈࠐΈϥΠϒϥϦͷܕΛ֬ೝ͢Δςετ͕յΕΔ w SVCZSVCZϦϙδτϦͰ$*ͰCVOEMFEHFNͷςετΛ࣮ߦ͢ΔΑ͏ʹͳ ͍ͬͯΔ w ϝιου͕ফ͑ͨΓɺҾͷॲཧ͕ඍົʹมΘͬͨΓ͢Δ w ී௨ͷ3VCZϓϩάϥϜʹӨڹ͕ͳ͍͕ɺ3#4ͷςετʹӨڹ͢Δ
ྫ*0XBJUͷฦΓͷܕ͕มΘͬͨ w self | bool | nil͔ΒInteger | false |
nilʹͳͬͨ
͔ͳΓΊΜͲ͍͘͞ 3#4ͷςετΛमਖ਼͢Δ w 3#4ͷܕఆٛ։ൃ൛͕ϦϦʔε͞Ε͔ͯΒߋ৽͢Δ ৽͍͠3#4ΛϦϦʔε͢Δ ৽͘͠ϦϦʔεͨ͠3#4Λͬͯ3VCZͷ$*Λճ͢ ͬͯͳ͔ͬͨΒ͔ΒΓ͠
ରࡦ w SCTHFNΛϦϦʔε͠ͳͯ͘3VCZͷ$*ͰςετͰ͖ΔΑ͏ʹ͢Δ w ίϛοτΛॻ͍͓ͯ͘ͱɺͦΕΛͬͯςετ͢Δ w 3VCZͷ$*͕Δ͜ͱΛ֬ೝ͔ͯ͠ΒSCTHFNΛϦϦʔε͢Δ
ରࡦ w SVCZSVCZͷதʹ͋Δrbs_skip_testsΛฤू͢ΔͱɺSCTHFNͷςετ ΛεΩοϓͰ͖ΔΑ͏ʹͨ͠ w SCTHFNͷमਖ਼ΛͨͣʹSVCZSVCZͷ$*͕ΔΑ͏ʹͳͬͨ
·ͱΊ w ·͋·͋େม w ։ൃ൛ͷ3VCZͱϦϦʔε൛ͷ3VCZΛࠞͥΔͱ͜Ζʹແཧ͕͋Δ w ʮ҆ఆ͍ͯ͠ͳ͍͔Β3VCZΑΓߴසͰϦϦʔε͍ͨ͠ʯͱ͍͏ཁ͕݅ ࠔ͞Λ૿͍ͯ͠Δ w ݹ͔͘Β͋ΔϥΠϒϥϦΛHFNʹͨͭ͠ɺރΕ͍ͯΔͷͰͦΜͳʹେม
Ͱͳͦ͞͏