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
ぺろぺろ - Github pull request bot framework -
Search
mzp
February 11, 2017
2
3.1k
ぺろぺろ - Github pull request bot framework -
名古屋Ruby会議 03
mzp
February 11, 2017
Tweet
Share
More Decks by mzp
See All by mzp
アイドルとして勤務する -理論と実践- / Work as cute idol. - theory & practice - #imas_hack
mzp
2
18k
日本語入力の落とし穴
mzp
4
14k
アイマスハッカソン 2017-ライブの感動を再現する
mzp
1
2.3k
The reason for using reason
mzp
2
2.9k
Love💕LivePhotos
mzp
0
1.4k
日本語入力とLisp
mzp
1
3.2k
Amazon EC2 スポットインスタンスを開発環境にする話
mzp
0
1.5k
クラウドサービスを活用した開発環境
mzp
1
3.2k
Rubyistのための型入門
mzp
20
5.9k
Featured
See All Featured
Testing 201, or: Great Expectations
jmmastey
40
7.1k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Unsuck your backbone
ammeep
669
57k
Optimizing for Happiness
mojombo
376
70k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
Building Your Own Lightsaber
phodgson
103
6.1k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Gamification - CAS2011
davidbonilla
80
5.1k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
95
17k
Visualization
eitanlees
146
15k
It's Worth the Effort
3n
183
28k
The World Runs on Bad Software
bkeepers
PRO
65
11k
Transcript
ΖΖ N[Q (JUIVCQVMMSFRVFTUCPUGSBNFXPSL
None
None
w ίϯϑϦΫτʹؾ͍ͨΒڭ͑ͯ͋͛Α͏ w ίϝϯτͨ͠Β4MBDLͰ͑Α͏ w ϨϏϡʔΛґཔ͢Δͱ͖4MBDLͰ͑Α͏ w
ӡ༻ϧʔϧͷCPUԽ " ➡ ࠓͷςʔϚ
͍ํ
%FQMPZUPIFSPLV
8FCIPPLͷઃఆ
ΧελϚΠζ source 'https://rubygems.org' gem 'prpr' gem 'prpr-slack' gem 'prpr-mention_comment' gem
'prpr-checklist' gem 'prpr-conflict_label' # <= ه
طଘϓϥάΠϯͷհ
QSQSDIFDLMJTU
None
QSQSNFOUJPO@DPNNFOU
None
QSQSHFNpMF
QSQSDPOqJDU@MBCFM
·ͱΊ طଘϓϥάΠϯͷհ w QSQSDIFDLMJTUνΣοΫϦετͷߘ w QSQSNFOUJPO@DPNNFOU4MBDLͷίϝϯτసૹ w QSQSHFNpMF(FNpMFMPDLͷEJ⒎දࣔ w QSQSDPOqJDU@MBCFMDPOqJDUͷՄࢹԽ
.JTPDB։ൃϑϩʔͱͷ ౷߹
8*1 ϨϏϡʔ Ϛʔδ σϓϩΠ
w ૬ޓʹϨϏϡʔ͢Δ w جຊతʹ4MBDLͰΓͱΓΛ͢Δ IUUQTSFDSVJUNJTPDBKQ ৄࡉͪ͜Β
QSQSSFWJFX@MBCFM
QSQSMHUN
None
QSQSNFSHFE
σϓϩΠ CPUʹσϓϩΠΛґཔ͢Δ σϓϩΠ༻ͷϓϧϦΫΤετ͕࡞͞ΕΔ Ϛʔδ͢ΔͱɺσϓϩΠ͞ΕΔ
QSQSDPEF@EFQMPZ DPNNJUJE
·ͱΊ .JTPDB։ൃϑϩʔͱͷ౷߹ w QSQSSFWJFX@MBCFMϨϏϡʔґཔ w QSQSMHUN-(5.ͷՄࢹԽ w QSQSNFSHFEϚʔδ௨ w QSQSDPEF@EFQMPZσϓϩΠ
ઌߦࣄྫ
None
None
ϓϥάΠϯͰ֦ுͰ͖ΔCPU w IVCPU w 3VCPUZ w
ઃܭ
ඪ w HFNʹΑΔ֦ு w ཧऀҎ֎ઃఆมߋͰ͖ΔΑ͏ʹ͢Δ w IFSPLVͰಈ࡞͢Δ w ͬ͞͞ͱಈ͔͢
ߏ http CLI Handler Action Publisher GithubAPI ઃఆ ϓϥάΠϯ ίΞ
ྫ)BOEMFS class Prpr::Handler::Merged < Prpr::Handler::Base handle Event::PullRequest, action: /closed/ do
Prpr::Action::Merged::Merged.new(event).call end end
ྫ"DUJPO class Prpr::Action::Merged < Prpr::Action::Base def call if merged?
Publisher::Adapter::Base.broadcast message end end private def merged? !!event.pull_request.merged_at end .....
ྫ"DUJPO def message Prpr::Publisher::Message.new(body: body, from: from, room: room)
end def body env.format(:merged_body, event.pull_request) end def from event.sender end def room env[:merged_room] end
Βͳ͔ͬͨ͜ͱ w 8FC6*Λ࡞Βͳ͍ w #JUCVDLFU(JU-BCͷ͜ͱΕΔ
໋໊
Α͔ͬͨͱ͜Ζ w HFNԽͨ͠ͷͰɺϓϥάΠϯͱͷڥ͕໌֬ʹͳͬ ͨ w $-*Ͱಈ࡞͢ΔΑ͏ʹͨ͠ͷͰςετָ͕ w ֎෦"1*Λୟ͘෦͕ϓϥάΠϯͳͷͰɺຊମͷς ετָ͕
ۤ࿑ͨ͠ w (JUIVCͷ৽ػೳ͕ͳ͔ͳ͔"1*ʹͳΒͳ͍ w PDUPLJUʹ͍Βͳ͍ w େྔͷHFNTQFDΛॻ͘ͷ͕μϧ͍
·ͱΊ w ϓϧϦΫΤετ༻CPUϑϨʔϜϫʔΫΛ࡞ͬͨ w .JTPDBͷ։ൃϑϩʔʹࠐ·Ε͍ͯΔ w ֦ு͍͢͠Α͏ʹίϯϙʔωϯτׂ͞Ε͍ͯΔ