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
Bot開発でRubyを学ぶ / Learn Ruby with Bot Development
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
bake0937
July 17, 2019
Programming
0
490
Bot開発でRubyを学ぶ / Learn Ruby with Bot Development
2019.07.17 📅 Otemachi.rb #19
bake0937
July 17, 2019
Tweet
Share
More Decks by bake0937
See All by bake0937
GASを使って非エンジニアが AWS Step Functions を 操作できる仕組みの紹介 / Introducing how non-engineers can operate AWS Step Functions using GAS
bake0937
1
480
CircleCI の有料プランを導入するためにやったこと/What I did to introduce CircleCI's paid plan
bake0937
0
1.8k
FlutterアプリのiOSビルドとアーカイブを CircleCI で自動化してみた / Tried automating the iOS build and archive of the Flutter app with CircleCI
bake0937
0
1.3k
Probot で学ぶ TypeScript / Learn with Probot TypeScript
bake0937
0
210
Amazon ECR を利用していたと思ったら、Docker Hub を利用し続けていた / If I thought I was using Amazon ECR, I continued to use Docker Hub
bake0937
0
1k
Jest + Puppeteer によるE2Eテストで確認作業を短縮してみた / End-to-end testing by Jest + Puppeteer shortened the confirmation work
bake0937
0
720
所属企業の Advent Calendar を初めて作った時に学んだこと / What I learned when I first created my company's Advent Calendar
bake0937
1
850
Notion 📚 へ移行して 3ヶ月経った振り返り / Looking back at Notion after 3 months
bake0937
0
5.9k
小さく始めるOSS活動
bake0937
0
140
Other Decks in Programming
See All in Programming
ロボットのための工場に灯りは要らない
watany
11
3.1k
Angular-Apps smarter machen mit Gen AI: Lokal und offlinefähig - Hands-on Workshop!
christianliebel
PRO
0
130
Fundamentals of Software Engineering In the Age of AI
therealdanvega
2
290
ふつうの Rubyist、ちいさなデバイス、大きな一年
bash0c7
0
1.1k
API Platformを活用したPHPによる本格的なWeb API開発 / api-platform-book-intro
ttskch
1
150
AIコードレビューの導入・運用と AI駆動開発における「AI4QA」の取り組みについて
hagevvashi
0
550
Laravel Nightwatchの裏側 - Laravel公式Observabilityツールを支える設計と実装
avosalmon
1
140
Agentic AI: Evolution oder Revolution
mobilelarson
PRO
0
190
SourceGeneratorのマーカー属性問題について
htkym
0
210
ベクトル検索のフィルタを用いた機械学習モデルとの統合 / python-meetup-fukuoka-06-vector-attr
monochromegane
2
510
条件判定に名前、つけてますか? #phperkaigi #c
77web
2
690
AI活用のコスパを最大化する方法
ochtum
0
290
Featured
See All Featured
So, you think you're a good person
axbom
PRO
2
2k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
200
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
500
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.6k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
210
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
310
Build your cross-platform service in a week with App Engine
jlugia
234
18k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
76
Designing Experiences People Love
moore
143
24k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
410
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
Transcript
Bot開発でRubyを学ぶ 岡部 恭平 / Mynavi Corporation 2019.07.17 Otemachi.rb #19
IT戦略事業部 IT開発統括部 ITマネジメント2部 開発1課(マイナビニュース) 岡部恭平 @okabeeeat Webアプリケーションエンジニア
マイナビニュース
マイナビニュースを支える技術
本題
最近の悩み 個人的な悩み • 普段、業務で Rails を書いている • Ruby は確かに書いてはいるが、あくまでレールに乗った上で書いているためRuby 自体を使いこなせてるか不安になる時がある
• 急に独自のクラスやモジュールを書くぞ!ってなった時に焦る 業務でのちょっとした悩み • GitHub の Issue 作成など画面でポチポチする系の作業が面倒だと感じる時があ る
そうだ! Botを作ろう
選定したBotフレームワーク • Ruboty ◦ https://github.com/r7kamura/ruboty ◦ カスタマイズ性が高い ◦ 国産で導入事例やナレッジ、様々なプラグインがある •
タイミングを見て Lita でも Bot を作って検証してみたい ◦ Lita: https://github.com/litaio/lita
導入はこんなに簡単 ① Bot の追加と API トークンを取得 ② Ruboty のインストールと起動 ③確認
作ったBot なぜなぜベア • マイナビベアが Slack 上で GitHub の Issue 名を「なぜなぜ分析※1」し、
Issue を磨いてくれ る Bot • マイナビベアはユーザに対して「なぜなぜ」を 5回繰り返す • マイナビベアは 5回目の「なぜなぜ」で GitHub の Issue を作成する ◦ Octokit.rb で GitHub API を実行し Issue を作成する ◦ https://github.com/octokit/octokit.rb • まずは最低限の機能のみを実装する ※1 イシューからはじめよ ― 知的生産の「シンプルな本質」 第一章より
実装してみた(一部)
動かしてみた
Issueができた
Botを作ってみて • 久しぶりに「 Rails から離れた Ruby 」が書けた ◦ Rails が偉大なフレームワークであることを再認識した
◦ あれ? 結局フレームワークに縛られてる !? ▪ Bot フレームワーク無しで作ってみたら更に勉強になりそう ▪ ディレクトリ構成の検討、クラス・モジュールの設計・実装 ...色々勉強になりそう! • 以下のようなモチベーションを得た →オリジナルサービス開発していた時のように Bot に愛着が湧く → Bot に色んな機能を実装したい → Ruby をもっと勉強したい → Ruby 書くのが楽しい!! • Octokit.rb が驚くほど便利だった • 今回のような要領で Gem 作りもやれば良いのでは ? という気づきを得た
今後 • 業務で使えるレベルの品質にする ◦ 例外処理の追加 ◦ リファクタリング • 普段の業務が楽になる機能をドンドン追加する •
AWS や Heroku にデプロイしてみる
参考 • チャットボットフレームワーク Ruboty を振り返る ◦ https://medium.com/@r7kamura/%E3%83%81%E3%83%A3%E3%83%83%E3%83%88%E3%83%9C%E3%83%83%E 3%83%88%E3%83%95%E3%83%AC%E3%83%BC%E3%83%A0%E3%83%AF%E3%83%BC%E3%82%AF-ruboty-% E3%82%92%E6%8C%AF%E3%82%8A%E8%BF%94%E3%82%8B-be95e56d2400 •
5分でできるRubotyのインストールとプラグインチュートリアル ◦ https://48n.jp/blog/2016/07/29/first-step-ruboty/ • Botsインテグレーションを使って手軽にRubotyをSlackで動かす ◦ https://48n.jp/blog/2016/08/02/ruboty-and-slack/ • Ruboty | Brain ボットの脳にデータを記憶 #ruboty #chatops ◦ https://qiita.com/tbpgr/items/74027b2aa3d6a6a575a7 • Octokit で GitHub の Issue を作成する ◦ http://tbpgr.hatenablog.com/entry/2016/12/09/234718
!?
We're Hiring!!! https://www.wantedly.com/projects/301633 https://www.wantedly.com/projects/325946 エンジニア 開発ディレクター